move ControllableDescriptor from libpbd to libardour; add support for describing...
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 16 May 2016 15:08:32 +0000 (11:08 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 May 2016 19:30:42 +0000 (15:30 -0400)
16 files changed:
libs/ardour/ardour/controllable_descriptor.h [new file with mode: 0644]
libs/ardour/ardour/session.h
libs/ardour/ardour/stripable.h
libs/ardour/controllable_descriptor.cc [new file with mode: 0644]
libs/ardour/session.cc
libs/ardour/session_state.cc
libs/ardour/stripable.cc
libs/ardour/wscript
libs/pbd/controllable_descriptor.cc [deleted file]
libs/pbd/pbd/controllable_descriptor.h [deleted file]
libs/pbd/wscript
libs/surfaces/faderport/faderport.cc
libs/surfaces/generic_midi/generic_midi_control_protocol.cc
libs/surfaces/generic_midi/generic_midi_control_protocol.h
libs/surfaces/generic_midi/midicontrollable.cc
libs/surfaces/generic_midi/midicontrollable.h

diff --git a/libs/ardour/ardour/controllable_descriptor.h b/libs/ardour/ardour/controllable_descriptor.h
new file mode 100644 (file)
index 0000000..1d647ff
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+    Copyright (C) 2009 Paul Davis
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef __libardour_controllable_descriptor_h__
+#define __libardour_controllable_descriptor_h__
+
+#include <vector>
+#include <string>
+#include <stdint.h>
+
+#include "ardour/libardour_visibility.h"
+
+namespace ARDOUR {
+
+class LIBARDOUR_API ControllableDescriptor {
+public:
+    enum TopLevelType {
+           PresentationOrderRoute,
+           PresentationOrderVCA,
+           NamedRoute,
+           SelectionCount,
+    };
+
+    enum SubType {
+           Gain,
+           Trim,
+           Solo,
+           Mute,
+           Recenable,
+           PanDirection,
+           PanWidth,
+           PanElevation,
+           Balance,
+           SendGain,
+           PluginParameter
+    };
+
+    ControllableDescriptor ()
+           : _top_level_type (PresentationOrderRoute)
+           , _subtype (Gain)
+           , _banked (false)
+           , _bank_offset (0)
+    {}
+
+    int set (const std::string&);
+
+    /* it is only valid to call top_level_name() if top_level_type() returns
+       NamedRoute
+    */
+
+    TopLevelType top_level_type() const { return _top_level_type; }
+    const std::string& top_level_name() const { return _top_level_name; }
+
+    SubType subtype() const { return _subtype; }
+
+    uint32_t presentation_order() const;
+    uint32_t selection_id() const;
+    uint32_t target (uint32_t n) const;
+    bool banked() const { return _banked; }
+
+    void set_bank_offset (uint32_t o) { _bank_offset = o; }
+
+private:
+    TopLevelType          _top_level_type;
+    SubType               _subtype;
+    std::string           _top_level_name;
+    union {
+           uint32_t  _presentation_order;
+           uint32_t  _selection_id;
+    };
+    std::vector<uint32_t> _target;
+    uint32_t              _banked;
+    uint32_t              _bank_offset;
+};
+
+}
+
+#endif /* __libardour_controllable_descriptor_h__ */
index f3a11a953c41b1359c093fcf87ab4e5dda240c99..0dcad54b6c166d09f6b6ba01e04093c880e6050b 100644 (file)
@@ -88,7 +88,6 @@ class Parser;
 
 namespace PBD {
 class Controllable;
-class ControllableDescriptor;
 }
 
 namespace luabridge {
@@ -114,6 +113,7 @@ class BufferSet;
 class Bundle;
 class Butler;
 class Click;
+class ControllableDescriptor;
 class Diskstream;
 class ExportHandler;
 class ExportStatus;
@@ -988,7 +988,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        boost::shared_ptr<Processor> processor_by_id (PBD::ID) const;
 
        boost::shared_ptr<PBD::Controllable> controllable_by_id (const PBD::ID&);
-       boost::shared_ptr<PBD::Controllable> controllable_by_descriptor (const PBD::ControllableDescriptor&);
+       boost::shared_ptr<PBD::Controllable> controllable_by_descriptor (const ARDOUR::ControllableDescriptor&);
 
        void add_controllable (boost::shared_ptr<PBD::Controllable>);
        void remove_controllable (PBD::Controllable*);
index 1b8239707423adf4fd51632f4d263a2885a95934..274a0109dcc4d292191b121f2bf7d9355c3bc4f9 100644 (file)
@@ -183,9 +183,6 @@ class LIBARDOUR_API Stripable : public SessionObject {
        void set_presentation_info_explicit (PresentationInfo);
 
        void add_state (XMLNode&) const;
-
-  private:
-       void set_presentation_info_internal (PresentationInfo id, bool notify_class_listeners = true);
 };
 
 struct PresentationInfoSorter {
diff --git a/libs/ardour/controllable_descriptor.cc b/libs/ardour/controllable_descriptor.cc
new file mode 100644 (file)
index 0000000..05aa184
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+    Copyright (C) 2009 Paul Davis
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "pbd/strsplit.h"
+#include "pbd/convert.h"
+
+#include "ardour/controllable_descriptor.h"
+
+using namespace std;
+using namespace PBD;
+using namespace ARDOUR;
+
+int
+ControllableDescriptor::set (const std::string& str)
+{
+       string::size_type first_space = str.find_first_of (" ");
+
+       if (first_space == string::npos) {
+               return -1;
+       }
+
+       string front = str.substr (0, first_space);
+       string back = str.substr (first_space);
+
+       vector<string> path;
+       split (front, path, '/');
+
+       if (path.size() < 2) {
+               return -1;
+       }
+
+       vector<string> rest;
+       split (back, rest, ' ');
+
+       if (rest.size() < 1) {
+               return -1;
+       }
+
+       if (path[0] == "route" || path[0] == "rid") {
+
+               _top_level_type = PresentationOrderRoute;
+
+               if (rest[0][0] == 'B') {
+                       _banked = true;
+                       _presentation_order = atoi (rest[0].substr (1));
+               } else if (rest[0][0] == 'S') {
+                       _top_level_type = SelectionCount;
+                       _banked = true;
+                       _selection_id = atoi (rest[0].substr (1));
+               } else if (isdigit (rest[0][0])) {
+                       _banked = false;
+                       _presentation_order = atoi (rest[0]);
+               } else {
+                       return -1;
+               }
+
+       } else if (path[0] == "vca") {
+
+               _top_level_type = PresentationOrderVCA;
+
+               if (rest[0][0] == 'B') {
+                       _banked = true;
+                       _presentation_order = atoi (rest[0].substr (1));
+               } else if (rest[0][0] == 'S') {
+                       _top_level_type = SelectionCount;
+                       _banked = true;
+                       _selection_id = atoi (rest[0].substr (1));
+               } else if (isdigit (rest[0][0])) {
+                       _banked = false;
+                       _presentation_order = atoi (rest[0]);
+               } else {
+                       return -1;
+               }
+
+       } else if (path[0] == "bus" || path[0] == "track") {
+
+               _top_level_type = NamedRoute;
+               _top_level_name = rest[0];
+       }
+
+       if (path[1] == "gain") {
+               _subtype = Gain;
+
+       } else if (path[1] == "trim") {
+               _subtype = Trim;
+
+       } else if (path[1] == "solo") {
+               _subtype = Solo;
+
+       } else if (path[1] == "mute") {
+               _subtype = Mute;
+
+       } else if (path[1] == "recenable") {
+               _subtype = Recenable;
+
+       } else if (path[1] == "balance") {
+               _subtype = Balance;
+
+       } else if (path[1] == "panwidth") {
+               _subtype = PanWidth;
+
+       } else if (path[1] == "pandirection") {
+               _subtype = PanDirection;
+
+       } else if (path[1] == "plugin") {
+               if (path.size() == 3 && rest.size() == 3) {
+                       if (path[2] == "parameter") {
+                               _subtype = PluginParameter;
+                               _target.push_back (atoi (rest[1]));
+                               _target.push_back (atoi (rest[2]));
+                       } else {
+                               return -1;
+                       }
+               } else {
+                       return -1;
+               }
+       } else if (path[1] == "send") {
+
+               if (path.size() == 3 && rest.size() == 2) {
+                       if (path[2] == "gain") {
+                               _subtype = SendGain;
+                               _target.push_back (atoi (rest[1]));
+                       } else {
+                               return -1;
+                       }
+               } else {
+                       return -1;
+               }
+       }
+
+       return 0;
+}
+
+uint32_t
+ControllableDescriptor::presentation_order () const
+{
+       if (banked()) {
+               return _presentation_order + _bank_offset;
+       }
+
+       return _presentation_order;
+}
+
+uint32_t
+ControllableDescriptor::selection_id () const
+{
+       if (banked()) {
+               return _selection_id + _bank_offset;
+       }
+
+       return _selection_id;
+}
+
+uint32_t
+ControllableDescriptor::target (uint32_t n) const
+{
+       if (n < _target.size()) {
+               return _target[n];
+       }
+
+       return 0;
+}
index 8856d9d3233503957bfccc32ce00865d677b0ca5..5d452728eed14373cee7b3a84541409ba9624a2b 100644 (file)
@@ -4206,7 +4206,7 @@ Session::get_remote_nth_stripable (uint16_t n, PresentationInfo::Flag flags) con
        boost::shared_ptr<RouteList> r = routes.reader ();
        vector<boost::shared_ptr<Route> > v;
 
-       if (n > r->size()) {
+       if (n >= r->size()) {
                return boost::shared_ptr<Route> ();
        }
 
@@ -6676,14 +6676,7 @@ Session::notify_presentation_info_change ()
                return;
        }
 
-       switch (Config->get_remote_model()) {
-       case MixerOrdered:
-               Stripable::PresentationInfoChange (); /* EMIT SIGNAL */
-               break;
-       default:
-               break;
-       }
-
+       Stripable::PresentationInfoChange (); /* EMIT SIGNAL */
        reassign_track_numbers();
 
 #ifdef USE_TRACKS_CODE_FEATURES
index 5b10389a3f620f0a058db2719f4d91adacf3e8b3..0fcda1c3f91daab539f59aeb50d40adc839d4380 100644 (file)
@@ -62,7 +62,6 @@
 #include "evoral/SMF.hpp"
 
 #include "pbd/basename.h"
-#include "pbd/controllable_descriptor.h"
 #include "pbd/debug.h"
 #include "pbd/enumwriter.h"
 #include "pbd/error.h"
@@ -84,6 +83,7 @@
 #include "ardour/automation_control.h"
 #include "ardour/boost_debug.h"
 #include "ardour/butler.h"
+#include "ardour/controllable_descriptor.h"
 #include "ardour/control_protocol_manager.h"
 #include "ardour/directory_names.h"
 #include "ardour/filename_extensions.h"
@@ -1597,6 +1597,24 @@ Session::load_routes (const XMLNode& node, int version)
 
        BootMessage (_("Finished adding tracks/busses"));
 
+       boost::shared_ptr<Route> r;
+       uint32_t n = nroutes ();
+
+       for (uint32_t nn = 0; nn < n + 1; ++nn) {
+               r = get_remote_nth_route (nn);
+               if (r) {
+                       std::cerr << "Nth-route = " << r->name() << endl;
+               } else {
+                       std::cerr << "Nth-route: undefined\n";
+               }
+       }
+
+       boost::shared_ptr<Stripable> s;
+       s = get_remote_nth_stripable (0, PresentationInfo::MasterOut);
+       std::cerr << " Master = " << s << std::endl;
+       s = get_remote_nth_stripable (0, PresentationInfo::MonitorOut);
+       std::cerr << " Monitor = " << s << std::endl;
+
        return 0;
 }
 
@@ -3396,6 +3414,7 @@ boost::shared_ptr<Controllable>
 Session::controllable_by_descriptor (const ControllableDescriptor& desc)
 {
        boost::shared_ptr<Controllable> c;
+       boost::shared_ptr<Stripable> s;
        boost::shared_ptr<Route> r;
 
        switch (desc.top_level_type()) {
@@ -3403,65 +3422,65 @@ Session::controllable_by_descriptor (const ControllableDescriptor& desc)
        {
                std::string str = desc.top_level_name();
                if (str == "Master" || str == "master") {
-                       r = _master_out;
+                       s = _master_out;
                } else if (str == "control" || str == "listen") {
-                       r = _monitor_out;
+                       s = _monitor_out;
                } else {
-                       r = route_by_name (desc.top_level_name());
+                       s = route_by_name (desc.top_level_name());
                }
                break;
        }
 
-       case ControllableDescriptor::RemoteControlID:
-               r = get_remote_nth_route (desc.rid());
+       case ControllableDescriptor::PresentationOrderRoute:
+               s = get_remote_nth_stripable (desc.presentation_order(), PresentationInfo::Route);
+               break;
+
+       case ControllableDescriptor::PresentationOrderVCA:
+               s = get_remote_nth_stripable (desc.presentation_order(), PresentationInfo::VCA);
                break;
 
        case ControllableDescriptor::SelectionCount:
-               r = route_by_selected_count (desc.selection_id());
+               s = route_by_selected_count (desc.selection_id());
                break;
        }
 
-       if (!r) {
+       if (!s) {
                return c;
        }
 
+       r = boost::dynamic_pointer_cast<Route> (s);
+
        switch (desc.subtype()) {
        case ControllableDescriptor::Gain:
-               c = r->gain_control ();
+               c = s->gain_control ();
                break;
 
        case ControllableDescriptor::Trim:
-               c = r->trim()->gain_control ();
+               c = s->trim_control ();
                break;
 
        case ControllableDescriptor::Solo:
-                c = r->solo_control();
+                c = s->solo_control();
                break;
 
        case ControllableDescriptor::Mute:
-               c = r->mute_control();
+               c = s->mute_control();
                break;
 
        case ControllableDescriptor::Recenable:
-       {
-               boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(r);
-
-               if (t) {
-                       c = t->rec_enable_control ();
-               }
+               c = s->recenable_control ();
                break;
-       }
 
        case ControllableDescriptor::PanDirection:
-               c = r->pan_azimuth_control();
+               c = s->pan_azimuth_control();
                break;
 
        case ControllableDescriptor::PanWidth:
-               c = r->pan_width_control();
+               c = s->pan_width_control();
                break;
 
        case ControllableDescriptor::PanElevation:
-               c = r->pan_elevation_control();
+               c = s->pan_elevation_control();
                break;
 
        case ControllableDescriptor::Balance:
@@ -3483,6 +3502,10 @@ Session::controllable_by_descriptor (const ControllableDescriptor& desc)
                        --parameter_index;
                }
 
+               if (!r) {
+                       return c;
+               }
+
                boost::shared_ptr<Processor> p = r->nth_plugin (plugin);
 
                if (p) {
@@ -3497,6 +3520,9 @@ Session::controllable_by_descriptor (const ControllableDescriptor& desc)
                if (send > 0) {
                        --send;
                }
+               if (!r) {
+                       return c;
+               }
                c = r->send_level_controllable (send);
                break;
        }
index d322fd75deb3c42db785095d3d24a02a48bb8a1d..a9f8b2b01ac657fb1bf9a324fa2fe353f2529784 100644 (file)
@@ -43,7 +43,7 @@ Stripable::Stripable (Session& s, string const & name, PresentationInfo const &
 void
 Stripable::set_presentation_group_order (PresentationInfo::order_t order, bool notify_class_listeners)
 {
-       set_presentation_info_internal (PresentationInfo (order, _presentation_info.flags()), notify_class_listeners);
+       set_presentation_info (PresentationInfo (order, _presentation_info.flags()), notify_class_listeners);
 }
 
 void
@@ -54,16 +54,6 @@ Stripable::set_presentation_group_order_explicit (PresentationInfo::order_t orde
 
 void
 Stripable::set_presentation_info (PresentationInfo pi, bool notify_class_listeners)
-{
-       if (Config->get_remote_model() != UserOrdered) {
-               return;
-       }
-
-       set_presentation_info_internal (pi, notify_class_listeners);
-}
-
-void
-Stripable::set_presentation_info_internal (PresentationInfo pi, bool notify_class_listeners)
 {
        if (pi != presentation_info()) {
 
@@ -88,7 +78,7 @@ Stripable::set_presentation_info_internal (PresentationInfo pi, bool notify_clas
 void
 Stripable::set_presentation_info_explicit (PresentationInfo pi)
 {
-       set_presentation_info_internal (pi, false);
+       set_presentation_info (pi, false);
 }
 
 int
@@ -99,24 +89,19 @@ Stripable::set_state (XMLNode const& node, int version)
        XMLNodeConstIterator niter;
        XMLNode *child;
 
-       if (version > 3000) {
-
-               std::cerr << "Looking for PI\n";
+       if (version > 3001) {
 
                for (niter = nlist.begin(); niter != nlist.end(); ++niter){
                        child = *niter;
 
                        if (child->name() == X_("PresentationInfo")) {
-                               std::cerr << "Found it\n";
                                if ((prop = child->property (X_("value"))) != 0) {
                                        _presentation_info = prop->value ();
-                                       std::cerr << "Set pinfo to " << _presentation_info << " from " << prop->value() << std::endl;
                                }
                        }
                }
 
        } else {
-               std::cerr << "Old\n";
 
                /* Older versions of Ardour stored "_flags" as a property of the Route
                 * node, only for 3 special Routes (MasterOut, MonitorOut, Auditioner.
@@ -146,6 +131,12 @@ Stripable::set_state (XMLNode const& node, int version)
                        _presentation_info.set_flags (flags);
 
                }
+
+               if (!_presentation_info.special()) {
+                       if ((prop = node.property (X_("order-key"))) != 0) {
+                               _presentation_info.set_group_order (atol (prop->value()));
+                       }
+               }
        }
 
        return 0;
index 1be40f7f6391a2503d7ef95e14eb4bc225102cc4..44e2f21c65f4efc00df93b60429c380c5d40b325 100644 (file)
@@ -8,7 +8,7 @@ import subprocess
 import sys
 
 # default state file version for this build
-CURRENT_SESSION_FILE_VERSION = 3001
+CURRENT_SESSION_FILE_VERSION = 3002
 
 I18N_PACKAGE = 'ardour'
 
@@ -57,6 +57,7 @@ libardour_sources = [
         'chan_count.cc',
         'chan_mapping.cc',
         'config_text.cc',
+        'controllable_descriptor.cc',
         'control_group.cc',
         'control_protocol_manager.cc',
         'cycle_timer.cc',
diff --git a/libs/pbd/controllable_descriptor.cc b/libs/pbd/controllable_descriptor.cc
deleted file mode 100644 (file)
index dce7341..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
-    Copyright (C) 2009 Paul Davis
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#include "pbd/controllable_descriptor.h"
-#include "pbd/strsplit.h"
-#include "pbd/convert.h"
-
-using namespace std;
-using namespace PBD;
-
-int
-ControllableDescriptor::set (const std::string& str)
-{
-       string::size_type first_space = str.find_first_of (" ");
-
-       if (first_space == string::npos) {
-               return -1;
-       }
-
-       string front = str.substr (0, first_space);
-       string back = str.substr (first_space);
-
-       vector<string> path;
-       split (front, path, '/');
-
-       if (path.size() < 2) {
-               return -1;
-       }
-
-       vector<string> rest;
-       split (back, rest, ' ');
-
-       if (rest.size() < 1) {
-               return -1;
-       }
-
-       if (path[0] == "route" || path[0] == "rid") {
-
-               _top_level_type = RemoteControlID;
-
-               if (rest[0][0] == 'B') {
-                       _banked = true;
-                       _rid = atoi (rest[0].substr (1));
-               } else if (rest[0][0] == 'S') {
-                       _top_level_type = SelectionCount;
-                       _banked = true;
-                       _selection_id = atoi (rest[0].substr (1));
-               } else if (isdigit (rest[0][0])) {
-                       _banked = false;
-                       _rid = atoi (rest[0]);
-               } else {
-                       return -1;
-               }
-
-       } else if (path[0] == "bus" || path[0] == "track") {
-
-               _top_level_type = NamedRoute;
-               _top_level_name = rest[0];
-       }
-
-       if (path[1] == "gain") {
-               _subtype = Gain;
-
-       } else if (path[1] == "trim") {
-               _subtype = Trim;
-
-       } else if (path[1] == "solo") {
-               _subtype = Solo;
-
-       } else if (path[1] == "mute") {
-               _subtype = Mute;
-
-       } else if (path[1] == "recenable") {
-               _subtype = Recenable;
-
-       } else if (path[1] == "balance") {
-               _subtype = Balance;
-
-       } else if (path[1] == "panwidth") {
-               _subtype = PanWidth;
-
-       } else if (path[1] == "pandirection") {
-               _subtype = PanDirection;
-
-       } else if (path[1] == "plugin") {
-               if (path.size() == 3 && rest.size() == 3) {
-                       if (path[2] == "parameter") {
-                               _subtype = PluginParameter;
-                               _target.push_back (atoi (rest[1]));
-                               _target.push_back (atoi (rest[2]));
-                       } else {
-                               return -1;
-                       }
-               } else {
-                       return -1;
-               }
-       } else if (path[1] == "send") {
-
-               if (path.size() == 3 && rest.size() == 2) {
-                       if (path[2] == "gain") {
-                               _subtype = SendGain;
-                               _target.push_back (atoi (rest[1]));
-                       } else {
-                               return -1;
-                       }
-               } else {
-                       return -1;
-               }
-       }
-
-       return 0;
-}
-
-uint32_t
-ControllableDescriptor::rid () const
-{
-       if (banked()) {
-               return _rid + _bank_offset;
-       }
-
-       return _rid;
-}
-
-uint32_t
-ControllableDescriptor::selection_id () const
-{
-       if (banked()) {
-               return _selection_id + _bank_offset;
-       }
-
-       return _selection_id;
-}
-
-uint32_t
-ControllableDescriptor::target (uint32_t n) const
-{
-       if (n < _target.size()) {
-               return _target[n];
-       }
-
-       return 0;
-}
diff --git a/libs/pbd/pbd/controllable_descriptor.h b/libs/pbd/pbd/controllable_descriptor.h
deleted file mode 100644 (file)
index b7eb269..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-    Copyright (C) 2009 Paul Davis
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef __pbd_controllable_descriptor_h__
-#define __pbd_controllable_descriptor_h__
-
-#include <vector>
-#include <string>
-#include <stdint.h>
-
-#include "pbd/libpbd_visibility.h"
-
-namespace PBD {
-
-class LIBPBD_API ControllableDescriptor {
-public:
-    enum TopLevelType {
-           RemoteControlID,
-           NamedRoute,
-           SelectionCount,
-    };
-
-    enum SubType {
-           Gain,
-           Trim,
-           Solo,
-           Mute,
-           Recenable,
-           PanDirection,
-           PanWidth,
-           PanElevation,
-           Balance,
-           SendGain,
-           PluginParameter
-    };
-
-    ControllableDescriptor ()
-           : _top_level_type (RemoteControlID)
-           , _subtype (Gain)
-           , _rid (0)
-           , _banked (false)
-           , _bank_offset (0)
-    {}
-
-    int set (const std::string&);
-
-    /* it is only valid to call top_level_name() if top_level_type() returns
-       NamedRoute
-    */
-
-    TopLevelType top_level_type() const { return _top_level_type; }
-    const std::string& top_level_name() const { return _top_level_name; }
-
-    SubType subtype() const { return _subtype; }
-
-    uint32_t rid() const;
-    uint32_t selection_id() const;
-    uint32_t target (uint32_t n) const;
-    bool banked() const { return _banked; }
-
-    void set_bank_offset (uint32_t o) { _bank_offset = o; }
-
-private:
-    TopLevelType          _top_level_type;
-    SubType               _subtype;
-    std::string           _top_level_name;
-    union {
-           uint32_t  _rid;
-           uint32_t  _selection_id;
-    };
-    std::vector<uint32_t> _target;
-    uint32_t              _banked;
-    uint32_t              _bank_offset;
-};
-
-}
-
-#endif /* __pbd_controllable_descriptor_h__ */
index 18b13e3054828a9e267bda2b07dd9e159f8ace41..a996c1913cae436a7fc103af4f29cd20c60f0c3e 100644 (file)
@@ -37,7 +37,6 @@ libpbd_sources = [
     'configuration_variable.cc',
     'convert.cc',
     'controllable.cc',
-    'controllable_descriptor.cc',
     'crossthread.cc',
     'cpus.cc',
     'debug.cc',
index 3d549348f4df458d6d01475a6af0fade44f1d2d2..7b76e9950d372f5433bf45ac4c5bcc3f666b0686 100644 (file)
@@ -26,7 +26,6 @@
 #include <glibmm/fileutils.h>
 #include <glibmm/miscutils.h>
 
-#include "pbd/controllable_descriptor.h"
 #include "pbd/error.h"
 #include "pbd/failed_constructor.h"
 #include "pbd/file_utils.h"
@@ -40,6 +39,7 @@
 #include "ardour/audioengine.h"
 #include "ardour/amp.h"
 #include "ardour/bundle.h"
+#include "ardour/controllable_descriptor.h"
 #include "ardour/debug.h"
 #include "ardour/filesystem_paths.h"
 #include "ardour/midi_port.h"
index 6277adc84e0ede668162645e1880650b81db8938..d4dbb69cb267a01e8cf86dc1d3b7b49b48ba7ffc 100644 (file)
@@ -25,7 +25,6 @@
 #include <glibmm/fileutils.h>
 #include <glibmm/miscutils.h>
 
-#include "pbd/controllable_descriptor.h"
 #include "pbd/error.h"
 #include "pbd/failed_constructor.h"
 #include "pbd/file_utils.h"
@@ -37,6 +36,7 @@
 #include "ardour/async_midi_port.h"
 #include "ardour/audioengine.h"
 #include "ardour/audioengine.h"
+#include "ardour/controllable_descriptor.h"
 #include "ardour/filesystem_paths.h"
 #include "ardour/session.h"
 #include "ardour/route.h"
index a453716e9523c3986e61bd08c3806ea22ee078a9..c1e59bc0dc1c5cd0088c665a02f6b6d26f22c5d2 100644 (file)
 
 namespace PBD {
        class Controllable;
-       class ControllableDescriptor;
 }
 
 namespace ARDOUR {
        class AsyncMIDIPort;
+       class ControllableDescriptor;
        class MidiPort;
        class Session;
 }
@@ -63,7 +63,7 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol {
        int set_feedback (bool yn);
        bool get_feedback () const;
 
-        boost::shared_ptr<PBD::Controllable> lookup_controllable (const PBD::ControllableDescriptor&) const;
+        boost::shared_ptr<PBD::Controllable> lookup_controllable (const ARDOUR::ControllableDescriptor&) const;
 
        XMLNode& get_state ();
        int set_state (const XMLNode&, int version);
index 1051503fc4de3568f6ccc774e4f76d6b1834304e..d99f319f65f73146c6d62b16cf55924d543de876 100644 (file)
@@ -23,7 +23,6 @@
 #include <iostream>
 
 #include "pbd/error.h"
-#include "pbd/controllable_descriptor.h"
 #include "pbd/xml++.h"
 #include "pbd/stacktrace.h"
 #include "pbd/compose.h"
@@ -34,6 +33,7 @@
 
 #include "ardour/async_midi_port.h"
 #include "ardour/automation_control.h"
+#include "ardour/controllable_descriptor.h"
 #include "ardour/midi_ui.h"
 #include "ardour/utils.h"
 #include "ardour/debug.h"
index 8c14856742f908c3b69bf9004508aa097d17156b..ebae2e9294341134a223aed851b4a52a5dc0f14a 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "ardour/types.h"
 
-namespace PBD {
+namespace ARDOUR {
        class ControllableDescriptor;
 }
 
@@ -91,7 +91,7 @@ class MIDIControllable : public PBD::Stateful
        void set_controllable (PBD::Controllable*);
        const std::string& current_uri() const { return _current_uri; }
 
-       PBD::ControllableDescriptor& descriptor() const { return *_descriptor; }
+       ARDOUR::ControllableDescriptor& descriptor() const { return *_descriptor; }
 
        std::string control_description() const { return _control_description; }
 
@@ -116,7 +116,7 @@ class MIDIControllable : public PBD::Stateful
 
        GenericMidiControlProtocol* _surface;
        PBD::Controllable* controllable;
-       PBD::ControllableDescriptor* _descriptor;
+       ARDOUR::ControllableDescriptor* _descriptor;
        std::string     _current_uri;
         MIDI::Parser&   _parser;
        bool             setting;