Announcement

Collapse
No announcement yet.

First Winamp general plugin (n00b needs help!)

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

  • First Winamp general plugin (n00b needs help!)

    Hey everyone!
    Ok, since I'm assuming that you've read the title, you all know that I need some help with creating my first Winamp plugin. I've downloaded the general plugin SDK and have no idea what does what (there are no helpful comments) so I have nowhere to start. I HAVE made an external "plugin" that basically lets you control Winamp using the keypad (I know others exist, but I wanted to do one myself). It isn't a windows program, just a simple DOS console one. Now, is there a way that I can use my existing code to create the plugin? Also, if someone would be willing to tell me how to create the actual DLL I would be very grateful. Incase you're wondering, I'm using Microsoft's Visual C++ 6.0 compiler.

    Thanks a ton for reading my novel
    gremlin

    P.S. If you don't feel like doing a lot of typing, you can just post a site or two that might be helpful. Thanks again.

  • #2


    Instead of adding the files in there add the files you got from the SDK.
    NSIS FAQ | NSIS Home Page | Donate $
    "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

    Comment


    • #3
      Where does my code go?

      Thanks for the site, it helped a lot, but my main problem still exists: I need to put my code into the plugin. Where does it go?

      Thanks again,
      Gremlin

      Comment


      • #4
        One more thing...

        Also, would it be possible to get a "blank" SDK, not something full of commands and things that I don't need?

        Thanks,
        Gremlin

        Comment


        • #5
          These two are the most important statements. In the first one you set the details for your plugin, version, name, init, config and quit functions (that Winamp will call). Later it will be filled by Winamp with Winamp's hWnd, and your DLL hInstance.
          The second exporeted function gives Winamp the struct from the line above so it can know what functions it should call.

          In those init, config, and quit (names that you can change) functions you can do whatever you want, that is, put your code.

          code:
          winampGeneralPurposePlugin plugin =
          {
          GPPHDR_VER,
          "",
          init,
          config,
          quit,
          };

          __declspec( dllexport ) winampGeneralPurposePlugin * winampGetGeneralPurposePlugin()
          {
          return &plugin;
          }

          NSIS FAQ | NSIS Home Page | Donate $
          "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

          Comment


          • #6
            Ok, thanks alot, that really cleared alot up for me, but now how do I get winamp to see my plugin? here's my code:

            code:
            #include <windows.h>
            #include "gen.h"

            int init();
            void config();
            void quit();

            winampGeneralPurposePlugin plugin =
            {
            GPPHDR_VER,
            "",
            init,
            config,
            quit,
            };


            int init()
            {
            return 0;
            }

            void config()
            {
            MessageBox(NULL,"Test config","Testing...",MB_YESNO);
            }

            void quit()
            {
            }


            __declspec( dllexport ) winampGeneralPurposePlugin * winampGetGeneralPurposePlugin()
            {
            return &plugin;
            }


            I know it's simple, but I'm just starting. What am I forgetting?

            Thanks,
            gremlin

            Comment


            • #7
              You have got to give it a name, or else you won't see it in the plugin list.
              NSIS FAQ | NSIS Home Page | Donate $
              "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

              Comment


              • #8
                Ok, by now I know you're probably thinking that I'm an idiot, but it still won't work. There's got to be something missing! Pleasa keep in mind that I've never done this before, ever. I have no idea of what is needed for a Winamp plugin.

                Thanks for the help,
                Gremlin

                Comment


                • #9
                  Just to make sure, this:

                  code:
                  winampGeneralPurposePlugin plugin =
                  {
                  GPPHDR_VER,
                  "",
                  init,
                  config,
                  quit,
                  };

                  should be this:

                  code:
                  winampGeneralPurposePlugin plugin =
                  {
                  GPPHDR_VER,
                  "my plugin name here",
                  init,
                  config,
                  quit,
                  };

                  I don't think you are an idiot, just a begginer, and that's OK. We all were begginers at the beggining

                  If it still doesn't word attach the entire code (all of the files) and I will have a look at it.
                  NSIS FAQ | NSIS Home Page | Donate $
                  "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

                  Comment


                  • #10
                    Hmm, I tried the above code as well, and even with a name, it doesn't do anything. It shows up in the Winamp plugins list as [NOT_LOADED]. I even added a MessageBox in the init() function, but it doesn't show up.

                    Comment


                    • #11
                      Well, that's good, I just hate asking so many questions, I find that some people get frustrated when I do. Yes, I did put the name of the plugin between those quotes, like in your example, but no, it still didn't work. I have attached the two files that get compiled for the plugin that I'm working on, (zipped, so I hope you have windows), so that you can see exactly what I'm working with. It's for Microsoft VC++ 6.0.

                      Thanks again for all your help,
                      gremlin

                      P.S.
                      My MSN email is [email protected]. If you have MSN Messenger, feel free to add me to your list, so that we can talk live. Thanks again.
                      Attached Files

                      Comment


                      • #12
                        Try adding this function:

                        code:
                        BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
                        {
                        return TRUE;
                        }

                        Also try to build in Release mode rather than debug.
                        NSIS FAQ | NSIS Home Page | Donate $
                        "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

                        Comment


                        • #13
                          I got it! Sorry, but I didn't use your code exactly. I pretty much just opened up the gen_minisdk that I downloaded, then stripped away the useless stuff until I got the bare minimum needed to have a working plugin. Actually, it looks almost exactly like what you've given me. Email me if you need a more detailed explanation ([email protected]). I do have a new question though, which will be going in its own post, but I figure what the hey, why not ask it here first: When I capture keyboard events, how do I stop them from continuing to Winamp? Here's an example of what is happening, which I don't want:

                          Normally in Winamp the 0 (zero) key on the numpad opens the Open File dialog box. In my plugin I make the 0 (zero) key stop whatever is playing (if anything is playing). But, when I press 0 (zero), first it stops the playing (my code does that, so there's no problem there), then it opens the Open File dialog box! I know that there is a way to stop the key presses from actually getting to Winamp, but how?

                          Thanks alot for all of your help,
                          gremlin

                          Comment


                          • #14
                            Is that a hotkey or just key processing in Winamp?

                            Anyway, you need to subclass Winamp and prevent it from getting the message.
                            NSIS FAQ | NSIS Home Page | Donate $
                            "I hear and I forget. I see and I remember. I do and I understand." -- Confucius

                            Comment


                            • #15
                              I'm pretty sure that it's a hotkey, but I'm not positive. Also, what do you mean by subclass, and how would I go about doing it?

                              Thanks,
                              gremlin

                              Comment

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