ardour
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
ARDOUR::Butler Class Reference

#include <butler.h>

Inheritance diagram for ARDOUR::Butler:
ARDOUR::SessionHandleRef PBD::ScopedConnectionList

Classes

struct  Request
 

Public Member Functions

 Butler (Session &session)
 
 ~Butler ()
 
int start_thread ()
 
void terminate_thread ()
 
void schedule_transport_work ()
 
void summon ()
 
void stop ()
 
void wait_until_finished ()
 
bool transport_work_requested () const
 
void drop_references ()
 
framecnt_t audio_diskstream_capture_buffer_size () const
 
framecnt_t audio_diskstream_playback_buffer_size () const
 
uint32_t midi_diskstream_buffer_size () const
 
void * thread_work ()
 
- Public Member Functions inherited from ARDOUR::SessionHandleRef
 SessionHandleRef (ARDOUR::Session &s)
 
virtual ~SessionHandleRef ()
 
- Public Member Functions inherited from PBD::ScopedConnectionList
 ScopedConnectionList ()
 
virtual ~ScopedConnectionList ()
 
void add_connection (const UnscopedConnection &c)
 
void drop_connections ()
 

Static Public Member Functions

static void * _thread_work (void *arg)
 

Public Attributes

pthread_t thread
 
bool have_thread
 
Glib::Threads::Mutex request_lock
 
Glib::Threads::Cond paused
 
bool should_run
 
gint should_do_transport_work
 
framecnt_t audio_dstream_capture_buffer_size
 
framecnt_t audio_dstream_playback_buffer_size
 
uint32_t midi_dstream_buffer_size
 
RingBuffer< CrossThreadPool * > pool_trash
 

Private Member Functions

void empty_pool_trash ()
 
void config_changed (std::string)
 
void queue_request (Request::Type r)
 

Private Attributes

CrossThreadChannel _xthread
 

Additional Inherited Members

- Protected Member Functions inherited from ARDOUR::SessionHandleRef
virtual void session_going_away ()
 
virtual void insanity_check ()
 
- Protected Attributes inherited from ARDOUR::SessionHandleRef
ARDOUR::Session_session
 

Detailed Description

One of the Butler's functions is to clean up (ie delete) unused CrossThreadPools. When a thread with a CrossThreadPool terminates, its CTP is added to pool_trash. When the Butler thread wakes up, we check this trash buffer for CTPs, and if they are empty they are deleted.

Definition at line 49 of file butler.h.

Constructor & Destructor Documentation

ARDOUR::Butler::Butler ( Session session)

Definition at line 44 of file butler.cc.

ARDOUR::Butler::~Butler ( )

Definition at line 60 of file butler.cc.

Member Function Documentation

void * ARDOUR::Butler::_thread_work ( void *  arg)
static

Definition at line 121 of file butler.cc.

framecnt_t ARDOUR::Butler::audio_diskstream_capture_buffer_size ( ) const
inline

Definition at line 64 of file butler.h.

framecnt_t ARDOUR::Butler::audio_diskstream_playback_buffer_size ( ) const
inline

Definition at line 65 of file butler.h.

void ARDOUR::Butler::config_changed ( std::string  p)
private

Definition at line 66 of file butler.cc.

void ARDOUR::Butler::drop_references ( )

Definition at line 410 of file butler.cc.

void ARDOUR::Butler::empty_pool_trash ( )
private

Definition at line 380 of file butler.cc.

uint32_t ARDOUR::Butler::midi_diskstream_buffer_size ( ) const
inline

Definition at line 66 of file butler.h.

void ARDOUR::Butler::queue_request ( Request::Type  r)
private

Add request to butler thread request queue

Definition at line 330 of file butler.cc.

void ARDOUR::Butler::schedule_transport_work ( )

Definition at line 323 of file butler.cc.

int ARDOUR::Butler::start_thread ( )

Definition at line 81 of file butler.cc.

void ARDOUR::Butler::stop ( )

Definition at line 356 of file butler.cc.

void ARDOUR::Butler::summon ( )

Definition at line 349 of file butler.cc.

void ARDOUR::Butler::terminate_thread ( )

Definition at line 110 of file butler.cc.

void * ARDOUR::Butler::thread_work ( )

Definition at line 129 of file butler.cc.

bool ARDOUR::Butler::transport_work_requested ( ) const

Definition at line 374 of file butler.cc.

void ARDOUR::Butler::wait_until_finished ( )

Definition at line 365 of file butler.cc.

Member Data Documentation

CrossThreadChannel ARDOUR::Butler::_xthread
private

Definition at line 99 of file butler.h.

framecnt_t ARDOUR::Butler::audio_dstream_capture_buffer_size

Definition at line 85 of file butler.h.

framecnt_t ARDOUR::Butler::audio_dstream_playback_buffer_size

Definition at line 86 of file butler.h.

bool ARDOUR::Butler::have_thread

Definition at line 80 of file butler.h.

uint32_t ARDOUR::Butler::midi_dstream_buffer_size

Definition at line 87 of file butler.h.

Glib::Threads::Cond ARDOUR::Butler::paused

Definition at line 82 of file butler.h.

RingBuffer<CrossThreadPool*> ARDOUR::Butler::pool_trash

Definition at line 88 of file butler.h.

Glib::Threads::Mutex ARDOUR::Butler::request_lock

Definition at line 81 of file butler.h.

gint ARDOUR::Butler::should_do_transport_work
mutable

Definition at line 84 of file butler.h.

bool ARDOUR::Butler::should_run

Definition at line 83 of file butler.h.

pthread_t ARDOUR::Butler::thread

Definition at line 79 of file butler.h.


The documentation for this class was generated from the following files: