1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-09-06 20:20:41 +02:00

Compare commits

...

588 Commits

Author SHA1 Message Date
Jeff Mitchell
5afce9327f Fix proxying (on Qt 4.8? With current OpenSSH?) 2012-04-24 14:44:19 -04:00
Jeff Mitchell
db413b2049 truthiness++ 2012-04-22 13:52:22 -04:00
Jeff Mitchell
646d2fbfd3 I'm stupid. Put the right version first. 2012-04-21 15:18:27 -04:00
Jeff Mitchell
dcb46877f0 Changelogify 2012-04-21 14:54:02 -04:00
Jeff Mitchell
985b54d84d Add zerconf protocol v2 2012-04-21 14:52:59 -04:00
Jeff Mitchell
c6ca3d8660 I can't think of any reason that removing this wasn't a mistake, so I'm
putting it back
2012-04-07 18:58:10 -04:00
Christian Muehlhaeuser
a104e92471 * Merged ChangeLog. 2012-04-07 10:10:52 +02:00
Christian Muehlhaeuser
1929804541 * Merged audio backend fixes from master. 2012-04-07 10:10:10 +02:00
Christian Muehlhaeuser
a564b3b272 * Don't update seek slider too often, use less cpu. 2012-04-07 10:07:05 +02:00
Christian Muehlhaeuser
d083528ad5 * Updated ChangeLog. 2012-04-07 08:10:31 +02:00
Christian Muehlhaeuser
4d63a9462d * Updated translations. 2012-04-07 08:09:37 +02:00
Christian Muehlhaeuser
5a64886b7c * Bumped to 0.4.2 and updated ChangeLog. 2012-04-07 06:46:13 +02:00
Leo Franchi
76986e8908 Backport case-insensitivity fix from master 2012-04-06 22:07:38 -03:00
Christian Muehlhaeuser
9a9a7148af * Properly fix time display in stable. 2012-04-05 06:17:40 +02:00
Christian Muehlhaeuser
aec7a0b140 * Fixed crash in AudioControls. (merge) 2012-04-05 05:39:50 +02:00
Christian Muehlhaeuser
eff42af593 * Updated ChangeLog. 2012-04-04 02:44:18 +02:00
Christian Muehlhaeuser
ad2b54ad90 * Bump version to 0.4.1. 2012-04-04 01:55:00 +02:00
Christian Muehlhaeuser
4e316a48ea * Fixed non debug builds. 2012-04-04 01:54:14 +02:00
Christian Muehlhaeuser
87863ae7e2 * Fixed about dialog for non debug releases. 2012-04-04 01:54:05 +02:00
Jeff Mitchell
5e439b990f See if this fixes Chris' time-updating problem 2012-03-31 13:06:50 -04:00
Leo Franchi
5dcf426cdf TWK-770: Fix echonest sentence summary grammar 2012-03-31 10:03:53 -04:00
Leo Franchi
5b6c4560ae TWK-785: Rename playlist after revision is created so plitem is selectable 2012-03-31 09:53:47 -04:00
Leo Franchi
fec670f27c TWK-793: Let the sourcetreeview sort before we scroll otherwise we might scroll the wrong amount 2012-03-31 09:26:30 -04:00
Leo Franchi
fb13ccd285 Oops, fix signals/slot params 2012-03-31 09:26:07 -04:00
Leo Franchi
b3b70cea82 TWK-795: Filter dups from last.fm top artists 2012-03-31 09:05:14 -04:00
Leo Franchi
f84d08e011 Don't sort related artists in footnotes 2012-03-31 08:49:18 -04:00
Leo Franchi
9c5966000c TWK-799: Don't set autoupdate when loading playlist view 2012-03-30 17:47:28 -04:00
Leo Franchi
79bfdec895 TWK-798: Start playing first resolvable track when double-clicking on a playlist item 2012-03-30 17:14:08 -04:00
Leo Franchi
9f5215302c various updater fixes 2012-03-30 14:32:01 -04:00
Leo Franchi
73d7ba03f5 TWK-815: Try using foreground text color when drawing grey bg, white on grey is hard to read 2012-03-30 13:34:48 -04:00
Leo Franchi
d623bbefc2 Fix crash on exit 2012-03-30 13:27:36 -04:00
Leo Franchi
907dad95e1 TWK-721: Don't flicker from officialtracks to supercollection tracks.
If the second infosystem albumtracks request comes back empty but the first one
came back with tracks, this is not a failure and so keep the official tracks
2012-03-30 12:09:59 -04:00
Leo Franchi
565217a53a TWK-725: Some extra pointer safety 2012-03-30 10:42:11 -04:00
Christian Muehlhaeuser
bee6485475 * Fixed crash situation in AudioControls.
(cherry picked from commit a2bfd73d55)

Conflicts:

	src/audiocontrols.cpp
2012-03-30 10:31:07 -04:00
Christian Muehlhaeuser
ace18dfa1f * Prevent race condition.
(cherry picked from commit ebbedb2b99)
2012-03-30 10:30:29 -04:00
Christian Muehlhaeuser
95f1162b6e * Fixed cached resolving.
(cherry picked from commit bd098e3ff2)
2012-03-30 10:30:09 -04:00
Christian Muehlhaeuser
e5bdd2242f * Fixed race condition during resolving.
(cherry picked from commit b70114a225)
2012-03-30 10:30:01 -04:00
Christian Muehlhaeuser
deb0eb819c * Fetch square covers from Last.fm.
(cherry picked from commit d5aed7b6df)
2012-03-30 10:29:48 -04:00
Jeff Mitchell
04864c7d79 Set scanning threads idle priority
(cherry picked from commit 5a57e285ec)
2012-03-30 10:28:04 -04:00
Jeff Mitchell
43c4daa4e3 Change wording 2012-03-29 10:41:16 -04:00
Jeff Mitchell
fc95cee6ce Dynamically enable/disable the web API, and change the wording for the option to make it more enticing 2012-03-29 10:41:14 -04:00
Dominik Schmidt
fff8fbfe80 win: fix qca2 usage/grooveshark 2012-03-28 17:23:27 +02:00
Leo Franchi
eec8b76de0 fix xspf auto-updating
(cherry picked from commit c54ca78769)
2012-03-27 11:27:07 -04:00
Leo Franchi
68f03dbd13 autoupdate fixes: init on creation, and every 10 not 100 mins
(cherry picked from commit ff04ab3b92)
2012-03-27 11:27:03 -04:00
Leo Franchi
753e1b3c90 aFix crash in dragging artist, don't assume AlbumModel only contains albums as it's hacked to also contain artists.
(cherry picked from commit 68d541d2e8)
2012-03-20 11:29:30 -04:00
Leo Franchi
e828dadec8 All QSharedPointers used in different threads need deleteLater as custom deleter. This is some of them.
(cherry picked from commit e3f5605c4e)
2012-03-19 22:24:41 -04:00
Leo Franchi
6e929986cb A bit of extra safety
(cherry picked from commit 2a58d53145)
2012-03-19 22:22:28 -04:00
mack-t
e1b086e3a4 Add albumpos, discnumber and score information from tomahawk resolver
(cherry picked from commit 21eeab61d8)
2012-03-19 22:20:32 -04:00
Leo Franchi
27147a0140 Guard against null sharedptr that shouldn't be null anyway -.- 2012-03-19 22:20:07 -04:00
Christian Muehlhaeuser
66836ae0bd * Something is wonky about CLucene scoring. Rely on our internal scoring. 2012-03-15 09:05:56 +01:00
Christian Muehlhaeuser
6342e6a9f8 * Fixed TWK-758: Sorting playlist by album position. 2012-03-15 09:05:47 +01:00
Jeff Mitchell
042ccbe730 Fix merge issue 2012-03-14 16:31:20 -04:00
Jeff Mitchell
6c6411561b Bump dependencies 2012-03-14 16:20:24 -04:00
Jeff Mitchell
18e3669911 Fix XMPP proxy. Make no proxy hosts static so changing it works across
all threads; make a duplication method so jreen doesn't scopepointer us
to death on shutdown; pass in proxyfactory to jreen.

Conflicts:

	src/settingsdialog.cpp
	src/sip/jabber/jabber.cpp
2012-03-14 16:19:32 -04:00
Dominik Schmidt
240517b0cd Bump the required QTweetLib version 2012-03-11 18:46:00 +01:00
Jeff Mitchell
fab36b2262 Use new QTweetLib 0.5 API for PIN values so leading zeros are respected
Conflicts:

	src/accounts/twitter/tomahawkoauthtwitter.h
2012-03-11 18:44:43 +01:00
Christian Muehlhaeuser
dd74ce04e6 Moved QuaZip from "shipped" to "recommended". 2012-03-07 17:51:20 +01:00
Christian Muehlhaeuser
e3a43e8ca6 * Bumped version to 0.4.0. 2012-03-07 05:07:47 +01:00
Christian Muehlhaeuser
c401ea0d91 * Update ChangeLog. 2012-03-07 05:07:23 +01:00
Christian Muehlhaeuser
2d03b8aea0 * Didn't mean to commit that. 2012-03-07 04:49:26 +01:00
Christian Muehlhaeuser
178aed9174 * Fixed TWK-474: proper fulltext search. 2012-03-07 04:47:24 +01:00
Christian Muehlhaeuser
6552deca61 * Fixed Source method being run in the wrong thread. 2012-03-07 04:45:32 +01:00
Leo Franchi
89009c09be Add a small guard to Artist::get and Album::get as they are called all over, and might be called after destruction of DB on shutdown 2012-03-06 18:47:55 -05:00
Leo Franchi
34672c7bed TWK-722: Fix quitting right after startup by ensuring chart data loaders are deleted before database 2012-03-06 18:46:48 -05:00
Leo Franchi
3caeb4642a Attempt at fixing TWK-723. 2012-03-06 18:23:17 -05:00
Christian Muehlhaeuser
80b0eacfed * Revert macdeploy back to use Qt 4.7.4. 2012-03-06 00:42:12 +01:00
Leo Franchi
aa078e86e5 Merge pull request #77 from anselmolsm/master
Play/Pause when system tray receives a mouse middle click
2012-03-05 12:20:13 -08:00
Anselmo L. S. Melo
9daf0a6089 Play/Pause when system tray receives a mouse middle click 2012-03-05 15:00:28 -03:00
Jason Herskowitz
6dead5e7e1 Fix all Super Collection text strings to SuperCollection 2012-03-04 22:46:10 -05:00
Jason Herskowitz
335868ea95 Merge branch 'master' of github.com:tomahawk-player/tomahawk 2012-03-04 22:28:56 -05:00
Jason Herskowitz
fc45646205 Update SuperCollection header text 2012-03-04 22:28:35 -05:00
Leo Franchi
dbd466d3ed Changelog++ 2012-03-04 22:21:04 -05:00
Leo Franchi
292d8c9530 Don't update playlist if no tracks have changed 2012-03-04 21:54:55 -05:00
Leo Franchi
6b68598d1d Show job status for indexing 2012-03-04 21:54:55 -05:00
Dominik Schmidt
0d9e248dac Fix lastfm export macro after my last commit. Why did it work before that?! 2012-03-05 01:09:31 +01:00
Leo Franchi
46a86fe6a5 Install vlc plugins to Frameworks/vlc/plugins instead of plugins/ 2012-03-04 16:55:57 -05:00
Dominik Schmidt
a56ca4ddfc Improve liblastfm2 export macro 2012-03-04 21:14:59 +01:00
Leo Franchi
6483c55749 Revert "Disable breakpad for an osx nightly"
This reverts commit 5a56a3e060.
2012-03-04 13:21:41 -05:00
Leo Franchi
5a56a3e060 Disable breakpad for an osx nightly 2012-03-04 12:55:05 -05:00
Dominik Schmidt
585f32c4d8 osx: fix undefined reference to bringToFront() with visibility=hidden 2012-03-04 18:44:23 +01:00
Jason Herskowitz
9ea311526c Make audio error icon match set 2012-03-03 18:45:07 -05:00
Leo Franchi
1342fdb9a7 Revert "disable break for a sec"
This reverts commit 2cc4fccd66.
2012-03-03 11:40:16 -05:00
Leo Franchi
2cc4fccd66 disable break for a sec 2012-03-03 11:39:49 -05:00
Leo Franchi
a2d0899285 Add grooveshark track parsing, and add a job notification for shortened url unwrapping 2012-03-02 22:41:44 -05:00
Dominik Schmidt
06cc52744d Enforce proper symbol exporting on all platforms 2012-03-03 01:14:21 +01:00
Leo Franchi
df758aa3f8 TWK-710: Don't expand items when clicking on headphones or lock icon 2012-03-02 00:15:16 -05:00
Leo Franchi
f79ed86b57 TWK-711: Some attica resolver icon fixes and optimizations. Don't write too much to disk 2012-03-01 23:33:27 -05:00
Leo Franchi
c9b0c92450 Bump up time for SetFile to finish 2012-03-01 23:25:49 -05:00
Leo Franchi
57d1c29d35 TWK-533: Show instructive error message if stations run out of tracks 2012-03-01 23:05:09 -05:00
Christian Muehlhaeuser
cdf7c11b29 * Fixed TWK-703: Auto expand sidebar's groups per default. 2012-03-02 04:42:32 +01:00
Leo Franchi
be7b5babe9 Show filter errors when loading a dynamic playlist for the first time too 2012-03-01 22:34:55 -05:00
Leo Franchi
f7f2c51d4e TWK-712: Don't emit track number changed when they really haven't, thus masking other errors 2012-03-01 22:11:02 -05:00
Leo Franchi
4889ed6a33 TWK-633: Don't use useless-to-us QUrl.addQueryItem, does not encode '+' 2012-03-01 21:53:13 -05:00
Leo Franchi
3557686681 Include in the right place 2012-03-01 21:53:11 -05:00
Christian Muehlhaeuser
58dfc54e00 * Fixed TWK-708: Resolve album page top-to-bottom. 2012-03-02 03:32:30 +01:00
Christian Muehlhaeuser
bddbc7a194 * Fixed TWK-642: Update Footnotes when selecting an album in AlbumView. 2012-03-02 02:45:56 +01:00
Christian Muehlhaeuser
33e0116e4b * Fixed TWK-700: Add description for SuperCollection. 2012-03-02 02:28:27 +01:00
Christian Muehlhaeuser
b07f498516 * Fixed TWK-699: Don't paint now playing icon over item decoration. 2012-03-02 02:21:08 +01:00
Christian Muehlhaeuser
c77be81e5b * Fixed TWK-641: don't write empty album covers in InfoSystem. 2012-03-02 01:55:28 +01:00
Christian Muehlhaeuser
11cf2c78d8 * Fixed ArtistPlaylistInterface. 2012-03-02 01:30:31 +01:00
Leo Franchi
77bcc7c7aa TWK-709: Fetch albums from infosystem if no tracks are found in the DB when dropping an album 2012-03-01 18:14:45 -05:00
Leo Franchi
5b97802104 Revert "Add debug for jason". Debug did its job :)
This reverts commit 25ec5cb432.
2012-03-01 09:20:41 -05:00
Leo Franchi
25ec5cb432 Add debug for jason 2012-03-01 09:12:27 -05:00
Leo Franchi
8b4b4a8f0c Add documentation 2012-03-01 00:19:59 -05:00
Leo Franchi
6448cebec6 Mostly fix TWK-701. A few bugs lined up here.
1) Tracks fetched from an album or artist in DropJob would only fetch from the db
   and never resolve w/ resolvers
2) artist* and album* objects were getting deleted too early if they didn't already exist before
   DropJob asked for them (results from db thread are queued, sharedpointer deletion happened first).
   Keep ahold of them until we're done with them.

For albums we don't know about, we still need to look up metadata track listings when nothing is found in the DB.
2012-03-01 00:14:16 -05:00
Leo Franchi
191ee259d4 TWK-671: Fix filter text being 'behind' by one step 2012-02-29 22:28:54 -05:00
Leo Franchi
dc364726c0 TWK-706: Don't auto-enable resolvers when upgrading them. 2012-02-29 18:46:58 -05:00
Hugo Lindström
6ac0f68224 Silly misstake in naming 2012-03-01 00:38:32 +01:00
Leo Franchi
3c3078f9f8 Clean up from previous test 2012-02-29 17:45:20 -05:00
Leo Franchi
b994befc58 osx /volumes tweak 2012-02-29 17:12:59 -05:00
Hugo Lindström
56cf0239da Fix soundcloudwall and pump version 2012-02-29 08:06:56 +01:00
Christian Muehlhaeuser
69d75362b3 * This should speed up resolving... a lot. 2012-02-29 02:36:33 +01:00
Leo Franchi
8db9c79e57 Add some SetFile/GetFileInfo debug 2012-02-28 18:54:22 -05:00
Hugo Lindström
e9ee617d94 Better name for soundcloudwall 2012-02-28 21:36:53 +01:00
Leo Franchi
c9c6534af5 Wait a bit longer for portfwd thread to exit to avoid crashes on exit 2012-02-28 10:37:37 -05:00
Leo Franchi
1b9767995b Make stations item drop enabled. How did this ever work!? 2012-02-28 10:37:37 -05:00
Christian Muehlhaeuser
1c561ba7a9 * Prepare macdeploy for Qt 4.8. 2012-02-28 15:49:21 +01:00
Leo Franchi
52baebc899 Delete pipeline after database, as some dbcmds create queries which access Pipeline 2012-02-26 17:35:14 -05:00
Leo Franchi
63c029554a Set default type of echonest control so an empty control is valid (and ignored) 2012-02-26 17:34:11 -05:00
Leo Franchi
3900dd27d2 TWK-686: Implement playlistinterface and jump to current track 2012-02-26 13:06:10 -05:00
Leo Franchi
e9fb17dadb TWK-604: Update Show/Hide menu entry if Tomahawk is hidden with Cmd-H 2012-02-26 12:44:19 -05:00
Leo Franchi
56c2f86381 Use SetFile/GetFileInfo from bundle 2012-02-26 10:57:00 -05:00
Leo Franchi
a8440c72e4 Fix build for gcc on mac. Hudson should use clang :D 2012-02-25 23:52:34 -05:00
Leo Franchi
cbb5bac075 TWK-624: When resolving dups in dropjob, prefer playable ones 2012-02-25 23:20:31 -05:00
Leo Franchi
b7f1f56f77 TWK-633: Don't hand-make URLs, that is just asking for trouble 2012-02-25 21:53:08 -05:00
Leo Franchi
9fe17cf6f5 Upgrade SPMediaKeyTap 2012-02-25 21:25:57 -05:00
Leo Franchi
d641f06e6d cleanups 2012-02-25 20:54:54 -05:00
Leo Franchi
7668f04c0c Cache height as sizehint is called plenty often 2012-02-25 20:13:12 -05:00
Leo Franchi
a73d1cd342 Don't calculate height by assuming rows are same height anymore, as they are not. 2012-02-25 20:07:33 -05:00
Leo Franchi
35c4a29cbe center icon in delegate for multi-line jobs 2012-02-25 20:03:01 -05:00
Leo Franchi
f6e00fbb86 Show error message if phonon spits an error, but don't block with modal dialog/audio stop 2012-02-25 20:02:38 -05:00
Leo Franchi
3f9503364c Return null qstring 2012-02-25 19:48:00 -05:00
Leo Franchi
36b2a585f9 Show errors when fetching information from the network. Fixes TWK-515 2012-02-25 19:39:35 -05:00
Leo Franchi
42220a8c95 Delete InfoSystem after pipeline as various constructors connect to InfoSystem. Fixes crash on exit. 2012-02-25 16:24:57 -05:00
Christian Muehlhaeuser
1ac4efa88a * Prepare for 0.4.0. 2012-02-25 10:18:00 +01:00
Christian Muehlhaeuser
cfe42d10ea * Minor cleanups. 2012-02-24 06:29:32 +01:00
Christian Muehlhaeuser
6ad9e820e3 * Only show top 50 loved tracks for the SuperCollection. 2012-02-24 05:52:02 +01:00
Christian Muehlhaeuser
47a403a9c8 * Update social actions everytime you open the contextual menu of a track. 2012-02-24 05:40:00 +01:00
Christian Muehlhaeuser
b2fc0935a4 * Show now playing speaker next to current playlist again. 2012-02-24 05:18:55 +01:00
Christian Muehlhaeuser
a04d384ac4 * Show default album, not artist cover on AlbumInfoWidget. 2012-02-24 04:15:28 +01:00
Christian Muehlhaeuser
325bb0bf8f * Added global common image cache. 2012-02-24 04:13:37 +01:00
Christian Muehlhaeuser
c2a79d4cbf * Don't wordwrap track names in sidebar. 2012-02-23 21:06:17 +01:00
Christian Muehlhaeuser
b17b8356ad * Fixed a few issues with controlling playback via CLI args. 2012-02-23 20:34:23 +01:00
Christian Muehlhaeuser
a41b174851 Merge pull request #76 from ubertaco/master
Initial support for TWK-595
2012-02-23 11:23:43 -08:00
ubertaco
458d32ed7c removed duplicate --stop 2012-02-23 14:05:44 -05:00
ubertaco
a0383b6664 fixed helpstrings and inconsistent spacing 2012-02-23 14:04:24 -05:00
ubertaco
9b1fc4cd24 added helpstrings 2012-02-23 13:52:11 -05:00
ubertaco
2a27ef88f6 Added initial support for TWK-595 ( command-line audio controls ) 2012-02-23 13:48:51 -05:00
Christian Muehlhaeuser
d1ecf6d748 * More work on sidebar reorganization. 2012-02-23 06:22:47 +01:00
Christian Muehlhaeuser
396b5cd6e0 * Modify Tomahawk's config file to be only accessible by the owner. 2012-02-23 04:36:30 +01:00
Christian Muehlhaeuser
55e7d6383b * Unbreak headless more. 2012-02-23 04:08:14 +01:00
Christian Muehlhaeuser
dbcbffb6c4 * Auto load covers after expanding an artist. 2012-02-23 04:05:06 +01:00
Christian Muehlhaeuser
6b51872c3e * Unbreak headless. 2012-02-23 03:30:22 +01:00
Christian Muehlhaeuser
79d8b081d7 * Speed up cover loading in TreeView. 2012-02-23 03:21:21 +01:00
Christian Muehlhaeuser
165276912f * Fixed Windows compiling. 2012-02-22 02:42:42 +01:00
Christian Muehlhaeuser
413052bf8e * Destroy Pipeline properly and deactivate it earlier during shutdown. 2012-02-22 02:09:24 +01:00
Leo Franchi
46fd72920c Remove duplicate signal/slot collection. All SourceTreeItem* signals are already hooked up for each item 2012-02-19 15:36:48 -05:00
Christian Muehlhaeuser
399b835436 * SourcePlaylistInterface shouldn't use temporary queries. 2012-02-19 11:29:03 +01:00
Alejandro Wainzinger
9f76cdf486 Fix typo. 2012-02-18 00:49:08 -08:00
Alejandro Wainzinger
881bf5dd9d Check for OS X 10.7 as well as 10.6 for delegate protocol. 2012-02-18 00:47:23 -08:00
Leo Franchi
8bb9661960 Add an index on the file mtime. For future users for now 2012-02-17 19:08:59 -05:00
Leo Franchi
a1c69b0b43 rework some startup order to load servent before UI components 2012-02-17 18:37:59 -05:00
Dominik Schmidt
5083849514 Merge branch 'master' of git://github.com/tomahawk-player/tomahawk 2012-02-14 05:28:57 +01:00
Dominik Schmidt
8d75ba4d64 Add console output on windows 2012-02-14 05:28:35 +01:00
Leo Franchi
b54b7f6455 Up webapi timeouts so resolving can finish 2012-02-12 17:15:02 -05:00
Dominik Schmidt
488eb387cb Use my new pvlc build in update-vlc.sh 2012-02-12 20:49:55 +01:00
Dominik Schmidt
99143f6148 Fix windows for qt 4.8 2012-02-12 20:23:20 +01:00
Dominik Schmidt
1d4320afea Bump year ;-) 2012-02-11 03:55:23 +01:00
Dominik Schmidt
d9c3162146 Remove now unneccesary workaround in mingw toolchain file 2012-02-10 19:36:10 +01:00
Dominik Schmidt
4a1b021753 Fix FindTaglib.cmake for windows 2012-02-10 19:33:48 +01:00
Leo Franchi
3418d5295b Merge pull request #75 from crabmanX/master
suggest playlist filename on export
2012-02-10 06:35:51 -08:00
Kilian Lackhove
bf30dc37a2 suggest playlist filename on export 2012-02-10 15:30:07 +01:00
Dominik Schmidt
6ed4902e00 Check for QtUiTools 2012-02-06 14:56:32 +01:00
Dominik Schmidt
e3f6e61900 *sigh* Fix returning years in scriptresolvers 2012-02-04 01:53:54 +01:00
Christian Muehlhaeuser
c9b1daeba7 * Fixed TWK-670: Don't crash without a composer. 2012-02-03 17:10:03 +01:00
Jeff Mitchell
52531e9125 Use the faster method for actual comparison 2012-02-02 16:08:42 -05:00
Jeff Mitchell
72b6252ab5 Add id() to playlistinterface for comparison 2012-02-02 16:05:51 -05:00
Jeff Mitchell
95f3ead710 Remove extraneous local IP checks; let the plugin set the name and don't
try to adjust it based on IP.
2012-02-02 15:42:18 -05:00
Jeff Mitchell
07a9486e4d Some whitespace cleaning 2012-02-02 14:02:38 -05:00
Dominik Schmidt
7efceebb1c Merge pull request #74 from peretti/master
Added Brazilian Portuguese translation
2012-01-29 19:39:21 -08:00
Hugo Lindström
47529ee4d8 Add version controll to force cacheupdates on new sources. 2012-01-25 16:40:59 +01:00
Allan Peretti
6fdc49b6e5 Brazilian POrtuguese translation 2012-01-24 20:54:59 -06:00
Jeff Mitchell
78ad724bac Clean up some sourceplaylistinterface logic to hopefully prevent it
saying that a track couldn't be resolved when it gets resolved right
afterwards.

Also, have the latch mode changing (for instance on pause) affect the
source's icon.
2012-01-23 16:14:33 -05:00
Jeff Mitchell
fad6768955 Don't go QImage -> QPixmap -> QImage 2012-01-23 15:17:43 -05:00
Jeff Mitchell
03384c4e19 Be a bit safer 2012-01-23 15:14:57 -05:00
Jeff Mitchell
63e59e7e27 Fix crash from album cover refactoring. QPixmap was being put into a
QVariant and QImage being taken out.
2012-01-23 15:12:06 -05:00
Christian Muehlhaeuser
b768e84afe * Better highlighting for artist names in AlbumView. 2012-01-23 18:34:07 +01:00
Christian Muehlhaeuser
8fdddb501f * Better shutdown sequence. 2012-01-23 18:33:34 +01:00
Christian Muehlhaeuser
f6d00be6c1 * Fixed TreeModel's columns / data method. 2012-01-23 15:48:47 +01:00
Jeff Mitchell
783893f750 I wish Jreen would properly namespace their signals/slots. 2012-01-23 06:49:05 -05:00
Christian Muehlhaeuser
ff9074421a * Fixed spinner size. 2012-01-23 06:03:00 +01:00
Christian Muehlhaeuser
5a719f39bd * Fixed painting issues with BreadcrumbBar. 2012-01-23 05:52:39 +01:00
Christian Muehlhaeuser
39a40ce372 * Use proper sort order for Top Hits & Related Artists. 2012-01-23 04:48:31 +01:00
Christian Muehlhaeuser
fdb13a1f78 * Fixed alignment of playlist headers. 2012-01-23 03:20:49 +01:00
Christian Muehlhaeuser
9f99108701 * Let's make alignment a data-role as it's intended to be. 2012-01-23 03:12:55 +01:00
Dominik Schmidt
1e022bf627 Use only 'Show Queue' not 'Open Queue' additionally 2012-01-23 03:07:24 +01:00
Dominik Schmidt
354dad71d9 Fix context menu showing play when actually opening artist/album pages 2012-01-23 03:07:24 +01:00
Christian Muehlhaeuser
ea7dc6e057 * Properly center playlist items. 2012-01-23 03:00:12 +01:00
Dominik Schmidt
c9ceb5f813 Align some columns centered in playlistitemdelegate: albumpos, duration, etc 2012-01-23 02:46:00 +01:00
Christian Muehlhaeuser
576c66133e * Fixed search crash. 2012-01-23 00:36:26 +01:00
Christian Muehlhaeuser
0c704d2928 * Fixed column weights. 2012-01-23 00:25:02 +01:00
Christian Muehlhaeuser
d611bad383 * Fixed SQL Query. 2012-01-22 23:16:53 +01:00
Dominik Schmidt
3c2139ebeb taghandlers should be part of the core library not of the gui library 2012-01-22 22:22:56 +01:00
Dominik Schmidt
081102fee4 Read discnumber from script resolvers 2012-01-22 20:40:38 +01:00
Dominik Schmidt
c68772c9b5 Fix rebase fail 2012-01-22 20:40:04 +01:00
Teo Mrnjavac
68c421e00e Fix after borked merge. 2012-01-22 19:50:14 +01:00
Teo Mrnjavac
93722665af Get the discnumber in databaseimpl.cpp as well. 2012-01-22 19:50:14 +01:00
Teo Mrnjavac
b8a38f7eda Write a null value for the composer id if there's no composer. 2012-01-22 19:48:18 +01:00
Teo Mrnjavac
06374586e0 Fix header weights. 2012-01-22 19:48:18 +01:00
Teo Mrnjavac
a7fd04e1f3 Added disc numbers to the Playlist view as well. 2012-01-22 19:48:18 +01:00
Teo Mrnjavac
9661a38c10 Added Composer column to the collection and playlist model/views. 2012-01-22 19:48:18 +01:00
Teo Mrnjavac
47e9f27199 Fixed bug with null discnumbers and added discnumbers to view.
Fix bug in the taghandlers where a discnumber polluted null entries in
the database.
Also made the tree model so that the discnumber appears before the track
number if it's defined.
2012-01-22 19:48:18 +01:00
Teo Mrnjavac
4e59f1dc12 Added discnumber & composer to the DB schema and sorting by discnumber.
Added support for three new metadata elements of a track: Album Artist,
Composer and Disc Number. Since these are not supported in ID3v1 which
TagLib uses as common ground between the different metadata formats, I
had to handle the following cases separately: APE, ASF, ID3v1, ID3v2,
MP4 and OGG.
Modified the DB schema to include composer and discnumber. Provided the
dbmigrate file and bumped the schema version.
Added composer and discnumber data to all relevant queries.
Removed a bogus result->setYear from some queries in dbcmd_resolve.cpp.
2012-01-22 19:48:18 +01:00
Dominik Schmidt
68b146e560 Simplify setting the year on results in scriptresolver 2012-01-22 19:15:10 +01:00
Dominik Schmidt
b06d50be98 Read albumpos from scriptresolvers 2012-01-22 18:57:28 +01:00
Dominik Schmidt
cc6a7fd5c5 qInstallMsgHandler(blackboard); for(int i=0;i<1000;++i) qDebug() << "QPixmap::loadFromData returns bool,
not the pixmap itself"
2012-01-22 18:08:03 +01:00
Dominik Schmidt
0488aa10f8 Fix headless by using QByteArrays instead of QPixmap or QImage 2012-01-22 17:50:33 +01:00
Christian Muehlhaeuser
7dcd6e8edc * Added missing return. 2012-01-22 16:41:40 +01:00
Christian Muehlhaeuser
11c6d4cdca * Moved social actions from Result into Query. Added contextual menu entry for (un)loving. 2012-01-22 16:36:56 +01:00
Christian Muehlhaeuser
60b746c430 * Move database dumping into its own method. 2012-01-20 02:15:42 +01:00
Christian Muehlhaeuser
1f2cc33364 * Moved cover / image retrieval into Artist & Album classes. Huge model / view cleanup. 2012-01-20 02:15:42 +01:00
Jeff Mitchell
5d215b1326 Add a missing delquery.exec() in deletefiles, probably causing the
remote delete failures
2012-01-19 17:32:43 -05:00
Christian Muehlhaeuser
46723bf9d3 * Added a --dumpdb command line option. 2012-01-19 18:11:17 +01:00
Hugo Lindström
36789637a2 Forgot api url 2012-01-19 14:06:51 +01:00
Hugo Lindström
6e669fe530 Adding Soundcloudwall.com 2012-01-19 14:05:34 +01:00
Christian Muehlhaeuser
90c1a4ec51 * Custom layouts are annoying. 2012-01-19 13:12:50 +01:00
Christian Muehlhaeuser
3e7b2b72cf * Let's hope centering the text works better. 2012-01-19 12:29:24 +01:00
Christian Muehlhaeuser
de5df30941 * Fixed source painting for some weird fonts. 2012-01-19 11:51:57 +01:00
Dominik Schmidt
f5764906d6 Don't print passwords in the xml console. Thanks Elessar for the patch. 2012-01-17 19:26:37 +01:00
Christian Muehlhaeuser
f6dce6181e * Added more Jabber debug output for Jason. 2012-01-17 04:20:05 +01:00
Christian Muehlhaeuser
ba74c22663 * Potential malloc / race condition fix. 2012-01-16 13:33:10 +01:00
Jeff Mitchell
14fd0424a1 Working query-stores-its-own-pointer behavior 2012-01-15 18:17:25 -05:00
Jeff Mitchell
4d7945291e Fix a couple warnings and getPlaylistInterface->playlistInterface 2012-01-15 15:02:53 -05:00
Christian Muehlhaeuser
2eabaa0195 * Fixed QSharedPtr related warnings. 2012-01-15 15:29:57 +01:00
Christian Muehlhaeuser
7ffe53b745 * Use QSharedPointers in DbCmd_AllTracks. 2012-01-14 08:33:37 +01:00
Jeff Mitchell
ff9a033e1e Fix real-time being the default 2012-01-13 12:31:44 -05:00
Jeff Mitchell
ef41c80eb1 Move the mutex locker in the query's destructor to try to ensure that no part of the destructor can be happening while access happens some other way.
Also actually lock the mutex in refreshResults() and check for validity of the object.
2012-01-13 08:52:30 -05:00
Jeff Mitchell
25a67447d3 Add lock/unlock icons to toggle realtime listening along 2012-01-12 19:05:14 -05:00
Jeff Mitchell
9242a7c942 Add the ability to listen along in real-time. Won't automatically switch
if you (currently, might need to tweak) have <= 6 seconds left of the
current track...after a while if you get further behind it'll
automatically correct.

Can toggle via source context menu right now, need to work in an icon.

If you pause the music, it turns off real-time if it's on.
2012-01-12 17:55:33 -05:00
Christian Muehlhaeuser
7cd51a6108 * Use tDebug() when printing out a clucene error. 2012-01-11 10:30:17 +01:00
Hugo Lindström
82a2ff900b Fetches artistdata from infosystem 2012-01-11 01:22:22 +01:00
Jeff Mitchell
d6a533527e Fix signal/slot errors from playlistinterface refactor 2012-01-10 12:45:06 -05:00
Jeff Mitchell
758d65e018 Fix signal/slot signatures.
Fixes TWK-654.
2012-01-10 09:56:48 -05:00
Leo Franchi
1ccc368195 Don't blindly refresh top loved tracks all the time.
Refactor update function from xspfupdater into tomahawkutils, use it in the loved tracks backend.
also, a few misc cleanups
2012-01-06 17:14:42 -05:00
Leo Franchi
7abc185586 no need for queued connection any longer as clicking a collection item won't lead to a setplaylistinterface 2012-01-06 15:31:48 -05:00
Leo Franchi
4bf4cdda7b reclaim more copyrights :) 2012-01-06 15:31:31 -05:00
Leo Franchi
5fcb7e637a Reduce shared memory segment used as we don't allow more than once instance open at once 2012-01-06 12:38:51 -05:00
Christian Muehlhaeuser
ad9cf93f28 * Properly calculate item spacing in AlbumViews. 2012-01-06 08:16:33 +01:00
Christian Muehlhaeuser
c0c43441c1 * Hotfixes for non-KDE users. 2012-01-06 08:08:34 +01:00
Christian Muehlhaeuser
dc79dfe403 * Hardcoded a bunch of font-sizes. Should be properly fixed eventually. 2012-01-06 08:03:25 +01:00
Dominik Schmidt
ef5af2c7d8 Remove Jreen submodule. 2012-01-05 22:40:10 +01:00
Leo Franchi
d4e82d8c94 Merge pull request #73 from Horrendus/master
Fix Bugs handling Grooveshark Playlist URL Drops
2012-01-04 08:41:00 -08:00
Stefan Derkits
4f3ae14dbf Better function naming in shortenedlinkparser 2012-01-04 17:03:48 +01:00
Stefan Derkits
3655a2b537 Don't check whitelist everytime we want to resolve a redirect 2012-01-04 16:37:04 +01:00
Stefan Derkits
014c6e7344 Fix Bugs in GroovesharkParser & enable resolving of multiple redirects 2012-01-04 15:57:23 +01:00
Christian Muehlhaeuser
bea98a5e30 Merge pull request #72 from mgnz/master
Updated spanish translation! :)
2012-01-03 16:21:07 -08:00
mgnz
aff87e936a Update lang/tomahawk_es.ts 2012-01-04 01:17:24 +01:00
Christian Muehlhaeuser
5f0200b151 * Fixed not being able to collapse History item in the sidebar. 2012-01-02 14:14:14 +01:00
Jeff Mitchell
f1fb4a2ed8 Merge branch 'playlistinterface_ptr' of ssh://github.com/tomahawk-player/tomahawk into playlistinterface_ptr 2011-12-31 00:13:56 -05:00
Jeff Mitchell
20d1c2a5cc Possibly fix some of the qsharedptr warnings by making constructors explicit 2011-12-31 00:13:40 -05:00
Jeff Mitchell
9c8a9e0c52 Possibly fix some of the qsharedptr warnings by making constructors explicit 2011-12-31 00:05:50 -05:00
Jeff Mitchell
b72863a1ff Get rid of now-unneeded qsharedptr 2011-12-30 23:49:56 -05:00
Jeff Mitchell
2c3bf472bc Fix a few more signal/slot errors 2011-12-30 23:45:00 -05:00
Jeff Mitchell
05c0f3e2d3 Merge branch 'playlistinterface_ptr' of ssh://github.com/tomahawk-player/tomahawk into playlistinterface_ptr 2011-12-30 23:41:55 -05:00
Jeff Mitchell
8abf965447 Fix a couple signal/slot errors 2011-12-30 23:41:48 -05:00
Christian Muehlhaeuser
0460f6f776 * Fixed compiling MPRIS plugin. 2011-12-31 03:29:11 +01:00
Jeff Mitchell
2ea2b57d92 Finish refactoring playlistinterface...it's its own QObject, and it doesn't multiple inherit with any other classes for any implementations.
Dragons ahead, beware. Brave testers needed.
2011-12-30 20:35:53 -05:00
Jeff Mitchell
9fe40f0682 Separate out Playlist's interface. PlaylistPlaylistInterface isn't a great name, someone come up with something better. 2011-12-30 16:31:19 -05:00
Jeff Mitchell
f81db381be Merge branch 'master' into playlistinterface_ptr 2011-12-29 10:02:46 -05:00
Jeff Mitchell
9320d2f9c2 Fix some corner cases affecting the time slider, such as when the streaming fails 2011-12-29 10:02:09 -05:00
Christian Muehlhaeuser
1639d617f7 * Added shlwapi dependency. 2011-12-28 23:32:47 +01:00
Christian Muehlhaeuser
4341256594 Merge pull request #71 from mickael9/master
Use AssocQueryString on Windows for script resolvers (untested)
2011-12-28 14:20:26 -08:00
mickael9
584c4446b5 Use AssocQueryString on Windows for script resolvers
that are not .exe files (untested !)
2011-12-28 22:42:51 +01:00
Jeff Mitchell
424ac7a1d5 Separate album playlist interface 2011-12-28 12:27:25 -05:00
Jeff Mitchell
9bc38282e9 Merge remote branch 'origin/master' into playlistinterface_ptr 2011-12-28 11:54:40 -05:00
Dominik Schmidt
9011e4977e Rename CMakeLists..txt files to CMakeLists..cmake so we get proper syntax highlighting 2011-12-27 03:25:12 +01:00
Dominik Schmidt
4c2c4b7c6d Remove hardcoded install paths, port over to CMAKE_INSTALL_*DIR 2011-12-27 03:17:37 +01:00
Dominik Schmidt
a6a362944a Allow setting absolute paths in CMAKE_INSTALL_LIBEXECDIR 2011-12-27 02:39:34 +01:00
Dominik Schmidt
a059cc2e18 Include GNUInstallDirs before configuring config.h 2011-12-27 01:09:08 +01:00
Dominik Schmidt
9a13d475a6 Use python.exe as interpreter for .py files on windows. 2011-12-26 20:14:42 +01:00
Jeff Mitchell
1a240911f5 Separate Artist playlist interface 2011-12-26 13:19:24 -05:00
Jeff Mitchell
a4f65cbcc2 Fix some compilation errors from the merge 2011-12-26 12:29:56 -05:00
Jeff Mitchell
073cbbaad5 Merge branch 'master' into playlistinterface_ptr
Conflicts:
	src/libtomahawk/widgets/whatshotwidget.cpp
2011-12-26 12:24:27 -05:00
Leo Franchi
4c8fa37d0e Delete external resolvers when removing them from resolvers list 2011-12-25 19:56:33 -06:00
Leo Franchi
038daffab7 Merge pull request #70 from Horrendus/master
enable parsing of tinysong.com Grooveshark links
2011-12-25 06:55:02 -08:00
Stefan Derkits
bd893995c3 Allow parsing of grooveshark tinysong.com links 2011-12-24 22:44:05 +01:00
Leo Franchi
9634d3230f Go back to old way of sending artists in charts, as old data type may be cached 2011-12-24 11:11:05 -06:00
Christian Muehlhaeuser
01d6a22f92 Merge pull request #69 from Horrendus/master
fix grooveshark stuff by putting ifdefs around it
2011-12-23 13:20:46 -08:00
Stefan Derkits
b3c144b4bf put ifdefs around grooveshark parsing stuff 2011-12-23 22:17:31 +01:00
Christian Muehlhaeuser
3875f0b693 * Auto expand group items. 2011-12-23 20:01:08 +01:00
Leo Franchi
cf4d0fe465 utils to utilsgui 2011-12-23 09:56:07 -06:00
Leo Franchi
06ac5cffb6 debug-- 2011-12-23 08:02:37 -06:00
Leo Franchi
3987ce7690 Load chart data objects in a thread, as they call synchronous db methods 2011-12-23 08:02:37 -06:00
Leo Franchi
c4c74d84dc Show search widget on qt 4.8 2011-12-23 08:02:36 -06:00
Christian Muehlhaeuser
79c283b181 Merge pull request #68 from Horrendus/master
Parse Grooveshark.com Playlist
2011-12-22 15:09:09 -08:00
Stefan Derkits
2e25337cc1 Small changes in groovesharkparser 2011-12-22 23:59:16 +01:00
Stefan Derkits
e989bc1652 Parse Grooveshark playlists on drag & drop
not much error handling yet, but it works ;)
2011-12-21 23:53:09 +01:00
Jeff Mitchell
a8810e90c1 Some cleanup 2011-12-21 16:17:59 -05:00
Jeff Mitchell
daca5fa107 Don't store a source_ptr in SourcePlaylistInterface, since the Source has a playlistinterface_ptr down to it, causing a loop 2011-12-21 14:35:10 -05:00
Jeff Mitchell
d3fbbf778a Some normalization 2011-12-21 14:21:03 -05:00
Jeff Mitchell
44cbcd434e Merge branch 'master' into playlistinterface_ptr
Conflicts:
	src/libtomahawk/playlistinterface.h
2011-12-21 14:08:57 -05:00
Jeff Mitchell
9e80ef8aca Add suggestion from leo 2011-12-21 08:59:27 -05:00
Hugo Lindström
52cb7cebd9 Forgot about spotifyApiReply. 2011-12-17 18:06:44 +01:00
Christian Muehlhaeuser
54c203982f * Fixed resolving regression, which caused omitting some results. 2011-12-15 20:58:24 +01:00
Christian Muehlhaeuser
c3e8420b57 * Removed PhantomJS warning from tomahawk.js. 2011-12-14 17:05:38 +01:00
Jason Herskowitz
d59ffc55b1 Transparent spinner 2011-12-14 09:33:32 -05:00
Hugo Lindström
f32de6bece Use pong instead to check if spotifyApi is online 2011-12-14 13:01:05 +01:00
Christian Muehlhaeuser
4f4406ffb1 * Indent playlists / stations correctly. This is possibly causing issues with the OS X background color. Needs checking. 2011-12-14 11:24:30 +01:00
Christian Muehlhaeuser
6064b2029e * New sidebar style. Also, first steps towards reorganizing it. 2011-12-14 11:16:22 +01:00
Dominik Schmidt
31fb398b37 Update README concerning Jreen 2011-12-13 00:12:35 +01:00
Jason Herskowitz
3b8deef8c5 New spinner animation 2011-12-11 16:20:52 -05:00
Jeff Mitchell
075a5a0f14 Add some debug 2011-12-10 12:02:02 -05:00
Jeff Mitchell
2a96048b7c This doesn't actually help, but maybe is "correct"...? Or quite possibly not. 2011-12-10 02:46:03 -05:00
Jeff Mitchell
ce13d7fed5 Explicitly call clear on the shared pointer in the playlistinterface destructor 2011-12-10 02:27:32 -05:00
Jeff Mitchell
8ffbebb2b6 Porting of the rest of the non-QSharedPointer playlistinterface pointers 2011-12-10 02:15:14 -05:00
Jeff Mitchell
ce60d46fa6 Register playlistinterface_ptr type 2011-12-09 23:29:21 -05:00
Jeff Mitchell
93a31146b1 Fix logical mistake 2011-12-09 23:20:57 -05:00
Christian Muehlhaeuser
d22bccd9fb * A few cleanups. 2011-12-10 02:02:59 +01:00
Jeff Mitchell
3430535774 First bit of migrating PlaylistInterface* to playlistinterface_ptr
Compiles, but need to fix up signals and slots
2011-12-09 17:19:57 -05:00
Hugo Lindström
3c3c1414fe Allow symlinks in dirtree 2011-12-09 20:37:54 +01:00
Dominik Schmidt
64d220d9c5 Show localized wikipedia context 2011-12-09 03:03:28 +01:00
Christian Muehlhaeuser
41e908bb34 * Updated english translation. 2011-12-07 08:51:18 +01:00
Christian Muehlhaeuser
94b7ff59d5 * Updated german translation. 2011-12-07 08:47:28 +01:00
Christian Muehlhaeuser
0ea928ade7 Merge pull request #67 from zizzfizzix/tr
small changes to Polish translation once again
2011-12-06 23:30:49 -08:00
Kuba Serafinowski
d1db5441df small changes to Polish translation once again 2011-12-07 07:29:14 +00:00
Christian Muehlhaeuser
45f7cd2938 * Fixed button label. 2011-12-07 07:55:50 +01:00
Christian Muehlhaeuser
41b3ebf4e4 * Auto-switch to super collection mode when no official info is available on artist & album pages. 2011-12-07 07:19:30 +01:00
Christian Muehlhaeuser
330efc5833 * Source/style cleanup. 2011-12-05 21:10:32 +01:00
Christian Muehlhaeuser
6f4a26220d * Search for more albums / artists. 2011-12-05 21:07:53 +01:00
Christian Muehlhaeuser
919644d07a * Query's toString() supports fulltext search queries, now. 2011-12-05 21:07:09 +01:00
Christian Muehlhaeuser
30cabb304c * Implement limiting for index searching. 2011-12-05 21:05:05 +01:00
Jeff Mitchell
b80230c962 Use system proxy when no proxy is set, for windows/mac 2011-12-05 13:02:56 -05:00
Dominik Schmidt
e8563b119b Fix compilation on OSX 2011-12-05 16:32:45 +01:00
Dominik Schmidt
83051cd554 Split ExternalResolver 2011-12-05 14:25:05 +01:00
Dominik Schmidt
cfce10fbec Split Resolver classes into separate files 2011-12-05 14:25:04 +01:00
Christian Muehlhaeuser
09087e2a8e * Safe approach to prevent resizing of album items. 2011-12-05 10:15:07 +01:00
Christian Muehlhaeuser
3520a7d0d8 * Slight optimation. 2011-12-05 10:04:18 +01:00
Christian Muehlhaeuser
7b4d08a7f5 * Don't prioritize album-less tracks in edge cases. 2011-12-05 09:42:00 +01:00
Christian Muehlhaeuser
7e6b543a70 * Use bold font for painting artist items in the 'still so-wrongly-called' AlbumItemDelegate. 2011-12-05 08:34:55 +01:00
Christian Muehlhaeuser
41c79b931f * In Collection view with filter set: Don't jump to the selected item when expanding an artist. 2011-12-05 08:33:30 +01:00
Christian Muehlhaeuser
477202aa47 Merge pull request #66 from zizzfizzix/tr
update Polish translation
2011-12-04 22:54:24 -08:00
Christian Muehlhaeuser
ff0d9a9837 Merge pull request #65 from mgnz/master
Updated spanish translation... again!
2011-12-04 22:54:15 -08:00
Christian Muehlhaeuser
2c83807efc * Fixed DropJob's query counter as discussed on GitHub. 2011-12-05 07:53:36 +01:00
Christian Muehlhaeuser
3517726d92 * Basic implementation of artist & album searches. 2011-12-05 07:51:24 +01:00
Christian Muehlhaeuser
a00ea52b0b * Moved Attica to port 80. 2011-12-05 02:50:33 +01:00
Kuba Serafinowski
e4b11807f2 update Polish translation 2011-12-04 21:20:37 +00:00
mgnz
7b521b0690 Update lang/tomahawk_es.ts 2011-12-04 17:35:25 +01:00
mgnz
8f14777831 Fixed some typo errors. 2011-12-04 17:31:10 +01:00
Christian Muehlhaeuser
ef3246db9c * Fixed another sidebar issue with gtk styles. 2011-12-04 13:02:22 +01:00
Christian Muehlhaeuser
7726302103 * Fixed sidebar issues with gtk styles. 2011-12-04 12:55:06 +01:00
Christian Muehlhaeuser
2b85536625 * URL encode the mpris2 ArtUrl. 2011-12-04 07:58:37 +01:00
Christian Muehlhaeuser
2bfa77c1ff * Potential fix for TWK-618: ArtUrl not properly encoded. 2011-12-04 07:48:27 +01:00
Christian Muehlhaeuser
9d4974b174 * Remove nonsense. 2011-12-04 07:32:49 +01:00
Christian Muehlhaeuser
eaf9d806d1 * Give instant user feedback when scanner gets kicked off. 2011-12-04 07:31:46 +01:00
Christian Muehlhaeuser
152b07d816 * Updated ChangeLog. 2011-12-04 06:39:33 +01:00
Christian Muehlhaeuser
441fa10add Merge pull request #64 from mgnz/master
Updated spanish translation
2011-12-03 21:31:50 -08:00
Christian Muehlhaeuser
261149287c * Renamed Tomahawk / Music Player menu to Controls. Let's see how that feels cross-platform. 2011-12-04 05:54:33 +01:00
Leo Franchi
80320fcf4e More regression hunting: fix dynamic playlist spinner disappearing prematurely 2011-12-03 16:09:50 -08:00
Leo Franchi
de6c80f04d Fix regression from model refactor that changed function name 2011-12-03 15:15:36 -08:00
mgnz
a4891bc64d Update lang/tomahawk_es.ts 2011-12-03 16:17:54 +01:00
mgnz
13ecdb04ee Update lang/tomahawk_es.ts 2011-12-03 16:13:10 +01:00
Christian Muehlhaeuser
633dddf281 * Fixed tomahawk:// protocol handler on Windows (Firefox related). 2011-12-02 13:19:02 +01:00
Christian Muehlhaeuser
8941036105 * Fixed auto-scrolling with the current selection. 2011-12-02 13:02:28 +01:00
Christian Muehlhaeuser
f46d0803be * Made sure lists resolve top-to-bottom. 2011-12-02 10:00:07 +01:00
Christian Muehlhaeuser
eec1e56dda * Try to fix dupe Tomahawk menu on OSX. 2011-12-01 15:34:24 +01:00
Christian Muehlhaeuser
324f8a9515 * Show an error dialog when a playback problem occurred. 2011-12-01 08:09:54 +01:00
Christian Muehlhaeuser
793babcd12 * Fixed TWK-418: Context menu for now playing track. 2011-12-01 07:21:53 +01:00
Christian Muehlhaeuser
8fb15633d3 Merge branch 'master' of github.com:tomahawk-player/tomahawk 2011-12-01 06:08:02 +01:00
Dominik Schmidt
4b77b9525f Don't install .protocol file anymore, if it's not enforced with LEGACY_KDE_INTEGRATION. Does anyone have Qt >= 4.7 and KDE =< 4.6.0 2011-11-30 18:15:41 +01:00
Dominik Schmidt
eff08a7cbd Fix opening URLs with gvfs-open, why does firefox ignore it? why does epiphany ignore it? ... 2011-11-30 14:57:39 +01:00
Christian Muehlhaeuser
6c8550bf64 * Bit of spring cleanup. 2011-11-30 11:49:01 +01:00
Dominik Schmidt
29239e08d3 Boo for too pedantic desktop-file-validate 2011-11-29 14:02:18 +01:00
Dominik Schmidt
34677a9c85 Merge branch 'master' of git://github.com/tomahawk-player/tomahawk 2011-11-29 13:42:52 +01:00
Dominik Schmidt
66914824af Add MimeType=x-scheme-handler/tomahawk to tomahawk.desktop 2011-11-29 13:42:42 +01:00
Christian Muehlhaeuser
08f6970303 Merge pull request #63 from omniwired/master
Updated to the lastest version and polished some lines
2011-11-29 00:25:05 -08:00
OmniWired
4878784ebe * Updated to lastest version and polished some lines 2011-11-29 04:34:37 -03:00
Dominik Schmidt
7984d38628 Remove now unneeded files from windows installer 2011-11-29 03:08:45 +01:00
Dominik Schmidt
b5ab183504 Use new phonon(-vlc) builds in update-vlc.sh, yay for umlauts and no-track-skipping (hopefully) 2011-11-29 02:53:24 +01:00
Dominik Schmidt
91f8ab27ee ifdefs--: abstract QDesktopServices away once again in TomahawkSettings 2011-11-28 19:39:08 +01:00
Christian Muehlhaeuser
7c9fc46caa * Don't accept 0.0.0.0 as a visible / valid address. 2011-11-28 16:36:01 +01:00
Christian Muehlhaeuser
48d07a679b * Proper fix for TWK-422. 2011-11-28 15:54:53 +01:00
Christian Muehlhaeuser
f4d1bc8dfb * Potential fix for TWK-422: Disappearing (white on white) sidebar items for some styles (e.g. gtk/gnome). 2011-11-28 15:43:28 +01:00
Christian Muehlhaeuser
5c380b0b8c * Tomahawkified some sources. 2011-11-28 15:26:37 +01:00
Christian Muehlhaeuser
9787e3bc08 * Updated German translation. 2011-11-28 15:15:24 +01:00
Christian Muehlhaeuser
5e15808508 * Updated German translation. 2011-11-28 14:58:31 +01:00
Leo Franchi
9a4d4cc409 remove unneeded debug 2011-11-28 08:31:26 -05:00
Christian Muehlhaeuser
fd936617d7 * Fixing assert in JobStatusModel. 2011-11-28 14:31:07 +01:00
Christian Muehlhaeuser
ef02bd8fae * Updated german translation. 2011-11-28 11:45:39 +01:00
Christian Muehlhaeuser
ffe30498cb * More natural job view order. 2011-11-28 10:37:55 +01:00
Christian Muehlhaeuser
2585467f0a * Animate the JobStatusView when it changes its size. 2011-11-28 10:22:44 +01:00
Christian Muehlhaeuser
68cf583e4b * Remove silly deleteLater in M3uLoader. 2011-11-28 09:54:04 +01:00
Christian Muehlhaeuser
e2336b595d * Fixed M3U loader not appending tracks to an existing playlist. 2011-11-28 09:51:20 +01:00
Christian Muehlhaeuser
5911b51d05 * Fixed storing playlists after directly dropping stuff on the PlaylistModel. 2011-11-28 09:29:55 +01:00
Christian Muehlhaeuser
9e23315972 * Added a splitter to SourceInfoWidget. 2011-11-28 09:05:59 +01:00
Christian Muehlhaeuser
e536157a4f * Quietened up a bit. 2011-11-28 08:56:18 +01:00
Christian Muehlhaeuser
c850fa3520 * Fixed TWK-556: Auto switch to super collection mode if we don't have any 'offical' information available. 2011-11-28 08:16:43 +01:00
Christian Muehlhaeuser
a8b655fef8 * Fixed TWK-559: Be more consistent with our GUI text. 2011-11-28 06:45:29 +01:00
Christian Muehlhaeuser
3ed443456a * Support Footnotes in TreeViews. 2011-11-28 06:32:20 +01:00
Dominik Schmidt
0a46febf36 Disable unreachable code path in servent which depends on QtGui 2011-11-28 03:31:42 +01:00
Christian Muehlhaeuser
956243e570 * Center overlay widgets before showing them the first time. 2011-11-27 01:11:21 +01:00
Christian Muehlhaeuser
b86c0f5c5e * Added a few overlay info messages. 2011-11-26 09:59:27 +01:00
Christian Muehlhaeuser
7b96505d27 * Improved file scanning situation a bit. 2011-11-26 09:10:51 +01:00
Leo Franchi
ba80899ee5 Remove upcoming tracks not from selected but from playing item 2011-11-25 14:34:35 -05:00
Leo Franchi
f9b18a9c26 Update the tree on mac after /Volumes is shown to avoid a race condition 2011-11-25 14:30:49 -05:00
Hugo Lindström
ed306b00f0 Create playlist from M3U 2011-11-24 15:02:33 +01:00
Christian Muehlhaeuser
f38f6b2eed * Coding-style fixes for DropJob. 2011-11-24 13:57:25 +01:00
Christian Muehlhaeuser
5929adfa57 * Support a few more URL shorteners: ow.ly, fb.me, itun.es, tinyurl.com. 2011-11-24 13:30:20 +01:00
Christian Muehlhaeuser
758bb74603 * Updated german and english translations. 2011-11-24 12:57:12 +01:00
Christian Muehlhaeuser
7d33ca1dec * Removed obsolete m_isPlayingHttp boolean. 2011-11-24 10:30:34 +01:00
Frank Osterfeld
953a9d2f71 fix warnings (delete + incomplete type, initializer list ordering) 2011-11-24 08:23:50 +01:00
Christian Muehlhaeuser
c90f0efad2 * Try to fix headless compiling. 2011-11-24 06:33:04 +01:00
Christian Muehlhaeuser
e4ad727a6f * Fixed a few more translations. Could fix TWK-591. 2011-11-24 06:25:00 +01:00
Christian Muehlhaeuser
97e69f9dcc * Added debugging output to identify Windows special char issue. 2011-11-24 05:29:01 +01:00
Christian Muehlhaeuser
e5086f5b49 * Crash reporter can now be disabled in the settings. 2011-11-24 02:41:18 +01:00
Christian Muehlhaeuser
c5236b897e * Updated ChangeLog. 2011-11-24 01:50:10 +01:00
Christian Muehlhaeuser
383ae37ce5 * Updated ChangeLog. 2011-11-24 01:50:10 +01:00
Christian Muehlhaeuser
cd753265a1 * Updated ChangeLog. 2011-11-24 01:50:10 +01:00
Christian Muehlhaeuser
9a0b3409d9 * Use default locale if translation can't be found. 2011-11-24 01:30:16 +01:00
Christian Muehlhaeuser
8d620363b7 * Disable UbuntuUnityHack until it's working properly. 2011-11-24 01:24:12 +01:00
Christian Muehlhaeuser
1db24d9c01 Merge pull request #61 from omniwired/master
Updated the .ts to the lastest source version
2011-11-23 14:28:25 -08:00
OmniWired
ccd485290e * Updated to lastest version and polished some lines 2011-11-23 19:05:44 -03:00
Hugo Lindström
9f0b412626 Codestyle fix 2011-11-23 22:56:37 +01:00
Hugo Lindström
31945b9017 Begun M3u parsing 2011-11-23 22:53:21 +01:00
Jason Herskowitz
11a6f419aa Update changelog 2011-11-23 16:14:28 -05:00
Christian Muehlhaeuser
5f8b56ff85 * Support .oga files (ogg mimetype). 2011-11-23 20:50:15 +01:00
Christian Muehlhaeuser
fc5bf30a79 * Prevent stuck now playing indicator. 2011-11-23 12:28:34 +01:00
Christian Muehlhaeuser
8cff1f7b76 * Only open database once. Might speed up loading a bit. 2011-11-23 11:37:36 +01:00
Christian Muehlhaeuser
86860b6da3 * Should hopefully fix Windows SettingsDialog. 2011-11-23 10:46:13 +01:00
Christian Muehlhaeuser
1d3d7738ae * Try fixing SettingsDialog on Windows. 2011-11-23 10:32:48 +01:00
Christian Muehlhaeuser
f3f1c2d814 * Forgot to rename crash reporter in one more place. 2011-11-23 10:22:13 +01:00
Christian Muehlhaeuser
e63eef8faf * Updated new crash reporter binary name in release scripts. 2011-11-23 10:12:09 +01:00
Christian Muehlhaeuser
cb3a4cf66b * Call ensurePolished before creating buttons in SettingsDialog. 2011-11-23 09:57:08 +01:00
Christian Muehlhaeuser
cf771ae94b * DRY: Cleaned up DropJob / ShortenedLinkParser & handling spoti.fi urls now. 2011-11-23 09:33:31 +01:00
Christian Muehlhaeuser
1b09361c51 * DRY: Moved md5() helper method to TomahawkUtils. 2011-11-23 09:18:31 +01:00
Dominik Schmidt
6172ef3df4 * Merged FindCLucene fix. 2011-11-23 06:39:38 +01:00
Christian Muehlhaeuser
a0cda5cce6 * Moved charts & spotify parser to port 80. 2011-11-23 06:32:29 +01:00
Christian Muehlhaeuser
445d6ca84c * Prevented over-zealous assert in PlaylistModel. 2011-11-23 06:20:04 +01:00
Dominik Schmidt
2be3ebd90b * Merged CrashReporter changes into master. 2011-11-23 06:14:26 +01:00
Dominik Schmidt
8a9c8278e2 Search for *_tomahawkresolver in CMAKE_INSTALL_LIBEXECDIR 2011-11-23 05:47:49 +01:00
Christian Muehlhaeuser
7c66269ac1 * Look for CrashReporter in local and global dirs. 2011-11-23 05:47:43 +01:00
Christian Muehlhaeuser
30dcf3cebb * More reliable and easier to read version check. Moved to TomahawkUtils, too. 2011-11-23 05:32:46 +01:00
Christian Muehlhaeuser
f5d2251312 * Made sure we don't duplicate connections in WelcomeWidget. 2011-11-23 05:03:58 +01:00
Christian Muehlhaeuser
004ea967ad * Use the proper color for selected playlist items on the Dashboard. 2011-11-23 05:00:47 +01:00
Christian Muehlhaeuser
55ab72ee76 * Use the proper highlight color for painting hovered artist names in the AlbumItemDelegate. 2011-11-23 04:54:16 +01:00
Christian Muehlhaeuser
54b8def06a * Update SourceInfoWidget when collection changes. 2011-11-23 04:38:07 +01:00
Christian Muehlhaeuser
778f352c0f * Less furious logging. 2011-11-23 04:18:40 +01:00
Christian Muehlhaeuser
34fab0f210 * Update recent additions on welcome page whenever a collection changes. 2011-11-23 04:18:39 +01:00
Christian Muehlhaeuser
ddfe32eec3 Merge pull request #60 from omniwired/master
Spanish Translation
2011-11-22 18:05:32 -08:00
OmniWired
cf678ce89f * Added spanish translation. 2011-11-22 22:36:55 -03:00
Christian Muehlhaeuser
4cbcbd2cda Merge pull request #59 from zizzfizzix/tr
PL translation update + some fixes and cleanups
2011-11-22 16:49:44 -08:00
Kuba Serafinowski
8cba2c4727 small update 2011-11-23 00:00:11 +00:00
Kuba Serafinowski
24d524f558 moar strings to translate! 2011-11-23 00:00:11 +00:00
Kuba Serafinowski
f060b6fd6b update PL translation file 2011-11-23 00:00:11 +00:00
Kuba Serafinowski
2a98857af1 remove unneeded strings 2011-11-23 00:00:11 +00:00
Kuba Serafinowski
147364de84 tiny typo fix 2011-11-23 00:00:10 +00:00
Jeff Mitchell
9b895034df Hopefully fix a case where the seek slider travels on when Phonon is
buffering
2011-11-22 16:53:35 -05:00
Jeff Mitchell
ef575c4d6d More explicitly set DefaultProxy and NoProxy in respective cases, may
help jayniz
2011-11-22 12:54:14 -05:00
Leo Franchi
31a67ecd42 Merge pull request #58 from rotzbouw/master
Enhance resolver version comparison to a third point
2011-11-22 07:39:09 -08:00
Thierry Goeckel
5bc0a496ed Enhance version upgrading to include a third point. 2011-11-22 16:30:39 +01:00
Leo Franchi
38a7051bba Fix loading XSPFs with spaces in their name. 2011-11-22 08:57:04 -05:00
Christian Muehlhaeuser
b5167db7a3 * Revert back to using system locale. 2011-11-22 08:29:49 +01:00
Christian Muehlhaeuser
b62dd8e96a * Add a default english translation. Fallback to 'en' if locale is set to 'C'. 2011-11-22 07:37:09 +01:00
Christian Muehlhaeuser
f023bb2bc7 * Fixed translation issue in TomahawkUtils. 2011-11-22 07:24:20 +01:00
Christian Muehlhaeuser
8a4e75e8fb * Fixed window title in AudioControls. 2011-11-22 06:35:44 +01:00
Christian Muehlhaeuser
7197040026 Merge pull request #55 from zizzfizzix/translation_pl
add Polish translation
2011-11-21 20:34:46 -08:00
Christian Muehlhaeuser
c9bf8eb349 * Increased size of Get-New-Resolvers dialog. 2011-11-22 05:23:46 +01:00
Christian Muehlhaeuser
0fba1504f0 * Cleanup scanner if there were no new and no obsolete tracks found. 2011-11-22 04:16:27 +01:00
Christian Muehlhaeuser
1347736ead * Don't let the MusicScanner emit finished before all our stuff actually ended up in the database. 2011-11-22 04:07:38 +01:00
Christian Muehlhaeuser
360748dd0b * Re-enable grouping of dynamic playlist revisions. 2011-11-22 02:04:42 +01:00
Christian Muehlhaeuser
18a3f15101 * Remove bottom label of steering controls. Changes now take effect on clicking the apply button. 2011-11-22 02:00:57 +01:00
Christian Muehlhaeuser
eba1505e1d * Don't remove current index when restarting a track by activating it directly.
* Don't create new playlist revisions for a list that doesn't belong to you.
2011-11-22 01:52:24 +01:00
Christian Muehlhaeuser
0f21cde318 * Fixed crashing on playing from queue. 2011-11-22 01:36:22 +01:00
Christian Muehlhaeuser
1c1b6ea940 * Fixed updating result-hints for out-dated dynamic playlists. 2011-11-21 21:52:58 +01:00
Christian Muehlhaeuser
4f55c6aa9a * Fixed compiling on Fedora 16. 2011-11-21 20:24:40 +01:00
Christian Muehlhaeuser
83d48c99aa * Don't overwrite friendlyname with an empty one. 2011-11-21 18:04:03 +01:00
Dominik Schmidt
40248965be Add missing files 2011-11-21 16:15:54 +01:00
Dominik Schmidt
584fc8a1b6 ifdefs--: split TomahawkSettings 2011-11-21 16:14:04 +01:00
Dominik Schmidt
3d0421b0a6 ifdefs--: not needed anymore 2011-11-21 16:14:04 +01:00
Christian Muehlhaeuser
633ade23fc * Assert on empty friendlynames. 2011-11-21 14:46:29 +01:00
Leo Franchi
f6d377275b Merge pull request #57 from crabmanX/xspfdialog
fix xspf import QFileDialog filter
2011-11-21 05:05:13 -08:00
Leo Franchi
5053c3cc7a Don't return last factory result instead of correct one 2011-11-21 07:59:43 -05:00
Kilian Lackhove
eb03e2c912 fix xspf import QFileDialog filter 2011-11-21 13:55:32 +01:00
Dominik Schmidt
699a6583b2 Merge pull request #56 from zizzfizzix/TWK-583
Fix #TWK-583
2011-11-21 04:50:04 -08:00
Kuba Serafinowski
a760577924 fix TWK-583 for jabber too 2011-11-21 12:47:13 +00:00
Kuba Serafinowski
5e40409ed9 fix for TWK-583 2011-11-21 12:31:19 +00:00
Hugo Lindström
7eb361f514 Fix for broken compile 2011-11-21 08:43:06 +01:00
Christian Muehlhaeuser
3a500a6303 * Always set current name as friendlyname. 2011-11-21 06:45:32 +01:00
Christian Muehlhaeuser
de48898d34 * Fixed WelcomeWidget. 2011-11-21 05:21:57 +01:00
Leo Franchi
6b23a58678 Fix one compile error 2011-11-20 23:08:59 -05:00
Christian Muehlhaeuser
d650ea45b5 * Refactored Track-, Collection-, PlaylistModel. 2011-11-21 05:01:00 +01:00
Leo Franchi
3f139addc3 Add a 0.3.2 changelog 2011-11-20 22:51:57 -05:00
Leo Franchi
8488eac070 TWK-531: Show (-) on new item after deleting an item 2011-11-20 22:39:00 -05:00
Leo Franchi
1a338aa602 Reclaim copyright :) 2011-11-20 22:39:00 -05:00
Dominik Schmidt
118b074aa3 What was that include for boostcrap again? 2011-11-21 04:14:05 +01:00
Dominik Schmidt
4f46ba3e61 style++ 2011-11-21 04:05:24 +01:00
Dominik Schmidt
2bba9ba000 ifdefs--: make pipeline ready for tomahawk-core 2011-11-21 03:57:26 +01:00
Dominik Schmidt
4c2bb1dd28 Fix headless 2011-11-21 02:41:09 +01:00
Dominik Schmidt
8849577f82 ifdefs--: Same for QtScriptResolver, QtWebkit needs QtGui :( 2011-11-21 02:41:09 +01:00
Dominik Schmidt
cef3f3ef0d ifdefs--: GlobalActionManager is not part of the headless build anyways 2011-11-21 02:41:09 +01:00
Leo Franchi
0dda262c18 Clear upcoming station tracks when steering, and re-fetch two 2011-11-20 20:06:51 -05:00
Leo Franchi
eb7845092a use QFileSystemModel instead of deprecated QDirModel, and show /Volumes on mac 2011-11-20 18:05:02 -05:00
Leo Franchi
24bf86fc37 Reset source last played when going offline---not functional yet 2011-11-20 18:02:39 -05:00
Dominik Schmidt
ea7e641bdd ifdefs--: Move ActionCollection initialization code from AudioEngine to
Ac
2011-11-20 23:32:39 +01:00
Dominik Schmidt
0f3ba435d9 lalalalala 2011-11-20 22:39:50 +01:00
Dominik Schmidt
d199fe5ff0 ifdefs--: split TomahawkUtils 2011-11-20 22:35:34 +01:00
Leo Franchi
c63e56712e Use plugins/ instead of PlugIns/ as vlc hard-codes it internally. 2011-11-20 16:17:42 -05:00
Christian Muehlhaeuser
a14b3cf49a Merge pull request #52 from yeager/master
Enable Swedish translation
2011-11-20 12:08:20 -08:00
Leo Franchi
14f75a0f8c Increment job count when creating a new xspf job 2011-11-20 14:26:17 -05:00
Jeff Mitchell
52df44c40c Merge branch 'master' into serventfixing 2011-11-20 13:14:06 -05:00
Kuba Serafinowski
0fb232216c add Polish translation
initially ~76% done
2011-11-20 15:27:55 +00:00
Dominik Schmidt
0449557ab2 Merge pull request #54 from zizzfizzix/littlefixes
Littlefixes
2011-11-20 05:24:01 -08:00
Kuba Serafinowski
00e4faa690 make the string extract with lupdate 2011-11-20 13:07:26 +00:00
Kuba Serafinowski
9e354b4392 match the text with buttons in the dialog 2011-11-20 13:07:26 +00:00
Hugo Lindström
743bffc9a6 Try to append xspf 2011-11-20 11:26:04 +01:00
Hugo Lindström
23d30e6197 Unbreak url drops 2011-11-20 09:23:38 +01:00
Hugo Lindström
302bdd4c6d Fix for local xspf dropjob, also allow remotes 2011-11-19 22:29:39 +01:00
Daniel Nylander
3a53f96119 Enabling Swedish translation 2011-11-19 17:03:10 +01:00
Christian Muehlhaeuser
42f5ef4bc9 Merge pull request #51 from yeager/master
Swedish translation
2011-11-19 07:29:55 -08:00
Daniel Nylander
e7df308d2a Added Swedish translation 2011-11-19 16:25:58 +01:00
Christian Muehlhaeuser
c533778f3b Merge pull request #50 from zizzfizzix/cmake_quazip_fix
Fix misleading cmake message - thanks zizzfizzix!
2011-11-19 06:47:10 -08:00
Kuba Serafinowski
8defaa6be5 fix misleading cmake message 2011-11-19 13:29:40 +00:00
Leo Franchi
fe97fbe977 Show tooltip with full text in job view 2011-11-18 21:34:55 -05:00
Leo Franchi
96d8d8b2b2 Make clicking back to current track work on dashboard, charts, and artist/album pages 2011-11-18 21:12:29 -05:00
Leo Franchi
115c618fc2 Don't show speaker next to a playlist if not paused or playing 2011-11-18 21:12:29 -05:00
Jeff Mitchell
46793bbf99 Do the connection name fixing in a different way; always end up with a
QHostAddress.
2011-11-18 18:18:19 -05:00
Jeff Mitchell
ed11593b16 Remove some debugging 2011-11-18 17:35:23 -05:00
Jeff Mitchell
7cc4632761 Lots of debug and half the fixes for fixing hostnames 2011-11-18 17:12:45 -05:00
Jeff Mitchell
362f8fc622 Add application proxy factory back in, only have servent use noproxy
in favor of default proxy, as opposed to when a SOCKS proxy is set
2011-11-18 15:24:51 -05:00
Leo Franchi
708668ea0a Always clear spinner when no albums found to load in albumview 2011-11-18 13:04:04 -05:00
Leo Franchi
80e1946fa4 Only show JS errors in tomahawk debug builds 2011-11-18 12:48:36 -05:00
Christian Muehlhaeuser
85d70f3408 * Fixed TWK-579: Proper default width for the sidebar. 2011-11-18 17:01:57 +01:00
Christian Muehlhaeuser
b9537802e3 * This should fix sources being stuck in 'Parsing'. 2011-11-18 11:39:47 +01:00
Leo Franchi
0c0a2ea55c Put delcaration in ifdef 2011-11-17 14:37:21 -05:00
Leo Franchi
ca14fbf0aa Automatically upgrade resolvers 2011-11-17 14:19:11 -05:00
Jeff Mitchell
9f1ec0ce93 More cleanup, more actioncollectionifying, and fix a few signals 2011-11-17 13:26:50 -05:00
Jeff Mitchell
9a3cc63700 Move some more actions to the action collection, and remove some
unnecessary member variables from sourcetreeview.
2011-11-17 12:38:26 -05:00
Leo Franchi
9aaadad95b Set the timer with track duration calculated in 2011-11-16 23:07:15 -05:00
Leo Franchi
3bf6682fce fix rdio track loading 2011-11-16 23:06:35 -05:00
Leo Franchi
9f009f5979 Add an "apply steering" button to make it clearer how to steer
Remove some super spammy debug
2011-11-16 22:41:40 -05:00
Leo Franchi
cb072fcf2c Manually replace + with " " as QUrl::queryItems doesn't do it for us... 2011-11-16 22:41:40 -05:00
Leo Franchi
5a94949b94 Don't hook up signals twice for loading xspf 2011-11-16 22:41:40 -05:00
Leo Franchi
589202bde7 Make surer to show playlist once loaded 2011-11-16 22:41:40 -05:00
Leo Franchi
6dd12f1940 Don't show drop indicator for playlists in sidebar and always create new ones 2011-11-16 22:41:40 -05:00
Christian Muehlhaeuser
c5a50849ec * Added debug output to figure out naming weirdness. 2011-11-17 03:23:19 +01:00
Leo Franchi
6a68a1aa1d Make source visible in audiocontrols on os x 2011-11-16 17:46:49 -05:00
Thierry Göckel
aaa2417e74 Fix returning of external IP address for some routers. 2011-11-16 22:37:31 +01:00
Dominik Schmidt
add5308bc3 WIP: headless: fix crashes in sipjabber 2011-11-16 15:21:14 +01:00
Hugo Lindström
b431c34d5f Add cache for all charts. Later on move spotify and hypem to charts api. 2011-11-16 14:55:30 +01:00
Dominik Schmidt
4ba59c07f9 oops 2011-11-16 14:03:46 +01:00
Dominik Schmidt
681521e5a5 WIP: headless: compiles and links :) 2011-11-16 14:01:46 +01:00
Hugo Lindström
8731665257 Adding cache for charts 2011-11-16 12:26:02 +01:00
Christian Muehlhaeuser
e406fb90a9 * Fixed negative time values showing up in GUI. 2011-11-16 05:56:05 +01:00
Christian Muehlhaeuser
5dabdd73a1 * Make SetPlaylistRevision DBCmds groupable. 2011-11-16 05:13:56 +01:00
Christian Muehlhaeuser
179d84c39b * Set stats for the right collection. 2011-11-16 04:54:52 +01:00
Christian Muehlhaeuser
e5636a446e * Introducing groupable DatabaseCommands. 2011-11-16 04:37:29 +01:00
Christian Muehlhaeuser
27c7b3fc17 * Improved collection syncing.
* Improved dupe detection.
* Prevent sources from being stuck syncing.
2011-11-16 02:36:09 +01:00
Jeff Mitchell
7e35961874 Fix metatype registration of InfoStringHash 2011-11-15 16:03:52 -05:00
Dominik Schmidt
c0688dfc1f WIP: headless: libtomahawk compiles, but doesnt link 2011-11-15 05:30:03 +01:00
Dominik Schmidt
f6078403e0 WIP: headless 2011-11-15 05:10:35 +01:00
Leo Franchi
0569ee0f1a Don't accept button press events as well as release when handling latches 2011-11-14 16:03:57 -05:00
Jeff Mitchell
7badddb99c hacky fix for Jreen needing the application proxy set. Really we need to
get them to accept their own QNAM
2011-11-14 13:26:05 -05:00
Jeff Mitchell
d0e0d53ee7 Handle the worker/cache threads better in InfoSystem, and re-enable
deletion on shutdown, so we can test in windows nightlies.
2011-11-14 11:40:59 -05:00
Leo Franchi
6e176c77a6 Don't create QNRs for null urls, let audioengine handle it properly 2011-11-13 22:28:02 -05:00
Leo Franchi
ba8cfc3e91 Revert "Skip to next track if we have a QNR and it emits a failed signal"
This reverts commit 9418fd0fb8.
2011-11-13 22:27:49 -05:00
Leo Franchi
2f97ff63f3 Shrink font for playlist author 2011-11-13 15:50:26 -05:00
Leo Franchi
641759c362 Hide connect warning 2011-11-13 15:49:59 -05:00
Leo Franchi
ae938cf04c Add 0.3.1 fixes to Changelog 2011-11-13 14:06:55 -05:00
Christian Muehlhaeuser
8f13fcdda6 * Updated ChangeLog. 2011-11-13 19:27:13 +01:00
Christian Muehlhaeuser
29bca56e56 * Bumped version to 0.3.99. 2011-11-13 19:26:33 +01:00
Christian Muehlhaeuser
297b230669 * Force an index update after 0.3.1 upgrade. 2011-11-13 19:15:37 +01:00
Christian Muehlhaeuser
1c6c52056f * 'Fixed' Windows shutdown crash. 2011-11-13 18:39:00 +01:00
Dominik Schmidt
25bb7bd547 Remove unneccessary toString conversion 2011-11-13 17:22:02 +01:00
Kilian Lackhove
8c175b88c5 add command line option to hide main window on startup 2011-11-12 12:15:52 -05:00
Christian Muehlhaeuser
85c7cb4186 * Fixed creating index when there is only a local source. 2011-11-11 23:27:52 +01:00
Leo Franchi
09a7d790ad Only do setenv on linux, that's theonly time we'll have unity anyway 2011-11-11 17:04:53 -05:00
Leo Franchi
d49a43709d Hide red latch headphones on local source if the source you are latched on to goes offline 2011-11-11 17:00:07 -05:00
Leo Franchi
96fe10cc9f Add Unity systray hack from Clementine. 2011-11-11 17:00:07 -05:00
Leo Franchi
8626678d23 Add comment 2011-11-11 17:00:06 -05:00
Leo Franchi
2a27cbde0d Draw the author name as well as avatar in recent playlists 2011-11-11 17:00:06 -05:00
Leo Franchi
1f10444d5c Don't show in global menu in unity. Thanks davidsansome :) 2011-11-11 17:00:06 -05:00
Leo Franchi
1bb8ff97d4 Be a bit more resilient in setting the playlist to rename after creating 2011-11-11 17:00:06 -05:00
Leo Franchi
518546b525 Don't select a temp item when deleting it 2011-11-11 17:00:06 -05:00
Leo Franchi
17e1003714 Hide warning 2011-11-11 17:00:06 -05:00
Christian Muehlhaeuser
011ece182f * Prevent watch for changes interfering with running scan. 2011-11-11 19:46:52 +01:00
Leo Franchi
8e742a06d9 Build sparkle upgrade handler conditionally 2011-11-11 12:24:51 -05:00
Leo Franchi
3c024ab7ac Stop the timer on new track starting 2011-11-11 11:35:34 -05:00
Dominik Schmidt
f216a0fe82 Do some work towards tomahawk headless 2011-11-11 03:44:18 +01:00
Leo Franchi
f9b5bda925 Fix crash on Sparkle update when binary is replaced. 2011-11-10 18:30:22 -05:00
443 changed files with 38243 additions and 6878 deletions

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "thirdparty/jreen"]
path = thirdparty/jreen
url = git://github.com/euroelessar/jreen.git

