mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 17:16:38 +01:00
show/hide VCA assign buttons depending on VCA existence
This commit is contained in:
parent
f485cfa324
commit
ba4464dc3c
3 changed files with 62 additions and 0 deletions
|
|
@ -1233,6 +1233,7 @@ Mixer_UI::redisplay_track_list ()
|
||||||
{
|
{
|
||||||
TreeModel::Children rows = track_model->children();
|
TreeModel::Children rows = track_model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
|
uint32_t n_masters = 0;
|
||||||
|
|
||||||
if (no_track_list_redisplay) {
|
if (no_track_list_redisplay) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -1247,6 +1248,7 @@ Mixer_UI::redisplay_track_list ()
|
||||||
if (vms) {
|
if (vms) {
|
||||||
vca_packer.pack_start (*vms, false, false);
|
vca_packer.pack_start (*vms, false, false);
|
||||||
vms->show ();
|
vms->show ();
|
||||||
|
n_masters++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1296,6 +1298,14 @@ Mixer_UI::redisplay_track_list ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* update visibility of VCA assign buttons */
|
||||||
|
|
||||||
|
if (n_masters == 0) {
|
||||||
|
UIConfiguration::instance().set_mixer_strip_visibility (VisibilityGroup::remove_element (UIConfiguration::instance().get_mixer_strip_visibility(), X_("VCA")));
|
||||||
|
} else {
|
||||||
|
UIConfiguration::instance().set_mixer_strip_visibility (VisibilityGroup::add_element (UIConfiguration::instance().get_mixer_strip_visibility(), X_("VCA")));
|
||||||
|
}
|
||||||
|
|
||||||
_group_tabs->set_dirty ();
|
_group_tabs->set_dirty ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,10 @@
|
||||||
#include <gtkmm/menu.h>
|
#include <gtkmm/menu.h>
|
||||||
#include <gtkmm/menushell.h>
|
#include <gtkmm/menushell.h>
|
||||||
#include <gtkmm/treeview.h>
|
#include <gtkmm/treeview.h>
|
||||||
|
|
||||||
|
#include "pbd/strsplit.h"
|
||||||
#include "pbd/xml++.h"
|
#include "pbd/xml++.h"
|
||||||
|
|
||||||
#include "visibility_group.h"
|
#include "visibility_group.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
@ -167,6 +170,52 @@ VisibilityGroup::set_state (string v)
|
||||||
update ();
|
update ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string
|
||||||
|
VisibilityGroup::remove_element (std::string const& from, std::string const& element)
|
||||||
|
{
|
||||||
|
std::vector<string> s;
|
||||||
|
std::string ret;
|
||||||
|
|
||||||
|
split (from, s, ',');
|
||||||
|
for (std::vector<string>::const_iterator i = s.begin(); i != s.end(); ++i) {
|
||||||
|
if ((*i) == element) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!ret.empty()) {
|
||||||
|
ret += ',';
|
||||||
|
}
|
||||||
|
ret += *i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
string
|
||||||
|
VisibilityGroup::add_element (std::string const& from, std::string const& element)
|
||||||
|
{
|
||||||
|
std::vector<string> s;
|
||||||
|
std::string ret;
|
||||||
|
|
||||||
|
split (from, s, ',');
|
||||||
|
|
||||||
|
for (std::vector<string>::const_iterator i = s.begin(); i != s.end(); ++i) {
|
||||||
|
if ((*i) == element) {
|
||||||
|
/* already present, just return the original */
|
||||||
|
return from;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = from;
|
||||||
|
|
||||||
|
if (!ret.empty()) {
|
||||||
|
ret += ',';
|
||||||
|
}
|
||||||
|
|
||||||
|
ret += element;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
VisibilityGroup::get_state_name () const
|
VisibilityGroup::get_state_name () const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,9 @@ public:
|
||||||
|
|
||||||
PBD::Signal0<void> VisibilityChanged;
|
PBD::Signal0<void> VisibilityChanged;
|
||||||
|
|
||||||
|
static std::string remove_element (std::string const& from, std::string const& element);
|
||||||
|
static std::string add_element (std::string const& from, std::string const& element);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
struct Member {
|
struct Member {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue