diff options
author | Uwe Klotz <uwe_klotz@web.de> | 2017-11-04 12:01:54 +0100 |
---|---|---|
committer | Uwe Klotz <uwe_klotz@web.de> | 2017-11-06 22:27:21 +0100 |
commit | a02cffd9aff9150cef257b7d342da5b72fddb214 (patch) | |
tree | 9a288999ca594b289efe135186539ae6efb25567 /src/sources/metadatasource.h | |
parent | 03222e3568ce25cebc592fb12867588c5947d047 (diff) |
Prepare next level of metadata synchronization
...by tracking synchronization (import/export) with an external source
with time stamps instead of only a boolean flag.
Diffstat (limited to 'src/sources/metadatasource.h')
-rw-r--r-- | src/sources/metadatasource.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/sources/metadatasource.h b/src/sources/metadatasource.h index 56e9ade414..740f65e10b 100644 --- a/src/sources/metadatasource.h +++ b/src/sources/metadatasource.h @@ -1,7 +1,10 @@ #pragma once +#include <QDateTime> #include <QImage> +#include <utility> + #include "track/trackmetadata.h" #include "util/memory.h" @@ -10,6 +13,10 @@ namespace mixxx { // API and abstract base class for parsing track metadata and // cover art. +// +// The time stamp returned from the source when importing/exporting +// metadata reflects the current version of the metadata at the source +// and can be used for synchronization purposes. class MetadataSource { public: virtual ~MetadataSource() {} @@ -25,10 +32,10 @@ class MetadataSource { // and might be passed a nullptr if their result is not needed. // If no metadata is available for a track then the source should // return Unavailable as this default implementation does. - virtual ImportResult importTrackMetadataAndCoverImage( + virtual std::pair<ImportResult, QDateTime> importTrackMetadataAndCoverImage( TrackMetadata* /*pTrackMetadata*/, QImage* /*pCoverImage*/) const { - return ImportResult::Unavailable; + return std::make_pair(ImportResult::Unavailable, QDateTime()); } enum class ExportResult { @@ -40,9 +47,9 @@ class MetadataSource { // Update track metadata of the source. // Sources that are read-only and don't support updating of metadata // should return Unsupported as this default implementation does. - virtual ExportResult exportTrackMetadata( + virtual std::pair<ExportResult, QDateTime> exportTrackMetadata( const TrackMetadata& /*trackMetadata*/) const { - return ExportResult::Unsupported; + return std::make_pair(ExportResult::Unsupported, QDateTime()); } }; |