getmusicbee.com

MusicBee & Add-Ons => Customizations => Plugins => Topic started by: kelsos on April 30, 2011, 09:54:31 PM

Title: Skype Now Playing Plugin
Post by: kelsos on April 30, 2011, 09:54:31 PM
Here is a simple now Skype Now playing plugin I created for MusicBee using C#.

The plugin uses the Skype4COM ActiveX to communicate with skype. Before 5.5 Skype4COM was part of the Extras Manager distributed along with Skype. In 5.5 The extras manager was removed so now if Skype4COM is not installed in your system you have to install it through the provided Skype4COM.msi.
If you have previously installed Skype4COM then this step is not required.

The tags supported at the moment are <Artist>, <AlbumArtist>, <Title>, <Year> and <Album> and they have to be like above in the textbox in order for the tag to get displayed. Also there is the option (activated by default) for a "Now Playing" string and a Unicode note char to appear in front of the selected pattern. (Depending on the computer the note may appear as a square).

There are installation info inside the archive.

Here is the original version: http://www.mediafire.com/?cwc5jmx6s1cx49t

Here is the latest v1.1.0.213: http://www.mediafire.com/?v9lj0clf4acf25a
(the skype4com.msi is provided along with the application archive)
Also thanks to Mikey helping me to sort out the issues with v1.1.0.202

The sources can be found on Github https://github.com/kelsos/mb-skype-plugin

It is possible that Skype4COM.msi will resolve the connectivity problems reported also with the previous version.

Title: Re: Skype Now Playing Plugin
Post by: Maleko12 on April 30, 2011, 10:13:58 PM
Hello! Thank you so much for this plugin!

Unfortunately, I got this error when trying to enable skype in MB:

Code
MusicBee v1.2.4136.34658 (Win6.1), 30 Apr 2011 14:04:

System.InvalidCastException: Unable to cast object of type '#=q4SPYDhidHOPs2MuKRg7oiivglNE00$wHLqWlHwfmgqW3Br__AzPS9jS7$2TGaQYH' to type '#=qFgvimSFsaJtgguyXzN0K2qqHEhOV3YBRimEPCdMZ6lX7e$pGG6wL5dFl4Glzon70'.
   at #=q4v4ehwoA1wZSV77L3pFqVWE_Ak0JIQJp7gFrA47mECHSczF7gHcuZqEusfKHgXJb.#=q8c8RS0YZxgpHKgRjEfpn_Yp8N8qmnV7oLpovgQBZpuE=(Object #=qwB_tJ64K4fF5gVlW0DJyCg==, EventArgs #=qJYPWUDFFpNXOU_GleeT47w==)
   at #=q4SPYDhidHOPs2MuKRg7oiivglNE00$wHLqWlHwfmgqW3Br__AzPS9jS7$2TGaQYH.OnClick(EventArgs #=qSfPn7Eb6oMVZmJgFR8jwDg==)
   at #=q4SPYDhidHOPs2MuKRg7oiivglNE00$wHLqWlHwfmgqW3Br__AzPS9jS7$2TGaQYH.#=q1nUO4vzqqWh5GVMf4ewLkbem3yQ1DI$EQF4N1MYEllg=(Object #=qA88cayXkTo9MUjkCXIZGQQ==, EventArgs #=qDbilhWlLPArGitOENOFq7g==)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Thus, everytime I try to enable the plugin, it will pop up that error above.
Not sure if you know how to fix this, so I'll PM Steven to this topic too.

http://imgur.com/4V1Wc
Title: Re: Skype Now Playing Plugin
Post by: kelsos on April 30, 2011, 10:21:13 PM
That's a shame, to be honest I have no idea what is causing this problem, and if am unable to actually replicate it I can't think of a way to fix it... are you using a newer build than 1.2.4120?
Title: Re: Skype Now Playing Plugin
Post by: Maleko12 on April 30, 2011, 10:21:55 PM
Yes... 1.2.4136: http://www.mediafire.com/?249w2kdqhtvsghp
Title: Re: Skype Now Playing Plugin
Post by: kelsos on April 30, 2011, 10:56:56 PM
It actually seems pretty weird... I have been getting the same error while trying to enable it with the 1.2.4136, so I decided check it with some debug builds... In the debug build somehow I actually managed to activate the plugin and it works (it updates the skype mood properly), but now I am getting the same error when I try to disable the plugin, so my guess is that probably Steven can help us resolve whatever issue exists.
Title: Re: Skype Now Playing Plugin
Post by: Steven on May 01, 2011, 08:40:18 AM
i made a change to swap a couple of fields around to fix a GUI glitch but it needed one other change. Glad you guys caught the mistake!
this should fix it:
get the latest weekly update
Title: Re: Skype Now Playing Plugin
Post by: Maleko12 on May 01, 2011, 04:53:29 PM
Yep, with that release, it now works properly! Thanks again Steven :)
Title: Re: Skype Now Playing Plugin
Post by: Pipovski on May 17, 2011, 07:57:35 AM
Thank you Kelsos! Works fine...  ::)

Cheers.
Title: Re: Skype Now Playing Plugin
Post by: stas on May 26, 2011, 10:08:29 AM
Great, kelsos, thank you very much.
The only problem is if I press Pause and then Play again, status updates again. So the same song is shown 2 times in a row.
Title: Re: Skype Now Playing Plugin
Post by: jpirez on June 24, 2011, 02:35:08 PM
It's not working on Skype beta 5.5
Title: Re: Skype Now Playing Plugin
Post by: kelsos on June 24, 2011, 05:48:10 PM
It's not working on Skype beta 5.5
I just got back home, I am gonna check it soon.

Great, kelsos, thank you very much.
The only problem is if I press Pause and then Play again, status updates again. So the same song is shown 2 times in a row.
The actual design was to restore the previous status when the track is paused and restore the playing track when un-paused. Is the original message not restored during pause? I could try to add it as an option, not to restore the original message when the track is paused and restored.

UPDATE:  I just installed Skype 5.5 beta on my computer and the plugin seems to work just fine. It updates properly. Did you allow MusicBee.exe to access skype and everything?
Title: Re: Skype Now Playing Plugin
Post by: jpirez on June 25, 2011, 02:35:12 PM
Hi mate

Thanks for your answer.

I am still having problems. Everything was working fine before updating to Skype's last beta.
Now, no matter what I do,  the plugin doesn't interact with skype.

I have tried to sort things out downgrading Skype but even so it didn't fix the problem.

I've got musicbee , skype (not beta), and the plugin working fine on my laptop.

I'll continue to investigate this issue.
Cheers
Title: Re: Skype Now Playing Plugin
Post by: kelsos on June 25, 2011, 03:14:53 PM
It is weird... It could be that the plugin fails to find if Skype is running or something.  I will add an information dialog at some point to show you If it managed to find Skype successfully. However it may take a while because it is my exams period right now..
Title: Re: Skype Now Playing Plugin
Post by: Mikey on October 19, 2011, 11:48:55 PM
This plugin and thread dead?  Not working for me in Skype 5.5.0.119  :(

Skype doesn't see the plugin...it does see my last fm scobbler but not your plugin...
Title: Re: Skype Now Playing Plugin
Post by: kelsos on October 20, 2011, 12:03:39 AM
I am currently working on a new version with updated skype4com, also I added the ability to check if the plugin sees skype. I will add a link soon.
Title: Re: Skype Now Playing Plugin
Post by: Mikey on July 09, 2012, 09:13:13 PM
Hi Kelsos, it look slike the latest update to Skype messed something up.  No more status updates....Could you check it out whenever you get a chance? Thanks!
Title: Re: Skype Now Playing Plugin
Post by: kelsos on July 10, 2012, 10:41:06 AM
of course. I will check it as soon as I find some free time.
Title: Re: Skype Now Playing Plugin
Post by: kelsos on July 20, 2012, 12:11:48 PM
I was working a version for MusicBee v2, that ditches the Skype4COM library and instead it directly hooks on the Skype API, this version seems to work with the latest skype version fine. could you tell me if you use the v2 beta or the 1.4 stable?  so I know for which .Net version should I build it?
Title: Re: Skype Now Playing Plugin
Post by: musika on July 24, 2012, 11:57:41 AM
Got the latest version from the first post and it works great.

Thanks!
Title: Re: Skype Now Playing Plugin
Post by: boroda on June 26, 2013, 08:06:50 AM
Here is plugin's wiki page (http://musicbee.wikia.com/wiki/Skype_Now_Playing). Please update it if plugin is updated.
Title: Re: Skype Now Playing Plugin
Post by: PureLoneWolf on September 22, 2013, 05:56:27 PM
Hi there

I just started using this today and it is working really well  :)

