mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Merge b786aa783e into 152e0c2beb
This commit is contained in:
commit
f8688222b6
3 changed files with 36 additions and 29 deletions
|
|
@ -2881,32 +2881,12 @@ OSC::_sel_plugin (int id, lo_address addr)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find out how many plugins we have */
|
|
||||||
sur->plugins.clear();
|
|
||||||
for (int nplugs = 0; true; ++nplugs) {
|
|
||||||
std::shared_ptr<Processor> proc = r->nth_plugin (nplugs);
|
|
||||||
if (!proc) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!r->nth_plugin(nplugs)->display_to_user()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#ifdef MIXBUS
|
|
||||||
/* need to check for mixbus channel strips (and exclude them) */
|
|
||||||
std::shared_ptr<PluginInsert> pi = std::dynamic_pointer_cast<PluginInsert>(proc);
|
|
||||||
if (pi && pi->is_channelstrip()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
sur->plugins.push_back (nplugs);
|
|
||||||
}
|
|
||||||
|
|
||||||
// limit plugin_id to actual plugins
|
// limit plugin_id to actual plugins
|
||||||
if (sur->plugins.size() < 1) {
|
if (sur->plugins.size() < 1) {
|
||||||
sur->plugin_id = 0;
|
sur->plugin_id = 0;
|
||||||
sur->plug_page = 1;
|
sur->plug_page = 1;
|
||||||
if (sur->sel_obs) {
|
if (sur->sel_obs) {
|
||||||
sur->sel_obs->set_plugin_id(-1, 1);
|
sur->sel_obs->set_plugin_id(0, 1);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
} else if (id < 1) {
|
} else if (id < 1) {
|
||||||
|
|
@ -2942,7 +2922,7 @@ OSC::_sel_plugin (int id, lo_address addr)
|
||||||
sur->plug_page = 1;
|
sur->plug_page = 1;
|
||||||
|
|
||||||
if (sur->sel_obs) {
|
if (sur->sel_obs) {
|
||||||
sur->sel_obs->set_plugin_id(sur->plugins[sur->plugin_id - 1], sur->plug_page);
|
sur->sel_obs->set_plugin_id(sur->plugin_id, sur->plug_page);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -4745,11 +4725,36 @@ OSC::_strip_select2 (std::shared_ptr<Stripable> s, OSCSurface *sur, lo_address a
|
||||||
_select = s;
|
_select = s;
|
||||||
}
|
}
|
||||||
if (!s) {
|
if (!s) {
|
||||||
|
sur->plugins.clear();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (s != old_sel) {
|
if (s != old_sel) {
|
||||||
sur->select = s;
|
sur->select = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Create list of user-visible plugins (into which piid indexes) */
|
||||||
|
sur->plugins.clear();
|
||||||
|
std::shared_ptr<Route> r = std::dynamic_pointer_cast<Route>(s);
|
||||||
|
if (r) {
|
||||||
|
for (int nplugs = 0; true; ++nplugs) {
|
||||||
|
std::shared_ptr<Processor> proc = r->nth_plugin (nplugs);
|
||||||
|
if (!proc) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!r->nth_plugin(nplugs)->display_to_user()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#ifdef MIXBUS
|
||||||
|
/* need to check for mixbus channel strips (and exclude them) */
|
||||||
|
std::shared_ptr<PluginInsert> pi = std::dynamic_pointer_cast<PluginInsert>(proc);
|
||||||
|
if (pi && pi->is_channelstrip()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
sur->plugins.push_back (nplugs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool sends;
|
bool sends;
|
||||||
uint32_t nsends = 0;
|
uint32_t nsends = 0;
|
||||||
do {
|
do {
|
||||||
|
|
@ -4792,7 +4797,6 @@ OSC::_strip_select2 (std::shared_ptr<Stripable> s, OSCSurface *sur, lo_address a
|
||||||
}
|
}
|
||||||
// need to set monitor for processor changed signal (for paging)
|
// need to set monitor for processor changed signal (for paging)
|
||||||
string address = lo_address_get_url (addr);
|
string address = lo_address_get_url (addr);
|
||||||
std::shared_ptr<Route> r = std::dynamic_pointer_cast<Route>(s);
|
|
||||||
if (r) {
|
if (r) {
|
||||||
r->processors_changed.connect (sur->proc_connection, MISSING_INVALIDATOR, std::bind (&OSC::processor_changed, this, address), this);
|
r->processors_changed.connect (sur->proc_connection, MISSING_INVALIDATOR, std::bind (&OSC::processor_changed, this, address), this);
|
||||||
_sel_plugin (sur->plugin_id, addr);
|
_sel_plugin (sur->plugin_id, addr);
|
||||||
|
|
|
||||||
|
|
@ -74,9 +74,9 @@ OSCSelectObserver::OSCSelectObserver (OSC& o, ARDOUR::Session& s, ArdourSurface:
|
||||||
plug_size = plug_page_size;
|
plug_size = plug_page_size;
|
||||||
plug_page = sur->plug_page;
|
plug_page = sur->plug_page;
|
||||||
if (sur->plugins.size () > 0) {
|
if (sur->plugins.size () > 0) {
|
||||||
plug_id = sur->plugins[sur->plugin_id - 1];
|
selected_piid = sur->plugin_id;
|
||||||
} else {
|
} else {
|
||||||
plug_id = -1;
|
selected_piid = 0;
|
||||||
}
|
}
|
||||||
_group_sharing[15] = 1;
|
_group_sharing[15] = 1;
|
||||||
refresh_strip (sur->select, sur->nsends, gainmode, true);
|
refresh_strip (sur->select, sur->nsends, gainmode, true);
|
||||||
|
|
@ -447,7 +447,7 @@ OSCSelectObserver::send_end ()
|
||||||
void
|
void
|
||||||
OSCSelectObserver::set_plugin_id (int id, uint32_t page)
|
OSCSelectObserver::set_plugin_id (int id, uint32_t page)
|
||||||
{
|
{
|
||||||
plug_id = id;
|
selected_piid = id;
|
||||||
plug_page = page;
|
plug_page = page;
|
||||||
renew_plugin ();
|
renew_plugin ();
|
||||||
}
|
}
|
||||||
|
|
@ -475,7 +475,7 @@ OSCSelectObserver::renew_plugin () {
|
||||||
void
|
void
|
||||||
OSCSelectObserver::plugin_init()
|
OSCSelectObserver::plugin_init()
|
||||||
{
|
{
|
||||||
if (plug_id < 0) {
|
if (!selected_piid) {
|
||||||
plugin_end ();
|
plugin_end ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -486,12 +486,14 @@ OSCSelectObserver::plugin_init()
|
||||||
}
|
}
|
||||||
|
|
||||||
// we have a plugin number now get the processor
|
// we have a plugin number now get the processor
|
||||||
std::shared_ptr<Processor> proc = r->nth_plugin (plug_id);
|
std::shared_ptr<Processor> proc = r->nth_plugin (sur->plugins[selected_piid - 1]);
|
||||||
std::shared_ptr<PluginInsert> pi;
|
std::shared_ptr<PluginInsert> pi;
|
||||||
if (!(pi = std::dynamic_pointer_cast<PluginInsert>(proc))) {
|
if (!(pi = std::dynamic_pointer_cast<PluginInsert>(proc))) {
|
||||||
plugin_end ();
|
plugin_end ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
_osc.float_message (X_("/select/plugin"), selected_piid, addr);
|
||||||
|
|
||||||
std::shared_ptr<ARDOUR::Plugin> pip = pi->plugin();
|
std::shared_ptr<ARDOUR::Plugin> pip = pi->plugin();
|
||||||
// we have a plugin we can ask if it is activated
|
// we have a plugin we can ask if it is activated
|
||||||
proc->ActiveChanged.connect (plugin_connections, MISSING_INVALIDATOR, std::bind (&OSCSelectObserver::plug_enable, this, X_("/select/plugin/activate"), proc), &_osc);
|
proc->ActiveChanged.connect (plugin_connections, MISSING_INVALIDATOR, std::bind (&OSCSelectObserver::plug_enable, this, X_("/select/plugin/activate"), proc), &_osc);
|
||||||
|
|
@ -564,6 +566,7 @@ void
|
||||||
OSCSelectObserver::plugin_end ()
|
OSCSelectObserver::plugin_end ()
|
||||||
{
|
{
|
||||||
plugin_connections.drop_connections ();
|
plugin_connections.drop_connections ();
|
||||||
|
_osc.float_message (X_("/select/plugin"), 0, addr);
|
||||||
_osc.float_message (X_("/select/plugin/activate"), 0, addr);
|
_osc.float_message (X_("/select/plugin/activate"), 0, addr);
|
||||||
_osc.text_message (X_("/select/plugin/name"), " ", addr);
|
_osc.text_message (X_("/select/plugin/name"), " ", addr);
|
||||||
for (uint32_t i = 1; i <= plug_size; i++) {
|
for (uint32_t i = 1; i <= plug_size; i++) {
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ class OSCSelectObserver
|
||||||
uint32_t nplug_params;
|
uint32_t nplug_params;
|
||||||
uint32_t plug_page_size;
|
uint32_t plug_page_size;
|
||||||
uint32_t plug_page;
|
uint32_t plug_page;
|
||||||
int plug_id;
|
uint32_t selected_piid;
|
||||||
uint32_t plug_size;
|
uint32_t plug_size;
|
||||||
std::vector<int> plug_params;
|
std::vector<int> plug_params;
|
||||||
int eq_bands;
|
int eq_bands;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue