• Welcome to Valhalla Legends Archive.
 

Winamp Control

Started by JaMi, January 15, 2003, 06:44 PM

Previous topic - Next topic

JaMi

Could anyone hook me up with a halfway decent wimamp mod for Vb? I've tried 2 or 3 different ones but they are overly buggy, and have the tendecy to produce mass error boxes, any help would be appreciated

Mesiah / haiseM

#1
just use an api spy and make ur own, its way more fun!
]HighBrow Innovations
Coming soon...

AIM Online Status: 

indulgence

#2
There is documentation on how to interact with Winamp 2.x at winamp dev site...

You just use SendMessage... really ez
<3

Yoni

#3
A year (exactly) old, but it should still work:
http://www.valhallalegends.com/yoni/SampleHDL.zip

JaMi

#4
thanx for the effort yoni, but that was for c++ and probablly wouldnt mesh together with the rest of my vb project very well :p

iago

#5
hmm.. I have one written in C++, but all it is is a few SendMessage calls.. I'll find you the source when I get home tonight, if you want.

All you have to do is declare SendMessage in VB, and the rest translates very nicely.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


iago

#6
Ok, sorry I took so long, I forgout about you :P

This is in c++, but it's really easy to convert it; all you really need are the SendMessages, and I would very much suggest you DO NOT do it this way, with the strcmp() at every line; that's just stupid, and I have to fix it :)

Without further ado, here is, quite possibly, the worst c++ code you'll ever see:

#define WS_VOLUMEUP 40058
#define WS_VOLUMEDOWN 40059
#define WS_PREV 40044
#define WS_NEXT 40048
#define WS_PLAY 40045
#define WS_PAUSE 40046
#define WS_STOP 40047
#define WS_FFWD 40060
#define WS_RWND 40061
#define MAX 128

bool Winamp(char *command)
{
      //A return value of 1 indicates good
      //0 means bad

      if(!(strcmp(command, "next")))
      {
            SendMessage(FindWindow("Winamp v1.x", NULL), WM_COMMAND, WS_NEXT, NULL);
            command = "song";
      }
      else if(!(strcmp(command, "prev")))
      {
            SendMessage(FindWindow("Winamp v1.x", NULL), WM_COMMAND, WS_PREV, NULL);
            command = "song";
      }
      else if(!(strcmp(command, "volup")))
      {
            SendMessage(FindWindow("Winamp v1.x", NULL), WM_COMMAND, WS_VOLUMEUP, NULL);
            return 1;
      }
      else if(!(strcmp(command, "voldown")))
      {
            SendMessage(FindWindow("Winamp v1.x", NULL), WM_COMMAND, WS_VOLUMEDOWN, NULL);
            return 1;
      }
      else if(!(strcmp(command, "play")))
      {
            SendMessage(FindWindow("Winamp v1.x", NULL), WM_COMMAND, WS_PLAY, NULL);
            command = "song";
      }
      else if(!(strcmp(command, "pause")))
      {
            SendMessage(FindWindow("Winamp v1.x", NULL), WM_COMMAND, WS_PAUSE, NULL);
            return 1;
      }
      else if(!(strcmp(command, "stop")))
      {
            SendMessage(FindWindow("Winamp v1.x", NULL), WM_COMMAND, WS_STOP, NULL);
            return 1;
      }
      else if(!(strcmp(command, "ffwd")))
      {
            SendMessage(FindWindow("Winamp v1.x", NULL), WM_COMMAND, WS_FFWD, NULL);
            return 1;
      }
      else if(!(strcmp(command, "rwnd")))
      {
            SendMessage(FindWindow("Winamp v1.x", NULL), WM_COMMAND, WS_RWND, NULL);
            return 1;
      }

      if(!strcmp(command, "song"))
      {
            char title[MAX];

            GetWindowText(FindWindow("Winamp v1.x", NULL), title, MAX);
            DisplayOnScreen(title);
            return 1;
      }
      return 0;
}
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


JaMi

#7
lol thank ya much that works rather well, with apispy + that id say i managed to make it work well enough that i dont get error's all the time anymore :p umm and since im on the topic, any help with accessing winamp's playlist for like searching through it for a certain song? or have i just not tinkered with the apispy long enough?

Atom

#8
tinker more. If that spy doesnt make it INCREDIBLY EASY ENOUGH for you then use patorjk's api spy, www.patorjk.com

it even generates the code for you, although the code isnt the cleanest
I am back! aINC is dead, ThinkTank PRO is alive.
VB, JAVA, ASM, C, its all yummy to me.

Mesiah / haiseM

#9
IIRC, winamp doesnt show the name of the song in the list, just the number, so youll only be able to search and play by its position in the playlist...
]HighBrow Innovations
Coming soon...

AIM Online Status: 

JaMi

#10
erm chewbot has `play *saliva*    type command so if thats not coming from winamp wheres it coming from?

Yoni

#11
QuoteA year (exactly) old, but it should still work:
http://www.valhallalegends.com/yoni/SampleHDL.zip
erm... *tries to figure out why I posted this here*
HDLs have nothing to do with winamp? ???

iago

#12
Well, you CAN use an HDL to control Winamp (maybe provide an even easier wrapper to catch messages), but it looks to me like you're just advertising :P
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*