OSCSurface *s = get_surface(addr);
uint32_t ssid = get_sid (strip, addr);
- OSCRouteObserver* o = new OSCRouteObserver (strip, addr, ssid, s->gainmode, s->feedback);
+ OSCRouteObserver* o = new OSCRouteObserver (strip, addr, ssid, s);
route_observers.push_back (o);
strip->DropReferences.connect (*this, MISSING_INVALIDATOR, boost::bind (&OSC::route_lost, this, boost::weak_ptr<Stripable> (strip)), this);
lo_message_add_int32 (reply, s->rec_enable_control()->get_value());
}
- //Automatically listen to routes listed
- listen_to_route(r, get_address (msg));
+ //Automatically listen to stripables listed
+ listen_to_route(s, get_address (msg));
lo_send_message (get_address (msg), "#reply", reply);
lo_message_free (reply);
// top bank is always filled if there are enough strips for at least one bank
bank_start = (uint32_t)((s->nstrips - b_size) + 1);
}
- //save bank in case we have had to change it
+ //save bank after bank limit checks
s->bank = bank_start;
if (s->feedback[0] || s->feedback[1]) {
}
}
// light bankup or bankdown buttons if it is possible to bank in that direction
- if (s->feedback[4]) {
- // these two messages could be bundled
+ if (s->feedback[4] && !s->no_clear) {
lo_message reply;
reply = lo_message_new ();
if ((s->bank > (s->nstrips - s->bank_size)) || (s->nstrips < s->bank_size)) {
lo_message_add_int32(reply, p->active() ? 1 : 0);
}
}
- // if used dedicated message path to identify this reply in async operation. Naming it #reply wont help the client to identify the content.
+ // if used dedicated message path to identify this reply in async operation.
+ // Naming it #reply wont help the client to identify the content.
lo_send_message(get_address (msg), "/strip/sends", reply);
lo_message_free(reply);
}
}
- // I have used a dedicated message path to identify this reply in async operation. Naming it #reply wont help the client to identify the content.
+ // I have used a dedicated message path to identify this reply in async operation.
+ // Naming it #reply wont help the client to identify the content.
lo_send_message(get_address (msg), "/strip/receives", reply);
lo_message_free(reply);
return 0;
using namespace ARDOUR;
using namespace ArdourSurface;
-OSCRouteObserver::OSCRouteObserver (boost::shared_ptr<Stripable> s, lo_address a, uint32_t ss, uint32_t gm, std::bitset<32> fb)
+OSCRouteObserver::OSCRouteObserver (boost::shared_ptr<Stripable> s, lo_address a, uint32_t ss, ArdourSurface::OSC::OSCSurface* su)
: _strip (s)
,ssid (ss)
- ,gainmode (gm)
- ,feedback (fb)
+ ,sur (su)
{
addr = lo_address_new (lo_address_get_hostname(a) , lo_address_get_port(a));
+ gainmode = sur->gainmode;
+ feedback = sur->feedback;
if (feedback[0]) { // buttons are separate feedback
_strip->PropertyChanged.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::name_changed, this, boost::lambda::_1), OSC::instance());
{
strip_connections.drop_connections ();
+ if (sur->no_clear) {
+ // some surfaces destroy their own strips and don't need the extra noise
+ lo_address_free (addr);
+ return;
+ }
+
// all strip buttons should be off and faders 0 and etc.
clear_strip ("/strip/expand", 0);
if (feedback[0]) { // buttons are separate feedback
#include "pbd/stateful.h"
#include "ardour/types.h"
+#include "osc.h"
+
class OSCRouteObserver
{
public:
- OSCRouteObserver (boost::shared_ptr<ARDOUR::Stripable>, lo_address addr, uint32_t sid, uint32_t gainmode, std::bitset<32> feedback);
+ OSCRouteObserver (boost::shared_ptr<ARDOUR::Stripable>, lo_address addr, uint32_t sid, ArdourSurface::OSC::OSCSurface* sur);
~OSCRouteObserver ();
boost::shared_ptr<ARDOUR::Stripable> strip () const { return _strip; }
uint32_t ssid;
uint32_t gainmode;
std::bitset<32> feedback;
+ ArdourSurface::OSC::OSCSurface* sur;
float _last_meter;
uint32_t gain_timeout;
uint32_t trim_timeout;