13dadd25ef
It has no users now that the stop button has been removed. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
78 lines
1.8 KiB
C
78 lines
1.8 KiB
C
/*
|
|
* Copyright 2013 (c) Anna Schumaker.
|
|
*
|
|
* The gst_init() function parses command line options passed to Ocarina
|
|
* through argv. Use the command `gst-inspect-1.0 --help-gst` to find
|
|
* what options are supported.
|
|
*/
|
|
#ifndef OCARINA_CORE_AUDIO_H
|
|
#define OCARINA_CORE_AUDIO_H
|
|
#include <core/tags/track.h>
|
|
#include <gst/gst.h>
|
|
|
|
|
|
struct audio_ops {
|
|
/* Called when a track is loaded. */
|
|
void (*on_load)(struct track *);
|
|
|
|
/* Called when playback state changes. */
|
|
void (*on_state_change)(GstState);
|
|
|
|
/* Called when the automatic pause state changes. */
|
|
void (*on_config_pause)(int);
|
|
};
|
|
|
|
|
|
/* Called to initialize the audio manager. */
|
|
void audio_init(int *, char ***, struct audio_ops *);
|
|
|
|
/* Called to deinitialize the audio manager. */
|
|
void audio_deinit();
|
|
|
|
|
|
/* Called to load a track for playback. */
|
|
bool audio_load(struct track *);
|
|
|
|
/* Called to get the current track. */
|
|
struct track *audio_cur_track();
|
|
|
|
/* Called to get the current playback state. */
|
|
GstState audio_cur_state();
|
|
|
|
|
|
/* Called to begin playback. */
|
|
bool audio_play();
|
|
|
|
/* Called to pause playback. */
|
|
bool audio_pause();
|
|
|
|
/* Called to seek playback to a specific offset, in nanoseconds. */
|
|
bool audio_seek(gint64);
|
|
|
|
/* Called to find the current playback position, in nanoseconds. */
|
|
gint64 audio_position();
|
|
|
|
/* Called to find the duration of the current track. */
|
|
gint64 audio_duration();
|
|
|
|
|
|
/* Called to load the next track. */
|
|
struct track *audio_next();
|
|
|
|
/* Called to load the previous track. */
|
|
struct track *audio_prev();
|
|
|
|
/* Called when playback has reached the end-of-stream position. */
|
|
struct track *audio_eos();
|
|
|
|
/* Called when gstreamer has received an error. */
|
|
void audio_error(GstMessage *);
|
|
|
|
/* Called to configure automatic pausing. */
|
|
void audio_pause_after(int);
|
|
|
|
#ifdef CONFIG_TESTING
|
|
GstElement *test_audio_player();
|
|
#endif /* CONFIG_TESTING */
|
|
#endif /* OCARINA_CORE_AUDIO_H */
|