Skip to content

Commit

Permalink
use io::completeBasename for generating resourceId as it was before PR
Browse files Browse the repository at this point in the history
…musescore#16990

(to maintain backward compatibility with old projects)
  • Loading branch information
RomanPudashkin committed Jul 4, 2023
1 parent aec4811 commit a33d4ed
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ mu::Ret RegisterAudioPluginsScenario::registerFailedPlugin(const io::path_t& plu
}

AudioPluginInfo info;
info.meta.id = io::filename(pluginPath).toStdString();
info.meta.id = io::completeBasename(pluginPath).toStdString();

std::string ext = io::suffix(pluginPath);
if (ext.find("vst") != std::string::npos) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ TEST_F(Audio_RegisterAudioPluginsScenarioTest, RegisterFailedPlugin)

// [THEN] The plugin has been registered
AudioPluginInfo expectedPluginInfo;
expectedPluginInfo.meta.id = mu::io::filename(pluginPath).toStdString();
expectedPluginInfo.meta.id = mu::io::completeBasename(pluginPath).toStdString();
expectedPluginInfo.meta.type = AudioResourceType::VstPlugin;
expectedPluginInfo.path = pluginPath;
expectedPluginInfo.enabled = false;
Expand Down
4 changes: 0 additions & 4 deletions src/framework/vst/internal/vstplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ void VstPlugin::load()
continue;
}

if (classInfo.name() != m_resourceId) {
continue;
}

m_pluginProvider = std::make_unique<VstPluginProvider>(factory, classInfo);
m_classInfo = classInfo;
break;
Expand Down
3 changes: 2 additions & 1 deletion src/framework/vst/internal/vstpluginmetareader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ mu::RetVal<AudioResourceMetaList> VstPluginMetaReader::readMeta(const io::path_t
}

audio::AudioResourceMeta meta;
meta.id = classInfo.name();
meta.id = io::completeBasename(pluginPath).toStdString();
meta.type = audio::AudioResourceType::VstPlugin;
meta.attributes.emplace(audio::CATEGORIES_ATTRIBUTE, String::fromStdString(classInfo.subCategoriesString()));
meta.vendor = classInfo.vendor();
meta.hasNativeEditorSupport = hasNativeEditorSupport();

result.emplace_back(std::move(meta));
break;
}

return RetVal<AudioResourceMetaList>::make_ok(result);
Expand Down

0 comments on commit a33d4ed

Please sign in to comment.