mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-23 15:16:25 +01:00
Consolidate code duplication
This commit is contained in:
parent
2226da1385
commit
b410ed992b
3 changed files with 7 additions and 17 deletions
|
|
@ -44,6 +44,7 @@
|
||||||
#include "ardour/value_as_string.h"
|
#include "ardour/value_as_string.h"
|
||||||
|
|
||||||
#include "plugin_pin_dialog.h"
|
#include "plugin_pin_dialog.h"
|
||||||
|
#include "plugin_setup_dialog.h"
|
||||||
#include "gui_thread.h"
|
#include "gui_thread.h"
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
#include "ui_config.h"
|
#include "ui_config.h"
|
||||||
|
|
@ -523,18 +524,7 @@ PluginPinWidget::refill_output_presets ()
|
||||||
|
|
||||||
for (PluginOutputConfiguration::const_iterator i = ppc.begin () ; i != ppc.end (); ++i) {
|
for (PluginOutputConfiguration::const_iterator i = ppc.begin () ; i != ppc.end (); ++i) {
|
||||||
assert (*i > 0);
|
assert (*i > 0);
|
||||||
std::string tmp;
|
std::string tmp = PluginSetupDialog::preset_label (*i);
|
||||||
switch (*i) {
|
|
||||||
case 1:
|
|
||||||
tmp = _("Mono");
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
tmp = _("Stereo");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
tmp = string_compose (P_("%1 Channel", "%1 Channels", *i), *i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
_out_presets.AddMenuElem (MenuElem (tmp, sigc::bind (sigc::mem_fun (*this, &PluginPinWidget::select_output_preset), *i)));
|
_out_presets.AddMenuElem (MenuElem (tmp, sigc::bind (sigc::mem_fun (*this, &PluginPinWidget::select_output_preset), *i)));
|
||||||
if (n_audio == *i) {
|
if (n_audio == *i) {
|
||||||
_out_presets.set_text (tmp);
|
_out_presets.set_text (tmp);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
|
* Copyright (C) 2016-2023 Robin Gareus <robin@gareus.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -207,7 +207,7 @@ PluginSetupDialog::toggle_fan_out ()
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
PluginSetupDialog::preset_label (uint32_t n_audio) const
|
PluginSetupDialog::preset_label (uint32_t n_audio)
|
||||||
{
|
{
|
||||||
std::string rv;
|
std::string rv;
|
||||||
switch (n_audio) {
|
switch (n_audio) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
|
* Copyright (C) 2016-2023 Robin Gareus <robin@gareus.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -34,6 +34,8 @@ public:
|
||||||
|
|
||||||
bool fan_out () const { return _fan_out.get_active () && _fan_out.get_sensitive (); }
|
bool fan_out () const { return _fan_out.get_active () && _fan_out.get_sensitive (); }
|
||||||
|
|
||||||
|
static std::string preset_label (uint32_t);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setup_output_presets ();
|
void setup_output_presets ();
|
||||||
void update_sensitivity (uint32_t);
|
void update_sensitivity (uint32_t);
|
||||||
|
|
@ -43,8 +45,6 @@ private:
|
||||||
void apply_mapping ();
|
void apply_mapping ();
|
||||||
void toggle_fan_out ();
|
void toggle_fan_out ();
|
||||||
|
|
||||||
std::string preset_label (uint32_t) const;
|
|
||||||
|
|
||||||
boost::shared_ptr<ARDOUR::Route> _route;
|
boost::shared_ptr<ARDOUR::Route> _route;
|
||||||
boost::shared_ptr<ARDOUR::PluginInsert> _pi;
|
boost::shared_ptr<ARDOUR::PluginInsert> _pi;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue