mixxx icon indicating copy to clipboard operation
mixxx copied to clipboard

Implement CO to set all QuickEffectRack Effects to the same Chain.

Open Swiftb0y opened this issue 1 year ago • 10 comments

Fixes #11371

Current Issues to discuss:

  • [ ] [QuickEffectRack1] is a new CO group, not sure if thats desired or where else to put the CO.
  • [x] [QuickEffectRack1],loaded_chain_preset is zero-based while their [QuickEffectRack1_[ChannelN]] equivalent is 1-based. Considering the first real preset starts at 2 now (since 1 is the empty chain introduced in #10859).
    • [x] When making the CO 0-based again ,[EqualizerRack1] and [EffectRack1] loaded_chain_preset now get initialized to weird, very large values for some reason.

Swiftb0y avatar Mar 15 '23 22:03 Swiftb0y

Quick note: #10859 introduced the inconsistency that QuickEffectRack1_[ChannelN] loaded_chain_preset is now offset by one compared to [EffectRack1_EffectUnitN] because of the prepended empty preset.

Swiftb0y avatar Apr 03 '23 18:04 Swiftb0y

This PR is marked as stale because it has been open 90 days with no activity.

github-actions[bot] avatar Jul 03 '23 00:07 github-actions[bot]

This PR is marked as stale because it has been open 90 days with no activity.

github-actions[bot] avatar Oct 03 '23 00:10 github-actions[bot]

I will move this PR to 2.5, because it is a feature.

daschuer avatar Jan 12 '24 09:01 daschuer

I'm still unhappy about https://github.com/mixxxdj/mixxx/pull/11378#issuecomment-1494798902

Swiftb0y avatar Jan 12 '24 11:01 Swiftb0y

Yeah, that's a pity, sorry for that!

I'm checking whether it's feasible to fix the index issue while avoiding the issue with standard effect chains I described in https://github.com/mixxxdj/mixxx/pull/10859#discussion_r962314889

TLDR - the dilemma: You can select --- in a any chain to clear all slots. Since all effect chains provide controls to load effects, the actually write-protected chain preset can be modified (saving won't work though). Hence you can have the '---' preset loaded and effects loaded, which renders the '---' item useless (you'd need to select another preset first, the '---').

Actually we can run into this situation with any chain, but it's problematic only for the standard chains due to how their states are saved to effects.xml. We save

  • preset name
  • states of all parameters of all slots

So when restoring standard chains on startup, we restore the previous state, but also select the '---' item, hence it's useless again.

(for QuickEffect and EQ chains it's all good: only the preset name is stored, so if the '---' preset has been modified in one of these chains we'd now load the desired empty preset)

Workaround (dirty)

  • prepend '---' to all preset lists
  • catch EffectSlot::effectChanged
  • if '---' is loaded and the slot is not empty:
    • load (nameless) empty preset (initial state of standard chains)
    • reload the selected effect
    • all good again, '---' is unloaded and can be used to clear the chain

Workaround (somewhat clean)

  • migrate the chain state to a new, nameless preset, preferrably with a new EffectChainPresetManager method
  • = do all of the above, just without the effect unload/reload hack

I'm working on it, will try to revert existing / not introduce more hacks/inconsistencies. Maybe fast and clean enough to integrate it into 2.4.0

ronso0 avatar Jan 12 '24 18:01 ronso0

When making the CO 0-based again ,[EqualizerRack1] and [EffectRack1] loaded_chain_preset now get initialized to weird, very large values for some reason.

4.29497e+09 to be precise ; )

int -> uint wrap-around? EffectChain::presetIndex() gets int from EffectChainPresetManager::quickEffectPresetIndex(presetName) but EffectChain::setControlLoadedPresetIndex expects uint.

I have WIP where I add the --- preset to the common chain preset list and make loaded_chain_preset 0-indexed, so we get QuickEffect & standard effect chains:

  • unknown preset: -1 (default with clean profile)
  • know presets incl. `---: 0 - end

EQ chains + main output chain:

  • always -1 because we don't load presets, only an effect into slot 1

How to proceed? My WIP at least that restores consistency, while avoiding the --- save/restore issue I described above. I'll share it soonish.

ronso0 avatar Jan 13 '24 00:01 ronso0

Fix is in #12561, please take a look.

ronso0 avatar Jan 13 '24 15:01 ronso0

@Swiftb0y Want rebase onto main and adjust the description?

ronso0 avatar Feb 18 '24 23:02 ronso0

yikes. tags galore. I don't know when I'll be able to properly pick this up. Feel free to adopt.

Swiftb0y avatar Feb 18 '24 23:02 Swiftb0y