libsaria: Remove PLAYLIST_SIZE notification
Instead, the UI should change the size during PLAYLIST_ADD and PLAYLIST_RM. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
a6fa805a53
commit
671dd7eb3a
|
@ -21,7 +21,6 @@ enum notify_t {
|
|||
PLAYLIST_ADD, // libsaria::PlaylistNotification *
|
||||
PLAYLIST_RM, // libsaria::PlaylistNotification *
|
||||
PLAYLIST_UPDATE, // libsaria::PlaylistNotification *
|
||||
PLAYLIST_SIZE, // libsaria::PlaylistNotification *
|
||||
PLAYLIST_GOTO, // libsaria::PlaylistNotification *
|
||||
NOTIFY_SIZE,
|
||||
};
|
||||
|
|
|
@ -20,7 +20,6 @@ namespace libsaria
|
|||
index.add_track(track);
|
||||
track->add_playlist(this);
|
||||
notify_ui(PLAYLIST_ADD, track, ins_index);
|
||||
notify_ui(PLAYLIST_SIZE, NULL, 0);
|
||||
data_state = DIRTY;
|
||||
schedule_save();
|
||||
if (plist.size() == 1)
|
||||
|
@ -41,7 +40,6 @@ namespace libsaria
|
|||
if (cur >= plist.size())
|
||||
cur = 0;
|
||||
notify_ui(PLAYLIST_RM, track, rm_index);
|
||||
notify_ui(PLAYLIST_SIZE, NULL, 0);
|
||||
data_state = DIRTY;
|
||||
schedule_save();
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ void on_notify(notify_t event, void *data)
|
|||
break;
|
||||
case PLAYLIST_ADD:
|
||||
case PLAYLIST_RM:
|
||||
case PLAYLIST_SIZE:
|
||||
case PLAYLIST_UPDATE:
|
||||
case PLAYLIST_GOTO:
|
||||
update_playlist(event, (libsaria::PlaylistNotification *)data);
|
||||
|
|
|
@ -103,14 +103,14 @@ static void playlist_goto_index(libsaria::Playlist *playlist, unsigned int index
|
|||
|
||||
void update_playlist(notify_t event, libsaria::PlaylistNotification *data)
|
||||
{
|
||||
if (event == PLAYLIST_ADD)
|
||||
if (event == PLAYLIST_ADD) {
|
||||
playlist_add(data->plist, data->track, data->index);
|
||||
else if (event == PLAYLIST_RM)
|
||||
playlist_rm(data->plist, data->index);
|
||||
else if (event == PLAYLIST_UPDATE)
|
||||
playlist_update(data->plist, data->track, data->index);
|
||||
else if (event == PLAYLIST_SIZE)
|
||||
set_playlist_size(data->plist);
|
||||
} else if (event == PLAYLIST_RM) {
|
||||
playlist_rm(data->plist, data->index);
|
||||
set_playlist_size(data->plist);
|
||||
} else if (event == PLAYLIST_UPDATE)
|
||||
playlist_update(data->plist, data->track, data->index);
|
||||
else if (event == PLAYLIST_GOTO)
|
||||
playlist_goto_index(data->plist, data->index);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user