-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmidieditor_solo.lua
More file actions
38 lines (29 loc) · 989 Bytes
/
midieditor_solo.lua
File metadata and controls
38 lines (29 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function Msg(param)
if false then
reaper.ShowConsoleMsg(tostring(param) .. "\n")
end
end
function Main()
local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive())
if not reaper.ValidatePtr(take, "MediaItem_Take*") then
Msg('invalid')
return
end
local item = reaper.GetMediaItemTake_Item(take)
local track = reaper.GetMediaItemTrack(item)
local is_soloed = reaper.GetMediaTrackInfo_Value(track, 'I_SOLO')
local action
Msg('Is soloed: ' .. is_soloed)
reaper.Undo_BeginBlock()
if is_soloed ~= 0 then
reaper.CSurf_OnSoloChange(track, 0)
-- reaper.SetMediaTrackInfo_Value(track, 'I_SOLO', 0)
action = 'Unsolo'
else
reaper.CSurf_OnSoloChange(track, 1)
-- reaper.SetMediaTrackInfo_Value(track, 'I_SOLO', 1)
action = 'Solo'
end
reaper.Undo_EndBlock(action .. ' active MIDI editor track', 1)
end
Main()