summaryrefslogtreecommitdiffstats
path: root/servers/audio_server.h
diff options
context:
space:
mode:
Diffstat (limited to 'servers/audio_server.h')
-rw-r--r--servers/audio_server.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/servers/audio_server.h b/servers/audio_server.h
index 16fcc029b3..9a80882dd7 100644
--- a/servers/audio_server.h
+++ b/servers/audio_server.h
@@ -99,6 +99,7 @@ public:
virtual Error init() = 0;
virtual void start() = 0;
virtual int get_mix_rate() const = 0;
+ virtual int get_input_mix_rate() const { return get_mix_rate(); }
virtual SpeakerMode get_speaker_mode() const = 0;
virtual float get_latency() { return 0; }
@@ -270,6 +271,14 @@ private:
};
struct AudioStreamPlaybackListNode {
+ // The state machine for audio stream playbacks is as follows:
+ // 1. The playback is created and added to the playback list in the playing state.
+ // 2. The playback is (maybe) paused, and the state is set to FADE_OUT_TO_PAUSE.
+ // 2.1. The playback is mixed after being paused, and the audio server thread atomically sets the state to PAUSED after performing a brief fade-out.
+ // 3. The playback is (maybe) deleted, and the state is set to FADE_OUT_TO_DELETION.
+ // 3.1. The playback is mixed after being deleted, and the audio server thread atomically sets the state to AWAITING_DELETION after performing a brief fade-out.
+ // NOTE: The playback is not deallocated at this time because allocation and deallocation are not realtime-safe.
+ // 4. The playback is removed and deallocated on the main thread using the SafeList maybe_cleanup method.
enum PlaybackState {
PAUSED = 0, // Paused. Keep this stream playback around though so it can be restarted.
PLAYING = 1, // Playing. Fading may still be necessary if volume changes!
@@ -427,6 +436,8 @@ public:
uint64_t get_mix_count() const;
uint64_t get_mixed_frames() const;
+ String get_driver_name() const;
+
void notify_listener_changed();
virtual void init();
@@ -441,6 +452,7 @@ public:
virtual SpeakerMode get_speaker_mode() const;
virtual float get_mix_rate() const;
+ virtual float get_input_mix_rate() const;
virtual float read_output_peak_db() const;