window_get_mouse_position returns a struct, claude wrote me a state machine for main.cpp, compositor queues animations on type instead of one queue, change from uint32_t to *_handle_t, improve compositor performance, generic raii wrapper in main.cpp over multiple structs.
This commit is contained in:
1 parent
a12c9a3e8f
commit
02b5bc8b52
7 files changed
+748
-490
No files matched your search
+9
-8
@@ -12,6 +12,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct audio_t audio_t;
|
||||
typedef uint32_t audio_stream_id_t;
|
||||
|
||||
// If the return type is bool, false means failure.
|
||||
|
||||
@@ -34,7 +35,7 @@ void audio_free_data(uint8_t* data);
|
||||
// data must remain valid until the stream ends or is stopped
|
||||
// loop: if true, the stream restarts on EOF
|
||||
// 0 means failure, valid IDs start from 1
|
||||
uint32_t audio_play(audio_t* audio,
|
||||
audio_stream_id_t audio_play(audio_t* audio,
|
||||
const uint8_t* data,
|
||||
int size,
|
||||
int channels,
|
||||
@@ -42,22 +43,22 @@ uint32_t audio_play(audio_t* audio,
|
||||
bool loop);
|
||||
|
||||
// Stop and remove stream by ID
|
||||
bool audio_stop(audio_t* audio, uint32_t id);
|
||||
bool audio_stop(audio_t* audio, audio_stream_id_t id);
|
||||
|
||||
bool audio_pause(audio_t* audio, uint32_t id);
|
||||
bool audio_resume(audio_t* audio, uint32_t id);
|
||||
bool audio_pause(audio_t* audio, audio_stream_id_t id);
|
||||
bool audio_resume(audio_t* audio, audio_stream_id_t id);
|
||||
|
||||
// Returns true if the stream is active (playing or paused)
|
||||
bool audio_is_active(audio_t* audio, uint32_t id);
|
||||
bool audio_is_active(audio_t* audio, audio_stream_id_t id);
|
||||
|
||||
// Returns true if the stream is currently playing (not paused, not stopped)
|
||||
bool audio_is_playing(audio_t* audio, uint32_t id);
|
||||
bool audio_is_playing(audio_t* audio, audio_stream_id_t id);
|
||||
|
||||
// Per-stream volume, immediate effect, range [0.0, 1.0]
|
||||
bool audio_set_volume(audio_t* audio, uint32_t id, float volume);
|
||||
bool audio_set_volume(audio_t* audio, audio_stream_id_t id, float volume);
|
||||
|
||||
// Animate per-stream volume linearly over time, driven by audio_tick()
|
||||
bool audio_animate_volume(audio_t* audio, uint32_t id,
|
||||
bool audio_animate_volume(audio_t* audio, audio_stream_id_t id,
|
||||
float to_volume, float duration_sec);
|
||||
|
||||
// Global volume, immediate effect, range [0.0, 1.0]
|
||||
|
||||
Reference in new issue
Block a user