Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"SWS/S&M: Toggle selected FX bypass for selected tracks" action only toggles first selected FX, not all selected #1443

Open
earhax opened this issue Nov 2, 2020 · 6 comments · May be fixed by #1444

Comments

@earhax
Copy link

earhax commented Nov 2, 2020

With more than one effect selected in the track FX UI, using the menu command to bypass will in fact bypass all selected effects. This action, however, will only bypass the first effect selected.

@jameadows
Copy link

Hi, I want to get up to speed on the SWS code and thought that tackling some bugs would be a good place to start. I looked into this one and I'm stuck looking for how to determine which FX are selected.

I believe the fix needs to go in SetOrToggleFXBypassSelTracks() in SnM_FX.cpp, switch case 2. Here it needs to loop through all of the track FX like cases 1 and 4 do, but also check if the FX is selected.

Is there a way for me to determine if an FX is selected? I found a function called GetSelectedTrackFX() but it looks like this only returns a single FX Id, even if multiple FX are selected.

Thanks!
-Joe

@nofishonfriday
Copy link
Collaborator

nofishonfriday commented Nov 3, 2020

Hi,
nice to see a new contributer, welcome! :)

@cfillion added CF_EnumSelectedFX.
code here:

sws/cfillion/cfillion.cpp

Lines 294 to 301 in 0c99559

int CF_EnumSelectedFX(HWND fxChain, const int index)
{
if(!fxChain)
return -1;
const HWND list = GetDlgItem(fxChain, 1076);
return ListView_GetNextItem(list, index, LVNI_SELECTED);
}

Does this help?

@jameadows
Copy link

Awesome, from a quick glance that looks like just the thing. Thanks for the pointer and the welcome! I recently started using Reaper on Linux and quickly discovered SWS. Very cool stuff, I hope I can be of some use to the project.
Cheers,
Joe

jameadows pushed a commit to jameadows/sws that referenced this issue Nov 3, 2020
Iterate through effects on selected tracks and toggle
the enabled state.

Fixes reaper-oss#1443
@jameadows
Copy link

@nofishonfriday thanks again for the pointer to CF_EnumSelectedFX(), that's what I needed. I tested the change with some combinations of multiple tracks and fx chains being selected and it seems to behave the way I think it's supposed to.

@cfillion
Copy link
Member

cfillion commented Nov 4, 2020

The current implementation of "SWS/S&M: Toggle selected FX bypass for selected tracks" also works when the FX chain is closed (because it relies on the selected FX index stored in the track's project data). I think the current behavior should be preserved when the FX chain is not shown.

There are a few other SWS actions that rely on the old "one selected FX" concept. Ideally, for consistency, these would also benefit from a multi-FX selection update, such as "SWS/S&M: Bypass selected FX for selected tracks".

@jameadows
Copy link

FX chain is not shown.

Would I detect this by CF_GetTrackFXChain() returns NULL, then just fall back to the current behavior?

There are a few other SWS actions that rely on the old "one selected FX" concept. Ideally, for consistency, these would also benefit from an update, such as "SWS/S&M: Bypass selected FX for selected tracks".

I'll look for these, please let me know if there's any that you have in mind.

jameadows pushed a commit to jameadows/sws that referenced this issue Nov 11, 2020
is not opened, i.e. toggle the current fx index for the track.

Fixes reaper-oss#1443
jameadows pushed a commit to jameadows/sws that referenced this issue Nov 18, 2020
For each selected track, if the effects window is open
then iterate through effects and toggle the enabled state.

Fall back to previous behavior if the effects window for the track
is not opened, i.e. toggle the current fx index for the track.

Fixes reaper-oss#1443
jameadows pushed a commit to jameadows/sws that referenced this issue Dec 7, 2020
For each selected track, if the effects window is open
then iterate through effects and toggle the enabled state.

Fall back to previous behavior if the effects window for the track
is not opened, i.e. toggle the current fx index for the track.

Fixes reaper-oss#1443
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 a pull request may close this issue.

4 participants