client/Client: emit idle flags in SetPartition()
This commit is contained in:
parent
7732db0aee
commit
ac126ede22
|
@ -22,6 +22,7 @@
|
||||||
#include "Partition.hxx"
|
#include "Partition.hxx"
|
||||||
#include "Instance.hxx"
|
#include "Instance.hxx"
|
||||||
#include "BackgroundCommand.hxx"
|
#include "BackgroundCommand.hxx"
|
||||||
|
#include "IdleFlags.hxx"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
Client::~Client() noexcept
|
Client::~Client() noexcept
|
||||||
|
@ -61,6 +62,25 @@ Client::OnBackgroundCommandFinished() noexcept
|
||||||
timeout_event.Schedule(client_timeout);
|
timeout_event.Schedule(client_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Client::SetPartition(Partition &new_partition) noexcept
|
||||||
|
{
|
||||||
|
if (partition == &new_partition)
|
||||||
|
return;
|
||||||
|
|
||||||
|
partition = &new_partition;
|
||||||
|
|
||||||
|
/* set idle flags for those subsystems which are specific to
|
||||||
|
the current partition to force the client to reload its
|
||||||
|
state */
|
||||||
|
idle_flags |= IDLE_PLAYLIST|IDLE_PLAYER|IDLE_MIXER|IDLE_OUTPUT|IDLE_OPTIONS;
|
||||||
|
/* note: we're not using IdleAdd() here because we don't need
|
||||||
|
to notify the client; the method is only used while this
|
||||||
|
client's "partition" command is handled, which means the
|
||||||
|
client is currently active and doesn't need to be woken
|
||||||
|
up */
|
||||||
|
}
|
||||||
|
|
||||||
Instance &
|
Instance &
|
||||||
Client::GetInstance() noexcept
|
Client::GetInstance() noexcept
|
||||||
{
|
{
|
||||||
|
|
|
@ -234,11 +234,7 @@ public:
|
||||||
return *partition;
|
return *partition;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetPartition(Partition &new_partition) noexcept {
|
void SetPartition(Partition &new_partition) noexcept;
|
||||||
partition = &new_partition;
|
|
||||||
|
|
||||||
// TODO: set various idle flags?
|
|
||||||
}
|
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
Instance &GetInstance() noexcept;
|
Instance &GetInstance() noexcept;
|
||||||
|
|
Loading…
Reference in New Issue