diff --git a/src/AudioTools/AudioPlayer.h b/src/AudioTools/AudioPlayer.h index 4a332479f3..13fe2cb0f8 100644 --- a/src/AudioTools/AudioPlayer.h +++ b/src/AudioTools/AudioPlayer.h @@ -109,8 +109,8 @@ namespace audio_tools { void setOutput(AudioOutput& output){ if (p_decoder->isResultPCM()){ - this->fade.setTarget(output); - this->volume_out.setTarget(fade); + this->fade.setOutput(output); + this->volume_out.setOutput(fade); delete this->p_out_decoding; this->p_out_decoding = new EncodedAudioOutput(&volume_out, p_decoder); } else { @@ -123,8 +123,8 @@ namespace audio_tools { void setOutput(Print &output){ if (p_decoder->isResultPCM()){ - this->fade.setTarget(output); - this->volume_out.setTarget(fade); + this->fade.setOutput(output); + this->volume_out.setOutput(fade); delete this->p_out_decoding; this->p_out_decoding = new EncodedAudioOutput(&volume_out, p_decoder); } else { @@ -137,8 +137,8 @@ namespace audio_tools { void setOutput(AudioStream& output){ if (p_decoder->isResultPCM()){ - this->fade.setTarget(output); - this->volume_out.setTarget(fade); + this->fade.setOutput(output); + this->volume_out.setOutput(fade); delete this->p_out_decoding; this->p_out_decoding = new EncodedAudioOutput(&volume_out, p_decoder); } else { diff --git a/src/AudioTools/Fade.h b/src/AudioTools/Fade.h index 91d754bd0e..8512e6e7da 100644 --- a/src/AudioTools/Fade.h +++ b/src/AudioTools/Fade.h @@ -240,15 +240,23 @@ class LastSampleFader { class FadeStream : public AudioStream { public: FadeStream() = default; - FadeStream(Print &out) { setTarget(out); } - FadeStream(Stream &io) { setTarget(io); } + FadeStream(Print &out) { setOutput(out); } + FadeStream(Stream &io) { setStream(io); } - void setTarget(Stream &io) { + void setStream(Stream &io) { p_io = &io; p_out = &io; } - void setTarget(Print &out) { p_out = &out; } + void setOutput(Print &out) { p_out = &out; } + + /// same as setStream + void setOutput(Stream &io) { + p_io = &io; + } + + /// same as setOutput + void setStream(Print &out) { p_out = &out; } void setAudioInfo(AudioInfo info) override { AudioStream::setAudioInfo(info); diff --git a/src/AudioTools/VolumeStream.h b/src/AudioTools/VolumeStream.h index 8f96807ba1..1a31ee98c5 100644 --- a/src/AudioTools/VolumeStream.h +++ b/src/AudioTools/VolumeStream.h @@ -36,7 +36,7 @@ class VolumeStream : public AudioStream { /// Constructor which assigns Print output VolumeStream(Print &out) { - setTarget(out); + setOutput(out); } /// Constructor which assigns Stream input or output @@ -47,7 +47,7 @@ class VolumeStream : public AudioStream { /// Constructor which assigns Print output VolumeStream(AudioOutput &out) { Print *p_print = &out; - setTarget(*p_print); + setOutput(*p_print); p_notify = (AudioInfoSupport*) &out; } @@ -58,21 +58,26 @@ class VolumeStream : public AudioStream { p_notify = (AudioInfoSupport *)&io; } + /// Defines/Changes the input & output + void setStream(Stream &in){ + p_in = ∈ + p_out = p_in; + } + /// Defines/Changes the output target - void setTarget(Print &out){ + void setOutput(Print &out){ p_out = &out; } - + /// same as setStream - void setTarget(Stream &in){ + void setOutput(Stream &in){ p_in = ∈ p_out = p_in; } - /// Defines/Changes the input & output - void setStream(Stream &in){ - p_in = ∈ - p_out = p_in; + /// same as set Output + void setStream(Print &out){ + p_out = &out; } VolumeStreamConfig defaultConfig() {