Valhalla Legends Forums Archive | General Programming | Yay new plugin

AuthorMessageTime
UserLoser.
well i was sort of bored, so i decided to create a Winamp control plugin for those of you that support BinaryChat Plugins. You can find it here.

/next - goes to next song
/back - goes to previous song
/play - plays winamp
/pause - pauses/unpauses winamp
/sop - goto start of playlist
/eop - goto start of playlist
/stop - stops winamp
/volup - volume up 1%
/voldown - volume down 1%
/rewind - go back 5 seconds
/forward - go forward 5 seconds
/display - displays current song
/show - sends current song to battle.net
/close - closes winamp

possibly more commands/features coming in the future, let me know of any bugs/suggestions and happy winamping :)

requirements:
------------------
BinaryChat Plugin Support (no brainer)
QueueChatMessage
WriteOutputTimestamp
WriteOutputString
SetOutputColor
November 10, 2003, 1:57 AM
Eibro
So how do you determine two loaded plugins will have no conflicting commands?
November 10, 2003, 2:01 AM
UserLoser.
I don't determine if commands conflict, which i'm pretty sure they don't, BCEL does ;D
November 10, 2003, 2:05 AM
Skywing
Comments:
1) Don't base your DLL at 0x10000000 because too many other DLLs are based there by default so you're virtually guaranteed a required relocation.
2) You might want to turn off frame pointer generation - did you enable optimizations?
3) Set the runtime library to multithreaded DLL instead of multithreaded to link to the shared msvcrt.dll/msvcr70.dll instead of including the CRT in your .bcp, which will significantly reduce program size.
November 10, 2003, 3:04 AM
UserLoser.
[quote author=Skywing link=board=5;threadid=3515;start=0#msg28415 date=1068433468]
Comments:
1) Don't base your DLL at 0x10000000 because too many other DLLs are based there by default so you're virtually guaranteed a required relocation.
2) You might want to turn off frame pointer generation - did you enable optimizations?
3) Set the runtime library to multithreaded DLL instead of multithreaded to link to the shared msvcrt.dll/msvcr70.dll instead of including the CRT in your .bcp, which will significantly reduce program size.
[/quote]

i have no clue how to do any of that, i have little C++ knowledge :P

Well I believe I did #3 correctly. Correct me please if i'm wrong:

Project->Settings->C/C++->Use run-time library->Mulithreaded DLL

Compiled it, size is now 97kb
November 10, 2003, 3:27 AM
j0k3r
Would there be any way for you to create a script that I can bind to my keyboard keys? It seems like you know what's going on here, and I just can't understand how to get commands for winamp or how to make scripts.
November 10, 2003, 3:28 AM
UserLoser.
[quote author=j0k3r link=board=5;threadid=3515;start=0#msg28420 date=1068434899]
Would there be any way for you to create a script that I can bind to my keyboard keys? It seems like you know what's going on here, and I just can't understand how to get commands for winamp or how to make scripts.
[/quote]

I actually thought of a KeyBinder, that read from some files like Keys.ini, for each keycode there was a setting to it, like keycode14=/time or something :P that'd require someone with more knowledge than me in C++, all i know is you'd use GetAsyncKeyState
November 10, 2003, 3:39 AM
dRAgoN
Suggestion if you want one,
I see you can close winamp how about setting it so you can open it aswell.

Just a thought.
November 10, 2003, 6:14 AM
iago
[quote author=UserLoser. link=board=5;threadid=3515;start=0#msg28423 date=1068435555]
[quote author=j0k3r link=board=5;threadid=3515;start=0#msg28420 date=1068434899]
Would there be any way for you to create a script that I can bind to my keyboard keys? It seems like you know what's going on here, and I just can't understand how to get commands for winamp or how to make scripts.
[/quote]

I actually thought of a KeyBinder, that read from some files like Keys.ini, for each keycode there was a setting to it, like keycode14=/time or something :P that'd require someone with more knowledge than me in C++, all i know is you'd use GetAsyncKeyState
[/quote]

You can also do it using DirectInput, but that would just be stupid :)

A system hook or global hook or whatever might be best, since that way you can change songs from anywhere, but I'm sure Skywing would argue that it's not since those are eww.
November 10, 2003, 8:25 AM
j0k3r
Lol Iago, I didn't mean regular keys. I have a microsoft Ergonomic keyboard and the buttons at the top only work for Windows Media Player and it will be a cold day in hell before I use that while playing games... Anyways I can bind the keys to program or files so that when I push them I can start up programs or do things... I think I could bind it to a script.

I also know that with EXE's... You can right click and go to shortcut and specify a shortcut.
November 10, 2003, 12:25 PM
Skywing
You should use RegisterHotKey to set a global keypress sequence instead of using a global hook. Note that there can be only one handler for a specific global hotkey per-desktop, and that hotkey will work even if some other program has focus. I wouldn't recommend using this...

A local hook would be acceptable use to catch keyboard input messages for the program in order to process your hotkey. However, you should be careful not to introduce conflicts with pre-existing accelerators - perhaps allow the user to define their own hotkey combination?

Note that you should not subclass a program window within a BCP, because this requires the user to unload your BCP in a certain order relative to any other BCPs that subclass windows or have the program crash. Hooks do not have this limitation.
November 10, 2003, 1:08 PM

Search