mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
GenericUI: replace ComboBoxText by ArdourDropdown
This commit is contained in:
parent
7c5a8dea7c
commit
1d173bc84f
2 changed files with 15 additions and 21 deletions
|
|
@ -670,21 +670,17 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param,
|
||||||
* b) This port is marked as being an enumeration.
|
* b) This port is marked as being an enumeration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
std::vector<std::string> labels;
|
control_ui->combo = new ArdourDropdown();
|
||||||
for (
|
for (ARDOUR::ScalePoints::const_iterator i = control_ui->scale_points->begin();
|
||||||
ARDOUR::ScalePoints::const_iterator i = control_ui->scale_points->begin();
|
i != control_ui->scale_points->end();
|
||||||
i != control_ui->scale_points->end();
|
++i) {
|
||||||
++i) {
|
control_ui->combo->AddMenuElem(Menu_Helpers::MenuElem(
|
||||||
|
i->first,
|
||||||
labels.push_back(i->first);
|
sigc::bind(sigc::mem_fun(*this, &GenericPluginUI::control_combo_changed),
|
||||||
|
control_ui,
|
||||||
|
i->second)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO use ArdourDropDown
|
|
||||||
control_ui->combo = new Gtk::ComboBoxText();
|
|
||||||
set_popdown_strings(*control_ui->combo, labels);
|
|
||||||
control_ui->combo->signal_changed().connect(
|
|
||||||
sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::control_combo_changed),
|
|
||||||
control_ui));
|
|
||||||
mcontrol->Changed.connect(control_connections, invalidator(*this),
|
mcontrol->Changed.connect(control_connections, invalidator(*this),
|
||||||
boost::bind(&GenericPluginUI::ui_parameter_changed,
|
boost::bind(&GenericPluginUI::ui_parameter_changed,
|
||||||
this, control_ui),
|
this, control_ui),
|
||||||
|
|
@ -982,7 +978,7 @@ GenericPluginUI::update_control_display (ControlUI* cui)
|
||||||
if (cui->combo && cui->scale_points) {
|
if (cui->combo && cui->scale_points) {
|
||||||
for (ARDOUR::ScalePoints::iterator it = cui->scale_points->begin(); it != cui->scale_points->end(); ++it) {
|
for (ARDOUR::ScalePoints::iterator it = cui->scale_points->begin(); it != cui->scale_points->end(); ++it) {
|
||||||
if (it->second == val) {
|
if (it->second == val) {
|
||||||
cui->combo->set_active_text(it->first);
|
cui->combo->set_text(it->first);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1006,11 +1002,10 @@ GenericPluginUI::update_control_display (ControlUI* cui)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
GenericPluginUI::control_combo_changed (ControlUI* cui)
|
GenericPluginUI::control_combo_changed (ControlUI* cui, float value)
|
||||||
{
|
{
|
||||||
if (!cui->ignore_change && cui->scale_points) {
|
if (!cui->ignore_change) {
|
||||||
string value = cui->combo->get_active_text();
|
insert->automation_control (cui->parameter())->set_value (value, Controllable::NoGroup);
|
||||||
insert->automation_control (cui->parameter())->set_value ((*cui->scale_points)[value], Controllable::NoGroup);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@
|
||||||
#include <gtkmm/adjustment.h>
|
#include <gtkmm/adjustment.h>
|
||||||
#include <gtkmm/togglebutton.h>
|
#include <gtkmm/togglebutton.h>
|
||||||
#include <gtkmm/socket.h>
|
#include <gtkmm/socket.h>
|
||||||
#include <gtkmm/comboboxtext.h>
|
|
||||||
#include <gtkmm/socket.h>
|
#include <gtkmm/socket.h>
|
||||||
|
|
||||||
#include "ardour/types.h"
|
#include "ardour/types.h"
|
||||||
|
|
@ -235,7 +234,7 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
|
||||||
|
|
||||||
ArdourButton automate_button;
|
ArdourButton automate_button;
|
||||||
Gtk::Label label;
|
Gtk::Label label;
|
||||||
Gtk::ComboBoxText* combo;
|
ArdourDropdown* combo;
|
||||||
Gtkmm2ext::ClickBox* clickbox;
|
Gtkmm2ext::ClickBox* clickbox;
|
||||||
Gtk::FileChooserButton* file_button;
|
Gtk::FileChooserButton* file_button;
|
||||||
ArdourSpinner* spin_box;
|
ArdourSpinner* spin_box;
|
||||||
|
|
@ -280,7 +279,7 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
|
||||||
|
|
||||||
void ui_parameter_changed (ControlUI* cui);
|
void ui_parameter_changed (ControlUI* cui);
|
||||||
void update_control_display (ControlUI* cui);
|
void update_control_display (ControlUI* cui);
|
||||||
void control_combo_changed (ControlUI* cui);
|
void control_combo_changed (ControlUI* cui, float value);
|
||||||
|
|
||||||
void astate_clicked (ControlUI*);
|
void astate_clicked (ControlUI*);
|
||||||
void automation_state_changed (ControlUI*);
|
void automation_state_changed (ControlUI*);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue