Repository navigation
audacity builtin-effects resource type - #32997
igorkorsukov merged 1 commit into
Conversation
| @@ -174,7 +174,8 @@ enum class AudioResourceType { | |||
| MuseSamplerSoundPack, | |||
| Lv2Plugin, | |||
| AudioUnit, | |||
| NyquistPlugin | |||
| NyquistPlugin, | |||
| BuiltinEffect, | |||
There was a problem hiding this comment.
"BuiltinEffect" and "MusePlugin" are the same thing, right?
There was a problem hiding this comment.
I could be convinced otherwise, but if it were just up to me I'd keep it separate, for two reasons:
NyquistPlugin would then also be a muse plugin, no? But AU still needs to distinguish the one from the other. And then should case AudioResourceType::NyquistPlugin: also return AudioFxType::MuseFx below?
AudioFxType type() const
{
switch (resourceMeta.type) {
case AudioResourceType::VstPlugin: return AudioFxType::VstFx;
case AudioResourceType::MusePlugin: return AudioFxType::MuseFx;
case AudioResourceType::AudioUnit:
case AudioResourceType::Lv2Plugin:
case AudioResourceType::FluidSoundfont:
case AudioResourceType::MuseSamplerSoundPack:
case AudioResourceType::NyquistPlugin:
case AudioResourceType::BuiltinEffect:
case AudioResourceType::Undefined: break;
}
return AudioFxType::Undefined;
}Also,
inline AudioResourceMeta makeReverbMeta()
{
AudioResourceMeta meta;
meta.id = MUSE_REVERB_ID;
meta.type = AudioResourceType::MusePlugin;
meta.vendor = "Muse";
meta.hasNativeEditorSupport = true;
return meta;
}This is in the framework's audiotypes.h, so visible by AU, and it's not an AU built-in effect. On the other hand, that function could be moved to the only place where it's used, namely musefxresolver.cpp ? That's also framework but nothing AU uses.
There was a problem hiding this comment.
NyquistPlugin would then also be a muse plugin, no? But AU still needs to distinguish the one from the other.
It appears that both terms—"MusePlugin" and "BuiltinEffect"—are incorrect in this context. It seems this enum should indicate not the plugin's ownership or delivery method, but rather its implementation, format.
There was a problem hiding this comment.
I would agree. So rename MusePlugin to maybe NativeEffect, so that it can mean MSS plugin or Audacity built-in effect or whatever native effect another application might come with?
There was a problem hiding this comment.
I like it—that's a good idea.
There was a problem hiding this comment.
Hi, in my understanding plugins have a format: AU, VST, Nyquist... or even Application specific format (or framework specific format).
And plugins could be delivered (or even built) with the app or not.
And usually "application/framework specific format" plugins tend to be delivered (and built) with the app.
so we have basically to track those two different aspect right?
There was a problem hiding this comment.
In this particular case, the discussion isn't about plugins at all, but rather about resource types.
Some resources may take the form of plugins (i.e., be supplied externally), while others may be built-in.
What is listed here is simply an enumeration of resource types—regardless of their origin. Some of these resources are effects in a specific format, while others are something else entirely (for example, "FluidSoundfont").
📝 WalkthroughWalkthroughThe PR replaces 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ffec67c to
8ea1330
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/framework/audioplugins/internal/knownaudiopluginsregister.cpp (1)
37-43:⚠️ Potential issue | 🟡 MinorInconsistent string representation for
NativeEffectacross audio plugin serialization.
RESOURCE_TYPE_TO_STRING_MAPhere uses"NativeEffect", butRESOURCE_TYPE_MAPinaudiotypes.h(line 185) maps the same enum to"muse_plugin". This creates two different JSON representations:
known_audio_plugins.json(this file): uses"NativeEffect"viametaToJson()- Project
audiosettings.json: uses"muse_plugin"viaaudioResourceTypeToString()While these files currently serve separate purposes, the divergent string representations should be documented or unified to prevent future compatibility issues if data needs to be shared or migrated between them.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/framework/audioplugins/internal/knownaudiopluginsregister.cpp` around lines 37 - 43, RESOURCE_TYPE_TO_STRING_MAP currently maps audio::AudioResourceType::NativeEffect to "NativeEffect", which conflicts with the canonical mapping in RESOURCE_TYPE_MAP (and helper audioResourceTypeToString()) that uses "muse_plugin"; update RESOURCE_TYPE_TO_STRING_MAP to use the same canonical string ("muse_plugin") for AudioResourceType::NativeEffect so both metaToJson() and audioResourceTypeToString() produce a consistent representation, or alternatively add a clear comment next to RESOURCE_TYPE_TO_STRING_MAP explaining the deliberate difference if unification is not desired.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/framework/audioplugins/internal/knownaudiopluginsregister.cpp`:
- Around line 37-43: RESOURCE_TYPE_TO_STRING_MAP currently maps
audio::AudioResourceType::NativeEffect to "NativeEffect", which conflicts with
the canonical mapping in RESOURCE_TYPE_MAP (and helper
audioResourceTypeToString()) that uses "muse_plugin"; update
RESOURCE_TYPE_TO_STRING_MAP to use the same canonical string ("muse_plugin") for
AudioResourceType::NativeEffect so both metaToJson() and
audioResourceTypeToString() produce a consistent representation, or
alternatively add a clear comment next to RESOURCE_TYPE_TO_STRING_MAP explaining
the deliberate difference if unification is not desired.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 7bd66855-63c1-4b69-bb43-ac5c6193cbba
📥 Commits
Reviewing files that changed from the base of the PR and between ffec67c6ebaf3f29abf0d7af715ad38a6733c269 and 8ea1330.
📒 Files selected for processing (4)
src/framework/audio/common/audiotypes.hsrc/framework/audio/common/audioutils.hsrc/framework/audio/tests/rpcpacker_tests.cppsrc/framework/audioplugins/internal/knownaudiopluginsregister.cpp
Resolves: audacity/audacity#10593
Needed by audacity/audacity#10597