mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
initial part of vca assignment via context menu
This commit is contained in:
parent
f44cac5cc6
commit
33e56e58d7
8 changed files with 71 additions and 14 deletions
|
|
@ -35,6 +35,7 @@
|
||||||
#include "ardour/template_utils.h"
|
#include "ardour/template_utils.h"
|
||||||
#include "ardour/route_group.h"
|
#include "ardour/route_group.h"
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
|
#include "ardour/vca.h"
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "add_route_dialog.h"
|
#include "add_route_dialog.h"
|
||||||
|
|
@ -264,7 +265,7 @@ AddRouteDialog::maybe_update_name_template_entry ()
|
||||||
name_template_entry.set_text (_("Bus"));
|
name_template_entry.set_text (_("Bus"));
|
||||||
break;
|
break;
|
||||||
case VCAMaster:
|
case VCAMaster:
|
||||||
name_template_entry.set_text (_("VCA"));
|
name_template_entry.set_text (VCA::default_name_template());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1798,13 +1798,13 @@ ARDOUR_UI::open_session ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ARDOUR_UI::session_add_vca (const string& name_template)
|
ARDOUR_UI::session_add_vca (const string& name_template, uint32_t n)
|
||||||
{
|
{
|
||||||
if (!_session) {
|
if (!_session) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_session->vca_manager().create_vca (name_template);
|
_session->vca_manager().create_vca (n, name_template);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -4046,7 +4046,7 @@ ARDOUR_UI::add_route ()
|
||||||
session_add_midi_bus (route_group, count, name_template, strict_io, instrument, 0);
|
session_add_midi_bus (route_group, count, name_template, strict_io, instrument, 0);
|
||||||
break;
|
break;
|
||||||
case AddRouteDialog::VCAMaster:
|
case AddRouteDialog::VCAMaster:
|
||||||
session_add_vca (name_template);
|
session_add_vca (name_template, count);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ public:
|
||||||
void flush_videotimeline_cache (bool localcacheonly=false);
|
void flush_videotimeline_cache (bool localcacheonly=false);
|
||||||
void export_video (bool range = false);
|
void export_video (bool range = false);
|
||||||
|
|
||||||
void session_add_vca (std::string const &);
|
void session_add_vca (std::string const &, uint32_t);
|
||||||
|
|
||||||
void session_add_audio_track (
|
void session_add_audio_track (
|
||||||
int input_channels,
|
int input_channels,
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,8 @@
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
#include "ardour/types.h"
|
#include "ardour/types.h"
|
||||||
#include "ardour/user_bundle.h"
|
#include "ardour/user_bundle.h"
|
||||||
|
#include "ardour/vca.h"
|
||||||
|
#include "ardour/vca_manager.h"
|
||||||
|
|
||||||
#include "ardour_window.h"
|
#include "ardour_window.h"
|
||||||
#include "mixer_strip.h"
|
#include "mixer_strip.h"
|
||||||
|
|
@ -217,9 +219,14 @@ MixerStrip::init ()
|
||||||
for (uint32_t n = 0; n < n_vca_buttons; ++n) {
|
for (uint32_t n = 0; n < n_vca_buttons; ++n) {
|
||||||
ArdourButton* v = manage (new ArdourButton (ArdourButton::default_elements));
|
ArdourButton* v = manage (new ArdourButton (ArdourButton::default_elements));
|
||||||
vca_buttons.push_back (v); /* no ownership transfer, button is managed by its container */
|
vca_buttons.push_back (v); /* no ownership transfer, button is managed by its container */
|
||||||
vca_table.attach (*v, n, n+1, 0, 1);
|
v->set_no_show_all (true);
|
||||||
|
v->set_name (X_("vca assign"));
|
||||||
|
v->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
|
||||||
|
v->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &MixerStrip::vca_button_release), n), false);
|
||||||
|
UI::instance()->set_tip (*v, string_compose (_("VCA %1 assign"), n));
|
||||||
|
v->set_text (_("v."));
|
||||||
v->show ();
|
v->show ();
|
||||||
v->set_text ("a");
|
vca_table.attach (*v, n, n+1, 0, 1);
|
||||||
}
|
}
|
||||||
vca_table.show ();
|
vca_table.show ();
|
||||||
|
|
||||||
|
|
@ -2483,3 +2490,48 @@ MixerStrip::set_meter_type (MeterType t)
|
||||||
if (_suspend_menu_callbacks) return;
|
if (_suspend_menu_callbacks) return;
|
||||||
gpm.set_type (t);
|
gpm.set_type (t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MixerStrip::vca_menu_toggle (uint32_t n)
|
||||||
|
{
|
||||||
|
if (!_route) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::shared_ptr<VCA> vca = _session->vca_manager().vca_by_number (n);
|
||||||
|
|
||||||
|
if (!vca) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
vca->add (_route);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
MixerStrip::vca_button_release (GdkEventButton* ev, uint32_t which)
|
||||||
|
{
|
||||||
|
using namespace Gtk::Menu_Helpers;
|
||||||
|
|
||||||
|
if (!_session || !Keyboard::is_context_menu_event (ev)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
VCAManager::VCAS vcas (_session->vca_manager().vcas());
|
||||||
|
|
||||||
|
if (vcas.empty()) {
|
||||||
|
/* XXX should probably show a message saying "No VCA masters" */
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Menu* menu = new Menu;
|
||||||
|
MenuList& items = menu->items();
|
||||||
|
RadioMenuItem::Group group;
|
||||||
|
|
||||||
|
for (VCAManager::VCAS::iterator v = vcas.begin(); v != vcas.end(); ++v) {
|
||||||
|
items.push_back (RadioMenuElem (group, (*v)->name(), sigc::bind (sigc::mem_fun (*this, &MixerStrip::vca_menu_toggle), (*v)->number())));
|
||||||
|
}
|
||||||
|
|
||||||
|
menu->popup (1, ev->time);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -319,6 +319,9 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
|
||||||
PBD::ScopedConnection _level_meter_connection;
|
PBD::ScopedConnection _level_meter_connection;
|
||||||
|
|
||||||
std::string meter_point_string (ARDOUR::MeterPoint);
|
std::string meter_point_string (ARDOUR::MeterPoint);
|
||||||
|
|
||||||
|
void vca_menu_toggle (uint32_t n);
|
||||||
|
bool vca_button_release (GdkEventButton* ev, uint32_t which);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __ardour_mixer_strip__ */
|
#endif /* __ardour_mixer_strip__ */
|
||||||
|
|
|
||||||
|
|
@ -368,7 +368,7 @@ Mixer_UI::show_window ()
|
||||||
void
|
void
|
||||||
Mixer_UI::add_masters (VCAList& vcas)
|
Mixer_UI::add_masters (VCAList& vcas)
|
||||||
{
|
{
|
||||||
cerr << "VCA added\n";
|
cerr << vcas.size() << " VCAs added\n";
|
||||||
|
|
||||||
for (VCAList::iterator v = vcas.begin(); v != vcas.end(); ++v) {
|
for (VCAList::iterator v = vcas.begin(); v != vcas.end(); ++v) {
|
||||||
|
|
||||||
|
|
@ -1192,7 +1192,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 ();
|
||||||
cerr << "Packed vca into vca_packer\n";
|
cerr << "Packed vca " << vms->vca()->number() << " into vca_packer\n";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,15 +25,15 @@ using std::string;
|
||||||
|
|
||||||
VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
|
VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
|
||||||
: AxisView (s)
|
: AxisView (s)
|
||||||
, vca (v)
|
, _vca (v)
|
||||||
, gain_meter (s, 250)
|
, gain_meter (s, 250)
|
||||||
{
|
{
|
||||||
gain_meter.set_controls (boost::shared_ptr<Route>(),
|
gain_meter.set_controls (boost::shared_ptr<Route>(),
|
||||||
boost::shared_ptr<PeakMeter>(),
|
boost::shared_ptr<PeakMeter>(),
|
||||||
boost::shared_ptr<Amp>(),
|
boost::shared_ptr<Amp>(),
|
||||||
vca->control());
|
_vca->control());
|
||||||
|
|
||||||
name_button.set_text (vca->name());
|
name_button.set_text (_vca->name());
|
||||||
active_button.set_text ("active");
|
active_button.set_text ("active");
|
||||||
|
|
||||||
pack_start (active_button, false, false);
|
pack_start (active_button, false, false);
|
||||||
|
|
@ -48,5 +48,5 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
|
||||||
string
|
string
|
||||||
VCAMasterStrip::name() const
|
VCAMasterStrip::name() const
|
||||||
{
|
{
|
||||||
return vca->name();
|
return _vca->name();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,10 @@ class VCAMasterStrip : public AxisView, public Gtk::VBox
|
||||||
|
|
||||||
std::string name() const;
|
std::string name() const;
|
||||||
std::string state_id() const { return "VCAMasterStrip"; }
|
std::string state_id() const { return "VCAMasterStrip"; }
|
||||||
|
boost::shared_ptr<ARDOUR::VCA> vca() const { return _vca; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::shared_ptr<ARDOUR::VCA> vca;
|
boost::shared_ptr<ARDOUR::VCA> _vca;
|
||||||
ArdourButton name_button;
|
ArdourButton name_button;
|
||||||
ArdourButton active_button;
|
ArdourButton active_button;
|
||||||
GainMeter gain_meter;
|
GainMeter gain_meter;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue