From: <ale...@us...> - 2012-01-14 15:27:13
|
Revision: 12356 http://amsn.svn.sourceforge.net/amsn/?rev=12356&view=rev Author: alexandernst Date: 2012-01-14 15:27:06 +0000 (Sat, 14 Jan 2012) Log Message: ----------- Add support for Clementine player in Music plugin. Thanks to c_jay and cylverback from forums. Modified Paths: -------------- trunk/amsn/plugins/music/music.tcl trunk/amsn/plugins/music/plugininfo.xml Modified: trunk/amsn/plugins/music/music.tcl =================================================================== --- trunk/amsn/plugins/music/music.tcl 2012-01-01 23:07:09 UTC (rev 12355) +++ trunk/amsn/plugins/music/music.tcl 2012-01-14 15:27:06 UTC (rev 12356) @@ -255,6 +255,7 @@ "Audacious (MPRIS)" [list GetSongMPRIS TreatSongMPRIS FillFrameLess] \ "Banshee" [list GetSongBanshee TreatSongBanshee FillFrameComplete] \ "BMP (MPRIS)" [list GetSongMPRIS TreatSongMPRIS FillFrameLess] \ + "Clementine" [list GetSongClementine TreatSongClementine FillFrameComplete] \ "Decibel" [list GetSongDecibel FillFrameLess] \ "Exaile" [list GetSongExaile TreatSongExaile FillFrameLess] \ "Exaile (MPRIS)" [list GetSongMPRIS TreatSongMPRIS FillFrameLess] \ @@ -1068,7 +1069,49 @@ return [list $Title $Artist $Uri $CoverUri ""] } + + ################################################ + # ::music::TreatSongClementine # + # ------------------------------------------- # + # Gets the current playing song in Clementine # + ################################################ + proc TreatSongClementine {} { + #Grab the information asynchronously : thanks to Tjikkun + after 0 {::music::exec_async [list "bash" [file join $::music::musicpluginpath "infoclementine"]] } + } + + ################################################ + # ::music::GetSongClementine # + # ------------------------------------------- # + # Gets the current playing song in Clementine # + ################################################ + proc GetSongClementine {} { + #actualsong is filled asynchronously in TreatSongClementine + #Split the lines into a list and set the variables as appropriate + + if { [catch {split $::music::actualsong "\n"} tmplst] } { + #actualsong isn't yet defined by asynchronous exec + return 0 + } + + #Get the information + set status [lindex $tmplst 0] + set art [lindex $tmplst 1] + set song [lindex $tmplst 2] + set path [lindex $tmplst 3] + set artpath [lindex $tmplst 4] + set album [lindex $tmplst 5] + if {[string first "nocover" [file tail $artpath]] != -1} {set artpath "" } + if {$status == "0"} { + return 0 + } + + + + return [list $song $art $path $artpath $album] + } + ########################################################### # ::music::TreatSongLastFM # # ------------------------------------------------------- # Modified: trunk/amsn/plugins/music/plugininfo.xml =================================================================== --- trunk/amsn/plugins/music/plugininfo.xml 2012-01-01 23:07:09 UTC (rev 12355) +++ trunk/amsn/plugins/music/plugininfo.xml 2012-01-14 15:27:06 UTC (rev 12356) @@ -12,7 +12,7 @@ <plugin_namespace>music</plugin_namespace> <init_procedure>InitPlugin</init_procedure> <deinit_procedure>DeInit</deinit_procedure> - <cvs_version>12283</cvs_version> + <cvs_version>12356</cvs_version> <lang> <langcode>da</langcode> @@ -87,6 +87,10 @@ <path>infobanshee</path> <version>11122</version> </file> + <file> + <path>infoclementine</path> + <version>1</version> + </file> <file> <path>infocog.scpt</path> <version>10822</version> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |