Ardour  9.0-pre0-582-g084a23a80d
BaseUI Class Referenceabstract

#include <base_ui.h>

Inheritance diagram for BaseUI:
[legend]

Public Member Functions

 BaseUI (const std::string &name)
 
virtual ~BaseUI ()
 
BaseUIbase_instance ()
 
Glib::RefPtr< Glib::MainLoop > main_loop () const
 
bool caller_is_self () const
 
bool ok () const
 
void run ()
 
void quit ()
 
- Public Member Functions inherited from PBD::EventLoop
 EventLoop (std::string const &)
 
virtual ~EventLoop ()
 
virtual bool call_slot (InvalidationRecord *, const std::function< void()> &)=0
 
virtual Glib::Threads::RWLock & slot_invalidation_rwlock ()=0
 
std::string event_loop_name () const
 

Static Public Member Functions

static RequestType new_request_type ()
 
static void set_thread_priority (int p)
 
- Static Public Member Functions inherited from PBD::EventLoop
static void * invalidate_request (void *data)
 
static EventLoopget_event_loop_for_thread ()
 
static void set_event_loop_for_thread (EventLoop *ui)
 
static std::vector< ThreadBufferMappingget_request_buffers_for_target_thread (const std::string &)
 
static void pre_register (const std::string &emitting_thread_name, uint32_t num_requests)
 
static void remove_request_buffer_from_map (pthread_t)
 
static InvalidationRecord__invalidator (sigc::trackable &trackable, const char *, int)
 

Static Public Attributes

static RequestType CallSlot
 
static RequestType Quit
 

Protected Member Functions

bool signal_running ()
 
virtual void thread_init ()
 
int set_thread_priority () const
 
bool request_handler (Glib::IOCondition)
 
void signal_new_request ()
 
void attach_request_source ()
 
virtual void maybe_install_precall_handler (Glib::RefPtr< Glib::MainContext >)
 
virtual void handle_ui_requests ()=0
 

Protected Attributes

bool _ok
 
Glib::RefPtr< Glib::MainLoop > _main_loop
 
Glib::RefPtr< Glib::MainContext > m_context
 
PBD::Thread_run_loop_thread
 
Glib::Threads::Mutex _run_lock
 
Glib::Threads::Cond _running
 

Private Member Functions

int setup_request_pipe ()
 
void main_thread ()
 

Private Attributes

BaseUIbase_ui_instance
 
CrossThreadChannel request_channel
 

Static Private Attributes

static uint64_t rt_bit
 
static int _thread_priority
 

Additional Inherited Members

- Public Types inherited from PBD::EventLoop
enum  RequestType { range_guarantee = ~0 }
 
- Public Attributes inherited from PBD::EventLoop
std::list< InvalidationRecord * > trash
 

Detailed Description

A BaseUI is an abstraction designed to be used with any "user interface" (not necessarily graphical) that needs to wait on events/requests and dispatch/process them as they arrive.

This implementation starts up a thread that runs a Glib main loop to wait on events/requests etc.

Definition at line 46 of file base_ui.h.

Constructor & Destructor Documentation

◆ BaseUI()

BaseUI::BaseUI ( const std::string &  name)

◆ ~BaseUI()

virtual BaseUI::~BaseUI ( )
virtual

Member Function Documentation

◆ attach_request_source()

void BaseUI::attach_request_source ( )
protected

◆ base_instance()

BaseUI* BaseUI::base_instance ( )
inline

Definition at line 52 of file base_ui.h.

◆ caller_is_self()

bool BaseUI::caller_is_self ( ) const
inline

Definition at line 55 of file base_ui.h.

◆ handle_ui_requests()

◆ main_loop()

Glib::RefPtr<Glib::MainLoop> BaseUI::main_loop ( ) const
inline

Definition at line 54 of file base_ui.h.

◆ main_thread()

void BaseUI::main_thread ( )
private

◆ maybe_install_precall_handler()

virtual void BaseUI::maybe_install_precall_handler ( Glib::RefPtr< Glib::MainContext >  )
inlineprotectedvirtual

Definition at line 107 of file base_ui.h.

◆ new_request_type()

static RequestType BaseUI::new_request_type ( )
static

◆ ok()

bool BaseUI::ok ( void  ) const
inline

Definition at line 57 of file base_ui.h.

◆ quit()

void BaseUI::quit ( )

stop the thread running the main loop (and block until it exits)

◆ request_handler()

bool BaseUI::request_handler ( Glib::IOCondition  )
protected

Called when there input ready on the request_channel

◆ run()

void BaseUI::run ( )

start up a thread to run the main loop

◆ set_thread_priority() [1/2]

int BaseUI::set_thread_priority ( ) const
protected

◆ set_thread_priority() [2/2]

static void BaseUI::set_thread_priority ( int  p)
inlinestatic

Definition at line 63 of file base_ui.h.

◆ setup_request_pipe()

int BaseUI::setup_request_pipe ( )
private

◆ signal_new_request()

void BaseUI::signal_new_request ( )
protected

◆ signal_running()

bool BaseUI::signal_running ( )
protected

◆ thread_init()

virtual void BaseUI::thread_init ( )
inlineprotectedvirtual

Member Data Documentation

◆ _main_loop

Glib::RefPtr<Glib::MainLoop> BaseUI::_main_loop
protected

Definition at line 79 of file base_ui.h.

◆ _ok

bool BaseUI::_ok
protected

Definition at line 77 of file base_ui.h.

◆ _run_lock

Glib::Threads::Mutex BaseUI::_run_lock
protected

Definition at line 82 of file base_ui.h.

◆ _run_loop_thread

PBD::Thread* BaseUI::_run_loop_thread
protected

Definition at line 81 of file base_ui.h.

◆ _running

Glib::Threads::Cond BaseUI::_running
protected

Definition at line 83 of file base_ui.h.

◆ _thread_priority

int BaseUI::_thread_priority
staticprivate

Definition at line 121 of file base_ui.h.

◆ base_ui_instance

BaseUI* BaseUI::base_ui_instance
private

Definition at line 116 of file base_ui.h.

◆ CallSlot

RequestType BaseUI::CallSlot
static

Definition at line 60 of file base_ui.h.

◆ m_context

Glib::RefPtr<Glib::MainContext> BaseUI::m_context
protected

Definition at line 80 of file base_ui.h.

◆ Quit

RequestType BaseUI::Quit
static

Definition at line 61 of file base_ui.h.

◆ request_channel

CrossThreadChannel BaseUI::request_channel
private

Definition at line 118 of file base_ui.h.

◆ rt_bit

uint64_t BaseUI::rt_bit
staticprivate

Definition at line 120 of file base_ui.h.


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