Add doxygen documentation for callbacks.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2014-09-12 16:26:17 -04:00
parent 0a9c6d296b
commit 97c6c836d3
2 changed files with 53 additions and 2 deletions

View File

@ -1,4 +1,5 @@
/*
/**
* @file
* Copyright 2014 (c) Anna Schumaker.
*/
#include <core/callback.h>

View File

@ -1,4 +1,5 @@
/*
/**
* @file
* Copyright 2014 (c) Anna Schumaker.
*/
#ifndef OCARINA_CORE_CALLBACK_H
@ -8,21 +9,70 @@
#include <core/queue.h>
/**
* 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();