However, is it possible for it to clear my mood/status (or set it back to what it was) when the music stops or MusicBee is closed?

I have had a few comments today from people asking me how long the track is :)

Thanks
Title: Re: Skype Now Playing Plugin
Post by: kelsos on September 22, 2013, 06:02:37 PM
I think that there is something like that already implemented though if I recall correctly it should have some issues in some cases... (restoring the previous mood). I will however check both (and the duration thing) as soon as I have some extra time available (probably starting October) before resuming the work on Remote... my guess is that they should not require that much time
Title: Re: Skype Now Playing Plugin
Post by: PureLoneWolf on September 22, 2013, 06:04:36 PM
Excellent, thanks.  For me, just clearing it would be perfect :)
Title: Re: Skype Now Playing Plugin
Post by: kelsos on October 30, 2013, 06:13:53 PM
I started working on some minor changes however I run across the following.
https://support.skype.com/en/faq/FA12349/skype-says-my-application-will-stop-working-with-skype-in-december-2013-why-is-that

It seems that Skype will be discontinuing the Desktop API as of December, which means that for every version released afterward the plugin will not function.

If anyone is still interested for a new build I could provide one.

The changes in the new build will be the following:

* Unicode note character removed, (there where a lot of cases where it failed to appear properly)
* Skype4COM dll dependency removed, now the plugin calls the Skype API directly.
* Updated to use .NET 4, the previous version uses .NET 2
* Adds automatic mood clearing on stop (2 seconds after actually) or on MusicBee closing
* Adds a <Duration> tag to display the duration in the now playing message
Title: Re: Skype Now Playing Plugin
Post by: realm174 on November 12, 2013, 02:47:10 AM
Actually, looks like they're not retiring it (yet)..

http://www.theregister.co.uk/2013/11/07/skype_desktop_u_turn/

I haven't tried your plugin yet, as I just discovered MusicBee yesterday... Going to try it now tho.. :)
Title: Re: Skype Now Playing Plugin
Post by: kelsos on November 12, 2013, 06:23:38 PM
I was using a single call of the API to change the mood, not sure if it is in the stuff they are going to remove though. My guess is that it will be removed, but in case they don't I will release an updated build.
Title: Re: Skype Now Playing Plugin
Post by: frogcrush on November 24, 2015, 04:46:04 AM
I kept getting a lockup on my (incredibly slow) laptop every time the song changed. I wrapped the function in a BackgroundWorker and submitted a pull request on your GitHub page. I've been testing it for a big and it seems to work well and as expected.
Title: Re: Skype Now Playing Plugin
Post by: kelsos on November 27, 2015, 08:38:56 AM
Thank you, pull request accepted.
Title: Re: Skype Now Playing Plugin
Post by: LazR on April 22, 2016, 04:06:11 AM
This plugin no longer works. It worked before then updated skype then saw it stopped working. When trying to enable the plugin it says 'Unable to initialise this plugin. Exception has been thrown by a target of an invocation'.
Title: Re: Skype Now Playing Plugin
Post by: boroda on April 26, 2016, 01:31:18 PM
skype discontinued their desktop api. you can try older version of skype, but suggest it wont work at all.