-- Monitoring state dummy action
local Dummy_1 = tonumber(reaper.GetExtState("Dummy_toggle_1_@","key_Dummy_toggle_1_")) or 0;
local Dummy_2 = tonumber(reaper.GetExtState("Dummy_toggle_2_@","key_Dummy_toggle_2_")) or 0;
local Dummy_3 = tonumber(reaper.GetExtState("Dummy_toggle_3_@","key_Dummy_toggle_3_")) or 0;
local Dummy_4 = tonumber(reaper.GetExtState("Dummy_toggle_4_@","key_Dummy_toggle_4_")) or 0;
local Dummy_5 = tonumber(reaper.GetExtState("Dummy_toggle_5_@","key_Dummy_toggle_5_")) or 0;
local Dummy_6 = tonumber(reaper.GetExtState("Dummy_toggle_6_@","key_Dummy_toggle_6_")) or 0;
local Dummy_7 = tonumber(reaper.GetExtState("Dummy_toggle_7_@","key_Dummy_toggle_7_")) or 0;
local Dummy_8 = tonumber(reaper.GetExtState("Dummy_toggle_8_@","key_Dummy_toggle_8_")) or 0;
local
StartProject_dummy_1,StartProject_dummy_2,StartProject_dummy_3,StartProject_dummy_4,
StartProject_dummy_5,StartProject_dummy_6,StartProject_dummy_7,StartProject_dummy_8,
Toggle_Dummy_1_X,Toggle_Dummy_2_X,Toggle_Dummy_3_X,Toggle_Dummy_4_X,
Toggle_Dummy_5_X,Toggle_Dummy_6_X,Toggle_Dummy_7_X,Toggle_Dummy_8_X;
local function loop();
if not StartProject_dummy_1 then;
local Toggle_Dummy_1 = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_DUMMY_TGL1"));
if Dummy_1 ~= Toggle_Dummy_1 then;
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_DUMMY_TGL1"),-1);
end;
StartProject_dummy_1 = true;
end;
local Toggle_Dummy_1 = reaper.GetToggleCommandState( reaper.NamedCommandLookup("_S&M_DUMMY_TGL1"));
if Toggle_Dummy_1 ~= Toggle_Dummy_1_X then;
reaper.SetExtState("Dummy_toggle_1_@","key_Dummy_toggle_1_",Toggle_Dummy_1,true);
Toggle_Dummy_1_X = Toggle_Dummy_1;
end;
--------------
if not StartProject_dummy_2 then;
local Toggle_Dummy_2 = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_DUMMY_TGL2"));
if Dummy_2 ~= Toggle_Dummy_2 then;
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_DUMMY_TGL2"),-1);
end;
StartProject_dummy_2 = true;
end;
local Toggle_Dummy_2 = reaper.GetToggleCommandState( reaper.NamedCommandLookup("_S&M_DUMMY_TGL2"));
if Toggle_Dummy_2 ~= Toggle_Dummy_2_X then;
reaper.SetExtState("Dummy_toggle_2_@","key_Dummy_toggle_2_",Toggle_Dummy_2,true);
Toggle_Dummy_2_X = Toggle_Dummy_2;
end;
--------------
if not StartProject_dummy_3 then;
local Toggle_Dummy_3 = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_DUMMY_TGL3"));
if Dummy_3 ~= Toggle_Dummy_3 then;
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_DUMMY_TGL3"),-1);
end;
StartProject_dummy_3 = true;
end;
local Toggle_Dummy_3 = reaper.GetToggleCommandState( reaper.NamedCommandLookup("_S&M_DUMMY_TGL3"));
if Toggle_Dummy_3 ~= Toggle_Dummy_3_X then;
reaper.SetExtState("Dummy_toggle_3_@","key_Dummy_toggle_3_",Toggle_Dummy_3,true);
Toggle_Dummy_3_X = Toggle_Dummy_3;
end;
--------------
if not StartProject_dummy_4 then;
local Toggle_Dummy_4 = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_DUMMY_TGL4"));
if Dummy_4 ~= Toggle_Dummy_4 then;
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_DUMMY_TGL4"),-1);
end;
StartProject_dummy_4 = true;
end;
local Toggle_Dummy_4 = reaper.GetToggleCommandState( reaper.NamedCommandLookup("_S&M_DUMMY_TGL4"));
if Toggle_Dummy_4 ~= Toggle_Dummy_4_X then;
reaper.SetExtState("Dummy_toggle_4_@","key_Dummy_toggle_4_",Toggle_Dummy_4,true);
Toggle_Dummy_4_X = Toggle_Dummy_4;
end;
--------------
if not StartProject_dummy_5 then;
local Toggle_Dummy_5 = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_DUMMY_TGL5"));
if Dummy_5 ~= Toggle_Dummy_5 then;
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_DUMMY_TGL5"),-1);
end;
StartProject_dummy_5 = true;
end;
local Toggle_Dummy_5 = reaper.GetToggleCommandState( reaper.NamedCommandLookup("_S&M_DUMMY_TGL5"));
if Toggle_Dummy_5 ~= Toggle_Dummy_5_X then;
reaper.SetExtState("Dummy_toggle_5_@","key_Dummy_toggle_5_",Toggle_Dummy_5,true);
Toggle_Dummy_5_X = Toggle_Dummy_5;
end;
--------------
if not StartProject_dummy_6 then;
local Toggle_Dummy_6 = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_DUMMY_TGL6"));
if Dummy_6 ~= Toggle_Dummy_6 then;
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_DUMMY_TGL6"),-1);
end;
StartProject_dummy_6 = true;
end;
local Toggle_Dummy_6 = reaper.GetToggleCommandState( reaper.NamedCommandLookup("_S&M_DUMMY_TGL6"));
if Toggle_Dummy_6 ~= Toggle_Dummy_6_X then;
reaper.SetExtState("Dummy_toggle_6_@","key_Dummy_toggle_6_",Toggle_Dummy_6,true);
Toggle_Dummy_6_X = Toggle_Dummy_6;
end;
--------------
if not StartProject_dummy_7 then;
local Toggle_Dummy_7 = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_DUMMY_TGL7"));
if Dummy_7 ~= Toggle_Dummy_7 then;
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_DUMMY_TGL7"),-1);
end;
StartProject_dummy_7 = true;
end;
local Toggle_Dummy_7 = reaper.GetToggleCommandState( reaper.NamedCommandLookup("_S&M_DUMMY_TGL7"));
if Toggle_Dummy_7 ~= Toggle_Dummy_7_X then;
reaper.SetExtState("Dummy_toggle_7_@","key_Dummy_toggle_7_",Toggle_Dummy_7,true);
Toggle_Dummy_7_X = Toggle_Dummy_7;
end;
--------------
if not StartProject_dummy_8 then;
local Toggle_Dummy_8 = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_DUMMY_TGL8"));
if Dummy_8 ~= Toggle_Dummy_8 then;
reaper.Main_OnCommand(reaper.NamedCommandLookup("_S&M_DUMMY_TGL8"),-1);
end;
StartProject_dummy_8 = true;
end;
local Toggle_Dummy_8 = reaper.GetToggleCommandState(reaper.NamedCommandLookup("_S&M_DUMMY_TGL8"));
if Toggle_Dummy_8 ~= Toggle_Dummy_8_X then;
reaper.SetExtState("Dummy_toggle_8_@","key_Dummy_toggle_8_",Toggle_Dummy_8,true);
Toggle_Dummy_8_X = Toggle_Dummy_8;
end;
--------------
reaper.defer(loop);
end;
loop();