Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::Butler Class Reference

#include <butler.h>

Inheritance diagram for ARDOUR::Butler:
[legend]

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 ()
 
void map_parameters ()
 
bool delegate (sigc::slot< void > const &work)
 
samplecnt_t audio_capture_buffer_size () const
 
samplecnt_t audio_playback_buffer_size () const
 
uint32_t midi_buffer_size () const
 
- Public Member Functions inherited from ARDOUR::SessionHandleRef
 SessionHandleRef (ARDOUR::Session &s)
 
virtual ~SessionHandleRef ()
 
- Public Member Functions inherited from PBD::ScopedConnectionList
 ScopedConnectionList ()
 
 ScopedConnectionList (const ScopedConnectionList &)=delete
 
ScopedConnectionListoperator= (const ScopedConnectionList &)=delete
 
virtual ~ScopedConnectionList ()
 
void add_connection (const UnscopedConnection &c)
 
void drop_connections ()
 

Public Attributes

std::atomic< int > should_do_transport_work
 

Private Member Functions

void * thread_work ()
 
void empty_pool_trash ()
 
void process_delegated_work ()
 
void config_changed (std::string)
 
bool flush_tracks_to_disk_normal (std::shared_ptr< RouteList const >, uint32_t &errors)
 
void queue_request (Request::Type r)
 

Static Private Member Functions

static void * _thread_work (void *arg)
 

Private Attributes

pthread_t thread
 
bool have_thread
 
Glib::Threads::Mutex request_lock
 
Glib::Threads::Cond paused
 
bool should_run
 
samplecnt_t _audio_capture_buffer_size
 
samplecnt_t _audio_playback_buffer_size
 
uint32_t _midi_buffer_size
 
PBD::RingBuffer< PBD::CrossThreadPool * > pool_trash
 
CrossThreadChannel _xthread
 
PBD::MPMCQueue< sigc::slot< void > > _delegated_work
 

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

◆ Butler()

ARDOUR::Butler::Butler ( Session session)

◆ ~Butler()

ARDOUR::Butler::~Butler ( )

Member Function Documentation

◆ _thread_work()

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

◆ audio_capture_buffer_size()

samplecnt_t ARDOUR::Butler::audio_capture_buffer_size ( ) const
inline

Definition at line 71 of file butler.h.

◆ audio_playback_buffer_size()

samplecnt_t ARDOUR::Butler::audio_playback_buffer_size ( ) const
inline

Definition at line 75 of file butler.h.

◆ config_changed()

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

◆ delegate()

bool ARDOUR::Butler::delegate ( sigc::slot< void > const &  work)
inline

Definition at line 66 of file butler.h.

◆ drop_references()

void ARDOUR::Butler::drop_references ( )

◆ empty_pool_trash()

void ARDOUR::Butler::empty_pool_trash ( )
private

◆ flush_tracks_to_disk_normal()

bool ARDOUR::Butler::flush_tracks_to_disk_normal ( std::shared_ptr< RouteList const >  ,
uint32_t &  errors 
)
private

◆ map_parameters()

void ARDOUR::Butler::map_parameters ( )

◆ midi_buffer_size()

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

Definition at line 79 of file butler.h.

◆ process_delegated_work()

void ARDOUR::Butler::process_delegated_work ( )
private

◆ queue_request()

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

◆ schedule_transport_work()

void ARDOUR::Butler::schedule_transport_work ( )

◆ start_thread()

int ARDOUR::Butler::start_thread ( )

◆ stop()

void ARDOUR::Butler::stop ( )

◆ summon()

void ARDOUR::Butler::summon ( )

◆ terminate_thread()

void ARDOUR::Butler::terminate_thread ( )

◆ thread_work()

void* ARDOUR::Butler::thread_work ( )
private

◆ transport_work_requested()

bool ARDOUR::Butler::transport_work_requested ( ) const

◆ wait_until_finished()

void ARDOUR::Butler::wait_until_finished ( )

Member Data Documentation

◆ _audio_capture_buffer_size

samplecnt_t ARDOUR::Butler::_audio_capture_buffer_size
private

Definition at line 113 of file butler.h.

◆ _audio_playback_buffer_size

samplecnt_t ARDOUR::Butler::_audio_playback_buffer_size
private

Definition at line 114 of file butler.h.

◆ _delegated_work

PBD::MPMCQueue<sigc::slot<void> > ARDOUR::Butler::_delegated_work
private

Definition at line 119 of file butler.h.

◆ _midi_buffer_size

uint32_t ARDOUR::Butler::_midi_buffer_size
private

Definition at line 115 of file butler.h.

◆ _xthread

CrossThreadChannel ARDOUR::Butler::_xthread
private

Definition at line 118 of file butler.h.

◆ have_thread

bool ARDOUR::Butler::have_thread
private

Definition at line 107 of file butler.h.

◆ paused

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

Definition at line 110 of file butler.h.

◆ pool_trash

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

Definition at line 117 of file butler.h.

◆ request_lock

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

Definition at line 109 of file butler.h.

◆ should_do_transport_work

std::atomic<int> ARDOUR::Butler::should_do_transport_work
mutable

Definition at line 84 of file butler.h.

◆ should_run

bool ARDOUR::Butler::should_run
private

Definition at line 111 of file butler.h.

◆ thread

pthread_t ARDOUR::Butler::thread
private

Definition at line 106 of file butler.h.


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