output/Control: pass rvalue reference to move constructor
This commit is contained in:
parent
5ad53a7554
commit
f0d66bf6a6
@ -186,7 +186,8 @@ handle_moveoutput(Client &client, Request request, Response &response)
|
|||||||
was_enabled);
|
was_enabled);
|
||||||
else
|
else
|
||||||
/* copy the AudioOutputControl and add it to the output list */
|
/* copy the AudioOutputControl and add it to the output list */
|
||||||
dest_partition.outputs.AddCopy(output,was_enabled);
|
dest_partition.outputs.AddMoveFrom(std::move(*output),
|
||||||
|
was_enabled);
|
||||||
|
|
||||||
instance.EmitIdle(IDLE_OUTPUT);
|
instance.EmitIdle(IDLE_OUTPUT);
|
||||||
return CommandResult::OK;
|
return CommandResult::OK;
|
||||||
|
@ -41,15 +41,15 @@ AudioOutputControl::AudioOutputControl(std::unique_ptr<FilteredAudioOutput> _out
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioOutputControl::AudioOutputControl(AudioOutputControl *_output,
|
AudioOutputControl::AudioOutputControl(AudioOutputControl &&src,
|
||||||
AudioOutputClient &_client) noexcept
|
AudioOutputClient &_client) noexcept
|
||||||
:output(_output->Steal()),
|
:output(src.Steal()),
|
||||||
name(output->GetName()),
|
name(output->GetName()),
|
||||||
client(_client),
|
client(_client),
|
||||||
thread(BIND_THIS_METHOD(Task))
|
thread(BIND_THIS_METHOD(Task))
|
||||||
{
|
{
|
||||||
tags =_output->tags;
|
tags = src.tags;
|
||||||
always_on=_output->always_on;
|
always_on = src.always_on;
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioOutputControl::~AudioOutputControl() noexcept
|
AudioOutputControl::~AudioOutputControl() noexcept
|
||||||
|
@ -252,7 +252,11 @@ public:
|
|||||||
AudioOutputControl(std::unique_ptr<FilteredAudioOutput> _output,
|
AudioOutputControl(std::unique_ptr<FilteredAudioOutput> _output,
|
||||||
AudioOutputClient &_client) noexcept;
|
AudioOutputClient &_client) noexcept;
|
||||||
|
|
||||||
AudioOutputControl(AudioOutputControl *_outputControl,
|
/**
|
||||||
|
* Move the contents of an existing instance, and convert that
|
||||||
|
* existing instance to a "dummy" output.
|
||||||
|
*/
|
||||||
|
AudioOutputControl(AudioOutputControl &&src,
|
||||||
AudioOutputClient &_client) noexcept;
|
AudioOutputClient &_client) noexcept;
|
||||||
|
|
||||||
~AudioOutputControl() noexcept;
|
~AudioOutputControl() noexcept;
|
||||||
|
@ -143,11 +143,12 @@ MultipleOutputs::Add(std::unique_ptr<FilteredAudioOutput> output,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MultipleOutputs::AddCopy(AudioOutputControl *outputControl,
|
MultipleOutputs::AddMoveFrom(AudioOutputControl &&src,
|
||||||
bool enable) noexcept
|
bool enable) noexcept
|
||||||
{
|
{
|
||||||
// TODO: this operation needs to be protected with a mutex
|
// TODO: this operation needs to be protected with a mutex
|
||||||
outputs.push_back(std::make_unique<AudioOutputControl>(outputControl, client));
|
outputs.push_back(std::make_unique<AudioOutputControl>(std::move(src),
|
||||||
|
client));
|
||||||
|
|
||||||
outputs.back()->LockSetEnabled(enable);
|
outputs.back()->LockSetEnabled(enable);
|
||||||
|
|
||||||
|
@ -128,8 +128,8 @@ public:
|
|||||||
void Add(std::unique_ptr<FilteredAudioOutput> output,
|
void Add(std::unique_ptr<FilteredAudioOutput> output,
|
||||||
bool enable) noexcept;
|
bool enable) noexcept;
|
||||||
|
|
||||||
void AddCopy(AudioOutputControl *outputControl,
|
void AddMoveFrom(AudioOutputControl &&src,
|
||||||
bool enable) noexcept;
|
bool enable) noexcept;
|
||||||
|
|
||||||
|
|
||||||
void SetReplayGainMode(ReplayGainMode mode) noexcept;
|
void SetReplayGainMode(ReplayGainMode mode) noexcept;
|
||||||
|
Loading…
Reference in New Issue
Block a user