mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 09:06:33 +01:00
Hide UI request mechanism from inheriting classes
This commit is contained in:
parent
5d20b3e24e
commit
7626cd68ac
4 changed files with 21 additions and 6 deletions
|
|
@ -94,7 +94,7 @@ UI::UI (string namestr, int *argc, char ***argv)
|
||||||
|
|
||||||
/* attach our request source to the default main context */
|
/* attach our request source to the default main context */
|
||||||
|
|
||||||
request_channel.ios()->attach (MainContext::get_default());
|
attach_request_source (MainContext::get_default());
|
||||||
|
|
||||||
errors = new TextViewer (800,600);
|
errors = new TextViewer (800,600);
|
||||||
errors->text().set_editable (false);
|
errors->text().set_editable (false);
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,9 @@ BaseUI::RequestType BaseUI::CallSlot = BaseUI::new_request_type();
|
||||||
BaseUI::RequestType BaseUI::Quit = BaseUI::new_request_type();
|
BaseUI::RequestType BaseUI::Quit = BaseUI::new_request_type();
|
||||||
|
|
||||||
BaseUI::BaseUI (const string& str)
|
BaseUI::BaseUI (const string& str)
|
||||||
: request_channel (true)
|
: run_loop_thread (0)
|
||||||
, run_loop_thread (0)
|
|
||||||
, _name (str)
|
, _name (str)
|
||||||
|
, request_channel (true)
|
||||||
{
|
{
|
||||||
base_ui_instance = this;
|
base_ui_instance = this;
|
||||||
|
|
||||||
|
|
@ -138,4 +138,15 @@ BaseUI::request_handler (Glib::IOCondition ioc)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BaseUI::signal_new_request ()
|
||||||
|
{
|
||||||
|
request_channel.wakeup ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BaseUI::attach_request_source (Glib::RefPtr<Glib::MainContext> context)
|
||||||
|
{
|
||||||
|
request_channel.ios()->attach (context);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -349,7 +349,7 @@ AbstractUI<RequestObject>::send_request (RequestObject *req)
|
||||||
at the per-thread and generic request lists.
|
at the per-thread and generic request lists.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
request_channel.wakeup ();
|
signal_new_request ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,6 @@ class BaseUI : public sigc::trackable, public PBD::EventLoop
|
||||||
void quit ();
|
void quit ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CrossThreadChannel request_channel;
|
|
||||||
bool _ok;
|
bool _ok;
|
||||||
|
|
||||||
Glib::RefPtr<Glib::MainLoop> _main_loop;
|
Glib::RefPtr<Glib::MainLoop> _main_loop;
|
||||||
|
|
@ -96,6 +95,9 @@ class BaseUI : public sigc::trackable, public PBD::EventLoop
|
||||||
*/
|
*/
|
||||||
bool request_handler (Glib::IOCondition);
|
bool request_handler (Glib::IOCondition);
|
||||||
|
|
||||||
|
void signal_new_request ();
|
||||||
|
void attach_request_source (Glib::RefPtr<Glib::MainContext> context);
|
||||||
|
|
||||||
/** Derived UI objects must implement this method,
|
/** Derived UI objects must implement this method,
|
||||||
* which will be called whenever there are requests
|
* which will be called whenever there are requests
|
||||||
* to be dealt with.
|
* to be dealt with.
|
||||||
|
|
@ -105,6 +107,8 @@ class BaseUI : public sigc::trackable, public PBD::EventLoop
|
||||||
private:
|
private:
|
||||||
std::string _name;
|
std::string _name;
|
||||||
BaseUI* base_ui_instance;
|
BaseUI* base_ui_instance;
|
||||||
|
|
||||||
|
CrossThreadChannel request_channel;
|
||||||
|
|
||||||
static uint64_t rt_bit;
|
static uint64_t rt_bit;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue