ardour
transform_dialog.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009-2014 Paul Davis
3  Author: David Robillard
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 
20 #ifndef __transform_dialog_h__
21 #define __transform_dialog_h__
22 
23 #include <list>
24 #include <string>
25 
26 #include <gtkmm/combobox.h>
27 #include <gtkmm/liststore.h>
28 #include <gtkmm/treemodel.h>
29 #include <gtkmm/spinbutton.h>
30 
31 #include "ardour/midi_model.h"
32 #include "ardour/transform.h"
33 #include "ardour/types.h"
34 #include "evoral/types.hpp"
35 
36 #include "ardour_dialog.h"
37 
53 {
54 public:
56 
58 
59 private:
65 
66  struct SourceCols : public Gtk::TreeModelColumnRecord {
67  SourceCols() { add(source); add(label); }
68 
69  Gtk::TreeModelColumn<Source> source;
70  Gtk::TreeModelColumn<std::string> label;
71  };
72 
73  struct PropertyCols : public Gtk::TreeModelColumnRecord {
74  PropertyCols() { add(property); add(label); }
75 
76  Gtk::TreeModelColumn<Property> property;
77  Gtk::TreeModelColumn<std::string> label;
78  };
79 
80  struct OperatorCols : public Gtk::TreeModelColumnRecord {
81  OperatorCols() { add(op); add(label); }
82 
83  Gtk::TreeModelColumn<Operator> op;
84  Gtk::TreeModelColumn<std::string> label;
85  };
86 
87  struct Model {
88  Model();
89 
91  Glib::RefPtr<Gtk::ListStore> source_list;
93  Glib::RefPtr<Gtk::ListStore> property_list;
95  Glib::RefPtr<Gtk::ListStore> operator_list;
96  };
97 
98  struct ValueChooser : public Gtk::HBox {
99  ValueChooser(const Model& model);
100 
102  void get(std::list<Operation>& ops);
103 
104  void set_target_property(Property prop);
105  void source_changed();
106 
107  const Model& model;
108  Property target_property;
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 {
117  OperationChooser(const Model& model);
118 
120  void get(std::list<Operation>& ops);
121 
122  void remove_clicked();
123 
124  const Model& model;
125  Gtk::ComboBox operator_combo;
127  Gtk::Button remove_button;
128  };
129 
130  void property_changed();
131  void add_clicked();
132 
134  Gtk::ComboBox _property_combo;
136  Gtk::VBox _operations_box;
137  Gtk::Button _add_button;
138 };
139 
140 #endif /* __transform_dialog_h__ */
Gtk::TreeModelColumn< Source > source
Glib::RefPtr< Gtk::ListStore > operator_list
ARDOUR::MidiModel::NoteDiffCommand::Property Property
Gtk::TreeModelColumn< std::string > label
Gtk::SpinButton value_spinner
Value or minimum for RANDOM.
ValueChooser * _seed_chooser
Gtk::Button _add_button
ARDOUR::Transform::Operation Operation
Gtk::TreeModelColumn< std::string > label
Gtk::TreeModelColumn< Operator > op
Gtk::ComboBox _property_combo
ARDOUR::Transform::Value::Source Source
Glib::RefPtr< Gtk::ListStore > property_list
const Model & model
Models for combo boxes.
Gtk::TreeModelColumn< Property > property
Gtk::ComboBox source_combo
Value source chooser.
Gtk::VBox _operations_box
Gtk::TreeModelColumn< std::string > label
Gtk::SpinButton max_spinner
Maximum for RANDOM.
void set_target_property(Property prop)
Gtk::ComboBox property_combo
Property chooser.
Glib::RefPtr< Gtk::ListStore > source_list
Property target_property
Property on source.
ARDOUR::Transform::Operation::Operator Operator
Gtk::Label to_label
"to" label for RANDOM
ValueChooser(const Model &model)
ARDOUR::Transform::Value Value