diff options
author | Robin Gareus <robin@gareus.org> | 2020-02-23 20:48:02 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-02-23 20:48:02 +0100 |
commit | 180843f9bd28b191c7404245ba0a121107992511 (patch) | |
tree | c60312dc09f76c2f55ba2383245c427e15c38dea /share/scripts/s_showhide_track.lua | |
parent | bf649cd68ad46c34a656700aa6cb89416d648c64 (diff) |
Also move Lua scripts to share subfolder
Diffstat (limited to 'share/scripts/s_showhide_track.lua')
-rw-r--r-- | share/scripts/s_showhide_track.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/share/scripts/s_showhide_track.lua b/share/scripts/s_showhide_track.lua new file mode 100644 index 0000000000..289367643d --- /dev/null +++ b/share/scripts/s_showhide_track.lua @@ -0,0 +1,23 @@ +ardour { ["type"] = "Snippet", name = "Show/Hide TimeAxisView" } + +function factory () return function () + -- get a route from the session by Presentation-Order + -- http://ardourman/lua-scripting/class_reference/#ARDOUR:Session + local route = Session:get_remote_nth_route(2) + assert (route) -- abort if it does not exist + print (route:name()) + + -- the GUI timeline representation of a Track/Bus is a "Route Time Axis View" Object + local rtav = Editor:rtav_from_route (route) -- lookup RTAV + + -- the show/hide state applies to any "Time Axis View", cast RTAV to TAV. + Editor:hide_track_in_display (rtav:to_timeaxisview(), false --[[true: only if selected; false: any]]) + + + -- look up the route named "Audio" + route = Session:route_by_name("Audio") + assert (route) -- abort if it does not exist + + Editor:show_track_in_display (Editor:rtav_from_route (route):to_timeaxisview(), false --[[move into view]]) + +end end |