1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-23 09:19:41 +01:00

Merge remote-tracking branch 'origin/master' into spotifyplaylists

This commit is contained in:
Leo Franchi 2012-04-08 10:00:55 -04:00
commit a80929e52f
47 changed files with 4046 additions and 341 deletions

View File

@ -1,3 +1,10 @@
Version 0.4.2:
* Updated translations for various languages.
* Resuming playback restores correct volume settings.
* Reduced CPU usage during playback.
* Fixed not starting up due to case sensitivity issue on OS X.
* Fixed volume issue (too quiet) on Windows.
Version 0.4.1:
* Fixed various crashes.
* Fixed issues with auto-updating XSPF playlists.
@ -7,7 +14,6 @@ Version 0.4.1:
* Fixed issues with changing proxy.
* Fixed Twitter authentication issues.
* Fixed Grooveshark support on Windows.
* Fixed volume issue (too quiet) on Windows.
Version 0.4.0:
* Added visual notification for database indexing job.
@ -20,9 +26,7 @@ Version 0.4.0:
* Fixed bug where resolvers would enable themselves after auto-updating.
* Fixed occasional crash when dropping tracks onto New Station item.
* Added jump-to-current-track support for search results page.
* Fixed out of sync Show/Hide menu items on OS X when hidden with cmd-h.
* Fixed non-resolving tracks when dragging from album view.
* Fixed /Volumes directory not showing up on OS X.
* Fixed fetching album covers for albums with special characters.
* Show errors and continue gracefully when resolved audio is not available.
* Fixed various crashes on exit.
@ -36,7 +40,6 @@ Version 0.4.0:
* Added SoundCloudWall.com charts.
* Added ability to "lock on" to a user when listening along, to skip along.
* Fixed bug where loved tracks would be refreshed much too often.
* Fixed startup crash on OS X.
* Fixed some font size issues.
* Sped up Tomahawk startup by moving chart loading into a separate thread.
* Added support for parsing Grooveshark and Tinysong tracks and playlists.
@ -44,6 +47,9 @@ Version 0.4.0:
* Added artist and album results to global searches.
* Fixed style and contrast issues when using GTK styles.
* Fixed paths to artwork when using MPRIS2 interface.
* Fixed out of sync Show/Hide menu items on OS X when hidden with cmd-h.
* Fixed /Volumes directory not showing up on OS X.
* Fixed startup crash on OS X.
Version 0.3.3:
* Automatically load Super Collection tracks when no official release

2
README
View File

@ -13,7 +13,7 @@ Compiling Tomahawk
Detailed building instructions for Ubuntu
-----------------------------------------
See: http://wiki.tomahawk-player.org/mediawiki/index.php/Building_Ubuntu_Binary_on_Maverick_(10.10)
See: http://wiki.tomahawk-player.org/mediawiki/index.php/Building_Ubuntu_Binary_on_Precise_(12.04)
Detailed building instructions for OS X
---------------------------------------

View File

@ -333,17 +333,17 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<context>
<name>AudioEngine</name>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="199"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="201"/>
<source>Tomahawk is stopped.</source>
<translation>Tomahawk е спрян</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="369"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="371"/>
<source>Tomahawk is playing &quot;%1&quot; by %2%3.</source>
<translation>Tomahawk изпълнява &quot;%1&quot; от %2%3.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="372"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="374"/>
<source>on album %1</source>
<translation>от албум %1</translation>
</message>

View File

@ -333,17 +333,17 @@ Denk dran: Erlaube das nur, wenn du dem Anderen vertraust und du die Rechte zum
<context>
<name>AudioEngine</name>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="199"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="201"/>
<source>Tomahawk is stopped.</source>
<translation>Tomahawk ist gestoppt.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="369"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="371"/>
<source>Tomahawk is playing &quot;%1&quot; by %2%3.</source>
<translation>Tomahawk spielt &quot;%1&quot; von %2%3.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="372"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="374"/>
<source>on album %1</source>
<translation>auf dem Album %1</translation>
</message>

View File

@ -333,17 +333,17 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<context>
<name>AudioEngine</name>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="199"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="201"/>
<source>Tomahawk is stopped.</source>
<translation>Tomahawk is stopped.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="369"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="371"/>
<source>Tomahawk is playing &quot;%1&quot; by %2%3.</source>
<translation>Tomahawk is playing &quot;%1&quot; by %2%3.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="372"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="374"/>
<source>on album %1</source>
<translation>on album %1</translation>
</message>

View File

@ -331,17 +331,17 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<context>
<name>AudioEngine</name>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="199"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="201"/>
<source>Tomahawk is stopped.</source>
<translation>Tomahawk está parado.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="369"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="371"/>
<source>Tomahawk is playing &quot;%1&quot; by %2%3.</source>
<translation>Tomahawk está reproduciendo &quot;%1&quot; de %2%3.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="372"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="374"/>
<source>on album %1</source>
<translation type="unfinished"/>
</message>

View File

@ -4,7 +4,7 @@
<message>
<location filename="../src/libtomahawk/aclregistry.cpp" line="140"/>
<source>Connect to Peer?</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/aclregistry.cpp" line="141"/>
@ -65,17 +65,17 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/libtomahawk/actioncollection.cpp" line="43"/>
<source>&amp;Listen Along</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/actioncollection.cpp" line="46"/>
<source>Stop &amp;Listening Along</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/actioncollection.cpp" line="50"/>
<source>&amp;Follow in real-time</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/actioncollection.cpp" line="55"/>
@ -97,7 +97,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/libtomahawk/actioncollection.cpp" line="62"/>
<source>&amp;Rename Playlist</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/actioncollection.cpp" line="63"/>
@ -107,12 +107,12 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/libtomahawk/actioncollection.cpp" line="64"/>
<source>&amp;Play</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/actioncollection.cpp" line="65"/>
<source>&amp;Stop</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/actioncollection.cpp" line="66"/>
@ -176,7 +176,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/libtomahawk/playlist/albummodel.cpp" line="145"/>
<source>Album</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/albummodel.cpp" line="260"/>
@ -229,12 +229,12 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<location filename="../src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp" line="86"/>
<location filename="../src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp" line="125"/>
<source>Click to show SuperCollection Albums</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp" line="127"/>
<source>Click to show Official Albums</source>
<translation type="unfinished"/>
<translation></translation>
</message>
</context>
<context>
@ -247,7 +247,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/libtomahawk/playlist/artistview.cpp" line="276"/>
<source>This collection is currently empty.</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/artistview.cpp" line="293"/>
@ -295,27 +295,27 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/audiocontrols.ui" line="302"/>
<source>love</source>
<translation type="unfinished"/>
<translation>Love</translation>
</message>
<message>
<location filename="../src/audiocontrols.ui" line="346"/>
<source>Time</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/audiocontrols.ui" line="375"/>
<source>Time Left</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/audiocontrols.ui" line="453"/>
<source>Shuffle</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/audiocontrols.ui" line="466"/>
<source>Repeat</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/audiocontrols.ui" line="504"/>
@ -331,17 +331,17 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<context>
<name>AudioEngine</name>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="199"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="201"/>
<source>Tomahawk is stopped.</source>
<translation type="unfinished"/>
<translation>Tomahawkは中止しています</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="369"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="371"/>
<source>Tomahawk is playing &quot;%1&quot; by %2%3.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="372"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="374"/>
<source>on album %1</source>
<translation type="unfinished"/>
</message>
@ -352,7 +352,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<location filename="../src/sourcetree/items/categoryitems.cpp" line="61"/>
<location filename="../src/sourcetree/items/categoryitems.cpp" line="100"/>
<source>New Playlist</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/sourcetree/items/categoryitems.cpp" line="63"/>
@ -360,7 +360,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<location filename="../src/sourcetree/items/categoryitems.cpp" line="316"/>
<location filename="../src/sourcetree/items/categoryitems.cpp" line="318"/>
<source>New Station</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/sourcetree/items/categoryitems.cpp" line="207"/>
@ -375,12 +375,12 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/sourcetree/items/categoryitems.h" line="63"/>
<source>Playlists</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/sourcetree/items/categoryitems.h" line="65"/>
<source>Stations</source>
<translation type="unfinished"/>
<translation></translation>
</message>
</context>
<context>
@ -388,7 +388,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/libtomahawk/playlist/topbar/clearbutton.cpp" line="38"/>
<source>Clear</source>
<translation type="unfinished"/>
<translation></translation>
</message>
</context>
<context>
@ -401,7 +401,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/libtomahawk/playlist/collectionflatmodel.cpp" line="74"/>
<source>Collection of %1</source>
<translation type="unfinished"/>
<translation>%1</translation>
</message>
</context>
<context>
@ -409,7 +409,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/libtomahawk/playlist/collectionview.cpp" line="85"/>
<source>This collection is empty.</source>
<translation type="unfinished"/>
<translation></translation>
</message>
</context>
<context>
@ -800,7 +800,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/proxydialog.ui" line="17"/>
<source>Proxy Settings</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/proxydialog.ui" line="70"/>
@ -810,12 +810,12 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/proxydialog.ui" line="77"/>
<source>Host</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/proxydialog.ui" line="84"/>
<source>Port</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/proxydialog.ui" line="104"/>
@ -997,7 +997,7 @@ other: %n年前</numerusform></translation>
<message>
<location filename="../src/libtomahawk/playlist/topbar/searchlineedit.cpp" line="58"/>
<source>Search</source>
<translation type="unfinished"/>
<translation></translation>
</message>
</context>
<context>
@ -1043,7 +1043,7 @@ other: %n年前</numerusform></translation>
<message>
<location filename="../src/settingsdialog.cpp" line="423"/>
<source>Information</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/settingsdialog.cpp" line="423"/>
@ -1182,7 +1182,7 @@ other: %n年前</numerusform></translation>
<message>
<location filename="../src/sourcetree/items/sourceitem.cpp" line="146"/>
<source>SuperCollection</source>
<translation type="unfinished"/>
<translation></translation>
</message>
</context>
<context>
@ -1190,7 +1190,7 @@ other: %n年前</numerusform></translation>
<message>
<location filename="../src/sourcetree/sourcetreeview.cpp" line="188"/>
<source>&amp;Copy Link</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/sourcetree/sourcetreeview.cpp" line="189"/>
@ -1205,7 +1205,7 @@ other: %n年前</numerusform></translation>
<message>
<location filename="../src/sourcetree/sourcetreeview.cpp" line="341"/>
<source>Save XSPF</source>
<translation type="unfinished"/>
<translation>XSPFを保存する</translation>
</message>
<message>
<location filename="../src/sourcetree/sourcetreeview.cpp" line="342"/>
@ -1223,12 +1223,12 @@ other: %n年前</numerusform></translation>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="81"/>
<source>Collection</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="84"/>
<source>Playlist</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="87"/>
@ -1238,7 +1238,7 @@ other: %n年前</numerusform></translation>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="90"/>
<source>Station</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="268"/>
@ -1253,12 +1253,12 @@ other: %n年前</numerusform></translation>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="271"/>
<source>My Music</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="279"/>
<source>SuperCollection</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="285"/>
@ -1268,12 +1268,12 @@ other: %n年前</numerusform></translation>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="273"/>
<source>Dashboard</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="290"/>
<source>Recently Played</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="295"/>
@ -1614,12 +1614,12 @@ You may wish to try re-authenticating.</source>
<message>
<location filename="../src/accounts/twitter/twitterconfigwidget.cpp" line="184"/>
<source>Direct Message</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/accounts/twitter/twitterconfigwidget.cpp" line="185"/>
<source>Send Message!</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/accounts/twitter/twitterconfigwidget.cpp" line="186"/>
@ -1673,7 +1673,7 @@ You may wish to try re-authenticating.</source>
<message>
<location filename="../src/accounts/twitter/twitterconfigwidget.cpp" line="282"/>
<source>Your message has been posted!</source>
<translation type="unfinished"/>
<translation>稿</translation>
</message>
</context>
<context>
@ -1697,7 +1697,7 @@ You may wish to try re-authenticating.</source>
<message>
<location filename="../src/libtomahawk/contextmenu.cpp" line="79"/>
<source>&amp;Play</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/contextmenu.cpp" line="82"/>
@ -1720,7 +1720,7 @@ You may wish to try re-authenticating.</source>
<location filename="../src/libtomahawk/contextmenu.cpp" line="96"/>
<location filename="../src/libtomahawk/contextmenu.cpp" line="277"/>
<source>&amp;Love</source>
<translation type="unfinished"/>
<translation>&amp;Love</translation>
</message>
<message>
<location filename="../src/libtomahawk/contextmenu.cpp" line="105"/>
@ -1730,27 +1730,27 @@ You may wish to try re-authenticating.</source>
<message>
<location filename="../src/libtomahawk/contextmenu.cpp" line="139"/>
<source>Show &amp;Album page</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/contextmenu.cpp" line="178"/>
<source>Show &amp;Artist page</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/contextmenu.cpp" line="272"/>
<source>Un-&amp;Love</source>
<translation type="unfinished"/>
<translation>Loveじゃないトラック</translation>
</message>
<message>
<location filename="../src/libtomahawk/contextmenu.cpp" line="110"/>
<source>&amp;Delete Items</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/contextmenu.cpp" line="110"/>
<source>&amp;Delete Item</source>
<translation type="unfinished"/>
<translation></translation>
</message>
</context>
<context>
@ -1927,57 +1927,57 @@ Try tweaking the filters for a new set of songs to play.</source>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp" line="302"/>
<source>0 secs</source>
<translation type="unfinished"/>
<translation>0</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp" line="302"/>
<source>3600 secs</source>
<translation type="unfinished"/>
<translation>3600</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp" line="306"/>
<source>-100 dB</source>
<translation type="unfinished"/>
<translation>-100dB</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp" line="306"/>
<source>100 dB</source>
<translation type="unfinished"/>
<translation>100dB</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp" line="343"/>
<source>Major</source>
<translation type="unfinished"/>
<translation>調</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp" line="344"/>
<source>Minor</source>
<translation type="unfinished"/>
<translation>調</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp" line="362"/>
<source>C</source>
<translation type="unfinished"/>
<translation>調</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp" line="363"/>
<source>C Sharp</source>
<translation type="unfinished"/>
<translation>調</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp" line="364"/>
<source>D</source>
<translation type="unfinished"/>
<translation>調</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp" line="365"/>
<source>E Flat</source>
<translation type="unfinished"/>
<translation>調</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp" line="366"/>
<source>E</source>
<translation type="unfinished"/>
<translation>調</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp" line="367"/>
@ -2336,12 +2336,12 @@ Try tweaking the filters for a new set of songs to play.</source>
<message>
<location filename="../src/libtomahawk/utils/jspfloader.cpp" line="137"/>
<source>New Playlist</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/utils/jspfloader.cpp" line="163"/>
<source>Failed to save tracks</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/utils/jspfloader.cpp" line="163"/>
@ -2438,7 +2438,7 @@ Try tweaking the filters for a new set of songs to play.</source>
<message>
<location filename="../src/libtomahawk/source.cpp" line="244"/>
<source>Scanning</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/source.cpp" line="278"/>
@ -2448,12 +2448,12 @@ Try tweaking the filters for a new set of songs to play.</source>
<message>
<location filename="../src/libtomahawk/source.cpp" line="283"/>
<source>Fetching</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/source.cpp" line="288"/>
<source>Parsing</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/source.cpp" line="417"/>
@ -2497,12 +2497,12 @@ enter the displayed PIN number here:</source>
<location filename="../src/tomahawktrayicon.cpp" line="59"/>
<location filename="../src/tomahawktrayicon.cpp" line="93"/>
<source>Hide Tomahawk Window</source>
<translation type="unfinished"/>
<translation>Tomahawkのウインドウを隠す</translation>
</message>
<message>
<location filename="../src/tomahawktrayicon.cpp" line="98"/>
<source>Show Tomahawk Window</source>
<translation type="unfinished"/>
<translation>Tomahawkのウインドウを表示</translation>
</message>
<message>
<location filename="../src/tomahawktrayicon.cpp" line="158"/>
@ -2512,12 +2512,12 @@ enter the displayed PIN number here:</source>
<message>
<location filename="../src/tomahawktrayicon.cpp" line="219"/>
<source>Play</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/tomahawktrayicon.cpp" line="226"/>
<source>Pause</source>
<translation type="unfinished"/>
<translation></translation>
</message>
</context>
<context>
@ -2525,12 +2525,12 @@ enter the displayed PIN number here:</source>
<message>
<location filename="../src/tomahawkwindow.ui" line="14"/>
<source>Tomahawk</source>
<translation type="unfinished"/>
<translation>Tomahawk</translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="75"/>
<source>&amp;Settings</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="81"/>
@ -2540,22 +2540,22 @@ enter the displayed PIN number here:</source>
<message>
<location filename="../src/tomahawkwindow.ui" line="100"/>
<source>&amp;Network</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="107"/>
<source>&amp;Window</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="114"/>
<source>&amp;Help</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="128"/>
<source>&amp;Quit</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="131"/>
@ -2580,27 +2580,27 @@ enter the displayed PIN number here:</source>
<message>
<location filename="../src/tomahawkwindow.ui" line="152"/>
<source>Update Collection</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="157"/>
<source>&amp;Configure Tomahawk...</source>
<translation type="unfinished"/>
<translation>Tomahawkを設定...</translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="165"/>
<source>Load &amp;XSPF...</source>
<translation type="unfinished"/>
<translation>XSPFを読み込み...</translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="170"/>
<source>Create &amp;New Playlist...</source>
<translation type="unfinished"/>
<translation>...</translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="175"/>
<source>About &amp;Tomahawk...</source>
<translation type="unfinished"/>
<translation>Tomahawk ...</translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="183"/>
@ -2625,7 +2625,7 @@ enter the displayed PIN number here:</source>
<message>
<location filename="../src/tomahawkwindow.ui" line="206"/>
<source>Minimize</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="209"/>
@ -2635,7 +2635,7 @@ enter the displayed PIN number here:</source>
<message>
<location filename="../src/tomahawkwindow.ui" line="214"/>
<source>Zoom</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/tomahawkwindow.ui" line="217"/>
@ -2744,7 +2744,7 @@ enter the displayed PIN number here:</source>
<message>
<location filename="../src/tomahawkwindow.cpp" line="614"/>
<source>Create New Station</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/tomahawkwindow.cpp" line="614"/>
@ -2844,17 +2844,17 @@ enter the displayed PIN number here:</source>
<message>
<location filename="../src/libtomahawk/playlist/topbar/topbar.cpp" line="49"/>
<source>Tracks</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/topbar/topbar.cpp" line="50"/>
<source>Artists</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/topbar/topbar.cpp" line="54"/>
<source>Filter</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/topbar/topbar.cpp" line="84"/>

View File

