allow to custom select panner-type for each delivery.
This commit is contained in:
parent
9c595f8131
commit
291618fe71
|
@ -1041,29 +1041,13 @@ MixerStrip::update_panner_choices ()
|
|||
ENSURE_GUI_THREAD (*this, &MixerStrip::update_panner_choices)
|
||||
if (!_route->panner_shell()) { return; }
|
||||
|
||||
int in = _route->output()->n_ports().n_audio();
|
||||
int out = in;
|
||||
|
||||
uint32_t in = _route->output()->n_ports().n_audio();
|
||||
uint32_t out = in;
|
||||
if (_route->panner()) {
|
||||
in = _route->panner()->in().n_audio();
|
||||
}
|
||||
|
||||
if (out < 2 || in == 0) {
|
||||
panners.set_available_panners(_route, std::map<std::string,std::string>());
|
||||
return;
|
||||
}
|
||||
|
||||
std::map<std::string,std::string> panner_list;
|
||||
std::list<PannerInfo*> panner_info = PannerManager::instance().panner_info;
|
||||
/* get available panners for current configuration. */
|
||||
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
|
||||
PanPluginDescriptor* d = &(*p)->descriptor;
|
||||
if (d->in != -1 && d->in != in) continue;
|
||||
if (d->out != -1 && d->out != out) continue;
|
||||
if (d->in == -1 && d->out == -1 && out <= 2) continue;
|
||||
panner_list.insert(std::pair<std::string,std::string>(d->panner_uri,d->name));
|
||||
}
|
||||
panners.set_available_panners(_route, panner_list);
|
||||
panners.set_available_panners(PannerManager::instance().PannerManager::get_available_panners(in, out));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1891,10 +1875,13 @@ MixerStrip::show_send (boost::shared_ptr<Send> send)
|
|||
gain_meter().set_controls (_route, send->meter(), send->amp());
|
||||
gain_meter().setup_meters ();
|
||||
|
||||
uint32_t const in = _current_delivery->pans_required();
|
||||
uint32_t const out = _current_delivery->pan_outs();
|
||||
|
||||
panner_ui().set_panner (_current_delivery->panner_shell(), _current_delivery->panner());
|
||||
panner_ui().set_available_panners(boost::shared_ptr<ARDOUR::Route>(), std::map<std::string,std::string>());
|
||||
panner_ui().set_available_panners(PannerManager::instance().PannerManager::get_available_panners(in, out));
|
||||
panner_ui().setup_pan ();
|
||||
panners.show_all ();
|
||||
panner_ui().show_all ();
|
||||
|
||||
input_button.set_sensitive (false);
|
||||
group_button.set_sensitive (false);
|
||||
|
|
|
@ -388,7 +388,7 @@ PannerUI::build_pan_menu ()
|
|||
items.push_back (MenuElem (_("Edit..."), sigc::mem_fun (*this, &PannerUI::pan_edit)));
|
||||
}
|
||||
|
||||
if (_route && _panner_list.size() > 1 && !_panshell->bypassed()) {
|
||||
if (_panner_list.size() > 1 && !_panshell->bypassed()) {
|
||||
RadioMenuItem::Group group;
|
||||
items.push_back (SeparatorElem());
|
||||
|
||||
|
@ -444,9 +444,7 @@ PannerUI::pan_reset ()
|
|||
void
|
||||
PannerUI::pan_set_custom_type (std::string uri) {
|
||||
if (_suspend_menu_callbacks) return;
|
||||
if (_route) {
|
||||
_route->set_custom_panner_uri(uri);
|
||||
}
|
||||
_panshell->select_panner_by_uri(uri);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -644,8 +642,7 @@ PannerUI::position_adjusted ()
|
|||
}
|
||||
|
||||
void
|
||||
PannerUI::set_available_panners(boost::shared_ptr<ARDOUR::Route> r, std::map<std::string,std::string> p)
|
||||
PannerUI::set_available_panners(std::map<std::string,std::string> p)
|
||||
{
|
||||
_route = r;
|
||||
_panner_list = p;
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
|||
|
||||
void set_width (Width);
|
||||
void setup_pan ();
|
||||
void set_available_panners(boost::shared_ptr<ARDOUR::Route>, std::map<std::string,std::string>);
|
||||
void set_available_panners(std::map<std::string,std::string>);
|
||||
|
||||
void effective_pan_display ();
|
||||
|
||||
|
@ -85,6 +85,7 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
|||
|
||||
private:
|
||||
friend class MixerStrip;
|
||||
friend class SendUI;
|
||||
|
||||
boost::shared_ptr<ARDOUR::PannerShell> _panshell;
|
||||
boost::shared_ptr<ARDOUR::Panner> _panner;
|
||||
|
@ -161,7 +162,6 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
|||
void start_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
|
||||
void stop_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
|
||||
|
||||
boost::shared_ptr<ARDOUR::Route> _route;
|
||||
std::map<std::string,std::string> _panner_list;
|
||||
bool _suspend_menu_callbacks;
|
||||
};
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <gtkmm2ext/doi.h>
|
||||
|
||||
#include "ardour/io.h"
|
||||
#include "ardour/panner_manager.h"
|
||||
#include "ardour/send.h"
|
||||
#include "ardour/rc_configuration.h"
|
||||
|
||||
|
@ -70,7 +71,11 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session
|
|||
|
||||
_send->output()->changed.connect (connections, invalidator (*this), boost::bind (&SendUI::outs_changed, this, _1, _2), gui_context());
|
||||
|
||||
uint32_t const in = _send->pans_required();
|
||||
uint32_t const out = _send->pan_outs();
|
||||
|
||||
_panners.set_width (Wide);
|
||||
_panners.set_available_panners(PannerManager::instance().PannerManager::get_available_panners(in, out));
|
||||
_panners.setup_pan ();
|
||||
|
||||
_gpm.setup_meters ();
|
||||
|
@ -97,7 +102,14 @@ SendUI::outs_changed (IOChange change, void* /*ignored*/)
|
|||
{
|
||||
ENSURE_GUI_THREAD (*this, &SendUI::outs_changed, change, ignored)
|
||||
if (change.type & IOChange::ConfigurationChanged) {
|
||||
uint32_t const in = _send->pans_required();
|
||||
uint32_t const out = _send->pan_outs();
|
||||
if (_panners._panner == 0) {
|
||||
_panners.set_panner (_send->panner_shell(), _send->panner());
|
||||
}
|
||||
_panners.set_available_panners(PannerManager::instance().PannerManager::get_available_panners(in, out));
|
||||
_panners.setup_pan ();
|
||||
_panners.show_all ();
|
||||
_gpm.setup_meters ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
namespace ARDOUR {
|
||||
|
||||
typedef std::map<std::string,std::string> PannerUriMap;
|
||||
|
||||
struct PannerInfo {
|
||||
PanPluginDescriptor descriptor;
|
||||
void* module;
|
||||
|
@ -50,7 +52,8 @@ public:
|
|||
std::list<PannerInfo*> panner_info;
|
||||
|
||||
PannerInfo* select_panner (ChanCount in, ChanCount out, std::string const uri = "");
|
||||
PannerInfo* get_by_uri (std::string uri);
|
||||
PannerInfo* get_by_uri (std::string uri) const;
|
||||
PannerUriMap get_available_panners(uint32_t const a_in, uint32_t const a_out) const;
|
||||
|
||||
private:
|
||||
PannerManager();
|
||||
|
|
|
@ -75,6 +75,9 @@ public:
|
|||
std::string user_selected_panner_uri() const { return _user_selected_panner_uri; }
|
||||
std::string panner_gui_uri() const { return _panner_gui_uri; }
|
||||
|
||||
/* this function takes the process lock */
|
||||
bool select_panner_by_uri (std::string const uri);
|
||||
|
||||
private:
|
||||
friend class Route;
|
||||
void distribute_no_automation (BufferSet& src, BufferSet& dest, pframes_t nframes, gain_t gain_coeff);
|
||||
|
|
|
@ -364,6 +364,7 @@ Delivery::set_state (const XMLNode& node, int version)
|
|||
XMLNode* pannnode = node.child (X_("Pannable"));
|
||||
if (_panshell && _panshell->panner() && pannnode) {
|
||||
_panshell->pannable()->set_state (*pannnode, version);
|
||||
_panshell->pannable()->set_panner(_panshell->panner());
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -218,13 +218,35 @@ PannerManager::select_panner (ChanCount in, ChanCount out, std::string const uri
|
|||
}
|
||||
|
||||
PannerInfo*
|
||||
PannerManager::get_by_uri (std::string uri)
|
||||
PannerManager::get_by_uri (std::string uri) const
|
||||
{
|
||||
PannerInfo* pi = NULL;
|
||||
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
|
||||
for (list<PannerInfo*>::const_iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
|
||||
if ((*p)->descriptor.panner_uri != uri) continue;
|
||||
pi = (*p);
|
||||
break;
|
||||
}
|
||||
return pi;
|
||||
}
|
||||
|
||||
PannerUriMap
|
||||
PannerManager::get_available_panners(uint32_t const a_in, uint32_t const a_out) const
|
||||
{
|
||||
int const in = a_in;
|
||||
int const out = a_out;
|
||||
PannerUriMap panner_list;
|
||||
|
||||
if (out < 2 || in == 0) {
|
||||
return panner_list;
|
||||
}
|
||||
|
||||
/* get available panners for current configuration. */
|
||||
for (list<PannerInfo*>::const_iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
|
||||
PanPluginDescriptor* d = &(*p)->descriptor;
|
||||
if (d->in != -1 && d->in != in) continue;
|
||||
if (d->out != -1 && d->out != out) continue;
|
||||
if (d->in == -1 && d->out == -1 && out <= 2) continue;
|
||||
panner_list.insert(std::pair<std::string,std::string>(d->panner_uri,d->name));
|
||||
}
|
||||
return panner_list;
|
||||
}
|
||||
|
|
|
@ -43,8 +43,10 @@
|
|||
#include "evoral/Curve.hpp"
|
||||
|
||||
#include "ardour/audio_buffer.h"
|
||||
#include "ardour/audioengine.h"
|
||||
#include "ardour/buffer_set.h"
|
||||
#include "ardour/debug.h"
|
||||
#include "ardour/pannable.h"
|
||||
#include "ardour/panner.h"
|
||||
#include "ardour/panner_manager.h"
|
||||
#include "ardour/panner_shell.h"
|
||||
|
@ -393,3 +395,21 @@ PannerShell::set_user_selected_panner_uri (std::string const uri)
|
|||
_force_reselect = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
PannerShell::select_panner_by_uri (std::string const uri)
|
||||
{
|
||||
if (uri == _user_selected_panner_uri) return false;
|
||||
_user_selected_panner_uri = uri;
|
||||
if (uri == _current_panner_uri) return false;
|
||||
_force_reselect = true;
|
||||
if (_panner) {
|
||||
Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ());
|
||||
ChanCount in = _panner->in();
|
||||
ChanCount out = _panner->out();
|
||||
configure_io(in, out);
|
||||
pannable()->set_panner(_panner);
|
||||
_session.set_dirty ();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1568,6 +1568,10 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams*
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* currently unused (again) -- but will come in handy soon (again)
|
||||
* once there is an option to link route + delivery panner settings
|
||||
*/
|
||||
void
|
||||
Route::set_custom_panner_uri (std::string const panner_uri)
|
||||
{
|
||||
|
@ -1619,6 +1623,7 @@ Route::set_custom_panner_uri (std::string const panner_uri)
|
|||
processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
|
||||
_session.set_dirty ();
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Route::reset_instrument_info ()
|
||||
|
|
Loading…
Reference in New Issue