Changeset View
Changeset View
Standalone View
Standalone View
src/core-impl/collections/db/sql/SqlMeta.h
Show All 20 Lines | |||||
21 | 21 | | |||
22 | #include "core/meta/Meta.h" | 22 | #include "core/meta/Meta.h" | ||
23 | #include "core/meta/Statistics.h" | 23 | #include "core/meta/Statistics.h" | ||
24 | #include "core/meta/TrackEditor.h" | 24 | #include "core/meta/TrackEditor.h" | ||
25 | #include "core/meta/support/MetaConstants.h" | 25 | #include "core/meta/support/MetaConstants.h" | ||
26 | #include "amarok_sqlcollection_export.h" | 26 | #include "amarok_sqlcollection_export.h" | ||
27 | #include "FileType.h" | 27 | #include "FileType.h" | ||
28 | 28 | | |||
29 | #include <QAtomicInt> | ||||
29 | #include <QByteArray> | 30 | #include <QByteArray> | ||
30 | #include <QMutex> | 31 | #include <QMutex> | ||
31 | #include <QReadWriteLock> | 32 | #include <QReadWriteLock> | ||
32 | #include <QString> | 33 | #include <QString> | ||
33 | #include <QStringList> | 34 | #include <QStringList> | ||
34 | #include <QVariant> | 35 | #include <QVariant> | ||
35 | 36 | | |||
36 | namespace Capabilities { | 37 | namespace Capabilities { | ||
▲ Show 20 Lines • Show All 387 Lines • ▼ Show 20 Line(s) | 394 | private: | |||
424 | * Note: setImage will not delete the already set image. | 425 | * Note: setImage will not delete the already set image. | ||
425 | */ | 426 | */ | ||
426 | void setImage( const QString &path ); | 427 | void setImage( const QString &path ); | ||
427 | 428 | | |||
428 | /** Finds or creates a magic value in the database which tells Amarok not to auto fetch an image since it has been explicitly unset. | 429 | /** Finds or creates a magic value in the database which tells Amarok not to auto fetch an image since it has been explicitly unset. | ||
429 | */ | 430 | */ | ||
430 | int unsetImageId() const; | 431 | int unsetImageId() const; | ||
431 | 432 | | |||
432 | private: | | |||
433 | Collections::SqlCollection* const m_collection; | 433 | Collections::SqlCollection* const m_collection; | ||
434 | 434 | | |||
435 | enum TracksLoadingStatus | ||||
436 | { | ||||
437 | NotLoaded, | ||||
438 | Loading, | ||||
439 | Loaded | ||||
440 | }; | ||||
435 | 441 | | |||
436 | QString m_name; | 442 | const QString m_name; | ||
437 | int m_id; // the id of this album in the database | 443 | const int m_id; // the id of this album in the database | ||
438 | int m_artistId; | 444 | const int m_artistId; | ||
439 | int m_imageId; | 445 | int m_imageId; | ||
440 | mutable QString m_imagePath; // path read from the database | 446 | mutable QString m_imagePath; // path read from the database | ||
441 | mutable bool m_hasImage; // true if we have an original image | 447 | mutable bool m_hasImage; // true if we have an original image | ||
442 | mutable bool m_hasImageChecked; // true if hasImage was checked | 448 | mutable bool m_hasImageChecked; // true if hasImage was checked | ||
443 | 449 | | |||
444 | mutable int m_unsetImageId; // this is the id of the unset magic value in the image sql database | 450 | mutable int m_unsetImageId; // this is the id of the unset magic value in the image sql database | ||
445 | static const QString AMAROK_UNSET_MAGIC; | 451 | static const QString AMAROK_UNSET_MAGIC; | ||
446 | 452 | | |||
447 | bool m_tracksLoaded; | 453 | TracksLoadingStatus m_tracksLoaded; | ||
448 | bool m_suppressAutoFetch; | 454 | bool m_suppressAutoFetch; | ||
449 | Meta::ArtistPtr m_artist; | 455 | Meta::ArtistPtr m_artist; | ||
450 | Meta::TrackList m_tracks; | 456 | Meta::TrackList m_tracks; | ||
451 | mutable QMutex m_mutex; | 457 | mutable QMutex m_mutex; | ||
452 | 458 | | |||
453 | //TODO: add album artist | 459 | //TODO: add album artist | ||
454 | 460 | | |||
455 | friend class ::SqlRegistry; // needs to call notifyObservers | 461 | friend class ::SqlRegistry; // needs to call notifyObservers | ||
Show All 17 Lines | 467 | { | |||
473 | 479 | | |||
474 | private: | 480 | private: | ||
475 | Collections::SqlCollection* const m_collection; | 481 | Collections::SqlCollection* const m_collection; | ||
476 | 482 | | |||
477 | const int m_id; | 483 | const int m_id; | ||
478 | const QString m_name; | 484 | const QString m_name; | ||
479 | 485 | | |||
480 | bool m_tracksLoaded; | 486 | bool m_tracksLoaded; | ||
487 | bool m_tracksLoading; | ||||
481 | Meta::TrackList m_tracks; | 488 | Meta::TrackList m_tracks; | ||
482 | QMutex m_mutex; | 489 | QMutex m_mutex; | ||
483 | 490 | | |||
484 | friend class ::SqlRegistry; // needs to call notifyObservers | 491 | friend class ::SqlRegistry; // needs to call notifyObservers | ||
485 | friend class Meta::SqlTrack; // needs to call notifyObservers | 492 | friend class Meta::SqlTrack; // needs to call notifyObservers | ||
486 | }; | 493 | }; | ||
487 | 494 | | |||
488 | class SqlGenre : public Meta::Genre | 495 | class SqlGenre : public Meta::Genre | ||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |