Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save mumblequatch/9bd5f9a924d473f1d947b0fe61fff905 to your computer and use it in GitHub Desktop.

Select an option

Save mumblequatch/9bd5f9a924d473f1d947b0fe61fff905 to your computer and use it in GitHub Desktop.
Reaper: unsolo/unarm/deselect all tracks, compact view, jump to start, zoom out to fit project
-- Overview reset: unsolo, unarm, deselect, compact tracks,
-- jump to project start, zoom out to fit entire project.
reaper.Undo_BeginBlock()
reaper.PreventUIRefresh(1)
local track_count = reaper.CountTracks(0)
-- Per-track: unsolo, disarm record, set to minimum (compact) height
for i = 0, track_count - 1 do
local track = reaper.GetTrack(0, i)
reaper.SetMediaTrackInfo_Value(track, "I_SOLO", 0)
reaper.SetMediaTrackInfo_Value(track, "I_RECARM", 0)
reaper.SetMediaTrackInfo_Value(track, "I_HEIGHTOVERRIDE", 1)
reaper.SetMediaTrackInfo_Value(track, "B_HEIGHTLOCK", 0)
end
-- Deselect all tracks
reaper.Main_OnCommand(40297, 0)
reaper.TrackList_AdjustWindows(false)
-- Move edit cursor to project start
reaper.Main_OnCommand(40042, 0)
-- Scroll TCP to the very top (first track)
reaper.CSurf_OnScroll(0, -100000)
-- Zoom horizontally to fit the entire project
reaper.Main_OnCommand(40295, 0) -- View: Zoom out project
reaper.PreventUIRefresh(-1)
reaper.TrackList_AdjustWindows(false)
reaper.UpdateArrange()
reaper.UpdateTimeline()
reaper.Undo_EndBlock("Overview: reset + compact + zoom to project", -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment