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 #1444

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions SnM/SnM_FX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "SnM_FX.h"
#include "SnM_Track.h"
#include "SnM_Util.h"
#include "cfillion/cfillion.hpp"


///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -101,14 +102,31 @@ bool SetOrToggleFXBypassSelTracks(const char* _undoMsg, int _mode, int _fxCmdId,
}
}
break;
case 2: // toggle
if (fxId < fxcnt)
case 2: // toggle selected fx
{
// Get handle to FX window for this track
HWND fxChain = CF_GetTrackFXChain(tr);
if(fxChain)
{
if (_undoMsg && !updated)
Undo_BeginBlock2(NULL);
TrackFX_SetEnabled(tr, fxId, !TrackFX_GetEnabled(tr, fxId));
updated = true;
int index=-1;
// enumerate selected FX
while( (index = CF_EnumSelectedFX(fxChain, index)) >= 0)
{
if (_undoMsg && !updated)
Undo_BeginBlock2(NULL);
// toggle enabled state
TrackFX_SetEnabled(tr, index, !TrackFX_GetEnabled(tr, index));
updated = true;
}
}
else if(fxId < fxcnt)
{
if (_undoMsg && !updated)
Undo_BeginBlock2(NULL);
TrackFX_SetEnabled(tr, fxId, !TrackFX_GetEnabled(tr, fxId));
updated = true;
}
}
break;
case 3: // set
if (fxId < fxcnt && _val != TrackFX_GetEnabled(tr, fxId))
Expand Down