Video-Frame (not sample)
[ardour.git] / scripts / s_showhide_track.lua
1 ardour { ["type"] = "Snippet", name = "Show/Hide TimeAxisView" }
2
3 function factory () return function ()
4         -- get a route from the session by Presentation-Order
5         -- http://ardourman/lua-scripting/class_reference/#ARDOUR:Session
6         local route = Session:get_remote_nth_route(2)
7         assert (route) -- abort if it does not exist
8         print (route:name())
9
10         -- the GUI timeline representation of a Track/Bus is a "Route Time Axis View" Object
11         local rtav = Editor:rtav_from_route (route) -- lookup RTAV
12
13         -- the show/hide state applies to any "Time Axis View", cast RTAV to TAV.
14         Editor:hide_track_in_display (rtav:to_timeaxisview(), false --[[true: only if selected; false: any]])
15
16
17         -- look up the route named "Audio"
18         route = Session:route_by_name("Audio")
19         assert (route) -- abort if it does not exist
20
21         Editor:show_track_in_display (Editor:rtav_from_route (route):to_timeaxisview(), false --[[move into view]])
22
23 end end