emesene forum
September 09, 2010, 09:05:19 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: CACHE KEY ERRORS? NICK NOT SAVED? UPGRADE TO 1.6.2 FIRST!

REPORT ANY ISSUE HERE - PLEASE CHECK IF THE PROBLEM HAS ALREADY BEEN REPORTED FIRST -- THANKS
 
  Home   Forum   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Current Song Plugin Reloaded  (Read 2104 times)
karasu
Hero Member
*****

l33tness: 4
Offline Offline

Posts: 285


Noein

gustaucastells@hotmail.com
View Profile WWW
« on: February 19, 2010, 06:05:18 PM »

Hi!

I've tried to patch the current song plugin to be able to:

1. Autodetect player:

http://forum.emesene.org/index.php/topic,2978.0.html

2. When we deactivate the plugin, be able to return to the previous avatar image:

http://forum.emesene.org/index.php/topic,2996.msg21015.htm

As I changed some "important" things of the plugin, I also noticed some little mistakes in some "subplugins". To sum it up (just in case somebody wants to code another "subplugin"):

IsRunning should tell if player is running (seems obvious, but...)

getStatus should tell if the player module can be loaded (doesn't matter if player is running or not, simply must tell if player could run and we would be able to comunicate with it). In D-Bus subplugins this function must not be overriden (as it's explained in plugins_base/currentsong/currentsong.py)

Now the changes:

- plugins_base/CurrentSong.py:
  * Changed how stored the avatar, as it always stored the last one that "worked". Now it stores only the one that we were using before loading the plugin. With the media button we load/unload it. Try it! Tongue
  * Added debug messages
  * Added "autodetect" option. LastFM subplugin can't be autodetected, as it's web based always gives us an ok.

- plugins_base/currentSong/CurrentSong.py:
  * Added isRunning function that can be used by all D-Bus based subplugins.

- plugins_base/currentSong/QuodLibet.py:
  * This subplugin returned False in getStatus when the player wasn't running. Fixed.

- plugins_base/currentSong/Amarok2.py:
  * isPlaying function didn't check if D-Bus was available or not. Fixed.
  * This subplugin returned False in getStatus when the player wasn't running. Fixed.

- plugins_base/currentSong/Spotify.py:
  * This plugin was wrongly based in CurrentSong.DbusBase when it does not use D-Bus. Fixed
  * There was no isRunning function. Written a new one.

- plugins_base/currentSong/Banshee.py:
  * Something strange here. When plugin couldn't load the song info from the player it used a info variable, that was undeclared. I simply deleted it and emptied the song info.

- plugins_base/currentSong/Xmms2.py: (this bug is mine Grin)
  * Don't try to connect with music server if we're already connected (yes, I know...)

- plugins_base/currentSong/Audacious.py:
  * Changed audtool name to audtool2 (newer version).
  * Added isRunning function
  * Fixed getStatus function (audacious can comunicate through D-Bus or the audtool2 program)
  * Fixed a small identation mistake (nobody noticed?  Huh)

- plugins_base/currentSong/Mpd.py:
  * Added isRunning function

In some files I added _() to be able to translate some strings (even when they are only debug messages, it's nice to show them in one's language  Wink )

That's all folks! Diffs are against svn version 2264.

I'd like your feedback!!! Sure there are some bugs here and there...  Sad
 
« Last Edit: February 20, 2010, 05:55:30 AM by karasu » Logged

I a vegades... els ocells fan cagarades...
C10uD
ololol
Administrator
Hero Member
*****

l33tness: -9989
Offline Offline

Posts: 2327



View Profile Email
« Reply #1 on: February 20, 2010, 05:39:59 AM »

:O oh shi-


i think i'll have to add this to svn :O
Logged
karasu
Hero Member
*****

l33tness: 4
Offline Offline

Posts: 285


Noein

gustaucastells@hotmail.com
View Profile WWW
« Reply #2 on: February 20, 2010, 06:47:36 AM »

Thanks!  Grin

I haven't tested it with ALL players, so I expect some bugs... but I'll be glad to fix them!

EDITED:

I knew it... just it gets to svn that I find a bug (not really nasty but annoying)

Steps:
 - You change your avatar with the avatar selector while the currentsong plugin is activated.
 - You get out emesene
 - You start again emesene
 - Old avatar is used

That's because current song plugin restores the old avatar when it gets out.

Anyway I think this behaviour is still better than the old one, that you always got a different avatar depending on when you got out of emesene.

Current song plugin restores to the SAME avatar that was used when the plugin was loaded.

Problem is that I don't know how to differentiate when the avatar is changed by the user from when the avatar is changed by the plugin.... I'll think about it!
« Last Edit: February 20, 2010, 06:56:45 AM by karasu » Logged

