Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Muse Sounds profile to MuseSounds (with compat) #26977

Merged
Merged
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
14 changes: 10 additions & 4 deletions src/playback/internal/playbackconfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ static const Settings::Key MUTE_HIDDEN_INSTRUMENTS(moduleName, "playback/mixer/m

static const Settings::Key DEFAULT_SOUND_PROFILE_FOR_NEW_PROJECTS(moduleName, "playback/profiles/defaultProfileName");
static const SoundProfileName BASIC_PROFILE_NAME(u"MuseScore Basic");
static const SoundProfileName MUSE_PROFILE_NAME(u"Muse Sounds");
static const SoundProfileName MUSESOUNDS_PROFILE_NAME(u"MuseSounds");
static const SoundProfileName COMPAT_MUSESOUNDS_PROFILE_NAME(u"Muse Sounds");

static Settings::Key mixerSectionVisibleKey(MixerSectionType sectionType)
{
Expand Down Expand Up @@ -294,9 +295,14 @@ const SoundProfileName& PlaybackConfiguration::basicSoundProfileName() const
return BASIC_PROFILE_NAME;
}

const SoundProfileName& PlaybackConfiguration::museSoundProfileName() const
const SoundProfileName& PlaybackConfiguration::museSoundsProfileName() const
{
return MUSE_PROFILE_NAME;
return MUSESOUNDS_PROFILE_NAME;
}

const SoundProfileName& PlaybackConfiguration::compatMuseSoundsProfileName() const
{
return COMPAT_MUSESOUNDS_PROFILE_NAME;
}

SoundProfileName PlaybackConfiguration::defaultProfileForNewProjects() const
Expand Down Expand Up @@ -347,7 +353,7 @@ bool PlaybackConfiguration::shouldMeasureInputLag() const
const SoundProfileName& PlaybackConfiguration::fallbackSoundProfileStr() const
{
if (musesamplerInfo() && musesamplerInfo()->isInstalled()) {
return MUSE_PROFILE_NAME;
return MUSESOUNDS_PROFILE_NAME;
}

return BASIC_PROFILE_NAME;
Expand Down
4 changes: 3 additions & 1 deletion src/playback/internal/playbackconfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ class PlaybackConfiguration : public IPlaybackConfiguration, public muse::async:
muse::async::Channel<bool> muteHiddenInstrumentsChanged() const override;

const SoundProfileName& basicSoundProfileName() const override;
const SoundProfileName& museSoundProfileName() const override;
const SoundProfileName& museSoundsProfileName() const override;
const SoundProfileName& compatMuseSoundsProfileName() const override;

SoundProfileName defaultProfileForNewProjects() const override;
void setDefaultProfileForNewProjects(const SoundProfileName& name) override;

Expand Down
4 changes: 2 additions & 2 deletions src/playback/internal/soundprofilesrepository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void SoundProfilesRepository::init()

SoundProfile museProfile;
museProfile.type = SoundProfileType::Muse;
museProfile.name = config()->museSoundProfileName();
museProfile.name = config()->museSoundsProfileName();
m_profilesMap.emplace(museProfile.name, std::move(museProfile));
}

Expand All @@ -47,7 +47,7 @@ void SoundProfilesRepository::refresh()
playback()->tracks()->availableInputResources()
.onResolve(this, [this](const AudioResourceMetaList& availableResources) {
SoundProfile& basicProfile = m_profilesMap.at(config()->basicSoundProfileName());
SoundProfile& museProfile = m_profilesMap.at(config()->museSoundProfileName());
SoundProfile& museProfile = m_profilesMap.at(config()->museSoundsProfileName());

for (const AudioResourceMeta& resource : availableResources) {
auto setup = resource.attributes.find(u"playbackSetupData");
Expand Down
3 changes: 2 additions & 1 deletion src/playback/iplaybackconfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class IPlaybackConfiguration : MODULE_EXPORT_INTERFACE
virtual muse::async::Channel<bool> muteHiddenInstrumentsChanged() const = 0;

virtual const SoundProfileName& basicSoundProfileName() const = 0;
virtual const SoundProfileName& museSoundProfileName() const = 0;
virtual const SoundProfileName& museSoundsProfileName() const = 0;
virtual const SoundProfileName& compatMuseSoundsProfileName() const = 0;

virtual SoundProfileName defaultProfileForNewProjects() const = 0;
virtual void setDefaultProfileForNewProjects(const SoundProfileName& name) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/playback/view/soundprofilesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void SoundProfilesModel::init()

std::sort(m_profiles.begin(), m_profiles.end(), [this](const SoundProfile& left, const SoundProfile& right) {
if (left.name == config()->basicSoundProfileName()
&& right.name == config()->museSoundProfileName()) {
&& right.name == config()->museSoundsProfileName()) {
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions src/project/internal/projectaudiosettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ Ret ProjectAudioSettings::read(const engraving::MscReader& reader)
m_activeSoundProfileName = rootObj.value("activeSoundProfile").toString();
if (m_activeSoundProfileName.empty()) {
m_activeSoundProfileName = playbackConfig()->defaultProfileForNewProjects();
} else if (m_activeSoundProfileName == playbackConfig()->compatMuseSoundsProfileName()) {
m_activeSoundProfileName = playbackConfig()->museSoundsProfileName();
}

return make_ret(Ret::Code::Ok);
Expand Down
8 changes: 7 additions & 1 deletion src/stubs/playback/playbackconfigurationstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,18 @@ const SoundProfileName& PlaybackConfigurationStub::basicSoundProfileName() const
return basic;
}

const SoundProfileName& PlaybackConfigurationStub::museSoundProfileName() const
const SoundProfileName& PlaybackConfigurationStub::museSoundsProfileName() const
{
static const SoundProfileName museSounds;
return museSounds;
}

const SoundProfileName& PlaybackConfigurationStub::compatMuseSoundsProfileName() const
{
static const SoundProfileName compatMuseSounds;
return compatMuseSounds;
}

SoundProfileName PlaybackConfigurationStub::defaultProfileForNewProjects() const
{
return {};
Expand Down
3 changes: 2 additions & 1 deletion src/stubs/playback/playbackconfigurationstub.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ class PlaybackConfigurationStub : public IPlaybackConfiguration
muse::async::Channel<bool> muteHiddenInstrumentsChanged() const override;

const SoundProfileName& basicSoundProfileName() const override;
const SoundProfileName& museSoundProfileName() const override;
const SoundProfileName& museSoundsProfileName() const override;
const SoundProfileName& compatMuseSoundsProfileName() const override;

SoundProfileName defaultProfileForNewProjects() const override;
void setDefaultProfileForNewProjects(const SoundProfileName& name) override;
Expand Down