• Welcome to Valhalla Legends Archive.
 

Yay new plugin

Started by UserLoser., November 09, 2003, 07:57 PM

Previous topic - Next topic

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

Eibro

So how do you determine two loaded plugins will have no conflicting commands?
Eibro of Yeti Lovers.

UserLoser.

I don't determine if commands conflict, which i'm pretty sure they don't, BCEL does ;D

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.

UserLoser.

#4
Quote from: Skywing on November 09, 2003, 09:04 PM
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.

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

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.
QuoteAnyone attempting to generate random numbers by deterministic means is, of course, living in a state of sin
John Vo

UserLoser.

Quote from: j0k3r on November 09, 2003, 09:28 PM
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.

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

l)ragon

Suggestion if you want one,
I see you can close winamp how about setting it so you can open it aswell.

Just a thought.
*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*ˆ¨¯¯¨ˆ*^~·.,l)ragon,.-·~^*ˆ¨¯¯¨ˆ*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*

iago

Quote from: UserLoser. on November 09, 2003, 09:39 PM
Quote from: j0k3r on November 09, 2003, 09:28 PM
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.

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

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.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


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.
QuoteAnyone attempting to generate random numbers by deterministic means is, of course, living in a state of sin
John Vo

Skywing

#10
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.