#include "osc.h"
#include "osc_route_observer.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace PBD;
recsafe_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_change_message, this, X_("/strip/record_safe"), _strip->rec_safe_control()), OSC::instance());
send_change_message ("/strip/record_safe", _strip->rec_safe_control());
}
- send_select_status ();
+ _strip->presentation_info().PropertyChanged.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_select_status, this, _1), OSC::instance());
+ send_select_status (ARDOUR::Properties::selected);
}
if (feedback[1]) { // level controls
strip_connections.drop_connections ();
// all strip buttons should be off and faders 0 and etc.
+ clear_strip ("/strip/expand", 0);
if (feedback[0]) { // buttons are separate feedback
lo_message msg = lo_message_new ();
// name is a string do it first
{
if (feedback[7] || feedback[8] || feedback[9]) { // meters enabled
// the only meter here is master
- float now_meter = _strip->peak_meter()->meter_level(0, MeterMCP);
+ float now_meter;
+ if (_strip->peak_meter()) {
+ now_meter = _strip->peak_meter()->meter_level(0, MeterMCP);
+ } else {
+ now_meter = -193;
+ }
if (now_meter < -193) now_meter = -193;
if (_last_meter != now_meter) {
if (feedback[7] || feedback[8]) {
}
void
-OSCRouteObserver::send_select_status ()
+OSCRouteObserver::send_select_status (const PropertyChange& what)
{
- // waiting for _strip->is_selected to start working
- if (_strip) {
- string path = "/strip/gui_select";
-
- lo_message msg = lo_message_new ();
- if (feedback[2]) {
- path = set_path (path);
- } else {
- lo_message_add_int32 (msg, ssid);
+ if (what == PropertyChange(ARDOUR::Properties::selected)) {
+ if (_strip) {
+ string path = "/strip/select";
+
+ lo_message msg = lo_message_new ();
+ if (feedback[2]) {
+ path = set_path (path);
+ } else {
+ lo_message_add_int32 (msg, ssid);
+ }
+ lo_message_add_float (msg, _strip->is_selected());
+ lo_send_message (addr, path.c_str(), msg);
+ lo_message_free (msg);
}
- //std::cout << "strip: " << ssid << " strip name: " << _strip->name() << " select: " << _strip->is_selected() << "\n";
- lo_message_add_float (msg, _strip->is_selected());
- lo_send_message (addr, path.c_str(), msg);
- lo_message_free (msg);
}
}