# HG changeset patch # User Chris Cannam # Date 1730282783 0 # Wed Oct 30 10:06:23 2024 +0000 # Branch toggle-record-in-io # Node ID 9bdee315ebcdcfd3d42874fa5ebf2a896daa123d # Parent 3b9a5f51f24786116993e4900715f2a1e580add6 Rename to suppressRecordSide to clarify that the default is enabled; provide stub versions in other implementations diff --git a/bqaudioio/SystemAudioIO.h b/bqaudioio/SystemAudioIO.h --- a/bqaudioio/SystemAudioIO.h +++ b/bqaudioio/SystemAudioIO.h @@ -72,13 +72,15 @@ bool isReady() const { return isSourceReady() && isTargetReady(); } /** - * Enable or disable recording. Both recording and playback are - * enabled by default; if you call enableRecordSide(false), the - * record side may be switched off on subsequent stream resumption - * until any following call to enableRecordSide(true). This is - * optional, not all implementations will implement it. + * Suppress or re-enable recording. By default both recording and + * playback are enabled, and an active stream will be duplex. A + * call to suppressRecordSide(true) may be used to hint that the + * record side should remain closed until any following call to + * suppressRecordSide(false). These calls should be made while the + * stream is suspended. This is only a hint; not all + * implementations will implement it. */ - virtual void enableRecordSide(bool enable) = 0; + virtual void suppressRecordSide(bool suppress) = 0; protected: SystemAudioIO(ApplicationRecordTarget *target, diff --git a/src/JACKAudioIO.h b/src/JACKAudioIO.h --- a/src/JACKAudioIO.h +++ b/src/JACKAudioIO.h @@ -66,6 +66,8 @@ void suspend() override {} void resume() override {} + void suppressRecordSide(bool) override {} + double getCurrentTime() const override; std::string getStartupErrorString() const { return m_startupError; } diff --git a/src/PortAudioIO.cpp b/src/PortAudioIO.cpp --- a/src/PortAudioIO.cpp +++ b/src/PortAudioIO.cpp @@ -504,8 +504,9 @@ } void -PortAudioIO::enableRecordSide(bool enabled) +PortAudioIO::suppressRecordSide(bool suppress) { + bool enabled = !suppress; if (enabled == m_recordEnabled) { return; } diff --git a/src/PortAudioIO.h b/src/PortAudioIO.h --- a/src/PortAudioIO.h +++ b/src/PortAudioIO.h @@ -70,7 +70,7 @@ virtual void suspend() override; virtual void resume() override; - virtual void enableRecordSide(bool) override; + virtual void suppressRecordSide(bool) override; std::string getStartupErrorString() const { return m_startupError; } diff --git a/src/PulseAudioIO.h b/src/PulseAudioIO.h --- a/src/PulseAudioIO.h +++ b/src/PulseAudioIO.h @@ -76,6 +76,8 @@ void suspend() override; void resume() override; + void suppressRecordSide(bool) override {} + std::string getStartupErrorString() const { return m_startupError; } protected: