Quote:
Originally Posted by nofish
Code:
lstate = -1;
function run(finishup)
(
masterTrack = GetMasterTrack(0);
peakInfo_L = Track_GetPeakInfo(masterTrack, 0);
peakInfo_R = Track_GetPeakInfo(masterTrack, 1);
peakInfo_L > 1 || peakInfo_R > 1 ? (clipped = 1;) : (clipped = 0);
// toolbar toggle state example by Jeffos
get_action_context(#fn,sec,cmd);
state=finishup ? -1 : (clipped);
state != lstate ?
(
SetToggleCommandState(sec, cmd, state);
RefreshToolbar2(sec, cmd);
lstate=state;
);
!finishup ? defer("run(0);");
);
defer("run(0);");
atexit("run(1);");
|
Who can turn this into a sticky toolbar button?