summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/xas/bank.h34
1 files changed, 23 insertions, 11 deletions
diff --git a/include/xas/bank.h b/include/xas/bank.h
index 9f877d0..be623f0 100644
--- a/include/xas/bank.h
+++ b/include/xas/bank.h
@@ -5,8 +5,10 @@
#include <xas/audio.h>
-#define XAS_BANK_IDLE 0
-#define XAS_BANK_ACTIVE (1 << 0)
+enum xas_bank_player_status {
+ XAS_BANK_PLAYER_STOPPED,
+ XAS_BANK_PLAYER_PLAYING,
+};
typedef struct _xas_bank_entry {
size_t duration;
@@ -17,13 +19,17 @@ typedef struct _xas_bank {
size_t entry_size,
entry_count;
+} xas_bank;
+
+typedef struct _xas_bank_player {
+ xas_bank *bank;
+ enum xas_bank_player_status status;
- int flags;
float gain;
size_t entry,
index;
-} xas_bank;
+} xas_bank_player;
xas_bank *xas_bank_new(xas_audio_format format,
size_t entry_size,
@@ -31,17 +37,23 @@ xas_bank *xas_bank_new(xas_audio_format format,
void xas_bank_destroy(xas_bank *bank);
-int xas_bank_play(xas_bank *bank, size_t entry, float gain);
-
-void xas_bank_stop(xas_bank *bank);
-
-int xas_bank_active(xas_bank *bank);
-
ssize_t xas_bank_record(xas_bank *bank,
xas_audio_stream *input,
size_t entry_index,
size_t count);
-xas_audio_stream *xas_bank_stream_new(xas_bank *bank);
+xas_bank_player *xas_bank_player_new(xas_bank *bank);
+
+void xas_bank_player_destroy(xas_bank_player *player);
+
+int xas_bank_player_start(xas_bank_player *player,
+ size_t entry,
+ float gain);
+
+int xas_bank_player_stop(xas_bank_player *player);
+
+int xas_bank_player_playing(xas_bank_player *player);
+
+xas_audio_stream *xas_bank_player_stream_new(xas_bank_player *player);
#endif /* _XAS_BANK_H */