#include "ardour/solo_isolate_control.h"
#include "ardour/solo_safe_control.h"
#include "ardour/route.h"
+#include "ardour/route_group.h"
#include "ardour/send.h"
#include "ardour/plugin.h"
#include "ardour/plugin_insert.h"
} else {
plug_id = -1;
}
- refresh_strip (sur->select, sur->nsends, true);
+ refresh_strip (sur->select, sur->nsends, gainmode, true);
set_expand (sur->expand_enable);
}
}
void
-OSCSelectObserver::refresh_strip (boost::shared_ptr<ARDOUR::Stripable> new_strip, uint32_t s_nsends, bool force)
+OSCSelectObserver::refresh_strip (boost::shared_ptr<ARDOUR::Stripable> new_strip, uint32_t s_nsends, uint32_t gm, bool force)
{
_init = true;
if (_tick_busy) {
Glib::usleep(100); // let tick finish
}
+ gainmode = gm;
if (_strip && (new_strip == _strip) && !force) {
_init = false;
_strip->PropertyChanged.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::name_changed, this, boost::lambda::_1), OSC::instance());
name_changed (ARDOUR::Properties::name);
+ boost::shared_ptr<Route> rt = boost::dynamic_pointer_cast<Route> (_strip);
+ rt->route_group_changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::group_name, this), OSC::instance());
+ group_name ();
+
+ _strip->presentation_info().PropertyChanged.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::pi_changed, this, _1), OSC::instance());
+ _osc.float_message ("/select/hide", _strip->is_hidden (), addr);
+
_strip->mute_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/mute"), _strip->mute_control()), OSC::instance());
change_message ("/select/mute", _strip->mute_control());
// all strip buttons should be off and faders 0 and etc.
_osc.float_message ("/select/expand", 0, addr);
_osc.text_message ("/select/name", " ", addr);
+ _osc.text_message ("/select/group/name", " ", addr);
_osc.text_message ("/select/comment", " ", addr);
_osc.float_message ("/select/mute", 0, addr);
_osc.float_message ("/select/solo", 0, addr);
_osc.float_message_with_id ("/select/send_enable", c, proc->enabled(), in_line, addr);
}
}
- if (!gainmode && send_valid) {
+ if ((gainmode != 1) && send_valid) {
_osc.text_message_with_id ("/select/send_name", c, _strip->send_name(s), in_line, addr);
}
}
}
}
+void
+OSCSelectObserver::group_name ()
+{
+ boost::shared_ptr<Route> rt = boost::dynamic_pointer_cast<Route> (_strip);
+
+ RouteGroup *rg = rt->route_group();
+ if (rg) {
+ _osc.text_message ("/select/group/name", rg->name(), addr);
+ } else {
+ _osc.text_message ("/select/group/name", " ", addr);
+ }
+}
+
+void
+OSCSelectObserver::pi_changed (PBD::PropertyChange const& what_changed)
+{
+ _osc.float_message ("/select/hide", _strip->is_hidden (), addr);
+}
+
void
OSCSelectObserver::change_message (string path, boost::shared_ptr<Controllable> controllable)
{
}
if (gainmode) {
- _osc.text_message ("/select/name", string_compose ("%1%2%3", std::fixed, std::setprecision(2), accurate_coefficient_to_dB (value)), addr);
- gain_timeout = 8;
_osc.float_message ("/select/fader", _strip->gain_control()->internal_to_interface (value), addr);
- } else {
+ if (gainmode == 1) {
+ _osc.text_message ("/select/name", string_compose ("%1%2%3", std::fixed, std::setprecision(2), accurate_coefficient_to_dB (value)), addr);
+ gain_timeout = 8;
+ }
+ }
+ if (!gainmode || gainmode == 2) {
if (value < 1e-15) {
_osc.float_message ("/select/gain", -200, addr);
} else {
#endif
if (gainmode) {
- path = "/select/send_fader";
if (controllable) {
value = controllable->internal_to_interface (raw_value);
}
- _osc.text_message_with_id ("/select/send_name" , id, string_compose ("%1%2%3", std::fixed, std::setprecision(2), db), in_line, addr);
- if (send_timeout.size() > id) {
- send_timeout[id] = 8;
+ _osc.float_message_with_id ("/select/send_fader", id, value, in_line, addr);
+ if (gainmode == 1) {
+ _osc.text_message_with_id ("/select/send_name" , id, string_compose ("%1%2%3", std::fixed, std::setprecision(2), db), in_line, addr);
+ if (send_timeout.size() > id) {
+ send_timeout[id] = 8;
+ }
}
- } else {
- path = "/select/send_gain";
- value = db;
+ }
+ if (!gainmode || gainmode == 2) {
+ _osc.float_message_with_id ("/select/send_gain", id, db, in_line, addr);
}
- _osc.float_message_with_id (path, id, value, in_line, addr);
}
void