function main()
InitLayouts()
SetLayouts()
end
function InitLayouts()
gfx.dest = 1
gfx.init("Audio layouts", 130, 0)
gfx.set (1,1,1,1)
end
function SetLayouts()
gfx.x = gfx.mouse_x
gfx.y = gfx.mouse_y
local cSelTracks = reaper.CountSelectedTracks(0)
local l_menu1 = "TCP : normal - MCP : large full|TCP : normal - MCP : large compact|TCP : normal - MCP : narrow full|TCP : normal - MCP : narrow compact|"
local l_menu2 = "TCP : reduced - MCP : large full|TCP : reduced - MCP : large compact|TCP : reduced - MCP : narrow full|TCP : reduced - MCP : narrow compact|"
local last_clicked_item = gfx.showmenu(l_menu1..l_menu2)
if last_clicked_item == 1 then
for i = 0, cSelTracks-1 do
curSelTrack = reaper.GetSelectedTrack(0, i)
Set_TCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_TCP_LAYOUT", "Normal : Audio", 1)
Set_MCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_MCP_LAYOUT", "Large : Audio", 1)
end
elseif last_clicked_item == 2 then
for i = 0, cSelTracks-1 do
curSelTrack = reaper.GetSelectedTrack(0, i)
Set_TCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_TCP_LAYOUT", "Normal : Audio", 1)
Set_MCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_MCP_LAYOUT", "Large/Compact : Audio", 1)
end
elseif last_clicked_item == 3 then
for i = 0, cSelTracks-1 do
curSelTrack = reaper.GetSelectedTrack(0, i)
Set_TCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_TCP_LAYOUT", "Normal : Audio", 1)
Set_MCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_MCP_LAYOUT", "Narrow/Full : Audio", 1)
end
elseif last_clicked_item == 4 then
for i = 0, cSelTracks-1 do
curSelTrack = reaper.GetSelectedTrack(0, i)
Set_TCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_TCP_LAYOUT", "Normal : Audio", 1)
Set_MCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_MCP_LAYOUT", "Narrow : Audio", 1)
end
elseif last_clicked_item == 5 then
for i = 0, cSelTracks-1 do
curSelTrack = reaper.GetSelectedTrack(0, i)
Set_TCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_TCP_LAYOUT", "Reduced : Audio", 1)
Set_MCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_MCP_LAYOUT", "Large : Audio", 1)
end
elseif last_clicked_item == 6 then
for i = 0, cSelTracks-1 do
curSelTrack = reaper.GetSelectedTrack(0, i)
Set_TCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_TCP_LAYOUT", "Reduced : Audio", 1)
Set_MCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_MCP_LAYOUT", "Large/Compact : Audio", 1)
end
elseif last_clicked_item == 7 then
for i = 0, cSelTracks-1 do
curSelTrack = reaper.GetSelectedTrack(0, i)
Set_TCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_TCP_LAYOUT", "Reduced : Audio", 1)
Set_MCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_MCP_LAYOUT", "Narrow/Full : Audio", 1)
end
elseif last_clicked_item == 8 then
for i = 0, cSelTracks-1 do
curSelTrack = reaper.GetSelectedTrack(0, i)
Set_TCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_TCP_LAYOUT", "Reduced : Audio", 1)
Set_MCPAudioLayout = reaper.GetSetMediaTrackInfo_String(curSelTrack, "P_MCP_LAYOUT", "Narrow : Audio", 1)
end
end
gfx.update()
gfx.quit()
end
main()