Splice mode: exclude newly-added regions from being shuffled
[ardour.git] / libs / ardour / audioengine.cc
index cb167c959579dfddc96348fca598fae5e3b6b707..8d4b17ebd4c607f27065bd79d66b703e4518b46a 100644 (file)
@@ -41,7 +41,7 @@
 #include "ardour/audio_port.h"
 #include "ardour/audio_backend.h"
 #include "ardour/audioengine.h"
-#include "ardour/backend_search_path.h"
+#include "ardour/search_paths.h"
 #include "ardour/buffer.h"
 #include "ardour/cycle_timer.h"
 #include "ardour/internal_send.h"
@@ -492,17 +492,21 @@ AudioEngine::discover_backends ()
        find_matching_files_in_search_path (backend_search_path (),
                                            dll_extension_pattern, backend_modules);
 
-       DEBUG_TRACE (DEBUG::Panning, string_compose (_("looking for backends in %1\n"), backend_search_path().to_string()));
+       DEBUG_TRACE (DEBUG::AudioEngine, string_compose ("looking for backends in %1\n", backend_search_path().to_string()));
 
        for (vector<std::string>::iterator i = backend_modules.begin(); i != backend_modules.end(); ++i) {
 
                AudioBackendInfo* info;
 
+               DEBUG_TRACE (DEBUG::AudioEngine, string_compose ("Checking possible backend in %1\n", *i));
+
                if ((info = backend_discover (*i)) != 0) {
                        _backends.insert (make_pair (info->name, info));
                }
        }
 
+       DEBUG_TRACE (DEBUG::AudioEngine, string_compose ("Found %1 backends\n", _backends.size()));
+
        return _backends.size();
 }
 
@@ -560,6 +564,7 @@ AudioEngine::drop_backend ()
 {
        if (_backend) {
                _backend->stop ();
+        _backend->drop_device();
                _backend.reset ();
        }
 }
@@ -589,7 +594,7 @@ AudioEngine::set_backend (const std::string& name, const std::string& arg1, cons
                if (b->second->instantiate (arg1, arg2)) {
                        throw failed_constructor ();
                }
-
+               
                _backend = b->second->factory (*this);
 
        } catch (exception& e) {
@@ -890,15 +895,6 @@ AudioEngine::set_buffer_size (uint32_t bufsiz)
        return _backend->set_buffer_size  (bufsiz);
 }
 
-int
-AudioEngine::set_sample_format (SampleFormat sf)
-{
-       if (!_backend) {
-               return -1;
-       }
-       return _backend->set_sample_format  (sf);
-}
-
 int
 AudioEngine::set_interleaved (bool yn)
 {
@@ -1020,17 +1016,15 @@ AudioEngine::halted_callback (const char* why)
 bool
 AudioEngine::setup_required () const
 {
-       /* If there is only a single backend and it claims to be configured
-        * already there is no setup to be done.
-        *
-        * Primarily for a case where there is only a JACK backend and
-        * JACK is already running.
-        */
-        
-       if (_backends.size() == 1 && _backends.begin()->second->already_configured()) {
-               return false;
+       if (_backend) {
+               if (_backend->info().already_configured())
+                       return false;
+       } else {
+               if (_backends.size() == 1 && _backends.begin()->second->already_configured()) {
+                       return false;
+               }
        }
-
+       
        return true;
 }