mixxx
mixxx copied to clipboard
Implement CO to set all QuickEffectRack Effects to the same Chain.
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.
- [x] When making the CO 0-based again ,
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.
This PR is marked as stale because it has been open 90 days with no activity.
This PR is marked as stale because it has been open 90 days with no activity.
I will move this PR to 2.5, because it is a feature.
I'm still unhappy about https://github.com/mixxxdj/mixxx/pull/11378#issuecomment-1494798902
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
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.
Fix is in #12561, please take a look.
@Swiftb0y Want rebase onto main and adjust the description?
yikes. tags galore. I don't know when I'll be able to properly pick this up. Feel free to adopt.