Ardour  9.7-245-g303f7adf54
scale_dialog.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 <map>
22 
23 #include "ytkmm/label.h"
24 #include "ytkmm/entry.h"
25 #include "ytkmm/spinbutton.h"
27 
28 #include "ardour/scale.h"
29 
31 
32 #include "ardour_dialog.h"
33 
34 namespace ArdourWidgets {
35  class Bracelet;
36 }
37 
38 class ScaleDialog : public ArdourDialog
39 {
40  public:
41  ScaleDialog (std::string const & provider_name);
43 
44  void set (ARDOUR::MusicalKey const *);
46 
48 
49  private:
50  static std::map<ARDOUR::MusicalModeType,std::string> type_string_map;
51  static std::map<std::string,ARDOUR::MusicalModeType> string_type_map;
52  static void fill_maps ();
53 
54  std::string provider;
56  std::unique_ptr<ARDOUR::MusicalKey> _key;
57 
58  struct StepEntry : public Gtk::Entry {
59  StepEntry (int idx) : index (idx) {}
60  int index;
61  };
62 
79 
85  bool ignore_set;
86 
88 
89  void pack_steps ();
92  void mode_changed ();
93 
96 };
void fill_dropdowns(ARDOUR::TuningSystem)
ARDOUR::MusicalKey * twelvetone_get() const
Gtk::Label type_label
Definition: scale_dialog.h:67
Gtk::Label name_label
Definition: scale_dialog.h:65
void twelvetone_set(ARDOUR::MusicalKey const &)
ArdourWidgets::ArdourDropdown tuning_dropdown
Definition: scale_dialog.h:80
void pack_steps()
bool ignore_set
Definition: scale_dialog.h:85
Gtk::SpinButton step_spinner
Definition: scale_dialog.h:71
std::unique_ptr< ARDOUR::MusicalKey > _key
Definition: scale_dialog.h:56
Gtk::VBox named_scale_box
Definition: scale_dialog.h:84
ArdourWidgets::ArdourDropdown mode_dropdown
Definition: scale_dialog.h:82
Gtk::HBox name_packer
Definition: scale_dialog.h:64
Gtk::Adjustment step_adjustment
Definition: scale_dialog.h:69
ArdourWidgets::ArdourDropdown type_dropdown
Definition: scale_dialog.h:73
std::string provider
Definition: scale_dialog.h:54
Gtk::Label clear_label
Definition: scale_dialog.h:78
Gtk::Label tuning_label
Definition: scale_dialog.h:68
Gtk::HBox root_mode_box
Definition: scale_dialog.h:83
static std::map< std::string, ARDOUR::MusicalModeType > string_type_map
Definition: scale_dialog.h:51
Gtk::HBox steps_box
Definition: scale_dialog.h:72
ARDOUR::TuningSystem _tuning
Definition: scale_dialog.h:55
Gtk::HBox scala_box
Definition: scale_dialog.h:74
ArdourWidgets::ArdourDropdown root_dropdown
Definition: scale_dialog.h:81
void mode_changed()
ARDOUR::MusicalKey * get() const
Gtk::FileChooserButton scala_file_button
Definition: scale_dialog.h:76
Gtk::Label steps_label
Definition: scale_dialog.h:70
Gtk::VBox step_packer
Definition: scale_dialog.h:63
Gtk::HBox type_box
Definition: scale_dialog.h:66
void set_type(ARDOUR::MusicalModeType)
Gtk::Label scala_label
Definition: scale_dialog.h:75
ArdourWidgets::Bracelet * bracelet
Definition: scale_dialog.h:87
void set(ARDOUR::MusicalKey const *)
void set_tuning(ARDOUR::TuningSystem)
static void fill_maps()
Gtk::Button clear_button
Definition: scale_dialog.h:77
ScaleDialog(std::string const &provider_name)
static std::map< ARDOUR::MusicalModeType, std::string > type_string_map
Definition: scale_dialog.h:50