View File

@@ -15,15 +15,18 @@ SET( TOMAHAWK_APPLICATION_NAME "Tomahawk" )
SET( TOMAHAWK_DESCRIPTION_SUMMARY "The social media player" )
SET( TOMAHAWK_VERSION_MAJOR 0 )
SET( TOMAHAWK_VERSION_MINOR 3 )
SET( TOMAHAWK_VERSION_PATCH 0 )
SET( TOMAHAWK_VERSION_MINOR 4 )
SET( TOMAHAWK_VERSION_PATCH 2 )
#SET( TOMAHAWK_VERSION_RC 0 )
# enforce proper symbol exporting on all platforms
add_definitions( "-fvisibility=hidden" )
# build options
option(BUILD_GUI "Build Tomahawk with GUI" ON)
option(BUILD_RELEASE "Generate TOMAHAWK_VERSION without GIT info" OFF)
option(LEGACY_KDE_INTEGRATION "Install tomahawk.protocol file, deprecated since 4.6.0" OFF)
# generate version string
@@ -54,6 +57,9 @@ SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
# make predefined install dirs available everywhere
INCLUDE(GNUInstallDirs)
# installer creation
INCLUDE( TomahawkCPack.cmake )
@@ -68,7 +74,7 @@ IF( NOT BUILD_GUI )
MESSAGE( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} in HEADLESS mode ***" )
ELSE()
MESSAGE( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} full GUI version ***" )
LIST(APPEND NEEDED_QT4_COMPONENTS "QtGui" "QtWebkit" )
LIST(APPEND NEEDED_QT4_COMPONENTS "QtGui" "QtWebkit" "QtUiTools" )
ENDIF()
IF( BUILD_GUI AND UNIX AND NOT APPLE )
@@ -76,7 +82,7 @@ IF( BUILD_GUI AND UNIX AND NOT APPLE )
ENDIF()
macro_optional_find_package(Qt4 4.7.0 COMPONENTS ${NEEDED_QT4_COMPONENTS} )
macro_log_feature(QT4_FOUND "Qt" "A cross-platform application and UI framework" "http://qt.nokia.com" TRUE "" "If you see this, although libqt4-devel is installed, check whether \n the qtwebkit-devel package is installed as well")
macro_log_feature(QT4_FOUND "Qt" "A cross-platform application and UI framework" "http://qt.nokia.com" TRUE "" "If you see this, although libqt4-devel is installed, check whether the \n qtwebkit-devel package and whatever contains QtUiTools is installed too")
macro_optional_find_package(Phonon 4.5.0)
macro_log_feature(PHONON_FOUND "Phonon" "The Phonon multimedia library" "http://phonon.kde.org" TRUE "" "")
@@ -108,7 +114,14 @@ macro_optional_find_package(LibAttica)
macro_log_feature(LIBATTICA_FOUND "libattica" "Provides support for automatic fetching and managing of resolvers from the tomahawk website" "https://projects.kde.org/projects/kdesupport/attica" FALSE "" "")
macro_optional_find_package(QuaZip)
macro_log_feature(QuaZip_FOUND "QuaZip" "Provides support for extracting downloaded resolvers autmatically. Will build internal copy instead." "http://quazip.sourceforge.net/" FALSE "" "")
macro_log_feature(QuaZip_FOUND "QuaZip" "Provides support for extracting downloaded resolvers automatically." "http://quazip.sourceforge.net/" FALSE "" "")
macro_optional_find_package(Jreen)
macro_log_feature(LIBJREEN_FOUND "Jreen" "Qt XMPP Library" "https://github.com/euroelessar/jreen" FALSE "" "Jreen is needed for the Jabber SIP plugin.\n")
macro_optional_find_package(QTweetLib)
macro_log_feature(QTWEETLIB_FOUND "QTweetLib" "Qt Twitter Library" "https://github.com/minimoog/QTweetLib" FALSE "" "QTweetLib is needed for the Twitter SIP plugin.\n")
IF( NOT QuaZip_FOUND )
add_subdirectory( ${CMAKE_SOURCE_DIR}/src/libtomahawk/thirdparty/quazip )
@@ -116,6 +129,7 @@ IF( NOT QuaZip_FOUND )
SET( QuaZip_LIBRARY quazip )
SET( QuaZip_LIBRARIES ${QuaZip_LIBRARY} )
SET( QuaZip_FOUND true )
macro_log_feature(QuaZip_FOUND "QuaZip" "Provides support for extracting downloaded resolvers automatically. Building internal copy" "http://quazip.sourceforge.net/" FALSE "" "")
# copy headers to build/quazip so we can use proper includes inside the code
FILE( COPY ${CMAKE_SOURCE_DIR}/src/libtomahawk/thirdparty/quazip/quazip/ DESTINATION ${CMAKE_BINARY_DIR}/libtomahawk/thirdparty/quazip )
@@ -128,29 +142,17 @@ ENDIF()
set(LIBLASTFM_FOUND true)
#### submodules start
# automatically init submodules here, don't delete this code we may add submodules again
# this installs headers and such and should really be handled in a separate package by packagers
IF( INTERNAL_JREEN )
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.gitmodules)
EXECUTE_PROCESS(COMMAND git submodule init WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
EXECUTE_PROCESS(COMMAND git submodule update WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.gitmodules)
ENDIF()
IF( INTERNAL_JREEN )
ADD_SUBDIRECTORY( ${THIRDPARTY_DIR}/jreen )
SET( LIBJREEN_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/thirdparty/jreen/include )
SET( LIBJREEN_LIBRARY jreen )
SET( LIBJREEN_LIBRARIES ${LIBJREEN_LIBRARY} )
SET( LIBJREEN_FOUND true )
MESSAGE(STATUS "INTERNAL libjreen: ${LIBJREEN_INCLUDE_DIR}, ${LIBJREEN_LIBRARY}")
ELSE( INTERNAL_JREEN )
macro_optional_find_package(Jreen)
ENDIF( INTERNAL_JREEN )
macro_log_feature(LIBJREEN_FOUND "Jreen" "Qt XMPP Library" "https://github.com/euroelessar/jreen" FALSE "" "Jreen is needed for the Jabber SIP plugin. \n\n Use -DINTERNAL_JREEN=ON to build the git submodule inside Tomahawk \n Be aware this installs a full jreen with headers and everything!\n")
# IF( FALSE )
# IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.gitmodules)
# EXECUTE_PROCESS(COMMAND git submodule init WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
# EXECUTE_PROCESS(COMMAND git submodule update WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
# ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.gitmodules)
# ENDIF()
macro_optional_find_package(QTweetLib)
macro_log_feature(QTWEETLIB_FOUND "QTweetLib" "Qt Twitter Library" "https://github.com/minimoog/QTweetLib" FALSE "" "QTweetLib is needed for the Twitter SIP plugin.\n")
#### submodules end
### libportfwd
@@ -211,4 +213,9 @@ ADD_SUBDIRECTORY( src/libtomahawk )
SET( TOMAHAWK_LIBRARIES tomahawklib )
ADD_SUBDIRECTORY( src )
ADD_SUBDIRECTORY( admin )
ADD_SUBDIRECTORY( src/breakpad/CrashReporter )
IF( BUILD_GUI )
IF( NOT DISABLE_CRASHREPORTER )
ADD_SUBDIRECTORY( src/breakpad/CrashReporter )
ENDIF()
ENDIF()

View File

@@ -2,6 +2,7 @@
# This module looks for clucene (http://clucene.sf.net) support
# It will define the following values
#
# CLUCENE_INCLUDE_DIRS = CLUCENE_INCLUDE_DIR + CLUCENE_LIBRARY_DIR
# CLUCENE_INCLUDE_DIR = where CLucene/StdHeader.h can be found
# CLUCENE_LIBRARY_DIR = where CLucene/clucene-config.h can be found
# CLUCENE_LIBRARIES = the libraries to link against CLucene
@@ -17,6 +18,7 @@ FIND_PACKAGE(CLuceneUnstable)
IF(CLUCENEUNSTABLE_FOUND)
SET(CLucene_FOUND TRUE)
SET(CLUCENE_INCLUDE_DIR ${CLUCENE_UNSTABLE_INCLUDE_DIRS})
SET(CLUCENE_INCLUDE_DIRS ${CLUCENE_INCLUDE_DIR})
SET(CLUCENE_LIBRARIES ${CLUCENE_UNSTABLE_LIBS})
#MESSAGE(FATAL_ERROR NARF)
@@ -106,7 +108,9 @@ ENDIF (CLUCENE_LIBRARY_DIR)
IF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARIES AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
SET(CLucene_FOUND TRUE)
SET(CLUCENE_INCLUDE_DIRS ${CLUCENE_LIBRARY_DIR} ${CLUCENE_INCLUDE_DIR})
ENDIF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARIES AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
ENDIF(CLUCENEUNSTABLE_FOUND)
IF(CLucene_FOUND)
@@ -120,7 +124,8 @@ ELSE(CLucene_FOUND)
ENDIF(CLucene_FOUND)
MARK_AS_ADVANCED(
CLUCENE_INCLUDE_DIR
CLUCENE_LIBRARY_DIR
CLUCENE_INCLUDE_DIRS
CLUCENE_INCLUDE_DIR
CLUCENE_LIBRARY_DIR
CLUCENE_LIBRARIES
)

View File

@@ -56,7 +56,7 @@ ELSE()
include(FindLibraryWithDebug)
include(FindPackageHandleStandardArgs)
find_path(TAGLIB_CFLAGS
find_path(TAGLIB_INCLUDES
NAMES
tag.h
PATH_SUFFIXES taglib

View File

@@ -0,0 +1,182 @@
# - Define GNU standard installation directories
# Provides install directory variables as defined for GNU software:
# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
# Inclusion of this module defines the following variables:
# CMAKE_INSTALL_<dir> - destination for files of a given type
# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path
# where <dir> is one of:
# BINDIR - user executables (bin)
# SBINDIR - system admin executables (sbin)
# LIBEXECDIR - program executables (libexec)
# SYSCONFDIR - read-only single-machine data (etc)
# SHAREDSTATEDIR - modifiable architecture-independent data (com)
# LOCALSTATEDIR - modifiable single-machine data (var)
# LIBDIR - object code libraries (lib or lib64)
# INCLUDEDIR - C header files (include)
# OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
# DATAROOTDIR - read-only architecture-independent data root (share)
# DATADIR - read-only architecture-independent data (DATAROOTDIR)
# INFODIR - info documentation (DATAROOTDIR/info)
# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale)
# MANDIR - man documentation (DATAROOTDIR/man)
# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME)
# Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION options of
# install() commands for the corresponding file type. If the includer does
# not define a value the above-shown default will be used and the value will
# appear in the cache for editing by the user.
# Each CMAKE_INSTALL_FULL_<dir> value contains an absolute path constructed
# from the corresponding destination by prepending (if necessary) the value
# of CMAKE_INSTALL_PREFIX.
#=============================================================================
# Copyright 2011 Nikita Krupen'ko <krnekit@gmail.com>
# Copyright 2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Installation directories
#
if(NOT DEFINED CMAKE_INSTALL_BINDIR)
set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
endif()
if(NOT DEFINED CMAKE_INSTALL_SBINDIR)
set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)")
endif()
if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR)
set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)")
endif()
if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)")
endif()
if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR)
set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)")
endif()
if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
endif()
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(_LIBDIR_DEFAULT "lib")
# Override this default 'lib' with 'lib64' iff:
# - we are on Linux system but NOT cross-compiling
# - we are NOT on debian
# - we are on a 64 bits system
# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
# Note that the future of multi-arch handling may be even
# more complicated than that: http://wiki.debian.org/Multiarch
if(CMAKE_SYSTEM_NAME MATCHES "Linux"
AND NOT CMAKE_CROSSCOMPILING
AND NOT EXISTS "/etc/debian_version")
if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
message(AUTHOR_WARNING
"Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
"Please enable at least one language before including GNUInstallDirs.")
else()
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(_LIBDIR_DEFAULT "lib64")
endif()
endif()
endif()
set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
endif()
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
endif()
if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR)
set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)")
endif()
if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR)
set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)")
endif()
#-----------------------------------------------------------------------------
# Values whose defaults are relative to DATAROOTDIR. Store empty values in
# the cache and store the defaults in local variables if the cache values are
# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes.
if(NOT CMAKE_INSTALL_DATADIR)
set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)")
set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}")
endif()
if(NOT CMAKE_INSTALL_INFODIR)
set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)")
set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info")
endif()
if(NOT CMAKE_INSTALL_LOCALEDIR)
set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)")
set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale")
endif()
if(NOT CMAKE_INSTALL_MANDIR)
set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)")
set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man")
endif()
if(NOT CMAKE_INSTALL_DOCDIR)
set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}")
endif()
#-----------------------------------------------------------------------------
mark_as_advanced(
CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_SBINDIR
CMAKE_INSTALL_LIBEXECDIR
CMAKE_INSTALL_SYSCONFDIR
CMAKE_INSTALL_SHAREDSTATEDIR
CMAKE_INSTALL_LOCALSTATEDIR
CMAKE_INSTALL_LIBDIR
CMAKE_INSTALL_INCLUDEDIR
CMAKE_INSTALL_OLDINCLUDEDIR
CMAKE_INSTALL_DATAROOTDIR
CMAKE_INSTALL_DATADIR
CMAKE_INSTALL_INFODIR
CMAKE_INSTALL_LOCALEDIR
CMAKE_INSTALL_MANDIR
CMAKE_INSTALL_DOCDIR
)
# Result directories
#
foreach(dir
BINDIR
SBINDIR
LIBEXECDIR
SYSCONFDIR
SHAREDSTATEDIR
LOCALSTATEDIR
LIBDIR
INCLUDEDIR
OLDINCLUDEDIR
DATAROOTDIR
DATADIR
INFODIR
LOCALEDIR
MANDIR
DOCDIR
)
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
else()
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")
endif()
endforeach()

View File

@@ -28,8 +28,8 @@
; We use official release plugins
; mingw32-vlc from obs misses a lot and has even broken ones probably
!define VLC_PATH "${SOURCE_PATH}\admin\win\vlc\prefix" ; SIC! ^
!define VLC_BIN "${VLC_PATH}\bin"
!define VLC_PATH "${SOURCE_PATH}\admin\win\vlc\" ; SIC! ^
!define VLC_BIN "${VLC_PATH}"
!define VLC_PLUGIN_PATH "${VLC_BIN}\plugins"
!define NSI_PATH "${SOURCE_PATH}/admin/win/nsi"
@@ -273,13 +273,12 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
;Main executable.
File "${INSTALL_PATH}\bin\tomahawk.exe"
File "${INSTALL_PATH}\bin\CrashReporter.exe"
File "${INSTALL_PATH}\bin\tomahawk_crash_reporter.exe"
File "${INSTALL_PATH}\bin\libtomahawk_breakpad.dll"
File "${INSTALL_PATH}\bin\libqxtweb-standalone.dll"
File "${INSTALL_PATH}\bin\libtomahawk_portfwd.dll"
File "${INSTALL_PATH}\bin\libtomahawk_lastfm2.dll"
File "${INSTALL_PATH}\bin\libquazip.dll"
File "${INSTALL_PATH}\bin\libtomahawklib.dll"
File "${INSTALL_PATH}\lib\libtomahawk_sip*.dll"
!endif
@@ -287,14 +286,13 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
;Main executable.
File "${BUILD_PATH}\tomahawk.exe"
File "${BUILD_PATH}\CrashReporter.exe"
File "${BUILD_PATH}\tomahawk_crash_reporter.exe"
File "${BUILD_PATH}\libtomahawk_breakpad.dll"
File "${BUILD_PATH}\libtomahawklib.dll"
File "${BUILD_PATH}\libqxtweb-standalone.dll"
File "${BUILD_PATH}\libtomahawk_portfwd.dll"
File "${BUILD_PATH}\libtomahawk_lastfm2.dll"
File "${BUILD_PATH}\libquazip.dll"
File "${BUILD_PATH}\libtomahawk_sip*.dll"
!endif
@@ -307,8 +305,10 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
File "${QT_DLL_PATH}\QtGui4.dll"
File "${QT_DLL_PATH}\QtNetwork4.dll"
File "${QT_DLL_PATH}\QtSql4.dll"
File "${QT_DLL_PATH}\QtXml4.dll"
File "${QT_DLL_PATH}\QtScript4.dll"
File "${QT_DLL_PATH}\QtUiTools4.dll"
File "${QT_DLL_PATH}\QtWebKit4.dll"
File "${QT_DLL_PATH}\QtXml4.dll"
;SQLite driver
SetOutPath "$INSTDIR\sqldrivers"
@@ -329,30 +329,17 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
File "${MING_BIN}\libstdc++-6.dll"
;Phonon stuff
;Fix the phonon build to not use Dbus
File "${QT_DLL_PATH}\QtDbus4.dll"
File "${MING_BIN}\libdbus-1-3.dll"
File "${MING_BIN}\dbus-daemon.exe"
File "${VLC_BIN}\libphonon.dll"
File "${MING_BIN}\libphonon.dll"
SetOutPath "$INSTDIR\phonon_backend"
File "${VLC_BIN}\phonon_backend\phonon_vlc.dll"
SetOutPath "$INSTDIR"
;VLC
;SetOutPath "$INSTDIR\phonon_backend"
File "${VLC_BIN}\libvlc.dll"
File "${VLC_BIN}\libvlccore.dll"
SetOutPath "$INSTDIR\plugins"
File /r "${VLC_PLUGIN_PATH}\*.dll"
SetOutPath "$INSTDIR"
File "${MING_BIN}\libmad-0.dll" ; MP3
File "${MING_BIN}\libFLAC-8.dll" ; FLAC
File "${MING_BIN}\libogg-0.dll" ; OGG, FLAC
File "${MING_BIN}\libvorbis-0.dll" ; OGG
File "${MING_BIN}\libvorbisenc-2.dll" ; OGG
; Other
File "${MING_BIN}\libqjson.dll"
@@ -363,6 +350,7 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
File "${MING_BIN}\libechonest.dll"
File "${MING_BIN}\libQTweetLib.dll"
File "${MING_BIN}\libquazip.dll"
; Jabber
File "${MING_BIN}\libjreen.dll"
@@ -467,7 +455,8 @@ Section -post
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tomahawk" "NoRepair" "1"
; Register tomahawk:// protocol handler
WriteRegStr HKCR "tomahawk" "" "URL: Tomahawk Protocol"
WriteRegStr HKCR "tomahawk" "" "URL:Tomahawk Protocol"
WriteRegStr HKCR "tomahawk" "URL Protocol" ""
WriteRegStr HKCR "tomahawk\DefaultIcon" "" $INSTDIR\tomahawk.exe,1
WriteRegStr HKCR "tomahawk\shell" "" "open"
WriteRegStr HKCR "tomahawk\shell\open\command" "" '"$INSTDIR\tomahawk.exe" "%1"'

108
ChangeLog
View File

@@ -1,3 +1,109 @@
Version 0.4.2:
* Fix ZeroConf protocol showing IP addresses instead of host names.
Sometimes. Full fix coming later.
* 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.
* Double-clicking a playlist starts playing it.
* Resolvers can now return disc number and album position for results.
* Fixed sorting playlists by track number.
* Fixed issues with changing proxy.
* Fixed Twitter authentication issues.
* Fixed Grooveshark support on Windows.
Version 0.4.0:
* Added visual notification for database indexing job.
* Fixed icons not appearing in resolvers list.
* Fixed various UI glitches and stray error messages in stations.
* Fixed bug where album page would resolve bottom-to-top.
* Fixed bug where Footnotes would not update when changing selected album in Album View.
* Fixed dragging albums and artists from charts, album, and artist views.
* Fixed bug where filter text would be one step behind filter value.
* 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 non-resolving tracks when dragging from album view.
* 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.
* Added basic command-line options for playback control.
* Bumped up web api timeouts to allow web clients to finish resolving.
* Added filename suggestion when exporting a playlist.
* Cleaned up highlighting of artist names in album view.
* Cleaned up alignment of playlist items.
* Fixed potential crash when searching.
* Added support for disc number.
* 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 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.
* Reorganized sidebar to follow more logical item groupings.
* 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
information is available.
* Fixed stations not fetching new tracks under certain circumstances.
* Fixed Footnotes not always updating when selecting a new track.
* Added support for ow.ly, fb.me, itun.es and tinyurl.com URL shorteners.
* Fixed playback issues with non-latin filenames on Windows.
* Fixed tomahawk:// protocol not working properly on Windows.
* Fixed dupe menu entry appearing on OS X.
* Fixed invisible sidebar items on Linux.
Version 0.3.2:
* Improved syncing process, it's faster and more reliable now.
* Fixed UPnP issues.
* Fixed not updating collections and views after a collection changes.
* Fixed not showing a source's proper name at all times.
* Improved music scanner reliability.
* Fixed various labels not being painted in the right color when selected.
* Support .oga (ogg mimetype) files.
* Fixed stuck Now Playing indicator icon.
* Fixed sidebar width of settings dialog on Windows.
* Fixed not always showing delete icon on hovered temporary pages.
* Fixed inability to select externally mounted drives.
* Fixed bug where speaker would be stuck next to a playlist.
* Fixed bug where first startup would show a loading spinner in the
Dashboard's "Recent Additions" forever.
* Automatically upgrade resolvers when an update is found.
* Fixed last played track of a friend never expiring.
* Fixed parsing of rdio tracks.
* Changed steering mechanism in stations to be user-friendlier.
* Fixed loading biographies of artist names with special characters.
* Fixed behaviour of dropping Spotify playlists on the sidebar.
* Fixed hard to read source-name in the audio control area on OS X.
* Fixed crashes when playing Grooveshark tracks.
* Fixed bug where clicking the latch button would flicker and unlatch.
* Fixed Jabber accounts not connecting properly when proxy is in use.
Version 0.3.1:
* Fixed not resolving to local files.
* Fixed shutdown crash on Windows.
* Support more widget types in Javascript resolver configs.
* Fixed bug where red headphone would be visible on My Collection
when listened along to source went offline.
* Draw author name as well as avatar in recently played playlists.
* Fixed Tomahawk integration in Unity.
* Fixed incorrect item selected in source tree when deleting temporary
pages.
* Fixed currently played label disappearing after 10 minutes regardless
of length of track.
* Fixed crash on Sparkle upgrade on OS X.
Version 0.3.0:
* Make artist names in the album view clickable.
* Don't start playing if a tomahawk:// link was clicked while Tomahawk
@@ -28,7 +134,7 @@ Version 0.3.0:
* Added new job status view in the bottom of the source list that displays
current jobs such as resolving, parsing playlists, and loading from
database.
* Parse and convert a Spotify playlist url when dropped anywhere on the
* Parse and convert a Spotify playlist URL when dropped anywhere on the
sidebar.
* Convert resolvers to use asynchronous calls to avoid blocking Tomahawk's
UI, greatly increasing responsiveness of Tomahawk while resolving.

6
README
View File

@@ -39,13 +39,13 @@ Dependencies
The following dependencies are optional, but recommended:
Attica 0.2.0 - ftp://ftp.kde.org/pub/kde/stable/attica/
jreen (Git) - https://github.com/euroelessar/jreen
QTweetLib 0.3.0 - https://github.com/minimoog/QTweetLib
QuaZip 0.4.3 - http://quazip.sourceforge.net/
Jreen 1.0.3 - https://github.com/euroelessar/jreen
QTweetLib 0.5.0 - https://github.com/minimoog/QTweetLib
Third party libraries that we ship with our source:
MiniUPnP 1.6 - http://miniupnp.free.fr/
liblastfm 0.4.0 - http://github.com/jonocole/liblastfm/
QuaZip 0.4.3 - http://quazip.sourceforge.net/
Enjoy!

View File

@@ -491,7 +491,7 @@ def FindVLCPlugin(name):
FixBinary(binary)
for plugin in VLC_PLUGINS:
FixVLCPlugin(FindVLCPlugin(plugin), '.')
FixVLCPlugin(FindVLCPlugin(plugin), '../Frameworks/vlc/plugins')
for plugin in TOMAHAWK_PLUGINS:
FixPlugin(plugin, '../MacOS')
@@ -502,9 +502,9 @@ except:
print 'Failed to find spotify resolver'
try:
FixPlugin('CrashReporter', '../MacOS')
FixPlugin('tomahawk_crash_reporter', '../MacOS')
except:
print 'Failed to find CrashReporter'
print 'Failed to find tomahawk_crash_reporter'
for plugin in QT_PLUGINS:
FixPlugin(FindQtPlugin(plugin), os.path.dirname(plugin))

View File

@@ -4,8 +4,9 @@ Version=1.0
Name=Tomahawk
GenericName=Music Player
TryExec=tomahawk
Exec=tomahawk
Exec=tomahawk %u
Comment=Tomahawk - Social Music Player
Icon=tomahawk
Terminal=false
Categories=Qt;AudioVideo;Audio;Player;
MimeType=x-scheme-handler/tomahawk;

View File

@@ -3,9 +3,12 @@ SET(MINGW_PREFIX "i686-w64-mingw32")
# this one is important
SET(CMAKE_SYSTEM_NAME Windows)
# specify the cross compiler
SET(CMAKE_C_COMPILER ccache ${MINGW_PREFIX}-gcc)
SET(CMAKE_C_FLAGS "-fno-keep-inline-dllexport")
SET(CMAKE_CXX_COMPILER ccache ${MINGW_PREFIX}-g++)
SET(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
SET(CMAKE_RC_COMPILER /usr/bin/${MINGW_PREFIX}-windres)
# where is the target environment containing libraries
@@ -15,13 +18,6 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# libs with broken find modules
SET(TAGLIB_FOUND true)
SET(TAGLIB_LIBRARIES ${CMAKE_FIND_ROOT_PATH}/lib/libtag.dll.a)
SET(TAGLIB_INCLUDES ${CMAKE_FIND_ROOT_PATH}/include/taglib)
# configure qt variables
SET(QT_LIBRARY_DIR /usr/${MINGW_PREFIX}/bin)
SET(QT_PLUGINS_DIR ${CMAKE_FIND_ROOT_PATH}/lib/qt4/plugins/)
SET(QT_QTUITOOLS_LIBRARY_RELEASE ${CMAKE_FIND_ROOT_PATH}/lib/libQtUiTools.a)
SET(QT_QTUITOOLS_LIBRARY_DEBUG ${CMAKE_FIND_ROOT_PATH}/lib/libQtUiToolsd.a)
SET(QT_QTUITOOLS_LIBRARY ${QT_QTUITOOLS_LIBRARY_RELEASE})

View File

@@ -1,42 +1,52 @@
#!/bin/bash
echo "Remove old vlc dir..."
mkdir -p vlc/
cd vlc/
if [ "$1" = "-c" ] ; then
echo "Continuing last download.."
rm -rvf vlc/
else
echo "Update archive..."
fi
#rm -vf vlc-*.7z
#rm -rf vlc/
rm -rvf vlc/
echo "Download specified binary..."
#wget -c "http://downloads.sourceforge.net/project/vlc/1.1.9/win32/vlc-1.1.9-win32.7z?r=http%3A%2F%2Fwww.videolan.org%2Fvlc%2Fdownload-windows.html&ts=1306272584&use_mirror=leaseweb"
#wget -c "http://download.tomahawk-player.org/tomahawk-vlc-0.1.zip"
wget -c http://people.videolan.org/~jb/phonon/phonon-vlc-last.7z
echo "Download phonon archive..."
# wget -c "http://downloads.sourceforge.net/project/vlc/1.1.9/win32/vlc-1.1.9-win32.7z?r=http%3A%2F%2Fwww.videolan.org%2Fvlc%2Fdownload-windows.html&ts=1306272584&use_mirror=leaseweb"
# wget -c "http://download.tomahawk-player.org/tomahawk-vlc-0.1.zip"
# wget -c http://people.videolan.org/~jb/phonon/phonon-vlc-last.7z
# wget -c http://people.videolan.org/~jb/phonon/phonon_phonon-vlc_20111128.7z
wget -c http://download.tomahawk-player.org/test/pvlc.tar.bz2
echo "Extract binary..."
7z x phonon-vlc-last.7z
#mv -v vlc-*/ vlc/
#unzip tomahawk-vlc-0.1.zip
# 7z x phonon*.7z
# mv -v vlc-*/ vlc/
# unzip tomahawk-vlc-0.1.zip
tar xvjf pvlc.tar.bz2
echo "Strip unneeded plugins from vlc/plugins..."
cd prefix/bin/plugins
rm -rvf libold* libvcd* libdvd* liblibass* libx264* libschroe* liblibmpeg2* \
libstream_out_* libmjpeg_plugin* libh264_plugin* libzvbi_plugin* lib*sub* \
*qt4* *skins2* libaccess_bd_plugin.dll \
libaudiobargraph_* libball_plugin.dll \
libdirac_plugin.dll \
libgnutls_plugin.dll \
libcaca_plugin.dll \
libfreetype_plugin.dll \
libaccess_output_shout_plugin.dll \
libremoteosd_plugin.dll \
libsdl_image_plugin.dll \
libvout_sdl_plugin.dll \
libpng_plugin.dll \
libgoom_plugin.dll \
libatmo_plugin.dll \
libmux_ts_plugin.dll \
libkate_plugin.dll \
libtaglib_plugin.dll
# echo "Download phonon_vlc_no_video.dll..."
# wget -c http://people.videolan.org/~jb/phonon/phonon_vlc_no_video.dll
# cp -v phonon_vlc_no_video.dll prefix/bin/phonon_backend/phonon_vlc.dll
# echo "Strip unneeded plugins from vlc/plugins..."
# cd prefix/bin/plugins
# rm -rvf libold* libvcd* libdvd* liblibass* libx264* libschroe* liblibmpeg2* \
# libstream_out_* libmjpeg_plugin* libh264_plugin* libzvbi_plugin* lib*sub* \
# *qt4* *skins2* libaccess_bd_plugin.dll \
# libaudiobargraph_* libball_plugin.dll \
# libdirac_plugin.dll \
# libgnutls_plugin.dll \
# libcaca_plugin.dll \
# libfreetype_plugin.dll \
# libaccess_output_shout_plugin.dll \
# libremoteosd_plugin.dll \
# libsdl_image_plugin.dll \
# libvout_sdl_plugin.dll \
# libpng_plugin.dll \
# libgoom_plugin.dll \
# libatmo_plugin.dll \
# libmux_ts_plugin.dll \
# libkate_plugin.dll \
# libtaglib_plugin.dll
# this is for vlc-1.2

BIN
data/images/apply-check.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
data/images/grooveshark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@@ -2,7 +2,7 @@
// if run in phantomjs add fake Tomahawk environment
if(window.Tomahawk === undefined)
{
alert("PHANTOMJS ENVIRONMENT");
// alert("PHANTOMJS ENVIRONMENT");
var Tomahawk = {
fakeEnv: function()
{

View File

@@ -1,4 +1,4 @@
-- Script to migate from db version 6 to 27
-- Script to migate from db version 26 to 27
-- Nothing to do
CREATE TABLE IF NOT EXISTS collection_attributes (

View File

@@ -0,0 +1,7 @@
-- Script to migate from db version 27 to 28.
-- Added albumartist and discnumber to file_join
ALTER TABLE file_join ADD COLUMN composer INTEGER REFERENCES artist(id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE file_join ADD COLUMN discnumber INTEGER;
UPDATE settings SET v = '28' WHERE k == 'schema_version';

3541
lang/tomahawk_bg.ts Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3541
lang/tomahawk_en.ts Normal file

File diff suppressed because it is too large Load Diff

3532
lang/tomahawk_es.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,11 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/lang">
<file>tomahawk_en.qm</file>
<file>tomahawk_de.qm</file>
<file>tomahawk_sv.qm</file>
<file>tomahawk_es.qm</file>
<file>tomahawk_bg.qm</file>
<file>tomahawk_pl.qm</file>
<file>tomahawk_pt_BR.qm</file>
</qresource>
</RCC>

3530
lang/tomahawk_pl.ts Normal file

File diff suppressed because it is too large Load Diff

3530
lang/tomahawk_pt_BR.ts Normal file

File diff suppressed because it is too large Load Diff

3515
lang/tomahawk_sv.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -98,6 +98,7 @@
<file>data/images/track-icon-22x22.png</file>
<file>data/images/track-icon-32x32.png</file>
<file>data/images/track-icon-16x16.png</file>
<file>data/images/apply-check.png</file>
<file>data/stylesheets/topbar-radiobuttons.css</file>
<file>data/icons/tomahawk-icon-16x16.png</file>
<file>data/icons/tomahawk-icon-32x32.png</file>
@@ -127,8 +128,13 @@
<file>data/images/headphones.png</file>
<file>data/images/headphones-off.png</file>
<file>data/images/headphones-sidebar.png</file>
<file>data/images/closed-padlock.png</file>
<file>data/images/open-padlock.png</file>
<file>data/images/headphones-bigger.png</file>
<file>data/images/no-album-no-case.png</file>
<file>data/images/rdio.png</file>
<file>data/images/grooveshark.png</file>
<file>data/sql/dbmigrate-27_to_28.sql</file>
<file>data/images/process-stop.png</file>
</qresource>
</RCC>

View File

@@ -2,9 +2,9 @@ FILE( GLOB _icons "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-*.png" )
FOREACH( _file ${_icons} )
STRING( REPLACE "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-" "" _res ${_file} )
STRING( REPLACE ".png" "" _res ${_res} )
INSTALL( FILES ${_file} RENAME tomahawk.png DESTINATION share/icons/hicolor/${_res}/apps )
INSTALL( FILES ${_file} RENAME tomahawk.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${_res}/apps )
ENDFOREACH( _file )
INSTALL( FILES ${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon.svg RENAME tomahawk.svg DESTINATION share/icons/hicolor/scalable/apps )
INSTALL( FILES ${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon.svg RENAME tomahawk.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps )
INSTALL( FILES ${CMAKE_SOURCE_DIR}/admin/unix/tomahawk.desktop DESTINATION share/applications )
INSTALL( FILES ${CMAKE_SOURCE_DIR}/admin/unix/tomahawk.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications )

View File

@@ -58,4 +58,7 @@ if (APPLE)
FILE(COPY ${CMAKE_SOURCE_DIR}/admin/mac/sparkle_pub.pem
DESTINATION "${CMAKE_BINARY_DIR}/tomahawk.app/Contents/Resources")
FILE(COPY /usr/bin/SetFile DESTINATION "${CMAKE_BINARY_DIR}/tomahawk.app/Contents/MacOS")
FILE(COPY /usr/bin/GetFileInfo DESTINATION "${CMAKE_BINARY_DIR}/tomahawk.app/Contents/MacOS")
endif (APPLE)

View File

@@ -13,6 +13,8 @@ SET( QT_USE_QTNETWORK TRUE )
SET( QT_USE_QTXML TRUE )
SET( QT_USE_QTWEBKIT TRUE )
add_definitions( -DQT_SHAREDPOINTER_TRACK_POINTERS )
INCLUDE( ${QT_USE_FILE} )
INCLUDE( AddAppIconMacro )
@@ -40,6 +42,7 @@ SET( tomahawkSources ${tomahawkSources}
musicscanner.cpp
shortcuthandler.cpp
scanmanager.cpp
ubuntuunityhack.cpp
tomahawkapp.cpp
main.cpp
)
@@ -57,11 +60,13 @@ SET( tomahawkSourcesGui ${tomahawkSourcesGui}
sourcetree/sourcedelegate.cpp
sourcetree/animationhelper.cpp
sourcetree/items/sourcetreeitem.cpp
sourcetree/items/collectionitem.cpp
sourcetree/items/sourceitem.cpp
sourcetree/items/playlistitems.cpp
sourcetree/items/categoryitems.cpp
sourcetree/items/genericpageitems.cpp
sourcetree/items/temporarypageitem.cpp
sourcetree/items/groupitem.cpp
sourcetree/items/historyitem.cpp
breakpad/BreakPad.cpp
@@ -85,6 +90,7 @@ SET( tomahawkHeaders ${tomahawkHeaders}
musicscanner.h
scanmanager.h
ubuntuunityhack.h
shortcuthandler.h
)
@@ -95,8 +101,8 @@ IF(LIBLASTFM_FOUND)
ENDIF(LIBLASTFM_FOUND)
IF(LIBATTICA_FOUND)
SET( tomahawkSources ${tomahawkSources} GetNewStuffDialog.cpp GetNewStuffDelegate.cpp GetNewStuffModel.cpp )
SET( tomahawkHeaders ${tomahawkHeaders} GetNewStuffDialog.h GetNewStuffDelegate.h GetNewStuffModel.h )
SET( tomahawkSourcesGui ${tomahawkSourcesGui} GetNewStuffDialog.cpp GetNewStuffDelegate.cpp GetNewStuffModel.cpp )
SET( tomahawkHeadersGui ${tomahawkHeadersGui} GetNewStuffDialog.h GetNewStuffDelegate.h GetNewStuffModel.h )
INCLUDE_DIRECTORIES( ${LIBATTICA_INCLUDE_DIR} )
ENDIF(LIBATTICA_FOUND)
@@ -108,11 +114,13 @@ SET( tomahawkHeadersGui ${tomahawkHeadersGui}
sourcetree/sourcedelegate.h
sourcetree/animationhelper.h
sourcetree/items/sourcetreeitem.h
sourcetree/items/collectionitem.h
sourcetree/items/sourceitem.h
sourcetree/items/playlistitems.h
sourcetree/items/categoryitems.h
sourcetree/items/genericpageitems.h
sourcetree/items/temporarypageitem.h
sourcetree/items/groupitem.h
sourcetree/items/historyitem.h
tomahawktrayicon.h
audiocontrols.h
@@ -170,10 +178,10 @@ INCLUDE_DIRECTORIES(
SET( OS_SPECIFIC_LINK_LIBRARIES "" )
IF( WIN32 )
INCLUDE( "CMakeLists.win32.txt" )
INCLUDE( "CMakeLists.win32.cmake" )
ENDIF( WIN32 )
IF( UNIX )
INCLUDE( "CMakeLists.unix.txt" )
INCLUDE( "CMakeLists.unix.cmake" )
ENDIF( UNIX )
IF( APPLE )
@@ -198,10 +206,7 @@ IF(QCA2_FOUND)
INCLUDE_DIRECTORIES( ${QCA2_INCLUDE_DIR} )
ENDIF(QCA2_FOUND)
kde4_add_app_icon( tomahawkSources "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-*.png" )
qt4_add_resources( RC_SRCS "../resources.qrc" )
qt4_wrap_cpp( tomahawkMoc ${tomahawkHeaders} )
INCLUDE(GNUInstallDirs)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
@@ -209,13 +214,17 @@ include( ${CMAKE_SOURCE_DIR}/lang/translations.cmake )
SET( final_src ${final_src} ${tomahawkMoc} ${tomahawkSources} ${tomahawkHeaders} ${trans_outfile})
IF( "${gui}" STREQUAL "no" )
ELSE()
IF( BUILD_GUI )
LIST(APPEND tomahawkHeaders ${tomahawkHeadersGui})
LIST(APPEND tomahawkSources ${tomahawkSourcesGui})
qt4_wrap_ui( tomahawkUI_H ${tomahawkUI} )
qt4_wrap_cpp( tomahawkMocGui ${tomahawkHeadersGui} )
SET( final_src ${final_src} ${tomahawkUI_H} ${tomahawkMocGui} ${tomahawkSourcesGui} ${RC_SRCS} )
ENDIF()
kde4_add_app_icon( tomahawkSources "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-*.png" )
qt4_add_resources( RC_SRCS "../resources.qrc" )
qt4_wrap_cpp( tomahawkMoc ${tomahawkHeaders} )
SET( final_src ${final_src} ${tomahawkUI_H} ${tomahawkMoc} ${tomahawkSources} ${RC_SRCS} )
IF( UNIX AND NOT APPLE )
ADD_EXECUTABLE( tomahawk ${final_src} )
ENDIF( UNIX AND NOT APPLE )
@@ -263,12 +272,12 @@ IF( APPLE )
ENDIF(HAVE_SPARKLE)
ENDIF( APPLE )
INSTALL( TARGETS tomahawk BUNDLE DESTINATION . RUNTIME DESTINATION bin )
INSTALL( TARGETS tomahawk BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
IF( UNIX AND NOT APPLE AND KDE4_INSTALLED ) #install protocol file
IF( UNIX AND NOT APPLE AND KDE4_INSTALLED AND LEGACY_KDE_INTEGRATION ) #install protocol file
FILE( READ ${CMAKE_SOURCE_DIR}/admin/unix/tomahawk.protocol protocol )
STRING( REPLACE "/path/to/binary" # match this
"${CMAKE_INSTALL_PREFIX}/bin/tomahawk" # this is linux (kde) so pretty safe I think
"${CMAKE_INSTALL_FULL_BINDIR}/tomahawk" # this is linux (kde) so pretty safe I think
edited_protocol # save in this variable
"${protocol}" # from the contents of this var
)
@@ -276,7 +285,7 @@ IF( UNIX AND NOT APPLE AND KDE4_INSTALLED ) #install protocol file
IF( ${SERVICES_INSTALL_DIR} )
SET( PROTOCOL_INSTALL_DIR ${SERVICES_INSTALL_DIR} )
ELSE()
SET( PROTOCOL_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/kde4/services" )
SET( PROTOCOL_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/kde4/services" )
ENDIF()
INSTALL( FILES ${CMAKE_BINARY_DIR}/tomahawk.protocol DESTINATION ${PROTOCOL_INSTALL_DIR} )
ENDIF()

View File

@@ -7,9 +7,9 @@ ADD_DEFINITIONS( -fPIC )
SET( QXTWEB_LIBRARIES qxtweb-standalone )
IF( APPLE )
INCLUDE( "CMakeLists.osx.txt" )
INCLUDE( "CMakeLists.osx.cmake" )
ENDIF( APPLE )
IF( UNIX AND NOT APPLE )
INCLUDE( "CMakeLists.linux.txt" )
INCLUDE( "CMakeLists.linux.cmake" )
ENDIF( UNIX AND NOT APPLE )

View File

@@ -22,7 +22,7 @@
#include "GetNewStuffDelegate.h"
#include "GetNewStuffModel.h"
GetNewStuffDialog::GetNewStuffDialog( QWidget *parent, Qt::WindowFlags f )
GetNewStuffDialog::GetNewStuffDialog( QWidget* parent, Qt::WindowFlags f )
: QDialog( parent, f )
, ui( new Ui::GetNewStuffDialog )
, m_model( new GetNewStuffModel( this ) )
@@ -37,16 +37,17 @@ GetNewStuffDialog::GetNewStuffDialog( QWidget *parent, Qt::WindowFlags f )
ui->listView->setMouseTracking( true );
setMinimumSize( 560, 350 );
#ifdef Q_WS_MAC
setMinimumSize( 510, 350 );
setMaximumSize( 510, 350 );
setMaximumSize( 560, 350 );
setSizeGripEnabled( false );
ui->listView->setAttribute( Qt::WA_MacShowFocusRect, false );
#endif
}
GetNewStuffDialog::~GetNewStuffDialog()
{
delete ui;

View File

@@ -34,9 +34,6 @@ LoadXSPFDialog::LoadXSPFDialog( QWidget* parent, Qt::WindowFlags f )
m_ui->verticalLayout->setSpacing( 0 );
#endif
connect( m_ui->buttonBox, SIGNAL( accepted() ), SLOT( accept() ) );
connect( m_ui->buttonBox, SIGNAL( rejected() ), SLOT( reject() ) );
connect( m_ui->navigateButton, SIGNAL( clicked( bool ) ), this, SLOT( getLocalFile() ) );
}
@@ -47,7 +44,7 @@ LoadXSPFDialog::~LoadXSPFDialog()
void
LoadXSPFDialog::getLocalFile()
{
QString url = QFileDialog::getOpenFileName( this, tr( "Load XSPF File" ), QDir::homePath(), ".xspf" );
QString url = QFileDialog::getOpenFileName( this, tr( "Load XSPF File" ), QDir::homePath(), tr( "XSPF Files (*.xspf)" ) );
m_ui->lineEdit->setText( url );
}

View File

@@ -19,14 +19,13 @@
#include "audiocontrols.h"
#include "ui_audiocontrols.h"
#include <QNetworkReply>
#include <QDropEvent>
#include <QMouseEvent>
#include <QtNetwork/QNetworkReply>
#include <QtGui/QDropEvent>
#include <QtGui/QMouseEvent>
#include "audio/audioengine.h"
#include "playlist/playlistview.h"
#include "database/database.h"
#include "database/databasecommand_socialaction.h"
#include "widgets/imagebutton.h"
#include "utils/tomahawkutils.h"
#include "utils/logger.h"
@@ -37,14 +36,13 @@
using namespace Tomahawk;
static QString s_acInfoIdentifier = QString( "AUDIOCONTROLS" );
AudioControls::AudioControls( QWidget* parent )
: QWidget( parent )
, ui( new Ui::AudioControls )
, m_repeatMode( PlaylistInterface::NoRepeat )
, m_shuffled( false )
, m_lastSliderCheck( 0 )
{
ui->setupUi( this );
setAcceptDrops( true );
@@ -86,16 +84,21 @@ AudioControls::AudioControls( QWidget* parent )
ui->loveButton->setPixmap( RESPATH "images/not-loved.png" );
ui->loveButton->setCheckable( true );
#ifdef Q_WS_MAC
ui->ownerLabel->setForegroundRole( QPalette::Text );
#else
ui->ownerLabel->setForegroundRole( QPalette::Dark );
#endif
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_sliderTimeLine.setCurveShape( QTimeLine::LinearCurve );
ui->seekSlider->setTimeLine( &m_sliderTimeLine );
m_phononTickCheckTimer.setSingleShot( true );
connect( &m_phononTickCheckTimer, SIGNAL( timeout() ), SLOT( phononTickCheckTimeout() ) );
connect( &m_sliderTimeLine, SIGNAL( frameChanged( int ) ), ui->seekSlider, SLOT( setValue( int ) ) );
connect( ui->seekSlider, SIGNAL( valueChanged( int ) ), AudioEngine::instance(), SLOT( seek( int ) ) );
@@ -107,8 +110,8 @@ AudioControls::AudioControls( QWidget* parent )
connect( ui->volumeLowButton, SIGNAL( clicked() ), AudioEngine::instance(), SLOT( lowerVolume() ) );
connect( ui->volumeHighButton, SIGNAL( clicked() ), AudioEngine::instance(), SLOT( raiseVolume() ) );
connect( ui->playPauseButton, SIGNAL( clicked() ), this, SIGNAL( playPressed() ) );
connect( ui->pauseButton, SIGNAL( clicked() ), this, SIGNAL( pausePressed() ) );
connect( ui->playPauseButton, SIGNAL( clicked() ), SIGNAL( playPressed() ) );
connect( ui->pauseButton, SIGNAL( clicked() ), SIGNAL( pausePressed() ) );
connect( ui->repeatButton, SIGNAL( clicked() ), SLOT( onRepeatClicked() ) );
connect( ui->shuffleButton, SIGNAL( clicked() ), SLOT( onShuffleClicked() ) );
@@ -128,15 +131,6 @@ AudioControls::AudioControls( QWidget* parent )
connect( AudioEngine::instance(), SIGNAL( timerMilliSeconds( qint64 ) ), SLOT( onPlaybackTimer( qint64 ) ) );
connect( AudioEngine::instance(), SIGNAL( volumeChanged( int ) ), SLOT( onVolumeChanged( int ) ) );
m_defaultCover = QPixmap( RESPATH "images/no-album-no-case.png" )
.scaled( ui->coverImage->size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ), SLOT( infoSystemFinished( QString ) ) );
ui->buttonAreaLayout->setSpacing( 0 );
ui->stackedLayout->setSpacing( 0 );
ui->stackedLayout->setContentsMargins( 0, 0, 0, 0 );
@@ -171,6 +165,13 @@ AudioControls::changeEvent( QEvent* e )
}
void
AudioControls::phononTickCheckTimeout()
{
onPlaybackTimer( m_lastSliderCheck );
}
void
AudioControls::onVolumeChanged( int volume )
{
@@ -183,8 +184,6 @@ AudioControls::onVolumeChanged( int volume )
void
AudioControls::onPlaybackStarted( const Tomahawk::result_ptr& result )
{
tDebug( LOGEXTRA ) << Q_FUNC_INFO;
if ( result.isNull() )
return;
@@ -198,114 +197,115 @@ 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 );
Tomahawk::InfoSystem::InfoStringHash trackInfo;
trackInfo["artist"] = result->artist()->name();
trackInfo["album"] = result->album()->name();
int updateRate = (double)1000 / ( (double)ui->seekSlider->contentsRect().width() / (double)( duration / 1000 ) );
m_sliderTimeLine.setUpdateInterval( qBound( 40, updateRate, 500 ) );
Tomahawk::InfoSystem::InfoRequestData requestData;
requestData.caller = s_acInfoIdentifier;
requestData.type = Tomahawk::InfoSystem::InfoAlbumCoverArt;
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo );
requestData.customData = QVariantMap();
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
}
void
AudioControls::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
{
if ( requestData.caller != s_acInfoIdentifier || requestData.type != Tomahawk::InfoSystem::InfoAlbumCoverArt )
{
return;
}
if ( m_currentTrack.isNull() )
{
tLog() << "Current track is null when trying to apply fetched cover art";
return;
}
if ( !output.canConvert< QVariantMap >() )
{
tDebug( LOGINFO ) << "Cannot convert fetched art from a QByteArray";
return;
}
QVariantMap returnedData = output.value< QVariantMap >();
const QByteArray ba = returnedData["imgbytes"].toByteArray();
if ( ba.length() )
{
QPixmap pm;
pm.loadFromData( ba );
if ( pm.isNull() )
ui->coverImage->setPixmap( m_defaultCover );
else
ui->coverImage->setPixmap( pm.scaled( ui->coverImage->size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) );
}
}
void
AudioControls::infoSystemFinished( QString target )
{
Q_UNUSED( target );
m_noTimeChange = false;
m_lastSliderCheck = 0;
}
void
AudioControls::onPlaybackLoading( const Tomahawk::result_ptr& result )
{
tDebug( LOGEXTRA ) << Q_FUNC_INFO;
if ( !m_currentTrack.isNull() )
{
disconnect( m_currentTrack->album().data(), SIGNAL( updated() ), this, SLOT( onAlbumCoverUpdated() ) );
disconnect( m_currentTrack->toQuery().data(), SIGNAL( socialActionsLoaded() ), this, SLOT( onSocialActionsLoaded() ) );
}
m_currentTrack = result;
connect( m_currentTrack->album().data(), SIGNAL( updated() ), SLOT( onAlbumCoverUpdated() ) );
connect( m_currentTrack->toQuery().data(), SIGNAL( socialActionsLoaded() ), SLOT( onSocialActionsLoaded() ) );
ui->artistTrackLabel->setResult( result );
ui->albumLabel->setResult( result );
ui->ownerLabel->setText( result->friendlySource() );
ui->coverImage->setPixmap( m_defaultCover );
const QString duration = TomahawkUtils::timeToString( result.data()->duration() );
ui->timeLabel->setFixedWidth( ui->timeLabel->fontMetrics().width( QString( duration.length(), QChar( '0' ) ) ) );
ui->timeLabel->setText( TomahawkUtils::timeToString( 0 ) );
ui->timeLeftLabel->setText( "-" + TomahawkUtils::timeToString( result.data()->duration() ) );
ui->timeLeftLabel->setFixedWidth( ui->timeLeftLabel->fontMetrics().width( QString( duration.length() + 1, QChar( '0' ) ) ) );
ui->timeLeftLabel->setText( "-" + duration );
m_lastTextSecondShown = 0;
ui->stackedLayout->setCurrentWidget( ui->pauseButton );
ui->loveButton->setEnabled( true );
ui->loveButton->setVisible( true );
result->loadSocialActions();
connect( result.data(), SIGNAL( socialActionsLoaded() ), this, SLOT( socialActionsLoaded() ) );
setAlbumCover();
setSocialActions();
}
void
AudioControls::socialActionsLoaded()
{
Result* r = qobject_cast< Result* >( sender() );
Q_ASSERT( r );
if ( m_currentTrack.data() == r )
void
AudioControls::onAlbumCoverUpdated()
{
Album* album = qobject_cast< Album* >( sender() );
if ( !album || album != m_currentTrack->album().data() )
return;
setAlbumCover();
}
void
AudioControls::setAlbumCover()
{
if ( !m_currentTrack->album()->cover( ui->coverImage->size() ).isNull() )
{
if ( m_currentTrack->loved() )
{
ui->loveButton->setPixmap( RESPATH "images/loved.png" );
ui->loveButton->setChecked( true );
}
else
{
ui->loveButton->setPixmap( RESPATH "images/not-loved.png" );
ui->loveButton->setChecked( false );
}
QPixmap cover;
cover = m_currentTrack->album()->cover( ui->coverImage->size() );
ui->coverImage->setPixmap( cover );
}
else
ui->coverImage->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultAlbumCover, TomahawkUtils::ScaledCover, ui->coverImage->size() ) );
}
void
AudioControls::onSocialActionsLoaded()
{
Query* query = qobject_cast< Query* >( sender() );
if ( !query || !m_currentTrack || query != m_currentTrack->toQuery().data() )
return;
query_ptr currentQuery = m_currentTrack->toQuery();
if ( query->artist() == currentQuery->artist() &&
query->track() == currentQuery->track() &&
query->album() == currentQuery->album() )
{
setSocialActions();
}
}
void
AudioControls::setSocialActions()
{
if ( m_currentTrack->toQuery()->loved() )
{
ui->loveButton->setPixmap( RESPATH "images/loved.png" );
ui->loveButton->setChecked( true );
}
else
{
ui->loveButton->setPixmap( RESPATH "images/not-loved.png" );
ui->loveButton->setChecked( false );
}
}
@@ -318,6 +318,7 @@ AudioControls::onPlaybackPaused()
m_sliderTimeLine.setPaused( true );
}
void
AudioControls::onPlaybackResumed()
{
@@ -334,6 +335,7 @@ AudioControls::onPlaybackSeeked( qint64 msec )
tDebug( LOGEXTRA ) << Q_FUNC_INFO << " setting current timer to " << msec;
m_sliderTimeLine.setPaused( true );
m_sliderTimeLine.setCurrentTime( msec );
m_lastSliderCheck = msec;
m_seekMsecs = msec;
}
@@ -363,32 +365,61 @@ AudioControls::onPlaybackStopped()
void
AudioControls::onPlaybackTimer( qint64 msElapsed )
{
//tDebug( LOGEXTRA ) << Q_FUNC_INFO << " msElapsed = " << msElapsed << " and timer current time = " << m_sliderTimeLine.currentTime() << " and m_seekMsecs = " << m_seekMsecs;
if ( m_currentTrack.isNull() )
const int seconds = msElapsed / 1000;
if ( seconds != m_lastTextSecondShown && !m_currentTrack.isNull() )
{
ui->timeLabel->setText( TomahawkUtils::timeToString( seconds ) );
ui->timeLeftLabel->setText( "-" + TomahawkUtils::timeToString( m_currentTrack->duration() - seconds ) );
m_lastTextSecondShown = seconds;
}
//tDebug( LOGEXTRA ) << Q_FUNC_INFO << "msElapsed =" << msElapsed << "and timer current time =" << m_sliderTimeLine.currentTime() << "and m_seekMsecs =" << m_seekMsecs;
if ( msElapsed > 0 && msElapsed != m_lastSliderCheck && m_seekMsecs == -1 && msElapsed - 500 < m_lastSliderCheck )
return;
m_lastSliderCheck = msElapsed;
if ( m_currentTrack.isNull() )
{
m_sliderTimeLine.stop();
return;
}
ui->seekSlider->blockSignals( true );
const int seconds = msElapsed / 1000;
ui->timeLabel->setText( TomahawkUtils::timeToString( seconds ) );
ui->timeLeftLabel->setText( "-" + TomahawkUtils::timeToString( m_currentTrack->duration() - seconds ) );
if ( m_sliderTimeLine.currentTime() > msElapsed || m_seekMsecs != -1 )
if ( sender() != &m_phononTickCheckTimer )
m_phononTickCheckTimer.start( 1000 );
int currentTime = m_sliderTimeLine.currentTime();
if ( m_noTimeChange )
{
if ( currentTime != msElapsed )
{
m_sliderTimeLine.setPaused( true );
m_noTimeChange = false;
m_sliderTimeLine.setCurrentTime( msElapsed );
m_seekMsecs = -1;
m_sliderTimeLine.resume();
}
}
else if ( currentTime >= msElapsed || m_seekMsecs != -1 )
{
m_sliderTimeLine.setPaused( true );
m_noTimeChange = false;
if ( currentTime == msElapsed )
m_noTimeChange = true;
m_sliderTimeLine.setCurrentTime( msElapsed );
m_seekMsecs = -1;
if ( AudioEngine::instance()->state() != AudioEngine::Paused )
if ( AudioEngine::instance()->state() != AudioEngine::Paused && sender() != &m_phononTickCheckTimer )
m_sliderTimeLine.resume();
}
else if ( m_sliderTimeLine.duration() > msElapsed && m_sliderTimeLine.state() == QTimeLine::NotRunning )
else if ( m_sliderTimeLine.duration() > msElapsed && m_sliderTimeLine.state() == QTimeLine::NotRunning && AudioEngine::instance()->state() == AudioEngine::Playing )
{
ui->seekSlider->setEnabled( AudioEngine::instance()->canSeek() );
m_sliderTimeLine.resume();
m_sliderTimeLine.start();
}
else if ( m_sliderTimeLine.state() == QTimeLine::Paused && AudioEngine::instance()->state() != AudioEngine::Paused )
{
ui->seekSlider->setEnabled( AudioEngine::instance()->canSeek() );
m_sliderTimeLine.resume();
}
@@ -567,30 +598,17 @@ AudioControls::droppedTracks( QList< query_ptr > tracks )
void
AudioControls::onLoveButtonClicked( bool checked )
{
Tomahawk::InfoSystem::InfoStringHash trackInfo;
trackInfo["title"] = m_currentTrack->track();
trackInfo["artist"] = m_currentTrack->artist()->name();
trackInfo["album"] = m_currentTrack->album()->name();
if ( checked )
{
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo(
s_acInfoIdentifier, Tomahawk::InfoSystem::InfoLove,
QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ) );
DatabaseCommand_SocialAction* cmd = new DatabaseCommand_SocialAction( m_currentTrack, QString( "Love" ), QString( "true") );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
ui->loveButton->setPixmap( RESPATH "images/loved.png" );
m_currentTrack->toQuery()->setLoved( true );
}
else
{
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo(
s_acInfoIdentifier, Tomahawk::InfoSystem::InfoUnLove,
QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ) );
DatabaseCommand_SocialAction* cmd = new DatabaseCommand_SocialAction( m_currentTrack, QString( "Love" ), QString( "false" ) );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
ui->loveButton->setPixmap( RESPATH "images/not-loved.png" );
m_currentTrack->toQuery()->setLoved( false );
}
}

View File

@@ -19,12 +19,12 @@
#ifndef AUDIOCONTROLS_H
#define AUDIOCONTROLS_H
#include <QWidget>
#include <QTimeLine>
#include <QtGui/QWidget>
#include <QtCore/QTimer>
#include <QtCore/QTimeLine>
#include "result.h"
#include "playlistinterface.h"
#include "infosystem/infosystem.h"
#include "query.h"
class QDropEvent;
@@ -51,7 +51,7 @@ signals:
public slots:
void onRepeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void onShuffleModeChanged( bool enabled );
protected:
void changeEvent( QEvent* e );
void dragEnterEvent ( QDragEnterEvent* );
@@ -59,6 +59,8 @@ protected:
void dropEvent ( QDropEvent* );
private slots:
void phononTickCheckTimeout();
void onPlaybackStarted( const Tomahawk::result_ptr& result );
void onPlaybackLoading( const Tomahawk::result_ptr& result );
void onPlaybackPaused();
@@ -77,24 +79,28 @@ private slots:
void onTrackClicked();
void onLoveButtonClicked( bool );
void infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
void infoSystemFinished( QString target );
void onAlbumCoverUpdated();
void droppedTracks( QList<Tomahawk::query_ptr> );
void socialActionsLoaded();
void onSocialActionsLoaded();
private:
Ui::AudioControls *ui;
void setAlbumCover();
void setSocialActions();
QPixmap m_defaultCover;
Ui::AudioControls *ui;
Tomahawk::result_ptr m_currentTrack;
Tomahawk::PlaylistInterface::RepeatMode m_repeatMode;
bool m_shuffled;
QTimer m_phononTickCheckTimer;
QTimeLine m_sliderTimeLine;
qint64 m_seekMsecs;
qint64 m_lastSliderCheck;
bool m_noTimeChange;
qint64 m_lastTextSecondShown;
};
#endif // AUDIOCONTROLS_H

View File

@@ -28,9 +28,6 @@
<height>80</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="topMargin">
<number>0</number>
@@ -164,9 +161,6 @@
<height>58</height>
</size>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
@@ -351,6 +345,9 @@
<property name="text">
<string>Time</string>
</property>
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
@@ -377,6 +374,9 @@
<property name="text">
<string>Time Left</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>

View File

@@ -18,11 +18,17 @@
#include "BreakPad.h"
#include "config.h"
#include "utils/logger.h"
#include <QCoreApplication>
#include <QString>
#include <QFileInfo>
#include <string.h>
#define CRASH_REPORTER_BINARY "CrashReporter"
#define CRASH_REPORTER_BINARY "tomahawk_crash_reporter"
bool s_active = true;
#ifndef WIN32
#include <unistd.h>
@@ -38,8 +44,10 @@ LaunchUploader( const char* dump_dir, const char* minidump_id, void* that, bool
return false;
const char* crashReporter = static_cast<BreakPad*>(that)->crashReporter();
pid_t pid = fork();
if ( !s_active || strlen( crashReporter ) == 0 )
return false;
pid_t pid = fork();
if ( pid == -1 ) // fork failed
return false;
if ( pid == 0 )
@@ -63,14 +71,25 @@ LaunchUploader( const char* dump_dir, const char* minidump_id, void* that, bool
}
BreakPad::BreakPad( const QString& path )
BreakPad::BreakPad( const QString& path, bool active )
#ifdef Q_OS_LINUX
: google_breakpad::ExceptionHandler( path.toStdString(), 0, LaunchUploader, this, true )
#else
: google_breakpad::ExceptionHandler( path.toStdString(), 0, LaunchUploader, this, true, 0 )
#endif
{
QString reporter = QString( "%1/%2" ).arg( qApp->applicationDirPath() ).arg( CRASH_REPORTER_BINARY );
s_active = active;
QString reporter;
QString localReporter = QString( "%1/%2" ).arg( qApp->applicationDirPath() ).arg( CRASH_REPORTER_BINARY );
QString globalReporter = QString( "%1/%2" ).arg( CMAKE_INSTALL_FULL_LIBEXECDIR ).arg( CRASH_REPORTER_BINARY );
if ( QFileInfo( localReporter ).exists() )
reporter = localReporter;
else if ( QFileInfo( globalReporter ).exists() )
reporter = globalReporter;
else
tLog() << "Could not find \"" CRASH_REPORTER_BINARY "\" in \"" CMAKE_INSTALL_FULL_LIBEXECDIR "\" or application path";
char* creporter;
std::string sreporter = reporter.toStdString();
@@ -126,7 +145,7 @@ LaunchUploader( const wchar_t* dump_dir, const wchar_t* minidump_id, void* that,
si.wShowWindow = SW_SHOWNORMAL;
ZeroMemory( &pi, sizeof(pi) );
if (CreateProcess( NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
if ( CreateProcess( NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) )
{
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
@@ -137,9 +156,24 @@ LaunchUploader( const wchar_t* dump_dir, const wchar_t* minidump_id, void* that,
}
BreakPad::BreakPad( const QString& path )
BreakPad::BreakPad( const QString& path, bool active )
: google_breakpad::ExceptionHandler( path.toStdWString(), 0, LaunchUploader, this, true )
{
s_active = active;
}
#endif // WIN32
void
BreakPad::setActive( bool enabled )
{
s_active = enabled;
}
bool
BreakPad::isActive()
{
return s_active;
}

View File

@@ -32,11 +32,14 @@ class BreakPad : public google_breakpad::ExceptionHandler
const char* m_crashReporter; // again, const char[]
public:
BreakPad( const QString &dump_write_dirpath );
BreakPad( const QString& dump_write_dirpath, bool active );
~BreakPad()
{}
static void setActive( bool enabled );
static bool isActive();
void setProductName( const char* s ) { m_productName = s; };
const char* productName() const { return m_productName; }

View File

@@ -1,8 +1,10 @@
PROJECT( CrashReporter )
FIND_PACKAGE( Qt4 REQUIRED )
SET( QT_USE_QTNETWORK TRUE )
SET( crashreporter_SOURCES main.cpp CrashReporter.cpp )
SET( crashreporter_HEADERS CrashReporter.h )
SET( crashreporter_UI CrashReporter.ui )
@@ -16,5 +18,7 @@ INCLUDE( ${QT_USE_FILE} )
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src ../../libtomahawk )
ADD_DEFINITIONS( ${QT_DEFINITIONS} )
ADD_EXECUTABLE( CrashReporter WIN32 ${crashreporter_SOURCES} ${crashreporter_HEADERS_MOC} ${crashreporter_UI_HEADERS} ${crashreporter_RC_RCC} )
TARGET_LINK_LIBRARIES( CrashReporter ${QT_LIBRARIES} tomahawklib )
ADD_EXECUTABLE( tomahawk_crash_reporter WIN32 ${crashreporter_SOURCES} ${crashreporter_HEADERS_MOC} ${crashreporter_UI_HEADERS} ${crashreporter_RC_RCC} )
TARGET_LINK_LIBRARIES( tomahawk_crash_reporter ${QT_LIBRARIES} tomahawklib )
install(TARGETS tomahawk_crash_reporter RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})

View File

@@ -9,6 +9,7 @@
#cmakedefine DEBUG_BUILD
#define CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}"
#define CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}"
#define CMAKE_SYSTEM "${CMAKE_SYSTEM}"
#cmakedefine LION

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.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
@@ -52,7 +52,8 @@ public:
setMinimumSize( sizeHint() );
setMaximumSize( sizeHint() ); // to remove the resize grip on osx this is the only way
connect( conf, SIGNAL( sizeHintChanged() ), this, SLOT( updateSizeHint() ) );
if( conf->metaObject()->indexOfSignal( "sizeHintChanged()" ) > -1 )
connect( conf, SIGNAL( sizeHintChanged() ), this, SLOT( updateSizeHint() ) );
#else
m_widget->setVisible( true );
#endif

View File

@@ -22,7 +22,7 @@
#ifdef ENABLE_HEADLESS
#define TOMAHAWK_APPLICATION QCoreApplication
#include <QApplication>
#include <QCoreApplication>
#else

View File

@@ -19,7 +19,7 @@
#include "AtticaManager.h"
#include "utils/tomahawkutils.h"
#include "tomahawksettings.h"
#include "TomahawkSettingsGui.h"
#include "pipeline.h"
#include <attica/downloaditem.h>
@@ -44,7 +44,9 @@ AtticaManager::AtticaManager( QObject* parent )
connect( &m_manager, SIGNAL( providerAdded( Attica::Provider ) ), this, SLOT( providerAdded( Attica::Provider ) ) );
// resolvers
m_manager.addProviderFile( QUrl( "http://bakery.tomahawk-player.org:10480/resolvers/providers.xml" ) );
m_manager.addProviderFile( QUrl( "http://bakery.tomahawk-player.org/resolvers/providers.xml" ) );
qRegisterMetaType< Attica::Content >( "Attica::Content" );
}
@@ -74,7 +76,10 @@ AtticaManager::loadPixmapsFromCache()
}
QPixmap* icon = new QPixmap( cacheDir.absoluteFilePath( file ) );
m_resolverStates[ info.baseName() ].pixmap = icon;
if ( !icon->isNull() )
{
m_resolverStates[ info.baseName() ].pixmap = icon;
}
}
}
@@ -91,14 +96,21 @@ AtticaManager::savePixmapsToCache()
foreach( const QString& id, m_resolverStates.keys() )
{
if ( !m_resolverStates[ id ].pixmap )
if ( !m_resolverStates[ id ].pixmap || !m_resolverStates[ id ].pixmapDirty )
continue;
const QString filename = cacheDir.absoluteFilePath( QString( "%1.png" ).arg( id ) );
if ( !m_resolverStates[ id ].pixmap->save( filename ) )
QFile f( filename );
if ( !f.open( QIODevice::WriteOnly ) )
{
tLog() << "Failed to open cache file for writing:" << filename;
continue;
}
else
{
if ( !m_resolverStates[ id ].pixmap->save( &f ) )
{
tLog() << "Failed to save pixmap into opened file for writing:" << filename;
}
}
}
}
@@ -149,6 +161,7 @@ AtticaManager::pathFromId( const QString& resolverId ) const
return m_resolverStates.value( resolverId ).scriptPath;
}
void
AtticaManager::uploadRating( const Content& c )
{
@@ -165,7 +178,7 @@ AtticaManager::uploadRating( const Content& c )
}
}
TomahawkSettings::instance()->setAtticaResolverStates( m_resolverStates );
TomahawkSettingsGui::instanceGui()->setAtticaResolverStates( m_resolverStates );
PostJob* job = m_resolverProvider.voteForContent( c.id(), (uint)c.rating() );
connect( job, SIGNAL( finished( Attica::BaseJob* ) ), job, SLOT( deleteLater() ) );
@@ -175,6 +188,7 @@ AtticaManager::uploadRating( const Content& c )
emit resolverStateChanged( c.id() );
}
bool
AtticaManager::userHasRated( const Content& c ) const
{
@@ -202,7 +216,7 @@ AtticaManager::resolversList( BaseJob* j )
ListJob< Content >* job = static_cast< ListJob< Content >* >( j );
m_resolvers = job->itemList();
m_resolverStates = TomahawkSettings::instance()->atticaResolverStates();
m_resolverStates = TomahawkSettingsGui::instanceGui()->atticaResolverStates();
// load icon cache from disk, and fetch any we are missing
loadPixmapsFromCache();
@@ -243,8 +257,10 @@ AtticaManager::resolverIconFetched()
QPixmap* icon = new QPixmap;
icon->loadFromData( data );
m_resolverStates[ resolverId ].pixmap = icon;
m_resolverStates[ resolverId ].pixmapDirty = true;
}
void
AtticaManager::syncServerData()
{
@@ -271,65 +287,19 @@ AtticaManager::syncServerData()
if ( ( r.state == Installed || r.state == NeedsUpgrade ) &&
!upstream.version().isEmpty() )
{
if ( newerVersion( r.version, upstream.version() ) )
if ( TomahawkUtils::newerVersion( r.version, upstream.version() ) )
{
m_resolverStates[ id ].state = NeedsUpgrade;
QMetaObject::invokeMethod( this, "upgradeResolver", Qt::QueuedConnection, Q_ARG( Attica::Content, upstream ) );
}
}
}
}
}
bool
AtticaManager::newerVersion( const QString& older, const QString& newer ) const
{
// Dumb version comparison. Expects two strings, X.Y and Z.V. Returns true if Z > v || Z == V && V > Y
// DOES NOT support X.Y.Z version strings
if ( older.isEmpty() || newer.isEmpty() )
return false;
QPair<int, int> oldVer, newVer;
QStringList parts = older.split( "." );
if ( parts.size() == 1 )
{
oldVer.first = parts[ 0 ].toInt();
oldVer.second = 0;
}
else if ( parts.size() == 2 )
{
oldVer.first = parts[ 0 ].toInt();
oldVer.second = parts[ 1 ].toInt();;
}
else
return false;
parts = newer.split( "." );
if ( parts.size() == 1 )
{
newVer.first = parts[ 0 ].toInt();
newVer.second = 0;
}
else if ( parts.size() == 2 )
{
newVer.first = parts[ 0 ].toInt();
newVer.second = parts[ 1 ].toInt();;
}
else
return false;
// Do the comparison
if ( newVer.first > oldVer.first )
return true;
if ( newVer.first == oldVer.first &&
newVer.second > oldVer.second )
return true;
return false;
}
void
AtticaManager::installResolver( const Content& resolver )
AtticaManager::installResolver( const Content& resolver, bool autoEnable )
{
Q_ASSERT( !resolver.id().isNull() );
@@ -343,10 +313,12 @@ AtticaManager::installResolver( const Content& resolver )
ItemJob< DownloadItem >* job = m_resolverProvider.downloadLink( resolver.id() );
connect( job, SIGNAL( finished( Attica::BaseJob* ) ), this, SLOT( resolverDownloadFinished( Attica::BaseJob* ) ) );
job->setProperty( "resolverId", resolver.id() );
job->setProperty( "autoEnable", autoEnable );
job->start();
}
void
AtticaManager::upgradeResolver( const Content& resolver )
{
@@ -356,11 +328,12 @@ AtticaManager::upgradeResolver( const Content& resolver )
if ( !m_resolverStates.contains( resolver.id() ) || m_resolverStates[ resolver.id() ].state != NeedsUpgrade )
return;
const bool enabled = TomahawkSettings::instance()->enabledScriptResolvers().contains( m_resolverStates[ resolver.id() ].scriptPath );
m_resolverStates[ resolver.id() ].state = Upgrading;
emit resolverStateChanged( resolver.id() );
uninstallResolver( resolver );
installResolver( resolver );
installResolver( resolver, enabled );
}
@@ -377,6 +350,7 @@ AtticaManager::resolverDownloadFinished ( BaseJob* j )
QNetworkReply* reply = TomahawkUtils::nam()->get( QNetworkRequest( url ) );
connect( reply, SIGNAL( finished() ), this, SLOT( payloadFetched() ) );
reply->setProperty( "resolverId", job->property( "resolverId" ) );
reply->setProperty( "autoEnable", job->property( "autoEnable" ) );
}
else
{
@@ -412,10 +386,12 @@ AtticaManager::payloadFetched()
// update with absolute, not relative, path
m_resolverStates[ resolverId ].scriptPath = resolverPath;
const bool autoEnable = reply->property( "autoEnable" ).toBool();
// Do the install / add to tomahawk
Tomahawk::Pipeline::instance()->addScriptResolver( resolverPath, true );
Tomahawk::Pipeline::instance()->addScriptResolver( resolverPath, autoEnable );
m_resolverStates[ resolverId ].state = Installed;
TomahawkSettings::instance()->setAtticaResolverStates( m_resolverStates );
TomahawkSettingsGui::instanceGui()->setAtticaResolverStates( m_resolverStates );
emit resolverInstalled( resolverId );
emit resolverStateChanged( resolverId );
}
@@ -511,7 +487,7 @@ AtticaManager::uninstallResolver( const QString& pathToResolver )
if ( resolver.id() == atticaId ) // this is the one
{
m_resolverStates[ atticaId ].state = Uninstalled;
TomahawkSettings::instance()->setAtticaResolverState( atticaId, Uninstalled );
TomahawkSettingsGui::instanceGui()->setAtticaResolverState( atticaId, Uninstalled );
doResolverRemove( atticaId );
}
@@ -529,7 +505,7 @@ AtticaManager::uninstallResolver( const Content& resolver )
emit resolverStateChanged( resolver.id() );
m_resolverStates[ resolver.id() ].state = Uninstalled;
TomahawkSettings::instance()->setAtticaResolverState( resolver.id(), Uninstalled );
TomahawkSettingsGui::instanceGui()->setAtticaResolverState( resolver.id(), Uninstalled );
}
Tomahawk::Pipeline::instance()->removeScriptResolver( pathFromId( resolver.id() ) );

View File

@@ -52,9 +52,12 @@ public:
ResolverState state;
QPixmap* pixmap;
// internal
bool pixmapDirty;
Resolver( const QString& v, const QString& path, int userR, ResolverState s )
: version( v ), scriptPath( path ), userRating( userR ), state( s ), pixmap( 0 ) {}
Resolver() : userRating( -1 ), state( Uninstalled ), pixmap( 0 ) {}
: version( v ), scriptPath( path ), userRating( userR ), state( s ), pixmap( 0 ), pixmapDirty( false ) {}
Resolver() : userRating( -1 ), state( Uninstalled ), pixmap( 0 ), pixmapDirty( false ) {}
};
typedef QHash< QString, AtticaManager::Resolver > StateHash;
@@ -83,8 +86,6 @@ public:
ResolverState resolverState( const Attica::Content& resolver ) const;
QPixmap iconForResolver( const Attica::Content& id ); // Looks up in icon cache
void installResolver( const Attica::Content& resolver );
void upgradeResolver( const Attica::Content& resolver );
void uninstallResolver( const Attica::Content& resolver );
void uninstallResolver( const QString& pathToResolver );
QString pathFromId( const QString& resolverId ) const;
@@ -92,6 +93,9 @@ public:
void uploadRating( const Attica::Content& c );
bool userHasRated( const Attica::Content& c ) const;
public slots:
void installResolver( const Attica::Content& resolver, bool autoEnable = true );
void upgradeResolver( const Attica::Content& resolver );
signals:
void resolversReloaded( const Attica::Content::List& resolvers );
@@ -111,7 +115,6 @@ private slots:
void resolverIconFetched();
void syncServerData();
bool newerVersion( const QString& older, const QString& newer ) const;
private:
QString extractPayload( const QString& filename, const QString& resolverId ) const;
@@ -127,4 +130,8 @@ private:
static AtticaManager* s_instance;
};
#ifdef LIBATTICA_FOUND
Q_DECLARE_METATYPE( Attica::Content );
#endif
#endif // ATTICAMANAGER_H

View File

@@ -11,39 +11,19 @@ include( ${QT_USE_FILE} )
add_definitions( ${QT_DEFINITIONS} )
add_definitions( -DQT_SHARED )
add_definitions( -DDLLEXPORT_PRO )
add_definitions( -DQT_SHAREDPOINTER_TRACK_POINTERS )
set( libSources
tomahawksettings.cpp
sourcelist.cpp
pipeline.cpp
aclsystem.cpp
set( libGuiSources
actioncollection.cpp
artist.cpp
album.cpp
collection.cpp
playlist.cpp
resolver.cpp
query.cpp
result.cpp
source.cpp
sourceplaylistinterface.cpp
viewpage.cpp
viewmanager.cpp
globalactionmanager.cpp
contextmenu.cpp
dropjob.cpp
playlistinterface.cpp
globalactionmanager.cpp
viewpage.cpp
viewmanager.cpp
LatchManager.cpp
EchonestCatalogSynchronizer.cpp
sip/SipPlugin.cpp
sip/SipHandler.cpp
sip/SipModel.cpp
sip/sipinfo.cpp
audio/audioengine.cpp
TomahawkSettingsGui.cpp
context/ContextPage.cpp
context/ContextWidget.cpp
@@ -52,6 +32,294 @@ set( libSources
context/pages/WikipediaContext.cpp
context/pages/WebContext.cpp
jobview/JobStatusView.cpp
jobview/JobStatusModel.cpp
jobview/JobStatusDelegate.cpp
jobview/PipelineStatusItem.cpp
jobview/TransferStatusItem.cpp
jobview/LatchedStatusItem.cpp
jobview/ErrorStatusMessage.cpp
jobview/IndexingJobItem.cpp
infobar/infobar.cpp
playlist/treemodel.cpp
playlist/treeproxymodel.cpp
playlist/treeproxymodelplaylistinterface.cpp
playlist/treeheader.cpp
playlist/treeitemdelegate.cpp
playlist/collectionproxymodel.cpp
playlist/collectionproxymodelplaylistinterface.cpp
playlist/collectionflatmodel.cpp
playlist/collectionview.cpp
playlist/playlistmodel.cpp
playlist/playlistproxymodel.cpp
playlist/playlistproxymodelplaylistinterface.cpp
playlist/playlistview.cpp
playlist/playlistitemdelegate.cpp
playlist/queueproxymodel.cpp
playlist/queueproxymodelplaylistinterface.cpp
playlist/queueview.cpp
playlist/trackmodel.cpp
playlist/trackmodelitem.cpp
playlist/trackproxymodel.cpp
playlist/trackproxymodelplaylistinterface.cpp
playlist/trackview.cpp
playlist/trackheader.cpp
playlist/treemodelitem.cpp
playlist/albumitem.cpp
playlist/albummodel.cpp
playlist/albumproxymodel.cpp
playlist/albumproxymodelplaylistinterface.cpp
playlist/albumitemdelegate.cpp
playlist/albumview.cpp
playlist/artistview.cpp
playlist/customplaylistview.cpp
playlist/ViewHeader.cpp
playlist/dynamic/DynamicPlaylist.cpp
playlist/dynamic/DynamicView.cpp
playlist/dynamic/DynamicModel.cpp
playlist/dynamic/echonest/EchonestGenerator.cpp
playlist/dynamic/echonest/EchonestControl.cpp
playlist/dynamic/echonest/EchonestSteerer.cpp
playlist/dynamic/widgets/DynamicWidget.cpp
playlist/dynamic/widgets/DynamicControlWrapper.cpp
playlist/dynamic/widgets/DynamicControlList.cpp
playlist/dynamic/widgets/ReadOrWriteWidget.cpp
playlist/dynamic/widgets/MiscControlWidgets.cpp
playlist/dynamic/widgets/CollapsibleControls.cpp
playlist/dynamic/widgets/DynamicSetupWidget.cpp
playlist/dynamic/widgets/LoadingSpinner.cpp
playlist/topbar/topbar.cpp
playlist/topbar/clearbutton.cpp
playlist/topbar/searchlineedit.cpp
playlist/topbar/lineedit.cpp
playlist/topbar/searchbutton.cpp
ExternalResolverGui.cpp
resolvers/scriptresolver.cpp
resolvers/qtscriptresolver.cpp
sip/SipModel.cpp
utils/widgetdragfilter.cpp
utils/xspfgenerator.cpp
utils/jspfloader.cpp
utils/spotifyparser.cpp
utils/m3uloader.cpp
utils/itunesparser.cpp
utils/rdioparser.cpp
utils/shortenedlinkparser.cpp
utils/stylehelper.cpp
utils/dropjobnotifier.cpp
utils/proxystyle.cpp
utils/tomahawkutilsgui.cpp
utils/closure.cpp
widgets/checkdirtree.cpp
widgets/querylabel.cpp
widgets/imagebutton.cpp
widgets/animatedsplitter.cpp
widgets/elidedlabel.cpp
widgets/newplaylistwidget.cpp
widgets/searchwidget.cpp
widgets/SeekSlider.cpp
widgets/playlisttypeselectordlg.cpp
widgets/welcomewidget.cpp
widgets/whatshotwidget.cpp
widgets/ChartDataLoader.cpp
widgets/RecentlyPlayedPlaylistsModel.cpp
widgets/RecentPlaylistsModel.cpp
widgets/OverlayButton.cpp
widgets/overlaywidget.cpp
widgets/HeaderLabel.cpp
widgets/HeaderWidget.cpp
widgets/combobox.cpp
widgets/ToggleButton.cpp
widgets/SocialPlaylistWidget.cpp
widgets/infowidgets/sourceinfowidget.cpp
widgets/infowidgets/ArtistInfoWidget.cpp
widgets/infowidgets/AlbumInfoWidget.cpp
widgets/Breadcrumb.cpp
widgets/BreadcrumbButton.cpp
)
IF(QCA2_FOUND)
set( libGuiSources ${libGuiSources} utils/groovesharkparser.cpp )
ENDIF(QCA2_FOUND)
set( libGuiHeaders
actioncollection.h
contextmenu.h
dropjob.h
viewmanager.h
globalactionmanager.h
LatchManager.h
TomahawkSettingsGui.h
context/ContextPage.h
context/ContextWidget.h
context/pages/TopTracksContext.h
context/pages/RelatedArtistsContext.h
context/pages/WikipediaContext.h
context/pages/WebContext.h
infobar/infobar.h
playlist/topbar/topbar.h
playlist/topbar/clearbutton.h
playlist/topbar/searchlineedit.h
playlist/topbar/lineedit.h
playlist/topbar/lineedit_p.h
playlist/topbar/searchbutton.h
playlist/treemodel.h
playlist/treeproxymodel.h
playlist/treeproxymodelplaylistinterface.h
playlist/treeheader.h
playlist/treeitemdelegate.h
playlist/collectionproxymodel.h
playlist/collectionproxymodelplaylistinterface.h
playlist/collectionflatmodel.h
playlist/collectionview.h
playlist/playlistmodel.h
playlist/playlistproxymodel.h
playlist/playlistproxymodelplaylistinterface.h
playlist/playlistview.h
playlist/playlistitemdelegate.h
playlist/queueproxymodel.h
playlist/queueproxymodelplaylistinterface.h
playlist/queueview.h
playlist/trackmodel.h
playlist/trackmodelitem.h
playlist/trackproxymodel.h
playlist/trackproxymodelplaylistinterface.h
playlist/trackview.h
playlist/trackheader.h
playlist/treemodelitem.h
playlist/albumitem.h
playlist/albummodel.h
playlist/albumproxymodel.h
playlist/albumproxymodelplaylistinterface.h
playlist/albumitemdelegate.h
playlist/albumview.h
playlist/artistview.h
playlist/customplaylistview.h
playlist/ViewHeader.h
playlist/dynamic/DynamicPlaylist.h
playlist/dynamic/GeneratorInterface.h
playlist/dynamic/DynamicView.h
playlist/dynamic/DynamicModel.h
playlist/dynamic/echonest/EchonestGenerator.h
playlist/dynamic/echonest/EchonestControl.h
playlist/dynamic/echonest/EchonestSteerer.h
playlist/dynamic/widgets/DynamicWidget.h
playlist/dynamic/widgets/DynamicControlWrapper.h
playlist/dynamic/widgets/DynamicControlList.h
playlist/dynamic/widgets/ReadOrWriteWidget.h
playlist/dynamic/widgets/MiscControlWidgets.h
playlist/dynamic/widgets/CollapsibleControls.h
playlist/dynamic/widgets/DynamicSetupWidget.h
playlist/dynamic/widgets/LoadingSpinner.h
ExternalResolverGui.h
resolvers/scriptresolver.h
resolvers/qtscriptresolver.h
sip/SipModel.h
utils/widgetdragfilter.h
utils/xspfgenerator.h
utils/jspfloader.h
utils/spotifyparser.h
utils/m3uloader.h
utils/itunesparser.h
utils/rdioparser.h
utils/shortenedlinkparser.h
utils/dropjobnotifier.h
utils/closure.h
widgets/checkdirtree.h
widgets/querylabel.h
widgets/animatedcounterlabel.h
widgets/imagebutton.h
widgets/animatedsplitter.h
widgets/elidedlabel.h
widgets/newplaylistwidget.h
widgets/searchwidget.h
widgets/SeekSlider.h
widgets/playlisttypeselectordlg.h
widgets/welcomewidget.h
widgets/whatshotwidget.h
widgets/whatshotwidget_p.h
widgets/ChartDataLoader.h
widgets/RecentlyPlayedPlaylistsModel.h
widgets/RecentPlaylistsModel.h
widgets/OverlayButton.h
widgets/overlaywidget.h
widgets/HeaderLabel.h
widgets/HeaderWidget.h
widgets/combobox.h
widgets/ToggleButton.h
widgets/SocialPlaylistWidget.h
widgets/infowidgets/sourceinfowidget.h
widgets/infowidgets/ArtistInfoWidget.h
widgets/infowidgets/ArtistInfoWidget_p.h
widgets/infowidgets/AlbumInfoWidget.h
widgets/Breadcrumb.h
widgets/BreadcrumbButton.h
jobview/JobStatusView.h
jobview/JobStatusModel.h
jobview/JobStatusDelegate.h
jobview/JobStatusItem.h
jobview/PipelineStatusItem.h
jobview/TransferStatusItem.h
jobview/LatchedStatusItem.h
jobview/ErrorStatusMessage.h
jobview/IndexingJobItem.h
thirdparty/Qocoa/qsearchfield.h
)
IF(QCA2_FOUND)
set( libGuiHeaders ${libGuiHeaders} utils/groovesharkparser.h )
ENDIF(QCA2_FOUND)
set( libSources
tomahawksettings.cpp
sourcelist.cpp
pipeline.cpp
aclsystem.cpp
artist.cpp
artistplaylistinterface.cpp
album.cpp
albumplaylistinterface.cpp
collection.cpp
playlist.cpp
playlistplaylistinterface.cpp
resolver.cpp
ExternalResolver.cpp
query.cpp
result.cpp
source.cpp
sourceplaylistinterface.cpp
playlistinterface.cpp
EchonestCatalogSynchronizer.cpp
sip/SipPlugin.cpp
sip/SipHandler.cpp
sip/sipinfo.cpp
audio/audioengine.cpp
database/database.cpp
database/fuzzyindex.cpp
database/databasecollection.cpp
@@ -104,11 +372,10 @@ set( libSources
database/databasecommand_settrackattributes.cpp
database/database.cpp
infobar/infobar.cpp
infosystem/infosystemcache.cpp
infosystem/infosystem.cpp
infosystem/infosystemcache.cpp
infosystem/infosystemworker.cpp
infosystem/infoplugins/generic/echonestplugin.cpp
infosystem/infoplugins/generic/lastfmplugin.cpp
infosystem/infoplugins/generic/chartsplugin.cpp
@@ -118,66 +385,6 @@ set( libSources
infosystem/infoplugins/generic/musicbrainzPlugin.cpp
infosystem/infoplugins/generic/RoviPlugin.cpp
playlist/treemodel.cpp
playlist/treeproxymodel.cpp
playlist/treeheader.cpp
playlist/treeitemdelegate.cpp
playlist/collectionproxymodel.cpp
playlist/collectionflatmodel.cpp
playlist/collectionview.cpp
playlist/playlistmodel.cpp
playlist/playlistproxymodel.cpp
playlist/playlistview.cpp
playlist/playlistitemdelegate.cpp
playlist/queueproxymodel.cpp
playlist/queueview.cpp
playlist/trackmodel.cpp
playlist/trackmodelitem.cpp
playlist/trackproxymodel.cpp
playlist/trackview.cpp
playlist/trackheader.cpp
playlist/treemodelitem.cpp
playlist/albumitem.cpp
playlist/albummodel.cpp
playlist/albumproxymodel.cpp
playlist/albumitemdelegate.cpp
playlist/albumview.cpp
playlist/artistview.cpp
playlist/customplaylistview.cpp
playlist/ViewHeader.cpp
playlist/PlaylistUpdaterInterface.cpp
playlist/XspfUpdater.cpp
playlist/topbar/topbar.cpp
playlist/topbar/clearbutton.cpp
playlist/topbar/searchlineedit.cpp
playlist/topbar/lineedit.cpp
playlist/topbar/searchbutton.cpp
playlist/dynamic/DynamicPlaylist.cpp
playlist/dynamic/DynamicControl.cpp
playlist/dynamic/GeneratorFactory.cpp
playlist/dynamic/GeneratorInterface.cpp
playlist/dynamic/DynamicView.cpp
playlist/dynamic/DynamicModel.cpp
playlist/dynamic/DynamicPlaylistRevision.cpp
playlist/dynamic/echonest/EchonestGenerator.cpp
playlist/dynamic/echonest/EchonestControl.cpp
playlist/dynamic/echonest/EchonestSteerer.cpp
playlist/dynamic/widgets/DynamicWidget.cpp
playlist/dynamic/widgets/DynamicControlWrapper.cpp
playlist/dynamic/widgets/DynamicControlList.cpp
playlist/dynamic/widgets/ReadOrWriteWidget.cpp
playlist/dynamic/widgets/MiscControlWidgets.cpp
playlist/dynamic/widgets/CollapsibleControls.cpp
playlist/dynamic/widgets/DynamicSetupWidget.cpp
playlist/dynamic/widgets/LoadingSpinner.cpp
playlist/dynamic/database/DatabaseControl.cpp
playlist/dynamic/database/DatabaseGenerator.cpp
resolvers/scriptresolver.cpp
resolvers/qtscriptresolver.cpp
network/bufferiodevice.cpp
network/msgprocessor.cpp
network/streamconnection.cpp
@@ -188,53 +395,28 @@ set( libSources
network/connection.cpp
network/controlconnection.cpp
playlist/PlaylistUpdaterInterface.cpp
playlist/dynamic/DynamicPlaylist.cpp
playlist/dynamic/GeneratorFactory.cpp
playlist/dynamic/GeneratorInterface.cpp
playlist/dynamic/DynamicPlaylistRevision.cpp
playlist/XspfUpdater.cpp
playlist/dynamic/database/DatabaseGenerator.cpp
playlist/dynamic/database/DatabaseControl.cpp
playlist/dynamic/DynamicControl.cpp
taghandlers/tag.cpp
taghandlers/apetag.cpp
taghandlers/asftag.cpp
taghandlers/id3v1tag.cpp
taghandlers/id3v2tag.cpp
taghandlers/mp4tag.cpp
taghandlers/oggtag.cpp
utils/tomahawkutils.cpp
utils/logger.cpp
utils/proxystyle.cpp
utils/widgetdragfilter.cpp
utils/xspfloader.cpp
utils/xspfgenerator.cpp
utils/jspfloader.cpp
utils/spotifyparser.cpp
utils/itunesparser.cpp
utils/rdioparser.cpp
utils/shortenedlinkparser.cpp
utils/stylehelper.cpp
utils/qnr_iodevicestream.cpp
utils/dropjobnotifier.cpp
widgets/checkdirtree.cpp
widgets/querylabel.cpp
widgets/imagebutton.cpp
widgets/animatedsplitter.cpp
widgets/elidedlabel.cpp
widgets/newplaylistwidget.cpp
widgets/searchwidget.cpp
widgets/SeekSlider.cpp
widgets/playlisttypeselectordlg.cpp
widgets/welcomewidget.cpp
widgets/whatshotwidget.cpp
widgets/RecentlyPlayedPlaylistsModel.cpp
widgets/RecentPlaylistsModel.cpp
widgets/OverlayButton.cpp
widgets/overlaywidget.cpp
widgets/HeaderLabel.cpp
widgets/HeaderWidget.cpp
widgets/combobox.cpp
widgets/ToggleButton.cpp
widgets/SocialPlaylistWidget.cpp
widgets/infowidgets/sourceinfowidget.cpp
widgets/infowidgets/ArtistInfoWidget.cpp
widgets/infowidgets/AlbumInfoWidget.cpp
widgets/Breadcrumb.cpp
widgets/BreadcrumbButton.cpp
jobview/JobStatusView.cpp
jobview/JobStatusModel.cpp
jobview/JobStatusDelegate.cpp
jobview/PipelineStatusItem.cpp
jobview/TransferStatusItem.cpp
jobview/LatchedStatusItem.cpp
utils/xspfloader.cpp
thirdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp
thirdparty/kdsingleapplicationguard/kdsharedmemorylocker.cpp
@@ -248,41 +430,34 @@ set( libHeaders
pipeline.h
functimeout.h
playlistinterface.h
aclsystem.h
actioncollection.h
collection.h
query.h
resolver.h
ExternalResolver.h
result.h
source.h
sourceplaylistinterface.h
viewmanager.h
globalactionmanager.h
contextmenu.h
dropjob.h
AtticaManager.h
LatchManager.h
artist.h
artistplaylistinterface.h
album.h
albumplaylistinterface.h
playlist.h
playlistplaylistinterface.h
viewpage.h
EchonestCatalogSynchronizer.h
sip/SipPlugin.h
sip/SipHandler.h
sip/SipModel.h
sip/sipinfo.h
audio/audioengine.h
context/ContextPage.h
context/ContextWidget.h
context/pages/TopTracksContext.h
context/pages/RelatedArtistsContext.h
context/pages/WikipediaContext.h
context/pages/WebContext.h
database/database.h
database/fuzzyindex.h
database/databaseworker.h
@@ -334,11 +509,11 @@ set( libHeaders
database/databasecommand_trackattributes.h
database/databasecommand_settrackattributes.h
infobar/infobar.h
infosystem/infosystem.h
infosystem/infosystem.h
infosystem/infosystemworker.h
infosystem/infosystemcache.h
infosystem/infoplugins/generic/echonestplugin.h
infosystem/infoplugins/generic/lastfmplugin.h
infosystem/infoplugins/generic/chartsplugin.h
@@ -358,123 +533,32 @@ set( libHeaders
network/controlconnection.h
network/portfwdthread.h
playlist/treemodel.h
playlist/treeproxymodel.h
playlist/treeheader.h
playlist/treeitemdelegate.h
playlist/collectionproxymodel.h
playlist/collectionflatmodel.h
playlist/collectionview.h
playlist/playlistmodel.h
playlist/playlistproxymodel.h
playlist/playlistview.h
playlist/playlistitemdelegate.h
playlist/queueproxymodel.h
playlist/queueview.h
playlist/trackmodel.h
playlist/trackmodelitem.h
playlist/trackproxymodel.h
playlist/trackview.h
playlist/trackheader.h
playlist/treemodelitem.h
playlist/albumitem.h
playlist/albummodel.h
playlist/albumproxymodel.h
playlist/albumitemdelegate.h
playlist/albumview.h
playlist/artistview.h
playlist/customplaylistview.h
playlist/ViewHeader.h
playlist/PlaylistUpdaterInterface.h
playlist/XspfUpdater.h
playlist/topbar/topbar.h
playlist/topbar/clearbutton.h
playlist/topbar/searchlineedit.h
playlist/topbar/lineedit.h
playlist/topbar/lineedit_p.h
playlist/topbar/searchbutton.h
playlist/dynamic/DynamicPlaylist.h
playlist/dynamic/DynamicControl.h
playlist/dynamic/GeneratorInterface.h
playlist/dynamic/DynamicView.h
playlist/dynamic/DynamicModel.h
playlist/dynamic/echonest/EchonestGenerator.h
playlist/dynamic/echonest/EchonestControl.h
playlist/dynamic/echonest/EchonestSteerer.h
playlist/dynamic/widgets/DynamicWidget.h
playlist/dynamic/widgets/DynamicControlWrapper.h
playlist/dynamic/widgets/DynamicControlList.h
playlist/dynamic/widgets/ReadOrWriteWidget.h
playlist/dynamic/widgets/MiscControlWidgets.h
playlist/dynamic/widgets/CollapsibleControls.h
playlist/dynamic/widgets/DynamicSetupWidget.h
playlist/dynamic/widgets/LoadingSpinner.h
playlist/dynamic/database/DatabaseControl.h
playlist/dynamic/GeneratorFactory.h
playlist/XspfUpdater.h
playlist/dynamic/database/DatabaseGenerator.h
resolvers/scriptresolver.h
resolvers/qtscriptresolver.h
utils/widgetdragfilter.h
utils/xspfloader.h
utils/xspfgenerator.h
utils/jspfloader.h
utils/spotifyparser.h
utils/itunesparser.h
utils/rdioparser.h
utils/shortenedlinkparser.h
utils/qnr_iodevicestream.h
utils/dropjobnotifier.h
widgets/checkdirtree.h
widgets/querylabel.h
widgets/animatedcounterlabel.h
widgets/imagebutton.h
widgets/animatedsplitter.h
widgets/elidedlabel.h
widgets/newplaylistwidget.h
widgets/searchwidget.h
widgets/SeekSlider.h
widgets/playlisttypeselectordlg.h
widgets/welcomewidget.h
widgets/whatshotwidget.h
widgets/RecentlyPlayedPlaylistsModel.h
widgets/RecentPlaylistsModel.h
widgets/OverlayButton.h
widgets/overlaywidget.h
widgets/HeaderLabel.h
widgets/HeaderWidget.h
widgets/combobox.h
widgets/ToggleButton.h
widgets/SocialPlaylistWidget.h
widgets/infowidgets/sourceinfowidget.h
widgets/infowidgets/ArtistInfoWidget.h
widgets/infowidgets/ArtistInfoWidget_p.h
widgets/infowidgets/AlbumInfoWidget.h
widgets/Breadcrumb.h
widgets/BreadcrumbButton.h
jobview/JobStatusView.h
jobview/JobStatusModel.h
jobview/JobStatusDelegate.h
jobview/JobStatusItem.h
jobview/PipelineStatusItem.h
jobview/TransferStatusItem.h
jobview/LatchedStatusItem.h
playlist/dynamic/database/DatabaseControl.h
playlist/dynamic/DynamicControl.h
thirdparty/kdsingleapplicationguard/kdsingleapplicationguard.h
thirdparty/Qocoa/qsearchfield.h
utils/tomahawkutilsgui.h
utils/xspfloader.h
utils/qnr_iodevicestream.h
)
set( libHeaders_NoMOC
viewpage.h
infosystem/infoplugins/unix/imageconverter.h
playlist/dynamic/GeneratorInterface.h
playlist/dynamic/GeneratorFactory.h
taghandlers/tag.h
taghandlers/apetag.h
taghandlers/asftag.h
taghandlers/id3v1tag.h
taghandlers/id3v2tag.h
taghandlers/mp4tag.h
taghandlers/oggtag.h
utils/tomahawkutils.h
)
@@ -501,7 +585,7 @@ include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/.
${QJSON_INCLUDE_DIR}
${LIBECHONEST_INCLUDE_DIR}
${LIBECHONEST_INCLUDE_DIR}/..
${CLUCENE_INCLUDE_DIR}
${CLUCENE_INCLUDE_DIRS}
${PHONON_INCLUDES}
${CMAKE_BINARY_DIR}/thirdparty/liblastfm2/src
@@ -517,20 +601,20 @@ IF(QCA2_FOUND)
ENDIF(QCA2_FOUND)
IF(LIBATTICA_FOUND)
SET( libSources ${libSources} AtticaManager.cpp )
SET( libHeaders ${libHeaders} AtticaManager.h )
SET( libGuiSources ${libGuiSources} AtticaManager.cpp )
SET( libGuiHeaders ${libGuiHeaders} AtticaManager.h )
INCLUDE_DIRECTORIES( ${LIBATTICA_INCLUDE_DIR} )
ENDIF(LIBATTICA_FOUND)
IF( UNIX AND NOT APPLE )
SET( libSources ${libSources}
LIST(APPEND libGuiSources
infosystem/infoplugins/unix/mprispluginrootadaptor.cpp
infosystem/infoplugins/unix/mprispluginplayeradaptor.cpp
infosystem/infoplugins/unix/mprisplugin.cpp
infosystem/infoplugins/unix/fdonotifyplugin.cpp
infosystem/infoplugins/unix/imageconverter.cpp )
SET( libHeaders ${libHeaders}
LIST(APPEND libGuiHeaders
infosystem/infoplugins/unix/mprispluginrootadaptor.h
infosystem/infoplugins/unix/mprispluginplayeradaptor.h
infosystem/infoplugins/unix/mprisplugin.h
@@ -553,6 +637,7 @@ IF( WIN32 )
"dsound.dll"
"winmm.dll"
"advapi32.dll"
"shlwapi.dll"
)
ENDIF( WIN32 )
@@ -569,6 +654,8 @@ IF( APPLE )
utils/tomahawkutils_mac.mm
thirdparty/Qocoa/qsearchfield_mac.mm )
SET_SOURCE_FILES_PROPERTIES(utils/tomahawkutils_mac.mm PROPERTIES COMPILE_FLAGS "-fvisibility=default")
SET( libHeaders ${libHeaders}
infosystem/infoplugins/mac/adium.h
infosystem/infoplugins/mac/adiumplugin.h )
@@ -584,13 +671,18 @@ IF( APPLE )
/System/Library/Frameworks/AppKit.framework
)
ELSE( APPLE )
SET( libSources ${libSources} thirdparty/Qocoa/qsearchfield.cpp )
SET( libGuiSources ${libGuiSources} thirdparty/Qocoa/qsearchfield.cpp )
ENDIF( APPLE )
IF(LIBLASTFM_FOUND)
SET(LINK_LIBRARIES ${LINK_LIBRARIES} tomahawk_lastfm2 )
ENDIF(LIBLASTFM_FOUND)
IF(BUILD_GUI)
LIST(APPEND libSources ${libGuiSources} )
LIST(APPEND libHeaders ${libGuiHeaders} )
ENDIF()
qt4_wrap_ui( libUI_H ${libUI} )
qt4_wrap_cpp( libMoc ${libHeaders} )
@@ -616,15 +708,17 @@ TARGET_LINK_LIBRARIES( tomahawklib
${TAGLIB_LIBRARIES}
${CLUCENE_LIBRARIES}
${LIBECHONEST_LIBRARY}
${QT_QTSQL_LIBRARY}
${QT_QTUITOOLS_LIBRARY}
${QT_LIBRARIES}
${QT_QTGUI_LIBRARY}
${QT_QTSCRIPT_LIBRARY}
${OS_SPECIFIC_LINK_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${LINK_LIBRARIES}
)
INSTALL( TARGETS tomahawklib
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

View File

@@ -342,7 +342,6 @@ EchonestCatalogSynchronizer::tracksRemoved( const QList< unsigned int >& trackId
foreach ( unsigned int id, trackIds )
{
tDebug() << "Deleting item with id:" << id;
Echonest::CatalogUpdateEntry e( Echonest::CatalogTypes::Delete );
e.setItemId( QString::number( id ).toLatin1() );
entries.append( e );

View File

@@ -0,0 +1,27 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ExternalResolver.h"
#include "utils/logger.h"
Tomahawk::ExternalResolver::ErrorState
Tomahawk::ExternalResolver::error() const
{
return NoError;
}

View File

@@ -0,0 +1,78 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EXTERNALRESOLVER_H
#define EXTERNALRESOLVER_H
#include "query.h"
#include "dllmacro.h"
#include "resolver.h"
#include <QObject>
class QWidget;
namespace Tomahawk
{
/**
* Generic resolver object, used to manage a resolver that Tomahawk knows about
*
* You *must* start() a resolver after creating an ExternalResolver in order to use it,
* otherwise it will not do anything.
*/
class DLLEXPORT ExternalResolver : public Resolver
{
Q_OBJECT
public:
enum ErrorState {
NoError,
FileNotFound,
FailedToLoad
};
ExternalResolver( const QString& filePath ) { m_filePath = filePath; }
virtual QString filePath() const { return m_filePath; }
virtual void saveConfig() = 0;
virtual void reload() {} // Reloads from file (especially useful to check if file now exists)
virtual ErrorState error() const;
virtual bool running() const = 0;
public slots:
virtual void start() = 0;
virtual void stop() = 0;
signals:
void changed(); // if config widget was added/removed
protected:
void setFilePath( const QString& path ) { m_filePath = path; }
private:
QString m_filePath;
};
}; //ns
#endif // EXTERNALESOLVER_H

View File

@@ -0,0 +1,124 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ExternalResolverGui.h"
#include <QMetaProperty>
#include <QBuffer>
#include <QDir>
#include <QtGui/QIcon>
#include <QtGui/QWidget>
#include <QUiLoader>
#include "utils/logger.h"
Tomahawk::ExternalResolverGui::ExternalResolverGui(const QString& filePath)
: Tomahawk::ExternalResolver(filePath)
{
}
QVariant
Tomahawk::ExternalResolverGui::configMsgFromWidget( QWidget* w )
{
if( !w )
return QVariant();
// generate a qvariantmap of all the widgets in the hierarchy, and for each one include the list of properties and values
QVariantMap widgetMap;
addChildProperties( w, widgetMap );
// qDebug() << "Generated widget variant:" << widgetMap;
return widgetMap;
}
void
Tomahawk::ExternalResolverGui::addChildProperties( QObject* widget, QVariantMap& m )
{
// recursively add all properties of this widget to the map, then repeat on all children.
// bare QWidgets are boring---so skip them! They have no input that the user can set.
if( !widget || !widget->isWidgetType() )
return;
if( qstrcmp( widget->metaObject()->className(), "QWidget" ) != 0 )
{
// qDebug() << "Adding properties for this:" << widget->metaObject()->className();
// add this widget's properties
QVariantMap props;
for( int i = 0; i < widget->metaObject()->propertyCount(); i++ )
{
QString prop = widget->metaObject()->property( i ).name();
QVariant val = widget->property( prop.toLatin1() );
// clean up for QJson....
if( val.canConvert< QPixmap >() || val.canConvert< QImage >() || val.canConvert< QIcon >() )
continue;
props[ prop ] = val.toString();
// qDebug() << QString( "%1: %2" ).arg( prop ).arg( props[ prop ].toString() );
}
m[ widget->objectName() ] = props;
}
// and recurse
foreach( QObject* child, widget->children() )
addChildProperties( child, m );
}
QWidget*
Tomahawk::ExternalResolverGui::widgetFromData( QByteArray& data, QWidget* parent )
{
if( data.isEmpty() )
return 0;
QUiLoader l;
QBuffer b( &data );
QWidget* w = l.load( &b, parent );
return w;
}
QByteArray
Tomahawk::ExternalResolverGui::fixDataImagePaths( const QByteArray& data, bool compressed, const QVariantMap& images )
{
// with a list of images and image data, write each to a temp file, replace the path in the .ui file with the temp file path
QString uiFile = QString::fromUtf8( data );
foreach( const QString& filename, images.keys() )
{
if( !uiFile.contains( filename ) ) // make sure the image is used
continue;
QString fullPath = QDir::tempPath() + "/" + filename;
QFile imgF( fullPath );
if( !imgF.open( QIODevice::WriteOnly ) )
{
qWarning() << "Failed to write to temporary image in UI file:" << filename << fullPath;
continue;
}
QByteArray data = images[ filename ].toByteArray();
// qDebug() << "expanding data:" << data << compressed;
data = compressed ? qUncompress( QByteArray::fromBase64( data ) ) : QByteArray::fromBase64( data );
imgF.write( data );
imgF.close();
// replace the path to the image with the real path
uiFile.replace( filename, fullPath );
}
return uiFile.toUtf8();
}

View File

@@ -0,0 +1,55 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EXTERNALRESOLVERGUI_H
#define EXTERNALRESOLVERGUI_H
#include "ExternalResolver.h"
#include "dllmacro.h"
class QWidget;
namespace Tomahawk
{
/**
* Generic resolver object, used to manage a resolver that Tomahawk knows about
*
* You *must* start() a resolver after creating an ExternalResolver in order to use it,
* otherwise it will not do anything.
*/
class DLLEXPORT ExternalResolverGui : public ExternalResolver
{
Q_OBJECT
public:
ExternalResolverGui( const QString& filePath );
virtual QWidget* configUI() const = 0;
protected:
QWidget* widgetFromData( QByteArray& data, QWidget* parent = 0 );
QVariant configMsgFromWidget( QWidget* w );
QByteArray fixDataImagePaths( const QByteArray& data, bool compressed, const QVariantMap& images );
private:
void addChildProperties( QObject* parent, QVariantMap& m );
};
}; //ns
#endif // RESOLVER_H

View File

@@ -22,8 +22,7 @@
#include "audio/audioengine.h"
#include "database/database.h"
#include <QtCore/QStateMachine>
#include <QtCore/QState>
#include <QtGui/QAction>
#include "sourcelist.h"
#include "database/databasecommand_socialaction.h"
#include "sourceplaylistinterface.h"
@@ -34,7 +33,7 @@ LatchManager::LatchManager( QObject* parent )
: QObject( parent )
, m_state( NotLatched )
{
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::PlaylistInterface* ) ), this, SLOT( playlistChanged( Tomahawk::PlaylistInterface* ) ) );
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ), this, SLOT( playlistChanged( Tomahawk::playlistinterface_ptr ) ) );
}
LatchManager::~LatchManager()
@@ -58,11 +57,11 @@ LatchManager::latchRequest( const source_ptr& source )
m_state = Latching;
m_waitingForLatch = source;
AudioEngine::instance()->playItem( source->getPlaylistInterface().data(), source->getPlaylistInterface()->nextItem() );
AudioEngine::instance()->playItem( source->playlistInterface(), source->playlistInterface()->nextItem() );
}
void
LatchManager::playlistChanged( PlaylistInterface* )
LatchManager::playlistChanged( Tomahawk::playlistinterface_ptr )
{
// If we were latched on and changed, send the listening along stop
if ( m_latchedOnTo.isNull() )
@@ -71,7 +70,7 @@ LatchManager::playlistChanged( PlaylistInterface* )
return; // Neither latched on nor waiting to be latched on, no-op
m_latchedOnTo = m_waitingForLatch;
m_latchedInterface = m_waitingForLatch->getPlaylistInterface();
m_latchedInterface = m_waitingForLatch->playlistInterface();
m_waitingForLatch.clear();
m_state = Latched;
@@ -82,7 +81,9 @@ LatchManager::playlistChanged( PlaylistInterface* )
cmd->setTimestamp( QDateTime::currentDateTime().toTime_t() );
Database::instance()->enqueue( QSharedPointer< DatabaseCommand >( cmd ) );
ActionCollection::instance()->getAction( "latchOn" )->setText( tr( "&Catch Up" ) );
QAction *latchOnAction = ActionCollection::instance()->getAction( "latchOn" );
latchOnAction->setText( tr( "&Catch Up" ) );
latchOnAction->setIcon( QIcon() );
// If not, then keep waiting
return;
@@ -108,7 +109,7 @@ LatchManager::playlistChanged( PlaylistInterface* )
m_latchedInterface.clear();
// call ourselves to hit the "create latch" condition
playlistChanged( 0 );
playlistChanged( Tomahawk::playlistinterface_ptr() );
return;
}
m_latchedOnTo.clear();
@@ -117,7 +118,9 @@ LatchManager::playlistChanged( PlaylistInterface* )
m_state = NotLatched;
ActionCollection::instance()->getAction( "latchOn" )->setText( tr( "&Listen Along" ) );
QAction *latchOnAction = ActionCollection::instance()->getAction( "latchOn" );
latchOnAction->setText( tr( "&Listen Along" ) );
latchOnAction->setIcon( QIcon( RESPATH "images/headphones-sidebar.png" ) );
}
@@ -128,12 +131,27 @@ LatchManager::catchUpRequest()
AudioEngine::instance()->next();
}
void
LatchManager::unlatchRequest( const source_ptr& source )
{
Q_UNUSED( source );
AudioEngine::instance()->stop();
AudioEngine::instance()->setPlaylist( 0 );
AudioEngine::instance()->setPlaylist( Tomahawk::playlistinterface_ptr() );
ActionCollection::instance()->getAction( "latchOn" )->setText( tr( "&Listen Along" ) );
QAction *latchOnAction = ActionCollection::instance()->getAction( "latchOn" );
latchOnAction->setText( tr( "&Listen Along" ) );
latchOnAction->setIcon( QIcon( RESPATH "images/headphones-sidebar.png" ) );
}
void
LatchManager::latchModeChangeRequest( const Tomahawk::source_ptr& source, bool realtime )
{
if ( !isLatched( source ) )
return;
source->playlistInterface()->setLatchMode( realtime ? Tomahawk::PlaylistInterface::RealTime : Tomahawk::PlaylistInterface::StayOnSong );
if ( realtime )
catchUpRequest();
}

View File

@@ -43,10 +43,11 @@ public slots:
void latchRequest( const Tomahawk::source_ptr& source );
void unlatchRequest( const Tomahawk::source_ptr& source );
void catchUpRequest();
void latchModeChangeRequest( const Tomahawk::source_ptr& source, bool realtime );
private slots:
void playlistChanged( Tomahawk::PlaylistInterface* );
void playlistChanged( Tomahawk::playlistinterface_ptr );
private:
enum State {
NotLatched = 0,

View File

@@ -0,0 +1,140 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "TomahawkSettingsGui.h"
#include <QDesktopServices>
#include "settingsdialog.h"
// #include <QDir>
//
// #include "sip/SipHandler.h"
// #include "playlistinterface.h"
//
// #include "utils/logger.h"
// #include "utils/tomahawkutils.h"
//
// #include "database/databasecommand_updatesearchindex.h"
// #include "database/database.h"
#define VERSION 5
using namespace Tomahawk;
inline QDataStream& operator<<(QDataStream& out, const AtticaManager::StateHash& states)
{
out << VERSION;
out << (quint32)states.count();
foreach( const QString& key, states.keys() )
{
AtticaManager::Resolver resolver = states[ key ];
out << key << resolver.version << resolver.scriptPath << (qint32)resolver.state << resolver.userRating;
}
return out;
}
inline QDataStream& operator>>(QDataStream& in, AtticaManager::StateHash& states)
{
quint32 count = 0, version = 0;
in >> version;
in >> count;
for ( uint i = 0; i < count; i++ )
{
QString key, version, scriptPath;
qint32 state, userRating;
in >> key;
in >> version;
in >> scriptPath;
in >> state;
in >> userRating;
states[ key ] = AtticaManager::Resolver( version, scriptPath, userRating, (AtticaManager::ResolverState)state );
}
return in;
}
TomahawkSettingsGui*
TomahawkSettingsGui::instanceGui()
{
return qobject_cast< TomahawkSettingsGui* >(TomahawkSettings::instance());
}
TomahawkSettingsGui::TomahawkSettingsGui( QObject* parent )
: TomahawkSettings( parent )
{
qRegisterMetaType< AtticaManager::StateHash >( "AtticaManager::StateHash" );
qRegisterMetaTypeStreamOperators<AtticaManager::StateHash>("AtticaManager::StateHash");
}
TomahawkSettingsGui::~TomahawkSettingsGui()
{
}
QString
TomahawkSettingsGui::storageCacheLocation() const
{
return QDesktopServices::storageLocation( QDesktopServices::CacheLocation ) + "/InfoSystemCache/";
}
QStringList
TomahawkSettingsGui::scannerPaths() const
{
QString musicLocation;
musicLocation = QDesktopServices::storageLocation( QDesktopServices::MusicLocation );
return value( "scanner/paths", musicLocation ).toStringList();
}
void
TomahawkSettingsGui::setAtticaResolverState( const QString& resolver, AtticaManager::ResolverState state )
{
AtticaManager::StateHash resolvers = value( "script/atticaresolverstates" ).value< AtticaManager::StateHash >();
AtticaManager::Resolver r = resolvers.value( resolver );
r.state = state;
resolvers.insert( resolver, r );
setValue( "script/atticaresolverstates", QVariant::fromValue< AtticaManager::StateHash >( resolvers ) );
sync();
}
AtticaManager::StateHash
TomahawkSettingsGui::atticaResolverStates() const
{
return value( "script/atticaresolverstates" ).value< AtticaManager::StateHash >();
}
void
TomahawkSettingsGui::setAtticaResolverStates( const AtticaManager::StateHash states )
{
setValue( "script/atticaresolverstates", QVariant::fromValue< AtticaManager::StateHash >( states ) );
}
void
TomahawkSettingsGui::removeAtticaResolverState ( const QString& resolver )
{
AtticaManager::StateHash resolvers = value( "script/atticaresolverstates" ).value< AtticaManager::StateHash >();
resolvers.remove( resolver );
setValue( "script/atticaresolverstates", QVariant::fromValue< AtticaManager::StateHash >( resolvers ) );
}

View File

@@ -0,0 +1,55 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOMAHAWK_SETTINGS_GUI_H
#define TOMAHAWK_SETTINGS_GUI_H
#include "tomahawksettings.h"
#include "AtticaManager.h"
#include <QSettings>
#include "dllmacro.h"
/**
* Convenience wrapper around QSettings for tomahawk-specific config
*/
class DLLEXPORT TomahawkSettingsGui : public TomahawkSettings
{
Q_OBJECT
public:
static TomahawkSettingsGui* instanceGui();
explicit TomahawkSettingsGui( QObject* parent = 0 );
virtual ~TomahawkSettingsGui();
virtual QString storageCacheLocation() const;
virtual QStringList scannerPaths() const;
AtticaManager::StateHash atticaResolverStates() const;
void setAtticaResolverStates( const AtticaManager::StateHash states );
void setAtticaResolverState( const QString& resolver, AtticaManager::ResolverState state );
void removeAtticaResolverState( const QString& resolver );
};
Q_DECLARE_METATYPE(AtticaManager::StateHash);
#endif

View File

@@ -17,8 +17,9 @@
*/
#include "actioncollection.h"
#include <tomahawksettings.h>
#include <utils/tomahawkutils.h>
#include "tomahawksettings.h"
#include "audio/audioengine.h"
#include "utils/tomahawkutils.h"
ActionCollection* ActionCollection::s_instance = 0;
ActionCollection* ActionCollection::instance()
@@ -38,14 +39,39 @@ ActionCollection::ActionCollection( QObject *parent )
void
ActionCollection::initActions()
{
m_actionCollection[ "latchOn" ] = new QAction( tr( "&Listen Along" ), this );
m_actionCollection[ "latchOff" ] = new QAction( tr( "&Stop Listening Along" ), this );
QAction *latchOn = new QAction( tr( "&Listen Along" ), this );
latchOn->setIcon( QIcon( RESPATH "images/headphones-sidebar.png" ) );
m_actionCollection[ "latchOn" ] = latchOn;
QAction *latchOff = new QAction( tr( "Stop &Listening Along" ), this );
latchOff->setIcon( QIcon( RESPATH "images/headphones-off.png" ) );
m_actionCollection[ "latchOff" ] = latchOff;
QAction *realtimeFollowingAlong = new QAction( tr( "&Follow in real-time" ), this );
realtimeFollowingAlong->setCheckable( true );
m_actionCollection[ "realtimeFollowingAlong" ] = realtimeFollowingAlong;
bool isPublic = TomahawkSettings::instance()->privateListeningMode() == TomahawkSettings::PublicListening;
QAction *privacyToggle = new QAction( tr( QString( isPublic ? "&Listen Privately" : "&Listen Publicly" ).toAscii().constData() ), this );
QAction *privacyToggle = new QAction( ( isPublic ? tr( "&Listen Privately" ) : tr( "&Listen Publicly" ) ), this );
privacyToggle->setIcon( QIcon( RESPATH "images/private-listening.png" ) );
privacyToggle->setIconVisibleInMenu( isPublic );
m_actionCollection[ "togglePrivacy" ] = privacyToggle;
connect( m_actionCollection[ "togglePrivacy" ], SIGNAL( triggered() ), SLOT( togglePrivateListeningMode() ), Qt::UniqueConnection );
m_actionCollection[ "loadPlaylist" ] = new QAction( tr( "&Load Playlist" ), this );
m_actionCollection[ "renamePlaylist" ] = new QAction( tr( "&Rename Playlist" ), this );
m_actionCollection[ "copyPlaylist" ] = new QAction( tr( "&Copy Playlist Link" ), this );
m_actionCollection[ "playPause" ] = new QAction( tr( "&Play" ), this );
m_actionCollection[ "stop" ] = new QAction( tr( "&Stop" ), this );
m_actionCollection[ "previousTrack" ] = new QAction( tr( "&Previous Track" ), this );
m_actionCollection[ "nextTrack" ] = new QAction( tr( "&Next Track" ), this );
m_actionCollection[ "quit" ] = new QAction( tr( "&Quit" ), this );
// connect actions to AudioEngine
AudioEngine *ae = AudioEngine::instance();
connect( m_actionCollection[ "playPause" ], SIGNAL( triggered() ), ae, SLOT( playPause() ), Qt::UniqueConnection );
connect( m_actionCollection[ "stop" ], SIGNAL( triggered() ), ae, SLOT( stop() ), Qt::UniqueConnection );
connect( m_actionCollection[ "previousTrack" ], SIGNAL( triggered() ), ae, SLOT( previous() ), Qt::UniqueConnection );
connect( m_actionCollection[ "nextTrack" ], SIGNAL( triggered() ), ae, SLOT( next() ), Qt::UniqueConnection );
}
@@ -62,3 +88,21 @@ ActionCollection::getAction( const QString& name )
{
return m_actionCollection.contains( name ) ? m_actionCollection[ name ] : 0;
}
void
ActionCollection::togglePrivateListeningMode()
{
tDebug() << Q_FUNC_INFO;
if ( TomahawkSettings::instance()->privateListeningMode() == TomahawkSettings::PublicListening )
TomahawkSettings::instance()->setPrivateListeningMode( TomahawkSettings::FullyPrivate );
else
TomahawkSettings::instance()->setPrivateListeningMode( TomahawkSettings::PublicListening );
QAction *privacyToggle = m_actionCollection[ "togglePrivacy" ];
bool isPublic = TomahawkSettings::instance()->privateListeningMode() == TomahawkSettings::PublicListening;
privacyToggle->setText( ( isPublic ? tr( "&Listen Privately" ) : tr( "&Listen Publicly" ) ) );
privacyToggle->setIconVisibleInMenu( isPublic );
emit privacyModeChanged();
}

View File

@@ -23,11 +23,10 @@
#include <QtGui/QAction>
class DLLEXPORT ActionCollection : public QObject
{
Q_OBJECT
public:
static ActionCollection* instance();
@@ -35,9 +34,15 @@ public:
~ActionCollection();
void initActions();
QAction* getAction( const QString &name );
QAction* getAction( const QString& name );
public slots:
void togglePrivateListeningMode();
signals:
void privacyModeChanged();
private:
static ActionCollection* s_instance;

View File

@@ -19,21 +19,28 @@
#include "album.h"
#include "artist.h"
#include "albumplaylistinterface.h"
#include "database/database.h"
#include "database/databaseimpl.h"
#include "database/databasecommand_alltracks.h"
#include "query.h"
#include "utils/logger.h"
using namespace Tomahawk;
Album::Album() {}
Album::~Album() {}
Album::~Album()
{
delete m_cover;
}
album_ptr
Album::get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCreate )
{
if ( !Database::instance() || !Database::instance()->impl() )
return album_ptr();
int albid = Database::instance()->impl()->albumId( artist->id(), name, autoCreate );
if ( albid < 1 && autoCreate )
return album_ptr();
@@ -54,7 +61,7 @@ Album::get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& ar
return s_albums.value( id );
}
album_ptr a = album_ptr( new Album( id, name, artist ) );
album_ptr a = album_ptr( new Album( id, name, artist ), &QObject::deleteLater );
if ( id > 0 )
s_albums.insert( id, a );
@@ -63,80 +70,118 @@ Album::get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& ar
Album::Album( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist )
: PlaylistInterface( this )
: QObject()
, m_id( id )
, m_name( name )
, m_artist( artist )
, m_currentItem( 0 )
, m_currentTrack( 0 )
, m_cover( 0 )
, m_infoLoaded( false )
{
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
}
void
Album::onTracksAdded( const QList<Tomahawk::query_ptr>& tracks )
{
qDebug() << Q_FUNC_INFO;
Tomahawk::AlbumPlaylistInterface* api = dynamic_cast< Tomahawk::AlbumPlaylistInterface* >( playlistInterface().data() );
if ( api )
api->addQueries( tracks );
m_queries << tracks;
emit tracksAdded( tracks );
}
Tomahawk::result_ptr
Album::siblingItem( int itemsAway )
{
int p = m_currentTrack;
p += itemsAway;
if ( p < 0 )
return Tomahawk::result_ptr();
if ( p >= m_queries.count() )
return Tomahawk::result_ptr();
m_currentTrack = p;
m_currentItem = m_queries.at( p )->results().first();
return m_currentItem;
}
result_ptr
Album::currentItem() const
{
return m_currentItem;
}
bool
Album::hasNextItem()
{
int p = m_currentTrack;
p++;
if ( p < 0 || p >= m_queries.count() )
return false;
return true;
}
artist_ptr
Album::artist() const
{
return m_artist;
}
QList<Tomahawk::query_ptr>
Album::tracks()
#ifndef ENABLE_HEADLESS
QPixmap
Album::cover( const QSize& size, bool forceLoad ) const
{
if ( m_queries.isEmpty() )
if ( !m_infoLoaded )
{
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks();
cmd->setAlbum( this );
cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition );
if ( !forceLoad )
return QPixmap();
m_uuid = uuid();
connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ),
SLOT( onTracksAdded( QList<Tomahawk::query_ptr> ) ) );
Tomahawk::InfoSystem::InfoStringHash trackInfo;
trackInfo["artist"] = artist()->name();
trackInfo["album"] = name();
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
Tomahawk::InfoSystem::InfoRequestData requestData;
requestData.caller = m_uuid;
requestData.type = Tomahawk::InfoSystem::InfoAlbumCoverArt;
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo );
requestData.customData = QVariantMap();
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
}
return m_queries;
if ( !m_cover && !m_coverBuffer.isEmpty() )
{
m_cover = new QPixmap();
m_cover->loadFromData( m_coverBuffer );
}
if ( m_cover && !m_cover->isNull() && !size.isEmpty() )
{
if ( m_coverCache.contains( size.width() ) )
{
return m_coverCache.value( size.width() );
}
QPixmap scaledCover;
scaledCover = m_cover->scaled( size, Qt::KeepAspectRatio, Qt::SmoothTransformation );
m_coverCache.insert( size.width(), scaledCover );
return scaledCover;
}
if ( m_cover )
return *m_cover;
else
return QPixmap();
}
#endif
void
Album::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
{
if ( requestData.caller != m_uuid ||
requestData.type != Tomahawk::InfoSystem::InfoAlbumCoverArt )
{
return;
}
m_infoLoaded = true;
if ( !output.isNull() && output.isValid() )
{
QVariantMap returnedData = output.value< QVariantMap >();
const QByteArray ba = returnedData["imgbytes"].toByteArray();
if ( ba.length() )
{
m_coverBuffer = ba;
}
}
emit updated();
}
Tomahawk::playlistinterface_ptr
Album::playlistInterface()
{
if ( m_playlistInterface.isNull() )
{
m_playlistInterface = Tomahawk::playlistinterface_ptr( new Tomahawk::AlbumPlaylistInterface( this ) );
}
return m_playlistInterface;
}

View File

@@ -19,17 +19,23 @@
#ifndef TOMAHAWKALBUM_H
#define TOMAHAWKALBUM_H
#include <QObject>
#include <QSharedPointer>
#include "config.h"
#include <QtCore/QObject>
#include <QtCore/QSharedPointer>
#ifndef ENABLE_HEADLESS
#include <QtGui/QPixmap>
#endif
#include "typedefs.h"
#include "playlistinterface.h"
#include "dllmacro.h"
#include "infosystem/infosystem.h"
namespace Tomahawk
{
class DLLEXPORT Album : public QObject, public PlaylistInterface
class DLLEXPORT Album : public QObject
{
Q_OBJECT
@@ -37,56 +43,44 @@ public:
static album_ptr get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCreate = false );
static album_ptr get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist );
Album( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist );
~Album();
explicit Album( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist );
virtual ~Album();
unsigned int id() const { return m_id; }
QString name() const { return m_name; }
artist_ptr artist() const;
#ifndef ENABLE_HEADLESS
QPixmap cover( const QSize& size, bool forceLoad = true ) const;
#endif
bool infoLoaded() const { return m_infoLoaded; }
QList<Tomahawk::query_ptr> tracks();
virtual int trackCount() const { return m_queries.count(); }
virtual int unfilteredTrackCount() const { return m_queries.count(); }
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
virtual bool hasNextItem();
virtual Tomahawk::result_ptr currentItem() const;
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
virtual bool shuffled() const { return false; }
virtual void setRepeatMode( PlaylistInterface::RepeatMode ) {}
virtual void setShuffled( bool ) {}
virtual void setFilter( const QString& /*pattern*/ ) {}
Tomahawk::playlistinterface_ptr playlistInterface();
signals:
void repeatModeChanged( PlaylistInterface::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void tracksAdded( const QList<Tomahawk::query_ptr>& tracks );
void trackCountChanged( unsigned int tracks );
void sourceTrackCountChanged( unsigned int tracks );
void nextTrackReady();
void updated();
private slots:
void onTracksAdded( const QList<Tomahawk::query_ptr>& tracks );
void infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
private:
Album();
Q_DISABLE_COPY( Album )
unsigned int m_id;
QString m_name;
artist_ptr m_artist;
QList<Tomahawk::query_ptr> m_queries;
result_ptr m_currentItem;
unsigned int m_currentTrack;
QByteArray m_coverBuffer;
mutable QPixmap* m_cover;
bool m_infoLoaded;
mutable QString m_uuid;
mutable QHash< int, QPixmap > m_coverCache;
Tomahawk::playlistinterface_ptr m_playlistInterface;
};
}; // ns
} // ns
#endif

View File

@@ -0,0 +1,109 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "albumplaylistinterface.h"
#include "artist.h"
#include "database/database.h"
#include "database/databaseimpl.h"
#include "database/databasecommand_alltracks.h"
#include "query.h"
#include "utils/logger.h"
using namespace Tomahawk;
AlbumPlaylistInterface::AlbumPlaylistInterface() {}
AlbumPlaylistInterface::AlbumPlaylistInterface( Tomahawk::Album *album )
: Tomahawk::PlaylistInterface()
, m_currentItem( 0 )
, m_currentTrack( 0 )
, m_album( QWeakPointer< Tomahawk::Album >( album ) )
{
}
AlbumPlaylistInterface::~AlbumPlaylistInterface()
{
m_album.clear();
}
Tomahawk::result_ptr
AlbumPlaylistInterface::siblingItem( int itemsAway )
{
int p = m_currentTrack;
p += itemsAway;
if ( p < 0 )
return Tomahawk::result_ptr();
if ( p >= m_queries.count() )
return Tomahawk::result_ptr();
m_currentTrack = p;
m_currentItem = m_queries.at( p )->results().first();
return m_currentItem;
}
result_ptr
AlbumPlaylistInterface::currentItem() const
{
return m_currentItem;
}
bool
AlbumPlaylistInterface::hasNextItem()
{
int p = m_currentTrack;
p++;
if ( p < 0 || p >= m_queries.count() )
return false;
return true;
}
QList< Tomahawk::query_ptr >
AlbumPlaylistInterface::tracks()
{
if ( m_queries.isEmpty() && m_album )
{
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks();
cmd->setAlbum( m_album );
cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition );
//this takes discnumber into account as well
connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ),
m_album.data(), SLOT( onTracksAdded( QList<Tomahawk::query_ptr> ) ) );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
}
return m_queries;
}
void
AlbumPlaylistInterface::addQueries( const QList< query_ptr >& tracks )
{
m_queries << tracks;
}

View File

@@ -0,0 +1,82 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOMAHAWKALBUMPLAYLISTINTERFACE_H
#define TOMAHAWKALBUMPLAYLISTINTERFACE_H
#include <QtCore/QObject>
#include <QtCore/QSharedPointer>
#include "album.h"
#include "typedefs.h"
#include "playlistinterface.h"
#include "dllmacro.h"
namespace Tomahawk
{
class DLLEXPORT AlbumPlaylistInterface : public Tomahawk::PlaylistInterface
{
Q_OBJECT
public:
AlbumPlaylistInterface( Tomahawk::Album *album );
virtual ~AlbumPlaylistInterface();
QList<Tomahawk::query_ptr> tracks();
virtual int trackCount() const { return m_queries.count(); }
virtual int unfilteredTrackCount() const { return m_queries.count(); }
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
virtual bool hasNextItem();
virtual Tomahawk::result_ptr currentItem() const;
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
virtual bool shuffled() const { return false; }
virtual void setRepeatMode( PlaylistInterface::RepeatMode ) {}
virtual void setShuffled( bool ) {}
virtual void setFilter( const QString& /*pattern*/ ) {}
virtual void addQueries( const QList<Tomahawk::query_ptr>& tracks );
signals:
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void trackCountChanged( unsigned int tracks );
void sourceTrackCountChanged( unsigned int tracks );
void nextTrackReady();
private:
AlbumPlaylistInterface();
QList< Tomahawk::query_ptr > m_queries;
result_ptr m_currentItem;
unsigned int m_currentTrack;
QWeakPointer< Tomahawk::Album > m_album;
};
}; // ns
#endif

View File

@@ -18,10 +18,10 @@
#include "artist.h"
#include "artistplaylistinterface.h"
#include "collection.h"
#include "database/database.h"
#include "database/databaseimpl.h"
#include "database/databasecommand_alltracks.h"
#include "query.h"
#include "utils/logger.h"
@@ -29,19 +29,18 @@
using namespace Tomahawk;
Artist::Artist()
{
}
Artist::~Artist()
{
delete m_cover;
}
artist_ptr
Artist::get( const QString& name, bool autoCreate )
{
if ( !Database::instance() || !Database::instance()->impl() )
return artist_ptr();
int artid = Database::instance()->impl()->artistId( name, autoCreate );
if ( artid < 1 && autoCreate )
return artist_ptr();
@@ -62,7 +61,7 @@ Artist::get( unsigned int id, const QString& name )
return s_artists.value( id );
}
artist_ptr a = artist_ptr( new Artist( id, name ) );
artist_ptr a = artist_ptr( new Artist( id, name ), &QObject::deleteLater );
if ( id > 0 )
s_artists.insert( id, a );
@@ -71,76 +70,110 @@ Artist::get( unsigned int id, const QString& name )
Artist::Artist( unsigned int id, const QString& name )
: PlaylistInterface( this )
: QObject()
, m_id( id )
, m_name( name )
, m_currentItem( 0 )
, m_currentTrack( 0 )
, m_cover( 0 )
, m_infoLoaded( false )
{
m_sortname = DatabaseImpl::sortname( name, true );
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
}
void
Artist::onTracksAdded( const QList<Tomahawk::query_ptr>& tracks )
{
qDebug() << Q_FUNC_INFO;
m_queries << tracks;
Tomahawk::ArtistPlaylistInterface* api = dynamic_cast< Tomahawk::ArtistPlaylistInterface* >( playlistInterface().data() );
if ( api )
api->addQueries( tracks );
emit tracksAdded( tracks );
}
Tomahawk::result_ptr
Artist::siblingItem( int itemsAway )
#ifndef ENABLE_HEADLESS
QPixmap
Artist::cover( const QSize& size, bool forceLoad ) const
{
int p = m_currentTrack;
p += itemsAway;
if ( p < 0 )
return Tomahawk::result_ptr();
if ( p >= m_queries.count() )
return Tomahawk::result_ptr();
m_currentTrack = p;
m_currentItem = m_queries.at( p )->results().first();
return m_currentItem;
}
bool
Artist::hasNextItem()
{
int p = m_currentTrack;
p++;
if ( p < 0 || p >= m_queries.count() )
return false;
return true;
}
result_ptr
Artist::currentItem() const
{
return m_currentItem;
}
QList<Tomahawk::query_ptr>
Artist::tracks()
{
if ( m_queries.isEmpty() )
if ( !m_infoLoaded )
{
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks();
cmd->setArtist( this );
cmd->setSortOrder( DatabaseCommand_AllTracks::Album );
if ( !forceLoad )
return QPixmap();
m_uuid = uuid();
connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ),
SLOT( onTracksAdded( QList<Tomahawk::query_ptr> ) ) );
Tomahawk::InfoSystem::InfoStringHash trackInfo;
trackInfo["artist"] = name();
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
Tomahawk::InfoSystem::InfoRequestData requestData;
requestData.caller = m_uuid;
requestData.type = Tomahawk::InfoSystem::InfoArtistImages;
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo );
requestData.customData = QVariantMap();
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
}
return m_queries;
if ( !m_cover && !m_coverBuffer.isEmpty() )
{
m_cover = new QPixmap();
m_cover->loadFromData( m_coverBuffer );
}
if ( m_cover && !m_cover->isNull() && !size.isEmpty() )
{
if ( m_coverCache.contains( size.width() ) )
{
return m_coverCache.value( size.width() );
}
QPixmap scaledCover;
scaledCover = m_cover->scaled( size, Qt::KeepAspectRatio, Qt::SmoothTransformation );
m_coverCache.insert( size.width(), scaledCover );
return scaledCover;
}
if ( m_cover )
return *m_cover;
else
return QPixmap();
}
#endif
void
Artist::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
{
if ( requestData.caller != m_uuid ||
requestData.type != Tomahawk::InfoSystem::InfoArtistImages )
{
return;
}
m_infoLoaded = true;
if ( !output.isNull() && output.isValid() )
{
QVariantMap returnedData = output.value< QVariantMap >();
const QByteArray ba = returnedData["imgbytes"].toByteArray();
if ( ba.length() )
{
m_coverBuffer = ba;
}
}
emit updated();
}
Tomahawk::playlistinterface_ptr
Artist::playlistInterface()
{
if ( m_playlistInterface.isNull() )
{
m_playlistInterface = Tomahawk::playlistinterface_ptr( new Tomahawk::ArtistPlaylistInterface( this ) );
}
return m_playlistInterface;
}

View File

