add checks for MIXBUS for certain features, and reconcile that with the GUI parts as well

This commit is contained in:
Nikolaus Gullotta 2019-04-11 11:04:57 -05:00 committed by Nikolaus Gullotta
parent 0f8702478e
commit 2d77e99d29
No known key found for this signature in database
GPG key ID: 565F60578092AA31
4 changed files with 54 additions and 39 deletions

View file

@ -263,18 +263,27 @@ bool MixerSnapshotDialog::bootstrap_display_and_model(Gtkmm2ext::DnDTreeView<str
model->set_sort_column(6, SORT_DESCENDING);
//new stuff - see TODO
display.append_column(_("EQ"), _columns.recall_eq); // col 8
display.append_column(_("Comp"), _columns.recall_comp);
display.append_column(_("I/O"), _columns.recall_io);
display.append_column(_("Groups"), _columns.recall_groups);
display.append_column(_("VCAs"), _columns.recall_vcas); //col 12
//dumb work around because we're doing an ifdef MIXBUS here
int col_count[] = {
#ifdef MIXBUS
display.append_column(_("EQ"), _columns.recall_eq),
display.append_column(_("Comp"), _columns.recall_comp),
#endif
display.append_column(_("I/O"), _columns.recall_io),
display.append_column(_("Groups"), _columns.recall_groups),
display.append_column(_("VCAs"), _columns.recall_vcas),
};
// TODO make this a vector
for(int i = 8; i <= 12; i++) {
CellRendererToggle* cell = dynamic_cast<CellRendererToggle*>(display.get_column_cell_renderer(i));
int col_count_size = (sizeof(col_count)/sizeof(*col_count));
for(int i = 0; i < col_count_size; i++) {
int index = col_count[i] - 1; //the actual count at the time of appending
CellRendererToggle* cell = dynamic_cast<CellRendererToggle*>(display.get_column_cell_renderer(index));
string col_title = display.get_column(index)->get_title();
cell->property_activatable() = true;
cell->property_radio() = true;
cell->signal_toggled().connect(sigc::bind(sigc::mem_fun(*this, &MixerSnapshotDialog::recall_flag_cell_action), global, i));
cell->signal_toggled().connect(sigc::bind(sigc::mem_fun(*this, &MixerSnapshotDialog::recall_flag_cell_action), global, col_title));
}
display.set_headers_visible(true);
@ -485,8 +494,10 @@ void MixerSnapshotDialog::refill()
row[_columns.full_path] = path;
row[_columns.snapshot] = snap;
#ifdef MIXBUS
row[_columns.recall_eq] = snap->get_recall_eq();
row[_columns.recall_comp] = snap->get_recall_comp();
#endif
row[_columns.recall_io] = snap->get_recall_io();
row[_columns.recall_groups] = snap->get_recall_group();
row[_columns.recall_vcas] = snap->get_recall_vca();
@ -528,8 +539,10 @@ void MixerSnapshotDialog::refill()
row[_columns.full_path] = path;
row[_columns.snapshot] = snap;
#ifdef MIXBUS
row[_columns.recall_eq] = snap->get_recall_eq();
row[_columns.recall_comp] = snap->get_recall_comp();
#endif
row[_columns.recall_io] = snap->get_recall_io();
row[_columns.recall_groups] = snap->get_recall_group();
row[_columns.recall_vcas] = snap->get_recall_vca();
@ -553,7 +566,7 @@ void MixerSnapshotDialog::fav_cell_action(const string& path, bool global)
}
}
void MixerSnapshotDialog::recall_flag_cell_action(const std::string& path, bool global, int col_index)
void MixerSnapshotDialog::recall_flag_cell_action(const std::string& path, bool global, string title)
{
TreeModel::iterator iter;
if(global) {
@ -565,36 +578,32 @@ void MixerSnapshotDialog::recall_flag_cell_action(const std::string& path, bool
if(iter) {
MixerSnapshot* snap = (*iter)[_columns.snapshot];
switch (col_index)
{
case 8:
snap->set_recall_eq(!snap->get_recall_eq());
(*iter)[_columns.recall_eq] = snap->get_recall_eq();
break;
#ifdef MIXBUS
if(title == "EQ") {
snap->set_recall_eq(!snap->get_recall_eq());
(*iter)[_columns.recall_eq] = snap->get_recall_eq();
}
case 9:
snap->set_recall_comp(!snap->get_recall_comp());
(*iter)[_columns.recall_comp] = snap->get_recall_comp();
break;
case 10:
if(title == "Comp") {
snap->set_recall_comp(!snap->get_recall_comp());
(*iter)[_columns.recall_comp] = snap->get_recall_comp();
}
#endif
if(title == "I/O") {
snap->set_recall_io(!snap->get_recall_io());
(*iter)[_columns.recall_io] = snap->get_recall_io();
break;
case 11:
snap->set_recall_group(!snap->get_recall_group());
(*iter)[_columns.recall_groups] = snap->get_recall_group();
break;
case 12:
snap->set_recall_vca(!snap->get_recall_vca());
(*iter)[_columns.recall_vcas] = snap->get_recall_vca();
break;
default:
break;
}
if(title == "Groups") {
snap->set_recall_group(!snap->get_recall_group());
(*iter)[_columns.recall_groups] = snap->get_recall_group();
}
if(title == "VCAs") {
snap->set_recall_vca(!snap->get_recall_vca());
(*iter)[_columns.recall_vcas] = snap->get_recall_vca();
}
snap->write((*iter)[_columns.full_path]);
}
}

View file

@ -64,7 +64,7 @@ class MixerSnapshotDialog : public ArdourWindow
bool button_press(GdkEventButton*, bool);
void window_opened();
void fav_cell_action(const std::string&, bool);
void recall_flag_cell_action(const std::string&, bool, int);
void recall_flag_cell_action(const std::string&, bool, std::string);
struct MixerSnapshotColumns : public Gtk::TreeModel::ColumnRecord {

View file

@ -72,15 +72,18 @@ class LIBARDOUR_API MixerSnapshot
std::vector<State> get_routes() {return route_states;};
std::vector<State> get_groups() {return group_states;};
std::vector<State> get_vcas() {return vca_states;};
#ifdef MIXBUS
bool get_recall_eq() const { return _flags & RecallEQ;};
bool get_recall_comp() const { return _flags & RecallComp;};
#endif
bool get_recall_io() const { return _flags & RecallIO;};
bool get_recall_group() const { return _flags & RecallGroup;};
bool get_recall_vca() const { return _flags & RecallVCA;};
#ifdef MIXBUS
void set_recall_eq(bool);
void set_recall_comp(bool);
#endif
void set_recall_io(bool);
void set_recall_group(bool);
void set_recall_vca(bool);

View file

@ -107,8 +107,10 @@ bool MixerSnapshot::set_flag(bool yn, RecallFlags flag)
return false;
}
#ifdef MIXBUS
void MixerSnapshot::set_recall_eq(bool yn) { set_flag(yn, RecallEQ);};
void MixerSnapshot::set_recall_comp(bool yn) { set_flag(yn, RecallComp);};
#endif
void MixerSnapshot::set_recall_io(bool yn) { set_flag(yn, RecallIO);};
void MixerSnapshot::set_recall_group(bool yn) { set_flag(yn, RecallGroup);};
void MixerSnapshot::set_recall_vca(bool yn) { set_flag(yn, RecallVCA);};
@ -305,7 +307,7 @@ void MixerSnapshot::recall()
if(!get_recall_vca()) {
continue;
}
State state = (*i);
boost::shared_ptr<VCA> vca = _session->vca_manager().vca_by_name(state.name);
@ -499,8 +501,8 @@ XMLNode& MixerSnapshot::sanitize_node(XMLNode& node)
for(vector<string>::const_iterator it = procs.begin(); it != procs.end(); it++) {
node.remove_node_and_delete(node_name, prop_name, (*it));
}
#endif
#else
if(!get_recall_eq()) {
node.remove_node_and_delete("Processor", "name", "EQ");
}
@ -508,6 +510,7 @@ XMLNode& MixerSnapshot::sanitize_node(XMLNode& node)
if(!get_recall_comp()) {
node.remove_node_and_delete("Processor", "name", "Comp");
}
#endif
if(!get_recall_io()) {
node.remove_node_and_delete("IO", "direction", "Input");