core/tags/track: Remove tag accessor functions
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
192bdc3ac7
commit
9c1cbbf8cb
|
@ -145,7 +145,7 @@ static void validate_library(struct library *&library)
|
|||
struct track *track, *next;
|
||||
|
||||
db_for_each(track, next, track_db_get()) {
|
||||
if (track->library() != library)
|
||||
if (track->tr_library != library)
|
||||
continue;
|
||||
|
||||
if (g_file_test(track->path().c_str(), G_FILE_TEST_EXISTS) == false) {
|
||||
|
@ -168,7 +168,7 @@ void collection :: init()
|
|||
library_q.load();
|
||||
|
||||
db_for_each(track, next, track_db_get()) {
|
||||
if (track->library()->li_enabled)
|
||||
if (track->tr_library->li_enabled)
|
||||
library_q.add(track);
|
||||
}
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ void collection :: set_enabled(struct library *library, bool enabled)
|
|||
library_set_enabled(library, enabled);
|
||||
|
||||
db_for_each(track, next, track_db_get()) {
|
||||
if (track->library() == library) {
|
||||
if (track->tr_library == library) {
|
||||
if (enabled)
|
||||
library_q.add(track);
|
||||
else
|
||||
|
|
|
@ -80,11 +80,11 @@ static inline int track_compare(struct track *lhs, struct track *rhs, sort_t fie
|
|||
{
|
||||
switch (field) {
|
||||
case SORT_ARTIST:
|
||||
return artist_compare(lhs->artist(), rhs->artist());
|
||||
return artist_compare(lhs->tr_artist, rhs->tr_artist);
|
||||
case SORT_COUNT:
|
||||
return lhs->count() - rhs->count();
|
||||
case SORT_GENRE:
|
||||
return genre_compare(lhs->genre(), rhs->genre());
|
||||
return genre_compare(lhs->tr_genre, rhs->tr_genre);
|
||||
case SORT_LENGTH:
|
||||
return lhs->length() - rhs->length();
|
||||
case SORT_PLAYED:
|
||||
|
@ -94,10 +94,10 @@ static inline int track_compare(struct track *lhs, struct track *rhs, sort_t fie
|
|||
case SORT_TRACK:
|
||||
return lhs->track_nr() - rhs->track_nr();
|
||||
case SORT_YEAR:
|
||||
if (lhs->album()->al_year - rhs->album()->al_year != 0)
|
||||
return lhs->album()->al_year - rhs->album()->al_year;
|
||||
if (lhs->tr_album->al_year - rhs->tr_album->al_year != 0)
|
||||
return lhs->tr_album->al_year - rhs->tr_album->al_year;
|
||||
case SORT_ALBUM:
|
||||
return album_compare(lhs->album(), rhs->album());
|
||||
return album_compare(lhs->tr_album, rhs->tr_album);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -62,11 +62,6 @@ track :: ~track()
|
|||
tr_library->li_size--;
|
||||
}
|
||||
|
||||
struct album *track :: album() { return tr_album; }
|
||||
struct artist *track :: artist() { return tr_artist; }
|
||||
struct genre *track :: genre() { return tr_genre; }
|
||||
struct library *track :: library() { return tr_library; }
|
||||
|
||||
unsigned int track :: count() { return tr_count; }
|
||||
unsigned int track :: length() { return tr_length; }
|
||||
unsigned int track :: track_nr() { return tr_track; }
|
||||
|
@ -189,7 +184,7 @@ void track_remove_all(struct library *library)
|
|||
struct track *it, *next;
|
||||
|
||||
db_for_each(it, next, &track_db) {
|
||||
if (it->library() == library)
|
||||
if (it->tr_library == library)
|
||||
db_remove(&track_db, it);
|
||||
}
|
||||
track_db_commit();
|
||||
|
|
|
@ -66,8 +66,8 @@ public:
|
|||
g_object_set(G_OBJECT(gst_player), "uri", uri, NULL);
|
||||
g_free(uri);
|
||||
|
||||
set_markup(o_album, "x-large", "From: " + track->album()->al_name);
|
||||
set_markup(o_artist, "x-large", "By: " + track->artist()->ar_name);
|
||||
set_markup(o_album, "x-large", "From: " + track->tr_album->al_name);
|
||||
set_markup(o_artist, "x-large", "By: " + track->tr_artist->ar_name);
|
||||
set_markup(o_title, "xx-large", track->name());
|
||||
o_duration->set_text(len);
|
||||
g_free(len);
|
||||
|
|
|
@ -117,13 +117,13 @@ void QueueModel::get_value_vfunc(const Gtk::TreeIter &iter, int column,
|
|||
g_free(str);
|
||||
return;
|
||||
case 3:
|
||||
return set_val(track->artist()->ar_name, value);
|
||||
return set_val(track->tr_artist->ar_name, value);
|
||||
case 4:
|
||||
return set_val(track->album()->al_name, value);
|
||||
return set_val(track->tr_album->al_name, value);
|
||||
case 5:
|
||||
return set_val(track->album()->al_year, value);
|
||||
return set_val(track->tr_album->al_year, value);
|
||||
case 6:
|
||||
return set_val(track->genre()->ge_name, value);
|
||||
return set_val(track->tr_genre->ge_name, value);
|
||||
case 7:
|
||||
return set_val(track->count(), value);
|
||||
case 8:
|
||||
|
|
|
@ -58,11 +58,6 @@ struct track : public GenericTag {
|
|||
~track(); /**< Track destructor. */
|
||||
|
||||
|
||||
struct album *album(); /**< @return Track::_album. */
|
||||
struct artist *artist(); /**< @return Track::_artist. */
|
||||
struct genre *genre(); /**< @return Track::_genre. */
|
||||
struct library *library(); /**< @return Track::_library. */
|
||||
|
||||
unsigned int count(); /**< @return Track::_count. */
|
||||
unsigned int length(); /**< @return Track::_length. */
|
||||
unsigned int track_nr(); /**< @return Track::_track. */
|
||||
|
|
|
@ -24,10 +24,10 @@ static void test_track_tag_default()
|
|||
{
|
||||
struct track track;
|
||||
|
||||
test_equal(track.album(), (struct album *)NULL);
|
||||
test_equal(track.artist(), (struct artist *)NULL);
|
||||
test_equal(track.genre(), (struct genre *)NULL);
|
||||
test_equal(track.library(), (struct library *)NULL);
|
||||
test_equal(track.tr_album, (struct album *)NULL);
|
||||
test_equal(track.tr_artist, (struct artist *)NULL);
|
||||
test_equal(track.tr_genre, (struct genre *)NULL);
|
||||
test_equal(track.tr_library, (struct library *)NULL);
|
||||
|
||||
test_equal(track.name(), (std::string)"");
|
||||
test_equal(track.lowercase(), (std::string)"");
|
||||
|
@ -42,10 +42,10 @@ static void test_track_tag_default()
|
|||
|
||||
static void verify_track_tag(struct track *track, unsigned int size)
|
||||
{
|
||||
test_equal(track->album(), album);
|
||||
test_equal(track->artist(), artist);
|
||||
test_equal(track->genre(), genre);
|
||||
test_equal(track->library(), library);
|
||||
test_equal(track->tr_album, album);
|
||||
test_equal(track->tr_artist, artist);
|
||||
test_equal(track->tr_genre, genre);
|
||||
test_equal(track->tr_library, library);
|
||||
|
||||
test_equal(track->name(), (std::string)"Legend of Zelda Medley");
|
||||
test_equal(track->lowercase(), (std::string)"legend of zelda medley");
|
||||
|
|
Loading…
Reference in New Issue