I a vegades... els ocells fan cagarades...
karasu
Hero Member
*****

l33tness: 4
Offline Offline

Posts: 285


Noein

gustaucastells@hotmail.com
View Profile WWW
« Reply #3 on: February 20, 2010, 07:51:29 AM »

Fixed!  Grin

Now it seems to work... you can change your avatar while the plugin is running... it will store it, and the cover avatar never stays.

C10ud, IMHO this little fix really should be svn'up...  Wink

Thaaaaanks!!!
« Last Edit: February 20, 2010, 07:55:28 AM by karasu » Logged

I a vegades... els ocells fan cagarades...
C10uD
ololol
Administrator
Hero Member
*****

l33tness: -9989
Offline Offline

Posts: 2327



View Profile Email
« Reply #4 on: February 20, 2010, 10:29:29 AM »

thank you
Logged
Kreuger
Sr. Member
****

l33tness: 0
Offline Offline

Posts: 83



View Profile
« Reply #5 on: February 21, 2010, 09:56:17 AM »

Can I please have the .py source so I can just stick it in my plugins dir? I dont wanna recompile Sad
Logged
karasu
Hero Member
*****

l33tness: 4
Offline Offline

Posts: 285


Noein

gustaucastells@hotmail.com
View Profile WWW
« Reply #6 on: February 21, 2010, 12:55:48 PM »

If you don't know how to use subversion you can browse source code here:

http://emesene.svn.sourceforge.net/viewvc/emesene/trunk/emesene/
Logged

I a vegades... els ocells fan cagarades...
Kreuger
Sr. Member
****

l33tness: 0
Offline Offline

Posts: 83



View Profile
« Reply #7 on: February 22, 2010, 03:08:29 PM »

I do know how, I just dont know how to patch the diff without rebuilding the code (if thats possible).
Logged
karasu
Hero Member
*****

l33tness: 4
Offline Offline

Posts: 285


Noein

gustaucastells@hotmail.com
View Profile WWW
« Reply #8 on: February 22, 2010, 03:57:37 PM »

Are you using linux or windows? because if you're using windows I'm not sure how to help... You could try to simply copy the modified py files to the current_song directory. Get them from the address I've given you before.

If you can't manage send me a PM, better than filling this thread with this Wink
Logged

I a vegades... els ocells fan cagarades...
Kreuger
Sr. Member
****

l33tness: 0
Offline Offline

Posts: 83



View Profile
« Reply #9 on: February 25, 2010, 01:07:37 AM »

Linux. I s'pose I'll just rebuild the source. Its probably the best way to go Smiley

Edit: I've downloaded the svn and ran it without compiling but didn't see an option for automatic detection in the gui. I also tried changing between players and it didn't work.
« Last Edit: February 25, 2010, 01:10:36 AM by Kreuger » Logged
rOckan
Jr. Member
**

l33tness: 0
Offline Offline

Posts: 9


View Profile Email
« Reply #10 on: February 28, 2010, 03:57:34 PM »

Would be awesome something for the app of Grooveshark in adobe air  Grin
Logged
karasu
Hero Member
*****

l33tness: 4
Offline Offline

Posts: 285


Noein

gustaucastells@hotmail.com
View Profile WWW
« Reply #11 on: February 28, 2010, 07:49:58 PM »

@Kreguer: You must go to the plugins dialog and configure the current song plugin. There you MUST have an autodetect option (if you're really using latest svn version it must be there).

@rOckan: I didn't even know what Grooveshark is. It seems it may be similar to lastFM.... don't know if this can be done. It depends if Grooveshark shares its current song info. When I have some free time I'll look into it, but as always I don't promise anything! (why don't you give it a try? Wink ).
Logged

I a vegades... els ocells fan cagarades...
arielj
Administrator
Hero Member
*****

l33tness: 31
Offline Offline

Posts: 1417


globitz!


View Profile Email
« Reply #12 on: March 01, 2010, 03:45:29 AM »

@krueger, you have to choose the Autodetect "player" on the list of available players.
Logged
Kreuger
Sr. Member
****

l33tness: 0
Offline Offline

Posts: 83



View Profile
« Reply #13 on: March 03, 2010, 02:00:38 AM »

I got it Smiley
Logged
karasu
Hero Member
*****

l33tness: 4
Offline Offline

Posts: 285


Noein

gustaucastells@hotmail.com
View Profile WWW
« Reply #14 on: March 03, 2010, 06:04:34 AM »

Perfect! Can I assume it works for you?
Logged

I a vegades... els ocells fan cagarades...
Pages: [1] 2
  Print  
 
Jump to:  

TinyPortal v.1.0.6 beta 2 © Bloc
Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!