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 <cairomm/region.h>
20 #include <pangomm/layout.h>
22 #include "pbd/compose.h"
23 #include "pbd/convert.h"
24 #include "pbd/debug.h"
25 #include "pbd/failed_constructor.h"
26 #include "pbd/file_utils.h"
27 #include "pbd/search_path.h"
28 #include "pbd/enumwriter.h"
30 #include "midi++/parser.h"
31 #include "timecode/time.h"
32 #include "timecode/bbt_time.h"
34 #include "ardour/async_midi_port.h"
35 #include "ardour/audioengine.h"
36 #include "ardour/debug.h"
37 #include "ardour/filesystem_paths.h"
38 #include "ardour/midiport_manager.h"
39 #include "ardour/midi_track.h"
40 #include "ardour/midi_port.h"
41 #include "ardour/session.h"
42 #include "ardour/tempo.h"
50 using namespace ARDOUR;
54 using namespace ArdourSurface;
55 using namespace ArdourCanvas;
57 ScaleLayout::ScaleLayout (Push2& p, Session& s)
63 ScaleLayout::~ScaleLayout ()
68 ScaleLayout::render (Rect const& area, Cairo::RefPtr<Cairo::Context> context) const
70 context->set_source_rgb (0.764, 0.882, 0.882);
71 context->rectangle (0, 0, 960, 160);
74 scale_menu->render (area, context);
78 ScaleLayout::button_upper (uint32_t n)
83 ScaleLayout::button_lower (uint32_t n)
88 ScaleLayout::strip_vpot (int n, int delta)
91 scale_menu->step_active (n, delta);
97 ScaleLayout::strip_vpot_touch (int, bool)
102 ScaleLayout::build_scale_menu ()
106 scale_menu = new Push2Menu (this);
108 v.push_back ("Dorian");
109 v.push_back ("IonianMajor");
110 v.push_back ("Minor");
111 v.push_back ("HarmonicMinor");
112 v.push_back ("MelodicMinorAscending");
113 v.push_back ("MelodicMinorDescending");
114 v.push_back ("Phrygian");
115 v.push_back ("Lydian");
116 v.push_back ("Mixolydian");
117 v.push_back ("Aeolian");
118 v.push_back ("Locrian");
119 v.push_back ("PentatonicMajor");
120 v.push_back ("PentatonicMinor");
121 v.push_back ("Chromatic");
122 v.push_back ("BluesScale");
123 v.push_back ("NeapolitanMinor");
124 v.push_back ("NeapolitanMajor");
125 v.push_back ("Oriental");
126 v.push_back ("DoubleHarmonic");
127 v.push_back ("Enigmatic");
128 v.push_back ("Hirajoshi");
129 v.push_back ("HungarianMinor");
130 v.push_back ("HungarianMajor");
131 v.push_back ("Kumoi");
132 v.push_back ("Iwato");
133 v.push_back ("Hindu");
134 v.push_back ("Spanish8Tone");
135 v.push_back ("Pelog");
136 v.push_back ("HungarianGypsy");
137 v.push_back ("Overtone");
138 v.push_back ("LeadingWholeTone");
139 v.push_back ("Arabian");
140 v.push_back ("Balinese");
141 v.push_back ("Gypsy");
142 v.push_back ("Mohammedan");
143 v.push_back ("Javanese");
144 v.push_back ("Persian");
145 v.push_back ("Algeria");
147 scale_menu->fill_column (0, v);