Aletheia
(Dblanchemain)
April 19, 2023, 10:01am
#1
how to set in lua the color of a region
x42
(Robin Gareus)
April 19, 2023, 11:53am
#2
Do you mean Track color? Regions in Ardour do not have any color, but can optionally inherit the track’s color (Preferences > Appearance > Editor > Region color follows track color ).
As for setting a track’s color using a Lua script, the color information is part of the track’s Presentation Info :
if (t:name ():find ("Drum")) then
-- print the name, and number of audio in/out
-- see also http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:ChanCount
print (t:name (), "| Audio In:", t:n_inputs ():n_audio (), "Audio Out:", t:n_outputs ():n_audio ())
-- get the track's http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:PresentationInfo
pi = t:presentation_info_ptr ()
-- set the track's color to orange - hex RGBA
pi:set_color (0xff8800ff)
-- phase invert the 1st channel
t:phase_control():set_phase_invert (1, true)
-- solo the track -- and only the track, not other tracks grouped with it.
--
-- Note that changing solo/mute needs to propagate implicit solo/mute.
-- These changes have to be done atomically, so that all
-- related solo/mute change simultaneously at the same time.
-- This can only be done from realtime-context, so we need to queue a session-rt
1 Like
system
(system)
closed
May 17, 2023, 11:53am
#3
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.