Main > Audio/Jukebox/MP3 Forum
Plugins: Document API for JukePlugSys
unclet:
My thoughts regarding Max/MinVolume and PageFlipLeft/Right commands were simply to supply the plugin with what the software is doing at the particular moment. I have no idea what a plugin would do with PageFlipLeft/Right or whether any plugin would like to know Max/MinVolume, but then I really do not care what a plugin author does .... I just wanted to supply the plugin author with as many routines as possible so their imagination can "run wild". Basically, the very reason of me not knowing how a plugin author would ever use these commands is what makes me want to include them. :)
unclet:
For an initial release ...... this is what I would like to do with my jukebox software for plugin support:
I will expect the plugin author to implement one routine called "Juke_PluginCommand()" with "command name" and "command value" strings as interface parameters. The "command value" obviously holds information related to the "command name".
Here are the list of routines along with the values for each below:
The "cmdValue" is simply a text string in which all data is separated by an "@" character.
--- Quote ---int Juke_PluginCommand(String cmdName, String cmdValue)
cmdName cmdValue
-------------------------------------------------------------------------------
JUKE_APPLICATION_OPENED n/a
JUKE_APPLICATION_CLOSED n/a
JUKE_PLUGIN_CONFIGURE n/a
JUKE_SONG_STARTED name@artist@album@albumNum@trackNum@totalDurationSecs@
JUKE_SONG_FINISHED n/a
JUKE_SONG_RESTARTED n/a
JUKE_SONG_SKIPPED n/a
JUKE_SONG_PAUSED n/a
JUKE_SONG_RESUMED n/a
JUKE_SONG_FAST_FORWARD_POS currentPositionSecs@totalDurationSecs@
JUKE_SONG_FAST_REVERSE_POS currentPositionSecs@totalDurationSecs@
JUKE_SONG_PLAY_POS currentPositionSecs@totalDurationSecs@
JUKE_QUEUE_USER_ADD_SONG queuePos@name@artist@album@
JUKE_QUEUE_SYSTEM_ADD_SONG queuePos@name@artist@album@
JUKE_QUEUE_DELETE_SONG queuePos@
JUKE_QUEUE_MOVE_SONG oldQueuePos@newQueuePos@
JUKE_QUEUE_CLEARED n/a
JUKE_VOLUME_CHANGE up/down/set@volumeLevel@
JUKE_VOLUME_MUTE_STATUS on/off@
JUKE_VOLUME_RANGE minVolumeLevel@maxVolumeLevel@
JUKE_ENTER_ALBUM_NUM_DIGIT digit(0-9)@
JUKE_ENTER_TRACK_NUM_DIGIT digit(0-9)@
JUKE_ATTRACT_MODE onActive/onNotActive/off@
JUKE_PARTY_LOCK on/off@
--- End quote ---
I would like to add a plugin page to my software. On this page I would have a button which can be clicked to display the plugin routines I support along with an explanation for each.
I was also thinking of adding a "Configure" button which could be clicked when a plugin has been selected from the list to allow the plugin author to configure their own plugin. Loadman mentioned this might be nice to have during the testing phase of the plugin. If this would be nice to have, then one more plugin routine would need to be created by the plugin author (ie: JukeConfigure() routine).
loadman:
--- Quote from: unclet on January 06, 2008, 09:54:44 pm ---I was also thinking of adding a "Configure" button which could be clicked when a plugin has been selected from the list to allow the plugin author to configure their own plugin. Loadman mentioned this might be nice to have during the testing phase of the plugin. If this would be nice to have, then one more plugin routine would need to be created by the plugin author (ie: JukeConfigure() routine).
--- End quote ---
That idea is growing on me (to use in MaLa too is Swindus will do it). Instead of having to load a seperate executable to configure Plug-ins it would also be cool to do this via the host software (triggering it) ;D
Space Fractal:
It pretty a nice idea to use one command, but there is now various commands to fit all you need. You can do this all functions with various functions, so they are all covered in the SDK:
--- Code: ---JUKE_APPLICATION_OPENED
Juke_Initialize()
JUKE_APPLICATION_CLOSED
Juke_Shutdown(0)
JUKE_SONG_STARTED
Juke_SongBegin()
; do not need to send song info again, since the plugin allready know it using add2queue().
JUKE_SONG_FINISHED
Juke_SongEnd(0)
; EDIT, just corrected a error.
JUKE_SONG_RESTARTED
Juke_SongBegin()
; The plugin did not delete the song from its queue, because Juke_SongEnd(0) was not used.
; can also use the same if you use some thing as song loop and something elsewice.
JUKE_SONG_SKIPPED
Juke_SongEnd(1)
; When a song skipped, the song is also ended. Let the plugin know with setting value to 1.
JUKE_SONG_PAUSED
Juke_SongStatus("PAUSE")
; Plugin can also detect that when listen to Juke_SongPlayed(secs), because seconds diddent count.
JUKE_SONG_RESUMED
Juke_SongStatus("PLAY")
JUKE_SONG_FAST_FORWARD_POS
Juke_SongStatus("FAST RESERVE")
Juke_CommandSend("FAST_RESERVE") ; if it can been used as a keypress command.
JUKE_SONG_PLAY_POS
;no need, the plugin can detect it while listing to Juke_SongPlayed(secs), since the secs change.
JUKE_QUEUE_USER_ADD_SONG
Juke_Add2Queue(File$, totalDurationSecs, 0, CoverArt$="", "+tracknr+" "+name, artist, album, "", "")
; tracknr is not supported, but use it as part of the title name. A plugin might check about it.
JUKE_QUEUE_SYSTEM_ADD_SONG
Juke_Add2Queue(File$, totalDurationSecs, 1, CoverArt$="", "+tracknr+" "+name, artist, album, "", "")
; tracknr is not supported, but use it as part of the title name. A plugin might check about it.
JUKE_QUEUE_DELETE_SONG
Juke_QueueClear(1)
; then resubmit all songs agom you have in your queue using Juke_Add2Queue()
JUKE_QUEUE_MOVE_SONG
Juke_QueueClear(1)
; then resubmit all songs you have in your queue using Juke_Add2Queue()
JUKE_QUEUE_CLEARED
Juke_QueueClear(0)
JUKE_VOLUME_CHANGE
Juke_Volume(volumelevel, minVolumeLevel, maxVolumeLevel)
JUKE_VOLUME_MUTE_STATUS
Juke_CommandSend("MUTE", 0); on
Juke_CommandSend("MUTE", 1); off
JUKE_VOLUME_RANGE
Juke_Volume(volumelevel, minVolumeLevel, maxVolumeLevel)
JUKE_ENTER_ALBUM_NUM_DIGIT
Juke_CommandSend(digit, 0) <- just a a string digit, You might need to use LCDString if you want full LCD control using this function.
JUKE_ENTER_TRACK_NUM_DIGIT
Juke_CommandSend(digit, 0) <- just a a string digit, You might need to use LCDString if you want full LCD control using this function.
--- End code ---
in plugindir/Commands.txt you should set these for above example:
--- Code: ---FAST_RESERVE,0
MUTE, 0
0, 0
1, 0
2, 0
3, 0
4, 0
5, 0
6, 0
7, 0
8, 0
9, 0
--- End code ---
About the config:
The main problem is I wont have my software locked while a plugin is on configuration. This because BlitzMax dosent support threads.
Instead the exe file can use the same name as the dll itself, so they can been called from the application. I add such a function in next version on my SDK when I went home. plugin authors dosnet need to do anything, just make sure the config exe is the same as dll name itself.
Adding this function soon to my wrapper to invoke a exe file to its config.
Barry Barcrest:
So what are the commands we need to support? Do we have a final list now... I assume for the config we just call something like juke_config in the dll and it displays it's config screen?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version