mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
non-modal sidechain i/o selector
This commit is contained in:
parent
db2a55f88a
commit
79794650c1
2 changed files with 19 additions and 23 deletions
|
|
@ -26,7 +26,6 @@
|
||||||
|
|
||||||
#include "ardour/plugin.h"
|
#include "ardour/plugin.h"
|
||||||
|
|
||||||
#include "io_selector.h"
|
|
||||||
#include "plugin_pin_dialog.h"
|
#include "plugin_pin_dialog.h"
|
||||||
#include "gui_thread.h"
|
#include "gui_thread.h"
|
||||||
#include "ui_config.h"
|
#include "ui_config.h"
|
||||||
|
|
@ -58,6 +57,7 @@ PluginPinDialog::PluginPinDialog (boost::shared_ptr<ARDOUR::PluginInsert> pi)
|
||||||
, _min_width (300)
|
, _min_width (300)
|
||||||
, _position_valid (false)
|
, _position_valid (false)
|
||||||
, _ignore_updates (false)
|
, _ignore_updates (false)
|
||||||
|
, _sidechain_selector (0)
|
||||||
{
|
{
|
||||||
assert (pi->owner ()); // Route
|
assert (pi->owner ()); // Route
|
||||||
|
|
||||||
|
|
@ -180,6 +180,7 @@ PluginPinDialog::PluginPinDialog (boost::shared_ptr<ARDOUR::PluginInsert> pi)
|
||||||
|
|
||||||
PluginPinDialog::~PluginPinDialog ()
|
PluginPinDialog::~PluginPinDialog ()
|
||||||
{
|
{
|
||||||
|
delete _sidechain_selector;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -202,6 +203,11 @@ PluginPinDialog::plugin_reconfigured ()
|
||||||
_tgl_sidechain.set_active (_pi->has_sidechain ());
|
_tgl_sidechain.set_active (_pi->has_sidechain ());
|
||||||
_edt_sidechain.set_sensitive (_pi->has_sidechain ()); // && _session
|
_edt_sidechain.set_sensitive (_pi->has_sidechain ()); // && _session
|
||||||
|
|
||||||
|
if (!_pi->has_sidechain () && _sidechain_selector) {
|
||||||
|
delete _sidechain_selector;
|
||||||
|
_sidechain_selector = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// calc minimum width
|
// calc minimum width
|
||||||
const uint32_t max_ports = std::max (_ins.n_total (), _out.n_total ());
|
const uint32_t max_ports = std::max (_ins.n_total (), _out.n_total ());
|
||||||
const uint32_t max_pins = std::max ((_sinks * _n_plugins).n_total (), (_sources * _n_plugins).n_total ());
|
const uint32_t max_pins = std::max ((_sinks * _n_plugins).n_total (), (_sources * _n_plugins).n_total ());
|
||||||
|
|
@ -695,9 +701,16 @@ void
|
||||||
PluginPinDialog::connect_sidechain ()
|
PluginPinDialog::connect_sidechain ()
|
||||||
{
|
{
|
||||||
if (!_session) { return; }
|
if (!_session) { return; }
|
||||||
// TODO non-modal would be cooler ... :)
|
|
||||||
SideChainUI sc (*this, _session, _pi->sidechain_input ());
|
if (_sidechain_selector == 0) {
|
||||||
sc.run ();
|
_sidechain_selector = new IOSelectorWindow (_session, _pi->sidechain_input ());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_sidechain_selector->is_visible()) {
|
||||||
|
_sidechain_selector->get_toplevel()->get_window()->raise();
|
||||||
|
} else {
|
||||||
|
_sidechain_selector->present ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -728,14 +741,3 @@ PluginPinDialog::add_remove_port_clicked (bool add, ARDOUR::DataType dt)
|
||||||
out.set (dt, out.get (dt) + (add ? 1 : -1));
|
out.set (dt, out.get (dt) + (add ? 1 : -1));
|
||||||
_route ()->customize_plugin_insert (_pi, _n_plugins, out);
|
_route ()->customize_plugin_insert (_pi, _n_plugins, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
SideChainUI::SideChainUI (Gtk::Window& p, Session* session, boost::shared_ptr<IO> sc)
|
|
||||||
: ArdourDialog (p, string (_("Sidechain ")) + sc->name (), true)
|
|
||||||
{
|
|
||||||
HBox* hbox = manage (new HBox);
|
|
||||||
IOSelector * io = Gtk::manage (new IOSelector (this, session, sc));
|
|
||||||
hbox->pack_start (*io, true, true);
|
|
||||||
get_vbox ()->pack_start (*hbox, true, true);
|
|
||||||
io->show ();
|
|
||||||
hbox->show ();
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#include "ardour_button.h"
|
#include "ardour_button.h"
|
||||||
#include "ardour_window.h"
|
#include "ardour_window.h"
|
||||||
#include "ardour_dialog.h"
|
#include "io_selector.h"
|
||||||
|
|
||||||
class PluginPinDialog : public ArdourWindow
|
class PluginPinDialog : public ArdourWindow
|
||||||
{
|
{
|
||||||
|
|
@ -131,13 +131,7 @@ private:
|
||||||
bool _position_valid;
|
bool _position_valid;
|
||||||
bool _ignore_updates;
|
bool _ignore_updates;
|
||||||
ARDOUR::Route* _route () { return static_cast<ARDOUR::Route*> (_pi->owner ()); }
|
ARDOUR::Route* _route () { return static_cast<ARDOUR::Route*> (_pi->owner ()); }
|
||||||
|
IOSelectorWindow *_sidechain_selector;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SideChainUI: public ArdourDialog
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
SideChainUI (Gtk::Window&, ARDOUR::Session*, boost::shared_ptr<ARDOUR::IO>);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue