Add a test for the constrained cubic interpolation of Evoral::Curve
[ardour.git] / libs / ardour / analyser.cc
index 9309b4d03b1d5b6ca63687d1503157f06b4dd279..bf98ecc20ab406a30c5e675c0c9ecb6337914202 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2008 Paul Davis 
+    Copyright (C) 2008 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
 
 #include "ardour/analyser.h"
 #include "ardour/audiofilesource.h"
+#include "ardour/session_event.h"
 #include "ardour/transient_detector.h"
 
-#include "pbd/pthread_utils.h"
-#include "pbd/convert.h"
-
 using namespace std;
-using namespace sigc;
 using namespace ARDOUR;
 using namespace PBD;
 
 Analyser* Analyser::the_analyser = 0;
-Glib::StaticMutex Analyser::analysis_queue_lock = GLIBMM_STATIC_MUTEX_INIT;
-Glib::Cond* Analyser::SourcesToAnalyse = 0;
+Glib::Threads::Mutex Analyser::analysis_queue_lock;
+Glib::Threads::Cond  Analyser::SourcesToAnalyse;
 list<boost::weak_ptr<Source> > Analyser::analysis_queue;
 
 Analyser::Analyser ()
 {
-       
+
 }
 
 Analyser::~Analyser ()
@@ -52,8 +49,7 @@ analyser_work ()
 void
 Analyser::init ()
 {
-       SourcesToAnalyse = new Glib::Cond();
-       Glib::Thread::create (sigc::ptr_fun (analyser_work), false);
+       Glib::Threads::Thread::create (sigc::ptr_fun (analyser_work));
 }
 
 void
@@ -67,22 +63,22 @@ Analyser::queue_source_for_analysis (boost::shared_ptr<Source> src, bool force)
                return;
        }
 
-       Glib::Mutex::Lock lm (analysis_queue_lock);
+       Glib::Threads::Mutex::Lock lm (analysis_queue_lock);
        analysis_queue.push_back (boost::weak_ptr<Source>(src));
-       SourcesToAnalyse->broadcast ();
+       SourcesToAnalyse.broadcast ();
 }
 
 void
 Analyser::work ()
 {
-       PBD::notify_gui_about_thread_creation (pthread_self(), string ("analyser-") + to_string (pthread_self(), std::dec));
+       SessionEvent::create_per_thread_pool ("Analyser", 64);
 
        while (true) {
                analysis_queue_lock.lock ();
 
          wait:
                if (analysis_queue.empty()) {
-                       SourcesToAnalyse->wait (analysis_queue_lock);
+                       SourcesToAnalyse.wait (analysis_queue_lock);
                }
 
                if (analysis_queue.empty()) {