@ -152,13 +152,13 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<location filename="../src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp" line="72"/>
<location filename="../src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp" line="118"/>
<source>Click to show SuperCollection Tracks</source>
<translation type="unfinished"/>
<translation>Kliknij, aby pokazać utwory Superkolekcji</translation>
</message>
<message>
<location filename="../src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp" line="79"/>
<location filename="../src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp" line="136"/>
<source>Click to show SuperCollection Albums</source>
<translation type="unfinished"/>
<translation>Kliknij, aby pokazać albumy Superkolekcji</translation>
</message>
<message>
<location filename="../src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp" line="138"/>
@ -229,7 +229,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<location filename="../src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp" line="86"/>
<location filename="../src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp" line="125"/>
<source>Click to show SuperCollection Albums</source>
<translation type="unfinished"/>
<translation>Kliknij, aby pokazać albumy Superkolekcji</translation>
</message>
<message>
<location filename="../src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp" line="127"/>
@ -331,19 +331,19 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<context>
<name>AudioEngine</name>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="199"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="201"/>
<source>Tomahawk is stopped.</source>
<translation>Tomahawk jest zatrzymany.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="369"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="371"/>
<source>Tomahawk is playing &quot;%1&quot; by %2%3.</source>
<translation>Tomahawk odtwarza &quot;%1&quot; wykonawcy %2%3.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="372"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="374"/>
<source>on album %1</source>
<translation type="unfinished"/>
<translation>z albumu %1</translation>
</message>
</context>
<context>
@ -488,7 +488,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/delegateconfigwrapper.cpp" line="61"/>
<source>Delete Account</source>
<translation type="unfinished"/>
<translation>Usuń Konto</translation>
</message>
</context>
<context>
@ -530,7 +530,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/libtomahawk/jobview/IndexingJobItem.cpp" line="31"/>
<source>Indexing database</source>
<translation type="unfinished"/>
<translation>Indeksowanie bazy danych</translation>
</message>
</context>
<context>
@ -579,22 +579,22 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/accounts/lastfm/LastFmConfig.ui" line="41"/>
<source>Scrobble tracks to Last.fm</source>
<translation type="unfinished"/>
<translation>Skrobluj utwory do Last.fm</translation>
</message>
<message>
<location filename="../src/accounts/lastfm/LastFmConfig.ui" line="50"/>
<source>Username:</source>
<translation type="unfinished"/>
<translation>Użytkownik:</translation>
</message>
<message>
<location filename="../src/accounts/lastfm/LastFmConfig.ui" line="60"/>
<source>Password:</source>
<translation type="unfinished"/>
<translation>Hasło:</translation>
</message>
<message>
<location filename="../src/accounts/lastfm/LastFmConfig.ui" line="76"/>
<source>Test Login</source>
<translation type="unfinished"/>
<translation>Test logowania</translation>
</message>
</context>
<context>
@ -623,7 +623,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/LoadXSPFDialog.ui" line="22"/>
<source>Playlist URL</source>
<translation type="unfinished"/>
<translation>URL Listy odtwarzania</translation>
</message>
<message>
<location filename="../src/LoadXSPFDialog.ui" line="29"/>
@ -1113,13 +1113,13 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<location filename="../src/sourcetree/sourcedelegate.cpp" line="289"/>
<location filename="../src/sourcetree/sourcedelegate.cpp" line="330"/>
<source>Show</source>
<translation type="unfinished"/>
<translation>Pokaż</translation>
</message>
<message>
<location filename="../src/sourcetree/sourcedelegate.cpp" line="291"/>
<location filename="../src/sourcetree/sourcedelegate.cpp" line="332"/>
<source>Hide</source>
<translation type="unfinished"/>
<translation>Schowaj</translation>
</message>
</context>
<context>
@ -1170,17 +1170,17 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/sourcetree/items/sourceitem.cpp" line="77"/>
<source>Recently Played</source>
<translation type="unfinished"/>
<translation>Ostatnio Odtworzone</translation>
</message>
<message>
<location filename="../src/sourcetree/items/sourceitem.cpp" line="81"/>
<source>Loved Tracks</source>
<translation type="unfinished"/>
<translation>Ulubione Utwory</translation>
</message>
<message>
<location filename="../src/sourcetree/items/sourceitem.cpp" line="146"/>
<source>SuperCollection</source>
<translation type="unfinished"/>
<translation>Superkolekcja</translation>
</message>
</context>
<context>
@ -1246,17 +1246,17 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="269"/>
<source>Search History</source>
<translation type="unfinished"/>
<translation>Historia wyszukiwania</translation>
</message>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="271"/>
<source>My Music</source>
<translation type="unfinished"/>
<translation>Moja Muzyka</translation>
</message>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="279"/>
<source>SuperCollection</source>
<translation type="unfinished"/>
<translation>Superkolekcja</translation>
</message>
<message>
<location filename="../src/sourcetree/sourcesmodel.cpp" line="285"/>
@ -1299,7 +1299,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/accounts/spotify/SpotifyAccountConfig.ui" line="65"/>
<source>Username:</source>
<translation type="unfinished"/>
<translation>Użytkownik:</translation>
</message>
<message>
<location filename="../src/accounts/spotify/SpotifyAccountConfig.ui" line="72"/>
@ -1309,7 +1309,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/accounts/spotify/SpotifyAccountConfig.ui" line="79"/>
<source>Password:</source>
<translation type="unfinished"/>
<translation>Hasło:</translation>
</message>
<message>
<location filename="../src/accounts/spotify/SpotifyAccountConfig.ui" line="86"/>
@ -1319,7 +1319,7 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<message>
<location filename="../src/accounts/spotify/SpotifyAccountConfig.ui" line="116"/>
<source>High Quality Streaming</source>
<translation type="unfinished"/>
<translation>Strumieniowanie w wysokiej jakości</translation>
</message>
<message>
<location filename="../src/accounts/spotify/SpotifyAccountConfig.ui" line="186"/>
@ -1374,12 +1374,12 @@ indywidualnego profilu gustu.</translation>
<message>
<location filename="../src/stackedsettingsdialog.ui" line="98"/>
<source>Internet Services</source>
<translation type="unfinished"/>
<translation>Usługi internetowe</translation>
</message>
<message>
<location filename="../src/stackedsettingsdialog.ui" line="109"/>
<source>Install from file...</source>
<translation type="unfinished"/>
<translation>Zainstaluj z pliku...</translation>
</message>
<message>
<location filename="../src/stackedsettingsdialog.ui" line="129"/>
@ -1437,12 +1437,12 @@ indywidualnego profilu gustu.</translation>
<message>
<location filename="../src/AccountDelegate.cpp" line="200"/>
<source>Add Account</source>
<translation type="unfinished"/>
<translation>Dodaj Konto</translation>
</message>
<message>
<location filename="../src/AccountDelegate.cpp" line="250"/>
<source>Remove Account</source>
<translation type="unfinished"/>
<translation>Usuń Konto</translation>
</message>
<message>
<location filename="../src/AccountDelegate.cpp" line="360"/>
@ -1452,17 +1452,17 @@ indywidualnego profilu gustu.</translation>
<message>
<location filename="../src/AccountDelegate.cpp" line="585"/>
<source>Online</source>
<translation type="unfinished"/>
<translation>Online</translation>
</message>
<message>
<location filename="../src/AccountDelegate.cpp" line="590"/>
<source>Connecting...</source>
<translation type="unfinished"/>
<translation>Łączenie...</translation>
</message>
<message>
<location filename="../src/AccountDelegate.cpp" line="595"/>
<source>Offline</source>
<translation type="unfinished"/>
<translation>Offline</translation>
</message>
</context>
<context>
@ -1475,7 +1475,7 @@ indywidualnego profilu gustu.</translation>
<message>
<location filename="../src/accounts/xmpp/googlewrapper/googlewrapper.cpp" line="83"/>
<source>Google Address</source>
<translation type="unfinished"/>
<translation>Adres Google</translation>
</message>
<message>
<location filename="../src/accounts/xmpp/googlewrapper/googlewrapper.cpp" line="84"/>
@ -1485,7 +1485,7 @@ indywidualnego profilu gustu.</translation>
<message>
<location filename="../src/accounts/xmpp/googlewrapper/googlewrapper.cpp" line="85"/>
<source>username@gmail.com</source>
<translation type="unfinished"/>
<translation>użytkownik@gmail.com</translation>
</message>
</context>
<context>
@ -1501,7 +1501,7 @@ indywidualnego profilu gustu.</translation>
<message>
<location filename="../src/accounts/xmpp/googlewrapper/googlewrapper.cpp" line="61"/>
<source>Add Friend</source>
<translation type="unfinished"/>
<translation>Dodaj Znajomego</translation>
</message>
<message>
<location filename="../src/accounts/xmpp/googlewrapper/googlewrapper.cpp" line="62"/>
@ -1559,7 +1559,7 @@ indywidualnego profilu gustu.</translation>
<location filename="../src/accounts/twitter/twitterconfigwidget.cpp" line="141"/>
<location filename="../src/accounts/twitter/twitterconfigwidget.cpp" line="189"/>
<source>Tweet!</source>
<translation type="unfinished"/>
<translation>Tweet!</translation>
</message>
<message>
<location filename="../src/accounts/twitter/twitterconfigwidget.cpp" line="66"/>

View File

@ -331,17 +331,17 @@ Remember: Only allow peers to connect if you trust who they are and if you have
<context>
<name>AudioEngine</name>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="199"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="201"/>
<source>Tomahawk is stopped.</source>
<translation>Tomahawk está inativo.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="369"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="371"/>
<source>Tomahawk is playing &quot;%1&quot; by %2%3.</source>
<translation>Tomahawk está reproduzindo &quot;%1&quot; por %2%3.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="372"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="374"/>
<source>on album %1</source>
<translation type="unfinished"/>
</message>

3524
lang/tomahawk_ru.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -333,17 +333,17 @@ Kom ihåg: Tillåt endast anslutning från klienter du litar på, och som har la
<context>
<name>AudioEngine</name>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="199"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="201"/>
<source>Tomahawk is stopped.</source>
<translation>Tomahawk är stoppad.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="369"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="371"/>
<source>Tomahawk is playing &quot;%1&quot; by %2%3.</source>
<translation>Tomahawk spelar upp &quot;%1&quot; av %2%3.</translation>
</message>
<message>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="372"/>
<location filename="../src/libtomahawk/audio/audioengine.cpp" line="374"/>
<source>on album %1</source>
<translation> album %1</translation>
</message>

View File

@ -127,14 +127,12 @@ LastFmPlugin::getInfo( Tomahawk::InfoSystem::InfoRequestData requestData )
void
LastFmPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
LastFmPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
Q_UNUSED( caller )
Q_UNUSED( pushFlags )
switch ( type )
switch ( pushData.type )
{
case InfoSubmitNowPlaying:
nowPlaying( pushInfoPair.second );
nowPlaying( pushData.infoPair.second );
break;
case InfoSubmitScrobble:
@ -143,7 +141,7 @@ LastFmPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tom
case InfoLove:
case InfoUnLove:
sendLoveSong( type, pushInfoPair.second );
sendLoveSong( pushData.type, pushData.infoPair.second );
break;
default:

View File

@ -62,7 +62,7 @@ protected slots:
virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData );
virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags );
virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData );
private:
void fetchCoverArt( Tomahawk::InfoSystem::InfoRequestData requestData );

View File

@ -64,11 +64,8 @@ Tomahawk::InfoSystem::XmppInfoPlugin::~XmppInfoPlugin()
void
Tomahawk::InfoSystem::XmppInfoPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
Tomahawk::InfoSystem::XmppInfoPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
Q_UNUSED( caller )
Q_UNUSED( pushFlags )
tDebug() << Q_FUNC_INFO << m_sipPlugin->m_client->jid().full();
if( m_sipPlugin->m_account->configuration().value("publishtracks").toBool() == false )
@ -77,12 +74,12 @@ Tomahawk::InfoSystem::XmppInfoPlugin::pushInfo( QString caller, Tomahawk::InfoSy
return;
}
switch ( type )
switch ( pushData.type )
{
case InfoNowPlaying:
case InfoNowResumed:
m_pauseTimer.stop();
audioStarted( pushInfoPair );
audioStarted( pushData.infoPair );
break;
case InfoNowPaused:
m_pauseTimer.start( PAUSE_TIMEOUT * 1000 );

View File

@ -47,7 +47,7 @@ namespace Tomahawk {
void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData );
protected slots:
void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags );
void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData );
void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
private slots:

View File

@ -93,14 +93,12 @@ AudioControls::AudioControls( QWidget* parent )
ui->metaDataArea->setStyleSheet( "QWidget#metaDataArea {\nborder-width: 4px;\nborder-image: url(" RESPATH "images/now-playing-panel.png) 4 4 4 4 stretch stretch; }" );
ui->seekSlider->setEnabled( true );
ui->seekSlider->setTimeLine( &m_sliderTimeLine );
ui->volumeSlider->setRange( 0, 100 );
ui->volumeSlider->setValue( AudioEngine::instance()->volume() );
m_phononTickCheckTimer.setSingleShot( true );
m_sliderTimeLine.setCurveShape( QTimeLine::LinearCurve );
ui->seekSlider->setTimeLine( &m_sliderTimeLine );
connect( &m_phononTickCheckTimer, SIGNAL( timeout() ), SLOT( phononTickCheckTimeout() ) );
connect( &m_sliderTimeLine, SIGNAL( frameChanged( int ) ), ui->seekSlider, SLOT( setValue( int ) ) );
@ -200,17 +198,22 @@ AudioControls::onPlaybackStarted( const Tomahawk::result_ptr& result )
ui->seekSlider->setRange( 0, duration );
ui->seekSlider->setValue( 0 );
ui->seekSlider->setEnabled( AudioEngine::instance()->canSeek() );
m_phononTickCheckTimer.stop();
m_sliderTimeLine.stop();
m_sliderTimeLine.setDuration( duration );
m_sliderTimeLine.setFrameRange( 0, duration );
m_sliderTimeLine.setCurveShape( QTimeLine::LinearCurve );
m_sliderTimeLine.setCurrentTime( 0 );
m_seekMsecs = -1;
ui->seekSlider->setVisible( true );
int updateRate = (double)1000 / ( (double)ui->seekSlider->contentsRect().width() / (double)( duration / 1000 ) );
m_sliderTimeLine.setUpdateInterval( qBound( 40, updateRate, 500 ) );
m_noTimeChange = false;
m_lastSliderCheck = 0;
}
@ -380,10 +383,11 @@ AudioControls::onPlaybackTimer( qint64 msElapsed )
if ( sender() != &m_phononTickCheckTimer )
m_phononTickCheckTimer.start( 1000 );
int currentTime = m_sliderTimeLine.currentTime();
if ( m_noTimeChange )
{
if ( m_sliderTimeLine.currentTime() != msElapsed )
if ( currentTime != msElapsed )
{
m_sliderTimeLine.setPaused( true );
m_noTimeChange = false;
@ -392,12 +396,12 @@ AudioControls::onPlaybackTimer( qint64 msElapsed )
m_sliderTimeLine.resume();
}
}
else if ( m_sliderTimeLine.currentTime() >= msElapsed || m_seekMsecs != -1 )
else if ( currentTime >= msElapsed || m_seekMsecs != -1 )
{
m_sliderTimeLine.setPaused( true );
m_noTimeChange = false;
if ( m_sliderTimeLine.currentTime() == msElapsed )
if ( currentTime == msElapsed )
m_noTimeChange = true;
m_sliderTimeLine.setCurrentTime( msElapsed );
@ -407,12 +411,10 @@ AudioControls::onPlaybackTimer( qint64 msElapsed )
}
else if ( m_sliderTimeLine.duration() > msElapsed && m_sliderTimeLine.state() == QTimeLine::NotRunning && AudioEngine::instance()->state() == AudioEngine::Playing )
{
ui->seekSlider->setEnabled( AudioEngine::instance()->canSeek() );
m_sliderTimeLine.start();
}
else if ( m_sliderTimeLine.state() == QTimeLine::Paused && AudioEngine::instance()->state() != AudioEngine::Paused )
{
ui->seekSlider->setEnabled( AudioEngine::instance()->canSeek() );
m_sliderTimeLine.resume();
}

View File

@ -132,7 +132,9 @@ AudioEngine::play()
if ( isPaused() )
{
setVolume( m_volume );
m_mediaObject->play();
setVolume( m_volume );
emit resumed();
if ( TomahawkSettings::instance()->privateListeningMode() != TomahawkSettings::FullyPrivate )
@ -145,11 +147,12 @@ AudioEngine::play()
trackInfo["albumpos"] = QString::number( m_currentTrack->albumpos() );
trackInfo["duration"] = QString::number( m_currentTrack->duration() );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo(
Tomahawk::InfoSystem::InfoPushData pushData (
s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNowResumed,
QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ),
Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( pushData );
}
}
else
@ -162,10 +165,11 @@ AudioEngine::pause()
{
tDebug( LOGEXTRA ) << Q_FUNC_INFO;
m_volume = volume();
m_mediaObject->pause();
emit paused();
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNowPaused, QVariant(), Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( Tomahawk::InfoSystem::InfoPushData( s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNowPaused, QVariant(), Tomahawk::InfoSystem::PushNoFlag ) );
}
@ -331,10 +335,12 @@ AudioEngine::sendWaitingNotificationSlot() const
QVariantMap retryInfo;
retryInfo["message"] = QString( "The current track could not be resolved. Tomahawk will pick back up with the next resolvable track from this source." );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo(
Tomahawk::InfoSystem::InfoPushData pushData (
s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNotifyUser,
QVariant::fromValue< QVariantMap >( retryInfo ),
Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( pushData );
}
@ -380,10 +386,12 @@ AudioEngine::onNowPlayingInfoReady()
#endif
}
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo(
Tomahawk::InfoSystem::InfoPushData pushData (
s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNotifyUser,
QVariant::fromValue< QVariantMap >( playInfo ),
Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( pushData );
}
@ -475,11 +483,13 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
trackInfo["duration"] = QString::number( m_currentTrack->duration() );
trackInfo["albumpos"] = QString::number( m_currentTrack->albumpos() );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo(
Tomahawk::InfoSystem::InfoPushData pushData (
s_aeInfoIdentifier,
Tomahawk::InfoSystem::InfoNowPlaying,
QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ),
Tomahawk::InfoSystem::PushShortUrlFlag );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( pushData );
}
}
}

View File

@ -160,6 +160,7 @@ private:
mutable QStringList m_supportedMimeTypes;
AudioState m_state;
unsigned int m_volume;
static AudioEngine* s_instance;
};

View File

@ -123,12 +123,12 @@ GlobalActionManager::openLink( const QString& title, const QString& artist, cons
void
GlobalActionManager::shortenLink( const QUrl& url, const QVariantMap &callbackMap )
GlobalActionManager::shortenLink( const QUrl& url, const QVariant &callbackObj )
{
if ( QThread::currentThread() != thread() )
{
qDebug() << "Reinvoking in correct thread:" << Q_FUNC_INFO;
QMetaObject::invokeMethod( this, "shortenLink", Qt::QueuedConnection, Q_ARG( QUrl, url ), Q_ARG( QVariantMap, callbackMap ) );
QMetaObject::invokeMethod( this, "shortenLink", Qt::QueuedConnection, Q_ARG( QUrl, url ), Q_ARG( QVariant, callbackObj ) );
return;
}
@ -136,8 +136,8 @@ GlobalActionManager::shortenLink( const QUrl& url, const QVariantMap &callbackMa
request.setUrl( url );
QNetworkReply *reply = TomahawkUtils::nam()->get( request );
if ( !callbackMap.empty() )
reply->setProperty( "callbackMap", callbackMap );
if ( !callbackObj.isValid() )
reply->setProperty( "callbackobj", callbackObj );
connect( reply, SIGNAL( finished() ), SLOT( shortenLinkRequestFinished() ) );
connect( reply, SIGNAL( error( QNetworkReply::NetworkError ) ), SLOT( shortenLinkRequestError( QNetworkReply::NetworkError ) ) );
}
@ -900,9 +900,9 @@ GlobalActionManager::shortenLinkRequestFinished()
return;
}
QVariantMap callbackMap;
if ( reply->property( "callbackMap" ).canConvert< QVariantMap >() && !reply->property( "callbackMap" ).toMap().isEmpty() )
callbackMap = reply->property( "callbackMap" ).toMap();
QVariant callbackObj;
if ( reply->property( "callbackobj" ).canConvert< QVariant >() && reply->property( "callbackobj" ).isValid() )
callbackObj = reply->property( "callbackobj" );
// Check for the redirect attribute, as this should be the shortened link
QVariant urlVariant = reply->attribute( QNetworkRequest::RedirectionTargetAttribute );
@ -932,9 +932,9 @@ GlobalActionManager::shortenLinkRequestFinished()
else
{
if ( !error )
emit shortLinkReady( longUrl, shortUrl, callbackMap );
emit shortLinkReady( longUrl, shortUrl, callbackObj );
else
emit shortLinkReady( longUrl, longUrl, callbackMap );
emit shortLinkReady( longUrl, longUrl, callbackObj );
}
reply->deleteLater();

View File

@ -56,7 +56,7 @@ public:
void savePlaylistToFile( const Tomahawk::playlist_ptr& playlist, const QString& filename );
public slots:
void shortenLink( const QUrl& url, const QVariantMap &callbackMap = QVariantMap() );
void shortenLink( const QUrl& url, const QVariant &callbackObj = QVariant() );
bool parseTomahawkLink( const QString& link );
void waitingForResolved( bool );
@ -67,7 +67,7 @@ public slots:
void handlePlayTrack( const Tomahawk::query_ptr& qry );
signals:
void shortLinkReady( QUrl longUrl, QUrl shortUrl, QVariantMap callbackMap ) const;
void shortLinkReady( QUrl longUrl, QUrl shortUrl, QVariant callbackObj ) const;
private slots:
void shortenLinkRequestFinished();

View File

@ -42,12 +42,9 @@ public:
protected:
virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData );
virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
Q_UNUSED( caller )
Q_UNUSED( type)
Q_UNUSED( pushInfoPair )
Q_UNUSED( pushFlags )
Q_UNUSED( pushData );
}
virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );

View File

@ -60,12 +60,9 @@ protected slots:
virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData );
virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
Q_UNUSED( caller )
Q_UNUSED( type)
Q_UNUSED( pushInfoPair )
Q_UNUSED( pushFlags )
Q_UNUSED( pushData );
}
private:

View File

@ -49,12 +49,9 @@ public:
protected slots:
virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
Q_UNUSED( caller )
Q_UNUSED( type)
Q_UNUSED( pushInfoPair )
Q_UNUSED( pushFlags )
Q_UNUSED( pushData );
}
virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )

View File

@ -58,12 +58,9 @@ public slots:
protected slots:
virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData );
virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
Q_UNUSED( caller )
Q_UNUSED( type)
Q_UNUSED( pushInfoPair )
Q_UNUSED( pushFlags )
Q_UNUSED( pushData );
}

View File

@ -43,12 +43,9 @@ protected slots:
virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
virtual void notInCacheSlot( InfoStringHash criteria, InfoRequestData requestData );
virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
Q_UNUSED( caller )
Q_UNUSED( type)
Q_UNUSED( pushInfoPair )
Q_UNUSED( pushFlags )
Q_UNUSED( pushData );
}

View File

@ -46,12 +46,9 @@ public slots:
protected slots:
virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
Q_UNUSED( caller )
Q_UNUSED( type)
Q_UNUSED( pushInfoPair )
Q_UNUSED( pushFlags )
Q_UNUSED( pushData );
}
virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )

View File

@ -58,12 +58,9 @@ public slots:
protected slots:
virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData );
virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
Q_UNUSED( caller )
Q_UNUSED( type)
Q_UNUSED( pushInfoPair )
Q_UNUSED( pushFlags )
Q_UNUSED( pushData );
}
private:

View File

@ -101,23 +101,23 @@ AdiumPlugin::settingsChanged()
void
AdiumPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
AdiumPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
qDebug() << Q_FUNC_INFO;
if( !m_active )
return;
switch ( type )
switch ( pushData.type )
{
case InfoNowPlaying:
audioStarted( pushInfoPair );
audioStarted( pushData.infoPair );
break;
case InfoNowPaused:
audioPaused();
return;
case InfoNowResumed:
audioResumed( pushInfoPair );
audioResumed( pushData.infoPair );
break;
case InfoNowStopped:
audioStopped();

View File

@ -47,7 +47,7 @@ protected slots:
Q_UNUSED( requestData );
}
void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags );
virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData );
public slots:
virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )

View File

@ -63,18 +63,16 @@ FdoNotifyPlugin::~FdoNotifyPlugin()
}
void
FdoNotifyPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
FdoNotifyPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
Q_UNUSED( caller );
Q_UNUSED( pushFlags );
qDebug() << Q_FUNC_INFO;
QVariant pushData = pushInfoPair.second;
if ( type != Tomahawk::InfoSystem::InfoNotifyUser || !pushData.canConvert< QVariantMap >() )
QVariant inputData = pushData.infoPair.second;
if ( pushData.type != Tomahawk::InfoSystem::InfoNotifyUser || !inputData.canConvert< QVariantMap >() )
{
qDebug() << Q_FUNC_INFO << " not the right type or could not convert the hash";
return;
}
QVariantMap hash = pushData.value< QVariantMap >();
QVariantMap hash = inputData.value< QVariantMap >();
if ( !hash.contains( "message" ) )
{
qDebug() << Q_FUNC_INFO << " hash did not contain a message";

View File

@ -42,7 +42,7 @@ protected slots:
Q_UNUSED( requestData );
}
virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags );
virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData );
virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )
{

View File

@ -469,17 +469,15 @@ MprisPlugin::getInfo( Tomahawk::InfoSystem::InfoRequestData requestData )
void
MprisPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
MprisPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
Q_UNUSED( caller );
Q_UNUSED( pushFlags );
bool isPlayingInfo = false;
switch ( type )
switch ( pushData.type )
{
case InfoNowPlaying:
isPlayingInfo = true;
audioStarted( pushInfoPair.second );
audioStarted( pushData.infoPair.second );
break;
case InfoNowPaused:
isPlayingInfo = true;
@ -487,7 +485,7 @@ MprisPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Toma
break;
case InfoNowResumed:
isPlayingInfo = true;
audioResumed( pushInfoPair.second );
audioResumed( pushData.infoPair.second );
break;
case InfoNowStopped:
isPlayingInfo = true;

View File

@ -141,7 +141,7 @@ public slots:
protected slots:
void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags );
void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData );
private slots:
void stateChanged( AudioState newState, AudioState oldState );

View File

@ -172,17 +172,18 @@ InfoSystem::getInfo( const QString &caller, const QVariantMap &customData, const
bool
InfoSystem::pushInfo( const QString &caller, const InfoType type, const QVariant& input, const PushInfoFlags pushFlags )
InfoSystem::pushInfo( InfoPushData pushData )
{
tDebug() << Q_FUNC_INFO << "type is " << type;
tDebug() << Q_FUNC_INFO << "type is " << pushData.type;
if ( !m_inited || !m_infoSystemWorkerThreadController->worker() )
{
init();
return false;
}
PushInfoPair currPair( QVariantMap(), input );
QMetaObject::invokeMethod( m_infoSystemWorkerThreadController->worker(), "pushInfo", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( Tomahawk::InfoSystem::PushInfoPair, currPair ), Q_ARG( Tomahawk::InfoSystem::PushInfoFlags, pushFlags ) );
PushInfoPair pushInfoPair( QVariantMap(), pushData.input );
pushData.infoPair = pushInfoPair;
QMetaObject::invokeMethod( m_infoSystemWorkerThreadController->worker(), "pushInfo", Qt::QueuedConnection, Q_ARG( Tomahawk::InfoSystem::InfoPushData, pushData ) );
return true;
}
@ -199,8 +200,9 @@ InfoSystem::pushInfo( const QString &caller, const InfoTypeMap &input, const Pus
Q_FOREACH( InfoType type, input.keys() )
{
PushInfoPair currPair( QVariantMap(), input[ type ] );
QMetaObject::invokeMethod( m_infoSystemWorkerThreadController->worker(), "pushInfo", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( Tomahawk::InfoSystem::PushInfoPair, currPair ), Q_ARG( Tomahawk::InfoSystem::PushInfoFlags, pushFlags ) );
InfoPushData pushData( caller, type, input[ type ], pushFlags );
pushData.infoPair = PushInfoPair( QVariantMap(), pushData.input );
QMetaObject::invokeMethod( m_infoSystemWorkerThreadController->worker(), "pushInfo", Qt::QueuedConnection, Q_ARG( Tomahawk::InfoSystem::InfoPushData, pushData ) );
}
return true;

View File

@ -131,6 +131,13 @@ enum InfoType { // as items are saved in cache, mark them here to not change the
InfoLastInfo = 101 //WARNING: *ALWAYS* keep this last!
};
typedef QMap< InfoType, QVariant > InfoTypeMap;
typedef QMap< InfoType, uint > InfoTimeoutMap;
typedef QHash< QString, QString > InfoStringHash;
typedef QPair< QVariantMap, QVariant > PushInfoPair;
struct InfoRequestData {
quint64 requestId;
quint64 internalId; //do not assign to this; it may get overwritten by the InfoSystem
@ -164,10 +171,32 @@ struct InfoRequestData {
{}
};
typedef QMap< InfoType, QVariant > InfoTypeMap;
typedef QMap< InfoType, uint > InfoTimeoutMap;
typedef QHash< QString, QString > InfoStringHash;
typedef QPair< QVariantMap, QVariant > PushInfoPair;
struct InfoPushData {
QString caller;
InfoType type;
QVariant input;
PushInfoFlags pushFlags;
PushInfoPair infoPair;
InfoPushData()
: caller( QString() )
, type( Tomahawk::InfoSystem::InfoNoInfo )
, input( QVariant() )
, pushFlags( Tomahawk::InfoSystem::PushNoFlag )
, infoPair( Tomahawk::InfoSystem::PushInfoPair( QVariantMap(), QVariant() ) )
{}
InfoPushData( const QString &callr, const Tomahawk::InfoSystem::InfoType typ, const QVariant &inputvar, const Tomahawk::InfoSystem::PushInfoFlags pflags )
: caller( callr )
, type( typ )
, input( inputvar )
, pushFlags( pflags )
, infoPair( Tomahawk::InfoSystem::PushInfoPair( QVariantMap(), QVariant() ) )
{}
};
class DLLEXPORT InfoPlugin : public QObject
{
@ -189,7 +218,7 @@ signals:
protected slots:
virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData ) = 0;
virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair pushInfoPair, Tomahawk::InfoSystem::PushInfoFlags pushFlags ) = 0;
virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData ) = 0;
virtual void notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) = 0;
protected:
@ -201,6 +230,7 @@ private:
friend class InfoSystem;
};
typedef QWeakPointer< InfoPlugin > InfoPluginPtr;
class InfoSystemCacheThread : public QThread
@ -218,6 +248,7 @@ private:
QWeakPointer< InfoSystemCache > m_cache;
};
class InfoSystemWorkerThread : public QThread
{
Q_OBJECT
@ -233,6 +264,7 @@ private:
QWeakPointer< InfoSystemWorker > m_worker;
};
class DLLEXPORT InfoSystem : public QObject
{
Q_OBJECT
@ -246,7 +278,7 @@ public:
bool getInfo( const InfoRequestData &requestData );
//WARNING: if changing timeoutMillis above, also change in below function in .cpp file
bool getInfo( const QString &caller, const QVariantMap &customData, const InfoTypeMap &inputMap, const InfoTimeoutMap &timeoutMap = InfoTimeoutMap(), bool allSources = false );
bool pushInfo( const QString &caller, const InfoType type, const QVariant &input, const PushInfoFlags pushFlags );
bool pushInfo( InfoPushData pushData );
bool pushInfo( const QString &caller, const InfoTypeMap &input, const PushInfoFlags pushFlags );
public slots:
@ -297,6 +329,7 @@ inline uint qHash( Tomahawk::InfoSystem::InfoStringHash hash )
}
Q_DECLARE_METATYPE( Tomahawk::InfoSystem::InfoRequestData );
Q_DECLARE_METATYPE( Tomahawk::InfoSystem::InfoPushData );
Q_DECLARE_METATYPE( Tomahawk::InfoSystem::InfoStringHash );
Q_DECLARE_METATYPE( Tomahawk::InfoSystem::PushInfoPair );
Q_DECLARE_METATYPE( Tomahawk::InfoSystem::PushInfoFlags );

