Skip to content

Commit 75ee008

Browse files
committed
command/partition: apply replay_gain_mode on "moveoutput"
"moveoutput" reverted the "replay_gain_mode" to OFF. Another bug fix necessary for #2497
1 parent 421f769 commit 75ee008

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/command/PartitionCommands.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ handle_moveoutput(Client &client, Request request, Response &response)
161161
else
162162
/* copy the AudioOutputControl and add it to the output list */
163163
dest_partition.outputs.AddMoveFrom(std::move(*output),
164-
was_enabled);
164+
was_enabled,
165+
dest_partition.replay_gain_mode);
165166

166167
instance.EmitIdle(IDLE_OUTPUT);
167168
return CommandResult::OK;

src/output/MultipleOutputs.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,15 @@ MultipleOutputs::FindByName(const std::string_view name) noexcept
114114

115115
void
116116
MultipleOutputs::AddMoveFrom(AudioOutputControl &&src,
117-
bool enable) noexcept
117+
bool enable,
118+
ReplayGainMode replay_gain_mode) noexcept
118119
{
119120
// TODO: this operation needs to be protected with a mutex
120121
outputs.push_back(std::make_unique<AudioOutputControl>(std::move(src),
121122
client));
122123

123124
outputs.back()->LockSetEnabled(enable);
125+
outputs.back()->SetReplayGainMode(replay_gain_mode);
124126

125127
client.ApplyEnabled();
126128
}

src/output/MultipleOutputs.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public:
110110
}
111111

112112
void AddMoveFrom(AudioOutputControl &&src,
113-
bool enable) noexcept;
114-
113+
bool enable,
114+
ReplayGainMode replay_gain_mode) noexcept;
115115

116116
void SetReplayGainMode(ReplayGainMode mode) noexcept;
117117

0 commit comments

Comments
 (0)