diff --git a/core/callback.cpp b/core/callback.cpp index 0c210f0c..1b4bf0c7 100644 --- a/core/callback.cpp +++ b/core/callback.cpp @@ -1,4 +1,5 @@ -/* +/** + * @file * Copyright 2014 (c) Anna Schumaker. */ #include diff --git a/include/core/callback.h b/include/core/callback.h index d8f84df1..6c0f57cf 100644 --- a/include/core/callback.h +++ b/include/core/callback.h @@ -1,4 +1,5 @@ -/* +/** + * @file * Copyright 2014 (c) Anna Schumaker. */ #ifndef OCARINA_CORE_CALLBACK_H @@ -8,21 +9,70 @@ #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();