ardour
|
#include <base_ui.h>
Public Member Functions | |
BaseUI (const std::string &name) | |
virtual | ~BaseUI () |
BaseUI * | base_instance () |
Glib::RefPtr< Glib::MainLoop > | main_loop () const |
Glib::Threads::Thread * | event_loop_thread () const |
bool | caller_is_self () const |
std::string | name () const |
bool | ok () const |
void | run () |
void | quit () |
Public Member Functions inherited from PBD::EventLoop | |
EventLoop () | |
virtual | ~EventLoop () |
virtual void | call_slot (InvalidationRecord *, const boost::function< void()> &)=0 |
virtual Glib::Threads::Mutex & | slot_invalidation_mutex ()=0 |
Static Public Member Functions | |
static RequestType | new_request_type () |
Static Public Member Functions inherited from PBD::EventLoop | |
static void * | invalidate_request (void *data) |
static EventLoop * | get_event_loop_for_thread () |
static void | set_event_loop_for_thread (EventLoop *ui) |
Static Public Attributes | |
static RequestType | CallSlot = BaseUI::new_request_type() |
static RequestType | Quit = BaseUI::new_request_type() |
Protected Member Functions | |
bool | signal_running () |
virtual void | thread_init () |
bool | request_handler (Glib::IOCondition) |
void | signal_new_request () |
void | attach_request_source () |
virtual void | handle_ui_requests ()=0 |
Protected Attributes | |
bool | _ok |
Glib::RefPtr< Glib::MainLoop > | _main_loop |
Glib::RefPtr< Glib::MainContext > | m_context |
Glib::Threads::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 | |
std::string | _name |
BaseUI * | base_ui_instance |
CrossThreadChannel | request_channel |
Static Private Attributes | |
static uint64_t | rt_bit = 1 |
Additional Inherited Members | |
Public Types inherited from PBD::EventLoop | |
enum | RequestType { range_guarantee = ~0 } |
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.
BaseUI::BaseUI | ( | const std::string & | name | ) |
Definition at line 50 of file base_ui.cc.
|
virtual |
Definition at line 62 of file base_ui.cc.
|
protected |
This method relies on the caller having already set m_context
Definition at line 158 of file base_ui.cc.
|
inline |
|
protectedpure virtual |
Derived UI objects must implement this method, which will be called whenever there are requests to be dealt with.
Implemented in AbstractUI< RequestObject >, AbstractUI< TestUIRequest >, AbstractUI< UIRequest >, and AbstractUI< MidiUIRequest >.
|
inline |
|
private |
Definition at line 80 of file base_ui.cc.
|
static |
Definition at line 67 of file base_ui.cc.
void BaseUI::quit | ( | ) |
stop the thread running the main loop (and block until it exits)
Definition at line 114 of file base_ui.cc.
|
protected |
Called when there input ready on the request_channel
Definition at line 123 of file base_ui.cc.
void BaseUI::run | ( | ) |
start up a thread to run the main loop
Definition at line 99 of file base_ui.cc.
|
private |
|
protected |
Definition at line 148 of file base_ui.cc.
|
protected |
Definition at line 90 of file base_ui.cc.
|
inlineprotectedvirtual |
Derived UI objects can implement thread_init() which will be called by the event loop thread immediately before it enters the event loop.
Reimplemented in ARDOUR::MidiControlUI.
|
static |
|
protected |
|
static |
|
private |