@@ -19,75 +19,67 @@
#ifndef TOMAHAWKARTIST_H
#define TOMAHAWKARTIST_H
#include <QObject>
#include <QSharedPointer>
#include "config.h"
#include <QtCore/QObject>
#include <QtCore/QSharedPointer>
#ifndef ENABLE_HEADLESS
#include <QtGui/QPixmap>
#endif
#include "typedefs.h"
#include "playlistinterface.h"
#include "dllmacro.h"
#include "infosystem/infosystem.h"
namespace Tomahawk
{
class DLLEXPORT Artist : public QObject, public PlaylistInterface
class DLLEXPORT Artist : public QObject
{
Q_OBJECT
public:
static artist_ptr get( const QString& name, bool autoCreate = false );
static artist_ptr get( unsigned int id, const QString& name );
Artist( unsigned int id, const QString& name );
Artist();
explicit Artist( unsigned int id, const QString& name );
virtual ~Artist();
unsigned int id() const { return m_id; }
QString name() const { return m_name; }
QString sortname() const { return m_sortname; }
#ifndef ENABLE_HEADLESS
QPixmap cover( const QSize& size, bool forceLoad = true ) const;
#endif
bool infoLoaded() const { return m_infoLoaded; }
virtual QList<Tomahawk::query_ptr> tracks();
virtual int trackCount() const { return 0; }
virtual int unfilteredTrackCount() const { return m_queries.count(); }
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
virtual bool hasNextItem();
virtual Tomahawk::result_ptr currentItem() const;
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
virtual bool shuffled() const { return false; }
virtual void setRepeatMode( PlaylistInterface::RepeatMode ) {}
virtual void setShuffled( bool ) {}
virtual void setFilter( const QString& /*pattern*/ ) {}
Tomahawk::playlistinterface_ptr playlistInterface();
signals:
void repeatModeChanged( PlaylistInterface::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void tracksAdded( const QList<Tomahawk::query_ptr>& tracks );
void trackCountChanged( unsigned int tracks );
void sourceTrackCountChanged( unsigned int tracks );
void nextTrackReady();
void updated();
private slots:
void onTracksAdded( const QList<Tomahawk::query_ptr>& tracks );
void infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
private:
Q_DISABLE_COPY(Artist)
Q_DISABLE_COPY( Artist )
unsigned int m_id;
QString m_name;
QString m_sortname;
QByteArray m_coverBuffer;
mutable QPixmap* m_cover;
bool m_infoLoaded;
mutable QString m_uuid;
QList<Tomahawk::query_ptr> m_queries;
result_ptr m_currentItem;
unsigned int m_currentTrack;
mutable QHash< int, QPixmap > m_coverCache;
Tomahawk::playlistinterface_ptr m_playlistInterface;
};
}; // ns
} // ns
#endif

View File

@@ -0,0 +1,106 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "artistplaylistinterface.h"
#include "artist.h"
#include "collection.h"
#include "query.h"
#include "database/database.h"
#include "database/databasecommand_alltracks.h"
#include "utils/logger.h"
using namespace Tomahawk;
ArtistPlaylistInterface::ArtistPlaylistInterface( Tomahawk::Artist *artist )
: Tomahawk::PlaylistInterface()
, m_currentItem( 0 )
, m_currentTrack( 0 )
, m_artist( QWeakPointer< Tomahawk::Artist >( artist ) )
{
}
ArtistPlaylistInterface::~ArtistPlaylistInterface()
{
m_artist.clear();
}
Tomahawk::result_ptr
ArtistPlaylistInterface::siblingItem( int itemsAway )
{
int p = m_currentTrack;
p += itemsAway;
if ( p < 0 )
return Tomahawk::result_ptr();
if ( p >= m_queries.count() )
return Tomahawk::result_ptr();
m_currentTrack = p;
m_currentItem = m_queries.at( p )->results().first();
return m_currentItem;
}
bool
ArtistPlaylistInterface::hasNextItem()
{
int p = m_currentTrack;
p++;
if ( p < 0 || p >= m_queries.count() )
return false;
return true;
}
result_ptr
ArtistPlaylistInterface::currentItem() const
{
return m_currentItem;
}
QList<Tomahawk::query_ptr>
ArtistPlaylistInterface::tracks()
{
if ( m_queries.isEmpty() && m_artist )
{
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks();
cmd->setArtist( m_artist );
cmd->setSortOrder( DatabaseCommand_AllTracks::Album );
connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ),
m_artist.data(), SLOT( onTracksAdded( QList<Tomahawk::query_ptr> ) ) );
Database::instance()->enqueue( QSharedPointer< DatabaseCommand >( cmd ) );
}
return m_queries;
}
void
ArtistPlaylistInterface::addQueries( const QList< query_ptr >& tracks )
{
m_queries << tracks;
}

View File

@@ -0,0 +1,73 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOMAHAWKARTISTPLAYLISTINTERFACE_H
#define TOMAHAWKARTISTPLAYLISTINTERFACE_H
#include <QtCore/QObject>
#include <QtCore/QSharedPointer>
#include "artist.h"
#include "typedefs.h"
#include "playlistinterface.h"
#include "dllmacro.h"
namespace Tomahawk
{
class DLLEXPORT ArtistPlaylistInterface : public Tomahawk::PlaylistInterface
{
Q_OBJECT
public:
ArtistPlaylistInterface( Tomahawk::Artist *artist );
virtual ~ArtistPlaylistInterface();
virtual QList<Tomahawk::query_ptr> tracks();
virtual int trackCount() const { return 0; }
virtual int unfilteredTrackCount() const { return m_queries.count(); }
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
virtual bool hasNextItem();
virtual Tomahawk::result_ptr currentItem() const;
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
virtual bool shuffled() const { return false; }
virtual void setRepeatMode( PlaylistInterface::RepeatMode ) {}
virtual void setShuffled( bool ) {}
virtual void setFilter( const QString& /*pattern*/ ) {}
virtual void addQueries( const QList<Tomahawk::query_ptr>& tracks );
private:
Q_DISABLE_COPY( ArtistPlaylistInterface )
QList< Tomahawk::query_ptr > m_queries;
result_ptr m_currentItem;
unsigned int m_currentTrack;
QWeakPointer< Tomahawk::Artist > m_artist;
};
}; // ns
#endif

View File

@@ -18,19 +18,20 @@
#include "audioengine.h"
#include <QUrl>
#include <QNetworkReply>
#include "config.h"
#include <QtCore/QUrl>
#include <QtNetwork/QNetworkReply>
#include "playlistinterface.h"
#include "sourceplaylistinterface.h"
#include "tomahawksettings.h"
#include "actioncollection.h"
#include "database/database.h"
#include "database/databasecommand_logplayback.h"
#include "network/servent.h"
#include "utils/qnr_iodevicestream.h"
#include "headlesscheck.h"
#include "infosystem/infosystem.h"
#include "album.h"
#include "utils/logger.h"
@@ -52,12 +53,10 @@ AudioEngine::instance()
AudioEngine::AudioEngine()
: QObject()
, m_isPlayingHttp( false )
, m_queue( 0 )
, m_timeElapsed( 0 )
, m_expectStop( false )
, m_waitingOnNewTrack( false )
, m_infoSystemConnected( false )
, m_state( Stopped )
{
s_instance = this;
@@ -75,12 +74,9 @@ AudioEngine::AudioEngine()
connect( m_mediaObject, SIGNAL( tick( qint64 ) ), SLOT( timerTriggered( qint64 ) ) );
connect( m_mediaObject, SIGNAL( aboutToFinish() ), SLOT( onAboutToFinish() ) );
connect( m_audioOutput, SIGNAL( volumeChanged( qreal ) ), this, SLOT( onVolumeChanged( qreal ) ) );
connect( m_audioOutput, SIGNAL( volumeChanged( qreal ) ), SLOT( onVolumeChanged( qreal ) ) );
#ifndef TOMAHAWK_HEADLESS
tDebug() << Q_FUNC_INFO << "Connecting privacy toggle";
connect( ActionCollection::instance()->getAction( "togglePrivacy" ), SIGNAL( triggered( bool ) ), this, SLOT( togglePrivateListeningMode() ) );
#endif
connect( this, SIGNAL( sendWaitingNotification() ), SLOT( sendWaitingNotificationSlot() ), Qt::QueuedConnection );
onVolumeChanged( m_audioOutput->volume() );
@@ -135,8 +131,11 @@ AudioEngine::play()
if ( isPaused() )
{
setVolume( m_volume );
m_mediaObject->play();
setVolume( m_volume );
emit resumed();
Tomahawk::InfoSystem::InfoStringHash trackInfo;
trackInfo["title"] = m_currentTrack->track();
@@ -156,6 +155,7 @@ AudioEngine::pause()
{
tDebug( LOGEXTRA ) << Q_FUNC_INFO;
m_volume = volume();
m_mediaObject->pause();
emit paused();
@@ -167,6 +167,8 @@ void
AudioEngine::stop()
{
tDebug( LOGEXTRA ) << Q_FUNC_INFO;
emit stopped();
if ( isStopped() )
return;
@@ -178,20 +180,17 @@ AudioEngine::stop()
if ( !m_currentTrack.isNull() )
emit timerPercentage( ( (double)m_timeElapsed / (double)m_currentTrack->duration() ) * 100.0 );
emit stopped();
setCurrentTrack( Tomahawk::result_ptr() );
Tomahawk::InfoSystem::InfoTypeMap map;
map[ Tomahawk::InfoSystem::InfoNowStopped ] = QVariant();
if ( m_waitingOnNewTrack )
{
sendWaitingNotification();
}
emit sendWaitingNotification();
else if ( TomahawkSettings::instance()->verboseNotifications() )
{
QVariantMap stopInfo;
stopInfo["message"] = QString( "Tomahawk is stopped." );
stopInfo["message"] = tr( "Tomahawk is stopped." );
map[ Tomahawk::InfoSystem::InfoNotifyUser ] = QVariant::fromValue< QVariantMap >( stopInfo );
}
@@ -234,12 +233,12 @@ AudioEngine::canGoNext()
m_playlist.data()->skipRestrictions() == PlaylistInterface::NoSkipForwards )
return false;
if ( !m_currentTrack.isNull() && !m_playlist.data()->hasNextItem() &&
( m_playlist.data()->currentItem().isNull() || ( m_currentTrack->id() == m_playlist.data()->currentItem()->id() ) ) )
if ( !m_currentTrack.isNull() && !m_playlist->hasNextItem() &&
( m_playlist->currentItem().isNull() || ( m_currentTrack->id() == m_playlist->currentItem()->id() ) ) )
{
//For instance, when doing a catch-up while listening along, but the person
//you're following hasn't started a new track yet...don't do anything
tDebug( LOGEXTRA ) << Q_FUNC_INFO << "catch up";
tDebug( LOGEXTRA ) << Q_FUNC_INFO << "catch up, but same track or can't move on because don't have next track or it wasn't resolved";
return false;
}
@@ -317,8 +316,13 @@ AudioEngine::mute()
void
AudioEngine::sendWaitingNotification() const
AudioEngine::sendWaitingNotificationSlot() const
{
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
//since it's async, after this is triggered our result could come in, so don't show the popup in that case
if ( !m_playlist.isNull() && m_playlist->hasNextItem() )
return;
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(
@@ -330,62 +334,42 @@ AudioEngine::sendWaitingNotification() const
void
AudioEngine::sendNowPlayingNotification()
{
tDebug( LOGEXTRA ) << Q_FUNC_INFO;
if ( ! m_infoSystemConnected )
#ifndef ENABLE_HEADLESS
if ( m_currentTrack->album().isNull() || m_currentTrack->album()->infoLoaded() )
onNowPlayingInfoReady();
else
{
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ), SLOT( infoSystemFinished( QString ) ) );
m_infoSystemConnected = true;
connect( m_currentTrack->album().data(), SIGNAL( updated() ), SLOT( onNowPlayingInfoReady() ), Qt::UniqueConnection );
m_currentTrack->album()->cover( QSize( 0, 0 ) );
}
Tomahawk::InfoSystem::InfoStringHash trackInfo;
trackInfo["artist"] = m_currentTrack->album()->artist()->name();
trackInfo["album"] = m_currentTrack->album()->name();
Tomahawk::InfoSystem::InfoRequestData requestData;
requestData.caller = s_aeInfoIdentifier;
requestData.type = Tomahawk::InfoSystem::InfoAlbumCoverArt;
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo );
requestData.customData = QVariantMap();
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
#endif
}
void
AudioEngine::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
AudioEngine::onNowPlayingInfoReady()
{
if ( requestData.caller != s_aeInfoIdentifier ||
requestData.type != Tomahawk::InfoSystem::InfoAlbumCoverArt )
{
return;
}
if ( m_currentTrack.isNull() ||
m_currentTrack->track().isNull() ||
m_currentTrack->artist().isNull() )
return;
if ( !m_currentTrack->album().isNull() && sender() && m_currentTrack->album().data() != sender() )
return;
QVariantMap playInfo;
playInfo["message"] = tr( "Tomahawk is playing \"%1\" by %2%3." )
.arg( m_currentTrack->track() )
.arg( m_currentTrack->artist()->name() )
.arg( m_currentTrack->album().isNull() ? QString() : tr( " on album %1" ).arg( m_currentTrack->album()->name() ) );
if ( !output.isNull() && output.isValid() )
.arg( m_currentTrack->album().isNull() ? QString() : QString( " %1" ).arg( tr( "on album %1" ).arg( m_currentTrack->album()->name() ) ) );
if ( !m_currentTrack->album().isNull() )
{
QVariantMap returnedData = output.value< QVariantMap >();
const QByteArray ba = returnedData["imgbytes"].toByteArray();
if ( ba.length() )
{
QPixmap pm;
pm.loadFromData( ba );
playInfo["image"] = QVariant( pm.toImage() );
}
#ifndef ENABLE_HEADLESS
QImage cover;
cover = m_currentTrack->album()->cover( QSize( 0, 0 ) ).toImage();
playInfo["image"] = QVariant( cover );
#endif
}
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo(
@@ -394,32 +378,6 @@ AudioEngine::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData,
}
void
AudioEngine::infoSystemFinished( QString caller )
{
Q_UNUSED( caller );
}
void
AudioEngine::togglePrivateListeningMode()
{
tDebug() << Q_FUNC_INFO;
if ( TomahawkSettings::instance()->privateListeningMode() == TomahawkSettings::PublicListening )
TomahawkSettings::instance()->setPrivateListeningMode( TomahawkSettings::FullyPrivate );
else
TomahawkSettings::instance()->setPrivateListeningMode( TomahawkSettings::PublicListening );
#ifndef TOMAHAWK_HEADLESS
QAction *privacyToggle = ActionCollection::instance()->getAction( "togglePrivacy" );
bool isPublic = TomahawkSettings::instance()->privateListeningMode() == TomahawkSettings::PublicListening;
privacyToggle->setText( tr( QString( isPublic ? "&Listen Privately" : "&Listen Publicly" ).toAscii().constData() ) );
privacyToggle->setIconVisibleInMenu( isPublic );
#endif
}
bool
AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
{
@@ -450,9 +408,6 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
tLog() << "Starting new song:" << m_currentTrack->url();
emit loading( m_currentTrack );
if ( QNetworkReply* qnr_io = qobject_cast< QNetworkReply* >( io.data() ) )
connect( qnr_io, SIGNAL( error( QNetworkReply::NetworkError ) ), this, SLOT( ioStreamError( QNetworkReply::NetworkError ) ) );
if ( !isHttpResult( m_currentTrack->url() ) && !isLocalResult( m_currentTrack->url() ) )
{
if ( QNetworkReply* qnr_io = qobject_cast< QNetworkReply* >( io.data() ) )
@@ -460,7 +415,6 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
else
m_mediaObject->setCurrentSource( io.data() );
m_mediaObject->currentSource().setAutoDelete( false );
m_isPlayingHttp = false;
}
else
{
@@ -481,11 +435,11 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
if ( furl.startsWith( "file://" ) )
furl = furl.right( furl.length() - 7 );
#endif
tLog( LOGVERBOSE ) << "Passing to Phonon:" << furl << furl.toLatin1();
m_mediaObject->setCurrentSource( furl );
}
m_mediaObject->currentSource().setAutoDelete( true );
m_isPlayingHttp = true;
}
if ( !m_input.isNull() )
@@ -498,8 +452,8 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
emit started( m_currentTrack );
if ( TomahawkSettings::instance()->verboseNotifications() )
sendNowPlayingNotification();
sendNowPlayingNotification();
if ( TomahawkSettings::instance()->privateListeningMode() != TomahawkSettings::FullyPrivate )
{
DatabaseCommand_LogPlayback* cmd = new DatabaseCommand_LogPlayback( m_currentTrack, DatabaseCommand_LogPlayback::Started );
@@ -583,7 +537,7 @@ AudioEngine::loadNextTrack()
void
AudioEngine::playItem( Tomahawk::PlaylistInterface* playlist, const Tomahawk::result_ptr& result )
AudioEngine::playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk::result_ptr& result )
{
tDebug( LOGEXTRA ) << Q_FUNC_INFO << ( result.isNull() ? QString() : result->url() );
@@ -591,7 +545,7 @@ AudioEngine::playItem( Tomahawk::PlaylistInterface* playlist, const Tomahawk::re
m_playlist.data()->reset();
setPlaylist( playlist );
m_currentTrackPlaylist = playlist->getSharedPointer();
m_currentTrackPlaylist = playlist;
if ( !result.isNull() )
loadTrack( result );
@@ -599,26 +553,24 @@ AudioEngine::playItem( Tomahawk::PlaylistInterface* playlist, const Tomahawk::re
{
m_waitingOnNewTrack = true;
if ( isStopped() )
sendWaitingNotification();
emit sendWaitingNotification();
else
stop();
}
}
void
AudioEngine::ioStreamError( QNetworkReply::NetworkError error )
AudioEngine::onPlaylistNextTrackReady()
{
if ( error != QNetworkReply::NoError )
// If in real-time and you have a few seconds left, you're probably lagging -- finish it up
if ( m_playlist && m_playlist->latchMode() == PlaylistInterface::RealTime && ( m_waitingOnNewTrack || m_currentTrack.isNull() || m_currentTrack->id() == 0 || ( currentTrackTotalTime() - currentTime() > 6000 ) ) )
{
if ( canGoNext() )
loadNextTrack();
m_waitingOnNewTrack = false;
loadNextTrack();
return;
}
}
void
AudioEngine::playlistNextTrackReady()
{
if ( !m_waitingOnNewTrack )
return;
@@ -642,7 +594,10 @@ AudioEngine::onStateChanged( Phonon::State newState, Phonon::State oldState )
if ( newState == Phonon::ErrorState )
{
stop();
tLog() << "Phonon Error:" << m_mediaObject->errorString() << m_mediaObject->errorType();
emit error( UnknownError );
return;
}
if ( newState == Phonon::PlayingState )
@@ -714,26 +669,26 @@ AudioEngine::timerTriggered( qint64 time )
void
AudioEngine::setPlaylist( PlaylistInterface* playlist )
AudioEngine::setPlaylist( Tomahawk::playlistinterface_ptr playlist )
{
if ( !m_playlist.isNull() )
{
if ( m_playlist.data()->object() && m_playlist.data()->retryMode() == PlaylistInterface::Retry )
disconnect( m_playlist.data()->object(), SIGNAL( nextTrackReady() ) );
if ( m_playlist.data() && m_playlist.data()->retryMode() == PlaylistInterface::Retry )
disconnect( m_playlist.data(), SIGNAL( nextTrackReady() ) );
m_playlist.data()->reset();
}
if ( !playlist )
if ( playlist.isNull() )
{
m_playlist.clear();
emit playlistChanged( playlist );
return;
}
m_playlist = playlist->getSharedPointer();
m_playlist = playlist;
if ( m_playlist.data()->object() && m_playlist.data()->retryMode() == PlaylistInterface::Retry )
connect( m_playlist.data()->object(), SIGNAL( nextTrackReady() ), SLOT( playlistNextTrackReady() ) );
if ( !m_playlist.isNull() && m_playlist.data() && m_playlist.data()->retryMode() == PlaylistInterface::Retry )
connect( m_playlist.data(), SIGNAL( nextTrackReady() ), SLOT( onPlaylistNextTrackReady() ) );
emit playlistChanged( playlist );
}

View File

@@ -19,34 +19,28 @@
#ifndef AUDIOENGINE_H
#define AUDIOENGINE_H
#include <QObject>
#include <QTimer>
#include <QNetworkReply>
#include <QtCore/QObject>
#include <QtCore/QTimer>
#include <phonon/MediaObject>
#include <phonon/AudioOutput>
#include <phonon/BackendCapabilities>
#include "infosystem/infosystem.h"
#include "result.h"
#include "typedefs.h"
#include "playlistinterface.h"
#include "dllmacro.h"
#define AUDIO_VOLUME_STEP 5
namespace Tomahawk
{
class PlaylistInterface;
}
class DLLEXPORT AudioEngine : public QObject
{
Q_OBJECT
public:
enum AudioErrorCode { StreamReadError, AudioDeviceError, DecodeError };
enum AudioErrorCode { StreamReadError, AudioDeviceError, DecodeError, UnknownError };
enum AudioState { Stopped, Playing, Paused };
static AudioEngine* instance();
@@ -63,10 +57,10 @@ public:
bool isStopped() const { return m_state == Stopped; }
/* Returns the PlaylistInterface of the currently playing track. Note: This might be different to the current playlist! */
Tomahawk::PlaylistInterface* currentTrackPlaylist() const { return m_currentTrackPlaylist.data(); }
Tomahawk::playlistinterface_ptr currentTrackPlaylist() const { return m_currentTrackPlaylist; }
/* Returns the PlaylistInterface of the current playlist. Note: The currently playing track might still be from a different playlist! */
Tomahawk::PlaylistInterface* playlist() const { return m_playlist.data(); }
Tomahawk::playlistinterface_ptr playlist() const { return m_playlist; }
Tomahawk::result_ptr currentTrack() const { return m_currentTrack; }
@@ -91,19 +85,11 @@ public slots:
void setVolume( int percentage );
void lowerVolume() { setVolume( volume() - AUDIO_VOLUME_STEP ); }
void raiseVolume() { setVolume( volume() + AUDIO_VOLUME_STEP ); }
void onVolumeChanged( qreal volume ) { emit volumeChanged( volume * 100 ); }
void mute();
void playItem( Tomahawk::PlaylistInterface* playlist, const Tomahawk::result_ptr& result );
void setPlaylist( Tomahawk::PlaylistInterface* playlist );
void setQueue( Tomahawk::PlaylistInterface* queue ) { m_queue = queue; }
void playlistNextTrackReady();
void infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
void infoSystemFinished( QString caller );
void togglePrivateListeningMode();
void playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk::result_ptr& result );
void setPlaylist( Tomahawk::playlistinterface_ptr playlist );
void setQueue( Tomahawk::playlistinterface_ptr queue ) { m_queue = queue; }
signals:
void loading( const Tomahawk::result_ptr& track );
@@ -122,9 +108,11 @@ signals:
void timerSeconds( unsigned int secondsElapsed );
void timerPercentage( unsigned int percentage );
void playlistChanged( Tomahawk::PlaylistInterface* playlist );
void playlistChanged( Tomahawk::playlistinterface_ptr playlist );
void error( AudioErrorCode errorCode );
void error( AudioEngine::AudioErrorCode errorCode );
void sendWaitingNotification();
private slots:
bool loadTrack( const Tomahawk::result_ptr& result );
@@ -133,28 +121,30 @@ private slots:
void onAboutToFinish();
void onStateChanged( Phonon::State newState, Phonon::State oldState );
void onVolumeChanged( qreal volume ) { emit volumeChanged( volume * 100 ); }
void timerTriggered( qint64 time );
void setCurrentTrack( const Tomahawk::result_ptr& result );
void onNowPlayingInfoReady();
void onPlaylistNextTrackReady();
void sendWaitingNotificationSlot() const;
void ioStreamError( QNetworkReply::NetworkError );
private:
void setState( AudioState state );
bool isHttpResult( const QString& ) const;
bool isLocalResult( const QString& ) const;
void sendWaitingNotification() const;
void sendNowPlayingNotification();
bool m_isPlayingHttp;
QSharedPointer<QIODevice> m_input;
Tomahawk::result_ptr m_currentTrack;
Tomahawk::result_ptr m_lastTrack;
QWeakPointer< Tomahawk::PlaylistInterface > m_playlist;
QWeakPointer< Tomahawk::PlaylistInterface > m_currentTrackPlaylist;
Tomahawk::PlaylistInterface* m_queue;
Tomahawk::playlistinterface_ptr m_playlist;
Tomahawk::playlistinterface_ptr m_currentTrackPlaylist;
Tomahawk::playlistinterface_ptr m_queue;
Phonon::MediaObject* m_mediaObject;
Phonon::AudioOutput* m_audioOutput;
@@ -162,10 +152,10 @@ private:
unsigned int m_timeElapsed;
bool m_expectStop;
bool m_waitingOnNewTrack;
bool m_infoSystemConnected;
mutable QStringList m_supportedMimeTypes;
AudioState m_state;
unsigned int m_volume;
static AudioEngine* s_instance;
};

View File

@@ -33,10 +33,12 @@ Collection::Collection( const source_ptr& source, const QString& name, QObject*
: QObject( parent )
, m_name( name )
, m_lastmodified( 0 )
, m_isLoaded( false )
, m_changed( false )
, m_source( source )
{
qDebug() << Q_FUNC_INFO << name << source->friendlyName();
connect( source.data(), SIGNAL( synced() ), SLOT( onSynced() ) );
}
@@ -147,24 +149,24 @@ Collection::deleteStation( const dynplaylist_ptr& s )
}
playlist_ptr
Tomahawk::playlist_ptr
Collection::playlist( const QString& guid )
{
return m_playlists.value( guid, playlist_ptr() );
return m_playlists.value( guid, Tomahawk::playlist_ptr() );
}
dynplaylist_ptr
Tomahawk::dynplaylist_ptr
Collection::autoPlaylist( const QString& guid )
{
return m_autoplaylists.value( guid, dynplaylist_ptr() );
return m_autoplaylists.value( guid, Tomahawk::dynplaylist_ptr() );
}
dynplaylist_ptr
Tomahawk::dynplaylist_ptr
Collection::station( const QString& guid )
{
return m_stations.value( guid, dynplaylist_ptr() );
return m_stations.value( guid, Tomahawk::dynplaylist_ptr() );
}
@@ -209,20 +211,32 @@ Collection::setStations( const QList< dynplaylist_ptr >& stations )
void
Collection::setTracks( const QList<unsigned int>& ids )
{
qDebug() << Q_FUNC_INFO << ids.count() << name();
tDebug() << Q_FUNC_INFO << ids.count() << name();
m_changed = true;
emit tracksAdded( ids );
emit changed();
}
void
Collection::delTracks( const QList<unsigned int>& ids )
{
qDebug() << Q_FUNC_INFO << ids.count() << name();
tDebug() << Q_FUNC_INFO << ids.count() << name();
m_changed = true;
emit tracksRemoved( ids );
emit changed();
}
void
Collection::onSynced()
{
tDebug() << Q_FUNC_INFO << m_changed;
if ( m_changed )
{
m_changed = false;
emit changed();
}
}

View File

@@ -49,8 +49,6 @@ public:
Collection( const source_ptr& source, const QString& name, QObject* parent = 0 );
virtual ~Collection();
virtual void setLoaded() { m_isLoaded = true; }
virtual bool isLoaded() const { return m_isLoaded; }
virtual QString name() const;
virtual void loadPlaylists() { qDebug() << Q_FUNC_INFO; }
@@ -107,8 +105,11 @@ protected:
QString m_name;
unsigned int m_lastmodified; // unix time of last change to collection
private slots:
void onSynced();
private:
bool m_isLoaded;
bool m_changed;
source_ptr m_source;
QHash< QString, Tomahawk::playlist_ptr > m_playlists;

View File

@@ -43,7 +43,7 @@ public:
virtual ~ContextPage() {}
virtual QGraphicsWidget* widget() = 0;
virtual Tomahawk::PlaylistInterface* playlistInterface() const = 0;
virtual Tomahawk::playlistinterface_ptr playlistInterface() const = 0;
virtual QString title() const = 0;
virtual QString description() const = 0;
@@ -52,7 +52,9 @@ public:
virtual bool jumpToCurrentTrack() = 0;
public slots:
virtual void setQuery( const Tomahawk::query_ptr& query ) = 0;
virtual void setArtist( const Tomahawk::artist_ptr& artist ) { Q_UNUSED( artist ); }
virtual void setAlbum( const Tomahawk::album_ptr& album ) { Q_UNUSED( album ); }
virtual void setQuery( const Tomahawk::query_ptr& query ) { Q_UNUSED( query ); }
signals:
void nameChanged( const QString& );

View File

@@ -33,6 +33,7 @@
#include "playlist/treemodel.h"
#include "utils/stylehelper.h"
#include "utils/tomahawkutilsgui.h"
#define ANIMATION_TIME 450
#define SLIDE_TIME 350
@@ -93,6 +94,7 @@ ContextWidget::ContextWidget( QWidget* parent )
setAutoFillBackground( true );
setFixedHeight( m_minHeight );
ensurePolished();
QPalette pal = palette();
pal.setBrush( QPalette::Window, StyleHelper::headerLowerColor() );
setPalette( pal );
@@ -113,6 +115,22 @@ ContextWidget::~ContextWidget()
}
void
ContextWidget::changeEvent( QEvent* e )
{
QWidget::changeEvent( e );
switch ( e->type() )
{
case QEvent::LanguageChange:
ui->retranslateUi( this );
break;
default:
break;
}
}
void
ContextWidget::layoutViews( bool animate )
{
@@ -212,6 +230,44 @@ ContextWidget::fadeOut( bool animate )
}
void
ContextWidget::setArtist( const Tomahawk::artist_ptr& artist )
{
if ( artist.isNull() )
return;
m_artist = artist;
if ( height() > m_minHeight )
{
foreach ( ContextProxyPage* proxy, m_pages )
{
proxy->page()->setArtist( artist );
}
layoutViews( true );
}
}
void
ContextWidget::setAlbum( const Tomahawk::album_ptr& album )
{
if ( album.isNull() )
return;
m_album = album;
if ( height() > m_minHeight )
{
foreach ( ContextProxyPage* proxy, m_pages )
{
proxy->page()->setAlbum( album );
}
layoutViews( true );
}
}
void
ContextWidget::setQuery( const Tomahawk::query_ptr& query, bool force )
{
@@ -275,6 +331,8 @@ ContextWidget::onAnimationFinished()
fadeOut( false );
m_scene->setSceneRect( ui->contextView->viewport()->rect() );
layoutViews( false );
setArtist( m_artist );
setAlbum( m_album );
setQuery( m_query, true );
ui->toggleButton->setText( tr( "Hide Footnotes" ) );

View File

@@ -50,6 +50,8 @@ public:
~ContextWidget();
public slots:
void setArtist( const Tomahawk::artist_ptr& artist );
void setAlbum( const Tomahawk::album_ptr& album );
void setQuery( const Tomahawk::query_ptr& query, bool force = false );
void toggleSize();
@@ -63,6 +65,7 @@ private slots:
protected:
void paintEvent( QPaintEvent* e );
void resizeEvent( QResizeEvent* e );
void changeEvent( QEvent* e );
private:
void fadeOut( bool animate );
@@ -81,6 +84,8 @@ private:
int m_currentView;
Tomahawk::artist_ptr m_artist;
Tomahawk::album_ptr m_album;
Tomahawk::query_ptr m_query;
bool m_visible;
};

View File

@@ -32,10 +32,13 @@ RelatedArtistsContext::RelatedArtistsContext()
{
m_relatedView = new ArtistView();
m_relatedView->setGuid( "RelatedArtistsContext" );
m_relatedView->setUpdatesContextView( false );
m_relatedModel = new TreeModel( m_relatedView );
m_relatedModel->setColumnStyle( TreeModel::TrackOnly );
m_relatedView->setTreeModel( m_relatedModel );
m_relatedView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
m_relatedView->setSortingEnabled( false );
m_relatedView->proxyModel()->sort( -1 );
QPalette pal = m_relatedView->palette();
pal.setColor( QPalette::Window, QColor( 0, 0, 0, 0 ) );
@@ -58,15 +61,17 @@ RelatedArtistsContext::~RelatedArtistsContext()
void
RelatedArtistsContext::setQuery( const Tomahawk::query_ptr& query )
RelatedArtistsContext::setArtist( const Tomahawk::artist_ptr& artist )
{
if ( !m_query.isNull() && query->artist() == m_query->artist() )
if ( artist.isNull() )
return;
if ( !m_artist.isNull() && m_artist->name() == artist->name() )
return;
m_query = query;
m_artist = artist;
Tomahawk::InfoSystem::InfoStringHash artistInfo;
artistInfo["artist"] = query->artist();
artistInfo["artist"] = artist->name();
Tomahawk::InfoSystem::InfoRequestData requestData;
requestData.caller = m_infoId;
@@ -78,6 +83,26 @@ RelatedArtistsContext::setQuery( const Tomahawk::query_ptr& query )
}
void
RelatedArtistsContext::setQuery( const Tomahawk::query_ptr& query )
{
if ( query.isNull() )
return;
setArtist( Artist::get( query->artist(), false ) );
}
void
RelatedArtistsContext::setAlbum( const Tomahawk::album_ptr& album )
{
if ( album.isNull() )
return;
setArtist( album->artist() );
}
void
RelatedArtistsContext::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
{
@@ -89,9 +114,9 @@ RelatedArtistsContext::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData req
if ( output.canConvert< QVariantMap >() )
{
if ( trackInfo["artist"] != m_query->artist() )
if ( trackInfo["artist"] != m_artist->name() )
{
qDebug() << "Returned info was for:" << trackInfo["artist"] << "- was looking for:" << m_query->artist();
qDebug() << "Returned info was for:" << trackInfo["artist"] << "- was looking for:" << m_artist->name();
return;
}
}

View File

@@ -23,6 +23,8 @@
#include "dllmacro.h"
#include "artist.h"
#include "album.h"
#include "query.h"
#include "context/ContextPage.h"
#include "infosystem/infosystem.h"
@@ -40,7 +42,7 @@ public:
virtual QGraphicsWidget* widget() { return m_proxy; }
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
virtual QString title() const { return tr( "Related Artists" ); }
virtual QString description() const { return QString(); }
@@ -48,6 +50,8 @@ public:
virtual bool jumpToCurrentTrack() { return false; }
public slots:
virtual void setArtist( const Tomahawk::artist_ptr& artist );
virtual void setAlbum( const Tomahawk::album_ptr& album );
virtual void setQuery( const Tomahawk::query_ptr& query );
private slots:
@@ -61,7 +65,7 @@ private:
QGraphicsProxyWidget* m_proxy;
QString m_infoId;
Tomahawk::query_ptr m_query;
Tomahawk::artist_ptr m_artist;
};
#endif // RELATEDARTISTSCONTEXT_H

View File

@@ -58,15 +58,17 @@ TopTracksContext::~TopTracksContext()
void
TopTracksContext::setQuery( const Tomahawk::query_ptr& query )
TopTracksContext::setArtist( const Tomahawk::artist_ptr& artist )
{
if ( !m_query.isNull() && query->artist() == m_query->artist() )
if ( artist.isNull() )
return;
if ( !m_artist.isNull() && m_artist->name() == artist->name() )
return;
m_query = query;
m_artist = artist;
Tomahawk::InfoSystem::InfoStringHash artistInfo;
artistInfo["artist"] = query->artist();
artistInfo["artist"] = artist->name();
Tomahawk::InfoSystem::InfoRequestData requestData;
requestData.caller = m_infoId;
@@ -78,6 +80,26 @@ TopTracksContext::setQuery( const Tomahawk::query_ptr& query )
}
void
TopTracksContext::setAlbum( const Tomahawk::album_ptr& album )
{
if ( album.isNull() )
return;
setArtist( album->artist() );
}
void
TopTracksContext::setQuery( const Tomahawk::query_ptr& query )
{
if ( query.isNull() )
return;
setArtist( Artist::get( query->artist(), false ) );
}
void
TopTracksContext::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
{
@@ -89,9 +111,9 @@ TopTracksContext::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestD
if ( output.canConvert< QVariantMap >() )
{
if ( trackInfo["artist"] != m_query->artist() )
if ( trackInfo["artist"] != m_artist->name() )
{
qDebug() << "Returned info was for:" << trackInfo["artist"] << "- was looking for:" << m_query->artist();
qDebug() << "Returned info was for:" << trackInfo["artist"] << "- was looking for:" << m_artist->name();
return;
}
}
@@ -107,7 +129,7 @@ TopTracksContext::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestD
int i = 0;
foreach ( const QString& track, tracks )
{
query_ptr query = Query::get( m_query->artist(), track, QString(), uuid() );
query_ptr query = Query::get( m_artist->name(), track, QString(), uuid() );
m_topHitsModel->append( query );
if ( ++i == 15 )

View File

@@ -23,6 +23,8 @@
#include "dllmacro.h"
#include "artist.h"
#include "album.h"
#include "query.h"
#include "context/ContextPage.h"
#include "infosystem/infosystem.h"
@@ -40,7 +42,7 @@ public:
virtual QGraphicsWidget* widget() { return m_proxy; }
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
virtual QString title() const { return tr( "Top Hits" ); }
virtual QString description() const { return QString(); }
@@ -48,6 +50,8 @@ public:
virtual bool jumpToCurrentTrack() { return false; }
public slots:
virtual void setArtist( const Tomahawk::artist_ptr& artist );
virtual void setAlbum( const Tomahawk::album_ptr& album );
virtual void setQuery( const Tomahawk::query_ptr& query );
private slots:
@@ -61,7 +65,7 @@ private:
QGraphicsProxyWidget* m_proxy;
QString m_infoId;
Tomahawk::query_ptr m_query;
Tomahawk::artist_ptr m_artist;
};
#endif // TOPTRACKSCONTEXT_H

View File

@@ -22,22 +22,69 @@ using namespace Tomahawk;
void
WikipediaContext::setQuery( const Tomahawk::query_ptr& query )
WikipediaContext::setArtist( const Tomahawk::artist_ptr& artist )
{
if ( !m_query.isNull() && query->artist() == m_query->artist() )
if ( artist.isNull() )
return;
if ( !m_artist.isNull() && m_artist->name() == artist->name() )
return;
m_query = query;
webView()->load( QString( "http://en.wikipedia.org/w/index.php?useformat=mobile&title=%1" ).arg( query->artist() ) );
m_artist = artist;
QString lang = QLocale::system().name().split("_").first();
webView()->load( QString( "http://%1.wikipedia.org/w/index.php?useformat=mobile&title=%2" ).arg( lang ).arg( m_artist->name() ) );
}
void
WikipediaContext::setAlbum( const Tomahawk::album_ptr& album )
{
if ( album.isNull() )
return;
setArtist( album->artist() );
}
void
WikipediaContext::setQuery( const Tomahawk::query_ptr& query )
{
if ( query.isNull() )
return;
setArtist( Artist::get( query->artist(), false ) );
}
void
LastfmContext::setArtist( const Tomahawk::artist_ptr& artist )
{
if ( artist.isNull() )
return;
if ( !m_artist.isNull() && m_artist->name() == artist->name() )
return;
m_artist = artist;
webView()->load( QString( "http://last.fm/music/%1" ).arg( m_artist->name() ) );
}
void
LastfmContext::setAlbum( const Tomahawk::album_ptr& album )
{
if ( album.isNull() )
return;
setArtist( album->artist() );
}
void
LastfmContext::setQuery( const Tomahawk::query_ptr& query )
{
if ( !m_query.isNull() && query->artist() == m_query->artist() )
if ( query.isNull() )
return;
m_query = query;
webView()->load( QString( "http://last.fm/music/%1" ).arg( query->artist() ) );
setArtist( Artist::get( query->artist(), false ) );
}

View File

@@ -23,6 +23,8 @@
#include "dllmacro.h"
#include "artist.h"
#include "album.h"
#include "query.h"
#include "WebContext.h"
@@ -34,7 +36,7 @@ public:
WikipediaContext() : WebContext() {}
~WikipediaContext() {}
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
virtual QString title() const { return tr( "Wikipedia" ); }
virtual QString description() const { return QString(); }
@@ -42,10 +44,12 @@ public:
virtual bool jumpToCurrentTrack() { return false; }
public slots:
virtual void setArtist( const Tomahawk::artist_ptr& artist );
virtual void setAlbum( const Tomahawk::album_ptr& album );
virtual void setQuery( const Tomahawk::query_ptr& query );
private:
Tomahawk::query_ptr m_query;
Tomahawk::artist_ptr m_artist;
};
@@ -57,7 +61,7 @@ public:
LastfmContext() : WebContext() {}
~LastfmContext() {}
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
virtual QString title() const { return tr( "Last.fm" ); }
virtual QString description() const { return QString(); }
@@ -65,10 +69,12 @@ public:
virtual bool jumpToCurrentTrack() { return false; }
public slots:
virtual void setArtist( const Tomahawk::artist_ptr& artist );
virtual void setAlbum( const Tomahawk::album_ptr& album );
virtual void setQuery( const Tomahawk::query_ptr& query );
private:
Tomahawk::query_ptr m_query;
Tomahawk::artist_ptr m_artist;
};
#endif // WIKIPEDIACONTEXT_H

View File

@@ -32,15 +32,19 @@ using namespace Tomahawk;
ContextMenu::ContextMenu( QWidget* parent )
: QMenu( parent )
, m_loveAction( 0 )
{
m_sigmap = new QSignalMapper( this );
connect( m_sigmap, SIGNAL( mapped( int ) ), SLOT( onTriggered( int ) ) );
m_supportedActions = ActionPlay | ActionQueue | ActionCopyLink;
m_supportedActions = ActionPlay | ActionQueue | ActionCopyLink | ActionLove;
}
ContextMenu::~ContextMenu()
{}
{
}
void
ContextMenu::clear()
@@ -50,23 +54,22 @@ ContextMenu::clear()
m_queries.clear();
m_albums.clear();
m_artists.clear();
}
unsigned int
ContextMenu::itemCount() const
{
return m_queries.count() + m_artists.count() + m_albums.count();
return m_queries.count() + m_artists.count() + m_albums.count();
}
void
ContextMenu::setQueries( const QList<Tomahawk::query_ptr>& queries )
{
if ( queries.isEmpty() )
return;
QMenu::clear();
m_queries.clear();
m_queries << queries;
@@ -79,19 +82,26 @@ ContextMenu::setQueries( const QList<Tomahawk::query_ptr>& queries )
addSeparator();
if ( m_supportedActions & ActionLove && itemCount() == 1 )
{
m_loveAction = addAction( tr( "&Love" ) );
m_sigmap->setMapping( m_loveAction, ActionLove );
connect( queries.first().data(), SIGNAL( socialActionsLoaded() ), SLOT( onSocialActionsLoaded() ) );
m_queries.first()->loadSocialActions();
onSocialActionsLoaded();
}
if ( m_supportedActions & ActionCopyLink && itemCount() == 1 )
m_sigmap->setMapping( addAction( tr( "Copy Track &Link" ) ), ActionCopyLink );
m_sigmap->setMapping( addAction( tr( "&Copy Track Link" ) ), ActionCopyLink );
addSeparator();
if ( m_supportedActions & ActionDelete )
m_sigmap->setMapping( addAction( queries.count() > 1 ? tr( "&Delete Items" ) : tr( "&Delete Item" ) ), ActionDelete );
foreach ( QAction* action, actions() )
{
connect( action, SIGNAL( triggered() ), m_sigmap, SLOT( map() ) );
}
}
@@ -107,7 +117,6 @@ ContextMenu::setQuery( const Tomahawk::query_ptr& query )
}
void
ContextMenu::setAlbums( const QList<Tomahawk::album_ptr>& albums )
{
@@ -119,7 +128,7 @@ ContextMenu::setAlbums( const QList<Tomahawk::album_ptr>& albums )
m_albums << albums;
if ( m_supportedActions & ActionPlay && itemCount() == 1 )
m_sigmap->setMapping( addAction( tr( "&Play" ) ), ActionPlay );
m_sigmap->setMapping( addAction( tr( "Show &Album page" ) ), ActionPlay );
if ( m_supportedActions & ActionQueue )
m_sigmap->setMapping( addAction( tr( "Add to &Queue" ) ), ActionQueue );
@@ -158,7 +167,7 @@ ContextMenu::setArtists( const QList<Tomahawk::artist_ptr>& artists )
m_artists << artists;
if ( m_supportedActions & ActionPlay && itemCount() == 1 )
m_sigmap->setMapping( addAction( tr( "&Play" ) ), ActionPlay );
m_sigmap->setMapping( addAction( tr( "Show &Artist page" ) ), ActionPlay );
if ( m_supportedActions & ActionQueue )
m_sigmap->setMapping( addAction( tr( "Add to &Queue" ) ), ActionQueue );
@@ -185,6 +194,7 @@ ContextMenu::setArtist( const Tomahawk::artist_ptr& artist )
setArtists( artists );
}
void
ContextMenu::onTriggered( int action )
{
@@ -198,6 +208,10 @@ ContextMenu::onTriggered( int action )
copyLink();
break;
case ActionLove:
m_queries.first()->setLoved( !m_queries.first()->loved() );
break;
default:
emit triggered( action );
}
@@ -205,7 +219,8 @@ ContextMenu::onTriggered( int action )
void ContextMenu::addToQueue()
void
ContextMenu::addToQueue()
{
foreach ( const query_ptr& query, m_queries )
{
@@ -232,3 +247,19 @@ ContextMenu::copyLink()
GlobalActionManager::instance()->copyToClipboard( m_queries.first() );
}
}
void
ContextMenu::onSocialActionsLoaded()
{
if ( m_queries.first()->loved() )
{
m_loveAction->setText( tr( "Un-&Love" ) );
m_loveAction->setIcon( QIcon( RESPATH "images/not-loved.png" ) );
}
else
{
m_loveAction->setText( tr( "&Love" ) );
m_loveAction->setIcon( QIcon( RESPATH "images/loved.png" ) );
}
}

View File

@@ -19,8 +19,8 @@
#ifndef CONTEXTMENU_H
#define CONTEXTMENU_H
#include <QSignalMapper>
#include <QMenu>
#include <QtCore/QSignalMapper>
#include <QtGui/QMenu>
#include "typedefs.h"
#include "dllmacro.h"
@@ -38,8 +38,8 @@ public:
ActionPlay = 1,
ActionQueue = 2,
ActionDelete = 4,
ActionCopyLink = 8
ActionCopyLink = 8,
ActionLove = 16
};
explicit ContextMenu( QWidget* parent = 0 );
@@ -69,10 +69,14 @@ private slots:
void copyLink();
void addToQueue();
void onSocialActionsLoaded();
private:
QSignalMapper* m_sigmap;
int m_supportedActions;
QAction* m_loveAction;
QList<Tomahawk::query_ptr> m_queries;
QList<Tomahawk::artist_ptr> m_artists;
QList<Tomahawk::album_ptr> m_albums;

View File

@@ -73,7 +73,15 @@ Database::loadIndex()
void
Database::enqueue( QSharedPointer<DatabaseCommand> lc )
Database::enqueue( const QList< QSharedPointer<DatabaseCommand> >& lc )
{
qDebug() << "Enqueueing" << lc.count() << "commands to rw thread";
m_workerRW->enqueue( lc );
}
void
Database::enqueue( const QSharedPointer<DatabaseCommand>& lc )
{
if ( lc->doesMutates() )
{

View File

@@ -66,7 +66,8 @@ signals:
void newJobRW( QSharedPointer<DatabaseCommand> );
public slots:
void enqueue( QSharedPointer<DatabaseCommand> lc );
void enqueue( const QSharedPointer<DatabaseCommand>& lc );
void enqueue( const QList< QSharedPointer<DatabaseCommand> >& lc );
private slots:
void setIsReadyTrue() { m_ready = true; }

View File

@@ -69,22 +69,8 @@ DatabaseCollection::loadStations()
connect( cmd, SIGNAL( stationLoaded( Tomahawk::source_ptr, QVariantList ) ),
SLOT( stationCreated( const Tomahawk::source_ptr&, const QVariantList& ) ) );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );}
/*void
DatabaseCollection::loadTracks()
{
qDebug() << Q_FUNC_INFO << source()->userName();
setLoaded();
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( source()->collection() );
connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ),
SLOT( setTracks( QList<Tomahawk::query_ptr> ) ) );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
}*/
}
void
@@ -143,19 +129,8 @@ DatabaseCollection::stations()
}
/*QList< Tomahawk::query_ptr >
DatabaseCollection::tracks()
{
if ( !isLoaded() )
{
loadTracks();
}
return Collection::tracks();
}*/
void DatabaseCollection::autoPlaylistCreated( const source_ptr& source, const QVariantList& data )
void
DatabaseCollection::autoPlaylistCreated( const source_ptr& source, const QVariantList& data )
{
dynplaylist_ptr p( new DynamicPlaylist( source, //src
data[0].toString(), //current rev
@@ -167,12 +142,13 @@ void DatabaseCollection::autoPlaylistCreated( const source_ptr& source, const QV
static_cast<GeneratorMode>(data[6].toInt()), // dynamic mode
data[7].toBool(), //shared
data[8].toInt(), //lastmod
data[9].toString() ) ); //GUID
data[9].toString() ), &QObject::deleteLater ); //GUID
addAutoPlaylist( p );
}
void DatabaseCollection::stationCreated( const source_ptr& source, const QVariantList& data )
void
DatabaseCollection::stationCreated( const source_ptr& source, const QVariantList& data )
{
dynplaylist_ptr p( new DynamicPlaylist( source, //src
data[0].toString(), //current rev
@@ -184,7 +160,7 @@ void DatabaseCollection::stationCreated( const source_ptr& source, const QVarian
static_cast<GeneratorMode>(data[6].toInt()), // dynamic mode
data[7].toBool(), //shared
data[8].toInt(), //lastmod
data[9].toString() ) ); //GUID
data[9].toString() ), &QObject::deleteLater ); //GUID
addStation( p );
}

View File

@@ -80,12 +80,14 @@ DatabaseCommand::setSource( const Tomahawk::source_ptr& s )
m_source = s;
}
const Tomahawk::source_ptr&
DatabaseCommand::source() const
{
return m_source;
}
DatabaseCommand*
DatabaseCommand::factory( const QVariant& op, const source_ptr& source )
{
@@ -139,7 +141,8 @@ DatabaseCommand::factory( const QVariant& op, const source_ptr& source )
cmd->setSource( source );
QJson::QObjectHelper::qvariant2qobject( op.toMap(), cmd );
return cmd;
} else if( name == "createdynamicplaylist" )
}
else if( name == "createdynamicplaylist" )
{
DatabaseCommand_CreateDynamicPlaylist * cmd = new DatabaseCommand_CreateDynamicPlaylist;
cmd->setSource( source );
@@ -183,7 +186,7 @@ DatabaseCommand::factory( const QVariant& op, const source_ptr& source )
return cmd;
}
qDebug() << "ERROR in" << Q_FUNC_INFO << name;
qDebug() << "Unknown database command" << name;
// Q_ASSERT( false );
return NULL;
}

View File

@@ -70,6 +70,7 @@ public:
const Tomahawk::source_ptr& source() const;
virtual bool loggable() const { return false; }
virtual bool groupable() const { return false; }
virtual bool singletonCmd() const { return false; }
virtual bool localOnly() const { return false; }

View File

@@ -24,7 +24,6 @@
#include "album.h"
#include "collection.h"
#include "database/database.h"
#include "databasecommand_collectionstats.h"
#include "databaseimpl.h"
#include "network/dbsyncconnection.h"
#include "network/servent.h"
@@ -56,32 +55,17 @@ DatabaseCommand_AddFiles::files() const
void
DatabaseCommand_AddFiles::postCommitHook()
{
if ( source().isNull() || source()->collection().isNull() )
{
qDebug() << "Source has gone offline, not emitting to GUI.";
return;
}
// make the collection object emit its tracksAdded signal, so the
// collection browser will update/fade in etc.
Collection* coll = source()->collection().data();
connect( this, SIGNAL( notify( QList<unsigned int> ) ),
coll, SLOT( setTracks( QList<unsigned int> ) ),
Qt::QueuedConnection );
coll, SLOT( setTracks( QList<unsigned int> ) ), Qt::QueuedConnection );
emit notify( m_ids );
if ( source()->isLocal() )
{
Servent::instance()->triggerDBSync();
// Re-calculate local db stats
DatabaseCommand_CollectionStats* cmd = new DatabaseCommand_CollectionStats( SourceList::instance()->getLocal() );
connect( cmd, SIGNAL( done( QVariantMap ) ),
SourceList::instance()->getLocal().data(), SLOT( setStats( QVariantMap ) ), Qt::QueuedConnection );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
}
}
@@ -94,24 +78,23 @@ DatabaseCommand_AddFiles::exec( DatabaseImpl* dbi )
TomahawkSqlQuery query_file = dbi->newquery();
TomahawkSqlQuery query_filejoin = dbi->newquery();
TomahawkSqlQuery query_trackattr = dbi->newquery();
TomahawkSqlQuery query_file_del = dbi->newquery();
query_file.prepare( "INSERT INTO file(source, url, size, mtime, md5, mimetype, duration, bitrate) VALUES (?, ?, ?, ?, ?, ?, ?, ?)" );
query_filejoin.prepare( "INSERT INTO file_join(file, artist, album, track, albumpos) VALUES (?, ?, ?, ?, ?)" );
query_filejoin.prepare( "INSERT INTO file_join(file, artist, album, track, albumpos, composer, discnumber) VALUES (?, ?, ?, ?, ?, ?, ?)" );
query_trackattr.prepare( "INSERT INTO track_attributes(id, k, v) VALUES (?, ?, ?)" );
query_file_del.prepare( QString( "DELETE FROM file WHERE source %1 AND url = ?" )
.arg( source()->isLocal() ? "IS NULL" : QString( "= %1" ).arg( source()->id() ) ) );
int added = 0;
QVariant srcid = source()->isLocal() ? QVariant( QVariant::Int ) : source()->id();
qDebug() << "Adding" << m_files.length() << "files to db for source" << srcid;
QList<QVariant>::iterator it;
for( it = m_files.begin(); it != m_files.end(); ++it )
for ( it = m_files.begin(); it != m_files.end(); ++it )
{
QVariant& v = *it;
QVariantMap m = v.toMap();
int fileid = 0, artistid = 0, albumid = 0, trackid = 0, composerid = 0;
QString url = m.value( "url" ).toString();
int mtime = m.value( "mtime" ).toInt();
uint size = m.value( "size" ).toUInt();
@@ -123,12 +106,10 @@ DatabaseCommand_AddFiles::exec( DatabaseImpl* dbi )
QString album = m.value( "album" ).toString();
QString track = m.value( "track" ).toString();
uint albumpos = m.value( "albumpos" ).toUInt();
QString composer = m.value( "composer" ).toString();
uint discnumber = m.value( "discnumber" ).toUInt();
int year = m.value( "year" ).toInt();
int fileid = 0, artistid = 0, albumid = 0, trackid = 0;
query_file_del.bindValue( 0, url );
query_file_del.exec();
query_file.bindValue( 0, srcid );
query_file.bindValue( 1, url );
query_file.bindValue( 2, size );
@@ -137,28 +118,17 @@ DatabaseCommand_AddFiles::exec( DatabaseImpl* dbi )
query_file.bindValue( 5, mimetype );
query_file.bindValue( 6, duration );
query_file.bindValue( 7, bitrate );
if( !query_file.exec() )
{
qDebug() << "Failed to insert to file:"
<< query_file.lastError().databaseText()
<< query_file.lastError().driverText()
<< query_file.boundValues();
continue;
}
else
{
if( added % 1000 == 0 )
qDebug() << "Inserted" << added;
}
query_file.exec();
if ( added % 1000 == 0 )
qDebug() << "Inserted" << added;
// get internal IDs for art/alb/trk
fileid = query_file.lastInsertId().toInt();
m.insert( "id", fileid );
// this is the qvariant(map) the remote will get
v = m;
if( !source()->isLocal() )
url = QString( "servent://%1\t%2" ).arg( source()->userName() ).arg( url );
artistid = dbi->artistId( artist, true );
if ( artistid < 1 )
continue;
@@ -167,12 +137,17 @@ DatabaseCommand_AddFiles::exec( DatabaseImpl* dbi )
continue;
albumid = dbi->albumId( artistid, album, true );
if( !composer.trimmed().isEmpty() )
composerid = dbi->artistId( composer, true );
// Now add the association
query_filejoin.bindValue( 0, fileid );
query_filejoin.bindValue( 1, artistid );
query_filejoin.bindValue( 2, albumid > 0 ? albumid : QVariant( QVariant::Int ) );
query_filejoin.bindValue( 3, trackid );
query_filejoin.bindValue( 4, albumpos );
query_filejoin.bindValue( 5, composerid > 0 ? composerid : QVariant( QVariant::Int ) );
query_filejoin.bindValue( 6, discnumber );
if ( !query_filejoin.exec() )
{
qDebug() << "Error inserting into file_join table";
@@ -184,33 +159,6 @@ DatabaseCommand_AddFiles::exec( DatabaseImpl* dbi )
query_trackattr.bindValue( 2, year );
query_trackattr.exec();
/* QVariantMap attr;
Tomahawk::query_ptr query = Tomahawk::Query::get( artist, track, album );
attr["releaseyear"] = m.value( "year" );
Tomahawk::artist_ptr artistptr = Tomahawk::Artist::get( artistid, artist );
Tomahawk::album_ptr albumptr = Tomahawk::Album::get( albumid, album, artistptr );
Tomahawk::result_ptr result = Tomahawk::Result::get( url );
result->setModificationTime( mtime );
result->setSize( size );
result->setMimetype( mimetype );
result->setDuration( duration );
result->setBitrate( bitrate );
result->setArtist( artistptr );
result->setAlbum( albumptr );
result->setTrack( track );
result->setAlbumPos( albumpos );
result->setAttributes( attr );
result->setCollection( source()->collection() );
result->setScore( 1.0 );
result->setId( trackid );
QList<Tomahawk::result_ptr> results;
results << result;
query->addResults( results );
m_queries << query;*/
m_ids << fileid;
added++;
}
@@ -219,6 +167,6 @@ DatabaseCommand_AddFiles::exec( DatabaseImpl* dbi )
if ( added )
source()->updateIndexWhenSynced();
qDebug() << "Committing" << added << "tracks...";
tDebug() << "Committing" << added << "tracks...";
emit done( m_files, source()->collection() );
}

View File

@@ -35,20 +35,21 @@ DatabaseCommand_addSource::DatabaseCommand_addSource( const QString& username, c
void
DatabaseCommand_addSource::exec( DatabaseImpl* dbi )
{
Q_ASSERT( !m_fname.isEmpty() );
TomahawkSqlQuery query = dbi->newquery();
query.prepare( "SELECT id, friendlyname FROM source WHERE name = ?" );
query.prepare( "SELECT id FROM source WHERE name = ?" );
query.addBindValue( m_username );
query.exec();
if ( query.next() )
{
unsigned int id = query.value( 0 ).toInt();
QString fname = query.value( 1 ).toString();
query.prepare( "UPDATE source SET isonline = 'true', friendlyname = ? WHERE id = ?" );
query.addBindValue( m_fname );
query.addBindValue( id );
query.exec();
emit done( id, fname );
emit done( id, m_fname );
return;
}
@@ -59,7 +60,7 @@ DatabaseCommand_addSource::exec( DatabaseImpl* dbi )
query.exec();
unsigned int id = query.lastInsertId().toUInt();
qDebug() << "Inserted new source to DB, id:" << id << " friendlyname" << m_username;
tDebug() << "Inserted new source to DB, id:" << id << "friendlyname" << m_username;
emit done( id, m_fname );
}

View File

@@ -23,6 +23,7 @@
#include <QVariantMap>
#include "artist.h"
#include "collection.h"
#include "typedefs.h"
#include "databasecommand.h"

View File

@@ -40,7 +40,7 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
break;
case Album:
m_orderToken = "album.name, file_join.albumpos";
m_orderToken = "album.name, file_join.discnumber, file_join.albumpos";
break;
case ModificationTime:
@@ -48,7 +48,7 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
break;
case AlbumPosition:
m_orderToken = "file_join.albumpos";
m_orderToken = "file_join.discnumber, file_join.albumpos";
break;
}
@@ -60,7 +60,7 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
{
if ( m_album->id() == 0 )
{
m_artist = m_album->artist().data();
m_artist = m_album->artist();
albumToken = QString( "AND album.id IS NULL" );
}
else
@@ -68,11 +68,15 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
}
QString sql = QString(
"SELECT file.id, artist.name, album.name, track.name, file.size, "
"file.duration, file.bitrate, file.url, file.source, file.mtime, file.mimetype, file_join.albumpos, artist.id, album.id, track.id "
"SELECT file.id, artist.name, album.name, track.name, composer.name, file.size, " //0
"file.duration, file.bitrate, file.url, file.source, file.mtime, " //6
"file.mimetype, file_join.discnumber, file_join.albumpos, artist.id, " //11
"album.id, track.id, composer.id " //15
"FROM file, artist, track, file_join "
"LEFT OUTER JOIN album "
"ON file_join.album = album.id "
"LEFT OUTER JOIN artist AS composer "
"ON file_join.composer = composer.id "
"WHERE file.id = file_join.file "
"AND file_join.artist = artist.id "
"AND file_join.track = track.id "
@@ -92,15 +96,15 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
while( query.next() )
{
Tomahawk::source_ptr s;
QString url = query.value( 7 ).toString();
QString url = query.value( 8 ).toString();
if ( query.value( 8 ).toUInt() == 0 )
if ( query.value( 9 ).toUInt() == 0 )
{
s = SourceList::instance()->getLocal();
}
else
{
s = SourceList::instance()->get( query.value( 8 ).toUInt() );
s = SourceList::instance()->get( query.value( 9 ).toUInt() );
if ( s.isNull() )
{
Q_ASSERT( false );
@@ -110,26 +114,30 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
url = QString( "servent://%1\t%2" ).arg( s->userName() ).arg( url );
}
QString artist, track, album;
QString artist, track, album, composer;
artist = query.value( 1 ).toString();
album = query.value( 2 ).toString();
track = query.value( 3 ).toString();
composer = query.value( 4 ).toString();
Tomahawk::result_ptr result = Tomahawk::Result::get( url );
Tomahawk::query_ptr qry = Tomahawk::Query::get( artist, track, album );
Tomahawk::artist_ptr artistptr = Tomahawk::Artist::get( query.value( 12 ).toUInt(), artist );
Tomahawk::album_ptr albumptr = Tomahawk::Album::get( query.value( 13 ).toUInt(), album, artistptr );
Tomahawk::artist_ptr artistptr = Tomahawk::Artist::get( query.value( 14 ).toUInt(), artist );
Tomahawk::artist_ptr composerptr = Tomahawk::Artist::get( query.value( 17 ).toUInt(), composer );
Tomahawk::album_ptr albumptr = Tomahawk::Album::get( query.value( 15 ).toUInt(), album, artistptr );
result->setTrackId( query.value( 14 ).toUInt() );
result->setTrackId( query.value( 16 ).toUInt() );
result->setArtist( artistptr );
result->setAlbum( albumptr );
result->setTrack( query.value( 3 ).toString() );
result->setSize( query.value( 4 ).toUInt() );
result->setDuration( query.value( 5 ).toUInt() );
result->setBitrate( query.value( 6 ).toUInt() );
result->setModificationTime( query.value( 9 ).toUInt() );
result->setMimetype( query.value( 10 ).toString() );
result->setAlbumPos( query.value( 11 ).toUInt() );
result->setComposer( composerptr );
result->setSize( query.value( 5 ).toUInt() );
result->setDuration( query.value( 6 ).toUInt() );
result->setBitrate( query.value( 7 ).toUInt() );
result->setModificationTime( query.value( 10 ).toUInt() );
result->setMimetype( query.value( 11 ).toString() );
result->setDiscNumber( query.value( 12 ).toUInt() );
result->setAlbumPos( query.value( 13 ).toUInt() );
result->setScore( 1.0 );
result->setCollection( s->collection() );

View File

@@ -26,6 +26,8 @@
#include "collection.h"
#include "typedefs.h"
#include "query.h"
#include "artist.h"
#include "album.h"
#include "dllmacro.h"
@@ -55,8 +57,8 @@ public:
virtual bool doesMutates() const { return false; }
virtual QString commandname() const { return "alltracks"; }
void setArtist( Tomahawk::Artist* artist ) { m_artist = artist; }
void setAlbum( Tomahawk::Album* album ) { m_album = album; }
void setArtist( const Tomahawk::artist_ptr& artist ) { m_artist = artist; }
void setAlbum( const Tomahawk::album_ptr& album ) { m_album = album; }
void setLimit( unsigned int amount ) { m_amount = amount; }
void setSortOrder( DatabaseCommand_AllTracks::SortOrder order ) { m_sortOrder = order; }
@@ -69,8 +71,8 @@ signals:
private:
Tomahawk::collection_ptr m_collection;
Tomahawk::Artist* m_artist;
Tomahawk::Album* m_album;
Tomahawk::artist_ptr m_artist;
Tomahawk::album_ptr m_album;
unsigned int m_amount;
DatabaseCommand_AllTracks::SortOrder m_sortOrder;

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.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
@@ -28,10 +28,13 @@
#include "dynamic/GeneratorInterface.h"
#include "source.h"
#include "viewmanager.h"
#include "network/servent.h"
#include "utils/logger.h"
#ifndef ENABLE_HEADLESS
#include "viewmanager.h"
#endif
using namespace Tomahawk;
@@ -111,11 +114,13 @@ DatabaseCommand_CreateDynamicPlaylist::postCommitHook()
qDebug() << Q_FUNC_INFO << "..reporting..";
if( m_playlist.isNull() ) {
source_ptr src = source();
#ifndef ENABLE_HEADLESS
QMetaObject::invokeMethod( ViewManager::instance(),
"createDynamicPlaylist",
Qt::BlockingQueuedConnection,
QGenericArgument( "Tomahawk::source_ptr", (const void*)&src ),
Q_ARG( QVariant, m_v ) );
#endif
} else {
m_playlist->reportCreated( m_playlist );
}

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.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

View File

@@ -21,12 +21,15 @@
#include <QSqlQuery>
#include "source.h"
#include "viewmanager.h"
#include "databaseimpl.h"
#include "tomahawksqlquery.h"
#include "network/servent.h"
#include "utils/logger.h"
#ifndef ENABLE_HEADLESS
#include "viewmanager.h"
#endif
using namespace Tomahawk;
@@ -79,11 +82,13 @@ DatabaseCommand_CreatePlaylist::postCommitHook()
if ( m_playlist.isNull() )
{
source_ptr src = source();
#ifndef ENABLE_HEADLESS
QMetaObject::invokeMethod( ViewManager::instance(),
"createPlaylist",
Qt::BlockingQueuedConnection,
QGenericArgument( "Tomahawk::source_ptr", (const void*)&src ),
Q_ARG( QVariant, m_v ) );
#endif
}
else
{

View File

@@ -18,15 +18,14 @@
#include "databasecommand_deletefiles.h"
#include <QSqlQuery>
#include <QtSql/QSqlQuery>
#include "artist.h"
#include "album.h"
#include "collection.h"
#include "source.h"
#include "database/database.h"
#include "databasecommand_collectionstats.h"
#include "databaseimpl.h"
#include "database/databaseimpl.h"
#include "network/servent.h"
#include "utils/logger.h"
#include "utils/tomahawkutils.h"
@@ -38,7 +37,7 @@ using namespace Tomahawk;
void
DatabaseCommand_DeleteFiles::postCommitHook()
{
if ( !m_files.count() )
if ( !m_idList.count() )
return;
// make the collection object emit its tracksAdded signal, so the
@@ -48,13 +47,10 @@ DatabaseCommand_DeleteFiles::postCommitHook()
connect( this, SIGNAL( notify( QList<unsigned int> ) ),
coll, SLOT( delTracks( QList<unsigned int> ) ), Qt::QueuedConnection );
tDebug() << "Notifying of deleted tracks:" << m_ids.size() << "from source" << source()->id();
QList<unsigned int> ids;
foreach ( QVariant id, m_ids )
ids << id.toUInt();
emit notify( ids );
tDebug() << "Notifying of deleted tracks:" << m_idList.size() << "from source" << source()->id();
emit notify( m_idList );
if( source()->isLocal() )
if ( source()->isLocal() )
Servent::instance()->triggerDBSync();
}
@@ -64,113 +60,80 @@ DatabaseCommand_DeleteFiles::exec( DatabaseImpl* dbi )
{
Q_ASSERT( !source().isNull() );
QVariant srcid = source()->isLocal() ? QVariant( QVariant::Int ) : source()->id();
int srcid = source()->isLocal() ? 0 : source()->id();
TomahawkSqlQuery delquery = dbi->newquery();
QString lastPath;
if ( source()->isLocal() )
if ( m_deleteAll )
{
TomahawkSqlQuery dirquery = dbi->newquery();
dirquery.prepare( QString( "SELECT id FROM file WHERE source %1" )
.arg( source()->isLocal() ? "IS NULL" : QString( "= %1" ).arg( source()->id() ) ) );
dirquery.exec();
while ( dirquery.next() )
m_idList << dirquery.value( 0 ).toUInt();
}
else if ( source()->isLocal() )
{
if ( m_dir.path() != QString( "." ) )
{
tDebug() << "Deleting" << m_dir.path() << "from db for localsource" << srcid;
TomahawkSqlQuery dirquery = dbi->newquery();
QString path( "file://" + m_dir.canonicalPath() + "/%" );
dirquery.prepare( QString( "SELECT id, url FROM file WHERE source IS NULL AND url LIKE '%1'" ).arg( TomahawkUtils::sqlEscape( path ) ) );
dirquery.prepare( QString( "SELECT id FROM file WHERE source IS NULL AND url LIKE '%1'" ).arg( TomahawkUtils::sqlEscape( path ) ) );
dirquery.exec();
while ( dirquery.next() )
{
QFileInfo fi( dirquery.value( 1 ).toString().mid( 7 ) ); // remove file://
if ( fi.canonicalPath() != m_dir.canonicalPath() )
{
if ( lastPath != fi.canonicalPath() )
tDebug() << "Skipping subdir:" << fi.canonicalPath();
lastPath = fi.canonicalPath();
continue;
}
m_files << dirquery.value( 1 ).toString();
m_ids << dirquery.value( 0 ).toUInt();
m_ids << dirquery.value( 0 );
m_idList << dirquery.value( 0 ).toUInt();
}
}
else if ( !m_ids.isEmpty() )
{
tDebug() << Q_FUNC_INFO << "deleting given ids";
TomahawkSqlQuery dirquery = dbi->newquery();
QString idstring;
foreach( const QVariant& id, m_ids )
idstring.append( id.toString() + ", " );
idstring.chop( 2 ); //remove the trailing ", "
dirquery.prepare( QString( "SELECT id, url FROM file WHERE source IS NULL AND id IN ( %1 )" ).arg( idstring ) );
dirquery.exec();
while ( dirquery.next() )
{
m_files << dirquery.value( 1 ).toString();
}
foreach ( const QVariant& id, m_ids )
m_idList << id.toUInt();
}
else if ( m_deleteAll )
{
TomahawkSqlQuery dirquery = dbi->newquery();
dirquery.prepare( QString( "SELECT id, url FROM file WHERE source IS NULL" ) );
dirquery.exec();
while ( dirquery.next() )
{
m_ids << dirquery.value( 0 ).toString();
m_files << dirquery.value( 1 ).toString();
}
}
}
else
{
if ( m_deleteAll )
{
TomahawkSqlQuery dirquery = dbi->newquery();
dirquery.prepare( QString( "SELECT url FROM file WHERE source = %1" ).arg( source()->id() ) );
dirquery.exec();
while ( dirquery.next() )
m_ids << dirquery.value( 0 ).toString();
}
foreach( const QVariant& id, m_ids )
m_files << QString( "servent://%1\t%2" ).arg( source()->userName() ).arg( id.toString() );
}
if ( m_deleteAll )
{
if ( !m_ids.isEmpty() )
{
delquery.prepare( QString( "DELETE FROM file WHERE source %1" )
.arg( source()->isLocal() ? "IS NULL" : QString( "= %1" ).arg( source()->id() ) ) );
delquery.exec();
}
delquery.prepare( QString( "DELETE FROM file WHERE source %1" )
.arg( source()->isLocal() ? "IS NULL" : QString( "= %1" ).arg( source()->id() ) ) );
delquery.exec();
}
else if ( !m_ids.isEmpty() )
{
delquery.prepare( QString( "DELETE FROM file WHERE source %1 AND %2 IN ( ? )" )
.arg( source()->isLocal() ? "IS NULL" : QString( "= %1" ).arg( source()->id() ) )
.arg( source()->isLocal() ? "id" : "url" ) );
QString idstring;
foreach( const QVariant& id, m_ids )
foreach ( const QVariant& id, m_ids )
idstring.append( id.toString() + ", " );
idstring.chop( 2 ); //remove the trailing ", "
delquery.prepare( QString( "DELETE FROM file WHERE source %1 AND %2 IN ( %3 )" )
.arg( source()->isLocal() ? "IS NULL" : QString( "= %1" ).arg( source()->id() ) )
.arg( source()->isLocal() ? "id" : "url" )
.arg( idstring ) );
if ( !source()->isLocal() )
{
delquery.prepare( QString( "SELECT id FROM file WHERE source = %1 AND url IN ( %2 )" )
.arg( source()->id() )
.arg( idstring ) );
delquery.exec();
idstring = QString();
while ( delquery.next() )
{
idstring.append( delquery.value( 0 ).toString() + ", " );
m_idList << delquery.value( 0 ).toUInt();
}
idstring.chop( 2 ); //remove the trailing ", "
}
delquery.prepare( QString( "DELETE FROM file WHERE source %1 AND id IN ( %2 )" )
.arg( source()->isLocal() ? "IS NULL" : QString( "= %1" ).arg( source()->id() ) )
.arg( idstring ) );
delquery.exec();
}
emit done( m_files, source()->collection() );
if ( m_idList.count() )
source()->updateIndexWhenSynced();
emit done( m_idList, source()->collection() );
}

Some files were not shown because too many files have changed in this diff Show More