callbacks: Remove unused queue callback
I now mimic the effects of the "changed" callback with inheritance. This makes for a cleaner implementation. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
5bfdc31204
commit
5df79d3c08
|
@ -22,7 +22,6 @@ static struct Callbacks callbacks = {
|
|||
.on_queue_track_add = no_op,
|
||||
.on_queue_track_del = no_op,
|
||||
.on_queue_track_changed = no_op,
|
||||
.on_queue_changed = no_op,
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -109,8 +109,6 @@ unsigned int Queue :: _add_at(Track *track, unsigned int pos)
|
|||
_tracks.insert(_tracks.begin() + pos, track);
|
||||
_length += track->length;
|
||||
get_callbacks()->on_queue_track_add(this, pos);
|
||||
if (!(_flags & Q_DISABLE_CHANGED_SIZE))
|
||||
get_callbacks()->on_queue_changed();
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
@ -119,8 +117,6 @@ void Queue :: _del_at(Track *track, unsigned int pos)
|
|||
_tracks.erase(_tracks.begin() + pos);
|
||||
_length -= track->length;
|
||||
get_callbacks()->on_queue_track_del(this, pos);
|
||||
if (!(_flags & Q_DISABLE_CHANGED_SIZE))
|
||||
get_callbacks()->on_queue_changed();
|
||||
}
|
||||
|
||||
unsigned int Queue :: add(Track *track)
|
||||
|
@ -244,7 +240,6 @@ void Queue :: sort(sort_t field, bool reset)
|
|||
|
||||
for (unsigned int i = 0; i < _tracks.size(); i++)
|
||||
get_callbacks()->on_queue_track_changed(this, i);
|
||||
get_callbacks()->on_queue_changed();
|
||||
}
|
||||
|
||||
Track *Queue :: operator[](unsigned int i)
|
||||
|
|
|
@ -22,7 +22,6 @@ struct Callbacks {
|
|||
void (*on_queue_track_add)(Queue *, unsigned int);
|
||||
void (*on_queue_track_del)(Queue *, unsigned int);
|
||||
void (*on_queue_track_changed)(Queue *, unsigned int);
|
||||
void (*on_queue_changed)();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -15,10 +15,9 @@ enum queue_flags {
|
|||
Q_RANDOM = (1 << 1),
|
||||
Q_REPEAT = (1 << 2),
|
||||
Q_NO_SORT = (1 << 3),
|
||||
Q_DISABLE_CHANGED_SIZE = (1 << 31),
|
||||
};
|
||||
|
||||
static const unsigned int Q_FLAG_MASK = Q_ENABLED | Q_RANDOM | Q_REPEAT | Q_NO_SORT | Q_DISABLE_CHANGED_SIZE;
|
||||
static const unsigned int Q_FLAG_MASK = Q_ENABLED | Q_RANDOM | Q_REPEAT | Q_NO_SORT;
|
||||
|
||||
struct sort_info {
|
||||
sort_t field;
|
||||
|
|
Loading…
Reference in New Issue