Hi all,
I'm trying to create a plugin that I used in winamp, when I had not discovered yet the best music player: MusicBee!!
The plugin is very simple: it captures a global hotkey (Win+W for example), and send the current song to the recycle bin and plays the next song in the current playlist.
I've downloaded the API c# project, and I've tried to build it, but it doesn't work the way I want.
I've tested my plugin, but only works if I had disabled/enabled it via MusicBee Preferences menu, so I need some kind of advice because it's annoying having to disable and enable the plugin in every session in order to use it
My question is: There is a way to register a global hotkey via MusicBee API, so I can capture this hotkey and do my stuff?
You can see my source code in BitBucket:
https://bitbucket.org/jorgejiro/musicbee-sendtorecyclebinpluginThe "KeyboardHook.cs" class assigns/detects global hotkeys.
The event function moves to the next song, and send the file to the recycle bin.
void hook_KeyPressed(object sender, MusicBeePlugin.KeyboardHook.KeyPressedEventArgs e)
{
string fileUrl = mbApiInterface.NowPlaying_GetFileProperty(FilePropertyType.Url);
if (mbApiInterface.NowPlayingList_IsAnyFollowingTracks())
{
mbApiInterface.Player_PlayNextTrack();
}
else
{
mbApiInterface.Player_Stop();
}
FileOperationAPIWrapper.MoveToRecycleBin(fileUrl);
}