50 lines
2.8 KiB
C
50 lines
2.8 KiB
C
|
#pragma once
|
||
|
#include <glib-object.h>
|
||
|
#include <glib.h>
|
||
|
#include <gio/gliststore.h>
|
||
|
enum {
|
||
|
/// @brief No signals have occurred.
|
||
|
PlaybackSignalNone = 0,
|
||
|
/// @brief The file was changed. Recheck the properties of the file because they are likely different.
|
||
|
PlaybackSignalFileChanged = 1 << 0,
|
||
|
/// @brief The speed was changed.
|
||
|
PlaybackSignalSpeedChanged = 1 << 1,
|
||
|
/// @brief The speed was changed.
|
||
|
PlaybackSignalTempoChanged = 1 << 2,
|
||
|
/// @brief The speed was changed.
|
||
|
PlaybackSignalPitchChanged = 1 << 3,
|
||
|
/// @brief Playback was paused. If @ref PlaybackSignalResumed has also been sent, you must use @ref Playback::IsPaused to check if playback was paused or resumed.
|
||
|
PlaybackSignalPaused = 1 << 4,
|
||
|
/// @brief Playback was resumed. If @ref PlaybackSignalPaused has also been sent, you must use @ref Playback::IsPaused to check if playback was paused or resumed.
|
||
|
PlaybackSignalResumed = 1 << 5,
|
||
|
/// @brief Playback was stopped entirely. If @ref PlaybackSignalStarted has also been signalled, call @ref Playback::IsStopped to find out if playback is currently playing.
|
||
|
PlaybackSignalStopped = 1 << 6,
|
||
|
/// @brief An error occurred and playback has likely (but not necessarily) stopped. Call @ref Playback::GetError for details.
|
||
|
PlaybackSignalErrorOccurred = 1 << 7,
|
||
|
/// @brief Playback was seeked by the @ref Playback::Seek function
|
||
|
PlaybackSignalSeeked = 1 << 8,
|
||
|
/// @brief Playback has started. If @ref PlaybackSignalStopped has also been signalled, call @ref Playback::IsStopped to find out if playback is currently playing.
|
||
|
PlaybackSignalStarted = 1 << 9
|
||
|
};
|
||
|
G_BEGIN_DECLS
|
||
|
#define LOOPER_TYPE_STREAM looper_stream_get_type()
|
||
|
#define LOOPER_TYPE_PLAYBACK looper_playback_get_type()
|
||
|
G_DECLARE_FINAL_TYPE(LooperStream, looper_stream, LOOPER, STREAM, GObject)
|
||
|
G_DECLARE_FINAL_TYPE(LooperPlayback, looper_playback, LOOPER, PLAYBACK, GObject)
|
||
|
|
||
|
LooperPlayback *looper_playback_new(void);
|
||
|
void looper_playback_load(LooperPlayback *self, const gchar *file_path);
|
||
|
void looper_playback_start(LooperPlayback *self);
|
||
|
void looper_playback_set_stream_idx(LooperPlayback *self, gint stream_idx);
|
||
|
bool looper_playback_is_paused(LooperPlayback *self);
|
||
|
void looper_playback_seek(LooperPlayback *self, gdouble position);
|
||
|
gdouble looper_playback_get_length(LooperPlayback *self);
|
||
|
gdouble looper_playback_get_position(LooperPlayback *self);
|
||
|
const gchar *looper_stream_get_name(LooperStream *self);
|
||
|
gdouble looper_stream_get_length(LooperStream *self);
|
||
|
gint looper_stream_get_id(LooperStream *self);
|
||
|
void looper_stream_set_name(LooperStream *self, const gchar *name);
|
||
|
void looper_stream_set_length(LooperStream *self, gdouble length);
|
||
|
void looper_stream_set_id(LooperStream *self, gint id);
|
||
|
GListStore *looper_playback_get_streams(LooperPlayback *self);
|
||
|
G_END_DECLS
|