major rationalization of use of search paths. ardour now has just 4 functions used...
[ardour.git] / libs / surfaces / mackie / device_info.cc
index 12a6f90e5e296dafd7e3d94f97e521ab2f4c5acb..8d2186cf0c5bfad72d2d3a70610f31000587407d 100644 (file)
@@ -50,6 +50,7 @@ DeviceInfo::DeviceInfo()
        , _has_touch_sense_faders (true)
        , _uses_logic_control_buttons (false)
        , _uses_ipmidi (false)
+       , _no_handshake (false)
        , _name (X_("Mackie Control Universal Pro"))
 {
        mackie_control_buttons ();
@@ -281,6 +282,14 @@ DeviceInfo::set_state (const XMLNode& node, int /* version */)
                _uses_ipmidi = false;
        }
 
+       if ((child = node.child ("NoHandShake")) != 0) {
+               if ((prop = child->property ("value")) != 0) {
+                       _no_handshake = string_is_affirmative (prop->value());
+               }
+       } else {
+               _no_handshake = false;
+       }
+
        if ((child = node.child ("LogicControlButtons")) != 0) {
                if ((prop = child->property ("value")) != 0) {
                        _uses_logic_control_buttons = string_is_affirmative (prop->value());
@@ -395,6 +404,12 @@ DeviceInfo::has_jog_wheel () const
        return _has_jog_wheel;
 }
 
+bool
+DeviceInfo::no_handshake () const
+{
+       return _no_handshake;
+}
+
 bool
 DeviceInfo::has_touch_sense_faders () const
 {
@@ -406,7 +421,7 @@ static const char* const devinfo_dir_name = "mcp";
 static const char* const devinfo_suffix = ".device";
 
 static SearchPath
-system_devinfo_search_path ()
+devinfo_search_path ()
 {
        bool devinfo_path_defined = false;
         sys::path spath_env (Glib::getenv (devinfo_env_variable_name, devinfo_path_defined));
@@ -415,21 +430,12 @@ system_devinfo_search_path ()
                return spath_env;
        }
 
-       SearchPath spath (system_data_search_path());
+       SearchPath spath (ardour_data_search_path());
        spath.add_subdirectory_to_paths(devinfo_dir_name);
 
        return spath;
 }
 
-static sys::path
-user_devinfo_directory ()
-{
-       sys::path p(user_config_directory());
-       p /= devinfo_dir_name;
-
-       return p;
-}
-
 static bool
 devinfo_filter (const string &str, void */*arg*/)
 {
@@ -444,8 +450,7 @@ DeviceInfo::reload_device_info ()
        vector<string> s;
        vector<string *> *devinfos;
        PathScanner scanner;
-       SearchPath spath (system_devinfo_search_path());
-       spath += user_devinfo_directory ();
+       SearchPath spath (devinfo_search_path());
 
        devinfos = scanner (spath.to_string(), devinfo_filter, 0, false, true);
        device_info.clear ();