62 lines
1.3 KiB
C
62 lines
1.3 KiB
C
/**
|
|
* @file
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
*/
|
|
#ifndef OCARINA_CORE_CALLBACK_H
|
|
#define OCARINA_CORE_CALLBACK_H
|
|
|
|
#include <core/library.h>
|
|
#include <core/queue.h>
|
|
|
|
|
|
/**
|
|
* A structure for managing callback function pointers
|
|
*/
|
|
struct Callbacks {
|
|
/* 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 */
|