ocarina/ocarina/notify.cpp
Bryan Schumaker 5f1fb2290a ocarina: Remove old playlist code
ocarina/playlist/ was the last subdirectory remaining in the ocarina
code, and I can finally remove it.  Thank you GtkBuilder!  At this
point, there is only one ocarina header file, so I move it to the main
ocarina directory.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-05 09:13:47 -04:00

54 lines
1.1 KiB
C++

// Copyright (c) 2012 Bryan Schumaker.
#include <libsaria/idle.h>
#include "ocarina.h"
static void idle_add()
{
if (libsaria::idle::size() == 1) {
println("Adding idle callback");
g_idle_add(ocarina_idle, NULL);
}
}
void on_notify(notify_t event, void *data)
{
/* TODO: Array of function pointers */
switch (event) {
case IDLE_ADD:
idle_add();
break;
case TRACK_CHANGED:
update_labels((libsaria::Track *)data);
break;
case PATH_ADDED:
case PATH_DELETED:
case PATH_UPDATED:
notify_library(event, (libsaria::library::Path *)data);
break;
case PLAYING:
case PAUSED:
update_buttons(event);
break;
case PAUSE_TYPE:
update_autopause_type((AutoPauseType *)data);
break;
case PAUSE_COUNT:
update_autopause_count((unsigned int *)data);
break;
case PLAYLIST_NEW:
case PLAYLIST_DELETE:
case PLAYLIST_RENUMBER:
case PLAYLIST_DISABLE:
update_tabs(event, (libsaria::Playlist *)data);
break;
case PLAYLIST_ADD:
case PLAYLIST_RM:
case PLAYLIST_SIZE:
case PLAYLIST_UPDATE:
case PLAYLIST_GOTO:
update_playlist(event, (libsaria::PlaylistNotification *)data);
default:
break;
}
}