Author Topic: Looking to write a plugin to help replace Zune, questions about plugin API?  (Read 5958 times)

RPenton

  • Newbie
  • *
  • Posts: 3
So I'm attempting to write Zune replacement software, given how Zune is now discontinued. I have a music player for Windows Phone and I want to use a REST communication system to transfer files and metadata back and forth when syncing.

I got a bit far on a WPF app before I realised it was simply too slow to handle what I need it to do. I looked around for music players out there to see if any of them could handle the volume of music I intend to use this with, and MusicBee blew my mind. It's so freaking fast and responsive; I couldn't believe it. Well, when I found out it has a plugin system, I decided that maybe I could write my REST server code in a MusicBee plugin instead.

So I've been playing around with it for a few days, but I have a few problems that I don't know if there are solutions to:

1) How in the heck do you use PluginType.PanelView? Ideally I'd like a "sync" panel on the MB form so that I can drag tracks, albums, artists, and playlists onto the panel to signal that they should be synced.
2) Is there any way to add a custom column to the track view to indicate that a song has been synchronized with the mobile device?
2a) If this is not possible, is there any way to tap into the listbox engine that MB is using to create my own trackview to display things that are synchronized?


I am far and away blown away by MusicBee. I love this player, and I'd love to extend it with my little project here. I've even got the REST server up and running in a basic form using Nancy, which is amazing in and of itself, but the API documentation seems to be lacking to a point where I'm either hunting for abilities that don't exist or just lost.

Thanks for your help!

PS: To the developer of MusicBee, would there be any way to license the source code from you, for a fee of course, so that I could build what I need on top of it in the event that the plugin API can't provide what I need it to do?

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34349
there is API support for creating a virtual device. Its used in a couple of open-source plugins done by Boroda74 and also the sub-sonic plugin which has its code published as well. Its fairly straight-forward to use but its not well documented. I can also give you shell code to give you some more idea how it works.
Once you have created the virtual device, you would use MB's device synch functionality, which supports drag/drop onto the device and predefined sync lists etc
Let me know if thats the path you want to go down.
I am not interested in licensing the source code.

RPenton

  • Newbie
  • *
  • Posts: 3
Thank you for the swift reply! I had not considered this approach. I'm taking a look at the "iPod & iPhone Driver" right now, it has promise. I'll let you know if this method can do what I need it to.

I think the only concern I have is that it seems like more of a push service rather than pull; I had hoped that I could get my phone to automatically contact the server and pull synchronization data as soon as it's on my Wifi network. But maybe this can do that, still looking through the code.

Thanks again!


RPenton

  • Newbie
  • *
  • Posts: 3
Thanks again.

Playing around with that, I have a few more questions:

1) Is there any way for the plugin to sit around waiting for the device to contact it and then kick off a sync from there?
2) Whenever I sync with the virtual device, it doesn't seem to ever sync auto playlists. Whenever I do a "Send-to", it calls "IsReady", but nothing else, and whenever I do a full synchronize it'll send across regular playlists but not auto playlists. I suppose that's because the device can't possibly be capable of the same calculation engine that you have built in, but I was kind of hoping it would come up with some sort of "Virtual" playlist wherein the actual calculated tracks appear in a playlist that gets uploaded.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34349
for 1, your plugin would have its own wait handling and i would need to add the ability to invoke the synchronisation action which i am willing to do. You would need to let me know you are proceeding with the plugin for me to do this and that needs to be in the next few days.
for 2 i dont understand what you are saying. When synchronisation is started MB will call the public bool Synchronise(SynchronisationSettings flags, KeyValuePair<int, string[]>[] files) function in your plugin. For playlists (static or auto), MB will pass the url of the playlist if the playlist is included in the synch settings that the user has defined for the device (as with any device). Using the playlist url, you would call the appropriate API to query the playlist files and take whatever action you need

eddt

  • Newbie
  • *
  • Posts: 2
if you're able to pull this off, RPenton, I for one, will buy you several beers/beverages of your choice. My Zune still works a treat, and having a solid tool like musicbee as its new home - well, yes, I'd be thrilled.

tperez0312

  • Newbie
  • *
  • Posts: 1
Did you have any luck with this?
2) Is there any way to add a custom column to the track view to indicate that a song has been synchronized with the mobile device?

I don't necessarily need it to do it wirelessly but it would be an awesome feature to have since I don't like to sync my whole library but only select songs. Did you make any progress? I'd love to help if I can. My development background is mostly in Java though. What does MusicBee use?