2 ["type"] = "EditorAction",
\r
3 name = "Create Drum Tracks",
\r
5 description = [[Creates 8 new tracks with representative names and colors.]]
\r
8 function factory () return function ()
\r
20 local color = 0xff8800ff --orange
\r
24 local tl = Session:new_audio_track (1, 2, nil, 1, names[i],
\r
25 ARDOUR.PresentationInfo.max_order,
\r
26 ARDOUR.TrackMode.Normal)
\r
28 for track in tl:iter () do
\r
29 track:presentation_info_ptr ():set_color (color)
\r
35 end end -- function factory
\r
38 function icon (params) return function (ctx, width, height)
\r
39 local x = width * .5
\r
40 local y = height * .5
\r
41 local r = math.min (x, y) * .7
\r
43 ctx:translate (x, y)
\r
45 ctx:translate (-x, -y)
\r
46 ctx:arc (x, y, r, 0, 2 * math.pi)
\r
47 ctx:set_source_rgba (.9, .9, 1, 1)
\r
49 ctx:arc (x, y, r, 0, math.pi)
\r
50 ctx:arc_negative (x, y * 1.6, r, math.pi, 0)
\r
51 ctx:set_source_rgba (.7, .7, .7, 1)
\r
55 ctx:set_source_rgba (.6, .4, .2, 1)
\r
56 ctx:translate (x, y)
\r
58 ctx:translate (-x, -y)
\r
59 ctx:set_line_cap (Cairo.LineCap.Round)
\r
61 function drumstick (xp, lr)
\r
62 ctx:set_line_width (r * .3)
\r
63 ctx:move_to (x * xp, y)
\r
66 ctx:set_line_width (r * .2)
\r
67 ctx:move_to (x * xp, y)
\r
68 ctx:rel_line_to (lr * x, y)
\r
71 drumstick (1.2, 1.2)
\r
72 drumstick (0.7, -.5)
\r