Merge lp:~jonathan-costers/mixxx/LP878931 into lp:~mixxxdevelopers/mixxx/trunk
- LP878931
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 2979 | ||||
Proposed branch: | lp:~jonathan-costers/mixxx/LP878931 | ||||
Merge into: | lp:~mixxxdevelopers/mixxx/trunk | ||||
Diff against target: |
1157 lines (+124/-303) 19 files modified
mixxx/res/schema.xml (+0/-288) mixxx/src/audiotagger.cpp (+26/-0) mixxx/src/audiotagger.h (+2/-0) mixxx/src/dlgtrackinfo.cpp (+3/-0) mixxx/src/dlgtrackinfo.ui (+21/-6) mixxx/src/library/basesqltablemodel.cpp (+4/-1) mixxx/src/library/basetrackcache.cpp (+2/-0) mixxx/src/library/browse/browsetablemodel.cpp (+5/-0) mixxx/src/library/browse/browsetablemodel.h (+1/-0) mixxx/src/library/browse/browsethread.cpp (+3/-0) mixxx/src/library/dao/trackdao.cpp (+12/-6) mixxx/src/library/dao/trackdao.h (+1/-0) mixxx/src/library/mixxxlibraryfeature.cpp (+1/-0) mixxx/src/library/trackcollection.cpp (+1/-1) mixxx/src/soundsource.cpp (+14/-0) mixxx/src/soundsource.h (+3/-0) mixxx/src/soundsourceproxy.cpp (+2/-1) mixxx/src/trackinfoobject.cpp (+16/-0) mixxx/src/trackinfoobject.h (+7/-0) |
||||
To merge this branch: | bzr merge lp:~jonathan-costers/mixxx/LP878931 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
RJ Skerry-Ryan | Approve | ||
Review via email:
|
Commit message
Description of the change
Add Composer field to the library:
- DB revision 14, adding composer field to library table
- updated relevant models and DAOs
- updated library ui and track info dialog to show new field
- integrated new field with existing tag reading/writing
- 2983. By jonathan
-
use empty string as default value for composer field, instead of "?"
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
RJ Skerry-Ryan (rryan) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
RJ Skerry-Ryan (rryan) wrote : | # |
Looks good to me! Thanks Jonathan and nice job on making your code blend in with wherever you were writing it. As you have surely noticed there are a variety of different styles of code lurking around the codebase :).
I have one question. Is there a standard composer field for M4A files? I noticed you haven't updated SoundSource:
Is it ok if I add you to the credits as "Jonathan Costers"?
I'm merging this to trunk now and it will be in the 1.11.0 release later this year.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jonathan Costers (jonathan-costers) wrote : | # |
Haha, yes I did notice.
Not a lot different from any other projects I've been involved with in the past, for that matter :-)
I must have overlooked M4A tagging ... Let me find out.
Thanks for adding me to the credits! Jonathan Costers is quite alright.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
RJ Skerry-Ryan (rryan) wrote : | # |
I actually found a reference here:
http://
And added the appropriate parsing to trunk last night but I didn't test it.
On Sat, Jan 7, 2012 at 6:52 AM, Jonathan Costers <<email address hidden>
> wrote:
> Haha, yes I did notice.
> Not a lot different from any other projects I've been involved with in the
> past, for that matter :-)
>
> I must have overlooked M4A tagging ... Let me find out.
>
> Thanks for adding me to the credits! Jonathan Costers is quite alright.
> --
> https:/
> You are reviewing the proposed merge of
> lp:~jonathan-costers/mixxx/LP878931 into lp:mixxx.
>
Preview Diff
1 | === added file 'mixxx/res/schema.xml' |
2 | --- mixxx/res/schema.xml 1970-01-01 00:00:00 +0000 |
3 | +++ mixxx/res/schema.xml 2011-12-28 23:47:25 +0000 |
4 | @@ -0,0 +1,296 @@ |
5 | +<?xml version="1.0" encoding="utf-8"?> |
6 | +<!-- |
7 | +This is the Mixxx schema history file. It keeps track of internal changes to the |
8 | +Mixxx database schema and allows Mixxx to automatically upgrade itself to new |
9 | +revisions of the schema on a version upgrade. |
10 | + |
11 | +DO NOT EDIT THIS FILE OR YOU WILL BREAK YOUR MIXXX LIBRARY AND LOSE YOUR |
12 | +METADATA |
13 | +--> |
14 | +<schema> |
15 | + <revision version="1"> |
16 | + <description> |
17 | + The base schema for the Mixxx SQLITE database. |
18 | + </description> |
19 | + <sql> |
20 | + CREATE TABLE IF NOT EXISTS settings ( |
21 | + name TEXT UNIQUE NOT NULL, |
22 | + value TEXT, |
23 | + locked INTEGER DEFAULT 0, |
24 | + hidden INTEGER DEFAULT 0); |
25 | + |
26 | + CREATE TABLE IF NOT EXISTS track_locations ( |
27 | + id INTEGER PRIMARY KEY AUTOINCREMENT, |
28 | + location varchar(512) UNIQUE, |
29 | + filename varchar(512), |
30 | + directory varchar(512), |
31 | + filesize INTEGER, |
32 | + fs_deleted INTEGER, |
33 | + needs_verification INTEGER); |
34 | + |
35 | + CREATE TABLE IF NOT EXISTS LibraryHashes ( |
36 | + directory_path VARCHAR(256) primary key, |
37 | + hash INTEGER, |
38 | + directory_deleted INTEGER); |
39 | + |
40 | + CREATE TABLE IF NOT EXISTS library ( |
41 | + id INTEGER primary key AUTOINCREMENT, |
42 | + artist varchar(48), title varchar(48), |
43 | + album varchar(48), year varchar(16), |
44 | + genre varchar(32), tracknumber varchar(3), |
45 | + location varchar(512) REFERENCES track_locations(location), |
46 | + comment varchar(20), url varchar(256), |
47 | + duration integer, |
48 | + bitrate integer, samplerate integer, |
49 | + cuepoint integer, bpm float, |
50 | + wavesummaryhex blob, |
51 | + channels integer, |
52 | + datetime_added DEFAULT CURRENT_TIMESTAMP, |
53 | + mixxx_deleted integer, |
54 | + played integer); |
55 | + |
56 | + CREATE TABLE Playlists ( |
57 | + id INTEGER primary key, |
58 | + name varchar(48), |
59 | + position INTEGER, |
60 | + hidden INTEGER DEFAULT 0 NOT NULL, |
61 | + date_created datetime, |
62 | + date_modified datetime); |
63 | + |
64 | + CREATE TABLE PlaylistTracks ( |
65 | + id INTEGER primary key, |
66 | + playlist_id INTEGER REFERENCES Playlists(id), |
67 | + track_id INTEGER REFERENCES library(id), |
68 | + position INTEGER); |
69 | + |
70 | + CREATE TABLE IF NOT EXISTS cues ( |
71 | + id integer PRIMARY KEY AUTOINCREMENT, |
72 | + track_id integer NOT NULL REFERENCES library(id), |
73 | + type integer DEFAULT 0 NOT NULL, |
74 | + position integer DEFAULT -1 NOT NULL, |
75 | + length integer DEFAULT 0 NOT NULL, |
76 | + hotcue integer DEFAULT -1 NOT NULL, |
77 | + label text DEFAULT '' NOT NULL); |
78 | + |
79 | + CREATE TABLE IF NOT EXISTS crates ( |
80 | + id integer PRIMARY KEY AUTOINCREMENT, |
81 | + name varchar(48) UNIQUE NOT NULL, |
82 | + count integer DEFAULT 0, |
83 | + show integer DEFAULT 1); |
84 | + |
85 | + CREATE TABLE IF NOT EXISTS crate_tracks ( |
86 | + crate_id integer NOT NULL REFERENCES crates(id), |
87 | + track_id integer NOT NULL REFERENCES library(id), |
88 | + UNIQUE (crate_id, track_id)); |
89 | + |
90 | + </sql> |
91 | + </revision> |
92 | + <revision version="2"> |
93 | + <description> |
94 | + Add a header_parsed integer column to the library to indicate when a |
95 | + track's tags have been parsed. |
96 | + </description> |
97 | + <sql> |
98 | + ALTER TABLE library ADD COLUMN header_parsed integer DEFAULT 0; |
99 | + </sql> |
100 | + </revision> |
101 | + <revision version="3"> |
102 | + <description> |
103 | + Change the location column to be a an integer. Change comment to be |
104 | + varchar(256) and album/artist/title to be varchar(64). |
105 | + </description> |
106 | + <sql> |
107 | + ALTER TABLE library RENAME TO library_old; |
108 | + |
109 | + CREATE TABLE IF NOT EXISTS library ( |
110 | + id INTEGER primary key AUTOINCREMENT, |
111 | + artist varchar(64), |
112 | + title varchar(64), |
113 | + album varchar(64), |
114 | + year varchar(16), |
115 | + genre varchar(64), |
116 | + tracknumber varchar(3), |
117 | + location integer REFERENCES track_locations(location), |
118 | + comment varchar(256), |
119 | + url varchar(256), |
120 | + duration integer, |
121 | + bitrate integer, |
122 | + samplerate integer, |
123 | + cuepoint integer, |
124 | + bpm float, |
125 | + wavesummaryhex blob, |
126 | + channels integer, |
127 | + datetime_added DEFAULT CURRENT_TIMESTAMP, |
128 | + mixxx_deleted integer, |
129 | + played integer, |
130 | + header_parsed integer DEFAULT 0); |
131 | + |
132 | + INSERT INTO library (id, artist, title, album, year, genre, tracknumber, location, comment, url, duration, bitrate, samplerate, bpm, cuepoint, bpm, wavesummaryhex, channels, datetime_added, mixxx_deleted, played, header_parsed) SELECT id, artist, title, album, year, genre, tracknumber, location, comment, url, duration, bitrate, samplerate, bpm, cuepoint, bpm, wavesummaryhex, channels, datetime_added, mixxx_deleted, played, header_parsed from library_old; |
133 | + |
134 | + DROP TABLE library_old; |
135 | + </sql> |
136 | + </revision> |
137 | + <revision version="4"> |
138 | + <description> |
139 | + Add file type column. |
140 | + </description> |
141 | + <sql> |
142 | + ALTER TABLE library ADD COLUMN filetype varchar(8) DEFAULT "?"; |
143 | + </sql> |
144 | + </revision> |
145 | + <revision version="5"> |
146 | + <description> |
147 | + Add needs_verification column to library hashes table. |
148 | + </description> |
149 | + <sql> |
150 | + ALTER TABLE LibraryHashes ADD COLUMN needs_verification INTEGER DEFAULT 0; |
151 | + </sql> |
152 | + </revision> |
153 | + <revision version="6"> |
154 | + <description> |
155 | + Added a ReplayGain Column. |
156 | + </description> |
157 | + <sql> |
158 | + ALTER TABLE library ADD COLUMN replaygain float DEFAULT 0; |
159 | + </sql> |
160 | + </revision> |
161 | + <revision version="7" min_compatible="3"> |
162 | + <description> |
163 | + Add timesplayed and rating column. Reset header state. |
164 | + </description> |
165 | + <sql> |
166 | + ALTER TABLE library ADD COLUMN timesplayed integer DEFAULT 0; |
167 | + ALTER TABLE library ADD COLUMN rating integer DEFAULT 0; |
168 | + ALTER TABLE library ADD COLUMN key varchar(8) DEFAULT ""; |
169 | + UPDATE library SET timesplayed = played; |
170 | + UPDATE library SET played = 0; |
171 | + |
172 | + DELETE FROM settings WHERE name="mixxx.db.model.library.header_state"; |
173 | + DELETE FROM settings WHERE name="mixxx.db.model.playlist.header_state"; |
174 | + DELETE FROM settings WHERE name="mixxx.db.model.crate.header_state"; |
175 | + DELETE FROM settings WHERE name="mixxx.db.model.prepare.header_state"; |
176 | + DELETE FROM settings WHERE name="mixxx.db.model.missing.header_state"; |
177 | + </sql> |
178 | + </revision> |
179 | + <revision version="8" min_compatible="3"> |
180 | + <description> |
181 | + Added iTunes tables |
182 | + </description> |
183 | + <sql> |
184 | + CREATE TABLE IF NOT EXISTS itunes_library ( |
185 | + id INTEGER primary key, |
186 | + artist varchar(48), title varchar(48), |
187 | + album varchar(48), year varchar(16), |
188 | + genre varchar(32), tracknumber varchar(3), |
189 | + location varchar(512), |
190 | + comment varchar(60), |
191 | + duration integer, |
192 | + bitrate integer, |
193 | + bpm integer, |
194 | + rating integer); |
195 | + |
196 | + CREATE TABLE IF NOT EXISTS itunes_playlists ( |
197 | + id INTEGER primary key, |
198 | + name varchar(100) UNIQUE); |
199 | + |
200 | + CREATE TABLE IF NOT EXISTS itunes_playlist_tracks ( |
201 | + id INTEGER primary key AUTOINCREMENT, |
202 | + playlist_id INTEGER REFERENCES itunes_playlist(id), |
203 | + track_id INTEGER REFERENCES itunes_library(id)); |
204 | + </sql> |
205 | + </revision> |
206 | + <revision version="9" min_compatible="3"> |
207 | + <description> |
208 | + Tables for Traktor library feature |
209 | + </description> |
210 | + <sql> |
211 | + CREATE TABLE IF NOT EXISTS traktor_library ( |
212 | + id INTEGER primary key AUTOINCREMENT, |
213 | + artist varchar(48), title varchar(48), |
214 | + album varchar(48), year varchar(16), |
215 | + genre varchar(32), tracknumber varchar(3), |
216 | + location varchar(512) UNIQUE, |
217 | + comment varchar(60), |
218 | + duration integer, |
219 | + bitrate integer, |
220 | + bpm float, |
221 | + key varchar(6), |
222 | + rating integer |
223 | + ); |
224 | + CREATE TABLE IF NOT EXISTS traktor_playlists ( |
225 | + id INTEGER primary key, |
226 | + name varchar(100) UNIQUE |
227 | + ); |
228 | + CREATE TABLE IF NOT EXISTS traktor_playlist_tracks ( |
229 | + id INTEGER primary key AUTOINCREMENT, |
230 | + playlist_id INTEGER REFERENCES traktor_playlist(id), |
231 | + track_id INTEGER REFERENCES traktor_library(id) |
232 | + ); |
233 | + </sql> |
234 | + </revision> |
235 | + <revision version="10" min_compatible="3"> |
236 | + <description> |
237 | + Playlist and crate locks |
238 | + </description> |
239 | + <sql> |
240 | + ALTER TABLE crates ADD COLUMN locked integer DEFAULT 0; |
241 | + ALTER TABLE playlists ADD COLUMN locked integer DEFAULT 0; |
242 | + </sql> |
243 | + </revision> |
244 | + <revision version="11" min_compatible="3"> |
245 | + <description> |
246 | + Tables for Rhythmbox library feature |
247 | + </description> |
248 | + <sql> |
249 | + CREATE TABLE IF NOT EXISTS rhythmbox_library ( |
250 | + id INTEGER primary key AUTOINCREMENT, |
251 | + artist varchar(48), title varchar(48), |
252 | + album varchar(48), year varchar(16), |
253 | + genre varchar(32), tracknumber varchar(3), |
254 | + location varchar(512) UNIQUE, |
255 | + comment varchar(60), |
256 | + duration integer, |
257 | + bitrate integer, |
258 | + bpm float, |
259 | + key varchar(6), |
260 | + rating integer |
261 | + ); |
262 | + CREATE TABLE IF NOT EXISTS rhythmbox_playlists ( |
263 | + id INTEGER primary key AUTOINCREMENT, |
264 | + name varchar(100) UNIQUE |
265 | + ); |
266 | + CREATE TABLE IF NOT EXISTS rhythmbox_playlist_tracks ( |
267 | + id INTEGER primary key AUTOINCREMENT, |
268 | + playlist_id INTEGER REFERENCES rhythmbox_playlist(id), |
269 | + track_id INTEGER REFERENCES rhythmbox_library(id) |
270 | + ); |
271 | + </sql> |
272 | + </revision> |
273 | + <revision version="12" min_compatible="3"> |
274 | + <description> |
275 | + Add beats column to library table. |
276 | + </description> |
277 | + <sql> |
278 | + ALTER TABLE Library ADD COLUMN beats BLOB; |
279 | + ALTER TABLE Library ADD COLUMN beats_version TEXT; |
280 | + </sql> |
281 | + </revision> |
282 | + <revision version="13" min_compatible="3"> |
283 | + <description> |
284 | + Add position column to Rhythmbox, iTunes, and Traktor playlist tables. |
285 | + </description> |
286 | + <sql> |
287 | + ALTER TABLE itunes_playlist_tracks ADD COLUMN position INTEGER DEFAULT 0; |
288 | + ALTER TABLE rhythmbox_playlist_tracks ADD COLUMN position INTEGER DEFAULT 0; |
289 | + ALTER TABLE traktor_playlist_tracks ADD COLUMN position INTEGER DEFAULT 0; |
290 | + </sql> |
291 | + </revision> |
292 | + <revision version="14" min_compatible="3"> |
293 | + <description> |
294 | + Add composer column to library table. |
295 | + </description> |
296 | + <sql> |
297 | + ALTER TABLE library ADD COLUMN composer varchar(64) DEFAULT ""; |
298 | + </sql> |
299 | + </revision> |
300 | +</schema> |
301 | |
302 | === removed file 'mixxx/res/schema.xml' |
303 | --- mixxx/res/schema.xml 2011-10-14 00:24:59 +0000 |
304 | +++ mixxx/res/schema.xml 1970-01-01 00:00:00 +0000 |
305 | @@ -1,288 +0,0 @@ |
306 | -<?xml version="1.0" encoding="utf-8"?> |
307 | -<!-- |
308 | -This is the Mixxx schema history file. It keeps track of internal changes to the |
309 | -Mixxx database schema and allows Mixxx to automatically upgrade itself to new |
310 | -revisions of the schema on a version upgrade. |
311 | - |
312 | -DO NOT EDIT THIS FILE OR YOU WILL BREAK YOUR MIXXX LIBRARY AND LOSE YOUR |
313 | -METADATA |
314 | ---> |
315 | -<schema> |
316 | - <revision version="1"> |
317 | - <description> |
318 | - The base schema for the Mixxx SQLITE database. |
319 | - </description> |
320 | - <sql> |
321 | - CREATE TABLE IF NOT EXISTS settings ( |
322 | - name TEXT UNIQUE NOT NULL, |
323 | - value TEXT, |
324 | - locked INTEGER DEFAULT 0, |
325 | - hidden INTEGER DEFAULT 0); |
326 | - |
327 | - CREATE TABLE IF NOT EXISTS track_locations ( |
328 | - id INTEGER PRIMARY KEY AUTOINCREMENT, |
329 | - location varchar(512) UNIQUE, |
330 | - filename varchar(512), |
331 | - directory varchar(512), |
332 | - filesize INTEGER, |
333 | - fs_deleted INTEGER, |
334 | - needs_verification INTEGER); |
335 | - |
336 | - CREATE TABLE IF NOT EXISTS LibraryHashes ( |
337 | - directory_path VARCHAR(256) primary key, |
338 | - hash INTEGER, |
339 | - directory_deleted INTEGER); |
340 | - |
341 | - CREATE TABLE IF NOT EXISTS library ( |
342 | - id INTEGER primary key AUTOINCREMENT, |
343 | - artist varchar(48), title varchar(48), |
344 | - album varchar(48), year varchar(16), |
345 | - genre varchar(32), tracknumber varchar(3), |
346 | - location varchar(512) REFERENCES track_locations(location), |
347 | - comment varchar(20), url varchar(256), |
348 | - duration integer, |
349 | - bitrate integer, samplerate integer, |
350 | - cuepoint integer, bpm float, |
351 | - wavesummaryhex blob, |
352 | - channels integer, |
353 | - datetime_added DEFAULT CURRENT_TIMESTAMP, |
354 | - mixxx_deleted integer, |
355 | - played integer); |
356 | - |
357 | - CREATE TABLE Playlists ( |
358 | - id INTEGER primary key, |
359 | - name varchar(48), |
360 | - position INTEGER, |
361 | - hidden INTEGER DEFAULT 0 NOT NULL, |
362 | - date_created datetime, |
363 | - date_modified datetime); |
364 | - |
365 | - CREATE TABLE PlaylistTracks ( |
366 | - id INTEGER primary key, |
367 | - playlist_id INTEGER REFERENCES Playlists(id), |
368 | - track_id INTEGER REFERENCES library(id), |
369 | - position INTEGER); |
370 | - |
371 | - CREATE TABLE IF NOT EXISTS cues ( |
372 | - id integer PRIMARY KEY AUTOINCREMENT, |
373 | - track_id integer NOT NULL REFERENCES library(id), |
374 | - type integer DEFAULT 0 NOT NULL, |
375 | - position integer DEFAULT -1 NOT NULL, |
376 | - length integer DEFAULT 0 NOT NULL, |
377 | - hotcue integer DEFAULT -1 NOT NULL, |
378 | - label text DEFAULT '' NOT NULL); |
379 | - |
380 | - CREATE TABLE IF NOT EXISTS crates ( |
381 | - id integer PRIMARY KEY AUTOINCREMENT, |
382 | - name varchar(48) UNIQUE NOT NULL, |
383 | - count integer DEFAULT 0, |
384 | - show integer DEFAULT 1); |
385 | - |
386 | - CREATE TABLE IF NOT EXISTS crate_tracks ( |
387 | - crate_id integer NOT NULL REFERENCES crates(id), |
388 | - track_id integer NOT NULL REFERENCES library(id), |
389 | - UNIQUE (crate_id, track_id)); |
390 | - |
391 | - </sql> |
392 | - </revision> |
393 | - <revision version="2"> |
394 | - <description> |
395 | - Add a header_parsed integer column to the library to indicate when a |
396 | - track's tags have been parsed. |
397 | - </description> |
398 | - <sql> |
399 | - ALTER TABLE library ADD COLUMN header_parsed integer DEFAULT 0; |
400 | - </sql> |
401 | - </revision> |
402 | - <revision version="3"> |
403 | - <description> |
404 | - Change the location column to be a an integer. Change comment to be |
405 | - varchar(256) and album/artist/title to be varchar(64). |
406 | - </description> |
407 | - <sql> |
408 | - ALTER TABLE library RENAME TO library_old; |
409 | - |
410 | - CREATE TABLE IF NOT EXISTS library ( |
411 | - id INTEGER primary key AUTOINCREMENT, |
412 | - artist varchar(64), |
413 | - title varchar(64), |
414 | - album varchar(64), |
415 | - year varchar(16), |
416 | - genre varchar(64), |
417 | - tracknumber varchar(3), |
418 | - location integer REFERENCES track_locations(location), |
419 | - comment varchar(256), |
420 | - url varchar(256), |
421 | - duration integer, |
422 | - bitrate integer, |
423 | - samplerate integer, |
424 | - cuepoint integer, |
425 | - bpm float, |
426 | - wavesummaryhex blob, |
427 | - channels integer, |
428 | - datetime_added DEFAULT CURRENT_TIMESTAMP, |
429 | - mixxx_deleted integer, |
430 | - played integer, |
431 | - header_parsed integer DEFAULT 0); |
432 | - |
433 | - INSERT INTO library (id, artist, title, album, year, genre, tracknumber, location, comment, url, duration, bitrate, samplerate, bpm, cuepoint, bpm, wavesummaryhex, channels, datetime_added, mixxx_deleted, played, header_parsed) SELECT id, artist, title, album, year, genre, tracknumber, location, comment, url, duration, bitrate, samplerate, bpm, cuepoint, bpm, wavesummaryhex, channels, datetime_added, mixxx_deleted, played, header_parsed from library_old; |
434 | - |
435 | - DROP TABLE library_old; |
436 | - </sql> |
437 | - </revision> |
438 | - <revision version="4"> |
439 | - <description> |
440 | - Add file type column. |
441 | - </description> |
442 | - <sql> |
443 | - ALTER TABLE library ADD COLUMN filetype varchar(8) DEFAULT "?"; |
444 | - </sql> |
445 | - </revision> |
446 | - <revision version="5"> |
447 | - <description> |
448 | - Add needs_verification column to library hashes table. |
449 | - </description> |
450 | - <sql> |
451 | - ALTER TABLE LibraryHashes ADD COLUMN needs_verification INTEGER DEFAULT 0; |
452 | - </sql> |
453 | - </revision> |
454 | - <revision version="6"> |
455 | - <description> |
456 | - Added a ReplayGain Column. |
457 | - </description> |
458 | - <sql> |
459 | - ALTER TABLE library ADD COLUMN replaygain float DEFAULT 0; |
460 | - </sql> |
461 | - </revision> |
462 | - <revision version="7" min_compatible="3"> |
463 | - <description> |
464 | - Add timesplayed and rating column. Reset header state. |
465 | - </description> |
466 | - <sql> |
467 | - ALTER TABLE library ADD COLUMN timesplayed integer DEFAULT 0; |
468 | - ALTER TABLE library ADD COLUMN rating integer DEFAULT 0; |
469 | - ALTER TABLE library ADD COLUMN key varchar(8) DEFAULT ""; |
470 | - UPDATE library SET timesplayed = played; |
471 | - UPDATE library SET played = 0; |
472 | - |
473 | - DELETE FROM settings WHERE name="mixxx.db.model.library.header_state"; |
474 | - DELETE FROM settings WHERE name="mixxx.db.model.playlist.header_state"; |
475 | - DELETE FROM settings WHERE name="mixxx.db.model.crate.header_state"; |
476 | - DELETE FROM settings WHERE name="mixxx.db.model.prepare.header_state"; |
477 | - DELETE FROM settings WHERE name="mixxx.db.model.missing.header_state"; |
478 | - </sql> |
479 | - </revision> |
480 | - <revision version="8" min_compatible="3"> |
481 | - <description> |
482 | - Added iTunes tables |
483 | - </description> |
484 | - <sql> |
485 | - CREATE TABLE IF NOT EXISTS itunes_library ( |
486 | - id INTEGER primary key, |
487 | - artist varchar(48), title varchar(48), |
488 | - album varchar(48), year varchar(16), |
489 | - genre varchar(32), tracknumber varchar(3), |
490 | - location varchar(512), |
491 | - comment varchar(60), |
492 | - duration integer, |
493 | - bitrate integer, |
494 | - bpm integer, |
495 | - rating integer); |
496 | - |
497 | - CREATE TABLE IF NOT EXISTS itunes_playlists ( |
498 | - id INTEGER primary key, |
499 | - name varchar(100) UNIQUE); |
500 | - |
501 | - CREATE TABLE IF NOT EXISTS itunes_playlist_tracks ( |
502 | - id INTEGER primary key AUTOINCREMENT, |
503 | - playlist_id INTEGER REFERENCES itunes_playlist(id), |
504 | - track_id INTEGER REFERENCES itunes_library(id)); |
505 | - </sql> |
506 | - </revision> |
507 | - <revision version="9" min_compatible="3"> |
508 | - <description> |
509 | - Tables for Traktor library feature |
510 | - </description> |
511 | - <sql> |
512 | - CREATE TABLE IF NOT EXISTS traktor_library ( |
513 | - id INTEGER primary key AUTOINCREMENT, |
514 | - artist varchar(48), title varchar(48), |
515 | - album varchar(48), year varchar(16), |
516 | - genre varchar(32), tracknumber varchar(3), |
517 | - location varchar(512) UNIQUE, |
518 | - comment varchar(60), |
519 | - duration integer, |
520 | - bitrate integer, |
521 | - bpm float, |
522 | - key varchar(6), |
523 | - rating integer |
524 | - ); |
525 | - CREATE TABLE IF NOT EXISTS traktor_playlists ( |
526 | - id INTEGER primary key, |
527 | - name varchar(100) UNIQUE |
528 | - ); |
529 | - CREATE TABLE IF NOT EXISTS traktor_playlist_tracks ( |
530 | - id INTEGER primary key AUTOINCREMENT, |
531 | - playlist_id INTEGER REFERENCES traktor_playlist(id), |
532 | - track_id INTEGER REFERENCES traktor_library(id) |
533 | - ); |
534 | - </sql> |
535 | - </revision> |
536 | - <revision version="10" min_compatible="3"> |
537 | - <description> |
538 | - Playlist and crate locks |
539 | - </description> |
540 | - <sql> |
541 | - ALTER TABLE crates ADD COLUMN locked integer DEFAULT 0; |
542 | - ALTER TABLE playlists ADD COLUMN locked integer DEFAULT 0; |
543 | - </sql> |
544 | - </revision> |
545 | - <revision version="11" min_compatible="3"> |
546 | - <description> |
547 | - Tables for Rhythmbox library feature |
548 | - </description> |
549 | - <sql> |
550 | - CREATE TABLE IF NOT EXISTS rhythmbox_library ( |
551 | - id INTEGER primary key AUTOINCREMENT, |
552 | - artist varchar(48), title varchar(48), |
553 | - album varchar(48), year varchar(16), |
554 | - genre varchar(32), tracknumber varchar(3), |
555 | - location varchar(512) UNIQUE, |
556 | - comment varchar(60), |
557 | - duration integer, |
558 | - bitrate integer, |
559 | - bpm float, |
560 | - key varchar(6), |
561 | - rating integer |
562 | - ); |
563 | - CREATE TABLE IF NOT EXISTS rhythmbox_playlists ( |
564 | - id INTEGER primary key AUTOINCREMENT, |
565 | - name varchar(100) UNIQUE |
566 | - ); |
567 | - CREATE TABLE IF NOT EXISTS rhythmbox_playlist_tracks ( |
568 | - id INTEGER primary key AUTOINCREMENT, |
569 | - playlist_id INTEGER REFERENCES rhythmbox_playlist(id), |
570 | - track_id INTEGER REFERENCES rhythmbox_library(id) |
571 | - ); |
572 | - </sql> |
573 | - </revision> |
574 | - <revision version="12" min_compatible="3"> |
575 | - <description> |
576 | - Add beats column to library table. |
577 | - </description> |
578 | - <sql> |
579 | - ALTER TABLE Library ADD COLUMN beats BLOB; |
580 | - ALTER TABLE Library ADD COLUMN beats_version TEXT; |
581 | - </sql> |
582 | - </revision> |
583 | - <revision version="13" min_compatible="3"> |
584 | - <description> |
585 | - Add position column to Rhythmbox, iTunes, and Traktor playlist tables. |
586 | - </description> |
587 | - <sql> |
588 | - ALTER TABLE itunes_playlist_tracks ADD COLUMN position INTEGER DEFAULT 0; |
589 | - ALTER TABLE rhythmbox_playlist_tracks ADD COLUMN position INTEGER DEFAULT 0; |
590 | - ALTER TABLE traktor_playlist_tracks ADD COLUMN position INTEGER DEFAULT 0; |
591 | - </sql> |
592 | - </revision> |
593 | -</schema> |
594 | |
595 | === modified file 'mixxx/src/audiotagger.cpp' |
596 | --- mixxx/src/audiotagger.cpp 2011-04-15 11:09:14 +0000 |
597 | +++ mixxx/src/audiotagger.cpp 2011-12-28 23:47:25 +0000 |
598 | @@ -26,6 +26,7 @@ |
599 | m_artist = ""; |
600 | m_title = ""; |
601 | m_genre = ""; |
602 | + m_composer = ""; |
603 | m_album = ""; |
604 | m_year = ""; |
605 | m_comment = ""; |
606 | @@ -69,6 +70,11 @@ |
607 | } |
608 | |
609 | |
610 | +void AudioTagger::setComposer (QString composer ) |
611 | +{ |
612 | + m_composer = composer; |
613 | +} |
614 | + |
615 | |
616 | void AudioTagger::setYear (QString year ) |
617 | { |
618 | @@ -219,6 +225,22 @@ |
619 | |
620 | } |
621 | |
622 | + TagLib::ID3v2::FrameList composerFrame = id3v2->frameListMap()["TCOM"]; |
623 | + if (!composerFrame.isEmpty()) |
624 | + { |
625 | + composerFrame.front()->setText(m_composer.toStdString()); |
626 | + |
627 | + } |
628 | + else |
629 | + { |
630 | + //add new frame |
631 | + TagLib::ID3v2::TextIdentificationFrame* newFrame = new TagLib::ID3v2::TextIdentificationFrame("TCOM", TagLib::String::Latin1); |
632 | + |
633 | + newFrame->setText(m_composer.toStdString()); |
634 | + id3v2->addFrame(newFrame); |
635 | + |
636 | + } |
637 | + |
638 | } |
639 | void AudioTagger::addAPETag(TagLib::APE::Tag* ape) |
640 | { |
641 | @@ -230,6 +252,7 @@ |
642 | ape->addValue("BPM",m_bpm.toStdString(), true); |
643 | ape->addValue("BPM",m_bpm.toStdString(), true); |
644 | |
645 | + ape->addValue("Composer",m_composer.toStdString(), true); |
646 | |
647 | } |
648 | void AudioTagger::addXiphComment(TagLib::Ogg::XiphComment* xiph) |
649 | @@ -252,6 +275,9 @@ |
650 | xiph->removeField("KEY"); |
651 | xiph->addField("KEY", m_key.toStdString()); |
652 | |
653 | + xiph->removeField("COMPOSER"); |
654 | + xiph->addField("COMPOSER", m_key.toStdString()); |
655 | + |
656 | } |
657 | void AudioTagger::processMP4Tag(TagLib::MP4::Tag* mp4) |
658 | { |
659 | |
660 | === modified file 'mixxx/src/audiotagger.h' |
661 | --- mixxx/src/audiotagger.h 2011-04-10 18:23:52 +0000 |
662 | +++ mixxx/src/audiotagger.h 2011-12-28 23:47:25 +0000 |
663 | @@ -21,6 +21,7 @@ |
664 | void setTitle (QString title ); |
665 | void setAlbum (QString album ); |
666 | void setGenre (QString genre ); |
667 | + void setComposer (QString composer ); |
668 | void setYear (QString year ); |
669 | void setComment (QString comment ); |
670 | void setKey (QString key ); |
671 | @@ -33,6 +34,7 @@ |
672 | QString m_artist; |
673 | QString m_title; |
674 | QString m_genre; |
675 | + QString m_composer; |
676 | QString m_album; |
677 | QString m_year; |
678 | QString m_comment; |
679 | |
680 | === modified file 'mixxx/src/dlgtrackinfo.cpp' |
681 | --- mixxx/src/dlgtrackinfo.cpp 2011-12-18 20:23:14 +0000 |
682 | +++ mixxx/src/dlgtrackinfo.cpp 2011-12-28 23:47:25 +0000 |
683 | @@ -103,6 +103,7 @@ |
684 | txtArtist->setText(pTrack->getArtist()); |
685 | txtAlbum->setText(pTrack->getAlbum()); |
686 | txtGenre->setText(pTrack->getGenre()); |
687 | + txtComposer->setText(pTrack->getComposer()); |
688 | txtYear->setText(pTrack->getYear()); |
689 | txtTrackNumber->setText(pTrack->getTrackNumber()); |
690 | txtComment->setText(pTrack->getComment()); |
691 | @@ -198,6 +199,7 @@ |
692 | m_pLoadedTrack->setArtist(txtArtist->text()); |
693 | m_pLoadedTrack->setAlbum(txtAlbum->text()); |
694 | m_pLoadedTrack->setGenre(txtGenre->text()); |
695 | + m_pLoadedTrack->setComposer(txtComposer->text()); |
696 | m_pLoadedTrack->setYear(txtYear->text()); |
697 | m_pLoadedTrack->setTrackNumber(txtTrackNumber->text()); |
698 | m_pLoadedTrack->setBpm(spinBpm->value()); |
699 | @@ -253,6 +255,7 @@ |
700 | txtArtist->setText(""); |
701 | txtAlbum->setText(""); |
702 | txtGenre->setText(""); |
703 | + txtComposer->setText(""); |
704 | txtYear->setText(""); |
705 | txtTrackNumber->setText(""); |
706 | txtComment->setText(""); |
707 | |
708 | === modified file 'mixxx/src/dlgtrackinfo.ui' |
709 | --- mixxx/src/dlgtrackinfo.ui 2011-10-05 16:29:58 +0000 |
710 | +++ mixxx/src/dlgtrackinfo.ui 2011-12-28 23:47:25 +0000 |
711 | @@ -7,7 +7,7 @@ |
712 | <x>0</x> |
713 | <y>0</y> |
714 | <width>448</width> |
715 | - <height>571</height> |
716 | + <height>615</height> |
717 | </rect> |
718 | </property> |
719 | <property name="windowTitle"> |
720 | @@ -135,7 +135,22 @@ |
721 | <item row="5" column="1" colspan="3"> |
722 | <widget class="QLineEdit" name="txtGenre"/> |
723 | </item> |
724 | + |
725 | <item row="6" column="0"> |
726 | + <widget class="QLabel" name="label_11"> |
727 | + <property name="text"> |
728 | + <string>Composer:</string> |
729 | + </property> |
730 | + <property name="buddy" > |
731 | + <cstring>txtComposer</cstring> |
732 | + </property> |
733 | + </widget> |
734 | + </item> |
735 | + <item row="6" column="1" colspan="3"> |
736 | + <widget class="QLineEdit" name="txtComposer"/> |
737 | + </item> |
738 | + |
739 | + <item row="7" column="0"> |
740 | <widget class="QLabel" name="label_5"> |
741 | <property name="text"> |
742 | <string>Filename:</string> |
743 | @@ -145,7 +160,7 @@ |
744 | </property> |
745 | </widget> |
746 | </item> |
747 | - <item row="6" column="1" colspan="3"> |
748 | + <item row="7" column="1" colspan="3"> |
749 | <widget class="QLineEdit" name="txtFilepath"> |
750 | <property name="enabled"> |
751 | <bool>true</bool> |
752 | @@ -169,21 +184,21 @@ |
753 | </property> |
754 | </widget> |
755 | </item> |
756 | - <item row="8" column="2"> |
757 | + <item row="9" column="2"> |
758 | <widget class="QLabel" name="Type"> |
759 | <property name="text"> |
760 | <string>File Type:</string> |
761 | </property> |
762 | </widget> |
763 | </item> |
764 | - <item row="8" column="3"> |
765 | + <item row="9" column="3"> |
766 | <widget class="QLabel" name="txtType"> |
767 | <property name="text"> |
768 | <string>77</string> |
769 | </property> |
770 | </widget> |
771 | </item> |
772 | - <item row="9" column="0"> |
773 | + <item row="10" column="0"> |
774 | <widget class="QLabel" name="label_4"> |
775 | <property name="text"> |
776 | <string>Comments:</string> |
777 | @@ -193,7 +208,7 @@ |
778 | </property> |
779 | </widget> |
780 | </item> |
781 | - <item row="9" column="1" colspan="3"> |
782 | + <item row="10" column="1" colspan="3"> |
783 | <widget class="QTextEdit" name="txtComment"> |
784 | <property name="tabChangesFocus"> |
785 | <bool>true</bool> |
786 | |
787 | === modified file 'mixxx/src/library/basesqltablemodel.cpp' |
788 | --- mixxx/src/library/basesqltablemodel.cpp 2011-12-18 18:50:40 +0000 |
789 | +++ mixxx/src/library/basesqltablemodel.cpp 2011-12-28 23:47:25 +0000 |
790 | @@ -43,6 +43,8 @@ |
791 | Qt::Horizontal, tr("Album")); |
792 | setHeaderData(fieldIndex(LIBRARYTABLE_GENRE), |
793 | Qt::Horizontal, tr("Genre")); |
794 | + setHeaderData(fieldIndex(LIBRARYTABLE_COMPOSER), |
795 | + Qt::Horizontal, tr("Composer")); |
796 | setHeaderData(fieldIndex(LIBRARYTABLE_YEAR), |
797 | Qt::Horizontal, tr("Year")); |
798 | setHeaderData(fieldIndex(LIBRARYTABLE_FILETYPE), |
799 | @@ -528,7 +530,6 @@ |
800 | // waveform widget to load a track into a Player). |
801 | defaultFlags |= Qt::ItemIsDragEnabled; |
802 | |
803 | - int row = index.row(); |
804 | int column = index.column(); |
805 | |
806 | if ( column == fieldIndex(LIBRARYTABLE_FILETYPE) |
807 | @@ -609,6 +610,8 @@ |
808 | pTrack->setYear(value.toString()); |
809 | } else if (fieldIndex(LIBRARYTABLE_GENRE) == column) { |
810 | pTrack->setGenre(value.toString()); |
811 | + } else if (fieldIndex(LIBRARYTABLE_COMPOSER) == column) { |
812 | + pTrack->setComposer(value.toString()); |
813 | } else if (fieldIndex(LIBRARYTABLE_FILETYPE) == column) { |
814 | pTrack->setType(value.toString()); |
815 | } else if (fieldIndex(LIBRARYTABLE_TRACKNUMBER) == column) { |
816 | |
817 | === modified file 'mixxx/src/library/basetrackcache.cpp' |
818 | --- mixxx/src/library/basetrackcache.cpp 2011-12-18 20:25:07 +0000 |
819 | +++ mixxx/src/library/basetrackcache.cpp 2011-12-28 23:47:25 +0000 |
820 | @@ -238,6 +238,8 @@ |
821 | return QVariant(pTrack->getDateAdded()); |
822 | } else if (fieldIndex(LIBRARYTABLE_GENRE) == column) { |
823 | return QVariant(pTrack->getGenre()); |
824 | + } else if (fieldIndex(LIBRARYTABLE_COMPOSER) == column) { |
825 | + return QVariant(pTrack->getComposer()); |
826 | } else if (fieldIndex(LIBRARYTABLE_FILETYPE) == column) { |
827 | return QVariant(pTrack->getType()); |
828 | } else if (fieldIndex(LIBRARYTABLE_TRACKNUMBER) == column) { |
829 | |
830 | === modified file 'mixxx/src/library/browse/browsetablemodel.cpp' |
831 | --- mixxx/src/library/browse/browsetablemodel.cpp 2011-12-22 10:56:03 +0000 |
832 | +++ mixxx/src/library/browse/browsetablemodel.cpp 2011-12-28 23:47:25 +0000 |
833 | @@ -31,6 +31,7 @@ |
834 | header_data.insert(COLUMN_TRACK_NUMBER, tr("Track #")); |
835 | header_data.insert(COLUMN_YEAR, tr("Year")); |
836 | header_data.insert(COLUMN_GENRE, tr("Genre")); |
837 | + header_data.insert(COLUMN_COMPOSER, tr("Composer")); |
838 | header_data.insert(COLUMN_COMMENT, tr("Comment")); |
839 | header_data.insert(COLUMN_DURATION, tr("Duration")); |
840 | header_data.insert(COLUMN_BPM, tr("BPM")); |
841 | @@ -44,6 +45,7 @@ |
842 | addSearchColumn(COLUMN_ALBUM); |
843 | addSearchColumn(COLUMN_TITLE); |
844 | addSearchColumn(COLUMN_GENRE); |
845 | + addSearchColumn(COLUMN_COMPOSER); |
846 | addSearchColumn(COLUMN_KEY); |
847 | addSearchColumn(COLUMN_COMMENT); |
848 | |
849 | @@ -336,6 +338,7 @@ |
850 | tagger.setTracknumber(this->index(row,COLUMN_TRACK_NUMBER).data().toString()); |
851 | tagger.setYear(this->index(row,COLUMN_YEAR).data().toString()); |
852 | tagger.setGenre(this->index(row,COLUMN_GENRE).data().toString()); |
853 | + tagger.setComposer(this->index(row,COLUMN_COMPOSER).data().toString()); |
854 | |
855 | //check if one the item were edited |
856 | if(col == COLUMN_ARTIST) { |
857 | @@ -354,6 +357,8 @@ |
858 | tagger.setComment(value.toString()); |
859 | } else if(col == COLUMN_GENRE) { |
860 | tagger.setGenre(value.toString()); |
861 | + } else if(col == COLUMN_COMPOSER) { |
862 | + tagger.setComposer(value.toString()); |
863 | } else if(col == COLUMN_YEAR) { |
864 | tagger.setYear(value.toString()); |
865 | } |
866 | |
867 | === modified file 'mixxx/src/library/browse/browsetablemodel.h' |
868 | --- mixxx/src/library/browse/browsetablemodel.h 2011-12-22 10:56:03 +0000 |
869 | +++ mixxx/src/library/browse/browsetablemodel.h 2011-12-28 23:47:25 +0000 |
870 | @@ -24,6 +24,7 @@ |
871 | const int COLUMN_TYPE = 11; |
872 | const int COLUMN_BITRATE = 12; |
873 | const int COLUMN_LOCATION = 13; |
874 | +const int COLUMN_COMPOSER = 14; |
875 | |
876 | /* |
877 | * The BrowseTable models displays tracks |
878 | |
879 | === modified file 'mixxx/src/library/browse/browsethread.cpp' |
880 | --- mixxx/src/library/browse/browsethread.cpp 2011-11-04 20:03:24 +0000 |
881 | +++ mixxx/src/library/browse/browsethread.cpp 2011-12-28 23:47:25 +0000 |
882 | @@ -141,6 +141,9 @@ |
883 | item = new QStandardItem(tio.getGenre()); |
884 | row_data.insert(COLUMN_GENRE, item); |
885 | |
886 | + item = new QStandardItem(tio.getComposer()); |
887 | + row_data.insert(COLUMN_COMPOSER, item); |
888 | + |
889 | item = new QStandardItem(tio.getComment()); |
890 | row_data.insert(COLUMN_COMMENT, item); |
891 | |
892 | |
893 | === modified file 'mixxx/src/library/dao/trackdao.cpp' |
894 | --- mixxx/src/library/dao/trackdao.cpp 2011-10-21 00:42:23 +0000 |
895 | +++ mixxx/src/library/dao/trackdao.cpp 2011-12-28 23:47:25 +0000 |
896 | @@ -240,13 +240,13 @@ |
897 | } |
898 | |
899 | void TrackDAO::prepareLibraryInsert(QSqlQuery& query) { |
900 | - query.prepare("INSERT INTO library (artist, title, album, year, genre, tracknumber, " |
901 | - "filetype, location, comment, url, duration, rating, key, " |
902 | + query.prepare("INSERT INTO library (artist, title, album, year, genre, composer, " |
903 | + "tracknumber, filetype, location, comment, url, duration, rating, key, " |
904 | "bitrate, samplerate, cuepoint, bpm, replaygain, wavesummaryhex, " |
905 | "timesplayed, " |
906 | "channels, mixxx_deleted, header_parsed, beats_version, beats) " |
907 | "VALUES (:artist, " |
908 | - ":title, :album, :year, :genre, :tracknumber, " |
909 | + ":title, :album, :year, :genre, :composer, :tracknumber, " |
910 | ":filetype, :location, :comment, :url, :duration, :rating, :key, " |
911 | ":bitrate, :samplerate, :cuepoint, :bpm, :replaygain, :wavesummaryhex, " |
912 | ":timesplayed, " |
913 | @@ -260,6 +260,7 @@ |
914 | query.bindValue(":album", pTrack->getAlbum()); |
915 | query.bindValue(":year", pTrack->getYear()); |
916 | query.bindValue(":genre", pTrack->getGenre()); |
917 | + query.bindValue(":composer", pTrack->getComposer()); |
918 | query.bindValue(":tracknumber", pTrack->getTrackNumber()); |
919 | query.bindValue(":filetype", pTrack->getType()); |
920 | query.bindValue(":location", trackLocationId); |
921 | @@ -421,7 +422,8 @@ |
922 | // but marked deleted? Skip this track. |
923 | LOG_FAILED_QUERY(query) |
924 | << "Failed to INSERT new track into library:" |
925 | - << pTrack->getFilename(); |
926 | + << pTrack->getFilename() |
927 | + << ", composer: \'" << pTrack->getComposer() << "\'"; |
928 | continue; |
929 | } |
930 | int trackId = query.lastInsertId().toInt(); |
931 | @@ -557,6 +559,7 @@ |
932 | QString album = query.value(query.record().indexOf("album")).toString(); |
933 | QString year = query.value(query.record().indexOf("year")).toString(); |
934 | QString genre = query.value(query.record().indexOf("genre")).toString(); |
935 | + QString composer = query.value(query.record().indexOf("composer")).toString(); |
936 | QString tracknumber = query.value(query.record().indexOf("tracknumber")).toString(); |
937 | QString comment = query.value(query.record().indexOf("comment")).toString(); |
938 | QString url = query.value(query.record().indexOf("url")).toString(); |
939 | @@ -591,6 +594,7 @@ |
940 | pTrack->setAlbum(album); |
941 | pTrack->setYear(year); |
942 | pTrack->setGenre(genre); |
943 | + pTrack->setComposer(composer); |
944 | pTrack->setTrackNumber(tracknumber); |
945 | pTrack->setRating(rating); |
946 | pTrack->setKey(key); |
947 | @@ -704,7 +708,7 @@ |
948 | QSqlQuery query(m_database); |
949 | |
950 | query.prepare( |
951 | - "SELECT library.id, artist, title, album, year, genre, tracknumber, " |
952 | + "SELECT library.id, artist, title, album, year, genre, composer, tracknumber, " |
953 | "filetype, rating, key, track_locations.location as location, " |
954 | "track_locations.filesize as filesize, comment, url, duration, bitrate, " |
955 | "samplerate, cuepoint, bpm, replaygain, wavesummaryhex, channels, " |
956 | @@ -747,7 +751,7 @@ |
957 | query.prepare("UPDATE library " |
958 | "SET artist=:artist, " |
959 | "title=:title, album=:album, year=:year, genre=:genre, " |
960 | - "filetype=:filetype, tracknumber=:tracknumber, " |
961 | + "composer=:composer, filetype=:filetype, tracknumber=:tracknumber, " |
962 | "comment=:comment, url=:url, duration=:duration, rating=:rating, key=:key, " |
963 | "bitrate=:bitrate, samplerate=:samplerate, cuepoint=:cuepoint, " |
964 | "bpm=:bpm, replaygain=:replaygain, wavesummaryhex=:wavesummaryhex, " |
965 | @@ -760,6 +764,7 @@ |
966 | query.bindValue(":album", pTrack->getAlbum()); |
967 | query.bindValue(":year", pTrack->getYear()); |
968 | query.bindValue(":genre", pTrack->getGenre()); |
969 | + query.bindValue(":composer", pTrack->getComposer()); |
970 | query.bindValue(":filetype", pTrack->getType()); |
971 | query.bindValue(":tracknumber", pTrack->getTrackNumber()); |
972 | query.bindValue(":comment", pTrack->getComment()); |
973 | @@ -984,6 +989,7 @@ |
974 | tagger.setArtist(pTrack->getArtist()); |
975 | tagger.setTitle(pTrack->getTitle()); |
976 | tagger.setGenre(pTrack->getGenre()); |
977 | + tagger.setComposer(pTrack->getComposer()); |
978 | tagger.setAlbum(pTrack->getAlbum()); |
979 | tagger.setComment(pTrack->getComment()); |
980 | tagger.setTracknumber(pTrack->getTrackNumber()); |
981 | |
982 | === modified file 'mixxx/src/library/dao/trackdao.h' |
983 | --- mixxx/src/library/dao/trackdao.h 2011-10-21 00:42:23 +0000 |
984 | +++ mixxx/src/library/dao/trackdao.h 2011-12-28 23:47:25 +0000 |
985 | @@ -25,6 +25,7 @@ |
986 | const QString LIBRARYTABLE_ALBUM = "album"; |
987 | const QString LIBRARYTABLE_YEAR = "year"; |
988 | const QString LIBRARYTABLE_GENRE = "genre"; |
989 | +const QString LIBRARYTABLE_COMPOSER = "composer"; |
990 | const QString LIBRARYTABLE_TRACKNUMBER = "tracknumber"; |
991 | const QString LIBRARYTABLE_FILETYPE = "filetype"; |
992 | const QString LIBRARYTABLE_LOCATION = "location"; |
993 | |
994 | === modified file 'mixxx/src/library/mixxxlibraryfeature.cpp' |
995 | --- mixxx/src/library/mixxxlibraryfeature.cpp 2011-12-18 20:23:14 +0000 |
996 | +++ mixxx/src/library/mixxxlibraryfeature.cpp 2011-12-28 23:47:25 +0000 |
997 | @@ -28,6 +28,7 @@ |
998 | << "library." + LIBRARYTABLE_DURATION |
999 | << "library." + LIBRARYTABLE_RATING |
1000 | << "library." + LIBRARYTABLE_GENRE |
1001 | + << "library." + LIBRARYTABLE_COMPOSER |
1002 | << "library." + LIBRARYTABLE_FILETYPE |
1003 | << "library." + LIBRARYTABLE_TRACKNUMBER |
1004 | << "library." + LIBRARYTABLE_KEY |
1005 | |
1006 | === modified file 'mixxx/src/library/trackcollection.cpp' |
1007 | --- mixxx/src/library/trackcollection.cpp 2011-10-21 02:09:53 +0000 |
1008 | +++ mixxx/src/library/trackcollection.cpp 2011-12-28 23:47:25 +0000 |
1009 | @@ -67,7 +67,7 @@ |
1010 | return false; |
1011 | } |
1012 | |
1013 | - int requiredSchemaVersion = 13; |
1014 | + int requiredSchemaVersion = 14; |
1015 | if (!SchemaManager::upgradeToSchemaVersion(m_pConfig, m_db, |
1016 | requiredSchemaVersion)) { |
1017 | QMessageBox::warning(0, tr("Cannot upgrade database schema"), |
1018 | |
1019 | === modified file 'mixxx/src/soundsource.cpp' |
1020 | --- mixxx/src/soundsource.cpp 2011-03-22 16:24:04 +0000 |
1021 | +++ mixxx/src/soundsource.cpp 2011-12-28 23:47:25 +0000 |
1022 | @@ -110,6 +110,10 @@ |
1023 | { |
1024 | return m_sGenre; |
1025 | } |
1026 | +QString SoundSource::getComposer() |
1027 | +{ |
1028 | + return m_sComposer; |
1029 | +} |
1030 | QString SoundSource::getTrackNumber() |
1031 | { |
1032 | return m_sTrackNumber; |
1033 | @@ -167,6 +171,10 @@ |
1034 | { |
1035 | m_sGenre = genre; |
1036 | } |
1037 | +void SoundSource::setComposer(QString composer) |
1038 | +{ |
1039 | + m_sComposer = composer; |
1040 | +} |
1041 | void SoundSource::setTrackNumber(QString trackNumber) |
1042 | { |
1043 | m_sTrackNumber = trackNumber; |
1044 | @@ -326,6 +334,12 @@ |
1045 | } |
1046 | } |
1047 | } |
1048 | + TagLib::ID3v2::FrameList composerFrame = id3v2->frameListMap()["TCOM"]; |
1049 | + if (!composerFrame.isEmpty()) { |
1050 | + QString sComposer = TStringToQString(composerFrame.front()->toString()); |
1051 | + setComposer(sComposer); |
1052 | + } |
1053 | + |
1054 | return true; |
1055 | } |
1056 | |
1057 | |
1058 | === modified file 'mixxx/src/soundsource.h' |
1059 | --- mixxx/src/soundsource.h 2011-11-02 01:09:26 +0000 |
1060 | +++ mixxx/src/soundsource.h 2011-12-28 23:47:25 +0000 |
1061 | @@ -75,6 +75,7 @@ |
1062 | virtual QString getComment(); |
1063 | virtual QString getYear(); |
1064 | virtual QString getGenre(); |
1065 | + virtual QString getComposer(); |
1066 | virtual QString getTrackNumber(); |
1067 | virtual float getReplayGain(); |
1068 | virtual QString getKey(); |
1069 | @@ -91,6 +92,7 @@ |
1070 | virtual void setComment(QString); |
1071 | virtual void setYear(QString); |
1072 | virtual void setGenre(QString); |
1073 | + virtual void setComposer(QString); |
1074 | virtual void setTrackNumber(QString); |
1075 | virtual void setReplayGain(float); |
1076 | virtual void setKey(QString); |
1077 | @@ -122,6 +124,7 @@ |
1078 | QString m_sComment; |
1079 | QString m_sYear; |
1080 | QString m_sGenre; |
1081 | + QString m_sComposer; |
1082 | QString m_sTrackNumber; |
1083 | float m_fReplayGain; |
1084 | QString m_sKey; |
1085 | |
1086 | === modified file 'mixxx/src/soundsourceproxy.cpp' |
1087 | --- mixxx/src/soundsourceproxy.cpp 2011-12-15 21:15:41 +0000 |
1088 | +++ mixxx/src/soundsourceproxy.cpp 2011-12-28 23:47:25 +0000 |
1089 | @@ -302,7 +302,8 @@ |
1090 | p->setType(sndsrc->getType()); |
1091 | p->setYear(sndsrc->getYear()); |
1092 | p->setGenre(sndsrc->getGenre()); |
1093 | - p->setComment(sndsrc->getComment()); |
1094 | + p->setComposer(sndsrc->getComposer()); |
1095 | + p->setComment(sndsrc->getComment()); |
1096 | p->setTrackNumber(sndsrc->getTrackNumber()); |
1097 | p->setReplayGain(sndsrc->getReplayGain()); |
1098 | p->setBpm(sndsrc->getBPM()); |
1099 | |
1100 | === modified file 'mixxx/src/trackinfoobject.cpp' |
1101 | --- mixxx/src/trackinfoobject.cpp 2011-12-18 20:23:14 +0000 |
1102 | +++ mixxx/src/trackinfoobject.cpp 2011-12-28 23:47:25 +0000 |
1103 | @@ -508,6 +508,22 @@ |
1104 | setDirty(true); |
1105 | } |
1106 | |
1107 | +QString TrackInfoObject::getComposer() const |
1108 | +{ |
1109 | + QMutexLocker lock(&m_qMutex); |
1110 | + return m_sComposer; |
1111 | +} |
1112 | + |
1113 | +void TrackInfoObject::setComposer(QString s) |
1114 | +{ |
1115 | + QMutexLocker lock(&m_qMutex); |
1116 | + s = s.trimmed(); |
1117 | + bool dirty = m_sComposer != s; |
1118 | + m_sComposer = s; |
1119 | + if (dirty) |
1120 | + setDirty(true); |
1121 | +} |
1122 | + |
1123 | QString TrackInfoObject::getTrackNumber() const |
1124 | { |
1125 | QMutexLocker lock(&m_qMutex); |
1126 | |
1127 | === modified file 'mixxx/src/trackinfoobject.h' |
1128 | --- mixxx/src/trackinfoobject.h 2011-10-03 22:37:35 +0000 |
1129 | +++ mixxx/src/trackinfoobject.h 2011-12-28 23:47:25 +0000 |
1130 | @@ -77,6 +77,7 @@ |
1131 | Q_PROPERTY(QString title READ getTitle WRITE setTitle) |
1132 | Q_PROPERTY(QString album READ getAlbum WRITE setAlbum) |
1133 | Q_PROPERTY(QString genre READ getGenre WRITE setGenre) |
1134 | + Q_PROPERTY(QString composer READ getComposer WRITE setComposer) |
1135 | Q_PROPERTY(QString year READ getYear WRITE setYear) |
1136 | Q_PROPERTY(QString track_number READ getTrackNumber WRITE setTrackNumber) |
1137 | Q_PROPERTY(int times_played READ getTimesPlayed) |
1138 | @@ -172,6 +173,10 @@ |
1139 | QString getGenre() const; |
1140 | /** Set genre */ |
1141 | void setGenre(QString); |
1142 | + /** Return composer */ |
1143 | + QString getComposer() const; |
1144 | + /** Set composer */ |
1145 | + void setComposer(QString); |
1146 | /** Return Track Number */ |
1147 | QString getTrackNumber() const; |
1148 | /** Set Track Number */ |
1149 | @@ -317,6 +322,8 @@ |
1150 | QString m_sTitle; |
1151 | /** Genre */ |
1152 | QString m_sGenre; |
1153 | + /** Composer */ |
1154 | + QString m_sComposer; |
1155 | /** Year */ |
1156 | QString m_sYear; |
1157 | /** Track Number */ |
Thanks Jonathan! I'll get the code reviewed this weekend.