Changeset View
Changeset View
Standalone View
Standalone View
src/musicaudiotrack.cpp
Show All 32 Lines | 31 | MusicAudioTrackPrivate(bool aValid, QString aId, QString aParentId, | |||
---|---|---|---|---|---|
33 | int aTrackNumber, int aDiscNumber, QTime aDuration, QUrl aResourceURI, | 33 | int aTrackNumber, int aDiscNumber, QTime aDuration, QUrl aResourceURI, | ||
34 | QDateTime fileModificationTime, QUrl aAlbumCover, int rating, | 34 | QDateTime fileModificationTime, QUrl aAlbumCover, int rating, | ||
35 | bool aIsSingleDiscAlbum, QString aGenre, QString aComposer, | 35 | bool aIsSingleDiscAlbum, QString aGenre, QString aComposer, | ||
36 | QString aLyricist, bool aHasEmbeddedCover) | 36 | QString aLyricist, bool aHasEmbeddedCover) | ||
37 | : QSharedData(), mId(std::move(aId)), mParentId(std::move(aParentId)), | 37 | : QSharedData(), mId(std::move(aId)), mParentId(std::move(aParentId)), | ||
38 | mTitle(std::move(aTitle)), mArtist(std::move(aArtist)), | 38 | mTitle(std::move(aTitle)), mArtist(std::move(aArtist)), | ||
39 | mAlbumName(std::move(aAlbumName)), mAlbumArtist(std::move(aAlbumArtist)), | 39 | mAlbumName(std::move(aAlbumName)), mAlbumArtist(std::move(aAlbumArtist)), | ||
40 | mGenre(std::move(aGenre)), mComposer(std::move(aComposer)), mLyricist(std::move(aLyricist)), | 40 | mGenre(std::move(aGenre)), mComposer(std::move(aComposer)), mLyricist(std::move(aLyricist)), | ||
41 | mResourceURI(std::move(aResourceURI)), | 41 | mResourceURI(std::move(aResourceURI)), mAlbumCover(std::move(aAlbumCover)), | ||
42 | mAlbumCover(std::move(aAlbumCover)), | | |||
43 | mFileModificationTime(std::move(fileModificationTime)), mDuration(aDuration), | 42 | mFileModificationTime(std::move(fileModificationTime)), mDuration(aDuration), | ||
44 | mTrackNumber(aTrackNumber), mDiscNumber(aDiscNumber), mRating(rating), | 43 | mTrackNumber(aTrackNumber), mDiscNumber(aDiscNumber), mRating(rating), | ||
45 | mIsValid(aValid), mIsSingleDiscAlbum(aIsSingleDiscAlbum), mHasBooleanCover(aHasEmbeddedCover) | 44 | mIsValid(aValid), mIsSingleDiscAlbum(aIsSingleDiscAlbum), mHasBooleanCover(aHasEmbeddedCover), | ||
45 | mTrackNumberIsValid(true), mDiscNumberIsValid(true) | ||||
46 | { | 46 | { | ||
47 | } | 47 | } | ||
48 | 48 | | |||
49 | QString mId; | 49 | QString mId; | ||
50 | 50 | | |||
51 | QString mParentId; | 51 | QString mParentId; | ||
52 | 52 | | |||
53 | QString mTitle; | 53 | QString mTitle; | ||
Show All 39 Lines | |||||
93 | int mRating = -1; | 93 | int mRating = -1; | ||
94 | 94 | | |||
95 | bool mIsValid = false; | 95 | bool mIsValid = false; | ||
96 | 96 | | |||
97 | bool mIsSingleDiscAlbum = true; | 97 | bool mIsSingleDiscAlbum = true; | ||
98 | 98 | | |||
99 | bool mHasBooleanCover = false; | 99 | bool mHasBooleanCover = false; | ||
100 | 100 | | |||
101 | bool mTrackNumberIsValid = false; | ||||
102 | | ||||
103 | bool mDiscNumberIsValid = false; | ||||
104 | | ||||
105 | bool mChannelsIsValid = false; | ||||
106 | | ||||
107 | bool mBitRateIsValid = false; | ||||
108 | | ||||
109 | bool mSampleRateIsValid = false; | ||||
110 | | ||||
101 | }; | 111 | }; | ||
102 | 112 | | |||
103 | MusicAudioTrack::MusicAudioTrack() : d(new MusicAudioTrackPrivate()) | 113 | MusicAudioTrack::MusicAudioTrack() : d(new MusicAudioTrackPrivate()) | ||
104 | { | 114 | { | ||
105 | } | 115 | } | ||
106 | 116 | | |||
107 | MusicAudioTrack::MusicAudioTrack(bool aValid, QString aId, QString aParentId, QString aTitle, QString aArtist, QString aAlbumName, | 117 | MusicAudioTrack::MusicAudioTrack(bool aValid, QString aId, QString aParentId, QString aTitle, QString aArtist, QString aAlbumName, | ||
108 | QString aAlbumArtist, int aTrackNumber, int aDiscNumber, QTime aDuration, QUrl aResourceURI, | 118 | QString aAlbumArtist, int aTrackNumber, int aDiscNumber, QTime aDuration, QUrl aResourceURI, | ||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 179 | { | |||
172 | result.setDatabaseId(data.databaseId()); | 182 | result.setDatabaseId(data.databaseId()); | ||
173 | result.setTitle(data.title()); | 183 | result.setTitle(data.title()); | ||
174 | result.setArtist(data.artist()); | 184 | result.setArtist(data.artist()); | ||
175 | result.setAlbumName(data.album()); | 185 | result.setAlbumName(data.album()); | ||
176 | result.setAlbumArtist(data.albumArtist()); | 186 | result.setAlbumArtist(data.albumArtist()); | ||
177 | result.setGenre(data.genre()); | 187 | result.setGenre(data.genre()); | ||
178 | result.setComposer(data.composer()); | 188 | result.setComposer(data.composer()); | ||
179 | result.setLyricist(data.lyricist()); | 189 | result.setLyricist(data.lyricist()); | ||
180 | //result.setComment(data.comment()); | 190 | result.setComment(data.comment()); | ||
181 | result.setAlbumCover(data.albumCover()); | 191 | result.setAlbumCover(data.albumCover()); | ||
182 | result.setTrackNumber(data.trackNumber()); | 192 | result.setTrackNumber(data.trackNumber()); | ||
183 | result.setDiscNumber(data.discNumber()); | 193 | result.setDiscNumber(data.discNumber()); | ||
184 | //result.setYear(data.year()); | 194 | result.setYear(data.year()); | ||
185 | //result.setChannels(data.channels()); | 195 | result.setChannels(data.channels()); | ||
186 | //result.setBitRate(data.bitRate()); | 196 | result.setBitRate(data.bitRate()); | ||
187 | //result.setSampleRate(data.sampleRate()); | 197 | result.setSampleRate(data.sampleRate()); | ||
188 | result.setResourceURI(data.resourceURI()); | 198 | result.setResourceURI(data.resourceURI()); | ||
189 | result.setRating(data.rating()); | 199 | result.setRating(data.rating()); | ||
190 | result.setDuration(data[MusicAudioTrack::TrackDataType::key_type::DurationRole].toTime()); | 200 | result.setDuration(data[MusicAudioTrack::TrackDataType::key_type::DurationRole].toTime()); | ||
191 | result.setFileModificationTime(data.fileModificationTime()); | 201 | result.setFileModificationTime(data.fileModificationTime()); | ||
192 | 202 | | |||
193 | return result; | 203 | return result; | ||
194 | } | 204 | } | ||
195 | 205 | | |||
▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Line(s) | |||||
340 | QString MusicAudioTrack::comment() const | 350 | QString MusicAudioTrack::comment() const | ||
341 | { | 351 | { | ||
342 | return d->mComment; | 352 | return d->mComment; | ||
343 | } | 353 | } | ||
344 | 354 | | |||
345 | void MusicAudioTrack::setTrackNumber(int value) | 355 | void MusicAudioTrack::setTrackNumber(int value) | ||
346 | { | 356 | { | ||
347 | d->mTrackNumber = value; | 357 | d->mTrackNumber = value; | ||
358 | d->mTrackNumberIsValid = true; | ||||
348 | } | 359 | } | ||
349 | 360 | | |||
350 | int MusicAudioTrack::trackNumber() const | 361 | int MusicAudioTrack::trackNumber() const | ||
351 | { | 362 | { | ||
352 | return d->mTrackNumber; | 363 | return d->mTrackNumber; | ||
353 | } | 364 | } | ||
354 | 365 | | |||
366 | bool MusicAudioTrack::trackNumberIsValid() const | ||||
367 | { | ||||
368 | return d->mTrackNumberIsValid; | ||||
369 | } | ||||
370 | | ||||
355 | void MusicAudioTrack::setDiscNumber(int value) | 371 | void MusicAudioTrack::setDiscNumber(int value) | ||
356 | { | 372 | { | ||
357 | d->mDiscNumber = value; | 373 | d->mDiscNumber = value; | ||
374 | d->mDiscNumberIsValid = true; | ||||
358 | } | 375 | } | ||
359 | 376 | | |||
360 | int MusicAudioTrack::discNumber() const | 377 | int MusicAudioTrack::discNumber() const | ||
361 | { | 378 | { | ||
362 | return d->mDiscNumber; | 379 | return d->mDiscNumber; | ||
363 | } | 380 | } | ||
364 | 381 | | |||
382 | bool MusicAudioTrack::discNumberIsValid() const | ||||
383 | { | ||||
384 | return d->mDiscNumberIsValid; | ||||
385 | } | ||||
386 | | ||||
365 | void MusicAudioTrack::setYear(int value) | 387 | void MusicAudioTrack::setYear(int value) | ||
366 | { | 388 | { | ||
367 | d->mYear = value; | 389 | d->mYear = value; | ||
368 | } | 390 | } | ||
369 | 391 | | |||
370 | int MusicAudioTrack::year() const | 392 | int MusicAudioTrack::year() const | ||
371 | { | 393 | { | ||
372 | return d->mYear; | 394 | return d->mYear; | ||
373 | } | 395 | } | ||
374 | 396 | | |||
375 | void MusicAudioTrack::setChannels(int value) | 397 | void MusicAudioTrack::setChannels(int value) | ||
376 | { | 398 | { | ||
377 | d->mChannels = value; | 399 | d->mChannels = value; | ||
400 | d->mChannelsIsValid = true; | ||||
378 | } | 401 | } | ||
379 | 402 | | |||
380 | int MusicAudioTrack::channels() const | 403 | int MusicAudioTrack::channels() const | ||
381 | { | 404 | { | ||
382 | return d->mChannels; | 405 | return d->mChannels; | ||
383 | } | 406 | } | ||
384 | 407 | | |||
408 | bool MusicAudioTrack::channelsIsValid() const | ||||
409 | { | ||||
410 | return d->mChannelsIsValid; | ||||
411 | } | ||||
412 | | ||||
385 | void MusicAudioTrack::setBitRate(int value) | 413 | void MusicAudioTrack::setBitRate(int value) | ||
386 | { | 414 | { | ||
387 | d->mBitRate = value; | 415 | d->mBitRate = value; | ||
416 | d->mBitRateIsValid = true; | ||||
388 | } | 417 | } | ||
389 | 418 | | |||
390 | int MusicAudioTrack::bitRate() const | 419 | int MusicAudioTrack::bitRate() const | ||
391 | { | 420 | { | ||
392 | return d->mBitRate; | 421 | return d->mBitRate; | ||
393 | } | 422 | } | ||
394 | 423 | | |||
424 | bool MusicAudioTrack::bitRateIsValid() const | ||||
425 | { | ||||
426 | return d->mBitRateIsValid; | ||||
427 | } | ||||
428 | | ||||
395 | void MusicAudioTrack::setSampleRate(int value) | 429 | void MusicAudioTrack::setSampleRate(int value) | ||
396 | { | 430 | { | ||
397 | d->mSampleRate = value; | 431 | d->mSampleRate = value; | ||
432 | d->mSampleRateIsValid = true; | ||||
398 | } | 433 | } | ||
399 | 434 | | |||
400 | int MusicAudioTrack::sampleRate() const | 435 | int MusicAudioTrack::sampleRate() const | ||
401 | { | 436 | { | ||
402 | return d->mSampleRate; | 437 | return d->mSampleRate; | ||
403 | } | 438 | } | ||
404 | 439 | | |||
440 | bool MusicAudioTrack::sampleRateIsValid() const | ||||
441 | { | ||||
442 | return d->mSampleRateIsValid; | ||||
443 | } | ||||
444 | | ||||
405 | void MusicAudioTrack::setDuration(QTime value) | 445 | void MusicAudioTrack::setDuration(QTime value) | ||
406 | { | 446 | { | ||
407 | d->mDuration = value; | 447 | d->mDuration = value; | ||
408 | } | 448 | } | ||
409 | 449 | | |||
410 | QTime MusicAudioTrack::duration() const | 450 | QTime MusicAudioTrack::duration() const | ||
411 | { | 451 | { | ||
412 | return d->mDuration; | 452 | return d->mDuration; | ||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |