Ardour
9.0-pre0-582-g084a23a80d
|
#include <base_ui.h>
Public Member Functions | |
BaseUI (const std::string &name) | |
virtual | ~BaseUI () |
BaseUI * | base_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 EventLoop * | get_event_loop_for_thread () |
static void | set_event_loop_for_thread (EventLoop *ui) |
static std::vector< ThreadBufferMapping > | get_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 | |
BaseUI * | base_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 |
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 | ) |
|
virtual |
|
protected |
|
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< WiimoteControlUIRequest >, AbstractUI< BaseUI::BaseRequestObject >, AbstractUI< US2400ControlUIRequest >, AbstractUI< Maschine2Request >, AbstractUI< OSCUIRequest >, AbstractUI< CC121Request >, AbstractUI< TestUIRequest >, AbstractUI< MidiSurfaceRequest >, AbstractUI< UIRequest >, AbstractUI< GenericMIDIRequest >, AbstractUI< MackieControlUIRequest >, AbstractUI< LaunchControlRequest >, AbstractUI< ContourDesignControlUIRequest >, AbstractUI< ArdourWebsocketsUIRequest >, AbstractUI< FaderPort8Request >, and AbstractUI< MidiUIRequest >.
|
inline |
|
private |
|
inlineprotectedvirtual |
|
static |
void BaseUI::quit | ( | ) |
stop the thread running the main loop (and block until it exits)
|
protected |
Called when there input ready on the request_channel
void BaseUI::run | ( | ) |
start up a thread to run the main loop
|
protected |
|
inlinestatic |
|
private |
|
protected |
|
protected |
|
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 WiimoteControlProtocol, ArdourSurface::ArdourWebsockets, ArdourSurface::US2400Protocol, ArdourSurface::OSC, ArdourSurface::Maschine2, ArdourSurface::NS_MCU::MackieControlProtocol, ArdourSurface::LaunchControlXL, GenericMidiControlProtocol, ArdourSurface::FP8::FaderPort8, ArdourSurface::ContourDesignControlProtocol, ArdourSurface::CC121, MIDISurface, and ARDOUR::MidiControlUI.
|
protected |
|
static |
|
protected |
|
static |
|
private |