Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/playback/qml/MuseScore/Playback/mixerchannelitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* MuseScore Studio
* Music Composition & Notation
*
* Copyright (C) 2021 MuseScore Limited and others
* Copyright (C) 2026 MuseScore Limited and others
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
Expand Down Expand Up @@ -181,7 +181,7 @@ void MixerChannelItem::addBlankSlots(size_t count)
for (size_t i = 0; i < count; ++i) {
AudioFxParams params;
params.chainOrder = resolveNewBlankOutputResourceItemOrder();
m_outputResourceItems.insert(params.chainOrder, buildOutputResourceItem(std::move(params)));
m_outputResourceItems.insert(params.chainOrder, buildOutputResourceItem(params));
}

emit outputResourceItemListChanged();
Expand Down Expand Up @@ -365,7 +365,7 @@ void MixerChannelItem::loadSoloMuteState(const notation::INotationSoloMuteState:
}
}

void MixerChannelItem::subscribeOnAudioSignalChanges(AudioSignalChanges&& audioSignalChanges)
void MixerChannelItem::subscribeOnAudioSignalChanges(AudioSignalChanges& audioSignalChanges)
{
m_audioSignalChanges = audioSignalChanges;

Expand Down
2 changes: 1 addition & 1 deletion src/playback/qml/MuseScore/Playback/mixerchannelitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class MixerChannelItem : public QObject, public muse::async::Asyncable, public m
void loadOutputParams(const project::AudioOutputParams& newParams);
void loadSoloMuteState(const notation::INotationSoloMuteState::SoloMuteState& newState);

void subscribeOnAudioSignalChanges(muse::audio::AudioSignalChanges&& audioSignalChanges);
void subscribeOnAudioSignalChanges(muse::audio::AudioSignalChanges& audioSignalChanges);

bool outputOnly() const;

Expand Down
32 changes: 13 additions & 19 deletions src/playback/qml/MuseScore/Playback/mixerpanelmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,29 +270,29 @@ void MixerPanelModel::setupConnections()
TrackId trackId = muse::value(auxTrackIdMap, index);

if (MixerChannelItem* item = findChannelItem(trackId)) {
item->loadSoloMuteState(std::move(newSoloMuteState));
item->loadSoloMuteState(newSoloMuteState);
}
});

playback()->sourceParamsChanged().onReceive(this, [this](const TrackId trackId, const AudioSourceParams& params) {
if (MixerChannelItem* item = findChannelItem(trackId)) {
item->loadInputParams(std::move(params));
item->loadInputParams(params);
}
});

playback()->fxChainParamsChanged().onReceive(this, [this](const TrackId trackId, const AudioFxChain& params) {
if (MixerChannelItem* item = findChannelItem(trackId)) {
AudioOutputParams outParams = audioSettings()->trackOutputParams(item->instrumentTrackId());
outParams.fxChain = params;
loadOutputParams(item, std::move(outParams));
loadOutputParams(item, outParams);
}
});

playback()->masterFxChainParamsChanged().onReceive(this, [this](const AudioFxChain& params) {
if (m_masterChannelItem) {
AudioOutputParams outParams = audioSettings()->masterAudioOutputParams();
outParams.fxChain = params;
loadOutputParams(m_masterChannelItem, std::move(outParams));
loadOutputParams(m_masterChannelItem, outParams);
}
}, Asyncable::Mode::SetReplace);

Expand Down Expand Up @@ -418,13 +418,13 @@ MixerChannelItem* MixerPanelModel::buildInstrumentChannelItem(const TrackId trac
playback()->params(trackId)
.onResolve(this, [this, trackId, instrumentTrackId](const TrackParams& params) {
if (MixerChannelItem* item = findChannelItem(trackId)) {
item->loadInputParams(std::move(params.source));
item->loadInputParams(params.source);

AudioOutputParams outParams = audioSettings()->trackOutputParams(instrumentTrackId);
outParams.fxChain = params.fxChain;
outParams.auxSends = params.auxSends;
outParams.setControl(params.control);
loadOutputParams(item, std::move(outParams));
loadOutputParams(item, outParams);
}
})
.onReject(this, [](int errCode, std::string text) {
Expand All @@ -446,7 +446,7 @@ MixerChannelItem* MixerPanelModel::buildInstrumentChannelItem(const TrackId trac
playback()->signalChanges(trackId)
.onResolve(this, [this, trackId](AudioSignalChanges signalChanges) {
if (MixerChannelItem* item = findChannelItem(trackId)) {
item->subscribeOnAudioSignalChanges(std::move(signalChanges));
item->subscribeOnAudioSignalChanges(signalChanges);
}
})
.onReject(this, [](int errCode, std::string text) {
Expand Down Expand Up @@ -503,16 +503,12 @@ MixerChannelItem* MixerPanelModel::buildAuxChannelItem(aux_channel_idx_t index,
});

AudioOutputParams outParams = audioSettings()->auxOutputParams(index);
if (MixerChannelItem* existingItem = findChannelItem(trackId)) {
loadOutputParams(existingItem, std::move(outParams));
} else {
loadOutputParams(item, std::move(outParams));
}
loadOutputParams(item, outParams);

playback()->signalChanges(trackId)
.onResolve(this, [this, trackId](AudioSignalChanges signalChanges) {
if (MixerChannelItem* item = findChannelItem(trackId)) {
item->subscribeOnAudioSignalChanges(std::move(signalChanges));
item->subscribeOnAudioSignalChanges(signalChanges);
}
})
.onReject(this, [](int errCode, std::string text) {
Expand Down Expand Up @@ -545,14 +541,12 @@ MixerChannelItem* MixerPanelModel::buildMasterChannelItem()
item->setTitle(muse::qtrc("playback", "Master"));

AudioOutputParams outParams = audioSettings()->masterAudioOutputParams();
if (m_masterChannelItem && item == m_masterChannelItem) {
loadOutputParams(item, std::move(outParams));
}
loadOutputParams(item, outParams);

playback()->masterSignalChanges()
.onResolve(this, [this, item](AudioSignalChanges signalChanges) {
if (m_masterChannelItem && item == m_masterChannelItem) {
item->subscribeOnAudioSignalChanges(std::move(signalChanges));
item->subscribeOnAudioSignalChanges(signalChanges);
}
})
.onReject(this, [](int errCode, std::string text) {
Expand Down Expand Up @@ -591,13 +585,13 @@ MixerChannelItem* MixerPanelModel::findChannelItem(const TrackId& trackId) const
return nullptr;
}

void MixerPanelModel::loadOutputParams(MixerChannelItem* item, AudioOutputParams&& params)
void MixerPanelModel::loadOutputParams(MixerChannelItem* item, const AudioOutputParams& params)
{
IF_ASSERT_FAILED(item) {
return;
}

item->loadOutputParams(std::move(params));
item->loadOutputParams(params);
updateOutputResourceItemCount();
}

Expand Down
2 changes: 1 addition & 1 deletion src/playback/qml/MuseScore/Playback/mixerpanelmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class MixerPanelModel : public QAbstractListModel, public QQmlParserStatus, publ

MixerChannelItem* findChannelItem(const muse::audio::TrackId& trackId) const;

void loadOutputParams(MixerChannelItem* item, project::AudioOutputParams&& params);
void loadOutputParams(MixerChannelItem* item, const project::AudioOutputParams& params);
void updateOutputResourceItemCount();

project::INotationProjectPtr currentProject() const;
Expand Down
Loading