Fixes #994 - moveoutput: new AudioOutputControl created from copyMoving an output to a partition is now done via MultipleOutputs::AddCopy(),using a new AudioOutputControl constructor. Tags and always_on settings willpersist when moving outputs between partitions.
This commit is contained in:
parent
60d19b2380
commit
ba5531f9dd
2
NEWS
2
NEWS
|
@ -1,6 +1,8 @@
|
||||||
ver 0.22.4 (not yet released)
|
ver 0.22.4 (not yet released)
|
||||||
* decoder
|
* decoder
|
||||||
- dsdiff: apply padding to odd-sized chunks
|
- dsdiff: apply padding to odd-sized chunks
|
||||||
|
* output
|
||||||
|
- moveoutput: fix always_on and tag lost on move
|
||||||
|
|
||||||
ver 0.22.3 (2020/11/06)
|
ver 0.22.3 (2020/11/06)
|
||||||
* playlist
|
* playlist
|
||||||
|
|
|
@ -183,9 +183,8 @@ handle_moveoutput(Client &client, Request request, Response &response)
|
||||||
existing_output->ReplaceDummy(output->Steal(),
|
existing_output->ReplaceDummy(output->Steal(),
|
||||||
was_enabled);
|
was_enabled);
|
||||||
else
|
else
|
||||||
/* add it to the output list */
|
/* copy the AudioOutputControl and add it to the output list */
|
||||||
dest_partition.outputs.Add(output->Steal(),
|
dest_partition.outputs.AddCopy(output,was_enabled);
|
||||||
was_enabled);
|
|
||||||
|
|
||||||
instance.EmitIdle(IDLE_OUTPUT);
|
instance.EmitIdle(IDLE_OUTPUT);
|
||||||
return CommandResult::OK;
|
return CommandResult::OK;
|
||||||
|
|
|
@ -39,6 +39,17 @@ AudioOutputControl::AudioOutputControl(std::unique_ptr<FilteredAudioOutput> _out
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AudioOutputControl::AudioOutputControl(AudioOutputControl *_output,
|
||||||
|
AudioOutputClient &_client) noexcept
|
||||||
|
:output(std::move(_output->Steal())),
|
||||||
|
name(output->GetName()),
|
||||||
|
client(_client),
|
||||||
|
thread(BIND_THIS_METHOD(Task))
|
||||||
|
{
|
||||||
|
tags =_output->tags;
|
||||||
|
always_on=_output->always_on;
|
||||||
|
}
|
||||||
|
|
||||||
AudioOutputControl::~AudioOutputControl() noexcept
|
AudioOutputControl::~AudioOutputControl() noexcept
|
||||||
{
|
{
|
||||||
StopThread();
|
StopThread();
|
||||||
|
|
|
@ -245,6 +245,9 @@ public:
|
||||||
AudioOutputControl(std::unique_ptr<FilteredAudioOutput> _output,
|
AudioOutputControl(std::unique_ptr<FilteredAudioOutput> _output,
|
||||||
AudioOutputClient &_client) noexcept;
|
AudioOutputClient &_client) noexcept;
|
||||||
|
|
||||||
|
AudioOutputControl(AudioOutputControl *_outputControl,
|
||||||
|
AudioOutputClient &_client) noexcept;
|
||||||
|
|
||||||
~AudioOutputControl() noexcept;
|
~AudioOutputControl() noexcept;
|
||||||
|
|
||||||
AudioOutputControl(const AudioOutputControl &) = delete;
|
AudioOutputControl(const AudioOutputControl &) = delete;
|
||||||
|
|
|
@ -140,6 +140,19 @@ MultipleOutputs::Add(std::unique_ptr<FilteredAudioOutput> output,
|
||||||
client.ApplyEnabled();
|
client.ApplyEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MultipleOutputs::AddCopy(AudioOutputControl *outputControl,
|
||||||
|
bool enable) noexcept
|
||||||
|
{
|
||||||
|
// TODO: this operation needs to be protected with a mutex
|
||||||
|
outputs.emplace_back(std::make_unique<AudioOutputControl>(outputControl,
|
||||||
|
client));
|
||||||
|
|
||||||
|
outputs.back()->LockSetEnabled(enable);
|
||||||
|
|
||||||
|
client.ApplyEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MultipleOutputs::EnableDisable()
|
MultipleOutputs::EnableDisable()
|
||||||
{
|
{
|
||||||
|
|
|
@ -128,6 +128,10 @@ 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,
|
||||||
|
bool enable) noexcept;
|
||||||
|
|
||||||
|
|
||||||
void SetReplayGainMode(ReplayGainMode mode) noexcept;
|
void SetReplayGainMode(ReplayGainMode mode) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue