2 Copyright (C) 2016 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #include <pangomm/layout.h>
21 #include "pbd/compose.h"
22 #include "pbd/convert.h"
23 #include "pbd/debug.h"
24 #include "pbd/failed_constructor.h"
25 #include "pbd/file_utils.h"
26 #include "pbd/search_path.h"
27 #include "pbd/enumwriter.h"
29 #include "midi++/parser.h"
30 #include "timecode/time.h"
31 #include "timecode/bbt_time.h"
33 #include "ardour/async_midi_port.h"
34 #include "ardour/audioengine.h"
35 #include "ardour/debug.h"
36 #include "ardour/filesystem_paths.h"
37 #include "ardour/midiport_manager.h"
38 #include "ardour/midi_track.h"
39 #include "ardour/midi_port.h"
40 #include "ardour/session.h"
41 #include "ardour/tempo.h"
45 #include "track_mix.h"
49 using namespace ARDOUR;
53 using namespace ArdourSurface;
55 TrackMixLayout::TrackMixLayout (Push2& p, Session& s, Cairo::RefPtr<Cairo::Context> context)
59 name_layout = Pango::Layout::create (context);
61 Pango::FontDescription fd ("Sans Bold 24");
62 name_layout->set_font_description (fd);
65 TrackMixLayout::~TrackMixLayout ()
70 TrackMixLayout::redraw (Cairo::RefPtr<Cairo::Context> context) const
76 context->set_source_rgb (0.764, 0.882, 0.882);
77 context->rectangle (0, 0, 960, 160);
80 context->set_source_rgb (0.23, 0.0, 0.349);
81 context->move_to (10, 2);
82 name_layout->update_from_cairo_context (context);
83 name_layout->show_in_cairo_context (context);
89 TrackMixLayout::button_upper (uint32_t n)
94 TrackMixLayout::button_lower (uint32_t n)
99 TrackMixLayout::strip_vpot (int n, int delta)
104 TrackMixLayout::strip_vpot_touch (int, bool)
109 TrackMixLayout::set_stripable (boost::shared_ptr<Stripable> s)
114 stripable->DropReferences.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&TrackMixLayout::drop_stripable, this), &p2);
122 TrackMixLayout::drop_stripable ()
124 stripable_connections.drop_connections ();
130 TrackMixLayout::name_changed ()
132 name_layout->set_text (stripable->name());