View File

@ -220,43 +220,43 @@ InfoSystemWorker::getInfo( Tomahawk::InfoSystem::InfoRequestData requestData )
void
InfoSystemWorker::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair input, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
InfoSystemWorker::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{
tDebug() << Q_FUNC_INFO << "type is " << type;
tDebug() << Q_FUNC_INFO << "type is " << pushData.type;
if ( pushFlags != PushNoFlag )
if ( pushData.pushFlags != PushNoFlag )
{
if ( pushFlags & PushShortUrlFlag )
if ( pushData.pushFlags & PushShortUrlFlag )
{
pushFlags = Tomahawk::InfoSystem::PushInfoFlags( pushFlags & ~PushShortUrlFlag );
QMetaObject::invokeMethod( this, "getShortUrl", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( Tomahawk::InfoSystem::PushInfoPair, input ), Q_ARG( Tomahawk::InfoSystem::PushInfoFlags, pushFlags ) );
pushData.pushFlags = Tomahawk::InfoSystem::PushInfoFlags( pushData.pushFlags & ~PushShortUrlFlag );
QMetaObject::invokeMethod( this, "getShortUrl", Qt::QueuedConnection, Q_ARG( Tomahawk::InfoSystem::InfoPushData, pushData ) );
return;
}
}
Q_FOREACH( InfoPluginPtr ptr, m_infoPushMap[ type ] )
Q_FOREACH( InfoPluginPtr ptr, m_infoPushMap[ pushData.type ] )
{
if( ptr )
QMetaObject::invokeMethod( ptr.data(), "pushInfo", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( Tomahawk::InfoSystem::PushInfoPair, input ), Q_ARG( Tomahawk::InfoSystem::PushInfoFlags, pushFlags ) );
QMetaObject::invokeMethod( ptr.data(), "pushInfo", Qt::QueuedConnection, Q_ARG( Tomahawk::InfoSystem::InfoPushData, pushData ) );
}
}
void
InfoSystemWorker::getShortUrl( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair input, Tomahawk::InfoSystem::PushInfoFlags pushFlags )
InfoSystemWorker::getShortUrl( Tomahawk::InfoSystem::InfoPushData pushData )
{
tDebug() << Q_FUNC_INFO << "type is " << type;
if ( !input.second.canConvert< Tomahawk::InfoSystem::InfoStringHash >() )
tDebug() << Q_FUNC_INFO << "type is " << pushData.type;
if ( !pushData.infoPair.second.canConvert< Tomahawk::InfoSystem::InfoStringHash >() )
{
QMetaObject::invokeMethod( this, "pushInfo", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( Tomahawk::InfoSystem::PushInfoPair, input ), Q_ARG( Tomahawk::InfoSystem::PushInfoFlags, pushFlags ) );
QMetaObject::invokeMethod( this, "pushInfo", Qt::QueuedConnection, Q_ARG( Tomahawk::InfoSystem::InfoPushData, pushData ) );
return;
}
Tomahawk::InfoSystem::InfoStringHash hash = input.second.value< Tomahawk::InfoSystem::InfoStringHash >();
Tomahawk::InfoSystem::InfoStringHash hash = pushData.infoPair.second.value< Tomahawk::InfoSystem::InfoStringHash >();
if ( hash.isEmpty() || !hash.contains( "title" ) || !hash.contains( "artist" ) )
{
QMetaObject::invokeMethod( this, "pushInfo", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( Tomahawk::InfoSystem::PushInfoPair, input ), Q_ARG( Tomahawk::InfoSystem::PushInfoFlags, pushFlags ) );
QMetaObject::invokeMethod( this, "pushInfo", Qt::QueuedConnection, Q_ARG( Tomahawk::InfoSystem::InfoPushData, pushData ) );
return;
}
@ -268,46 +268,38 @@ InfoSystemWorker::getShortUrl( QString caller, Tomahawk::InfoSystem::InfoType ty
QUrl longUrl = GlobalActionManager::instance()->openLink( title, artist, album );
QVariantMap callbackMap;
callbackMap[ "caller" ] = caller;
callbackMap[ "type" ] = QVariant::fromValue< Tomahawk::InfoSystem::InfoType >( type );
callbackMap[ "pushinfopair" ] = QVariant::fromValue< Tomahawk::InfoSystem::PushInfoPair >( input );
callbackMap[ "pushflags" ] = QVariant::fromValue< Tomahawk::InfoSystem::PushInfoFlags >( pushFlags );
GlobalActionManager::instance()->shortenLink( longUrl, callbackMap );
connect( GlobalActionManager::instance(), SIGNAL( shortLinkReady( QUrl, QUrl, QVariantMap ) ), this, SLOT( shortLinkReady( QUrl, QUrl, QVariantMap ) ), Qt::UniqueConnection );
GlobalActionManager::instance()->shortenLink( longUrl, QVariant::fromValue< Tomahawk::InfoSystem::InfoPushData >( pushData ) );
connect( GlobalActionManager::instance(), SIGNAL( shortLinkReady( QUrl, QUrl, QVariant ) ), this, SLOT( shortLinkReady( QUrl, QUrl, QVariant ) ), Qt::UniqueConnection );
m_shortLinksWaiting++;
}
void
InfoSystemWorker::shortLinkReady( QUrl longUrl, QUrl shortUrl, QVariantMap callbackMap )
InfoSystemWorker::shortLinkReady( QUrl longUrl, QUrl shortUrl, QVariant callbackObj )
{
tDebug() << Q_FUNC_INFO << "long url = " << longUrl << ", shortUrl = " << shortUrl;
m_shortLinksWaiting--;
if ( !m_shortLinksWaiting )
disconnect( GlobalActionManager::instance(), SIGNAL( shortLinkReady( QUrl, QUrl, QVariantMap ) ) );
disconnect( GlobalActionManager::instance(), SIGNAL( shortLinkReady( QUrl, QUrl, QVariant ) ) );
if ( callbackMap.isEmpty() || !callbackMap.contains( "caller" ) || !callbackMap.contains( "type" ) || !callbackMap.contains( "pushinfopair" ) || !callbackMap.contains( "pushflags" ) )
if ( !callbackObj.isValid() )
{
tDebug() << Q_FUNC_INFO << "callback map was empty, cannot continue";
tDebug() << Q_FUNC_INFO << "callback object was not valid, cannot continue";
return;
}
QString caller = callbackMap[ "caller" ].toString();
Tomahawk::InfoSystem::InfoType type = callbackMap[ "type" ].value< Tomahawk::InfoSystem::InfoType >();
Tomahawk::InfoSystem::PushInfoPair pushInfoPair = callbackMap[ "pushinfopair" ].value< Tomahawk::InfoSystem::PushInfoPair >();
Tomahawk::InfoSystem::PushInfoFlags pushFlags = callbackMap[ "pushflags" ].value< Tomahawk::InfoSystem::PushInfoFlags >();
Tomahawk::InfoSystem::InfoPushData pushData = callbackObj.value< Tomahawk::InfoSystem::InfoPushData >();
if ( !shortUrl.isEmpty() && longUrl != shortUrl )
{
QVariantMap flagProps = pushInfoPair.first;
QVariantMap flagProps = pushData.infoPair.first;
flagProps[ "shorturl" ] = shortUrl;
pushInfoPair.first = flagProps;
pushData.infoPair.first = flagProps;
}
tDebug() << Q_FUNC_INFO << "pushInfoPair first is: " << pushInfoPair.first.keys();
tDebug() << Q_FUNC_INFO << "pushInfoPair first is: " << pushData.infoPair.first.keys();
QMetaObject::invokeMethod( this, "pushInfo", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( Tomahawk::InfoSystem::PushInfoPair, pushInfoPair ), Q_ARG( Tomahawk::InfoSystem::PushInfoFlags, pushFlags ) );
QMetaObject::invokeMethod( this, "pushInfo", Qt::QueuedConnection, Q_ARG( Tomahawk::InfoSystem::InfoPushData, pushData ) );
}

View File

@ -60,14 +60,14 @@ public slots:
void init( Tomahawk::InfoSystem::InfoSystemCache* cache );
void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair input, Tomahawk::InfoSystem::PushInfoFlags pushFlags );
void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData );
void infoSlot( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
void addInfoPlugin( Tomahawk::InfoSystem::InfoPlugin* plugin );
void getShortUrl( QString caller, Tomahawk::InfoSystem::InfoType type, Tomahawk::InfoSystem::PushInfoPair input, Tomahawk::InfoSystem::PushInfoFlags pushFlags );
void shortLinkReady( QUrl longUrl, QUrl shortUrl, QVariantMap callbackMap );
void getShortUrl( Tomahawk::InfoSystem::InfoPushData data );
void shortLinkReady( QUrl longUrl, QUrl shortUrl, QVariant callbackObj );
private slots:
void checkTimeoutsTimerFired();

View File

@ -587,10 +587,12 @@ Query::setLoved( bool loved )
trackInfo["artist"] = artist();
trackInfo["album"] = album();
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo(
id(), Tomahawk::InfoSystem::InfoLove,
QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ),
Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoPushData pushData ( id(),
Tomahawk::InfoSystem::InfoLove,
QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ),
Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( pushData );
DatabaseCommand_SocialAction* cmd = new DatabaseCommand_SocialAction( q, QString( "Love" ), loved ? QString( "true" ) : QString( "false" ) );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );

View File

@ -1,7 +1,8 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2012, Leo Franchi <lfranchi@kde.org>
*
* Copyright 2012, Jeff Mitchell <jeffe@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@ -20,16 +21,33 @@
#include "tomahawkutilsgui.h"
#include <QPainter>
#include <QBuffer>
#include <QPaintEngine>
#include <QTimer>
using namespace Tomahawk;
#define COVER_FADEIN 1000
QWeakPointer< TomahawkUtils::SharedTimeLine > PixmapDelegateFader::s_stlInstance = QWeakPointer< TomahawkUtils::SharedTimeLine >();
QWeakPointer< TomahawkUtils::SharedTimeLine >
PixmapDelegateFader::stlInstance()
{
if ( s_stlInstance.isNull() )
s_stlInstance = QWeakPointer< TomahawkUtils::SharedTimeLine> ( new TomahawkUtils::SharedTimeLine() );
return s_stlInstance;
}
PixmapDelegateFader::PixmapDelegateFader( const artist_ptr& artist, const QSize& size, TomahawkUtils::ImageMode mode, bool forceLoad )
: m_artist( artist )
, m_size( size )
, m_mode( mode )
, m_startFrame( 0 )
, m_connectedToStl( false )
, m_fadePct( 100 )
{
if ( !m_artist.isNull() )
{
@ -44,6 +62,9 @@ PixmapDelegateFader::PixmapDelegateFader( const album_ptr& album, const QSize& s
: m_album( album )
, m_size( size )
, m_mode( mode )
, m_startFrame( 0 )
, m_connectedToStl( false )
, m_fadePct( 100 )
{
if ( !m_album.isNull() )
{
@ -59,6 +80,9 @@ PixmapDelegateFader::PixmapDelegateFader( const query_ptr& track, const QSize& s
: m_track( track )
, m_size( size )
, m_mode( mode )
, m_startFrame( 0 )
, m_connectedToStl( false )
, m_fadePct( 100 )
{
if ( !m_track.isNull() )
{
@ -82,13 +106,8 @@ PixmapDelegateFader::init()
m_current = QPixmap( m_size );
m_current.fill( Qt::transparent );
m_crossfadeTimeline.setDuration( COVER_FADEIN );
m_crossfadeTimeline.setUpdateInterval( 20 );
m_crossfadeTimeline.setFrameRange( 0, 1000 );
m_crossfadeTimeline.setDirection( QTimeLine::Forward );
connect( &m_crossfadeTimeline, SIGNAL( frameChanged( int ) ), this, SLOT( onAnimationStep( int ) ) );
connect( &m_crossfadeTimeline, SIGNAL( finished() ), this, SLOT( onAnimationFinished() ) );
stlInstance().data()->setUpdateInterval( 20 );
if ( m_currentReference.isNull() )
{
// No cover loaded yet, use default and don't fade in
@ -102,7 +121,11 @@ PixmapDelegateFader::init()
return;
}
m_crossfadeTimeline.start();
stlInstance().data()->setUpdateInterval( 20 );
m_startFrame = stlInstance().data()->currentFrame();
m_connectedToStl = true;
m_fadePct = 0;
connect( stlInstance().data(), SIGNAL( frameChanged( int ) ), this, SLOT( onAnimationStep( int ) ) );
}
@ -141,7 +164,17 @@ PixmapDelegateFader::setPixmap( const QPixmap& pixmap )
if ( pixmap.isNull() )
return;
if ( m_crossfadeTimeline.state() == QTimeLine::Running )
QByteArray ba;
QBuffer buffer( &ba );
buffer.open( QIODevice::WriteOnly );
pixmap.save( &buffer, "PNG" );
QString newImageMd5 = TomahawkUtils::md5( buffer.data() );
if ( m_oldImageMd5 == newImageMd5 )
return;
m_oldImageMd5 = newImageMd5;
if ( m_connectedToStl )
{
m_pixmapQueue.enqueue( pixmap );
return;
@ -150,15 +183,25 @@ PixmapDelegateFader::setPixmap( const QPixmap& pixmap )
m_oldReference = m_currentReference;
m_currentReference = pixmap;
m_crossfadeTimeline.start();
m_startFrame = stlInstance().data()->currentFrame();
m_connectedToStl = true;
m_fadePct = 0;
connect( stlInstance().data(), SIGNAL( frameChanged( int ) ), this, SLOT( onAnimationStep( int ) ) );
}
void
PixmapDelegateFader::onAnimationStep( int step )
{
const qreal opacity = ((qreal)step / 1000.);
const qreal oldOpacity = ( 1000. - step ) / 1000. ;
m_fadePct = (float)( step - m_startFrame ) / 10.0;
if ( m_fadePct > 100.0 )
m_fadePct = 100.0;
if ( m_fadePct == 100.0 )
QTimer::singleShot( 0, this, SLOT( onAnimationFinished() ) );
const qreal opacity = m_fadePct / 100.0;
const qreal oldOpacity = ( 100.0 - m_fadePct ) / 100.0;
m_current.fill( Qt::transparent );
// Update our pixmap with the new opacity
@ -227,12 +270,12 @@ void
PixmapDelegateFader::onAnimationFinished()
{
m_oldReference = QPixmap();
onAnimationStep( 1000 );
onAnimationStep( INT_MAX );
disconnect( stlInstance().data(), SIGNAL( frameChanged( int ) ), this, SLOT( onAnimationStep( int ) ) );
if ( !m_pixmapQueue.isEmpty() )
{
setPixmap( m_pixmapQueue.dequeue() );
}
}

View File

@ -1,6 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2011-2012, Leo Franchi <lfranchi@kde.org>
* Copyright 2012, Jeff Mitchell <jeffe@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -26,6 +27,7 @@
#include <QObject>
#include <QTimeLine>
#include <QQueue>
#include <QWeakPointer>
namespace Tomahawk
{
@ -39,6 +41,9 @@ namespace Tomahawk
class PixmapDelegateFader : public QObject
{
Q_OBJECT
static QWeakPointer< TomahawkUtils::SharedTimeLine > stlInstance();
public:
PixmapDelegateFader( const artist_ptr& artist, const QSize& size, TomahawkUtils::ImageMode mode = TomahawkUtils::Original, bool forceLoad = true );
PixmapDelegateFader( const album_ptr& album, const QSize& size, TomahawkUtils::ImageMode mode = TomahawkUtils::Original, bool forceLoad = true );
@ -68,10 +73,16 @@ private:
query_ptr m_track;
QSize m_size;
TomahawkUtils::ImageMode m_mode;
int m_startFrame;
bool m_connectedToStl;
float m_fadePct;
QString m_oldImageMd5;
QQueue<QPixmap> m_pixmapQueue;
QTimeLine m_crossfadeTimeline;
QPixmap m_currentReference, m_oldReference, m_current;
static QWeakPointer< TomahawkUtils::SharedTimeLine > s_stlInstance;
};
}

View File

@ -609,7 +609,8 @@ removeDirectory( const QString& dir )
}
quint64 infosystemRequestId()
quint64
infosystemRequestId()
{
QMutexLocker locker( &s_infosystemRequestIdMutex );
quint64 result = s_infosystemRequestId;
@ -633,4 +634,42 @@ crash()
*a = 1;
}
SharedTimeLine::SharedTimeLine()
: QObject( 0 )
, m_refcount( 0 )
{
m_timeline.setCurveShape( QTimeLine::LinearCurve );
m_timeline.setFrameRange( 0, INT_MAX );
m_timeline.setDuration( INT_MAX );
m_timeline.setUpdateInterval( 40 );
connect( &m_timeline, SIGNAL( frameChanged( int ) ), SIGNAL( frameChanged( int ) ) );
}
void
SharedTimeLine::connectNotify( const char* signal )
{
if ( signal == QMetaObject::normalizedSignature( SIGNAL( frameChanged( int ) ) ) ) {
m_refcount++;
if ( m_timeline.state() != QTimeLine::Running )
m_timeline.start();
}
}
void
SharedTimeLine::disconnectNotify( const char* signal )
{
if ( signal == QMetaObject::normalizedSignature( SIGNAL( frameChanged( int ) ) ) )
{
m_refcount--;
if ( m_timeline.state() == QTimeLine::Running && m_refcount == 0 )
{
m_timeline.stop();
deleteLater();
}
}
}
} // ns

View File

@ -26,9 +26,9 @@
#include <QtCore/QThread>
#include <QtNetwork/QNetworkProxy>
#include <QtCore/QStringList>
#include <QTimeLine>
#include <typedefs.h>
#define RESPATH ":/data/"
@ -61,6 +61,34 @@ namespace TomahawkUtils
ScaledCover
};
class DLLEXPORT SharedTimeLine : public QObject
{
Q_OBJECT
public:
SharedTimeLine();
virtual ~SharedTimeLine() {}
int currentFrame() { return m_timeline.currentFrame(); }
void setUpdateInterval( int msec ) { if ( msec != m_timeline.updateInterval() ) m_timeline.setUpdateInterval( msec ); }
signals:
void frameChanged( int );
protected slots:
virtual void connectNotify( const char *signal );
virtual void disconnectNotify( const char *signal );
private:
int m_refcount;
QTimeLine m_timeline;
};
class DLLEXPORT NetworkProxyFactory : public QNetworkProxyFactory
{
public:
@ -85,6 +113,7 @@ namespace TomahawkUtils
QStringList m_noProxyHosts;
QNetworkProxy m_proxy;
};
DLLEXPORT QString appFriendlyVersion();
@ -107,7 +136,7 @@ namespace TomahawkUtils
DLLEXPORT QString md5( const QByteArray& data );
DLLEXPORT bool removeDirectory( const QString& dir );
/**
* This helper is designed to help "update" an existing playlist with a newer revision of itself.
* To avoid re-loading the whole playlist and re-resolving tracks that are the same in the old playlist,

View File

@ -1,6 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2011 - 2012, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2012, Jeff Mitchell <jeffe@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -18,22 +19,33 @@
#include "FadingPixmap.h"
#include "utils/logger.h"
#include <QTimer>
#include <QBuffer>
#include <QPainter>
#define ANIMATION_TIME 1000
QWeakPointer< TomahawkUtils::SharedTimeLine > FadingPixmap::s_stlInstance = QWeakPointer< TomahawkUtils::SharedTimeLine >();
QWeakPointer< TomahawkUtils::SharedTimeLine >
FadingPixmap::stlInstance()
{
if ( s_stlInstance.isNull() )
s_stlInstance = QWeakPointer< TomahawkUtils::SharedTimeLine> ( new TomahawkUtils::SharedTimeLine() );
return s_stlInstance;
}
FadingPixmap::FadingPixmap( QWidget* parent )
: QLabel( parent )
, m_oldPixmap( QPixmap() )
, m_fadePct( 100 )
, m_startFrame( 0 )
{
// setCursor( Qt::PointingHandCursor );
m_timeLine = new QTimeLine( ANIMATION_TIME, this );
m_timeLine->setUpdateInterval( 20 );
m_timeLine->setEasingCurve( QEasingCurve::Linear );
connect( m_timeLine, SIGNAL( frameChanged( int ) ), SLOT( onAnimationStep( int ) ) );
connect( m_timeLine, SIGNAL( finished() ), SLOT( onAnimationFinished() ) );
}
@ -45,8 +57,14 @@ FadingPixmap::~FadingPixmap()
void
FadingPixmap::onAnimationStep( int frame )
{
m_fadePct = (float)frame / 10.0;
m_fadePct = (float)( frame - m_startFrame ) / 10.0;
if ( m_fadePct > 100.0 )
m_fadePct = 100.0;
repaint();
if ( m_fadePct == 100.0 )
QTimer::singleShot( 0, this, SLOT( onAnimationFinished() ) );
}
@ -55,18 +73,28 @@ FadingPixmap::onAnimationFinished()
{
m_oldPixmap = QPixmap();
repaint();
disconnect( stlInstance().data(), SIGNAL( frameChanged( int ) ), this, SLOT( onAnimationStep( int ) ) );
if ( m_pixmapQueue.count() )
{
setPixmap( m_pixmapQueue.takeFirst() );
}
}
void
FadingPixmap::setPixmap( const QPixmap& pixmap, bool clearQueue )
{
if ( m_timeLine->state() == QTimeLine::Running )
QByteArray ba;
QBuffer buffer( &ba );
buffer.open( QIODevice::WriteOnly );
pixmap.save( &buffer, "PNG" );
QString newImageMd5 = TomahawkUtils::md5( buffer.data() );
if ( m_oldImageMd5 == newImageMd5 )
return;
m_oldImageMd5 = newImageMd5;
if ( !m_oldPixmap.isNull() )
{
if ( clearQueue )
m_pixmapQueue.clear();
@ -78,9 +106,10 @@ FadingPixmap::setPixmap( const QPixmap& pixmap, bool clearQueue )
m_oldPixmap = m_pixmap;
m_pixmap = pixmap;
m_timeLine->setFrameRange( 0, 1000 );
m_timeLine->setDirection( QTimeLine::Forward );
m_timeLine->start();
stlInstance().data()->setUpdateInterval( 20 );
m_startFrame = stlInstance().data()->currentFrame();
m_fadePct = 0;
connect( stlInstance().data(), SIGNAL( frameChanged( int ) ), this, SLOT( onAnimationStep( int ) ) );
}

View File

@ -1,6 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2011 - 2012, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2012, Jeff Mitchell <jeffe@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,9 +20,12 @@
#ifndef FADINGPIXMAP_H
#define FADINGPIXMAP_H
#include "utils/tomahawkutils.h"
#include <QLabel>
#include <QPaintEvent>
#include <QTimeLine>
#include <QWeakPointer>
#include "dllmacro.h"
@ -33,12 +37,15 @@ class DLLEXPORT FadingPixmap : public QLabel
{
Q_OBJECT
static QWeakPointer< TomahawkUtils::SharedTimeLine > stlInstance();
public:
FadingPixmap( QWidget* parent = 0 );
virtual ~FadingPixmap();
public slots:
virtual void setPixmap( const QPixmap& pixmap, bool clearQueue = true );
void onAnimationStep( int frame );
signals:
void clicked();
@ -48,17 +55,21 @@ protected:
void mouseReleaseEvent( QMouseEvent* event );
private slots:
void onAnimationStep( int frame );
void onAnimationFinished();
private:
QPixmap m_pixmap;
QPixmap m_oldPixmap;
QString m_oldImageMd5;
QList<QPixmap> m_pixmapQueue;
QTimeLine* m_timeLine;
int m_fadePct;
int m_startFrame;
static QWeakPointer< TomahawkUtils::SharedTimeLine > s_stlInstance;
};
#endif

View File

@ -72,19 +72,15 @@ SeekSlider::mousePressEvent( QMouseEvent* event )
void
SeekSlider::setValue( int value )
{
int newVal = value;
if ( value > maximum() )
newVal = maximum();
if ( value < minimum() )
newVal = minimum();
// int newVal = qBound( minimum(), value, maximum() );
if ( !m_timeLine || sender() != m_timeLine )
{
QSlider::setValue( newVal );
QSlider::setValue( value );
return;
}
blockSignals( true );
QSlider::setValue( newVal );
QSlider::setValue( value );
blockSignals( false );
}

View File

@ -86,11 +86,13 @@ Scrobbler::trackStarted( const Tomahawk::result_ptr& track )
trackInfo["album"] = track->album()->name();
trackInfo["duration"] = QString::number( track->duration() );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo(
Tomahawk::InfoSystem::InfoPushData pushData (
s_scInfoIdentifier, Tomahawk::InfoSystem::InfoSubmitNowPlaying,
QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ),
Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( pushData );
// liblastfm forces 0-length tracks to scrobble after 4 minutes, stupid.
if ( track->duration() == 0 )
m_scrobblePoint = ScrobblePoint( 30 );
@ -139,9 +141,11 @@ Scrobbler::scrobble()
{
Q_ASSERT( QThread::currentThread() == thread() );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo(
Tomahawk::InfoSystem::InfoPushData pushData (
s_scInfoIdentifier, Tomahawk::InfoSystem::InfoSubmitScrobble,
QVariant(), Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( pushData );
}

View File

@ -450,6 +450,7 @@ TomahawkApp::registerMetaTypes()
qRegisterMetaType< Tomahawk::InfoSystem::PushInfoFlags >( "Tomahawk::InfoSystem::PushInfoFlags" );
qRegisterMetaType< Tomahawk::InfoSystem::PushInfoPair >( "Tomahawk::InfoSystem::PushInfoPair" );
qRegisterMetaType< Tomahawk::InfoSystem::InfoRequestData >( "Tomahawk::InfoSystem::InfoRequestData" );
qRegisterMetaType< Tomahawk::InfoSystem::InfoPushData >( "Tomahawk::InfoSystem::InfoPushData" );
qRegisterMetaType< Tomahawk::InfoSystem::InfoSystemCache* >( "Tomahawk::InfoSystem::InfoSystemCache*" );
qRegisterMetaType< Tomahawk::InfoSystem::InfoPlugin* >( "Tomahawk::InfoSystem::InfoPlugin*" );
qRegisterMetaType< QList< Tomahawk::InfoSystem::InfoStringHash > >("QList< Tomahawk::InfoSystem::InfoStringHash > ");