Announcement

Collapse
No announcement yet.

Useful Info -> What info should you know when making plugins?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Some useful info I found in the audioscrobblers sources. I knew about the 666 message, but this explains it a little better. It is relative to the PE window. Credit to Spib from the audioscrobbler plugin for this.


    #define WA_STATE_CHANGE 0x0000029A

    PEWndproc:
    if(message == WM_USER)
    {
    if(wParam == WA_STATE_CHANGE)
    {
    int nType = HIWORD(lParam);
    int nTrack = LOWORD(lParam);
    // Ignore the double issue play message
    if(nType != 16384)
    return TRUE;
    if(SendMessage(m_hWndWinamp,WM_WA_IPC,0,IPC_ISPLAYING) == 1)
    {
    DWORD dwNow = GetTickCount();
    // Winamp Sends two quick song change notifications so
    // here we check if the last notification arrived less than
    // 400 milliseconds after the last in which case we ignore it.
    if((dwNow - m_dwLastPlay) < 400)
    {
    // Ignore second notifcation
    }
    else
    {
    m_dwLastPlay = dwNow;
    //Track changed
    }
    }
    }


    This is more useful than the 'PLAYING_FILE' IPC, as it also catches track changes within http streams. Be careful though, as it is called multiple times with http streams for the same title, so you need to check that it has actually changed.

    I think the 'GetLibraryWndIPC' or whatever it is plus the other library ipc calls should be added in ml.h or somewhere. I have written up a brief summary under 'Unodocmented APIs' [sic].
    Music Plugins

    Comment


    • #17
      Something useful now might be a how to compile using the Microsoft Visual C++ Toolkit 2003 that they recently released for free. Command line how to I mean, dunno. thought it sounded like an ok suggestion.

      Comment


      • #18
        SarCaSM: i'll see if i can have a play with it once i find and download it

        shaneh: ta, will document that as well as my version in a bit. as for the ml header, i'll add them into the version i'm making though i'll see if we can get the devs to better document the ml.h file (saves me some work as well)

        -daz
        WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

        Comment


        • #19
          wa_hotkeys.h... another one done and ready to go
          this should show how easy it is to add a global hotkey, enjoy

          -daz
          Attached Files
          WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

          Comment


          • #20
            Originally posted by DrO
            wa_hotkeys.h... another one done and ready to go
            this should show how easy it is to add a global hotkey, enjoy

            -daz
            if your plugin already has a window of some sort, it would be easier to set hotkey->wnd to your window instead... then there is no need to subclass winamp
            Album List for Winamp - Download: v1.43, v2.06, v2.07 beta
            Wallpaper for Playlist Editor - Download: v1.06

            Comment


            • #21
              Originally posted by Safai
              if your plugin already has a window of some sort, it would be easier to set hotkey->wnd to your window instead... then there is no need to subclass winamp
              very true, but it's only meant as a basic example (the window proc is just to show the message detection). reading through it should show that things can be tweaked to a per coders preference

              -daz
              WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

              Comment


              • #22
                How about an example of using winamp's dlg, for a none ml_ex plugin.... just a suggestion....although im sure most people could figure it out faily quickly.

                Comment


                • #23
                  Originally posted by Kaldo
                  How about an example of using winamp's dlg, for a none ml_ex plugin.... just a suggestion....although im sure most people could figure it out faily quickly.
                  do you mean skinned windows like winamp does? if so then gen_mandy (slightly delayed ) is what you might be looking for

                  -daz
                  WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

                  Comment


                  • #24
                    actually i am talking about wa_dlg.h....but if that is what gen_mandy uses then that would be a yes....not neccessarly skining the dlg....but just using winamps built in functions for a dlg. if it skins it for you already...then that would be a plus....im more or less just trying to get more information on using winamps built in functions for a dlg....it would actually save alot of time on coding a plugin for winamp as thats less code u have to write for your dlg's and what not... Thanks for the reply.

                    -kaldo

                    Comment


                    • #25
                      Winamp only allows to create the outer window skinned. Buttons and scroll bars etc have to be manually skinned by picking apart bitmaps and bitblting them around the place.
                      Music Plugins

                      Comment


                      • #26
                        im not actually refering to skining the dlg at all..im just trying to get more information on using winamps built in functions for a dlg for a plugin...like an example of showing how to use it, or more information on how to do it...

                        -kaldo

                        Comment


                        • #27
                          There are no built in functions for a dialog, you just create your own with CreateDialog, common controls and wndprocs etc. Any tutorial which shows you how to create a dialog using bare bones API calls will work, and is how it is done.
                          Music Plugins

                          Comment


                          • #28
                            Re: Skinning and Dialogs

                            How does the Media Library skin the scrollbars and the headers in the list-view. Does it subclass the scroll bar??

                            Re: Song change notifications
                            I just run some code in the WM_TIMER case in Winamp's subclass window procedure and compare the previous filename of playing song with the current. If it's not the same, then we have a song change. I previously did this in the WM_SETTEXT case since Winamp is changing it's Window title when the song playing changes.
                            Nullsoft should have implemented a more robust and efficient notifications API, like:
                            code:

                            notifyStruct notify;
                            notify.notifyhwnd = myhwnd;
                            notify.flags = NOTIFY_SONGCHANGE;
                            SendMessage(hwnd_winamp, WM_WA_IPC, (WPARAM)&notify, IPC_SETNOTIFICATION);

                            Which is NOT implemented now!

                            Comment


                            • #29
                              I suspect it does owner draw type stuff for the scrollbars etc.

                              The 666 message seems to be what winamp sends on a song change. Something sends it to the playlist whenever the title changes (ie includes everything, including 'buffering...' type stuff, internet stream title changes etc). As it is the nullsoft trademark '666' number Id suspect this is quite intentional, and has been there for a while. Its probably used internally to tell the different components about the new title. The newer 'playing_file' message doesnt catch stream title changes.

                              I dont like using a timer, as you are restricted by the resolution of the timer, have to do a strcmp every split second, which is redundant, and various other problems. You are better off just catching 666 in the playlist wndproc, as it is sent whenever there is a title change, and seems fairly compatible with all versions.
                              Music Plugins

                              Comment


                              • #30
                                I know that WM_TIMER is a bit redudant, but catching WM_SETTEXT is what I actually used in my NxS Balloon Tip plug-in. And to catch the '666' trick (number of the animal/devil) you would need to subclass the playlist window which I don't like to do as I'm not touching the playlist editor in NxS Balloon Tip. I know that checking the filename isn't a good solution as people may have the same song appearing multiple times in a row in the playlist, so I may very well investigate into the '666' trick. As I previously said: There should be a more staright-forward way of doing this.
                                Subclassing is not a robust way of doing things since there is a risk of interfering with other plug-ins then. A proper notification registration system must be implemented in Winamp's core.

                                Comment

                                Working...
                                X
                                😀
                                🥰
                                🤢
                                😎
                                😡
                                👍
                                👎