Main > Audio/Jukebox/MP3 Forum
Plugins: Document API for JukePlugSys
unclet:
--- Quote ---MultiJuke example I use GENRE_LOCK instead of PARTY_LOCK. Freebox if I remember correct use CAUSAL for the same feature.
--- End quote ---
Based on my recommendation you would simply add the following to the string values:
JUKE_PLAY
JUKE_VOLUME_UP
JUKE_VOLUME_DOWN
JUKE_PARTY_LOCK_ON
JUKE_PARTY_LOCK_OFF
JUKE_GENRE_LOCK_ON
JUKE_GENRE_LOCK_OFF
JUKE_CASUAL_ON
JUKE_CASUAL_OFF
JUKE_MUTE_ON
JUKE_MUTE_OFF
The author of the plugin would then group similiar strings together like the following to make it work with all jukebox software:
--- Quote ---int Juke_Command(String cmdName, String cmdValue)
{
switch(Name)
{
case "JUKE_SONG_BEGIN":
break;
case "JUKE_SONG_END":
break;
case "JUKE_PLAY":
break;
case "JUKE_VOLUME_UP":
break;
case "JUKE_VOLUME_DOWN":
break;
case "JUKE_PARTY_LOCK_ON":
case "JUKE_GENRE_LOCK_ON":
case "JUKE_CASUAL_ON":
break;
case "JUKE_PARTY_LOCK_OFF":
case "JUKE_GENRE_LOCK_OFF":
case "JUKE_CASUAL_OFF":
break;
case "JUKE_MUTE_ON":
break;
case "JUKE_MUTE_OFF":
break;
}
return 1;
}
--- End quote ---
Like loadman mentioned previously, the author of the plugin should really make sure their plugin works with all jukebox software themselves. This way the final "plugin" can be used with "any" jukebox still.
EXTRA
I also think it might be nice to inform the plugin of certain values such as "VOLUME_MIN" and "VOLUME_MAX" values. This will allow plugin developers to know what the range of volume can be (ie: in my software it is 0 to 100) in case they wish to make some neat LCD lighting to indicate how high the volume is. If they never knew the min and max values they would not be able to do this. now, there are probably other values which should be sent as well, but the VolumeMin and VolumeMax are justa couple examples. however, all this means is that we add a couple more set values as follows:
JUKE_VOLUME_MIN
JUKE_VOLUME_MAX
These values will most likely only needed to be sent once (on bringup of the jukebox).
Space Fractal:
I can't see why that is needed which would been very code overhead, due to a few diffecent from software to software?
It's matter to create a good configuration in theplugin to suit all commands in all software.
Look in the Sound Effect example I gave, not all use a CoinInsert command. Since your software does not have a CoinInsert command, the plugin would never listed that in thier configuration part, because they never got the command when you sent all commands used by your software using Juke_CommandList(). Hence you send a commandlist after a init().
I cant see I can do more universal?
That I trying to say, it a list of commands the jukebox software actuelly use and no more. Otherwice the user would been very confuction with unused commands in the plugin.
If a new command is developmented with a update, simply add that one to the juke_commandlist() as well. Plugin would simply automatic update its command list with the new command, because it got a new one when listed to juke_commandlist(), and the new command would been configurable by the user in its plugin config.
Due to that, no need to document new commands by a jukebox author.
Hence it expandande for future use with new commands.
_____
Volume: Done, I just added 2 extra arguments to the volume command. No need to create 2 own commands for that.
headkaze:
--- Quote from: unclet on January 06, 2008, 09:06:04 am ---JUKE_VOLUME_MIN
JUKE_VOLUME_MAX
--- End quote ---
I don't see the point of these values. Just have the range from 0 to 100. Then if the Jukebox software has a different range (Eg. 0 to 1024) then a simple calculation will convert it to the accepted range for the plugin.
Eg. int Volume = 512;
JukeVolume((Volume / 1024) * 100);
unclet:
Space Fractal
--- Quote ---It's matter to create a good configuration in the plugin to suit all commands in all software.
--- End quote ---
I have my doubts as to whether this will be possible since each software does not plan on using the full set of routines anyway.
Also, I still do not understand why a plugin has to create a command list of it's own.
I plan on having my jukebox software simply call a main routine like the following when an event occurs:
--- Quote ---Juke_Command(String cmdName, String cmdValue)
--- End quote ---
headkaze
Imagine if loadman wants to make an LCD lighting plugin which increases/decreases lights do to volume. When the volume is at the max, then "all" lights will be on. When the volume is at the min, then "one" light is on only. In order to do this correctly I thought the plugin author should know what the max/min values of the volume are set to in the software.
Now if you are proposing the JukeVolume() routine only ever return a value between 0 and 100, then you do not need my new proposed values. I was just not sure we wanted to restrict the JukeVolume() limits to be 0-100 only. Introducing my new values allow the plugins to know the exact volume setting of the software. Seems like a better idea in my opinion instead of rounding the volume level to be between 0 and 100.
:dunno
Space Fractal:
If you as Jukebox Author do not need to send a full list to the plug-in, You do not need to that. Its up to you.
The plug-in need to known which commands that is available to use, otherwise the user can not configurere what commands that would do that in the plugin configuration. Example to play a sound when the plugin got a "CoinInsert" command.
The commandList() is ONLY meant for the plugin configuration part have any use of available commands, show to user.
Any swtich commands like party_on of party_off is sendt via same string to commandlist(), so the plug is aware that command have a on/off stwich.
Because of above, Juke_Command() have only one argument, that is the command you want to sendt, you known that is on the commandlist().
Example after you have init() the plugin:
Juke_CommandList(0, "*Mute On, Mute Off")
Juke_CommandList(1, "Volume Up")
Juke_CommandList(2, "Volume Down")
Juke_CommandList(3, "Clear Queue")
I asume you write a function to do that, so you sendt the list to all used plugin at once.
In the plugin configuration, these 4 command would show to the user, what they want to due. It up to the plugin writer. Not by you.
When you so want to send a command, due this somewhere in your software needed:
Juke_command("Volume Up")
Plugin would now find "Volume Up" in its lists, becaue you have send a commandlist() with that name after init() and would do something in the plugin seleceted by the user somewhere on its configuration. It allways the user that select, what it should do, NOT by the plugin author.
For switch commands it more for remote controlling when you want to listen to any commands, also respons from the plugin (here you might need to use the wrapper I gave in the other thread). Can also been used for other thing. But for sending it is still one string command, "Mute On", or "Mute Off".
The plugin save its list anytime and should check for any new commands.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version