View Single Post
Old 11-08-2014, 03:19 PM   #16
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by PooFox View Post
sorry for my confusion. eel seemed a bit more straightforward. i just wanted to get the above script compatible when the master track happens to be selected. almost there.
This should work for master track also:

Code:
//by IXix (translated by Elan Hickler)

function ShowNamedPlugin(sPluginName, pTrack, create) local(iSel iPlugin) (
  /*
  If named plugin not found and create is True, add it to track FX chain
  If track FX chain is hidden, float the plugin.
  If track FX chain is open, switch focus to the plugin if it isn't selected
  */
  iPlugin =  TrackFX_GetByName(pTrack, sPluginName, create);
  iPlugin > -1 ? (
    iSel = TrackFX_GetChainVisible(pTrack);
    iSel == -1 ? (
      TrackFX_GetOpen(pTrack, iPlugin) ?
      TrackFX_Show(pTrack, iPlugin, 2):
      TrackFX_Show(pTrack, iPlugin, 3);
    ):
    iSel == -2 ? TrackFX_Show(pTrack, iPlugin, 1):
    iSel != iPlugin ? TrackFX_Show(pTrack, iPlugin, 1);
  );
);
sPluginName = "SPAN";
pProject = 0;

i = 0;
loop(CountSelectedTracks(pProject),
  pTrack = GetSelectedTrack(pProject, i);
  ShowNamedPlugin(sPluginName, pTrack, 1);
  i+=1;
);
IsTrackSelected(GetMasterTrack()) ? ShowNamedPlugin(sPluginName, GetMasterTrack(), 1);

Last edited by spk77; 11-08-2014 at 03:33 PM.
spk77 is offline   Reply With Quote