summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-07-11 12:52:46 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-07-11 12:52:46 -0400
commit7626cd68ac033de3ebaa0bf60ce4bdbf7da44329 (patch)
treeb3d8c3fa5d120ef7e47e85d2e59f7683400555e9 /libs/pbd
parent5d20b3e24eefc55b575d3703667d4a87e6491028 (diff)
Hide UI request mechanism from inheriting classes
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/base_ui.cc17
-rw-r--r--libs/pbd/pbd/abstract_ui.cc2
-rw-r--r--libs/pbd/pbd/base_ui.h6
3 files changed, 20 insertions, 5 deletions
diff --git a/libs/pbd/base_ui.cc b/libs/pbd/base_ui.cc
index 69b156589f..35ea6078ee 100644
--- a/libs/pbd/base_ui.cc
+++ b/libs/pbd/base_ui.cc
@@ -42,9 +42,9 @@ BaseUI::RequestType BaseUI::CallSlot = BaseUI::new_request_type();
BaseUI::RequestType BaseUI::Quit = BaseUI::new_request_type();
BaseUI::BaseUI (const string& str)
- : request_channel (true)
- , run_loop_thread (0)
+ : run_loop_thread (0)
, _name (str)
+ , request_channel (true)
{
base_ui_instance = this;
@@ -138,4 +138,15 @@ BaseUI::request_handler (Glib::IOCondition ioc)
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);
+}
diff --git a/libs/pbd/pbd/abstract_ui.cc b/libs/pbd/pbd/abstract_ui.cc
index 64fd718dbc..02b42fdead 100644
--- a/libs/pbd/pbd/abstract_ui.cc
+++ b/libs/pbd/pbd/abstract_ui.cc
@@ -349,7 +349,7 @@ AbstractUI<RequestObject>::send_request (RequestObject *req)
at the per-thread and generic request lists.
*/
- request_channel.wakeup ();
+ signal_new_request ();
}
}
diff --git a/libs/pbd/pbd/base_ui.h b/libs/pbd/pbd/base_ui.h
index 186a3c55a6..22784c9bfc 100644
--- a/libs/pbd/pbd/base_ui.h
+++ b/libs/pbd/pbd/base_ui.h
@@ -71,7 +71,6 @@ class BaseUI : public sigc::trackable, public PBD::EventLoop
void quit ();
protected:
- CrossThreadChannel request_channel;
bool _ok;
Glib::RefPtr<Glib::MainLoop> _main_loop;
@@ -96,6 +95,9 @@ class BaseUI : public sigc::trackable, public PBD::EventLoop
*/
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,
* which will be called whenever there are requests
* to be dealt with.
@@ -105,6 +107,8 @@ class BaseUI : public sigc::trackable, public PBD::EventLoop
private:
std::string _name;
BaseUI* base_ui_instance;
+
+ CrossThreadChannel request_channel;
static uint64_t rt_bit;