mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-26 15:25:04 +02:00
* Let Track detach from TrackData when changing metadata.
This commit is contained in:
@@ -128,12 +128,63 @@ Track::~Track()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Track::setArtist( const QString& artist )
|
||||||
|
{
|
||||||
|
Q_D( Track );
|
||||||
|
|
||||||
|
d->artistPtr = artist_ptr();
|
||||||
|
d->trackData = TrackData::get( 0, artist, track() );
|
||||||
|
|
||||||
|
init();
|
||||||
|
emit updated();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Track::setAlbum( const QString& album )
|
Track::setAlbum( const QString& album )
|
||||||
{
|
{
|
||||||
Q_D( Track );
|
Q_D( Track );
|
||||||
|
|
||||||
|
d->albumPtr = album_ptr();
|
||||||
d->album = album;
|
d->album = album;
|
||||||
updateSortNames();
|
updateSortNames();
|
||||||
|
|
||||||
|
emit updated();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Track::setTrack( const QString& track )
|
||||||
|
{
|
||||||
|
Q_D( Track );
|
||||||
|
|
||||||
|
d->trackData = TrackData::get( 0, artist(), track );
|
||||||
|
|
||||||
|
init();
|
||||||
|
emit updated();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Track::setAlbumPos( unsigned int albumpos )
|
||||||
|
{
|
||||||
|
Q_D( Track );
|
||||||
|
|
||||||
|
d->albumpos = albumpos;
|
||||||
|
|
||||||
|
emit updated();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Track::setAttributes( const QVariantMap& map )
|
||||||
|
{
|
||||||
|
Q_D( Track );
|
||||||
|
|
||||||
|
d->trackData->setAttributes( map );
|
||||||
|
|
||||||
|
emit attributesLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -53,11 +53,12 @@ public:
|
|||||||
|
|
||||||
virtual ~Track();
|
virtual ~Track();
|
||||||
|
|
||||||
// void setArtist( const QString& artist ) { m_artist = artist; updateSortNames(); }
|
void setArtist( const QString& artist );
|
||||||
void setAlbum( const QString& album );
|
void setAlbum( const QString& album );
|
||||||
// void setTrack( const QString& track ) { m_track = track; updateSortNames(); }
|
void setTrack( const QString& track );
|
||||||
|
|
||||||
|
void setAlbumPos( unsigned int albumpos );
|
||||||
// void setDuration( int duration ) { m_duration = duration; }
|
// void setDuration( int duration ) { m_duration = duration; }
|
||||||
// void setAlbumPos( unsigned int albumpos ) { m_albumpos = albumpos; }
|
|
||||||
// void setDiscNumber( unsigned int discnumber ) { m_discnumber = discnumber; }
|
// void setDiscNumber( unsigned int discnumber ) { m_discnumber = discnumber; }
|
||||||
// void setComposer( const QString& composer ) { m_composer = composer; updateSortNames(); }
|
// void setComposer( const QString& composer ) { m_composer = composer; updateSortNames(); }
|
||||||
|
|
||||||
@@ -97,6 +98,7 @@ public:
|
|||||||
|
|
||||||
void loadAttributes();
|
void loadAttributes();
|
||||||
QVariantMap attributes() const;
|
QVariantMap attributes() const;
|
||||||
|
void setAttributes( const QVariantMap& map );
|
||||||
|
|
||||||
void loadStats();
|
void loadStats();
|
||||||
QList< Tomahawk::PlaybackLog > playbackHistory( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() ) const;
|
QList< Tomahawk::PlaybackLog > playbackHistory( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() ) const;
|
||||||
|
Reference in New Issue
Block a user