Ardour  9.2-541-gc1841a13dd
chord_box.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2026 Paul Davis <paul@linuxaudiosystems.com>
3  *
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.
8  *
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.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #pragma once
20 
21 #include <string>
22 #include <vector>
23 
24 #include "ytkmm/box.h"
25 #include "ytkmm/label.h"
26 #include "ytkmm/table.h"
27 
29 
30 #include "ardour/scale.h"
31 #include "ardour/chord_provider.h"
32 
33 namespace ARDOUR {
34  class ScaleProvider;
35 }
36 
37 class EditingContext;
38 
40 {
41  public:
44 
46 
47  typedef std::vector<int> IntervalSet;
48 
49  bool get_midi_chord (int root_pitch, IntervalSet& pitches) const;
50  void show_chord (std::string const & name);
51 
52  sigc::signal<void, IntervalSet> ReplaceChord;
53  sigc::signal<void, bool> InvertChord;
54  sigc::signal<void, std::vector<int> > DropChord;
55 
56  private:
58  void pack (Gtk::Widget&);
59 
62 
63  void fill_table (Gtk::Table& table, std::vector<std::string> const & names, int chord_size);
65 
66  /* Western */
67 
70 
73 
78 
80 
81  void build_western ();
82 
83  void tet12_replace_chord (std::string const &);
84  void tet12_modify_chord (std::string const &);
85  void tet12_invert_chord (bool);
86  void tet12_drop_chord (std::vector<int> const &);
87 
88  /* end western */
89 
90  int _root;
92 };
Gtk::Table tetrad_table
Definition: chord_box.h:69
bool radio_ardour_button_hack(GdkEventButton *ev, ArdourWidgets::ArdourButton *button)
std::vector< int > IntervalSet
Definition: chord_box.h:47
void tet12_drop_chord(std::vector< int > const &)
void set_culture(ARDOUR::MusicalModeCulture)
bool get_midi_chord(int root_pitch, IntervalSet &pitches) const
Gtk::Label triad_label
Definition: chord_box.h:74
Gtk::VBox western_vbox
Definition: chord_box.h:79
Gtk::Table drop_table
Definition: chord_box.h:72
Gtk::Table triad_table
Definition: chord_box.h:68
sigc::signal< void, IntervalSet > ReplaceChord
Definition: chord_box.h:52
Gtk::Table inversion_table
Definition: chord_box.h:71
sigc::signal< void, bool > InvertChord
Definition: chord_box.h:53
Gtk::Label name_display
Definition: chord_box.h:61
Gtk::Label tetrad_label
Definition: chord_box.h:75
void show_chord(std::string const &name)
sigc::signal< void, std::vector< int > > DropChord
Definition: chord_box.h:54
ArdourWidgets::ArdourDropdown culture_button
Definition: chord_box.h:60
int _root
Definition: chord_box.h:90
void tet12_modify_chord(std::string const &)
ChordBox(EditingContext &)
Gtk::Label inversion_label
Definition: chord_box.h:76
ARDOUR::MusicalModeCulture _culture
Definition: chord_box.h:91
void fill_table(Gtk::Table &table, std::vector< std::string > const &names, int chord_size)
void tet12_replace_chord(std::string const &)
void build_western()
Gtk::Label drop_label
Definition: chord_box.h:77
void tet12_invert_chord(bool)
EditingContext & editing_context
Definition: chord_box.h:57
void pack(Gtk::Widget &)
GtkImageIconNameData name
Definition: gtkimage.h:6