summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2013-10-02 19:40:48 +1000
committerTim Mayberry <mojofunk@gmail.com>2013-10-04 18:53:37 +1000
commit53ad2d187ffb31edcb90f7db5799886ee1806586 (patch)
tree8974083bf0b95e5d4dfff9fe5e53d09641d685a3 /libs/ardour/ardour
parentdf363a4fb3057253c1530941176cac49a7ffd409 (diff)
Move processing thread list from ARDOUR::Graph into AudioBackend implementation
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/audio_backend.h14
-rw-r--r--libs/ardour/ardour/audio_backend_thread.h32
-rw-r--r--libs/ardour/ardour/audioengine.h7
-rw-r--r--libs/ardour/ardour/graph.h5
4 files changed, 14 insertions, 44 deletions
diff --git a/libs/ardour/ardour/audio_backend.h b/libs/ardour/ardour/audio_backend.h
index 3d65af481d..0e39625e8c 100644
--- a/libs/ardour/ardour/audio_backend.h
+++ b/libs/ardour/ardour/audio_backend.h
@@ -399,18 +399,26 @@ class AudioBackend : public PortEngine {
* stacksize. The thread will begin executing @param func, and will exit
* when that function returns.
*/
- virtual int create_process_thread (boost::function<void()> func, AudioBackendThread*, size_t stacksize) = 0;
+ virtual int create_process_thread (boost::function<void()> func) = 0;
- /** Wait for the thread specified by @param thread to exit.
+ /** Wait for all processing threads to exit.
*
* Return zero on success, non-zero on failure.
*/
- virtual int join_process_thread (AudioBackendThread* thread) = 0;
+ virtual int join_process_threads () = 0;
/** Return true if execution context is in a backend thread
*/
virtual bool in_process_thread () = 0;
+ /** Return the minimum stack size of audio threads in bytes
+ */
+ static size_t thread_stack_size () { return 100000; }
+
+ /** Return number of processing threads
+ */
+ virtual uint32_t process_thread_count () = 0;
+
virtual void update_latencies () = 0;
protected:
diff --git a/libs/ardour/ardour/audio_backend_thread.h b/libs/ardour/ardour/audio_backend_thread.h
deleted file mode 100644
index 90efecbc94..0000000000
--- a/libs/ardour/ardour/audio_backend_thread.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- Copyright (C) 2013 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.
-
-*/
-
-namespace ARDOUR {
-
-class AudioBackendThread
-{
-public:
-
- AudioBackendThread () { }
-
- virtual ~AudioBackendThread () { }
-
-};
-
-} // namespace ARDOUR
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h
index 82364ca191..1bf4be3243 100644
--- a/libs/ardour/ardour/audioengine.h
+++ b/libs/ardour/ardour/audioengine.h
@@ -58,7 +58,6 @@ class Session;
class ProcessThread;
class AudioBackend;
class AudioBackendInfo;
-class AudioBackendThread;
class AudioEngine : public SessionHandlePtr, public PortManager
{
@@ -102,10 +101,10 @@ public:
pframes_t samples_since_cycle_start ();
bool get_sync_offset (pframes_t& offset) const;
- int create_process_thread (boost::function<void()> func, AudioBackendThread*, size_t stacksize);
- int join_process_thread (AudioBackendThread*);
-
+ int create_process_thread (boost::function<void()> func);
+ int join_process_threads ();
bool in_process_thread ();
+ uint32_t process_thread_count ();
bool is_realtime() const;
bool connected() const;
diff --git a/libs/ardour/ardour/graph.h b/libs/ardour/ardour/graph.h
index ed9e22de31..763723c792 100644
--- a/libs/ardour/ardour/graph.h
+++ b/libs/ardour/ardour/graph.h
@@ -47,8 +47,6 @@ class Route;
class Session;
class GraphEdges;
-class AudioBackendThread;
-
typedef boost::shared_ptr<GraphNode> node_ptr_t;
typedef std::list< node_ptr_t > node_list_t;
@@ -59,8 +57,6 @@ class Graph : public SessionHandleRef
public:
Graph (Session & session);
- uint32_t threads_in_use () const { return _thread_list.size(); }
-
void prep();
void trigger (GraphNode * n);
void rechain (boost::shared_ptr<RouteList>, GraphEdges const &);
@@ -93,7 +89,6 @@ protected:
virtual void session_going_away ();
private:
- std::list<AudioBackendThread*> _thread_list;
volatile bool _quit_threads;
void reset_thread_list ();