Ardour  9.0-pre0-844-g046623df59
transform_dialog.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2015 David Robillard <d@drobilla.net>
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 <list>
22 #include <string>
23 
24 #include <ytkmm/combobox.h>
25 #include <ytkmm/liststore.h>
26 #include <ytkmm/treemodel.h>
27 #include <ytkmm/spinbutton.h>
28 
29 #include "ardour/midi_model.h"
30 #include "ardour/transform.h"
31 #include "ardour/types.h"
32 
33 #include "ardour_dialog.h"
34 
50 {
51 public:
53 
55 
56 private:
62 
63  struct SourceCols : public Gtk::TreeModelColumnRecord {
64  SourceCols() { add(source); add(label); }
65 
66  Gtk::TreeModelColumn<Source> source;
67  Gtk::TreeModelColumn<std::string> label;
68  };
69 
70  struct PropertyCols : public Gtk::TreeModelColumnRecord {
71  PropertyCols() { add(property); add(label); }
72 
73  Gtk::TreeModelColumn<Property> property;
74  Gtk::TreeModelColumn<std::string> label;
75  };
76 
77  struct OperatorCols : public Gtk::TreeModelColumnRecord {
78  OperatorCols() { add(op); add(label); }
79 
80  Gtk::TreeModelColumn<Operator> op;
81  Gtk::TreeModelColumn<std::string> label;
82  };
83 
84  struct Model {
85  Model();
86 
88  Glib::RefPtr<Gtk::ListStore> source_list;
90  Glib::RefPtr<Gtk::ListStore> property_list;
92  Glib::RefPtr<Gtk::ListStore> operator_list;
93  };
94 
95  struct ValueChooser : public Gtk::HBox {
97 
99  void get(std::list<Operation>& ops);
100 
103 
104  double get_value () const;
105  double get_max () const;
106 
107  const Model& model;
109  Gtk::ComboBox source_combo;
110  Gtk::ComboBox property_combo;
111  Gtk::SpinButton value_spinner;
112  Gtk::Label to_label;
113  Gtk::SpinButton max_spinner;
114  };
115 
116  struct OperationChooser : public Gtk::HBox {
118 
120  void get(std::list<Operation>& ops);
121 
123 
124  const Model& model;
125  Gtk::ComboBox operator_combo;
127  Gtk::Button remove_button;
128  };
129 
131  void add_clicked();
132 
134  Gtk::ComboBox _property_combo;
136  Gtk::VBox _operations_box;
137  Gtk::Button _add_button;
138 };
139 
ARDOUR::MidiModel::NoteDiffCommand::Property Property
Gtk::ComboBox _property_combo
ARDOUR::Transform::Program get()
ARDOUR::Transform::Value Value
ARDOUR::Transform::Operation Operation
ValueChooser * _seed_chooser
ARDOUR::Transform::Value::Source Source
Gtk::Button _add_button
Gtk::VBox _operations_box
void property_changed()
ARDOUR::Transform::Operation::Operator Operator
Glib::RefPtr< Gtk::ListStore > property_list
Glib::RefPtr< Gtk::ListStore > operator_list
Glib::RefPtr< Gtk::ListStore > source_list
OperationChooser(const Model &model)
void get(std::list< Operation > &ops)
Gtk::TreeModelColumn< Operator > op
Gtk::TreeModelColumn< std::string > label
Gtk::TreeModelColumn< std::string > label
Gtk::TreeModelColumn< Property > property
Gtk::TreeModelColumn< Source > source
Gtk::TreeModelColumn< std::string > label
const Model & model
Models for combo boxes.
Gtk::ComboBox source_combo
Value source chooser.
Gtk::SpinButton value_spinner
Value or minimum for RANDOM.
void get(std::list< Operation > &ops)
Gtk::ComboBox property_combo
Property chooser.
Gtk::SpinButton max_spinner
Maximum for RANDOM.
void set_target_property(Property prop)
ValueChooser(const Model &model)
Property target_property
Property on source.
Gtk::Label to_label
"to" label for RANDOM