first pass at making the GUI for a VCA visible
This commit is contained in:
parent
3819d4f9ed
commit
99d251de7d
|
@ -92,6 +92,7 @@
|
|||
#include "ardour/source_factory.h"
|
||||
#include "ardour/slave.h"
|
||||
#include "ardour/system_exec.h"
|
||||
#include "ardour/vca_manager.h"
|
||||
|
||||
#include "LuaBridge/LuaBridge.h"
|
||||
|
||||
|
@ -1796,6 +1797,16 @@ ARDOUR_UI::open_session ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::session_add_vca (const string& name_template)
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
}
|
||||
|
||||
_session->vca_manager().create_vca (name_template);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::session_add_mixed_track (
|
||||
const ChanCount& input,
|
||||
|
@ -4035,7 +4046,7 @@ ARDOUR_UI::add_route ()
|
|||
session_add_midi_bus (route_group, count, name_template, strict_io, instrument, 0);
|
||||
break;
|
||||
case AddRouteDialog::VCAMaster:
|
||||
/* do something */
|
||||
session_add_vca (name_template);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -271,6 +271,8 @@ public:
|
|||
void flush_videotimeline_cache (bool localcacheonly=false);
|
||||
void export_video (bool range = false);
|
||||
|
||||
void session_add_vca (std::string const &);
|
||||
|
||||
void session_add_audio_track (
|
||||
int input_channels,
|
||||
int32_t output_channels,
|
||||
|
|
|
@ -63,6 +63,10 @@ MixerGroupTabs::compute_tabs () const
|
|||
|
||||
MixerStrip* s = (*i)[_mixer->track_columns.strip];
|
||||
|
||||
if (!s) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (s->route()->is_master() || s->route()->is_monitor() || !s->marked_for_display()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -151,9 +155,13 @@ MixerGroupTabs::routes_for_tab (Tab const * t) const
|
|||
|
||||
MixerStrip* s = (*i)[_mixer->track_columns.strip];
|
||||
|
||||
if (s->route()->is_master() || s->route()->is_monitor() || !s->marked_for_display()) {
|
||||
continue;
|
||||
}
|
||||
if (!s) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (s->route()->is_master() || s->route()->is_monitor() || !s->marked_for_display()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (x >= t->to) {
|
||||
/* tab finishes before this track starts */
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
#include "ardour/route_group.h"
|
||||
#include "ardour/route_sorters.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/vca.h"
|
||||
#include "ardour/vca_manager.h"
|
||||
|
||||
#include "keyboard.h"
|
||||
#include "mixer_ui.h"
|
||||
|
@ -63,6 +65,7 @@
|
|||
#include "mixer_group_tabs.h"
|
||||
#include "timers.h"
|
||||
#include "ui_config.h"
|
||||
#include "vca_master_strip.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
@ -350,6 +353,9 @@ Mixer_UI::show_window ()
|
|||
|
||||
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
||||
ms = (*ri)[track_columns.strip];
|
||||
if (!ms) {
|
||||
continue;
|
||||
}
|
||||
ms->set_width_enum (ms->get_width_enum (), ms->width_owner());
|
||||
/* Fix visibility of mixer strip stuff */
|
||||
ms->parameter_changed (X_("mixer-element-visibility"));
|
||||
|
@ -359,6 +365,29 @@ Mixer_UI::show_window ()
|
|||
scroller_base.grab_focus ();
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::add_masters (VCAList& vcas)
|
||||
{
|
||||
cerr << "VCA added\n";
|
||||
|
||||
for (VCAList::iterator v = vcas.begin(); v != vcas.end(); ++v) {
|
||||
|
||||
VCAMasterStrip* vms = new VCAMasterStrip (_session, *v);
|
||||
|
||||
TreeModel::Row row = *(track_model->append());
|
||||
row[track_columns.text] = (*v)->name();
|
||||
row[track_columns.visible] = true;
|
||||
row[track_columns.vca] = vms;
|
||||
}
|
||||
|
||||
redisplay_track_list ();
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::remove_master (VCAMasterStrip* vms)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::add_strips (RouteList& routes)
|
||||
{
|
||||
|
@ -368,6 +397,10 @@ Mixer_UI::add_strips (RouteList& routes)
|
|||
for (Gtk::TreeModel::Children::iterator it = track_model->children().begin(); it != track_model->children().end(); ++it) {
|
||||
boost::shared_ptr<Route> r = (*it)[track_columns.route];
|
||||
|
||||
if (!r) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (r->order_key() == (routes.front()->order_key() + routes.size())) {
|
||||
insert_iter = it;
|
||||
break;
|
||||
|
@ -434,6 +467,7 @@ Mixer_UI::add_strips (RouteList& routes)
|
|||
row[track_columns.visible] = strip->route()->is_master() ? true : strip->marked_for_display();
|
||||
row[track_columns.route] = route;
|
||||
row[track_columns.strip] = strip;
|
||||
row[track_columns.vca] = 0;
|
||||
|
||||
if (!from_scratch) {
|
||||
_selection.add (strip);
|
||||
|
@ -540,6 +574,10 @@ Mixer_UI::reset_remote_control_ids ()
|
|||
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
|
||||
bool visible = (*ri)[track_columns.visible];
|
||||
|
||||
if (!route) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!route->is_master() && !route->is_monitor()) {
|
||||
|
||||
uint32_t new_rid = (visible ? rid : invisible_key--);
|
||||
|
@ -587,6 +625,10 @@ Mixer_UI::sync_order_keys_from_treeview ()
|
|||
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
|
||||
bool visible = (*ri)[track_columns.visible];
|
||||
|
||||
if (!route) {
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32_t old_key = route->order_key ();
|
||||
|
||||
if (order != old_key) {
|
||||
|
@ -650,6 +692,9 @@ Mixer_UI::sync_treeview_from_order_keys ()
|
|||
|
||||
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++old_order) {
|
||||
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
|
||||
if (!route) {
|
||||
continue;
|
||||
}
|
||||
sorted_routes.push_back (RoutePlusOrderKey (route, old_order, route->order_key ()));
|
||||
}
|
||||
|
||||
|
@ -826,6 +871,8 @@ Mixer_UI::set_session (Session* sess)
|
|||
_session->DirtyChanged.connect (_session_connections, invalidator (*this), boost::bind (&Mixer_UI::update_title, this), gui_context());
|
||||
_session->StateSaved.connect (_session_connections, invalidator (*this), boost::bind (&Mixer_UI::update_title, this), gui_context());
|
||||
|
||||
_session->vca_manager().VCAAdded.connect (_session_connections, invalidator (*this), boost::bind (&Mixer_UI::add_masters, this, _1), gui_context());
|
||||
|
||||
Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::parameter_changed, this, _1), gui_context ());
|
||||
|
||||
route_groups_changed ();
|
||||
|
@ -900,7 +947,9 @@ Mixer_UI::update_track_visibility ()
|
|||
|
||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||
MixerStrip *strip = (*i)[track_columns.strip];
|
||||
(*i)[track_columns.visible] = strip->marked_for_display ();
|
||||
if (strip) {
|
||||
(*i)[track_columns.visible] = strip->marked_for_display ();
|
||||
}
|
||||
}
|
||||
|
||||
/* force route order keys catch up with visibility changes
|
||||
|
@ -984,7 +1033,7 @@ Mixer_UI::set_all_strips_visibility (bool yn)
|
|||
TreeModel::Row row = (*i);
|
||||
MixerStrip* strip = row[track_columns.strip];
|
||||
|
||||
if (strip == 0) {
|
||||
if (!strip) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1013,7 +1062,7 @@ Mixer_UI::set_all_audio_midi_visibility (int tracks, bool yn)
|
|||
TreeModel::Row row = (*i);
|
||||
MixerStrip* strip = row[track_columns.strip];
|
||||
|
||||
if (strip == 0) {
|
||||
if (!strip) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1134,11 +1183,22 @@ Mixer_UI::redisplay_track_list ()
|
|||
return;
|
||||
}
|
||||
|
||||
container_clear (vca_packer);
|
||||
|
||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||
|
||||
VCAMasterStrip* vms = (*i)[track_columns.vca];
|
||||
|
||||
if (vms) {
|
||||
vca_packer.pack_start (*vms, false, false);
|
||||
vms->show ();
|
||||
cerr << "Packed vca into vca_packer\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
MixerStrip* strip = (*i)[track_columns.strip];
|
||||
|
||||
if (strip == 0) {
|
||||
if (!strip) {
|
||||
/* we're in the middle of changing a row, don't worry */
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ class MixerStrip;
|
|||
class PluginSelector;
|
||||
class MixerGroupTabs;
|
||||
class MonitorSection;
|
||||
class VCAMasterStrip;
|
||||
|
||||
class PluginTreeStore : public Gtk::TreeStore
|
||||
{
|
||||
|
@ -162,6 +163,9 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
|
|||
void add_strips (ARDOUR::RouteList&);
|
||||
void remove_strip (MixerStrip *);
|
||||
|
||||
void add_masters (ARDOUR::VCAList&);
|
||||
void remove_master (VCAMasterStrip*);
|
||||
|
||||
MixerStrip* strip_by_route (boost::shared_ptr<ARDOUR::Route>);
|
||||
|
||||
void hide_all_strips (bool with_select);
|
||||
|
@ -256,16 +260,20 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
|
|||
/* various treeviews */
|
||||
|
||||
struct TrackDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
|
||||
TrackDisplayModelColumns () {
|
||||
add (text);
|
||||
add (visible);
|
||||
add (route);
|
||||
add (strip);
|
||||
}
|
||||
Gtk::TreeModelColumn<bool> visible;
|
||||
Gtk::TreeModelColumn<std::string> text;
|
||||
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
|
||||
Gtk::TreeModelColumn<MixerStrip*> strip;
|
||||
TrackDisplayModelColumns () {
|
||||
add (text);
|
||||
add (visible);
|
||||
add (route);
|
||||
add (strip);
|
||||
add (vca);
|
||||
}
|
||||
Gtk::TreeModelColumn<bool> visible;
|
||||
Gtk::TreeModelColumn<std::string> text;
|
||||
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
|
||||
/* if route is non-null, this must be non-null */
|
||||
Gtk::TreeModelColumn<MixerStrip*> strip;
|
||||
/* if route is null, this may be non-null */
|
||||
Gtk::TreeModelColumn<VCAMasterStrip*> vca;
|
||||
};
|
||||
|
||||
struct GroupDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
|
||||
|
|
|
@ -52,6 +52,7 @@ namespace ARDOUR {
|
|||
class AudioSource;
|
||||
class Route;
|
||||
class Region;
|
||||
class VCA;
|
||||
|
||||
typedef float Sample;
|
||||
typedef float pan_t;
|
||||
|
@ -565,6 +566,8 @@ namespace ARDOUR {
|
|||
typedef std::list<boost::shared_ptr<Route> > RouteList;
|
||||
typedef std::list<boost::weak_ptr <Route> > WeakRouteList;
|
||||
|
||||
typedef std::list<boost::shared_ptr<VCA> > VCAList;
|
||||
|
||||
class Bundle;
|
||||
typedef std::vector<boost::shared_ptr<Bundle> > BundleList;
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "pbd/signals.h"
|
||||
|
||||
#include "ardour/session_handle.h"
|
||||
#include "ardour/types.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
|
||||
|
@ -47,8 +48,8 @@ class VCAManager : public SessionHandleRef
|
|||
typedef std::list<boost::shared_ptr<VCA> > VCAS;
|
||||
VCAS vcas() const;
|
||||
|
||||
PBD::Signal1<void,boost::shared_ptr<VCA> > VCAAdded;
|
||||
PBD::Signal1<void,boost::shared_ptr<VCA> > VCARemoved;
|
||||
PBD::Signal1<void,VCAList&> VCAAdded;
|
||||
PBD::Signal1<void,VCAList&> VCARemoved;
|
||||
|
||||
private:
|
||||
mutable Glib::Threads::Mutex lock;
|
||||
|
|
|
@ -312,7 +312,7 @@ Session::Session (AudioEngine &eng,
|
|||
, _scene_changer (0)
|
||||
, _midi_ports (0)
|
||||
, _mmc (0)
|
||||
, _vca_manager (0)
|
||||
, _vca_manager (new VCAManager (*this))
|
||||
{
|
||||
uint32_t sr = 0;
|
||||
|
||||
|
|
|
@ -50,7 +50,10 @@ VCAManager::create_vca (std::string const & name)
|
|||
_vcas.push_back (vca);
|
||||
}
|
||||
|
||||
VCAAdded (vca); /* EMIT SIGNAL */
|
||||
VCAList vcal;
|
||||
vcal.push_back (vca);
|
||||
|
||||
VCAAdded (vcal); /* EMIT SIGNAL */
|
||||
return vca;
|
||||
|
||||
}
|
||||
|
@ -64,6 +67,9 @@ VCAManager::remove_vca (boost::shared_ptr<VCA> vca)
|
|||
_vcas.remove (vca);
|
||||
}
|
||||
|
||||
VCARemoved (vca); /* EMIT SIGNAL */
|
||||
VCAList vcal;
|
||||
vcal.push_back (vca);
|
||||
|
||||
VCARemoved (vcal); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue