Skip to content

audacity builtin-effects resource type - #32997

Merged
igorkorsukov merged 1 commit into
musescore:masterfrom
saintmatthieu:audacity-builtin-effects-resource-type
Apr 13, 2026
Merged

igorkorsukov merged 1 commit into
musescore:masterfrom
saintmatthieu:audacity-builtin-effects-resource-type

Conversation

@saintmatthieu

Copy link
Copy Markdown
Contributor

Resolves: audacity/audacity#10593

Needed by audacity/audacity#10597

  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

Comment thread src/framework/audio/common/audiotypes.h Outdated
@@ -174,7 +174,8 @@ enum class AudioResourceType {
MuseSamplerSoundPack,
Lv2Plugin,
AudioUnit,
NyquistPlugin
NyquistPlugin,
BuiltinEffect,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"BuiltinEffect" and "MusePlugin" are the same thing, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it—that's a good idea.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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").

@coderabbitai

coderabbitai Bot commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The PR replaces MusePlugin with NativeEffect in the AudioResourceType enum and updates RESOURCE_TYPE_MAP so "muse_plugin" maps to NativeEffect; it also adds mappings for "lv2_plugin", "audio_unit", and "nyquist_plugin". AudioFxParams::type() and sourceTypeFromResourceType() switch cases were changed accordingly. Serialization support (RESOURCE_TYPE_TO_STRING_MAP) now includes NativeEffect. makeReverbMeta() sets reverb resources to NativeEffect. A test was updated to initialize AudioResourceMeta::type as NativeEffect.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'audacity builtin-effects resource type' is vague and generic, using non-descriptive terms that don't clearly convey what the changeset implements. Provide a more specific title that clearly describes the main change, such as 'Replace MusePlugin with NativeEffect in AudioResourceType enum'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description includes all required template sections with checkboxes completed, references the linked issue, and indicates the author's commitment to code quality standards.
Linked Issues check ✅ Passed The changes rename MusePlugin to NativeEffect and add mappings for plugin types, supporting the consolidation of effect metadata storage required by issue #10593.
Out of Scope Changes check ✅ Passed All changes are focused on refactoring the AudioResourceType enum and related mappings to support the metadata consolidation objective, with no extraneous modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@saintmatthieu
saintmatthieu force-pushed the audacity-builtin-effects-resource-type branch from ffec67c to 8ea1330 Compare April 13, 2026 11:30

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟡 Minor

Inconsistent string representation for NativeEffect across audio plugin serialization.

RESOURCE_TYPE_TO_STRING_MAP here uses "NativeEffect", but RESOURCE_TYPE_MAP in audiotypes.h (line 185) maps the same enum to "muse_plugin". This creates two different JSON representations:

  • known_audio_plugins.json (this file): uses "NativeEffect" via metaToJson()
  • Project audiosettings.json: uses "muse_plugin" via audioResourceTypeToString()

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.h
  • src/framework/audio/common/audioutils.h
  • src/framework/audio/tests/rpcpacker_tests.cpp
  • src/framework/audioplugins/internal/knownaudiopluginsregister.cpp

@igorkorsukov
igorkorsukov merged commit 19c508d into musescore:master Apr 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Effect-enabled toggle implementation

3 participants