/** * @file * Copyright 2014 (c) Anna Schumaker. */ #ifndef OCARINA_CORE_CALLBACK_H #define OCARINA_CORE_CALLBACK_H #include #include /** * A structure for managing callback function pointers */ struct Callbacks { /* Audio callbacks */ /** * Called when the audio layer loads a track. * * @param track The track that was just loaded. */ void (*on_track_loaded)(Track *); /** * Called when the audio layer's pause count changes. * * @param enabled The current status of automatic pausing. * @param n The number of tracks before pausing. */ void (*on_pause_count_changed)(bool, unsigned int); /* Deck callbacks */ /** * Called when a queue is removed. * * @param queue The queue that is being removed. */ void (*on_pq_removed)(Queue *); /* Queue callbacks */ /** * Called when tracks are added to a queue. * * @param queue The queue that was just modified. * @param row The index of the new track. */ void (*on_queue_track_add)(Queue *, unsigned int); /** * Called when tracks are removed from a queue * * @param queue The queue that was just modified. * @param row The former index of the track. */ void (*on_queue_track_del)(Queue *, unsigned int); /** * Called when a track's metadata changes. * * @param queue The queue containing the track. * @param row The current index of the track. */ void (*on_queue_track_changed)(Queue *, unsigned int); }; /** * Called to access the callbacks structure. * * @return The current struct Callbacks for this application. */ struct Callbacks *get_callbacks(); #endif /* OCARINA_CORE_CALLBACK_H */