add options to swap mute and solo and to create mapping stops
This commit is contained in:
parent
7634c4936c
commit
e22a0eb1db
@ -16,28 +16,26 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "c1_gui.h"
|
||||
|
||||
#include <gtkmm/alignment.h>
|
||||
#include <gtkmm/label.h>
|
||||
#include <gtkmm/liststore.h>
|
||||
|
||||
#include "pbd/unwind.h"
|
||||
#include "pbd/strsplit.h"
|
||||
#include "pbd/file_utils.h"
|
||||
#include "pbd/i18n.h"
|
||||
#include "pbd/strsplit.h"
|
||||
#include "pbd/unwind.h"
|
||||
|
||||
#include "ardour/audioengine.h"
|
||||
#include "ardour/debug.h"
|
||||
#include "ardour/filesystem_paths.h"
|
||||
#include "ardour/parameter_descriptor.h"
|
||||
#include "console1.h"
|
||||
#include "gtkmm2ext/bindings.h"
|
||||
#include "gtkmm2ext/gui_thread.h"
|
||||
#include "gtkmm2ext/utils.h"
|
||||
|
||||
#include "ardour/audioengine.h"
|
||||
#include "ardour/filesystem_paths.h"
|
||||
#include "ardour/parameter_descriptor.h"
|
||||
#include "ardour/debug.h"
|
||||
|
||||
#include "console1.h"
|
||||
#include "c1_gui.h"
|
||||
|
||||
#include "pbd/i18n.h"
|
||||
|
||||
using namespace PBD;
|
||||
using namespace ARDOUR;
|
||||
using namespace ArdourSurface;
|
||||
@ -49,9 +47,9 @@ void*
|
||||
Console1::get_gui () const
|
||||
{
|
||||
if (!gui) {
|
||||
const_cast<Console1*>(this)->build_gui ();
|
||||
const_cast<Console1*> (this)->build_gui ();
|
||||
}
|
||||
static_cast<Gtk::VBox*>(gui)->show_all();
|
||||
static_cast<Gtk::VBox*> (gui)->show_all ();
|
||||
return gui;
|
||||
}
|
||||
|
||||
@ -59,9 +57,9 @@ void
|
||||
Console1::tear_down_gui ()
|
||||
{
|
||||
if (gui) {
|
||||
Gtk::Widget *w = static_cast<Gtk::VBox*>(gui)->get_parent();
|
||||
Gtk::Widget* w = static_cast<Gtk::VBox*> (gui)->get_parent ();
|
||||
if (w) {
|
||||
w->hide();
|
||||
w->hide ();
|
||||
delete w;
|
||||
}
|
||||
}
|
||||
@ -78,10 +76,11 @@ Console1::build_gui ()
|
||||
/*--------------------*/
|
||||
|
||||
C1GUI::C1GUI (Console1& p)
|
||||
: c1 (p)
|
||||
, table (2, 5)
|
||||
, action_table (5, 4)
|
||||
, ignore_active_change (false)
|
||||
: c1 (p)
|
||||
, table (6, 4)
|
||||
, swap_solo_mute_cb ()
|
||||
, create_plugin_stubs_btn ()
|
||||
, ignore_active_change (false)
|
||||
{
|
||||
set_border_width (12);
|
||||
|
||||
@ -92,36 +91,62 @@ C1GUI::C1GUI (Console1& p)
|
||||
|
||||
std::string data_file_path;
|
||||
string name = "console1.png";
|
||||
Searchpath spath(ARDOUR::ardour_data_search_path());
|
||||
Searchpath spath (ARDOUR::ardour_data_search_path ());
|
||||
spath.add_subdirectory_to_paths ("icons");
|
||||
find_file (spath, name, data_file_path);
|
||||
if (!data_file_path.empty()) {
|
||||
if (!data_file_path.empty ()) {
|
||||
image.set (data_file_path);
|
||||
hpacker.pack_start (image, false, false);
|
||||
}
|
||||
|
||||
Gtk::Label* l;
|
||||
Gtk::Alignment* align;
|
||||
int row = 0;
|
||||
|
||||
input_combo.pack_start (midi_port_columns.short_name);
|
||||
output_combo.pack_start (midi_port_columns.short_name);
|
||||
|
||||
input_combo.signal_changed().connect (sigc::bind (sigc::mem_fun (*this, &C1GUI::active_port_changed), &input_combo, true));
|
||||
output_combo.signal_changed().connect (sigc::bind (sigc::mem_fun (*this, &C1GUI::active_port_changed), &output_combo, false));
|
||||
input_combo.signal_changed ().connect (
|
||||
sigc::bind (sigc::mem_fun (*this, &C1GUI::active_port_changed), &input_combo, true));
|
||||
output_combo.signal_changed ().connect (
|
||||
sigc::bind (sigc::mem_fun (*this, &C1GUI::active_port_changed), &output_combo, false));
|
||||
|
||||
// swap_solo_mute (_ ("Swap Solo and Mute"));
|
||||
swap_solo_mute_cb.set_tooltip_text (
|
||||
_ ("If checked Ardour the mute and solo buttons are swept so they have the same order as in the GUI."));
|
||||
swap_solo_mute_cb.set_active (p.swap_solo_mute);
|
||||
swap_solo_mute_cb.signal_toggled ().connect (sigc::mem_fun (*this, &C1GUI::set_swap_solo_mute));
|
||||
|
||||
// create_plugin_stubs (_ ("Create Plugin Mapping Stubs"));
|
||||
create_plugin_stubs_btn.set_tooltip_text (_ ("If checked a mapping stub is created for every unknown plugin."));
|
||||
create_plugin_stubs_btn.set_active (p.create_mapping_stubs);
|
||||
create_plugin_stubs_btn.signal_toggled ().connect (sigc::mem_fun (*this, &C1GUI::set_create_mapping_stubs));
|
||||
|
||||
l = manage (new Gtk::Label);
|
||||
l->set_markup (string_compose ("<span weight=\"bold\">%1</span>", _("Incoming MIDI on:")));
|
||||
l->set_markup (string_compose ("<span weight=\"bold\">%1</span>", _ ("Incoming MIDI on:")));
|
||||
l->set_alignment (1.0, 0.5);
|
||||
table.attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
|
||||
table.attach (input_combo, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
|
||||
table.attach (*l, 0, 1, row, row + 1, AttachOptions (FILL | EXPAND), AttachOptions (0));
|
||||
table.attach (input_combo, 1, 2, row, row + 1, AttachOptions (FILL | EXPAND), AttachOptions (0), 0, 0);
|
||||
row++;
|
||||
|
||||
l = manage (new Gtk::Label);
|
||||
l->set_markup (string_compose ("<span weight=\"bold\">%1</span>", _("Outgoing MIDI on:")));
|
||||
l->set_markup (string_compose ("<span weight=\"bold\">%1</span>", _ ("Outgoing MIDI on:")));
|
||||
l->set_alignment (1.0, 0.5);
|
||||
table.attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
|
||||
table.attach (output_combo, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
|
||||
table.attach (*l, 0, 1, row, row + 1, AttachOptions (FILL | EXPAND), AttachOptions (0));
|
||||
table.attach (output_combo, 1, 2, row, row + 1, AttachOptions (FILL | EXPAND), AttachOptions (0), 0, 0);
|
||||
row++;
|
||||
|
||||
l = manage (new Gtk::Label);
|
||||
l->set_markup (string_compose ("<span weight=\"bold\">%1</span>", _ ("Swap Solo and Mute:")));
|
||||
l->set_alignment (1.0, 0.5);
|
||||
table.attach (*l, 0, 1, row, row + 1, AttachOptions (FILL | EXPAND), AttachOptions (0));
|
||||
table.attach (swap_solo_mute_cb, 1, 2, row, row + 1);
|
||||
row++;
|
||||
|
||||
l = manage (new Gtk::Label);
|
||||
l->set_markup (string_compose ("<span weight=\"bold\">%1</span>", _ ("Create Plugin Mapping Stubs:")));
|
||||
l->set_alignment (1.0, 0.5);
|
||||
table.attach (*l, 0, 1, row, row + 1, AttachOptions (FILL | EXPAND), AttachOptions (0));
|
||||
table.attach (create_plugin_stubs_btn, 1, 2, row, row + 1);
|
||||
row++;
|
||||
|
||||
hpacker.pack_start (table, true, true);
|
||||
@ -136,13 +161,26 @@ C1GUI::C1GUI (Console1& p)
|
||||
|
||||
/* catch future changes to connection state */
|
||||
|
||||
ARDOUR::AudioEngine::instance()->PortRegisteredOrUnregistered.connect (_port_connections, invalidator (*this), boost::bind (&C1GUI::connection_handler, this), gui_context());
|
||||
ARDOUR::AudioEngine::instance()->PortPrettyNameChanged.connect (_port_connections, invalidator (*this), boost::bind (&C1GUI::connection_handler, this), gui_context());
|
||||
c1.ConnectionChange.connect (_port_connections, invalidator (*this), boost::bind (&C1GUI::connection_handler, this), gui_context());
|
||||
ARDOUR::AudioEngine::instance ()->PortRegisteredOrUnregistered.connect (
|
||||
_port_connections, invalidator (*this), boost::bind (&C1GUI::connection_handler, this), gui_context ());
|
||||
ARDOUR::AudioEngine::instance ()->PortPrettyNameChanged.connect (
|
||||
_port_connections, invalidator (*this), boost::bind (&C1GUI::connection_handler, this), gui_context ());
|
||||
c1.ConnectionChange.connect (
|
||||
_port_connections, invalidator (*this), boost::bind (&C1GUI::connection_handler, this), gui_context ());
|
||||
}
|
||||
|
||||
C1GUI::~C1GUI ()
|
||||
C1GUI::~C1GUI () {}
|
||||
|
||||
void
|
||||
C1GUI::set_swap_solo_mute ()
|
||||
{
|
||||
c1.swap_solo_mute = !c1.swap_solo_mute;
|
||||
}
|
||||
|
||||
void
|
||||
C1GUI::set_create_mapping_stubs ()
|
||||
{
|
||||
c1.create_mapping_stubs = !c1.create_mapping_stubs;
|
||||
}
|
||||
|
||||
void
|
||||
@ -164,8 +202,10 @@ C1GUI::update_port_combos ()
|
||||
vector<string> midi_inputs;
|
||||
vector<string> midi_outputs;
|
||||
|
||||
ARDOUR::AudioEngine::instance()->get_ports ("", ARDOUR::DataType::MIDI, ARDOUR::PortFlags (ARDOUR::IsOutput|ARDOUR::IsTerminal), midi_inputs);
|
||||
ARDOUR::AudioEngine::instance()->get_ports ("", ARDOUR::DataType::MIDI, ARDOUR::PortFlags (ARDOUR::IsInput|ARDOUR::IsTerminal), midi_outputs);
|
||||
ARDOUR::AudioEngine::instance ()->get_ports (
|
||||
"", ARDOUR::DataType::MIDI, ARDOUR::PortFlags (ARDOUR::IsOutput | ARDOUR::IsTerminal), midi_inputs);
|
||||
ARDOUR::AudioEngine::instance ()->get_ports (
|
||||
"", ARDOUR::DataType::MIDI, ARDOUR::PortFlags (ARDOUR::IsInput | ARDOUR::IsTerminal), midi_outputs);
|
||||
|
||||
Glib::RefPtr<Gtk::ListStore> input = build_midi_port_list (midi_inputs, true);
|
||||
Glib::RefPtr<Gtk::ListStore> output = build_midi_port_list (midi_outputs, false);
|
||||
@ -176,15 +216,14 @@ C1GUI::update_port_combos ()
|
||||
input_combo.set_model (input);
|
||||
output_combo.set_model (output);
|
||||
|
||||
Gtk::TreeModel::Children children = input->children();
|
||||
Gtk::TreeModel::Children children = input->children ();
|
||||
Gtk::TreeModel::Children::iterator i;
|
||||
i = children.begin();
|
||||
i = children.begin ();
|
||||
++i; /* skip "Disconnected" */
|
||||
|
||||
|
||||
for (n = 1; i != children.end(); ++i, ++n) {
|
||||
for (n = 1; i != children.end (); ++i, ++n) {
|
||||
string port_name = (*i)[midi_port_columns.full_name];
|
||||
if (c1.input_port()->connected_to (port_name)) {
|
||||
if (c1.input_port ()->connected_to (port_name)) {
|
||||
input_combo.set_active (n);
|
||||
input_found = true;
|
||||
break;
|
||||
@ -195,13 +234,13 @@ C1GUI::update_port_combos ()
|
||||
input_combo.set_active (0); /* disconnected */
|
||||
}
|
||||
|
||||
children = output->children();
|
||||
i = children.begin();
|
||||
children = output->children ();
|
||||
i = children.begin ();
|
||||
++i; /* skip "Disconnected" */
|
||||
|
||||
for (n = 1; i != children.end(); ++i, ++n) {
|
||||
for (n = 1; i != children.end (); ++i, ++n) {
|
||||
string port_name = (*i)[midi_port_columns.full_name];
|
||||
if (c1.output_port()->connected_to (port_name)) {
|
||||
if (c1.output_port ()->connected_to (port_name)) {
|
||||
output_combo.set_active (n);
|
||||
output_found = true;
|
||||
break;
|
||||
@ -214,19 +253,19 @@ C1GUI::update_port_combos ()
|
||||
}
|
||||
|
||||
Glib::RefPtr<Gtk::ListStore>
|
||||
C1GUI::build_midi_port_list (vector<string> const & ports, bool for_input)
|
||||
C1GUI::build_midi_port_list (vector<string> const& ports, bool for_input)
|
||||
{
|
||||
Glib::RefPtr<Gtk::ListStore> store = ListStore::create (midi_port_columns);
|
||||
TreeModel::Row row;
|
||||
|
||||
row = *store->append ();
|
||||
row[midi_port_columns.full_name] = string();
|
||||
row[midi_port_columns.short_name] = _("Disconnected");
|
||||
row[midi_port_columns.full_name] = string ();
|
||||
row[midi_port_columns.short_name] = _ ("Disconnected");
|
||||
|
||||
for (vector<string>::const_iterator p = ports.begin(); p != ports.end(); ++p) {
|
||||
for (vector<string>::const_iterator p = ports.begin (); p != ports.end (); ++p) {
|
||||
row = *store->append ();
|
||||
row[midi_port_columns.full_name] = *p;
|
||||
std::string pn = ARDOUR::AudioEngine::instance()->get_pretty_name_by_name (*p);
|
||||
std::string pn = ARDOUR::AudioEngine::instance ()->get_pretty_name_by_name (*p);
|
||||
if (pn.empty ()) {
|
||||
pn = (*p).substr ((*p).find (':') + 1);
|
||||
}
|
||||
@ -246,25 +285,25 @@ C1GUI::active_port_changed (Gtk::ComboBox* combo, bool for_input)
|
||||
TreeModel::iterator active = combo->get_active ();
|
||||
string new_port = (*active)[midi_port_columns.full_name];
|
||||
|
||||
if (new_port.empty()) {
|
||||
if (new_port.empty ()) {
|
||||
if (for_input) {
|
||||
c1.input_port()->disconnect_all ();
|
||||
c1.input_port ()->disconnect_all ();
|
||||
} else {
|
||||
c1.output_port()->disconnect_all ();
|
||||
c1.output_port ()->disconnect_all ();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (for_input) {
|
||||
if (!c1.input_port()->connected_to (new_port)) {
|
||||
c1.input_port()->disconnect_all ();
|
||||
c1.input_port()->connect (new_port);
|
||||
if (!c1.input_port ()->connected_to (new_port)) {
|
||||
c1.input_port ()->disconnect_all ();
|
||||
c1.input_port ()->connect (new_port);
|
||||
}
|
||||
} else {
|
||||
if (!c1.output_port()->connected_to (new_port)) {
|
||||
c1.output_port()->disconnect_all ();
|
||||
c1.output_port()->connect (new_port);
|
||||
if (!c1.output_port ()->connected_to (new_port)) {
|
||||
c1.output_port ()->disconnect_all ();
|
||||
c1.output_port ()->connect (new_port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/combobox.h>
|
||||
#include <gtkmm/checkbutton.h>
|
||||
#include <gtkmm/image.h>
|
||||
#include <gtkmm/table.h>
|
||||
#include <gtkmm/treestore.h>
|
||||
@ -52,10 +53,11 @@ private:
|
||||
PBD::ScopedConnectionList lcxl_connections;
|
||||
Gtk::VBox hpacker;
|
||||
Gtk::Table table;
|
||||
Gtk::Table action_table;
|
||||
Gtk::ComboBox input_combo;
|
||||
Gtk::ComboBox output_combo;
|
||||
Gtk::Image image;
|
||||
Gtk::Image image;
|
||||
Gtk::CheckButton swap_solo_mute_cb;
|
||||
Gtk::CheckButton create_plugin_stubs_btn;
|
||||
|
||||
void update_port_combos ();
|
||||
PBD::ScopedConnection connection_change_connection;
|
||||
@ -77,6 +79,9 @@ private:
|
||||
Glib::RefPtr<Gtk::ListStore> build_midi_port_list (std::vector<std::string> const & ports, bool for_input);
|
||||
void active_port_changed (Gtk::ComboBox*,bool for_input);
|
||||
|
||||
void set_swap_solo_mute ();
|
||||
void set_create_mapping_stubs ();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -43,11 +43,13 @@ Console1::bank (bool up)
|
||||
if ((current_bank + 1) * bank_size < list_size) {
|
||||
changed = true;
|
||||
++current_bank;
|
||||
current_strippable_index = 0;
|
||||
}
|
||||
} else {
|
||||
if (current_bank > 0) {
|
||||
changed = true;
|
||||
--current_bank;
|
||||
current_strippable_index = bank_size - 1;
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
@ -134,7 +136,7 @@ void
|
||||
Console1::select (const uint32_t i)
|
||||
{
|
||||
uint32_t strip_index = current_bank * bank_size + i;
|
||||
DEBUG_TRACE (DEBUG::Console1, string_compose ("select( %1 ) : idx %2\n", i, strip_index));
|
||||
DEBUG_TRACE (DEBUG::Console1, string_compose ("select( %1 / %2 ) : idx %3\n", current_bank, i, strip_index));
|
||||
select_rid_by_index (strip_index);
|
||||
}
|
||||
|
||||
@ -581,19 +583,19 @@ Console1::map_mute ()
|
||||
DEBUG_TRACE (DEBUG::Console1, "Console1::map_mute ...\n");
|
||||
if (_current_stripable) {
|
||||
if (_current_stripable->mute_control ()->muted ()) {
|
||||
get_button (MUTE)->set_led_state (true);
|
||||
get_button (swap_solo_mute ? SOLO : MUTE)->set_led_state (true);
|
||||
} else if (_current_stripable->mute_control ()->muted_by_others_soloing () ||
|
||||
_current_stripable->mute_control ()->muted_by_masters ()) {
|
||||
|
||||
DEBUG_TRACE (DEBUG::Console1, "Console1::map_mute start blinking\n");
|
||||
start_blinking (MUTE);
|
||||
start_blinking (swap_solo_mute ? SOLO : MUTE);
|
||||
} else {
|
||||
DEBUG_TRACE (DEBUG::Console1, "Console1::map_mute stop blinking\n");
|
||||
stop_blinking (MUTE);
|
||||
stop_blinking (swap_solo_mute ? SOLO : MUTE);
|
||||
}
|
||||
} else {
|
||||
DEBUG_TRACE (DEBUG::Console1, "Console1::map_mute stop blinking 2\n");
|
||||
stop_blinking (MUTE);
|
||||
stop_blinking (swap_solo_mute ? SOLO : MUTE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -612,7 +614,7 @@ Console1::map_phase ()
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::Console1, "map_phase \n");
|
||||
ControllerButton* controllerButton = get_button (PHASE_INV);
|
||||
if (_current_stripable) {
|
||||
if (_current_stripable && _current_stripable->phase_control ()) {
|
||||
uint32_t channels = _current_stripable->phase_control ()->size ();
|
||||
uint32_t inverted = 0;
|
||||
for (uint32_t i = 0; i < channels; ++i) {
|
||||
@ -681,9 +683,9 @@ Console1::map_plugin_state (bool plugin_state)
|
||||
}
|
||||
map_stripable_state ();
|
||||
} else {
|
||||
// I don't plan shift functionality with plugins...
|
||||
// I don't plan shift functionality with plugins...
|
||||
shift (0);
|
||||
// map all plugin related operations
|
||||
// map all plugin related operations
|
||||
}
|
||||
}
|
||||
|
||||
@ -692,7 +694,7 @@ Console1::map_solo ()
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::Console1, "map_solo()\n");
|
||||
try {
|
||||
ControllerButton* controllerButton = get_button (SOLO);
|
||||
ControllerButton* controllerButton = get_button (swap_solo_mute ? MUTE : SOLO);
|
||||
if (_current_stripable) {
|
||||
controllerButton->set_led_state (_current_stripable->solo_control ()->soloed ());
|
||||
} else {
|
||||
@ -723,8 +725,8 @@ Console1::map_filter ()
|
||||
try {
|
||||
get_button (ControllerID::FILTER_TO_COMPRESSORS)
|
||||
->set_led_state (_current_stripable->filter_enable_controllable (true)
|
||||
? _current_stripable->filter_enable_controllable (true)->get_value ()
|
||||
: false);
|
||||
? _current_stripable->filter_enable_controllable (true)->get_value ()
|
||||
: false);
|
||||
} catch (ControlNotFoundException& e) {
|
||||
DEBUG_TRACE (DEBUG::Console1, "Button not found\n");
|
||||
}
|
||||
@ -759,8 +761,8 @@ Console1::map_gate ()
|
||||
try {
|
||||
get_button (ControllerID::SHAPE)
|
||||
->set_led_state (_current_stripable->gate_enable_controllable ()
|
||||
? _current_stripable->gate_enable_controllable ()->get_value ()
|
||||
: false);
|
||||
? _current_stripable->gate_enable_controllable ()->get_value ()
|
||||
: false);
|
||||
} catch (ControlNotFoundException& e) {
|
||||
DEBUG_TRACE (DEBUG::Console1, "Button not found\n");
|
||||
}
|
||||
@ -775,8 +777,8 @@ Console1::map_gate_scf ()
|
||||
DEBUG_TRACE (DEBUG::Console1, string_compose ("map_gate_scf() - shift: %1\n", shift_state));
|
||||
get_button (ControllerID::HARD_GATE)
|
||||
->set_led_state (_current_stripable->gate_key_filter_enable_controllable ()
|
||||
? _current_stripable->gate_key_filter_enable_controllable ()->get_value ()
|
||||
: false);
|
||||
? _current_stripable->gate_key_filter_enable_controllable ()->get_value ()
|
||||
: false);
|
||||
} catch (ControlNotFoundException& e) {
|
||||
DEBUG_TRACE (DEBUG::Console1, "Button not found\n");
|
||||
}
|
||||
@ -791,8 +793,8 @@ Console1::map_gate_listen ()
|
||||
DEBUG_TRACE (DEBUG::Console1, string_compose ("map_gate_listen() - shift: %1\n", shift_state));
|
||||
get_button (ControllerID::HARD_GATE)
|
||||
->set_led_state (_current_stripable->gate_key_listen_controllable ()
|
||||
? _current_stripable->gate_key_listen_controllable ()->get_value ()
|
||||
: false);
|
||||
? _current_stripable->gate_key_listen_controllable ()->get_value ()
|
||||
: false);
|
||||
} catch (ControlNotFoundException& e) {
|
||||
DEBUG_TRACE (DEBUG::Console1, "Button not found\n");
|
||||
}
|
||||
@ -894,8 +896,8 @@ Console1::map_eq ()
|
||||
return;
|
||||
try {
|
||||
get_button (EQ)->set_led_state (_current_stripable->eq_enable_controllable ()
|
||||
? _current_stripable->eq_enable_controllable ()->get_value ()
|
||||
: false);
|
||||
? _current_stripable->eq_enable_controllable ()->get_value ()
|
||||
: false);
|
||||
} catch (ControlNotFoundException& e) {
|
||||
DEBUG_TRACE (DEBUG::Console1, "Button not found\n");
|
||||
}
|
||||
@ -1012,8 +1014,8 @@ Console1::map_comp ()
|
||||
try {
|
||||
get_button (ControllerID::COMP)
|
||||
->set_led_state (_current_stripable->comp_enable_controllable ()
|
||||
? _current_stripable->comp_enable_controllable ()->get_value ()
|
||||
: false);
|
||||
? _current_stripable->comp_enable_controllable ()->get_value ()
|
||||
: false);
|
||||
} catch (ControlNotFoundException& e) {
|
||||
DEBUG_TRACE (DEBUG::Console1, "Button not found\n");
|
||||
}
|
||||
|
@ -338,7 +338,7 @@ Console1::spill_plugins (const int32_t plugin_index)
|
||||
PluginMappingMap::iterator pmmit = pluginMappingMap.find (plugin->unique_id ());
|
||||
mapping_found = (pmmit != pluginMappingMap.end ());
|
||||
|
||||
if (!mapping_found) {
|
||||
if (!mapping_found && create_mapping_stubs ) {
|
||||
create_mapping (proc, plugin);
|
||||
return true;
|
||||
}
|
||||
|
@ -16,12 +16,13 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "console1.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
|
||||
#include <glibmm-2.4/glibmm/main.h>
|
||||
#include <boost/optional.hpp>
|
||||
#include <glibmm-2.4/glibmm/main.h>
|
||||
|
||||
#include "pbd/abstract_ui.cc" // instantiate template
|
||||
#include "pbd/controllable.h"
|
||||
@ -38,8 +39,6 @@
|
||||
#include "ardour/stripable.h"
|
||||
#include "ardour/track.h"
|
||||
#include "ardour/vca_manager.h"
|
||||
|
||||
#include "console1.h"
|
||||
#include "c1_control.h"
|
||||
#include "c1_gui.h"
|
||||
|
||||
@ -139,6 +138,27 @@ Console1::input_port_name () const
|
||||
#endif
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
Console1::get_state () const
|
||||
{
|
||||
XMLNode& node = MIDISurface::get_state ();
|
||||
node.set_property ("swap-solo-mute", swap_solo_mute);
|
||||
node.set_property ("create-mapping-stubs", create_mapping_stubs);
|
||||
return node;
|
||||
}
|
||||
|
||||
int
|
||||
Console1::set_state (const XMLNode& node, int version)
|
||||
{
|
||||
MIDISurface::set_state (node, version);
|
||||
std::string tmp;
|
||||
node.get_property ("swap-solo-mute", tmp);
|
||||
swap_solo_mute = (tmp == "1");
|
||||
node.get_property ("create-mapping-stubs", tmp);
|
||||
create_mapping_stubs = (tmp == "1");
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string
|
||||
Console1::output_port_name () const
|
||||
{
|
||||
@ -192,10 +212,10 @@ Console1::connect_session_signals ()
|
||||
DEBUG_TRACE (DEBUG::Console1, "connect_session_signals\n");
|
||||
// receive routes added
|
||||
session->RouteAdded.connect (
|
||||
session_connections, MISSING_INVALIDATOR, boost::bind (&Console1::create_strip_invetory, this), this);
|
||||
session_connections, MISSING_INVALIDATOR, boost::bind (&Console1::create_strip_inventory, this), this);
|
||||
// receive VCAs added
|
||||
session->vca_manager ().VCAAdded.connect (
|
||||
session_connections, MISSING_INVALIDATOR, boost::bind (&Console1::create_strip_invetory, this), this);
|
||||
session_connections, MISSING_INVALIDATOR, boost::bind (&Console1::create_strip_inventory, this), this);
|
||||
|
||||
// receive record state toggled
|
||||
// session->RecordStateChanged.connect(session_connections,
|
||||
@ -241,18 +261,18 @@ void
|
||||
Console1::notify_session_loaded ()
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::Console1, "************** Session Loaded() ********************\n");
|
||||
create_strip_invetory ();
|
||||
create_strip_inventory ();
|
||||
connect_internal_signals ();
|
||||
if (session) {
|
||||
DEBUG_TRACE (DEBUG::Console1, "session available\n");
|
||||
uint32_t i = 0;
|
||||
while (!first_selected_stripable () && i < 10 ) {
|
||||
while (!first_selected_stripable () && i < 10) {
|
||||
DEBUG_TRACE (DEBUG::Console1, "no stripable selected\n");
|
||||
std::this_thread::sleep_for (std::chrono::milliseconds (1000));
|
||||
++i;
|
||||
}
|
||||
if( i < 11)
|
||||
stripable_selection_changed ();
|
||||
if (i < 11)
|
||||
stripable_selection_changed ();
|
||||
}
|
||||
}
|
||||
|
||||
@ -289,10 +309,13 @@ Console1::setup_controls ()
|
||||
new ControllerButton (
|
||||
this, ControllerID::PAGE_DOWN, boost::function<void (uint32_t)> (boost::bind (&Console1::bank, this, false)));
|
||||
|
||||
new ControllerButton (
|
||||
this, ControllerID::MUTE, boost::function<void (uint32_t)> (boost::bind (&Console1::mute, this, _1)));
|
||||
new ControllerButton (
|
||||
this, ControllerID::SOLO, boost::function<void (uint32_t)> (boost::bind (&Console1::solo, this, _1)));
|
||||
new ControllerButton (this,
|
||||
swap_solo_mute ? ControllerID::SOLO : ControllerID::MUTE,
|
||||
boost::function<void (uint32_t)> (boost::bind (&Console1::mute, this, _1)));
|
||||
new ControllerButton (this,
|
||||
swap_solo_mute ? ControllerID::MUTE : ControllerID::SOLO,
|
||||
boost::function<void (uint32_t)> (boost::bind (&Console1::solo, this, _1)));
|
||||
|
||||
new ControllerButton (
|
||||
this, ControllerID::PHASE_INV, boost::function<void (uint32_t)> (boost::bind (&Console1::phase, this, _1)));
|
||||
|
||||
@ -523,6 +546,7 @@ Console1::stripable_selection_changed ()
|
||||
void
|
||||
Console1::drop_current_stripable ()
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::Console1, "drop_current_stripable \n");
|
||||
if (_current_stripable) {
|
||||
if (_current_stripable == session->monitor_out ()) {
|
||||
set_current_stripable (session->master_out ());
|
||||
@ -576,14 +600,20 @@ Console1::set_current_stripable (std::shared_ptr<Stripable> r)
|
||||
_current_stripable->DropReferences.connect (
|
||||
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::drop_current_stripable, this), this);
|
||||
|
||||
_current_stripable->mute_control ()->Changed.connect (
|
||||
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_mute, this), this);
|
||||
if (_current_stripable->mute_control ()) {
|
||||
_current_stripable->mute_control ()->Changed.connect (
|
||||
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_mute, this), this);
|
||||
}
|
||||
|
||||
_current_stripable->solo_control ()->Changed.connect (
|
||||
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_solo, this), this);
|
||||
if (_current_stripable->solo_control ()) {
|
||||
_current_stripable->solo_control ()->Changed.connect (
|
||||
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_solo, this), this);
|
||||
}
|
||||
|
||||
_current_stripable->phase_control ()->Changed.connect (
|
||||
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_phase, this), this);
|
||||
if (_current_stripable->phase_control ()) {
|
||||
_current_stripable->phase_control ()->Changed.connect (
|
||||
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_phase, this), this);
|
||||
}
|
||||
|
||||
// Rec Enabled
|
||||
std::shared_ptr<Track> t = std::dynamic_pointer_cast<Track> (_current_stripable);
|
||||
@ -1091,16 +1121,17 @@ Console1::midi_to_control (Controllable controllable, uint32_t val, uint32_t max
|
||||
}
|
||||
|
||||
void
|
||||
Console1::create_strip_invetory ()
|
||||
Console1::create_strip_inventory ()
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::Console1, "create_strip_invetory()\n");
|
||||
StripableList sl;
|
||||
DEBUG_TRACE (DEBUG::Console1, "create_strip_inventory()\n");
|
||||
// StripableList sl;
|
||||
boost::optional<order_t> master_order;
|
||||
strip_inventory.clear ();
|
||||
session->get_stripables (sl);
|
||||
StripableList sl = session->get_stripables ();
|
||||
uint32_t index = 0;
|
||||
for (const auto& s : sl) {
|
||||
PresentationInfo pi = s->presentation_info ();
|
||||
DEBUG_TRACE (DEBUG::Console1, string_compose ("%1: ", s->name ()));
|
||||
if (pi.flags () & ARDOUR::PresentationInfo::Hidden) {
|
||||
DEBUG_TRACE (DEBUG::Console1, string_compose ("strip hidden: index %1, order %2\n", index, pi.order ()));
|
||||
continue;
|
||||
@ -1113,7 +1144,7 @@ Console1::create_strip_invetory ()
|
||||
}
|
||||
if (pi.flags () & ARDOUR::PresentationInfo::MonitorOut) {
|
||||
DEBUG_TRACE (DEBUG::Console1,
|
||||
string_compose ("monitor strip found at index %1, order %2\n", index, pi.order ()));
|
||||
string_compose ("monitor strip found at index %1, order %2 - ignoring\n", index, pi.order ()));
|
||||
continue;
|
||||
}
|
||||
strip_inventory.insert (std::make_pair (index, pi.order ()));
|
||||
@ -1124,7 +1155,7 @@ Console1::create_strip_invetory ()
|
||||
strip_inventory.insert (std::make_pair (index, master_order.value ()));
|
||||
}
|
||||
DEBUG_TRACE (DEBUG::Console1,
|
||||
string_compose ("create_strip_invetory - inventory size %1\n", strip_inventory.size ()));
|
||||
string_compose ("create_strip_inventory - inventory size %1\n", strip_inventory.size ()));
|
||||
}
|
||||
|
||||
order_t
|
||||
|
@ -105,8 +105,12 @@ class Console1 : public MIDISurface
|
||||
std::string input_port_name () const override;
|
||||
std::string output_port_name () const override;
|
||||
|
||||
/*XMLNode& get_state () const;
|
||||
int set_state (const XMLNode&, int version);*/
|
||||
XMLNode& get_state () const override;
|
||||
int set_state (const XMLNode&, int version) override;
|
||||
|
||||
bool swap_solo_mute;
|
||||
bool create_mapping_stubs;
|
||||
|
||||
PBD::Signal0<void> ConnectionChange;
|
||||
|
||||
/* Timer Events */
|
||||
@ -326,7 +330,7 @@ class Console1 : public MIDISurface
|
||||
|
||||
StripInventoryMap strip_inventory;
|
||||
|
||||
void create_strip_invetory ();
|
||||
void create_strip_inventory ();
|
||||
|
||||
order_t get_inventory_order_by_index (const uint32_t index);
|
||||
uint32_t get_index_by_inventory_order (order_t order);
|
||||
|
Loading…
Reference in New Issue
Block a user