diff options
author | John Emmas <johne53@tiscali.co.uk> | 2017-08-26 13:07:45 +0100 |
---|---|---|
committer | John Emmas <johne53@tiscali.co.uk> | 2017-08-26 13:07:45 +0100 |
commit | b25b99216c2c3a2e955ef9c2bb7c2d9ffa31228e (patch) | |
tree | 8cc41b8697b12ef888cd6044b3cfd1600845ecf5 /gtk2_ardour/template_dialog.cc | |
parent | 5aeb5f0c7d06036f05ca35081cfd9545c40fcf1b (diff) |
Fix a compiler problem when building 'gtk2_ardour/template_dialog.cc' with MSVC
When setting up the 'TemplatesImported' signal, these 2 calls appear in the c'tor for class TemplateDialog:-
boost::bind (&RouteTemplateManager::init, route_tm)
boost::bind (&SessionTemplateManager::init, session_tm)
However - '&RouteTemplateManager::init' and '&SessionTemplateManager::init' are in fact the address of the same function. This seems to be causing a problem, either for boost::bind, or MSVC (or both).
In earlier builds they were 2 separate functions. So let's put them back that way (since the current code actually crashes the compiler!!)
Diffstat (limited to 'gtk2_ardour/template_dialog.cc')
-rw-r--r-- | gtk2_ardour/template_dialog.cc | 57 |
1 files changed, 38 insertions, 19 deletions
diff --git a/gtk2_ardour/template_dialog.cc b/gtk2_ardour/template_dialog.cc index 1703b0907f..6125c9330f 100644 --- a/gtk2_ardour/template_dialog.cc +++ b/gtk2_ardour/template_dialog.cc @@ -63,7 +63,7 @@ class TemplateManager : public Gtk::HBox, public: virtual ~TemplateManager () {} - void init (); + virtual void init () = 0; void handle_dirty_description (); PBD::Signal0<void> TemplatesImported; @@ -71,6 +71,9 @@ public: protected: TemplateManager (); + Gtk::TextView _description_editor; + Gtk::Button _save_desc; + void setup_model (const std::vector<ARDOUR::TemplateInfo>& templates); void row_selection_changed (); @@ -125,8 +128,6 @@ private: Gtk::CellRendererText _validating_cellrenderer; Gtk::TreeView::Column _validated_column; - Gtk::TextView _description_editor; - Gtk::Button _save_desc; bool _desc_dirty; Gtk::Button _remove_button; @@ -146,6 +147,8 @@ public: SessionTemplateManager () : TemplateManager () {} ~SessionTemplateManager () {} + void init (); + void get_templates (vector<TemplateInfo>& templates) const; private: @@ -165,6 +168,8 @@ public: RouteTemplateManager () : TemplateManager () {} ~RouteTemplateManager () {} + void init (); + void get_templates (vector<TemplateInfo>& templates) const; private: @@ -285,18 +290,6 @@ TemplateManager::TemplateManager () } void -TemplateManager::init () -{ - vector<TemplateInfo> templates; - get_templates (templates); - setup_model (templates); - - _progress_bar.hide (); - _description_editor.set_sensitive (false); - _save_desc.set_sensitive (false); -} - -void TemplateManager::setup_model (const vector<TemplateInfo>& templates) { _template_model->clear (); @@ -467,13 +460,14 @@ TemplateManager::key_event (GdkEventKey* ev) return false; } -static -bool accept_all_files (string const &, void *) +static bool +accept_all_files (string const &, void *) { return true; } -static void _set_progress (Progress* p, size_t n, size_t t) +static void +_set_progress (Progress* p, size_t n, size_t t) { p->set_progress (float (n) / float(t)); } @@ -669,12 +663,37 @@ TemplateManager::update_progress_gui (float p) } void +SessionTemplateManager::init () +{ + vector<TemplateInfo> templates; + get_templates (templates); + setup_model (templates); + + _progress_bar.hide (); + _description_editor.set_sensitive (false); + _save_desc.set_sensitive (false); +} + +void +RouteTemplateManager::init () +{ + vector<TemplateInfo> templates; + get_templates (templates); + setup_model (templates); + + _progress_bar.hide (); + _description_editor.set_sensitive (false); + _save_desc.set_sensitive (false); +} + +void SessionTemplateManager::get_templates (vector<TemplateInfo>& templates) const { find_session_templates (templates, /* read_xml = */ true); } -void RouteTemplateManager::get_templates (vector<TemplateInfo>& templates) const +void +RouteTemplateManager::get_templates (vector<TemplateInfo>& templates) const { find_route_templates (templates); } |