fully implement and deploy explicit x-thread signal connection syntax (testing comes next)

git-svn-id: svn://localhost/ardour2/branches/3.0@6379 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-12-21 18:23:07 +00:00
parent 738387f9a4
commit f450df300c
153 changed files with 775 additions and 790 deletions

View file

@ -234,20 +234,20 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
last_shuttle_request = last_peak_grab = 0; // get_microseconds(); last_shuttle_request = last_peak_grab = 0; // get_microseconds();
ARDOUR::Diskstream::DiskOverrun.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::disk_overrun_handler)); ARDOUR::Diskstream::DiskOverrun.connect (forever_connections, boost::bind (&ARDOUR_UI::disk_overrun_handler, this), gui_context());
ARDOUR::Diskstream::DiskUnderrun.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::disk_underrun_handler)); ARDOUR::Diskstream::DiskUnderrun.connect (forever_connections, boost::bind (&ARDOUR_UI::disk_underrun_handler, this), gui_context());
/* handle dialog requests */ /* handle dialog requests */
ARDOUR::Session::Dialog.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::session_dialog)); ARDOUR::Session::Dialog.connect (forever_connections, ui_bind (&ARDOUR_UI::session_dialog, this, _1), gui_context());
/* handle pending state with a dialog */ /* handle pending state with a dialog (PROBLEM: needs to return a value and thus cannot be x-thread) */
ARDOUR::Session::AskAboutPendingState.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::pending_state_dialog)); ARDOUR::Session::AskAboutPendingState.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::pending_state_dialog, this));
/* handle sr mismatch with a dialog */ /* handle sr mismatch with a dialog (PROBLEM: needs to return a value and thus cannot be x-thread) */
ARDOUR::Session::AskAboutSampleRateMismatch.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::sr_mismatch_dialog)); ARDOUR::Session::AskAboutSampleRateMismatch.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::sr_mismatch_dialog, this, _1, _2));
/* lets get this party started */ /* lets get this party started */
@ -329,10 +329,10 @@ ARDOUR_UI::create_engine ()
return -1; return -1;
} }
engine->Stopped.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::engine_stopped)); engine->Stopped.connect (forever_connections, boost::bind (&ARDOUR_UI::engine_stopped, this), gui_context());
engine->Running.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::engine_running)); engine->Running.connect (forever_connections, boost::bind (&ARDOUR_UI::engine_running, this), gui_context());
engine->Halted.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::engine_halted)); engine->Halted.connect (forever_connections, boost::bind (&ARDOUR_UI::engine_halted, this), gui_context());
engine->SampleRateChanged.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::update_sample_rate)); engine->SampleRateChanged.connect (forever_connections, ui_bind (&ARDOUR_UI::update_sample_rate, this, _1), gui_context());
post_engine (); post_engine ();
@ -407,7 +407,7 @@ ARDOUR_UI::post_engine ()
update_cpu_load (); update_cpu_load ();
update_sample_rate (engine->frame_rate()); update_sample_rate (engine->frame_rate());
Config->ParameterChanged.connect (forever_connections, sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed)); Config->ParameterChanged.connect (forever_connections, ui_bind (&ARDOUR_UI::parameter_changed, this, _1), gui_context());
boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1)); boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
Config->map_parameters (pc); Config->map_parameters (pc);

View file

@ -37,6 +37,7 @@
#include "theme_manager.h" #include "theme_manager.h"
#include "bundle_manager.h" #include "bundle_manager.h"
#include "keyeditor.h" #include "keyeditor.h"
#include "gui_thread.h"
#include "i18n.h" #include "i18n.h"
@ -113,14 +114,15 @@ ARDOUR_UI::set_session (Session *s)
Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::sync_blink)); Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::sync_blink));
Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::audition_blink)); Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::audition_blink));
_session->Xrun.connect (_session_connections, sigc::mem_fun(*this, &ARDOUR_UI::xrun_handler)); _session->RecordStateChanged.connect (_session_connections, boost::bind (&ARDOUR_UI::record_state_changed, this), gui_context());
_session->RecordStateChanged.connect (_session_connections, sigc::mem_fun (*this, &ARDOUR_UI::record_state_changed)); _session->TransportStateChange.connect (_session_connections, boost::bind (&ARDOUR_UI::map_transport_state, this), gui_context());
_session->locations()->added.connect (_session_connections, sigc::mem_fun (*this, &ARDOUR_UI::handle_locations_change)); _session->DirtyChanged.connect (_session_connections, boost::bind (&ARDOUR_UI::update_autosave, this), gui_context());
_session->locations()->removed.connect (_session_connections, sigc::mem_fun (*this, &ARDOUR_UI::handle_locations_change));
_session->TransportStateChange.connect (_session_connections, sigc::mem_fun(*this, &ARDOUR_UI::map_transport_state)); _session->Xrun.connect (_session_connections, ui_bind (&ARDOUR_UI::xrun_handler, this, _1), gui_context());
_session->AuditionActive.connect (_session_connections, sigc::mem_fun(*this, &ARDOUR_UI::auditioning_changed)); _session->SoloActive.connect (_session_connections, ui_bind (&ARDOUR_UI::soloing_changed, this, _1), gui_context());
_session->SoloActive.connect (_session_connections, sigc::mem_fun(*this, &ARDOUR_UI::soloing_changed)); _session->AuditionActive.connect (_session_connections, ui_bind (&ARDOUR_UI::auditioning_changed, this, _1), gui_context());
_session->DirtyChanged.connect (_session_connections, sigc::mem_fun(*this, &ARDOUR_UI::update_autosave)); _session->locations()->added.connect (_session_connections, ui_bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
_session->locations()->removed.connect (_session_connections, ui_bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
/* Clocks are on by default after we are connected to a session, so show that here. /* Clocks are on by default after we are connected to a session, so show that here.
*/ */

View file

@ -270,7 +270,7 @@ ARDOUR_UI::toggle_editing_space()
void void
ARDOUR_UI::setup_session_options () ARDOUR_UI::setup_session_options ()
{ {
_session->config.ParameterChanged.connect (_session_connections, sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed)); _session->config.ParameterChanged.connect (_session_connections, ui_bind (&ARDOUR_UI::parameter_changed, this, _1), gui_context());
boost::function<void (std::string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1)); boost::function<void (std::string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
_session->config.map_parameters (pc); _session->config.map_parameters (pc);
} }

View file

@ -35,6 +35,7 @@
#include "audio_clock.h" #include "audio_clock.h"
#include "utils.h" #include "utils.h"
#include "keyboard.h" #include "keyboard.h"
#include "gui_thread.h"
#include "i18n.h" #include "i18n.h"
using namespace ARDOUR; using namespace ARDOUR;
@ -214,7 +215,7 @@ AudioClock::AudioClock (std::string clock_name, bool transient, std::string widg
clock_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK); clock_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::SCROLL_MASK);
clock_base.signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &AudioClock::field_button_release_event), Timecode_Hours)); clock_base.signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &AudioClock::field_button_release_event), Timecode_Hours));
Session::TimecodeOffsetChanged.connect (_session_connections, sigc::mem_fun (*this, &AudioClock::timecode_offset_changed)); Session::TimecodeOffsetChanged.connect (_session_connections, boost::bind (&AudioClock::timecode_offset_changed, this), gui_context());
if (editable) { if (editable) {
setup_events (); setup_events ();

View file

@ -155,7 +155,7 @@ AudioRegionEditor::AudioRegionEditor (Session* s, boost::shared_ptr<AudioRegion>
bounds_changed (Change (StartChanged|LengthChanged|PositionChanged|Region::SyncOffsetChanged)); bounds_changed (Change (StartChanged|LengthChanged|PositionChanged|Region::SyncOffsetChanged));
gain_changed (); gain_changed ();
_region->StateChanged.connect (state_connection, sigc::mem_fun(*this, &AudioRegionEditor::region_changed)); _region->StateChanged.connect (state_connection, ui_bind (&AudioRegionEditor::region_changed, this, _1), gui_context());
spin_arrow_grab = false; spin_arrow_grab = false;
@ -228,7 +228,8 @@ AudioRegionEditor::connect_editor_events ()
gain_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &AudioRegionEditor::gain_adjustment_changed)); gain_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &AudioRegionEditor::gain_adjustment_changed));
audition_button.signal_toggled().connect (sigc::mem_fun(*this, &AudioRegionEditor::audition_button_toggled)); audition_button.signal_toggled().connect (sigc::mem_fun(*this, &AudioRegionEditor::audition_button_toggled));
_session->AuditionActive.connect (audition_connection, sigc::mem_fun(*this, &AudioRegionEditor::audition_state_changed));
_session->AuditionActive.connect (audition_connection, ui_bind (&AudioRegionEditor::audition_state_changed, this, _1), gui_context());
} }
void void

View file

@ -868,7 +868,7 @@ AudioRegionView::create_waves ()
// cerr << "\tchannel " << n << endl; // cerr << "\tchannel " << n << endl;
if (wait_for_data) { if (wait_for_data) {
if (audio_region()->audio_source(n)->peaks_ready (boost::bind (&AudioRegionView::peaks_ready_handler, this, n), data_ready_connection)) { if (audio_region()->audio_source(n)->peaks_ready (boost::bind (&AudioRegionView::peaks_ready_handler, this, n), data_ready_connection, gui_context())) {
// cerr << "\tData is ready\n"; // cerr << "\tData is ready\n";
create_one_wave (n, true); create_one_wave (n, true);
} else { } else {
@ -1186,7 +1186,7 @@ AudioRegionView::add_ghost (TimeAxisView& tv)
ghost->set_colors(); ghost->set_colors();
ghosts.push_back (ghost); ghosts.push_back (ghost);
ghost->GoingAway.connect (*this, boost::bind (&RegionView::remove_ghost, this, _1)); ghost->GoingAway.connect (*this, ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
return ghost; return ghost;
} }

View file

@ -66,7 +66,7 @@ AudioStreamView::AudioStreamView (AudioTimeAxisView& tv)
use_rec_regions = tv.editor().show_waveforms_recording (); use_rec_regions = tv.editor().show_waveforms_recording ();
Config->ParameterChanged.connect (*this, sigc::mem_fun (*this, &AudioStreamView::parameter_changed)); Config->ParameterChanged.connect (*this, ui_bind (&AudioStreamView::parameter_changed, this, _1), gui_context());
} }
AudioStreamView::~AudioStreamView () AudioStreamView::~AudioStreamView ()
@ -190,7 +190,7 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
/* catch region going away */ /* catch region going away */
r->GoingAway.connect (*this, boost::bind (&AudioStreamView::remove_region_view, this, boost::weak_ptr<Region> (r))); r->GoingAway.connect (*this, boost::bind (&AudioStreamView::remove_region_view, this, boost::weak_ptr<Region> (r)), gui_context());
RegionViewAdded (region_view); RegionViewAdded (region_view);
@ -288,7 +288,7 @@ AudioStreamView::playlist_changed (boost::shared_ptr<Diskstream> ds)
boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(ds->playlist()); boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(ds->playlist());
if (apl) { if (apl) {
apl->NewCrossfade.connect (playlist_connections, boost::bind (&AudioStreamView::add_crossfade, this, _1)); apl->NewCrossfade.connect (playlist_connections, ui_bind (&AudioStreamView::add_crossfade, this, _1), gui_context());
} }
} }
@ -347,7 +347,7 @@ AudioStreamView::add_crossfade (boost::shared_ptr<Crossfade> crossfade)
region_color, region_color,
*lview, *rview); *lview, *rview);
cv->set_valid (true); cv->set_valid (true);
crossfade->Invalidated.connect (*this, sigc::mem_fun (*this, &AudioStreamView::remove_crossfade)); crossfade->Invalidated.connect (*this, ui_bind (&AudioStreamView::remove_crossfade, this, _1), gui_context());
crossfade_views[cv->crossfade] = cv; crossfade_views[cv->crossfade] = cv;
if (!_trackview.session()->config.get_xfades_visible() || !crossfades_visible) { if (!_trackview.session()->config.get_xfades_visible() || !crossfades_visible) {
cv->hide (); cv->hide ();
@ -482,10 +482,9 @@ AudioStreamView::setup_rec_box ()
boost::shared_ptr<AudioFileSource> src = ads->write_source (n); boost::shared_ptr<AudioFileSource> src = ads->write_source (n);
if (src) { if (src) {
sources.push_back (src); sources.push_back (src);
src->PeakRangeReady.connect (rec_data_ready_connections,
(src->PeakRangeReady.connect (rec_data_ready_connections, ui_bind (&AudioStreamView::rec_peak_range_ready, this, _1, _2, boost::weak_ptr<Source>(src)),
boost::bind (&AudioStreamView::rec_peak_range_ready, gui_context());
this, _1, _2, boost::weak_ptr<Source>(src))));
} }
} }

View file

@ -56,6 +56,7 @@
#include "canvas_impl.h" #include "canvas_impl.h"
#include "crossfade_view.h" #include "crossfade_view.h"
#include "enums.h" #include "enums.h"
#include "gui_thread.h"
#include "automation_time_axis.h" #include "automation_time_axis.h"
#include "keyboard.h" #include "keyboard.h"
#include "playlist_selector.h" #include "playlist_selector.h"
@ -108,7 +109,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session* sess, boost::sh
} }
if (_route->panner()) { if (_route->panner()) {
_route->panner()->Changed.connect (*this, (boost::bind (&AudioTimeAxisView::ensure_pan_views, this, false))); _route->panner()->Changed.connect (*this, boost::bind (&AudioTimeAxisView::ensure_pan_views, this, false), gui_context());
} }
/* map current state of the route */ /* map current state of the route */

View file

@ -54,7 +54,7 @@ AutomationController::AutomationController(boost::shared_ptr<AutomationControl>
_screen_update_connection = ARDOUR_UI::RapidScreenUpdate.connect ( _screen_update_connection = ARDOUR_UI::RapidScreenUpdate.connect (
sigc::mem_fun (*this, &AutomationController::display_effective_value)); sigc::mem_fun (*this, &AutomationController::display_effective_value));
ac->Changed.connect (_changed_connection, sigc::mem_fun(*this, &AutomationController::value_changed)); ac->Changed.connect (_changed_connection, boost::bind (&AutomationController::value_changed, this), gui_context());
} }
AutomationController::~AutomationController() AutomationController::~AutomationController()

View file

@ -33,6 +33,7 @@
#include "simplerect.h" #include "simplerect.h"
#include "automation_line.h" #include "automation_line.h"
#include "control_point.h" #include "control_point.h"
#include "gui_thread.h"
#include "rgb_macros.h" #include "rgb_macros.h"
#include "ardour_ui.h" #include "ardour_ui.h"
#include "public_editor.h" #include "public_editor.h"
@ -85,7 +86,7 @@ AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanv
line->signal_event().connect (sigc::mem_fun (*this, &AutomationLine::event_handler)); line->signal_event().connect (sigc::mem_fun (*this, &AutomationLine::event_handler));
alist->StateChanged.connect (_state_connection, boost::bind (&AutomationLine::list_changed, this)); alist->StateChanged.connect (_state_connection, boost::bind (&AutomationLine::list_changed, this), gui_context());
trackview.session()->register_with_memento_command_factory(alist->id(), this); trackview.session()->register_with_memento_command_factory(alist->id(), this);

View file

@ -22,7 +22,9 @@
#include "ardour/event_type_map.h" #include "ardour/event_type_map.h"
#include "ardour/session.h" #include "ardour/session.h"
#include "ardour/source.h" #include "ardour/source.h"
#include "automation_region_view.h" #include "automation_region_view.h"
#include "gui_thread.h"
#include "public_editor.h" #include "public_editor.h"
#include "i18n.h" #include "i18n.h"
@ -59,7 +61,7 @@ AutomationRegionView::init (Gdk::Color const & basic_color, bool /*wfd*/)
set_height (trackview.current_height()); set_height (trackview.current_height());
_region->StateChanged.connect (*this, boost::bind (&RegionView::region_changed, this, _1)); _region->StateChanged.connect (*this, ui_bind (&RegionView::region_changed, this, _1), gui_context());
set_colors (); set_colors ();

View file

@ -129,7 +129,7 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region
display_region(region_view); display_region(region_view);
/* catch regionview going away */ /* catch regionview going away */
region->GoingAway.connect (*this, boost::bind (&AutomationStreamView::remove_region_view, this, boost::weak_ptr<Region>(region))); region->GoingAway.connect (*this, boost::bind (&AutomationStreamView::remove_region_view, this, boost::weak_ptr<Region>(region)), gui_context());
RegionViewAdded (region_view); RegionViewAdded (region_view);

View file

@ -28,6 +28,7 @@
#include "ardour_ui.h" #include "ardour_ui.h"
#include "automation_time_axis.h" #include "automation_time_axis.h"
#include "automation_streamview.h" #include "automation_streamview.h"
#include "gui_thread.h"
#include "route_time_axis.h" #include "route_time_axis.h"
#include "automation_line.h" #include "automation_line.h"
#include "public_editor.h" #include "public_editor.h"
@ -833,7 +834,7 @@ AutomationTimeAxisView::add_line (boost::shared_ptr<AutomationLine> line)
assert(!_line); assert(!_line);
assert(line->the_list() == _control->list()); assert(line->the_list() == _control->list());
_control->alist()->automation_state_changed.connect (automation_connection, boost::bind (&AutomationTimeAxisView::automation_state_changed, this)); _control->alist()->automation_state_changed.connect (automation_connection, boost::bind (&AutomationTimeAxisView::automation_state_changed, this), gui_context());
_line = line; _line = line;
//_controller = AutomationController::create(_session, line->the_list(), _control); //_controller = AutomationController::create(_session, line->the_list(), _control);

View file

@ -151,7 +151,7 @@ class AutomationTimeAxisView : public TimeAxisView {
void set_interpolation (ARDOUR::AutomationList::InterpolationStyle); void set_interpolation (ARDOUR::AutomationList::InterpolationStyle);
void interpolation_changed (); void interpolation_changed ();
boost::signals2::scoped_connection automation_connection; PBD::ScopedConnection automation_connection;
void update_extra_xml_shown (bool editor_shown); void update_extra_xml_shown (bool editor_shown);

View file

@ -24,10 +24,12 @@
#include <gtkmm/table.h> #include <gtkmm/table.h>
#include <gtkmm/comboboxtext.h> #include <gtkmm/comboboxtext.h>
#include <gtkmm/alignment.h> #include <gtkmm/alignment.h>
#include "ardour/session.h" #include "ardour/session.h"
#include "ardour/user_bundle.h" #include "ardour/user_bundle.h"
#include "ardour/audioengine.h" #include "ardour/audioengine.h"
#include "bundle_manager.h" #include "bundle_manager.h"
#include "gui_thread.h"
#include "i18n.h" #include "i18n.h"
#include "utils.h" #include "utils.h"
@ -395,7 +397,7 @@ BundleManager::add_bundle (boost::shared_ptr<Bundle> b)
(*i)[_list_model_columns.name] = u->name (); (*i)[_list_model_columns.name] = u->name ();
(*i)[_list_model_columns.bundle] = u; (*i)[_list_model_columns.bundle] = u;
u->Changed.connect (bundle_connections, boost::bind (&BundleManager::bundle_changed, this, _1, u)); u->Changed.connect (bundle_connections, ui_bind (&BundleManager::bundle_changed, this, _1, u), gui_context());
} }
void void
@ -420,7 +422,7 @@ BundleManager::bundle_changed (Bundle::Change c, boost::shared_ptr<UserBundle> b
} }
void void
BundleManager::row_activated (Gtk::TreeModel::Path const & p, Gtk::TreeViewColumn* c) BundleManager::row_activated (Gtk::TreeModel::Path const & p, Gtk::TreeViewColumn*)
{ {
Gtk::TreeModel::iterator i = _list_model->get_iter (p); Gtk::TreeModel::iterator i = _list_model->get_iter (p);
if (!i) { if (!i) {

View file

@ -291,9 +291,9 @@ CrossfadeEditor::CrossfadeEditor (Session* s, boost::shared_ptr<Crossfade> xf, d
curve_select_clicked (In); curve_select_clicked (In);
xfade->StateChanged.connect (state_connection, boost::bind (&CrossfadeEditor::xfade_changed, this, _1)); xfade->StateChanged.connect (state_connection, ui_bind (&CrossfadeEditor::xfade_changed, this, _1), gui_context());
_session->AuditionActive.connect (_session_connections, sigc::mem_fun(*this, &CrossfadeEditor::audition_state_changed)); _session->AuditionActive.connect (_session_connections, ui_bind (&CrossfadeEditor::audition_state_changed, this, _1), gui_context());
show_all_children(); show_all_children();
} }
@ -1130,7 +1130,7 @@ CrossfadeEditor::make_waves (boost::shared_ptr<AudioRegion> region, WhichFade wh
gdouble yoff = n * ht; gdouble yoff = n * ht;
if (region->audio_source(n)->peaks_ready (boost::bind (&CrossfadeEditor::peaks_ready, this, boost::weak_ptr<AudioRegion>(region), which), peaks_ready_connection)) { if (region->audio_source(n)->peaks_ready (boost::bind (&CrossfadeEditor::peaks_ready, this, boost::weak_ptr<AudioRegion>(region), which), peaks_ready_connection, gui_context())) {
WaveView* waveview = new WaveView (*(canvas->root())); WaveView* waveview = new WaveView (*(canvas->root()));
waveview->property_data_src() = region.get(); waveview->property_data_src() = region.get();

View file

@ -25,6 +25,7 @@
#include "canvas-simplerect.h" #include "canvas-simplerect.h"
#include "canvas-curve.h" #include "canvas-curve.h"
#include "crossfade_view.h" #include "crossfade_view.h"
#include "gui_thread.h"
#include "rgb_macros.h" #include "rgb_macros.h"
#include "audio_time_axis.h" #include "audio_time_axis.h"
#include "public_editor.h" #include "public_editor.h"
@ -83,7 +84,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
crossfade_changed (Change (~0)); crossfade_changed (Change (~0));
crossfade->StateChanged.connect (*this, sigc::mem_fun(*this, &CrossfadeView::crossfade_changed)); crossfade->StateChanged.connect (*this, ui_bind (&CrossfadeView::crossfade_changed, this, _1), gui_context());
ColorsChanged.connect (sigc::mem_fun (*this, &CrossfadeView::color_handler)); ColorsChanged.connect (sigc::mem_fun (*this, &CrossfadeView::color_handler));
} }

View file

@ -627,7 +627,7 @@ Editor::Editor ()
_playlist_selector = new PlaylistSelector(); _playlist_selector = new PlaylistSelector();
_playlist_selector->signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), static_cast<Window *> (_playlist_selector))); _playlist_selector->signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), static_cast<Window *> (_playlist_selector)));
RegionView::RegionViewGoingAway.connect (*this, boost::bind (&Editor::catch_vanishing_regionview, this, _1)); RegionView::RegionViewGoingAway.connect (*this, ui_bind (&Editor::catch_vanishing_regionview, this, _1), gui_context());
/* nudge stuff */ /* nudge stuff */
@ -677,14 +677,17 @@ Editor::Editor ()
/* allow external control surfaces/protocols to do various things */ /* allow external control surfaces/protocols to do various things */
ControlProtocol::ZoomToSession.connect (*this, boost::bind (&Editor::temporal_zoom_session, this)); ControlProtocol::ZoomToSession.connect (*this, boost::bind (&Editor::temporal_zoom_session, this), gui_context());
ControlProtocol::ZoomIn.connect (*this, boost::bind (&Editor::temporal_zoom_step, this, false)); ControlProtocol::ZoomIn.connect (*this, boost::bind (&Editor::temporal_zoom_step, this, false), gui_context());
ControlProtocol::ZoomOut.connect (*this, boost::bind (&Editor::temporal_zoom_step, this, true)); ControlProtocol::ZoomOut.connect (*this, boost::bind (&Editor::temporal_zoom_step, this, true), gui_context());
ControlProtocol::ScrollTimeline.connect (*this, boost::bind (&Editor::control_scroll, this, _1)); ControlProtocol::ScrollTimeline.connect (*this, ui_bind (&Editor::control_scroll, this, _1), gui_context());
BasicUI::AccessAction.connect (*this, boost::bind (&Editor::access_action, this, _1, _2)); BasicUI::AccessAction.connect (*this, ui_bind (&Editor::access_action, this, _1, _2), gui_context());
Session::AskAboutPlaylistDeletion.connect (*this, boost::bind (&Editor::playlist_deletion_dialog, this, _1));
/* problematic: has to return a value and thus cannot be x-thread */
Config->ParameterChanged.connect (*this, boost::bind (&Editor::parameter_changed, this, _1)); Session::AskAboutPlaylistDeletion.connect_same_thread (*this, boost::bind (&Editor::playlist_deletion_dialog, this, _1));
Config->ParameterChanged.connect (*this, ui_bind (&Editor::parameter_changed, this, _1), gui_context());
_last_normalization_value = 0; _last_normalization_value = 0;
@ -1081,22 +1084,22 @@ Editor::set_session (Session *t)
but use Gtkmm2ext::UI::instance()->call_slot(); but use Gtkmm2ext::UI::instance()->call_slot();
*/ */
_session->TransportStateChange.connect (_session_connections, boost::bind (&Editor::map_transport_state, this)); _session->TransportStateChange.connect (_session_connections, boost::bind (&Editor::map_transport_state, this), gui_context());
_session->PositionChanged.connect (_session_connections, boost::bind (&Editor::map_position_change, this, _1)); _session->PositionChanged.connect (_session_connections, ui_bind (&Editor::map_position_change, this, _1), gui_context());
_session->RouteAdded.connect (_session_connections, boost::bind (&Editor::handle_new_route, this, _1)); _session->RouteAdded.connect (_session_connections, ui_bind (&Editor::handle_new_route, this, _1), gui_context());
_session->DurationChanged.connect (_session_connections, boost::bind (&Editor::handle_new_duration, this)); _session->DurationChanged.connect (_session_connections, boost::bind (&Editor::handle_new_duration, this), gui_context());
_session->DirtyChanged.connect (_session_connections, boost::bind (&Editor::update_title, this)); _session->DirtyChanged.connect (_session_connections, boost::bind (&Editor::update_title, this), gui_context());
_session->TimecodeOffsetChanged.connect (_session_connections, boost::bind (&Editor::update_just_timecode, this)); _session->TimecodeOffsetChanged.connect (_session_connections, boost::bind (&Editor::update_just_timecode, this), gui_context());
_session->tempo_map().StateChanged.connect (_session_connections, boost::bind (&Editor::tempo_map_changed, this, _1)); _session->tempo_map().StateChanged.connect (_session_connections, ui_bind (&Editor::tempo_map_changed, this, _1), gui_context());
_session->Located.connect (_session_connections, boost::bind (&Editor::located, this)); _session->Located.connect (_session_connections, boost::bind (&Editor::located, this), gui_context());
_session->config.ParameterChanged.connect (_session_connections, boost::bind (&Editor::parameter_changed, this, _1)); _session->config.ParameterChanged.connect (_session_connections, ui_bind (&Editor::parameter_changed, this, _1), gui_context());
_session->StateSaved.connect (_session_connections, boost::bind (&Editor::session_state_saved, this, _1)); _session->StateSaved.connect (_session_connections, ui_bind (&Editor::session_state_saved, this, _1), gui_context());
_session->locations()->added.connect (_session_connections, sigc::mem_fun(*this, &Editor::add_new_location)); _session->locations()->added.connect (_session_connections, ui_bind (&Editor::add_new_location, this, _1), gui_context());
_session->locations()->removed.connect (_session_connections, sigc::mem_fun(*this, &Editor::location_gone)); _session->locations()->removed.connect (_session_connections, ui_bind (&Editor::location_gone, this, _1), gui_context());
_session->locations()->changed.connect (_session_connections, sigc::mem_fun(*this, &Editor::refresh_location_display)); _session->locations()->changed.connect (_session_connections, boost::bind (&Editor::refresh_location_display, this), gui_context());
_session->locations()->StateChanged.connect (_session_connections, sigc::mem_fun(*this, &Editor::refresh_location_display_s)); _session->locations()->StateChanged.connect (_session_connections, ui_bind (&Editor::refresh_location_display_s, this, _1), gui_context());
_session->locations()->end_location()->changed.connect (_session_connections, sigc::mem_fun(*this, &Editor::end_location_changed)); _session->locations()->end_location()->changed.connect (_session_connections, ui_bind (&Editor::end_location_changed, this, _1), gui_context());
_session->history().Changed.connect (_session_connections, boost::bind (&Editor::history_changed, this)); _session->history().Changed.connect (_session_connections, boost::bind (&Editor::history_changed, this), gui_context());
if (Profile->get_sae()) { if (Profile->get_sae()) {
BBT_Time bbt; BBT_Time bbt;
@ -4802,7 +4805,7 @@ Editor::handle_new_route (RouteList& routes)
rtv->view()->RegionViewAdded.connect (sigc::mem_fun (*this, &Editor::region_view_added)); rtv->view()->RegionViewAdded.connect (sigc::mem_fun (*this, &Editor::region_view_added));
rtv->view()->HeightChanged.connect (sigc::mem_fun (*this, &Editor::streamview_height_changed)); rtv->view()->HeightChanged.connect (sigc::mem_fun (*this, &Editor::streamview_height_changed));
rtv->GoingAway.connect (*this, boost::bind (&Editor::remove_route, this, rtv)); rtv->GoingAway.connect (*this, boost::bind (&Editor::remove_route, this, rtv), gui_context());
} }
_routes->routes_added (new_views); _routes->routes_added (new_views);

View file

@ -30,6 +30,7 @@
#include "audio_region_view.h" #include "audio_region_view.h"
#include "midi_region_view.h" #include "midi_region_view.h"
#include "ardour_ui.h" #include "ardour_ui.h"
#include "gui_thread.h"
#include "control_point.h" #include "control_point.h"
#include "utils.h" #include "utils.h"
#include "region_gain_line.h" #include "region_gain_line.h"
@ -237,7 +238,7 @@ RegionDrag::RegionDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<Re
_primary (p), _primary (p),
_views (v) _views (v)
{ {
RegionView::RegionViewGoingAway.connect (death_connection, boost::bind (&RegionDrag::region_going_away, this, _1)); RegionView::RegionViewGoingAway.connect (death_connection, ui_bind (&RegionDrag::region_going_away, this, _1), gui_context());
} }
void void

View file

@ -160,7 +160,7 @@ protected:
private: private:
void region_going_away (RegionView *); void region_going_away (RegionView *);
boost::signals2::scoped_connection death_connection; PBD::ScopedConnection death_connection;
}; };

View file

@ -41,6 +41,7 @@
#include "imageframe_socket_handler.h" #include "imageframe_socket_handler.h"
#include "ardour_image_compositor_socket.h" #include "ardour_image_compositor_socket.h"
#include "public_editor.h" #include "public_editor.h"
#include "gui_thread.h"
using namespace Gtk; using namespace Gtk;
using namespace PBD; using namespace PBD;
@ -1092,7 +1093,7 @@ Editor::handle_new_imageframe_time_axis_view(const string & track_name, void* sr
row[route_display_columns.tv] = iftav; row[route_display_columns.tv] = iftav;
route_list_display.get_selection()->select (row); route_list_display.get_selection()->select (row);
iftav->GoingAway.connect (*this, boost::bind (&Editor::remove_route, this, (TimeAxisView*)iftav)); iftav->GoingAway.connect (*this, boost::bind (&Editor::remove_route, this, (TimeAxisView*)iftav), gui_context());
iftav->gui_changed.connect(sigc::mem_fun(*this, &Editor::handle_gui_changes)) ; iftav->gui_changed.connect(sigc::mem_fun(*this, &Editor::handle_gui_changes)) ;
} }
@ -1109,7 +1110,7 @@ Editor::handle_new_imageframe_marker_time_axis_view(const string & track_name, T
row[route_display_columns.tv] = mta; row[route_display_columns.tv] = mta;
route_list_display.get_selection()->select (row); route_list_display.get_selection()->select (row);
mta->GoingAway.connect (*this, boost::bind (&Editor::remove_route, this, (TimeAxisView*)mta)); mta->GoingAway.connect (*this, boost::bind (&Editor::remove_route, this, (TimeAxisView*)mta), gui_context());
} }

View file

@ -123,11 +123,11 @@ Editor::add_new_location (Location *location)
lam->show (); lam->show ();
} }
location->start_changed.connect (*this, boost::bind (&Editor::location_changed, this, _1)); location->start_changed.connect (*this, ui_bind (&Editor::location_changed, this, _1), gui_context());
location->end_changed.connect (*this, boost::bind (&Editor::location_changed, this, _1)); location->end_changed.connect (*this, ui_bind (&Editor::location_changed, this, _1), gui_context());
location->changed.connect (*this, boost::bind (&Editor::location_changed, this, _1)); location->changed.connect (*this, ui_bind (&Editor::location_changed, this, _1), gui_context());
location->name_changed.connect (*this, boost::bind (&Editor::location_changed, this, _1)); location->name_changed.connect (*this, ui_bind (&Editor::location_changed, this, _1), gui_context());
location->FlagsChanged.connect (*this, boost::bind (&Editor::location_flags_changed, this, _1, _2)); location->FlagsChanged.connect (*this, ui_bind (&Editor::location_flags_changed, this, _1, _2), gui_context());
pair<Location*,LocationMarkers*> newpair; pair<Location*,LocationMarkers*> newpair;

View file

@ -35,6 +35,7 @@
#include "editor_routes.h" #include "editor_routes.h"
#include "editor_route_groups.h" #include "editor_route_groups.h"
#include "editor_regions.h" #include "editor_regions.h"
#include "gui_thread.h"
#include "i18n.h" #include "i18n.h"
@ -168,7 +169,7 @@ Editor::create_editor_mixer ()
_session, _session,
false); false);
current_mixer_strip->Hiding.connect (sigc::mem_fun(*this, &Editor::current_mixer_strip_hidden)); current_mixer_strip->Hiding.connect (sigc::mem_fun(*this, &Editor::current_mixer_strip_hidden));
current_mixer_strip->GoingAway.connect (*this, boost::bind (&Editor::current_mixer_strip_removed, this)); current_mixer_strip->GoingAway.connect (*this, boost::bind (&Editor::current_mixer_strip_removed, this), gui_context());
#ifdef GTKOSX #ifdef GTKOSX
current_mixer_strip->WidthChanged.connect (sigc::mem_fun(*this, &Editor::ensure_all_elements_drawn)); current_mixer_strip->WidthChanged.connect (sigc::mem_fun(*this, &Editor::ensure_all_elements_drawn));
#endif #endif

View file

@ -125,7 +125,7 @@ EditorRegions::EditorRegions (Editor* e)
//ARDOUR_UI::instance()->secondary_clock.mode_changed.connect (sigc::mem_fun(*this, &Editor::redisplay_regions)); //ARDOUR_UI::instance()->secondary_clock.mode_changed.connect (sigc::mem_fun(*this, &Editor::redisplay_regions));
ARDOUR_UI::instance()->secondary_clock.mode_changed.connect (sigc::mem_fun(*this, &EditorRegions::update_all_rows)); ARDOUR_UI::instance()->secondary_clock.mode_changed.connect (sigc::mem_fun(*this, &EditorRegions::update_all_rows));
ARDOUR::Region::RegionPropertyChanged.connect (region_property_connection, sigc::mem_fun(*this, &EditorRegions::update_row)); ARDOUR::Region::RegionPropertyChanged.connect (region_property_connection, ui_bind (&EditorRegions::update_row, this, _1), gui_context());
} }
@ -135,9 +135,9 @@ EditorRegions::set_session (ARDOUR::Session* s)
EditorComponent::set_session (s); EditorComponent::set_session (s);
if (_session) { if (_session) {
_session->RegionsAdded.connect (_session_connections, boost::bind (&EditorRegions::handle_new_regions, this, _1)); _session->RegionsAdded.connect (_session_connections, ui_bind (&EditorRegions::handle_new_regions, this, _1), gui_context());
_session->RegionRemoved.connect (_session_connections, boost::bind (&EditorRegions::handle_region_removed, this, _1)); _session->RegionRemoved.connect (_session_connections, ui_bind (&EditorRegions::handle_region_removed, this, _1), gui_context());
_session->RegionHiddenChange.connect (_session_connections, boost::bind (&EditorRegions::region_hidden, this, _1)); _session->RegionHiddenChange.connect (_session_connections, ui_bind (&EditorRegions::region_hidden, this, _1), gui_context());
} }
redisplay (); redisplay ();

View file

@ -574,7 +574,7 @@ EditorRouteGroups::add (RouteGroup* group)
focus = true; focus = true;
} }
group->FlagsChanged.connect (flags_connection, boost::bind (&EditorRouteGroups::flags_changed, this, _1, group)); group->FlagsChanged.connect (flags_connection, ui_bind (&EditorRouteGroups::flags_changed, this, _1, group), gui_context());
if (focus) { if (focus) {
TreeViewColumn* col = _display.get_column (0); TreeViewColumn* col = _display.get_column (0);
@ -668,8 +668,8 @@ EditorRouteGroups::set_session (Session* s)
EditorComponent::set_session (s); EditorComponent::set_session (s);
if (_session) { if (_session) {
_session->route_group_added.connect (_session_connections, boost::bind (&EditorRouteGroups::add, this, _1)); _session->route_group_added.connect (_session_connections, ui_bind (&EditorRouteGroups::add, this, _1), gui_context());
_session->route_group_removed.connect (_session_connections, boost::bind (&EditorRouteGroups::groups_changed, this)); _session->route_group_removed.connect (_session_connections, boost::bind (&EditorRouteGroups::groups_changed, this), gui_context());
} }
groups_changed (); groups_changed ();

View file

@ -150,7 +150,7 @@ EditorRoutes::EditorRoutes (Editor* e)
_model->signal_rows_reordered().connect (sigc::mem_fun (*this, &EditorRoutes::reordered)); _model->signal_rows_reordered().connect (sigc::mem_fun (*this, &EditorRoutes::reordered));
_display.signal_button_press_event().connect (sigc::mem_fun (*this, &EditorRoutes::button_press), false); _display.signal_button_press_event().connect (sigc::mem_fun (*this, &EditorRoutes::button_press), false);
Route::SyncOrderKeys.connect (*this, (sigc::mem_fun (*this, &EditorRoutes::sync_order_keys))); Route::SyncOrderKeys.connect (*this, ui_bind (&EditorRoutes::sync_order_keys, this, _1), gui_context());
} }
void void
@ -161,7 +161,7 @@ EditorRoutes::set_session (Session* s)
initial_display (); initial_display ();
if (_session) { if (_session) {
_session->SoloChanged.connect (*this, (sigc::mem_fun (*this, &EditorRoutes::solo_changed_so_update_mute))); _session->SoloChanged.connect (*this, boost::bind (&EditorRoutes::solo_changed_so_update_mute, this), gui_context());
} }
} }
@ -383,18 +383,18 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes)
boost::weak_ptr<Route> wr ((*x)->route()); boost::weak_ptr<Route> wr ((*x)->route());
(*x)->route()->gui_changed.connect (*this, boost::bind (&EditorRoutes::handle_gui_changes, this, _1, _2)); (*x)->route()->gui_changed.connect (*this, ui_bind (&EditorRoutes::handle_gui_changes, this, _1, _2), gui_context());
(*x)->route()->NameChanged.connect (*this, boost::bind (&EditorRoutes::route_name_changed, this, wr)); (*x)->route()->NameChanged.connect (*this, boost::bind (&EditorRoutes::route_name_changed, this, wr), gui_context());
(*x)->GoingAway.connect (*this, boost::bind (&EditorRoutes::route_removed, this, *x)); (*x)->GoingAway.connect (*this, boost::bind (&EditorRoutes::route_removed, this, *x), gui_context());
if ((*x)->is_track()) { if ((*x)->is_track()) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> ((*x)->route()); boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> ((*x)->route());
t->diskstream()->RecordEnableChanged.connect (*this, boost::bind (&EditorRoutes::update_rec_display, this)); t->diskstream()->RecordEnableChanged.connect (*this, boost::bind (&EditorRoutes::update_rec_display, this), gui_context());
} }
(*x)->route()->mute_changed.connect (*this, boost::bind (&EditorRoutes::update_mute_display, this)); (*x)->route()->mute_changed.connect (*this, boost::bind (&EditorRoutes::update_mute_display, this), gui_context());
(*x)->route()->solo_changed.connect (*this, boost::bind (&EditorRoutes::update_solo_display, this)); (*x)->route()->solo_changed.connect (*this, boost::bind (&EditorRoutes::update_solo_display, this), gui_context());
(*x)->route()->solo_isolated_changed.connect (*this, boost::bind (&EditorRoutes::update_solo_isolate_display, this)); (*x)->route()->solo_isolated_changed.connect (*this, boost::bind (&EditorRoutes::update_solo_isolate_display, this), gui_context());
} }
update_rec_display (); update_rec_display ();

View file

@ -47,8 +47,8 @@ EditorSummary::EditorSummary (Editor* e)
_zoom_dragging (false) _zoom_dragging (false)
{ {
Region::RegionPropertyChanged.connect (region_property_connection, boost::bind (&CairoWidget::set_dirty, this)); Region::RegionPropertyChanged.connect (region_property_connection, boost::bind (&CairoWidget::set_dirty, this), gui_context());
_editor->playhead_cursor->PositionChanged.connect (position_connection, boost::bind (&EditorSummary::playhead_position_changed, this, _1)); _editor->playhead_cursor->PositionChanged.connect (position_connection, ui_bind (&EditorSummary::playhead_position_changed, this, _1), gui_context());
} }
/** Connect to a session. /** Connect to a session.
@ -62,9 +62,9 @@ EditorSummary::set_session (Session* s)
set_dirty (); set_dirty ();
if (_session) { if (_session) {
_session->RegionRemoved.connect (_session_connections, boost::bind (&EditorSummary::set_dirty, this)); _session->RegionRemoved.connect (_session_connections, boost::bind (&EditorSummary::set_dirty, this), gui_context());
_session->StartTimeChanged.connect (_session_connections, boost::bind (&EditorSummary::set_dirty, this)); _session->StartTimeChanged.connect (_session_connections, boost::bind (&EditorSummary::set_dirty, this), gui_context());
_session->EndTimeChanged.connect (_session_connections, boost::bind (&EditorSummary::set_dirty, this)); _session->EndTimeChanged.connect (_session_connections, boost::bind (&EditorSummary::set_dirty, this), gui_context());
} }
} }

View file

@ -18,7 +18,6 @@
*/ */
#include "export_dialog.h"
#include <sigc++/signal.h> #include <sigc++/signal.h>
@ -27,6 +26,9 @@
#include "ardour/export_status.h" #include "ardour/export_status.h"
#include "ardour/export_handler.h" #include "ardour/export_handler.h"
#include "export_dialog.h"
#include "gui_thread.h"
using namespace ARDOUR; using namespace ARDOUR;
using namespace PBD; using namespace PBD;
@ -86,7 +88,8 @@ ExportDialog::set_session (ARDOUR::Session* s)
timespan_selector->CriticalSelectionChanged.connect (sigc::mem_fun (*this, &ExportDialog::update_warnings)); timespan_selector->CriticalSelectionChanged.connect (sigc::mem_fun (*this, &ExportDialog::update_warnings));
channel_selector->CriticalSelectionChanged.connect (sigc::mem_fun (*this, &ExportDialog::update_warnings)); channel_selector->CriticalSelectionChanged.connect (sigc::mem_fun (*this, &ExportDialog::update_warnings));
file_notebook->CriticalSelectionChanged.connect (sigc::mem_fun (*this, &ExportDialog::update_warnings)); file_notebook->CriticalSelectionChanged.connect (sigc::mem_fun (*this, &ExportDialog::update_warnings));
status->Aborting.connect (abort_connection, sigc::mem_fun (*this, &ExportDialog::notify_errors));
status->Aborting.connect (abort_connection, boost::bind (&ExportDialog::notify_errors, this), gui_context());
update_warnings (); update_warnings ();
} }

View file

@ -22,6 +22,7 @@
#include "ardour/export_format_specification.h" #include "ardour/export_format_specification.h"
#include "gui_thread.h"
#include "utils.h" #include "utils.h"
#include "i18n.h" #include "i18n.h"
@ -196,7 +197,7 @@ ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager,
tab_close_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*parent, &ExportFileNotebook::remove_file_page), this)); tab_close_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*parent, &ExportFileNotebook::remove_file_page), this));
profile_manager->FormatListChanged.connect (format_connection, boost::bind (&ExportFormatSelector::update_format_list, &format_selector)); profile_manager->FormatListChanged.connect (format_connection, boost::bind (&ExportFormatSelector::update_format_list, &format_selector), gui_context());
format_selector.FormatEdited.connect (sigc::mem_fun (*this, &ExportFileNotebook::FilePage::save_format_to_manager)); format_selector.FormatEdited.connect (sigc::mem_fun (*this, &ExportFileNotebook::FilePage::save_format_to_manager));
format_selector.FormatRemoved.connect (sigc::mem_fun (*profile_manager, &ExportProfileManager::remove_format_profile)); format_selector.FormatRemoved.connect (sigc::mem_fun (*profile_manager, &ExportProfileManager::remove_format_profile));

View file

@ -18,11 +18,11 @@
*/ */
#include "export_format_dialog.h"
#include "ardour/session.h" #include "ardour/session.h"
#include "ardour/export_format_specification.h" #include "ardour/export_format_specification.h"
#include "export_format_dialog.h"
#include "gui_thread.h"
#include "i18n.h" #include "i18n.h"
using namespace ARDOUR; using namespace ARDOUR;
@ -127,7 +127,7 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) :
close_button = add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_APPLY); close_button = add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_APPLY);
close_button->set_sensitive (false); close_button->set_sensitive (false);
close_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportFormatDialog::end_dialog)); close_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportFormatDialog::end_dialog));
manager.CompleteChanged.connect (*this, sigc::mem_fun (close_button, &Gtk::Button::set_sensitive)); manager.CompleteChanged.connect (*this, ui_bind (&Gtk::Button::set_sensitive, close_button, _1), gui_context());
/* Load state before hooking up the rest of the signals */ /* Load state before hooking up the rest of the signals */
@ -319,7 +319,7 @@ ExportFormatDialog::init_format_table ()
row[compatibility_cols.label] = (*it)->name(); row[compatibility_cols.label] = (*it)->name();
WeakCompatPtr ptr (*it); WeakCompatPtr ptr (*it);
(*it)->SelectChanged.connect (*this, boost::bind (&ExportFormatDialog::change_compatibility_selection, this, _1, ptr)); (*it)->SelectChanged.connect (*this, ui_bind (&ExportFormatDialog::change_compatibility_selection, this, _1, ptr), gui_context());
} }
compatibility_view.append_column_editable ("", compatibility_cols.selected); compatibility_view.append_column_editable ("", compatibility_cols.selected);
@ -347,8 +347,8 @@ ExportFormatDialog::init_format_table ()
row[quality_cols.label] = (*it)->name(); row[quality_cols.label] = (*it)->name();
WeakQualityPtr ptr (*it); WeakQualityPtr ptr (*it);
(*it)->SelectChanged.connect (*this, boost::bind (&ExportFormatDialog::change_quality_selection, this, _1, ptr)); (*it)->SelectChanged.connect (*this, ui_bind (&ExportFormatDialog::change_quality_selection, this, _1, ptr), gui_context());
(*it)->CompatibleChanged.connect (*this, boost::bind (&ExportFormatDialog::change_quality_compatibility, this, _1, ptr)); (*it)->CompatibleChanged.connect (*this, ui_bind (&ExportFormatDialog::change_quality_compatibility, this, _1, ptr), gui_context());
} }
quality_view.append_column ("", quality_cols.label); quality_view.append_column ("", quality_cols.label);
@ -369,19 +369,19 @@ ExportFormatDialog::init_format_table ()
row[format_cols.label] = (*it)->name(); row[format_cols.label] = (*it)->name();
WeakFormatPtr ptr (*it); WeakFormatPtr ptr (*it);
(*it)->SelectChanged.connect (*this, boost::bind (&ExportFormatDialog::change_format_selection, this, _1, ptr)); (*it)->SelectChanged.connect (*this, ui_bind (&ExportFormatDialog::change_format_selection, this, _1, ptr), gui_context());
(*it)->CompatibleChanged.connect (*this, boost::bind (&ExportFormatDialog::change_format_compatibility, this, _1, ptr)); (*it)->CompatibleChanged.connect (*this, ui_bind (&ExportFormatDialog::change_format_compatibility, this, _1, ptr), gui_context());
/* Encoding options */ /* Encoding options */
boost::shared_ptr<HasSampleFormat> hsf; boost::shared_ptr<HasSampleFormat> hsf;
if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (*it)) { if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (*it)) {
hsf->SampleFormatSelectChanged.connect (*this, boost::bind (&ExportFormatDialog::change_sample_format_selection, this, _1, _2)); hsf->SampleFormatSelectChanged.connect (*this, ui_bind (&ExportFormatDialog::change_sample_format_selection, this, _1, _2), gui_context());
hsf->SampleFormatCompatibleChanged.connect (*this, boost::bind (&ExportFormatDialog::change_sample_format_compatibility, this, _1, _2)); hsf->SampleFormatCompatibleChanged.connect (*this, ui_bind (&ExportFormatDialog::change_sample_format_compatibility, this, _1, _2), gui_context());
hsf->DitherTypeSelectChanged.connect (*this, boost::bind (&ExportFormatDialog::change_dither_type_selection, this, _1, _2)); hsf->DitherTypeSelectChanged.connect (*this, ui_bind (&ExportFormatDialog::change_dither_type_selection, this, _1, _2), gui_context());
hsf->DitherTypeCompatibleChanged.connect (*this, boost::bind (&ExportFormatDialog::change_dither_type_compatibility, this, _1, _2)); hsf->DitherTypeCompatibleChanged.connect (*this, ui_bind (&ExportFormatDialog::change_dither_type_compatibility, this, _1, _2), gui_context());
} }
} }
@ -403,8 +403,8 @@ ExportFormatDialog::init_format_table ()
row[sample_rate_cols.label] = (*it)->name(); row[sample_rate_cols.label] = (*it)->name();
WeakSampleRatePtr ptr (*it); WeakSampleRatePtr ptr (*it);
(*it)->SelectChanged.connect (*this, boost::bind (&ExportFormatDialog::change_sample_rate_selection, this, _1, ptr)); (*it)->SelectChanged.connect (*this, ui_bind (&ExportFormatDialog::change_sample_rate_selection, this, _1, ptr), gui_context());
(*it)->CompatibleChanged.connect (*this, boost::bind (&ExportFormatDialog::change_sample_rate_compatibility, this, _1, ptr)); (*it)->CompatibleChanged.connect (*this, ui_bind (&ExportFormatDialog::change_sample_rate_compatibility, this, _1, ptr), gui_context());
} }
sample_rate_view.append_column ("", sample_rate_cols.label); sample_rate_view.append_column ("", sample_rate_cols.label);

View file

@ -226,13 +226,13 @@ GainMeterBase::set_controls (boost::shared_ptr<Route> r,
boost::shared_ptr<AutomationControl> gc = amp->gain_control(); boost::shared_ptr<AutomationControl> gc = amp->gain_control();
gc->alist()->automation_state_changed.connect (model_connections, boost::bind (&GainMeter::gain_automation_state_changed, this)); gc->alist()->automation_state_changed.connect (model_connections, boost::bind (&GainMeter::gain_automation_state_changed, this), gui_context());
gc->alist()->automation_style_changed.connect (model_connections, boost::bind (&GainMeter::gain_automation_style_changed, this)); gc->alist()->automation_style_changed.connect (model_connections, boost::bind (&GainMeter::gain_automation_style_changed, this), gui_context());
gain_automation_state_changed (); gain_automation_state_changed ();
} }
amp->gain_control()->Changed.connect (model_connections, boost::bind (&GainMeterBase::gain_changed, this)); amp->gain_control()->Changed.connect (model_connections, boost::bind (&GainMeterBase::gain_changed, this), gui_context());
gain_changed (); gain_changed ();
show_gain (); show_gain ();

View file

@ -125,7 +125,7 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
main_contents.pack_start (hpacker, false, false); main_contents.pack_start (hpacker, false, false);
} }
pi->ActiveChanged.connect (active_connection, boost::bind (&GenericPluginUI::processor_active_changed, this, boost::weak_ptr<Processor>(pi))); pi->ActiveChanged.connect (active_connection, boost::bind (&GenericPluginUI::processor_active_changed, this, boost::weak_ptr<Processor>(pi)), gui_context());
bypass_button.set_active (!pi->active()); bypass_button.set_active (!pi->active());
@ -420,7 +420,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
//control_ui->combo->set_value_in_list(true, false); //control_ui->combo->set_value_in_list(true, false);
set_popdown_strings (*control_ui->combo, setup_scale_values(port_index, control_ui)); set_popdown_strings (*control_ui->combo, setup_scale_values(port_index, control_ui));
control_ui->combo->signal_changed().connect (sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::control_combo_changed), control_ui)); control_ui->combo->signal_changed().connect (sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::control_combo_changed), control_ui));
mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::parameter_changed, this, control_ui)); mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::parameter_changed, this, control_ui), gui_context());
control_ui->pack_start(control_ui->label, true, true); control_ui->pack_start(control_ui->label, true, true);
control_ui->pack_start(*control_ui->combo, false, true); control_ui->pack_start(*control_ui->combo, false, true);
@ -441,7 +441,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
//control_ui->combo->set_value_in_list(true, false); //control_ui->combo->set_value_in_list(true, false);
set_popdown_strings (*control_ui->combo, setup_scale_values(port_index, control_ui)); set_popdown_strings (*control_ui->combo, setup_scale_values(port_index, control_ui));
control_ui->combo->signal_changed().connect (sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::control_combo_changed), control_ui)); control_ui->combo->signal_changed().connect (sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::control_combo_changed), control_ui));
mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::parameter_changed, this, control_ui)); mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::parameter_changed, this, control_ui), gui_context());
control_ui->pack_start(control_ui->label, true, true); control_ui->pack_start(control_ui->label, true, true);
control_ui->pack_start(*control_ui->combo, false, true); control_ui->pack_start(*control_ui->combo, false, true);
@ -466,7 +466,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
// control_ui->pack_start (control_ui->automate_button, false, false); // control_ui->pack_start (control_ui->automate_button, false, false);
control_ui->button->signal_clicked().connect (sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::control_port_toggled), control_ui)); control_ui->button->signal_clicked().connect (sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::control_port_toggled), control_ui));
mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::toggle_parameter_changed, this, control_ui)); mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::toggle_parameter_changed, this, control_ui), gui_context());
if (plugin->get_parameter (port_index) > 0.5){ if (plugin->get_parameter (port_index) > 0.5){
control_ui->button->set_active(true); control_ui->button->set_active(true);
@ -542,8 +542,8 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
automation_state_changed (control_ui); automation_state_changed (control_ui);
mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::parameter_changed, this, control_ui)); mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::parameter_changed, this, control_ui), gui_context());
mcontrol->alist()->automation_state_changed.connect (control_connections, boost::bind (&GenericPluginUI::automation_state_changed, this, control_ui)); mcontrol->alist()->automation_state_changed.connect (control_connections, boost::bind (&GenericPluginUI::automation_state_changed, this, control_ui), gui_context());
} else if (plugin->parameter_is_output (port_index)) { } else if (plugin->parameter_is_output (port_index)) {
@ -592,7 +592,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
output_controls.push_back (control_ui); output_controls.push_back (control_ui);
} }
mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::parameter_changed, this, control_ui)); mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::parameter_changed, this, control_ui), gui_context());
return control_ui; return control_ui;
} }

View file

@ -21,6 +21,8 @@
#include "ardour/session.h" #include "ardour/session.h"
#include "ardour/route_group.h" #include "ardour/route_group.h"
#include "ardour/route.h" #include "ardour/route.h"
#include "gui_thread.h"
#include "route_group_dialog.h" #include "route_group_dialog.h"
#include "group_tabs.h" #include "group_tabs.h"
#include "keyboard.h" #include "keyboard.h"
@ -45,7 +47,7 @@ GroupTabs::set_session (Session* s)
EditorComponent::set_session (s); EditorComponent::set_session (s);
if (_session) { if (_session) {
_session->RouteGroupChanged.connect (_session_connections, boost::bind (&GroupTabs::set_dirty, this)); _session->RouteGroupChanged.connect (_session_connections, boost::bind (&GroupTabs::set_dirty, this), gui_context());
} }
} }

View file

@ -22,6 +22,7 @@
#include <gtkmm2ext/gtk_ui.h> #include <gtkmm2ext/gtk_ui.h>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/bind/protect.hpp>
#define ENSURE_GUI_THREAD(obj,method, ...) \ #define ENSURE_GUI_THREAD(obj,method, ...) \
if (!Gtkmm2ext::UI::instance()->caller_is_self()) { \ if (!Gtkmm2ext::UI::instance()->caller_is_self()) { \
@ -29,4 +30,7 @@
return;\ return;\
} }
#define gui_context() Gtkmm2ext::UI::instance() /* a UICallback-derived object that specifies the event loop for GUI signal handling */
#define ui_bind(f, ...) boost::protect (boost::bind (f, __VA_ARGS__))
#endif /* __ardour_gtk_gui_thread_h__ */ #endif /* __ardour_gtk_gui_thread_h__ */

View file

@ -322,7 +322,7 @@ ImageFrameTimeAxis::add_marker_time_axis(MarkerTimeAxis* marker_track, void* src
else else
{ {
marker_time_axis_list.push_back(marker_track) ; marker_time_axis_list.push_back(marker_track) ;
marker_track->GoingAway.connect (*this, boost::bind (&ImageFrameTimeAxis::remove_time_axis_view, this, marker_track, (void*)this)); marker_track->GoingAway.connect (*this, boost::bind (&ImageFrameTimeAxis::remove_time_axis_view, this, marker_track, (void*)this), gui_context());
MarkerTimeAxisAdded(marker_track, src) ; /* EMIT_SIGNAL */ MarkerTimeAxisAdded(marker_track, src) ; /* EMIT_SIGNAL */
ret = true ; ret = true ;

View file

@ -216,7 +216,7 @@ ImageFrameTimeAxisGroup::add_imageframe_item(const string & frame_id, nframes_t
imageframe_views.push_front(ifv) ; imageframe_views.push_front(ifv) ;
ifv->GoingAway.connect (*this, boost::bind (&ImageFrameTimeAxisGroup::remove_imageframe_item, this, (void*)this)); ifv->GoingAway.connect (*this, boost::bind (&ImageFrameTimeAxisGroup::remove_imageframe_item, this, (void*)this), gui_context());
ImageFrameAdded(ifv, src) ; /* EMIT_SIGNAL */ ImageFrameAdded(ifv, src) ; /* EMIT_SIGNAL */
} }

View file

@ -214,7 +214,7 @@ ImageFrameTimeAxisView::add_imageframe_group(std::string group_id, void* src)
imageframe_groups.push_front(iftag) ; imageframe_groups.push_front(iftag) ;
iftag->GoingAway.connect (*this, boost::bind (&ImageFrameTimeAxisView::remove_imageframe_group, this, iftag, (void*)this)); iftag->GoingAway.connect (*this, boost::bind (&ImageFrameTimeAxisView::remove_imageframe_group, this, iftag, (void*)this), gui_context());
ImageFrameGroupAdded(iftag, src) ; /* EMIT_SIGNAL */ ImageFrameGroupAdded(iftag, src) ; /* EMIT_SIGNAL */
} }

View file

@ -287,7 +287,7 @@ ImageFrameView::add_marker_view_item(MarkerView* item, void* src)
{ {
marker_view_list.push_back(item) ; marker_view_list.push_back(item) ;
item->GoingAway.connect (*this, boost::bind (&ImageFrameView::remove_marker_view_item, this, (void*)this)); item->GoingAway.connect (*this, boost::bind (&ImageFrameView::remove_marker_view_item, this, (void*)this), gui_context());
MarkerViewAdded(item, src) ; /* EMIT_SIGNAL */ MarkerViewAdded(item, src) ; /* EMIT_SIGNAL */
} }

View file

@ -272,7 +272,7 @@ PortInsertWindow::PortInsertWindow (ARDOUR::Session* sess, boost::shared_ptr<ARD
signal_delete_event().connect (sigc::mem_fun (*this, &PortInsertWindow::wm_delete), false); signal_delete_event().connect (sigc::mem_fun (*this, &PortInsertWindow::wm_delete), false);
pi->GoingAway.connect (going_away_connection, boost::bind (&PortInsertWindow::plugin_going_away, this)); pi->GoingAway.connect (going_away_connection, boost::bind (&PortInsertWindow::plugin_going_away, this), gui_context());
} }
bool bool

View file

@ -122,7 +122,7 @@ class PortInsertWindow : public ArdourDialog
void accept (); void accept ();
void plugin_going_away (); void plugin_going_away ();
boost::signals2::scoped_connection going_away_connection; PBD::ScopedConnection going_away_connection;
bool wm_delete (GdkEventAny*); bool wm_delete (GdkEventAny*);
}; };

View file

@ -59,7 +59,7 @@ LevelMeter::LevelMeter (Session* s)
{ {
set_session (s); set_session (s);
set_spacing (1); set_spacing (1);
Config->ParameterChanged.connect (_parameter_connection, boost::bind (&LevelMeter::parameter_changed, this, _1)); Config->ParameterChanged.connect (_parameter_connection, ui_bind (&LevelMeter::parameter_changed, this, _1), gui_context());
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &LevelMeter::on_theme_changed)); UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &LevelMeter::on_theme_changed));
ColorsChanged.connect (sigc::mem_fun (*this, &LevelMeter::color_handler)); ColorsChanged.connect (sigc::mem_fun (*this, &LevelMeter::color_handler));
max_peak = minus_infinity(); max_peak = minus_infinity();
@ -85,7 +85,7 @@ LevelMeter::set_meter (PeakMeter* meter)
_meter = meter; _meter = meter;
if (_meter) { if (_meter) {
_meter->ConfigurationChanged.connect (_configuration_connection, boost::bind (&LevelMeter::configuration_changed, this, _1, _2)); _meter->ConfigurationChanged.connect (_configuration_connection, ui_bind (&LevelMeter::configuration_changed, this, _1, _2), gui_context());
} }
} }

View file

@ -282,11 +282,11 @@ LocationEditRow::set_location (Location *loc)
end_clock.set_sensitive (!location->locked()); end_clock.set_sensitive (!location->locked());
length_clock.set_sensitive (!location->locked()); length_clock.set_sensitive (!location->locked());
location->start_changed.connect (connections, boost::bind (&LocationEditRow::start_changed, this, _1)); location->start_changed.connect (connections, ui_bind (&LocationEditRow::start_changed, this, _1), gui_context());
location->end_changed.connect (connections, boost::bind (&LocationEditRow::end_changed, this, _1)); location->end_changed.connect (connections, ui_bind (&LocationEditRow::end_changed, this, _1), gui_context());
location->name_changed.connect (connections, boost::bind (&LocationEditRow::name_changed, this, _1)); location->name_changed.connect (connections, ui_bind (&LocationEditRow::name_changed, this, _1), gui_context());
location->changed.connect (connections, boost::bind (&LocationEditRow::location_changed, this, _1)); location->changed.connect (connections, ui_bind (&LocationEditRow::location_changed, this, _1), gui_context());
location->FlagsChanged.connect (connections, boost::bind (&LocationEditRow::flags_changed, this, _1, _2)); location->FlagsChanged.connect (connections, ui_bind (&LocationEditRow::flags_changed, this, _1, _2), gui_context());
} }
void void
@ -860,10 +860,10 @@ LocationUI::set_session(ARDOUR::Session* s)
SessionHandlePtr::set_session (s); SessionHandlePtr::set_session (s);
if (_session) { if (_session) {
_session->locations()->changed.connect (_session_connections, boost::bind (&LocationUI::refresh_location_list, this)); _session->locations()->changed.connect (_session_connections, boost::bind (&LocationUI::refresh_location_list, this), gui_context());
_session->locations()->StateChanged.connect (_session_connections, boost::bind (&LocationUI::refresh_location_list, this)); _session->locations()->StateChanged.connect (_session_connections, boost::bind (&LocationUI::refresh_location_list, this), gui_context());
_session->locations()->added.connect (_session_connections, boost::bind (&LocationUI::location_added, this, _1)); _session->locations()->added.connect (_session_connections, ui_bind (&LocationUI::location_added, this, _1), gui_context());
_session->locations()->removed.connect (_session_connections, boost::bind (&LocationUI::location_removed, this, _1)); _session->locations()->removed.connect (_session_connections, ui_bind (&LocationUI::location_removed, this, _1), gui_context());
} }
refresh_location_list (); refresh_location_list ();

View file

@ -22,6 +22,7 @@
#include "ardour/lv2_plugin.h" #include "ardour/lv2_plugin.h"
#include "ardour_ui.h" #include "ardour_ui.h"
#include "gui_thread.h"
#include "lv2_plugin_ui.h" #include "lv2_plugin_ui.h"
using namespace Gtk; using namespace Gtk;
@ -227,7 +228,7 @@ LV2PluginUI::lv2ui_instantiate(const Glib::ustring& title)
} }
} }
_lv2->ParameterChanged.connect (parameter_connection, boost::bind (&LV2PluginUI::parameter_changed, this, _1, _2)); _lv2->ParameterChanged.connect (parameter_connection, ui_bind (&LV2PluginUI::parameter_changed, this, _1, _2), gui_context());
} }
LV2PluginUI::~LV2PluginUI () LV2PluginUI::~LV2PluginUI ()

View file

@ -211,7 +211,7 @@ MarkerTimeAxisView::add_marker_view(ImageFrameView* ifv, std::string mark_type,
ifv->add_marker_view_item(mv, src) ; ifv->add_marker_view_item(mv, src) ;
marker_view_list.push_front(mv) ; marker_view_list.push_front(mv) ;
mv->GoingAway.connect (*this, boost::bind (&MarkerTimeAxisView::remove_marker_view, this, (void*)this)); mv->GoingAway.connect (*this, boost::bind (&MarkerTimeAxisView::remove_marker_view, this, (void*)this), gui_context());
MarkerViewAdded(mv,src) ; /* EMIT_SIGNAL */ MarkerViewAdded(mv,src) ; /* EMIT_SIGNAL */

View file

@ -585,7 +585,7 @@ MidiRegionView::display_model(boost::shared_ptr<MidiModel> model)
{ {
_model = model; _model = model;
content_connection.disconnect (); content_connection.disconnect ();
_model->ContentsChanged.connect (content_connection, boost::bind (&MidiRegionView::redisplay_model, this)); _model->ContentsChanged.connect (content_connection, boost::bind (&MidiRegionView::redisplay_model, this), gui_context());
clear_events (); clear_events ();
@ -1071,7 +1071,7 @@ MidiRegionView::add_ghost (TimeAxisView& tv)
} }
} }
ghost->GoingAway.connect (*this, boost::bind (&RegionView::remove_ghost, this, _1)); ghost->GoingAway.connect (*this, ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
return ghost; return ghost;
} }

View file

@ -25,7 +25,7 @@
#include <libgnomecanvasmm.h> #include <libgnomecanvasmm.h>
#include <libgnomecanvasmm/polygon.h> #include <libgnomecanvasmm/polygon.h>
#include <boost/signals2.hpp> #include "pbd/signals.h"
#include "ardour/midi_track.h" #include "ardour/midi_track.h"
#include "ardour/midi_region.h" #include "ardour/midi_region.h"
@ -389,7 +389,7 @@ class MidiRegionView : public RegionView
std::vector<NoteResizeData *> _resize_data; std::vector<NoteResizeData *> _resize_data;
/* connection used to connect to model's ContentChanged signal */ /* connection used to connect to model's ContentChanged signal */
boost::signals2::scoped_connection content_connection; PBD::ScopedConnection content_connection;
ArdourCanvas::CanvasNoteEvent* find_canvas_note (boost::shared_ptr<NoteType>); ArdourCanvas::CanvasNoteEvent* find_canvas_note (boost::shared_ptr<NoteType>);
Events::iterator _optimization_iterator; Events::iterator _optimization_iterator;

View file

@ -180,7 +180,7 @@ MidiStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wfd,
display_region (region_view, wfd); display_region (region_view, wfd);
/* catch regionview going away */ /* catch regionview going away */
region->GoingAway.connect (*this, boost::bind (&MidiStreamView::remove_region_view, this, region)); region->GoingAway.connect (*this, boost::bind (&MidiStreamView::remove_region_view, this, region), gui_context());
RegionViewAdded (region_view); RegionViewAdded (region_view);
@ -402,8 +402,9 @@ MidiStreamView::setup_rec_box ()
sources.push_back(mds->write_source()); sources.push_back(mds->write_source());
mds->write_source()->ViewDataRangeReady.connect mds->write_source()->ViewDataRangeReady.connect
(rec_data_ready_connections, boost::bind (&MidiStreamView::rec_data_range_ready, this, (rec_data_ready_connections,
_1, _2, boost::weak_ptr<Source>(mds->write_source()))); ui_bind (&MidiStreamView::rec_data_range_ready, this, _1, _2, boost::weak_ptr<Source>(mds->write_source())),
gui_context());
// handle multi // handle multi

View file

@ -137,7 +137,7 @@ MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session* sess,
set_state (*xml_node, Stateful::loading_state_version); set_state (*xml_node, Stateful::loading_state_version);
_route->processors_changed.connect (*this, boost::bind (&MidiTimeAxisView::processors_changed, this, _1)); _route->processors_changed.connect (*this, ui_bind (&MidiTimeAxisView::processors_changed, this, _1), gui_context());
if (is_track()) { if (is_track()) {
_piano_roll_header = new PianoRollHeader(*midi_view()); _piano_roll_header = new PianoRollHeader(*midi_view());

View file

@ -257,8 +257,8 @@ MixerStrip::init ()
_packed = false; _packed = false;
_embedded = false; _embedded = false;
_session->engine().Stopped.connect (*this, boost::bind (&MixerStrip::engine_stopped, this)); _session->engine().Stopped.connect (*this, boost::bind (&MixerStrip::engine_stopped, this), gui_context());
_session->engine().Running.connect (*this, boost::bind (&MixerStrip::engine_running, this)); _session->engine().Running.connect (*this, boost::bind (&MixerStrip::engine_running, this), gui_context());
input_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::input_press), false); input_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::input_press), false);
output_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::output_press), false); output_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::output_press), false);
@ -363,7 +363,7 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
boost::shared_ptr<AudioTrack> at = audio_track(); boost::shared_ptr<AudioTrack> at = audio_track();
at->FreezeChange.connect (route_connections, boost::bind (&MixerStrip::map_frozen, this)); at->FreezeChange.connect (route_connections, boost::bind (&MixerStrip::map_frozen, this), gui_context());
button_table.attach (*rec_enable_button, 0, 2, 2, 3); button_table.attach (*rec_enable_button, 0, 2, 2, 3);
rec_enable_button->set_sensitive (_session->writable()); rec_enable_button->set_sensitive (_session->writable());
@ -412,22 +412,22 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
_("Click to Add/Edit Comments"): _("Click to Add/Edit Comments"):
_route->comment()); _route->comment());
_route->meter_change.connect (route_connections, boost::bind (&MixerStrip::meter_changed, this, _1)); _route->meter_change.connect (route_connections, ui_bind (&MixerStrip::meter_changed, this, _1), gui_context());
_route->input()->changed.connect (route_connections, boost::bind (&MixerStrip::input_changed, this, _1, _2)); _route->input()->changed.connect (route_connections, ui_bind (&MixerStrip::input_changed, this, _1, _2), gui_context());
_route->output()->changed.connect (route_connections, boost::bind (&MixerStrip::output_changed, this, _1, _2)); _route->output()->changed.connect (route_connections, ui_bind (&MixerStrip::output_changed, this, _1, _2), gui_context());
_route->route_group_changed.connect (route_connections, boost::bind (&MixerStrip::route_group_changed, this)); _route->route_group_changed.connect (route_connections, boost::bind (&MixerStrip::route_group_changed, this), gui_context());
if (_route->panner()) { if (_route->panner()) {
_route->panner()->Changed.connect (route_connections, boost::bind (&MixerStrip::connect_to_pan, this)); _route->panner()->Changed.connect (route_connections, boost::bind (&MixerStrip::connect_to_pan, this), gui_context());
} }
if (is_audio_track()) { if (is_audio_track()) {
audio_track()->DiskstreamChanged.connect (route_connections, boost::bind (&MixerStrip::diskstream_changed, this)); audio_track()->DiskstreamChanged.connect (route_connections, boost::bind (&MixerStrip::diskstream_changed, this), gui_context());
} }
_route->NameChanged.connect (route_connections, boost::bind (&RouteUI::name_changed, this)); _route->NameChanged.connect (route_connections, boost::bind (&RouteUI::name_changed, this), gui_context());
_route->comment_changed.connect (route_connections, boost::bind (&MixerStrip::comment_changed, this, _1)); _route->comment_changed.connect (route_connections, ui_bind (&MixerStrip::comment_changed, this, _1), gui_context());
_route->gui_changed.connect (route_connections, boost::bind (&MixerStrip::route_gui_changed, this, _1, _2)); _route->gui_changed.connect (route_connections, ui_bind (&MixerStrip::route_gui_changed, this, _1, _2), gui_context());
set_stuff_from_route (); set_stuff_from_route ();
@ -928,8 +928,8 @@ MixerStrip::connect_to_pan ()
_route->panner()->data().control(Evoral::Parameter(PanAutomation))); _route->panner()->data().control(Evoral::Parameter(PanAutomation)));
if (pan_control) { if (pan_control) {
pan_control->alist()->automation_state_changed.connect (panstate_connection, boost::bind (&PannerUI::pan_automation_state_changed, &panners)); pan_control->alist()->automation_state_changed.connect (panstate_connection, boost::bind (&PannerUI::pan_automation_state_changed, &panners), gui_context());
pan_control->alist()->automation_style_changed.connect (panstyle_connection, boost::bind (&PannerUI::pan_automation_style_changed, &panners)); pan_control->alist()->automation_style_changed.connect (panstyle_connection, boost::bind (&PannerUI::pan_automation_style_changed, &panners), gui_context());
} }
panners.pan_changed (this); panners.pan_changed (this);
@ -1693,7 +1693,7 @@ MixerStrip::show_send (boost::shared_ptr<Send> send)
_current_delivery = send; _current_delivery = send;
send->set_metering (true); send->set_metering (true);
_current_delivery->GoingAway.connect (send_gone_connection, boost::bind (&MixerStrip::revert_to_default_display, this)); _current_delivery->GoingAway.connect (send_gone_connection, boost::bind (&MixerStrip::revert_to_default_display, this), gui_context());
gain_meter().set_controls (_route, send->meter(), send->amp()); gain_meter().set_controls (_route, send->meter(), send->amp());
gain_meter().setup_meters (); gain_meter().setup_meters ();

View file

@ -214,8 +214,8 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
void input_changed (ARDOUR::IOChange, void *); void input_changed (ARDOUR::IOChange, void *);
void output_changed (ARDOUR::IOChange, void *); void output_changed (ARDOUR::IOChange, void *);
boost::signals2::scoped_connection panstate_connection; PBD::ScopedConnection panstate_connection;
boost::signals2::scoped_connection panstyle_connection; PBD::ScopedConnection panstyle_connection;
void connect_to_pan (); void connect_to_pan ();
void update_diskstream_display (); void update_diskstream_display ();
@ -265,7 +265,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
void revert_to_default_display (); void revert_to_default_display ();
void drop_send (); void drop_send ();
boost::signals2::scoped_connection send_gone_connection; PBD::ScopedConnection send_gone_connection;
void reset_strip_style (); void reset_strip_style ();

View file

@ -74,7 +74,7 @@ Mixer_UI::Mixer_UI ()
strip_redisplay_does_not_sync_order_keys = false; strip_redisplay_does_not_sync_order_keys = false;
ignore_sync = false; ignore_sync = false;
Route::SyncOrderKeys.connect (*this, boost::bind (&Mixer_UI::sync_order_keys, this, _1)); Route::SyncOrderKeys.connect (*this, ui_bind (&Mixer_UI::sync_order_keys, this, _1), gui_context());
scroller_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK); scroller_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
scroller_base.set_name ("MixerWindow"); scroller_base.set_name ("MixerWindow");
@ -333,9 +333,9 @@ Mixer_UI::add_strip (RouteList& routes)
route->set_order_key (N_("signal"), track_model->children().size()-1); route->set_order_key (N_("signal"), track_model->children().size()-1);
} }
route->NameChanged.connect (*this, boost::bind (&Mixer_UI::strip_name_changed, this, strip)); route->NameChanged.connect (*this, boost::bind (&Mixer_UI::strip_name_changed, this, strip), gui_context());
strip->GoingAway.connect (*this, boost::bind (&Mixer_UI::remove_strip, this, strip)); strip->GoingAway.connect (*this, boost::bind (&Mixer_UI::remove_strip, this, strip), gui_context());
strip->WidthChanged.connect (sigc::mem_fun(*this, &Mixer_UI::strip_width_changed)); strip->WidthChanged.connect (sigc::mem_fun(*this, &Mixer_UI::strip_width_changed));
strip->signal_button_release_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_button_release_event), strip)); strip->signal_button_release_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_button_release_event), strip));
} }
@ -476,10 +476,10 @@ Mixer_UI::set_session (Session* sess)
initial_track_display (); initial_track_display ();
_session->RouteAdded.connect (_session_connections, boost::bind (&Mixer_UI::add_strip, this, _1)); _session->RouteAdded.connect (_session_connections, ui_bind (&Mixer_UI::add_strip, this, _1), gui_context());
_session->route_group_added.connect (_session_connections, boost::bind (&Mixer_UI::add_route_group, this, _1)); _session->route_group_added.connect (_session_connections, ui_bind (&Mixer_UI::add_route_group, this, _1), gui_context());
_session->route_group_removed.connect (_session_connections, boost::bind (&Mixer_UI::route_groups_changed, this)); _session->route_group_removed.connect (_session_connections, boost::bind (&Mixer_UI::route_groups_changed, this), gui_context());
_session->config.ParameterChanged.connect (_session_connections, boost::bind (&Mixer_UI::parameter_changed, this, _1)); _session->config.ParameterChanged.connect (_session_connections, ui_bind (&Mixer_UI::parameter_changed, this, _1), gui_context());
route_groups_changed (); route_groups_changed ();
@ -1252,7 +1252,7 @@ Mixer_UI::add_route_group (RouteGroup* group)
focus = true; focus = true;
} }
group->FlagsChanged.connect (*this, boost::bind (&Mixer_UI::group_flags_changed, this, _1, group)); group->FlagsChanged.connect (*this, ui_bind (&Mixer_UI::group_flags_changed, this, _1, group), gui_context());
if (focus) { if (focus) {
TreeViewColumn* col = group_display.get_column (0); TreeViewColumn* col = group_display.get_column (0);

View file

@ -164,7 +164,7 @@ OptionEditor::OptionEditor (Configuration* c, std::string const & t)
show_all_children(); show_all_children();
/* Watch out for changes to parameters */ /* Watch out for changes to parameters */
_config->ParameterChanged.connect (config_connection, boost::bind (&OptionEditor::parameter_changed, this, _1)); _config->ParameterChanged.connect (config_connection, ui_bind (&OptionEditor::parameter_changed, this, _1), gui_context());
} }
OptionEditor::~OptionEditor () OptionEditor::~OptionEditor ()

View file

@ -72,8 +72,8 @@ Panner2d::Panner2d (boost::shared_ptr<Panner> p, int32_t h)
allow_y = false; allow_y = false;
allow_target = false; allow_target = false;
panner->StateChanged.connect (state_connection, boost::bind (&Panner2d::handle_state_change, this)); panner->StateChanged.connect (state_connection, boost::bind (&Panner2d::handle_state_change, this), gui_context());
panner->Changed.connect (change_connection, boost::bind (&Panner2d::handle_position_change, this)); panner->Changed.connect (change_connection, boost::bind (&Panner2d::handle_position_change, this), gui_context());
drag_target = 0; drag_target = 0;
set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK); set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);

View file

@ -151,9 +151,9 @@ PannerUI::set_panner (boost::shared_ptr<Panner> p)
return; return;
} }
_panner->Changed.connect (connections, boost::bind (&PannerUI::panner_changed, this)); _panner->Changed.connect (connections, boost::bind (&PannerUI::panner_changed, this), gui_context());
_panner->LinkStateChanged.connect (connections, boost::bind (&PannerUI::update_pan_linkage, this)); _panner->LinkStateChanged.connect (connections, boost::bind (&PannerUI::update_pan_linkage, this), gui_context());
_panner->StateChanged.connect (connections, boost::bind (&PannerUI::update_pan_state, this)); _panner->StateChanged.connect (connections, boost::bind (&PannerUI::update_pan_state, this), gui_context());
setup_pan (); setup_pan ();
@ -404,7 +404,7 @@ PannerUI::setup_pan ()
pan_adjustments.back()->set_value(rx); pan_adjustments.back()->set_value(rx);
pan_adjustments.back()->signal_value_changed().connect (sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_adjustment_changed), (uint32_t) asz)); pan_adjustments.back()->signal_value_changed().connect (sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_adjustment_changed), (uint32_t) asz));
_panner->pan_control( asz )->Changed.connect (connections, boost::bind (&PannerUI::pan_value_changed, this, (uint32_t) asz)); _panner->pan_control( asz )->Changed.connect (connections, boost::bind (&PannerUI::pan_value_changed, this, (uint32_t) asz), gui_context());
bc->set_name ("PanSlider"); bc->set_name ("PanSlider");
bc->set_shadow_type (Gtk::SHADOW_NONE); bc->set_shadow_type (Gtk::SHADOW_NONE);

View file

@ -115,7 +115,7 @@ PluginEqGui::PluginEqGui(boost::shared_ptr<ARDOUR::PluginInsert> pluginInsert)
// Connect the realtime signal collection callback // Connect the realtime signal collection callback
_plugin_insert->AnalysisDataGathered.connect (analysis_connection, boost::bind (&PluginEqGui::signal_collect_callback, this, _1, _2)); _plugin_insert->AnalysisDataGathered.connect (analysis_connection, ui_bind (&PluginEqGui::signal_collect_callback, this, _1, _2), gui_context());
} }
PluginEqGui::~PluginEqGui() PluginEqGui::~PluginEqGui()

View file

@ -74,7 +74,7 @@ PluginSelector::PluginSelector (PluginManager *mgr)
manager = mgr; manager = mgr;
in_row_change = false; in_row_change = false;
manager->PluginListChanged.connect (plugin_list_changed_connection, boost::bind (&PluginSelector::build_plugin_menu, this)); manager->PluginListChanged.connect (plugin_list_changed_connection, boost::bind (&PluginSelector::build_plugin_menu, this), gui_context());
build_plugin_menu (); build_plugin_menu ();
plugin_model = Gtk::ListStore::create (plugin_columns); plugin_model = Gtk::ListStore::create (plugin_columns);

View file

@ -142,7 +142,7 @@ PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr<PluginInsert
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK); add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window*> (this)), false); signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window*> (this)), false);
insert->GoingAway.connect (death_connection, boost::bind (&PluginUIWindow::plugin_going_away, this)); insert->GoingAway.connect (death_connection, boost::bind (&PluginUIWindow::plugin_going_away, this), gui_context());
gint h = _pluginui->get_preferred_height (); gint h = _pluginui->get_preferred_height ();
gint w = _pluginui->get_preferred_width (); gint w = _pluginui->get_preferred_width ();
@ -390,7 +390,7 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi)
save_button.set_name ("PluginSaveButton"); save_button.set_name ("PluginSaveButton");
save_button.signal_clicked().connect(sigc::mem_fun(*this, &PlugUIBase::save_plugin_setting)); save_button.signal_clicked().connect(sigc::mem_fun(*this, &PlugUIBase::save_plugin_setting));
insert->ActiveChanged.connect (active_connection, boost::bind (&PlugUIBase::processor_active_changed, this, boost::weak_ptr<Processor>(insert))); insert->ActiveChanged.connect (active_connection, boost::bind (&PlugUIBase::processor_active_changed, this, boost::weak_ptr<Processor>(insert)), gui_context());
bypass_button.set_active (!pi->active()); bypass_button.set_active (!pi->active());
@ -414,7 +414,7 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi)
plugin_analysis_expander.property_expanded().signal_changed().connect( sigc::mem_fun(*this, &PlugUIBase::toggle_plugin_analysis)); plugin_analysis_expander.property_expanded().signal_changed().connect( sigc::mem_fun(*this, &PlugUIBase::toggle_plugin_analysis));
plugin_analysis_expander.set_expanded(false); plugin_analysis_expander.set_expanded(false);
insert->GoingAway.connect (death_connection, boost::bind (&PlugUIBase::plugin_going_away, this)); insert->GoingAway.connect (death_connection, boost::bind (&PlugUIBase::plugin_going_away, this), gui_context());
} }
PlugUIBase::~PlugUIBase() PlugUIBase::~PlugUIBase()

View file

@ -264,7 +264,7 @@ class PluginUIWindow : public Gtk::Window
private: private:
Glib::ustring _title; Glib::ustring _title;
PlugUIBase* _pluginui; PlugUIBase* _pluginui;
boost::signals2::scoped_connection death_connection; PBD::ScopedConnection death_connection;
Gtk::Window* parent; Gtk::Window* parent;
Gtk::VBox vbox; Gtk::VBox vbox;
bool non_gtk_gui; bool non_gtk_gui;

View file

@ -30,6 +30,7 @@
#include "ardour/session.h" #include "ardour/session.h"
#include "ardour/auditioner.h" #include "ardour/auditioner.h"
#include "gui_thread.h"
#include "port_group.h" #include "port_group.h"
#include "port_matrix.h" #include "port_matrix.h"
#include "time_axis_view.h" #include "time_axis_view.h"
@ -116,7 +117,7 @@ PortGroup::add_bundle_internal (boost::shared_ptr<Bundle> b, boost::shared_ptr<I
} }
BundleRecord* br = new BundleRecord (b, io, colour, has_colour); BundleRecord* br = new BundleRecord (b, io, colour, has_colour);
b->Changed.connect (br->changed_connection, boost::bind (&PortGroup::bundle_changed, this, _1)); b->Changed.connect (br->changed_connection, ui_bind (&PortGroup::bundle_changed, this, _1), gui_context());
_bundles.push_back (br); _bundles.push_back (br);
Changed (); Changed ();
@ -521,8 +522,8 @@ PortGroupList::add_group (boost::shared_ptr<PortGroup> g)
{ {
_groups.push_back (g); _groups.push_back (g);
g->Changed.connect (_changed_connections, boost::bind (&PortGroupList::emit_changed, this)); g->Changed.connect (_changed_connections, boost::bind (&PortGroupList::emit_changed, this), gui_context());
g->BundleChanged.connect (_bundle_changed_connections, boost::bind (&PortGroupList::emit_bundle_changed, this, _1)); g->BundleChanged.connect (_bundle_changed_connections, ui_bind (&PortGroupList::emit_bundle_changed, this, _1), gui_context());
emit_changed (); emit_changed ();
} }

View file

@ -78,7 +78,7 @@ public:
boost::shared_ptr<ARDOUR::IO> io; boost::shared_ptr<ARDOUR::IO> io;
Gdk::Color colour; Gdk::Color colour;
bool has_colour; bool has_colour;
boost::signals2::scoped_connection changed_connection; PBD::ScopedConnection changed_connection;
BundleRecord (boost::shared_ptr<ARDOUR::Bundle>, boost::shared_ptr<ARDOUR::IO>, Gdk::Color, bool has_colour); BundleRecord (boost::shared_ptr<ARDOUR::Bundle>, boost::shared_ptr<ARDOUR::IO>, Gdk::Color, bool has_colour);
}; };

View file

@ -135,10 +135,10 @@ PortMatrix::init ()
for (int i = 0; i < 2; ++i) { for (int i = 0; i < 2; ++i) {
/* watch for the content of _ports[] changing */ /* watch for the content of _ports[] changing */
_ports[i].Changed.connect (_changed_connections, boost::bind (&PortMatrix::setup, this)); _ports[i].Changed.connect (_changed_connections, boost::bind (&PortMatrix::setup, this), gui_context());
/* and for bundles in _ports[] changing */ /* and for bundles in _ports[] changing */
_ports[i].BundleChanged.connect (_bundle_changed_connections, boost::bind (&PortMatrix::setup, this)); _ports[i].BundleChanged.connect (_bundle_changed_connections, boost::bind (&PortMatrix::setup, this), gui_context());
} }
/* scrolling stuff */ /* scrolling stuff */
@ -149,13 +149,13 @@ PortMatrix::init ()
/* Part 2: notice when things have changed that require our subclass to clear and refill _ports[] */ /* Part 2: notice when things have changed that require our subclass to clear and refill _ports[] */
/* watch for routes being added or removed */ /* watch for routes being added or removed */
_session->RouteAdded.connect (_session_connections, boost::bind (&PortMatrix::routes_changed, this)); _session->RouteAdded.connect (_session_connections, boost::bind (&PortMatrix::routes_changed, this), gui_context());
/* and also bundles */ /* and also bundles */
_session->BundleAdded.connect (_session_connections, boost::bind (&PortMatrix::setup_global_ports, this)); _session->BundleAdded.connect (_session_connections, boost::bind (&PortMatrix::setup_global_ports, this), gui_context());
/* and also ports */ /* and also ports */
_session->engine().PortRegisteredOrUnregistered.connect (_session_connections, boost::bind (&PortMatrix::setup_global_ports, this)); _session->engine().PortRegisteredOrUnregistered.connect (_session_connections, boost::bind (&PortMatrix::setup_global_ports, this), gui_context());
reconnect_to_routes (); reconnect_to_routes ();
@ -170,7 +170,7 @@ PortMatrix::reconnect_to_routes ()
boost::shared_ptr<RouteList> routes = _session->get_routes (); boost::shared_ptr<RouteList> routes = _session->get_routes ();
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) { for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
(*i)->processors_changed.connect (_route_connections, boost::bind (&PortMatrix::route_processors_changed, this, _1)); (*i)->processors_changed.connect (_route_connections, ui_bind (&PortMatrix::route_processors_changed, this, _1), gui_context());
} }
} }

View file

@ -20,6 +20,8 @@
#include <iostream> #include <iostream>
#include "ardour/bundle.h" #include "ardour/bundle.h"
#include "ardour/types.h" #include "ardour/types.h"
#include "gui_thread.h"
#include "port_matrix_body.h" #include "port_matrix_body.h"
#include "port_matrix.h" #include "port_matrix.h"
#include "port_matrix_column_labels.h" #include "port_matrix_column_labels.h"
@ -254,7 +256,7 @@ PortMatrixBody::setup ()
PortGroup::BundleList r = _matrix->visible_rows()->bundles (); PortGroup::BundleList r = _matrix->visible_rows()->bundles ();
for (PortGroup::BundleList::iterator i = r.begin(); i != r.end(); ++i) { for (PortGroup::BundleList::iterator i = r.begin(); i != r.end(); ++i) {
(*i)->bundle->Changed.connect (_bundle_connections, boost::bind (&PortMatrixBody::rebuild_and_draw_row_labels, this)); (*i)->bundle->Changed.connect (_bundle_connections, boost::bind (&PortMatrixBody::rebuild_and_draw_row_labels, this), gui_context());
} }
} }
@ -262,7 +264,7 @@ PortMatrixBody::setup ()
if (_matrix->visible_columns()) { if (_matrix->visible_columns()) {
PortGroup::BundleList c = _matrix->visible_columns()->bundles (); PortGroup::BundleList c = _matrix->visible_columns()->bundles ();
for (PortGroup::BundleList::iterator i = c.begin(); i != c.end(); ++i) { for (PortGroup::BundleList::iterator i = c.begin(); i != c.end(); ++i) {
(*i)->bundle->Changed.connect (_bundle_connections, boost::bind (&PortMatrixBody::rebuild_and_draw_column_labels, this)); (*i)->bundle->Changed.connect (_bundle_connections, boost::bind (&PortMatrixBody::rebuild_and_draw_column_labels, this), gui_context());
} }
} }

View file

@ -106,8 +106,8 @@ ProcessorEntry::ProcessorEntry (boost::shared_ptr<Processor> p, Width w)
_active.set_active (_processor->active ()); _active.set_active (_processor->active ());
_active.signal_toggled().connect (sigc::mem_fun (*this, &ProcessorEntry::active_toggled)); _active.signal_toggled().connect (sigc::mem_fun (*this, &ProcessorEntry::active_toggled));
_processor->ActiveChanged.connect (active_connection, boost::bind (&ProcessorEntry::processor_active_changed, this)); _processor->ActiveChanged.connect (active_connection, boost::bind (&ProcessorEntry::processor_active_changed, this), gui_context());
_processor->NameChanged.connect (name_connection, boost::bind (&ProcessorEntry::processor_name_changed, this)); _processor->NameChanged.connect (name_connection, boost::bind (&ProcessorEntry::processor_name_changed, this), gui_context());
} }
EventBox& EventBox&
@ -229,7 +229,7 @@ SendProcessorEntry::SendProcessorEntry (boost::shared_ptr<Send> s, Width w)
_vbox.pack_start (_fader); _vbox.pack_start (_fader);
_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &SendProcessorEntry::gain_adjusted)); _adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &SendProcessorEntry::gain_adjusted));
_send->amp()->gain_control()->Changed.connect (send_gain_connection, boost::bind (&SendProcessorEntry::show_gain, this)); _send->amp()->gain_control()->Changed.connect (send_gain_connection, boost::bind (&SendProcessorEntry::show_gain, this), gui_context());
show_gain (); show_gain ();
} }
@ -326,9 +326,9 @@ ProcessorBox::set_route (boost::shared_ptr<Route> r)
no_processor_redisplay = false; no_processor_redisplay = false;
_route = r; _route = r;
_route->processors_changed.connect (connections, boost::bind (&ProcessorBox::route_processors_changed, this, _1)); _route->processors_changed.connect (connections, ui_bind (&ProcessorBox::route_processors_changed, this, _1), gui_context());
_route->GoingAway.connect (connections, boost::bind (&ProcessorBox::route_going_away, this)); _route->GoingAway.connect (connections, boost::bind (&ProcessorBox::route_going_away, this), gui_context());
_route->NameChanged.connect (connections, boost::bind (&ProcessorBox::route_name_changed, this)); _route->NameChanged.connect (connections, boost::bind (&ProcessorBox::route_name_changed, this), gui_context());
redisplay_processors (); redisplay_processors ();
} }

View file

@ -10,6 +10,8 @@
#include "ardour/rc_configuration.h" #include "ardour/rc_configuration.h"
#include "ardour/control_protocol_manager.h" #include "ardour/control_protocol_manager.h"
#include "control_protocol/control_protocol.h" #include "control_protocol/control_protocol.h"
#include "gui_thread.h"
#include "rc_option_editor.h" #include "rc_option_editor.h"
#include "utils.h" #include "utils.h"
#include "midi_port_dialog.h" #include "midi_port_dialog.h"
@ -117,7 +119,7 @@ private:
if ((*i)->input()) { if ((*i)->input()) {
r[_model.online] = !(*i)->input()->offline(); r[_model.online] = !(*i)->input()->offline();
(*i)->input()->OfflineStatusChanged.connect (port_connections, boost::bind (&MIDIPorts::port_offline_changed, this, (*i))); (*i)->input()->OfflineStatusChanged.connect (port_connections, boost::bind (&MIDIPorts::port_offline_changed, this, (*i)), gui_context());
r[_model.trace_input] = (*i)->input()->tracing(); r[_model.trace_input] = (*i)->input()->tracing();
} }

View file

@ -20,6 +20,7 @@
#include "ardour/region.h" #include "ardour/region.h"
#include "gui_thread.h"
#include "region_view.h" #include "region_view.h"
#include "region_selection.h" #include "region_selection.h"
#include "time_axis_view.h" #include "time_axis_view.h"
@ -32,7 +33,7 @@ using namespace PBD;
*/ */
RegionSelection::RegionSelection () RegionSelection::RegionSelection ()
{ {
RegionView::RegionViewGoingAway.connect (death_connection, boost::bind (&RegionSelection::remove_it, this, _1)); RegionView::RegionViewGoingAway.connect (death_connection, ui_bind (&RegionSelection::remove_it, this, _1), gui_context());
_current_start = 0; _current_start = 0;
_current_end = 0; _current_end = 0;
@ -44,7 +45,7 @@ RegionSelection::RegionSelection ()
RegionSelection::RegionSelection (const RegionSelection& other) RegionSelection::RegionSelection (const RegionSelection& other)
: std::list<RegionView*>() : std::list<RegionView*>()
{ {
RegionView::RegionViewGoingAway.connect (death_connection, boost::bind (&RegionSelection::remove_it, this, _1)); RegionView::RegionViewGoingAway.connect (death_connection, ui_bind (&RegionSelection::remove_it, this, _1), gui_context());
_current_start = other._current_start; _current_start = other._current_start;
_current_end = other._current_end; _current_end = other._current_end;

View file

@ -22,8 +22,7 @@
#include <set> #include <set>
#include <list> #include <list>
#include <boost/signals2.hpp> #include "pbd/signals.h"
#include "ardour/types.h" #include "ardour/types.h"
class RegionView; class RegionView;
@ -71,7 +70,7 @@ class RegionSelection : public std::list<RegionView*>
nframes_t _current_end; ///< end position for the selection nframes_t _current_end; ///< end position for the selection
std::list<RegionView *> _bylayer; ///< list of regions sorted by layer std::list<RegionView *> _bylayer; ///< list of regions sorted by layer
boost::signals2::scoped_connection death_connection; PBD::ScopedConnection death_connection;
}; };
#endif /* __ardour_gtk_region_selection_h__ */ #endif /* __ardour_gtk_region_selection_h__ */

View file

@ -178,7 +178,7 @@ RegionView::init (Gdk::Color const & basic_color, bool wfd)
set_height (trackview.current_height()); set_height (trackview.current_height());
_region->StateChanged.connect (*this, boost::bind (&RegionView::region_changed, this, _1)); _region->StateChanged.connect (*this, ui_bind (&RegionView::region_changed, this, _1), gui_context());
group->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_event), group, this)); group->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_event), group, this));

View file

@ -57,7 +57,7 @@ ReturnUI::ReturnUI (Gtk::Window* parent, boost::shared_ptr<Return> r, Session* s
show_all (); show_all ();
_return->set_metering (true); _return->set_metering (true);
_return->input()->changed.connect (input_change_connection, boost::bind (&ReturnUI::ins_changed, this, _1, _2)); _return->input()->changed.connect (input_change_connection, ui_bind (&ReturnUI::ins_changed, this, _1, _2), gui_context());
_gpm.setup_meters (); _gpm.setup_meters ();
_gpm.set_fader_name ("ReturnUIFrame"); _gpm.set_fader_name ("ReturnUIFrame");
@ -110,7 +110,7 @@ ReturnUIWindow::ReturnUIWindow (boost::shared_ptr<Return> r, ARDOUR::Session* s)
set_name ("ReturnUIWindow"); set_name ("ReturnUIWindow");
r->GoingAway.connect (going_away_connection, boost::bind (&ReturnUIWindow::return_going_away, this)); r->GoingAway.connect (going_away_connection, boost::bind (&ReturnUIWindow::return_going_away, this), gui_context());
signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window *> (this))); signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window *> (this)));
} }

View file

@ -69,7 +69,7 @@ class ReturnUIWindow : public ArdourDialog
Gtk::HBox hpacker; Gtk::HBox hpacker;
void return_going_away (); void return_going_away ();
boost::signals2::scoped_connection going_away_connection; PBD::ScopedConnection going_away_connection;
}; };
#endif /* __ardour_gtk_return_ui_h__ */ #endif /* __ardour_gtk_return_ui_h__ */

View file

@ -181,8 +181,8 @@ RouteParams_UI::add_routes (RouteList& routes)
//route_select_list.rows().back().select (); //route_select_list.rows().back().select ();
route->NameChanged.connect (*this, boost::bind (&RouteParams_UI::route_name_changed, this, boost::weak_ptr<Route>(route))); route->NameChanged.connect (*this, boost::bind (&RouteParams_UI::route_name_changed, this, boost::weak_ptr<Route>(route)), gui_context());
route->GoingAway.connect (*this, boost::bind (&RouteParams_UI::route_removed, this, boost::weak_ptr<Route>(route))); route->GoingAway.connect (*this, boost::bind (&RouteParams_UI::route_removed, this, boost::weak_ptr<Route>(route)), gui_context());
} }
} }
@ -293,8 +293,8 @@ RouteParams_UI::setup_latency_frame ()
latency_packer.pack_start (delay_label); latency_packer.pack_start (delay_label);
latency_click_connection = latency_apply_button.signal_clicked().connect (sigc::mem_fun (*latency_widget, &LatencyGUI::finish)); latency_click_connection = latency_apply_button.signal_clicked().connect (sigc::mem_fun (*latency_widget, &LatencyGUI::finish));
_route->signal_latency_changed.connect (latency_connections, sigc::mem_fun (*this, &RouteParams_UI::refresh_latency)); _route->signal_latency_changed.connect (latency_connections, boost::bind (&RouteParams_UI::refresh_latency, this), gui_context());
_route->initial_delay_changed.connect (latency_connections, sigc::mem_fun (*this, &RouteParams_UI::refresh_latency)); _route->initial_delay_changed.connect (latency_connections, boost::bind (&RouteParams_UI::refresh_latency, this), gui_context());
latency_frame.add (latency_packer); latency_frame.add (latency_packer);
latency_frame.show_all (); latency_frame.show_all ();
@ -399,7 +399,7 @@ RouteParams_UI::set_session (Session *sess)
if (_session) { if (_session) {
boost::shared_ptr<RouteList> r = _session->get_routes(); boost::shared_ptr<RouteList> r = _session->get_routes();
add_routes (*r); add_routes (*r);
_session->RouteAdded.connect (_session_connections, sigc::mem_fun(*this, &RouteParams_UI::add_routes)); _session->RouteAdded.connect (_session_connections, ui_bind (&RouteParams_UI::add_routes, this, _1), gui_context());
start_updating (); start_updating ();
} else { } else {
stop_updating (); stop_updating ();
@ -458,7 +458,7 @@ RouteParams_UI::route_selected()
setup_processor_boxes(); setup_processor_boxes();
setup_latency_frame (); setup_latency_frame ();
route->processors_changed.connect (_route_processors_connection, boost::bind (&RouteParams_UI::processors_changed, this, _1)); route->processors_changed.connect (_route_processors_connection, ui_bind (&RouteParams_UI::processors_changed, this, _1), gui_context());
track_input_label.set_text (_route->name()); track_input_label.set_text (_route->name());
@ -522,7 +522,7 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> proc)
SendUI *send_ui = new SendUI (this, send, _session); SendUI *send_ui = new SendUI (this, send, _session);
cleanup_view(); cleanup_view();
send->GoingAway.connect (_processor_going_away_connection, boost::bind (&RouteParams_UI::processor_going_away, this, boost::weak_ptr<Processor>(proc))); send->GoingAway.connect (_processor_going_away_connection, boost::bind (&RouteParams_UI::processor_going_away, this, boost::weak_ptr<Processor>(proc)), gui_context());
_active_view = send_ui; _active_view = send_ui;
redir_hpane.add2 (*_active_view); redir_hpane.add2 (*_active_view);
@ -533,7 +533,7 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> proc)
ReturnUI *return_ui = new ReturnUI (this, retrn, _session); ReturnUI *return_ui = new ReturnUI (this, retrn, _session);
cleanup_view(); cleanup_view();
retrn->GoingAway.connect (_processor_going_away_connection, boost::bind (&RouteParams_UI::processor_going_away, this, boost::weak_ptr<Processor>(proc))); retrn->GoingAway.connect (_processor_going_away_connection, boost::bind (&RouteParams_UI::processor_going_away, this, boost::weak_ptr<Processor>(proc)), gui_context());
_active_view = return_ui; _active_view = return_ui;
redir_hpane.add2 (*_active_view); redir_hpane.add2 (*_active_view);
@ -544,7 +544,7 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> proc)
GenericPluginUI *plugin_ui = new GenericPluginUI (plugin_insert, true); GenericPluginUI *plugin_ui = new GenericPluginUI (plugin_insert, true);
cleanup_view(); cleanup_view();
plugin_insert->plugin()->GoingAway.connect (_processor_going_away_connection, boost::bind (&RouteParams_UI::plugin_going_away, this, PreFader)); plugin_insert->plugin()->GoingAway.connect (_processor_going_away_connection, boost::bind (&RouteParams_UI::plugin_going_away, this, PreFader), gui_context());
plugin_ui->start_updating (0); plugin_ui->start_updating (0);
_active_view = plugin_ui; _active_view = plugin_ui;
@ -556,7 +556,7 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> proc)
PortInsertUI *portinsert_ui = new PortInsertUI (this, _session, port_insert); PortInsertUI *portinsert_ui = new PortInsertUI (this, _session, port_insert);
cleanup_view(); cleanup_view();
port_insert->GoingAway.connect (_processor_going_away_connection, boost::bind (&RouteParams_UI::processor_going_away, this, boost::weak_ptr<Processor> (proc))); port_insert->GoingAway.connect (_processor_going_away_connection, boost::bind (&RouteParams_UI::processor_going_away, this, boost::weak_ptr<Processor> (proc)), gui_context());
_active_view = portinsert_ui; _active_view = portinsert_ui;
redir_hpane.pack2 (*_active_view); redir_hpane.pack2 (*_active_view);

View file

@ -126,10 +126,10 @@ class RouteParams_UI : public ArdourDialog, public PBD::ScopedConnectionList
RouteRedirectSelection _rr_selection; RouteRedirectSelection _rr_selection;
boost::shared_ptr<ARDOUR::Route> _route; boost::shared_ptr<ARDOUR::Route> _route;
boost::signals2::scoped_connection _route_processors_connection; PBD::ScopedConnection _route_processors_connection;
boost::shared_ptr<ARDOUR::Processor> _processor; boost::shared_ptr<ARDOUR::Processor> _processor;
boost::signals2::scoped_connection _processor_going_away_connection; PBD::ScopedConnection _processor_going_away_connection;
enum ConfigView { enum ConfigView {

View file

@ -94,7 +94,7 @@ RouteRedirectSelection::add (boost::shared_ptr<Route> r)
{ {
if (find (routes.begin(), routes.end(), r) == routes.end()) { if (find (routes.begin(), routes.end(), r) == routes.end()) {
routes.push_back (r); routes.push_back (r);
r->GoingAway.connect (*this, boost::bind (&RouteRedirectSelection::removed, this, boost::weak_ptr<Route>(r))); r->GoingAway.connect (*this, boost::bind (&RouteRedirectSelection::removed, this, boost::weak_ptr<Route>(r)), gui_context());
RoutesChanged(); RoutesChanged();
} }
} }

View file

@ -193,9 +193,9 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, boost::sh
} }
controls_hbox.pack_start(gm.get_level_meter(), false, false); controls_hbox.pack_start(gm.get_level_meter(), false, false);
_route->meter_change.connect (*this, boost::bind (&RouteTimeAxisView::meter_changed, this, _1)); _route->meter_change.connect (*this, ui_bind (&RouteTimeAxisView::meter_changed, this, _1), gui_context());
_route->input()->changed.connect (*this, boost::bind (&RouteTimeAxisView::io_changed, this, _1, _2)); _route->input()->changed.connect (*this, ui_bind (&RouteTimeAxisView::io_changed, this, _1, _2), gui_context());
_route->output()->changed.connect (*this, boost::bind (&RouteTimeAxisView::io_changed, this, _1, _2)); _route->output()->changed.connect (*this, ui_bind (&RouteTimeAxisView::io_changed, this, _1, _2), gui_context());
controls_table.attach (*mute_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0); controls_table.attach (*mute_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
controls_table.attach (*solo_button, 7, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0); controls_table.attach (*solo_button, 7, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
@ -234,19 +234,19 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, boost::sh
_y_position = -1; _y_position = -1;
_route->mute_changed.connect (*this, boost::bind (&RouteUI::mute_changed, this, _1)); _route->mute_changed.connect (*this, ui_bind (&RouteUI::mute_changed, this, _1), gui_context());
_route->solo_changed.connect (*this, boost::bind (&RouteUI::solo_changed, this, _1)); _route->solo_changed.connect (*this, ui_bind (&RouteUI::solo_changed, this, _1), gui_context());
_route->processors_changed.connect (*this, boost::bind (&RouteTimeAxisView::processors_changed, this, _1)); _route->processors_changed.connect (*this, ui_bind (&RouteTimeAxisView::processors_changed, this, _1), gui_context());
_route->NameChanged.connect (*this, boost::bind (&RouteTimeAxisView::route_name_changed, this)); _route->NameChanged.connect (*this, boost::bind (&RouteTimeAxisView::route_name_changed, this), gui_context());
_route->solo_isolated_changed.connect (*this, boost::bind (&RouteUI::solo_changed, this, _1)); _route->solo_isolated_changed.connect (*this, ui_bind (&RouteUI::solo_changed, this, _1), gui_context());
if (is_track()) { if (is_track()) {
track()->TrackModeChanged.connect (*this, boost::bind (&RouteTimeAxisView::track_mode_changed, this)); track()->TrackModeChanged.connect (*this, boost::bind (&RouteTimeAxisView::track_mode_changed, this), gui_context());
track()->FreezeChange.connect (*this, boost::bind (&RouteTimeAxisView::map_frozen, this)); track()->FreezeChange.connect (*this, boost::bind (&RouteTimeAxisView::map_frozen, this), gui_context());
track()->DiskstreamChanged.connect (*this, boost::bind (&RouteTimeAxisView::diskstream_changed, this)); track()->DiskstreamChanged.connect (*this, boost::bind (&RouteTimeAxisView::diskstream_changed, this), gui_context());
get_diskstream()->SpeedChanged.connect (*this, boost::bind (&RouteTimeAxisView::speed_changed, this)); get_diskstream()->SpeedChanged.connect (*this, boost::bind (&RouteTimeAxisView::speed_changed, this), gui_context());
/* pick up the correct freeze state */ /* pick up the correct freeze state */
map_frozen (); map_frozen ();
@ -532,7 +532,7 @@ RouteTimeAxisView::build_display_menu ()
if (!Profile->get_sae()) { if (!Profile->get_sae()) {
items.push_back (MenuElem (_("Alignment"), *alignment_menu)); items.push_back (MenuElem (_("Alignment"), *alignment_menu));
get_diskstream()->AlignmentStyleChanged.connect (route_connections, boost::bind (&RouteTimeAxisView::align_style_changed, this)); get_diskstream()->AlignmentStyleChanged.connect (route_connections, boost::bind (&RouteTimeAxisView::align_style_changed, this), gui_context());
RadioMenuItem::Group mode_group; RadioMenuItem::Group mode_group;
items.push_back (RadioMenuElem (mode_group, _("Normal mode"), sigc::bind ( items.push_back (RadioMenuElem (mode_group, _("Normal mode"), sigc::bind (
@ -564,7 +564,7 @@ RouteTimeAxisView::build_display_menu ()
} }
} }
get_diskstream()->AlignmentStyleChanged.connect (route_connections, boost::bind (&RouteTimeAxisView::align_style_changed, this)); get_diskstream()->AlignmentStyleChanged.connect (route_connections, boost::bind (&RouteTimeAxisView::align_style_changed, this), gui_context());
mode_menu = build_mode_menu(); mode_menu = build_mode_menu();
if (mode_menu) if (mode_menu)

View file

@ -136,11 +136,11 @@ RouteUI::init ()
show_sends_button->set_self_managed (true); show_sends_button->set_self_managed (true);
UI::instance()->set_tip (show_sends_button, _("make mixer strips show sends to this bus"), ""); UI::instance()->set_tip (show_sends_button, _("make mixer strips show sends to this bus"), "");
_session->SoloChanged.connect (_session_connections, sigc::mem_fun(*this, &RouteUI::solo_changed_so_update_mute)); _session->SoloChanged.connect (_session_connections, boost::bind (&RouteUI::solo_changed_so_update_mute, this), gui_context());
_session->TransportStateChange.connect (_session_connections, sigc::mem_fun (*this, &RouteUI::check_rec_enable_sensitivity)); _session->TransportStateChange.connect (_session_connections, boost::bind (&RouteUI::check_rec_enable_sensitivity, this), gui_context());
_session->RecordStateChanged.connect (_session_connections, boost::bind (&RouteUI::session_rec_enable_changed, this)); _session->RecordStateChanged.connect (_session_connections, boost::bind (&RouteUI::session_rec_enable_changed, this), gui_context());
Config->ParameterChanged.connect (*this, boost::bind (&RouteUI::parameter_changed, this, _1)); Config->ParameterChanged.connect (*this, ui_bind (&RouteUI::parameter_changed, this, _1), gui_context());
} }
void void
@ -188,22 +188,22 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
} }
if (self_destruct) { if (self_destruct) {
rp->GoingAway.connect (route_connections, boost::bind (&RouteUI::self_delete, this)); rp->GoingAway.connect (route_connections, boost::bind (&RouteUI::self_delete, this), gui_context());
} }
mute_button->set_controllable (_route->mute_control()); mute_button->set_controllable (_route->mute_control());
solo_button->set_controllable (_route->solo_control()); solo_button->set_controllable (_route->solo_control());
_route->active_changed.connect (route_connections, boost::bind (&RouteUI::route_active_changed, this)); _route->active_changed.connect (route_connections, boost::bind (&RouteUI::route_active_changed, this), gui_context());
_route->mute_changed.connect (route_connections, boost::bind (&RouteUI::mute_changed, this, _1)); _route->mute_changed.connect (route_connections, ui_bind (&RouteUI::mute_changed, this, _1), gui_context());
_route->solo_changed.connect (route_connections, boost::bind (&RouteUI::solo_changed, this, _1)); _route->solo_changed.connect (route_connections, ui_bind (&RouteUI::solo_changed, this, _1), gui_context());
_route->listen_changed.connect (route_connections, boost::bind (&RouteUI::listen_changed, this, _1)); _route->listen_changed.connect (route_connections, ui_bind (&RouteUI::listen_changed, this, _1), gui_context());
_route->solo_isolated_changed.connect (route_connections, boost::bind (&RouteUI::solo_changed, this, _1)); _route->solo_isolated_changed.connect (route_connections, ui_bind (&RouteUI::solo_changed, this, _1), gui_context());
if (_session->writable() && is_track()) { if (_session->writable() && is_track()) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(_route); boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(_route);
t->diskstream()->RecordEnableChanged.connect (route_connections, boost::bind (&RouteUI::route_rec_enable_changed, this)); t->diskstream()->RecordEnableChanged.connect (route_connections, boost::bind (&RouteUI::route_rec_enable_changed, this), gui_context());
rec_enable_button->show(); rec_enable_button->show();
rec_enable_button->set_controllable (t->rec_enable_control()); rec_enable_button->set_controllable (t->rec_enable_control());
@ -893,14 +893,14 @@ RouteUI::build_solo_menu (void)
check = new CheckMenuItem(_("Solo Isolate")); check = new CheckMenuItem(_("Solo Isolate"));
check->set_active (_route->solo_isolated()); check->set_active (_route->solo_isolated());
check->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_solo_isolated), check)); check->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_solo_isolated), check));
_route->solo_isolated_changed.connect (route_connections, boost::bind (&RouteUI::solo_isolated_toggle, this, _1, check)); _route->solo_isolated_changed.connect (route_connections, ui_bind (&RouteUI::solo_isolated_toggle, this, _1, check), gui_context());
items.push_back (CheckMenuElem(*check)); items.push_back (CheckMenuElem(*check));
check->show_all(); check->show_all();
check = new CheckMenuItem(_("Solo Safe")); check = new CheckMenuItem(_("Solo Safe"));
check->set_active (_route->solo_safe()); check->set_active (_route->solo_safe());
check->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_solo_safe), check)); check->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_solo_safe), check));
_route->solo_safe_changed.connect (route_connections, boost::bind (&RouteUI::solo_safe_toggle, this, _1, check)); _route->solo_safe_changed.connect (route_connections, ui_bind (&RouteUI::solo_safe_toggle, this, _1, check), gui_context());
items.push_back (CheckMenuElem(*check)); items.push_back (CheckMenuElem(*check));
check->show_all(); check->show_all();
@ -946,7 +946,7 @@ RouteUI::build_mute_menu(void)
//items.push_back (SeparatorElem()); //items.push_back (SeparatorElem());
// items.push_back (MenuElem (_("MIDI Bind"), sigc::mem_fun (*mute_button, &BindableToggleButton::midi_learn))); // items.push_back (MenuElem (_("MIDI Bind"), sigc::mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
_route->mute_points_changed.connect (route_connections, boost::bind (&RouteUI::muting_change, this)); _route->mute_points_changed.connect (route_connections, boost::bind (&RouteUI::muting_change, this), gui_context());
} }
void void

View file

@ -25,6 +25,7 @@
#include "ardour/playlist.h" #include "ardour/playlist.h"
#include "ardour/rc_configuration.h" #include "ardour/rc_configuration.h"
#include "gui_thread.h"
#include "midi_cut_buffer.h" #include "midi_cut_buffer.h"
#include "region_view.h" #include "region_view.h"
#include "selection.h" #include "selection.h"
@ -209,7 +210,7 @@ Selection::toggle (TimeAxisView* track)
if ((i = find (tracks.begin(), tracks.end(), track)) == tracks.end()) { if ((i = find (tracks.begin(), tracks.end(), track)) == tracks.end()) {
void (Selection::*pmf)(TimeAxisView*) = &Selection::remove; void (Selection::*pmf)(TimeAxisView*) = &Selection::remove;
track->GoingAway.connect (*this, boost::bind (pmf, this, track)); track->GoingAway.connect (*this, boost::bind (pmf, this, track), gui_context());
tracks.push_back (track); tracks.push_back (track);
} else { } else {
tracks.erase (i); tracks.erase (i);
@ -338,7 +339,7 @@ Selection::add (const TrackViewList& track_list)
for (list<TimeAxisView*>::const_iterator i = added.begin(); i != added.end(); ++i) { for (list<TimeAxisView*>::const_iterator i = added.begin(); i != added.end(); ++i) {
void (Selection::*pmf)(TimeAxisView*) = &Selection::remove; void (Selection::*pmf)(TimeAxisView*) = &Selection::remove;
(*i)->GoingAway.connect (*this, boost::bind (pmf, this, (*i))); (*i)->GoingAway.connect (*this, boost::bind (pmf, this, (*i)), gui_context());
} }
if (!added.empty()) { if (!added.empty()) {
@ -949,7 +950,7 @@ Selection::add (Marker* m)
void (Selection::*pmf)(Marker*) = &Selection::remove; void (Selection::*pmf)(Marker*) = &Selection::remove;
m->GoingAway.connect (*this, boost::bind (pmf, this, m)); m->GoingAway.connect (*this, boost::bind (pmf, this, m), gui_context());
markers.push_back (m); markers.push_back (m);
MarkersChanged(); MarkersChanged();

View file

@ -61,8 +61,8 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session
_send->set_metering (true); _send->set_metering (true);
_send->input()->changed.connect (connections, boost::bind (&SendUI::ins_changed, this, _1, _2)); _send->input()->changed.connect (connections, ui_bind (&SendUI::ins_changed, this, _1, _2), gui_context());
_send->output()->changed.connect (connections, boost::bind (&SendUI::outs_changed, this, _1, _2)); _send->output()->changed.connect (connections, ui_bind (&SendUI::outs_changed, this, _1, _2), gui_context());
_panners.set_width (Wide); _panners.set_width (Wide);
_panners.setup_pan (); _panners.setup_pan ();
@ -130,7 +130,7 @@ SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session* session)
set_name ("SendUIWindow"); set_name ("SendUIWindow");
s->GoingAway.connect (going_away_connection, boost::bind (&SendUIWindow::send_going_away, this)); s->GoingAway.connect (going_away_connection, boost::bind (&SendUIWindow::send_going_away, this), gui_context());
signal_delete_event().connect (sigc::bind ( signal_delete_event().connect (sigc::bind (
sigc::ptr_fun (just_hide_it), sigc::ptr_fun (just_hide_it),

View file

@ -71,7 +71,7 @@ class SendUIWindow : public ArdourDialog
Gtk::HBox hpacker; Gtk::HBox hpacker;
void send_going_away (); void send_going_away ();
boost::signals2::scoped_connection going_away_connection; PBD::ScopedConnection going_away_connection;
}; };
#endif /* __ardour_gtk_send_ui_h__ */ #endif /* __ardour_gtk_send_ui_h__ */

View file

@ -30,6 +30,7 @@
#include <gtkmm2ext/utils.h> #include <gtkmm2ext/utils.h>
#include "gui_thread.h"
#include "prompter.h" #include "prompter.h"
#include "i18n.h" #include "i18n.h"
@ -91,10 +92,10 @@ SessionImportDialog::SessionImportDialog (ARDOUR::Session* target) :
ok_button = add_button (_("Import"), Gtk::RESPONSE_ACCEPT); ok_button = add_button (_("Import"), Gtk::RESPONSE_ACCEPT);
ok_button->signal_clicked().connect (sigc::mem_fun (*this, &SessionImportDialog::do_merge)); ok_button->signal_clicked().connect (sigc::mem_fun (*this, &SessionImportDialog::do_merge));
// prompt signals // prompt signals XXX: problem - handlers to be in the same thread since they return values
ElementImporter::Rename.connect (connections, boost::bind (&SessionImportDialog::open_rename_dialog, this, _1, _2)); ElementImporter::Rename.connect_same_thread (connections, boost::bind (&SessionImportDialog::open_rename_dialog, this, _1, _2));
ElementImporter::Prompt.connect (connections, boost::bind (&SessionImportDialog::open_prompt_dialog, this, _1)); ElementImporter::Prompt.connect_same_thread (connections, boost::bind (&SessionImportDialog::open_prompt_dialog, this, _1));
// Finalize // Finalize
show_all(); show_all();
} }

View file

@ -3,6 +3,8 @@
#include "ardour/auditioner.h" #include "ardour/auditioner.h"
#include "ardour/audioengine.h" #include "ardour/audioengine.h"
#include "ardour/port.h" #include "ardour/port.h"
#include "gui_thread.h"
#include "session_option_editor.h" #include "session_option_editor.h"
#include "port_matrix.h" #include "port_matrix.h"
#include "i18n.h" #include "i18n.h"
@ -160,9 +162,9 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
sigc::mem_fun (*_session_config, &SessionConfiguration::set_sync_source) sigc::mem_fun (*_session_config, &SessionConfiguration::set_sync_source)
); );
s->MTC_PortChanged.connect (_session_connections, boost::bind (&SessionOptionEditor::populate_sync_options, this, s, ssrc)); s->MTC_PortChanged.connect (_session_connections, boost::bind (&SessionOptionEditor::populate_sync_options, this, s, ssrc), gui_context());
s->MIDIClock_PortChanged.connect (_session_connections, boost::bind (&SessionOptionEditor::populate_sync_options, this, s, ssrc)); s->MIDIClock_PortChanged.connect (_session_connections, boost::bind (&SessionOptionEditor::populate_sync_options, this, s, ssrc), gui_context());
s->config.ParameterChanged.connect (_session_connections, boost::bind (&SessionOptionEditor::follow_sync_state, this, _1, s, ssrc)); s->config.ParameterChanged.connect (_session_connections, ui_bind (&SessionOptionEditor::follow_sync_state, this, _1, s, ssrc), gui_context());
populate_sync_options (s, ssrc); populate_sync_options (s, ssrc);
follow_sync_state (string ("external-sync"), s, ssrc); follow_sync_state (string ("external-sync"), s, ssrc);

View file

@ -56,7 +56,7 @@ Splash::Splash ()
set_default_size (pixbuf->get_width(), pixbuf->get_height()); set_default_size (pixbuf->get_width(), pixbuf->get_height());
the_splash = this; the_splash = this;
ARDOUR::BootMessage.connect (msg_connection, boost::bind (&Splash::boot_message, this, _1)); ARDOUR::BootMessage.connect (msg_connection, ui_bind (&Splash::boot_message, this, _1), gui_context());
} }
void void

View file

@ -79,12 +79,12 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
canvas_rect, &_trackview)); canvas_rect, &_trackview));
if (_trackview.is_track()) { if (_trackview.is_track()) {
_trackview.track()->DiskstreamChanged.connect (*this, boost::bind (&StreamView::diskstream_changed, this)); _trackview.track()->DiskstreamChanged.connect (*this, boost::bind (&StreamView::diskstream_changed, this), gui_context());
_trackview.get_diskstream()->RecordEnableChanged.connect (*this, boost::bind (&StreamView::rec_enable_changed, this)); _trackview.get_diskstream()->RecordEnableChanged.connect (*this, boost::bind (&StreamView::rec_enable_changed, this), gui_context());
_trackview.session()->TransportStateChange.connect (*this, boost::bind (&StreamView::transport_changed, this)); _trackview.session()->TransportStateChange.connect (*this, boost::bind (&StreamView::transport_changed, this), gui_context());
_trackview.session()->TransportLooped.connect (*this, boost::bind (&StreamView::transport_looped, this)); _trackview.session()->TransportLooped.connect (*this, boost::bind (&StreamView::transport_looped, this), gui_context());
_trackview.session()->RecordStateChanged.connect (*this, boost::bind (&StreamView::sess_rec_enable_changed, this)); _trackview.session()->RecordStateChanged.connect (*this, boost::bind (&StreamView::sess_rec_enable_changed, this), gui_context());
} }
ColorsChanged.connect (sigc::mem_fun (*this, &StreamView::color_handler)); ColorsChanged.connect (sigc::mem_fun (*this, &StreamView::color_handler));
@ -231,7 +231,7 @@ StreamView::display_diskstream (boost::shared_ptr<Diskstream> ds)
{ {
playlist_change_connection.disconnect(); playlist_change_connection.disconnect();
playlist_changed (ds); playlist_changed (ds);
ds->PlaylistChanged.connect (playlist_change_connection, boost::bind (&StreamView::playlist_changed_weak, this, boost::weak_ptr<Diskstream> (ds))); ds->PlaylistChanged.connect (playlist_change_connection, boost::bind (&StreamView::playlist_changed_weak, this, boost::weak_ptr<Diskstream> (ds)), gui_context());
} }
void void
@ -353,9 +353,9 @@ StreamView::playlist_changed (boost::shared_ptr<Diskstream> ds)
/* catch changes */ /* catch changes */
ds->playlist()->Modified.connect (playlist_connections, boost::bind (&StreamView::playlist_modified_weak, this, ds)); ds->playlist()->Modified.connect (playlist_connections, boost::bind (&StreamView::playlist_modified_weak, this, ds), gui_context());
ds->playlist()->RegionAdded.connect (playlist_connections, boost::bind (&StreamView::add_region_view_weak, this, _1)); ds->playlist()->RegionAdded.connect (playlist_connections, ui_bind (&StreamView::add_region_view_weak, this, _1), gui_context());
ds->playlist()->RegionRemoved.connect (playlist_connections, boost::bind (&StreamView::remove_region_view, this, _1)); ds->playlist()->RegionRemoved.connect (playlist_connections, ui_bind (&StreamView::remove_region_view, this, _1), gui_context());
} }
void void

View file

@ -161,7 +161,7 @@ protected:
uint32_t stream_base_color; ///< Background color uint32_t stream_base_color; ///< Background color
PBD::ScopedConnectionList playlist_connections; PBD::ScopedConnectionList playlist_connections;
boost::signals2::scoped_connection playlist_change_connection; PBD::ScopedConnection playlist_change_connection;
ARDOUR::layer_t _layers; ARDOUR::layer_t _layers;
LayerDisplay _layer_display; LayerDisplay _layer_display;

View file

@ -22,8 +22,10 @@
#include <gtkmm/stock.h> #include <gtkmm/stock.h>
#include "ardour/audioregion.h" #include "ardour/audioregion.h"
#include "ardour/audiosource.h" #include "ardour/audiosource.h"
#include "ardour/dB.h" #include "ardour/dB.h"
#include "ardour_ui.h" #include "ardour_ui.h"
#include "gui_thread.h"
#include "strip_silence_dialog.h" #include "strip_silence_dialog.h"
#include "canvas_impl.h" #include "canvas_impl.h"
#include "waveview.h" #include "waveview.h"
@ -129,7 +131,7 @@ StripSilenceDialog::create_waves ()
int n = 0; int n = 0;
for (std::list<Wave>::iterator i = _waves.begin(); i != _waves.end(); ++i) { for (std::list<Wave>::iterator i = _waves.begin(); i != _waves.end(); ++i) {
if (i->region->audio_source(0)->peaks_ready (boost::bind (&StripSilenceDialog::peaks_ready, this), _peaks_ready_connection)) { if (i->region->audio_source(0)->peaks_ready (boost::bind (&StripSilenceDialog::peaks_ready, this), _peaks_ready_connection, gui_context())) {
i->view = new WaveView (*(_canvas->root())); i->view = new WaveView (*(_canvas->root()));
i->view->property_data_src() = static_cast<gpointer>(i->region.get()); i->view->property_data_src() = static_cast<gpointer>(i->region.get());
i->view->property_cache() = WaveView::create_cache (); i->view->property_cache() = WaveView::create_cache ();

View file

@ -66,5 +66,5 @@ private:
int _wave_width; int _wave_width;
int _wave_height; int _wave_height;
boost::signals2::scoped_connection _peaks_ready_connection; PBD::ScopedConnection _peaks_ready_connection;
}; };

View file

@ -71,7 +71,7 @@ TapeAudioRegionView::init (Gdk::Color const & basic_color, bool /*wfw*/)
/* every time the wave data changes and peaks are ready, redraw */ /* every time the wave data changes and peaks are ready, redraw */
for (uint32_t n = 0; n < audio_region()->n_channels(); ++n) { for (uint32_t n = 0; n < audio_region()->n_channels(); ++n) {
audio_region()->audio_source(n)->PeaksReady.connect (*this, boost::bind (&TapeAudioRegionView::update, this, n)); audio_region()->audio_source(n)->PeaksReady.connect (*this, boost::bind (&TapeAudioRegionView::update, this, n), gui_context());
} }
} }

View file

@ -40,6 +40,7 @@
#include "ardour/location.h" #include "ardour/location.h"
#include "ardour_ui.h" #include "ardour_ui.h"
#include "gui_thread.h"
#include "public_editor.h" #include "public_editor.h"
#include "time_axis_view.h" #include "time_axis_view.h"
#include "region_view.h" #include "region_view.h"
@ -924,7 +925,7 @@ TimeAxisView::add_ghost (RegionView* rv)
if(gr) { if(gr) {
ghosts.push_back(gr); ghosts.push_back(gr);
gr->GoingAway.connect (*this, boost::bind (&TimeAxisView::erase_ghost, this, _1)); gr->GoingAway.connect (*this, ui_bind (&TimeAxisView::erase_ghost, this, _1), gui_context());
} }
} }

View file

@ -72,7 +72,7 @@ class AudioSource : virtual public Source,
sframes_t start, nframes_t cnt, double samples_per_visual_peak) const; sframes_t start, nframes_t cnt, double samples_per_visual_peak) const;
int build_peaks (); int build_peaks ();
bool peaks_ready (boost::function<void()> callWhenReady, PBD::Connection& connection_created_if_not_ready) const; bool peaks_ready (boost::function<void()> callWhenReady, PBD::Connection& connection_created_if_not_ready, PBD::EventLoop* event_loop) const;
mutable PBD::Signal0<void> PeaksReady; mutable PBD::Signal0<void> PeaksReady;
mutable PBD::Signal2<void,nframes_t,nframes_t> PeakRangeReady; mutable PBD::Signal2<void,nframes_t,nframes_t> PeakRangeReady;

View file

@ -30,6 +30,8 @@ class MidiControlUI : public AbstractUI<MidiUIRequest>
public: public:
MidiControlUI (Session& s); MidiControlUI (Session& s);
~MidiControlUI (); ~MidiControlUI ();
static MidiControlUI* instance() { return _instance; }
static BaseUI::RequestType PortChange; static BaseUI::RequestType PortChange;
@ -48,6 +50,8 @@ class MidiControlUI : public AbstractUI<MidiUIRequest>
bool midi_input_handler (Glib::IOCondition, MIDI::Port*); bool midi_input_handler (Glib::IOCondition, MIDI::Port*);
void reset_ports (); void reset_ports ();
void clear_ports (); void clear_ports ();
static MidiControlUI* _instance;
}; };
} }

View file

@ -7,7 +7,7 @@
#include "pbd/pool.h" #include "pbd/pool.h"
#include "pbd/ringbuffer.h" #include "pbd/ringbuffer.h"
#include "pbd/ui_callback.h" #include "pbd/event_loop.h"
#include "ardour/types.h" #include "ardour/types.h"
@ -73,7 +73,7 @@ struct SessionEvent {
boost::shared_ptr<RouteList> routes; /* apply to */ boost::shared_ptr<RouteList> routes; /* apply to */
boost::function<void (void)> rt_slot; /* what to call in RT context */ boost::function<void (void)> rt_slot; /* what to call in RT context */
RTeventCallback rt_return; /* called after rt_slot, with this event as an argument */ RTeventCallback rt_return; /* called after rt_slot, with this event as an argument */
PBD::UICallback* ui; PBD::EventLoop* event_loop;
std::list<AudioRange> audio_range; std::list<AudioRange> audio_range;
std::list<MusicRange> music_range; std::list<MusicRange> music_range;
@ -88,7 +88,7 @@ struct SessionEvent {
, speed (spd) , speed (spd)
, yes_or_no (yn) , yes_or_no (yn)
, second_yes_or_no (yn2) , second_yes_or_no (yn2)
, ui (0) {} , event_loop (0) {}
void set_ptr (void* p) { void set_ptr (void* p) {
ptr = p; ptr = p;

View file

@ -44,6 +44,7 @@
#include "ardour/audio_port.h" #include "ardour/audio_port.h"
#include "ardour/audioengine.h" #include "ardour/audioengine.h"
#include "ardour/audiofilesource.h" #include "ardour/audiofilesource.h"
#include "ardour/audioplaylist.h" #include "ardour/audioplaylist.h"
#include "ardour/audioregion.h" #include "ardour/audioregion.h"
#include "ardour/butler.h" #include "ardour/butler.h"
@ -1504,7 +1505,7 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca
continue; /* XXX is this OK? */ continue; /* XXX is this OK? */
} }
region->GoingAway.connect (*this, boost::bind (&Diskstream::remove_region_from_last_capture, this, boost::weak_ptr<Region>(region))); region->GoingAway.connect_same_thread (*this, boost::bind (&Diskstream::remove_region_from_last_capture, this, boost::weak_ptr<Region>(region)));
_last_capture_regions.push_back (region); _last_capture_regions.push_back (region);

View file

@ -528,8 +528,8 @@ AudioPlaylist::add_crossfade (boost::shared_ptr<Crossfade> xfade)
} else { } else {
_crossfades.push_back (xfade); _crossfades.push_back (xfade);
xfade->Invalidated.connect (*this, boost::bind (&AudioPlaylist::crossfade_invalidated, this, _1)); xfade->Invalidated.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_invalidated, this, _1));
xfade->StateChanged.connect (*this, boost::bind (&AudioPlaylist::crossfade_changed, this, _1)); xfade->StateChanged.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_changed, this, _1));
notify_crossfade_added (xfade); notify_crossfade_added (xfade);
} }
@ -584,8 +584,8 @@ AudioPlaylist::set_state (const XMLNode& node, int version)
try { try {
boost::shared_ptr<Crossfade> xfade = boost::shared_ptr<Crossfade> (new Crossfade (*((const Playlist *)this), *child)); boost::shared_ptr<Crossfade> xfade = boost::shared_ptr<Crossfade> (new Crossfade (*((const Playlist *)this), *child));
_crossfades.push_back (xfade); _crossfades.push_back (xfade);
xfade->Invalidated.connect (*this, boost::bind (&AudioPlaylist::crossfade_invalidated, this, _1)); xfade->Invalidated.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_invalidated, this, _1));
xfade->StateChanged.connect (*this, boost::bind (&AudioPlaylist::crossfade_changed, this, _1)); xfade->StateChanged.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_changed, this, _1));
NewCrossfade(xfade); NewCrossfade(xfade);
} }

View file

@ -182,7 +182,7 @@ AudioTrack::set_diskstream (boost::shared_ptr<AudioDiskstream> ds, void * /*src*
if (audio_diskstream()->deprecated_io_node) { if (audio_diskstream()->deprecated_io_node) {
if (!IO::connecting_legal) { if (!IO::connecting_legal) {
IO::ConnectingLegal.connect (*this, boost::bind (&AudioTrack::deprecated_use_diskstream_connections, this)); IO::ConnectingLegal.connect_same_thread (*this, boost::bind (&AudioTrack::deprecated_use_diskstream_connections, this));
} else { } else {
deprecated_use_diskstream_connections (); deprecated_use_diskstream_connections ();
} }
@ -304,7 +304,7 @@ AudioTrack::_set_state (const XMLNode& node, int version, bool call_base)
pending_state = const_cast<XMLNode*> (&node); pending_state = const_cast<XMLNode*> (&node);
if (_session.state_of_the_state() & Session::Loading) { if (_session.state_of_the_state() & Session::Loading) {
_session.StateReady.connect (*this, boost::bind (&AudioTrack::set_state_part_two, this)); _session.StateReady.connect_same_thread (*this, boost::bind (&AudioTrack::set_state_part_two, this));
} else { } else {
set_state_part_two (); set_state_part_two ();
} }

View file

@ -96,7 +96,7 @@ AudioRegion::AudioRegion (boost::shared_ptr<AudioSource> src, nframes_t start, n
{ {
boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> (src); boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> (src);
if (afs) { if (afs) {
afs->HeaderPositionOffsetChanged.connect (*this, boost::bind (&AudioRegion::source_offset_changed, this)); afs->HeaderPositionOffsetChanged.connect_same_thread (*this, boost::bind (&AudioRegion::source_offset_changed, this));
} }
init (); init ();
@ -113,7 +113,7 @@ AudioRegion::AudioRegion (boost::shared_ptr<AudioSource> src, nframes_t start, n
{ {
boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> (src); boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> (src);
if (afs) { if (afs) {
afs->HeaderPositionOffsetChanged.connect (*this, boost::bind (&AudioRegion::source_offset_changed, this)); afs->HeaderPositionOffsetChanged.connect_same_thread (*this, boost::bind (&AudioRegion::source_offset_changed, this));
} }
init (); init ();
@ -205,7 +205,7 @@ AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other, const Sour
boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> ((*i)); boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> ((*i));
if (afs) { if (afs) {
afs->HeaderPositionOffsetChanged.connect (*this, boost::bind (&AudioRegion::source_offset_changed, this)); afs->HeaderPositionOffsetChanged.connect_same_thread (*this, boost::bind (&AudioRegion::source_offset_changed, this));
} }
} }
@ -229,7 +229,7 @@ AudioRegion::AudioRegion (boost::shared_ptr<AudioSource> src, const XMLNode& nod
{ {
boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> (src); boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> (src);
if (afs) { if (afs) {
afs->HeaderPositionOffsetChanged.connect (*this, boost::bind (&AudioRegion::source_offset_changed, this)); afs->HeaderPositionOffsetChanged.connect_same_thread (*this, boost::bind (&AudioRegion::source_offset_changed, this));
} }
init (); init ();
@ -270,7 +270,7 @@ void
AudioRegion::connect_to_analysis_changed () AudioRegion::connect_to_analysis_changed ()
{ {
for (SourceList::const_iterator i = _sources.begin(); i != _sources.end(); ++i) { for (SourceList::const_iterator i = _sources.begin(); i != _sources.end(); ++i) {
(*i)->AnalysisChanged.connect (*this, boost::bind (&AudioRegion::invalidate_transients, this)); (*i)->AnalysisChanged.connect_same_thread (*this, boost::bind (&AudioRegion::invalidate_transients, this));
} }
} }
@ -285,7 +285,7 @@ AudioRegion::connect_to_header_position_offset_changed ()
unique_srcs.insert (*i); unique_srcs.insert (*i);
boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> (*i); boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> (*i);
if (afs) { if (afs) {
afs->HeaderPositionOffsetChanged.connect (*this, boost::bind (&AudioRegion::source_offset_changed, this)); afs->HeaderPositionOffsetChanged.connect_same_thread (*this, boost::bind (&AudioRegion::source_offset_changed, this));
} }
} }
} }
@ -294,9 +294,9 @@ AudioRegion::connect_to_header_position_offset_changed ()
void void
AudioRegion::listen_to_my_curves () AudioRegion::listen_to_my_curves ()
{ {
_envelope->StateChanged.connect (*this, boost::bind (&AudioRegion::envelope_changed, this)); _envelope->StateChanged.connect_same_thread (*this, boost::bind (&AudioRegion::envelope_changed, this));
_fade_in->StateChanged.connect (*this, boost::bind (&AudioRegion::fade_in_changed, this)); _fade_in->StateChanged.connect_same_thread (*this, boost::bind (&AudioRegion::fade_in_changed, this));
_fade_out->StateChanged.connect (*this, boost::bind (&AudioRegion::fade_out_changed, this)); _fade_out->StateChanged.connect_same_thread (*this, boost::bind (&AudioRegion::fade_out_changed, this));
} }
void void

View file

@ -149,7 +149,7 @@ AudioSource::update_length (sframes_t pos, sframes_t cnt)
***********************************************************************/ ***********************************************************************/
bool bool
AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, Connection& connect_here_if_not) const AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, Connection& connect_here_if_not, EventLoop* event_loop) const
{ {
bool ret; bool ret;
Glib::Mutex::Lock lm (_peaks_ready_lock); Glib::Mutex::Lock lm (_peaks_ready_lock);
@ -159,7 +159,7 @@ AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, Connection& c
*/ */
if (!(ret = _peaks_built)) { if (!(ret = _peaks_built)) {
PeaksReady.connect (connect_here_if_not, doThisWhenReady); PeaksReady.connect (connect_here_if_not, doThisWhenReady, event_loop);
} }
return ret; return ret;

View file

@ -72,7 +72,7 @@ Auditioner::Auditioner (Session& s)
_main_outs->allow_pan_reset (); _main_outs->allow_pan_reset ();
_main_outs->reset_panner (); _main_outs->reset_panner ();
_output->changed.connect (*this, boost::bind (&Auditioner::output_changed, this, _1, _2)); _output->changed.connect_same_thread (*this, boost::bind (&Auditioner::output_changed, this, _1, _2));
the_region.reset ((AudioRegion*) 0); the_region.reset ((AudioRegion*) 0);
g_atomic_int_set (&_active, 0); g_atomic_int_set (&_active, 0);

View file

@ -64,10 +64,10 @@ Delivery::Delivery (Session& s, boost::shared_ptr<IO> io, boost::shared_ptr<Mute
_display_to_user = false; _display_to_user = false;
if (_output) { if (_output) {
_output->changed.connect (*this, boost::bind (&Delivery::output_changed, this, _1, _2)); _output->changed.connect_same_thread (*this, boost::bind (&Delivery::output_changed, this, _1, _2));
} }
CycleStart.connect (*this, boost::bind (&Delivery::cycle_start, this, _1)); CycleStart.connect_same_thread (*this, boost::bind (&Delivery::cycle_start, this, _1));
} }
/* deliver to a new IO object */ /* deliver to a new IO object */
@ -88,10 +88,10 @@ Delivery::Delivery (Session& s, boost::shared_ptr<MuteMaster> mm, const string&
_display_to_user = false; _display_to_user = false;
if (_output) { if (_output) {
_output->changed.connect (*this, boost::bind (&Delivery::output_changed, this, _1, _2)); _output->changed.connect_same_thread (*this, boost::bind (&Delivery::output_changed, this, _1, _2));
} }
CycleStart.connect (*this, boost::bind (&Delivery::cycle_start, this, _1)); CycleStart.connect_same_thread (*this, boost::bind (&Delivery::cycle_start, this, _1));
} }
/* deliver to a new IO object, reconstruct from XML */ /* deliver to a new IO object, reconstruct from XML */
@ -116,10 +116,10 @@ Delivery::Delivery (Session& s, boost::shared_ptr<MuteMaster> mm, const XMLNode&
} }
if (_output) { if (_output) {
_output->changed.connect (*this, boost::bind (&Delivery::output_changed, this, _1, _2)); _output->changed.connect_same_thread (*this, boost::bind (&Delivery::output_changed, this, _1, _2));
} }
CycleStart.connect (*this, boost::bind (&Delivery::cycle_start, this, _1)); CycleStart.connect_same_thread (*this, boost::bind (&Delivery::cycle_start, this, _1));
} }
/* deliver to an existing IO object, reconstruct from XML */ /* deliver to an existing IO object, reconstruct from XML */
@ -144,10 +144,10 @@ Delivery::Delivery (Session& s, boost::shared_ptr<IO> out, boost::shared_ptr<Mut
} }
if (_output) { if (_output) {
_output->changed.connect (*this, boost::bind (&Delivery::output_changed, this, _1, _2)); _output->changed.connect_same_thread (*this, boost::bind (&Delivery::output_changed, this, _1, _2));
} }
CycleStart.connect (*this, boost::bind (&Delivery::cycle_start, this, _1)); CycleStart.connect_same_thread (*this, boost::bind (&Delivery::cycle_start, this, _1));
} }
std::string std::string
@ -419,7 +419,7 @@ Delivery::reset_panner ()
} }
} else { } else {
panner_legal_c.disconnect (); panner_legal_c.disconnect ();
PannersLegal.connect (panner_legal_c, boost::bind (&Delivery::panners_became_legal, this)); PannersLegal.connect_same_thread (panner_legal_c, boost::bind (&Delivery::panners_became_legal, this));
} }
} }

View file

@ -142,13 +142,13 @@ Diskstream::set_route (Route& r)
_io = _route->input(); _io = _route->input();
ic_connection.disconnect(); ic_connection.disconnect();
_io->changed.connect (ic_connection, boost::bind (&Diskstream::handle_input_change, this, _1, _2)); _io->changed.connect_same_thread (ic_connection, boost::bind (&Diskstream::handle_input_change, this, _1, _2));
input_change_pending = ConfigurationChanged; input_change_pending = ConfigurationChanged;
non_realtime_input_change (); non_realtime_input_change ();
set_align_style_from_io (); set_align_style_from_io ();
_route->GoingAway.connect (*this, boost::bind (&Diskstream::route_going_away, this)); _route->GoingAway.connect_same_thread (*this, boost::bind (&Diskstream::route_going_away, this));
} }
void void
@ -339,9 +339,9 @@ Diskstream::use_playlist (boost::shared_ptr<Playlist> playlist)
reset_write_sources (false); reset_write_sources (false);
} }
_playlist->Modified.connect (playlist_connections, boost::bind (&Diskstream::playlist_modified, this)); _playlist->Modified.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_modified, this));
_playlist->GoingAway.connect (playlist_connections, boost::bind (&Diskstream::playlist_deleted, this, boost::weak_ptr<Playlist>(_playlist))); _playlist->GoingAway.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_deleted, this, boost::weak_ptr<Playlist>(_playlist)));
_playlist->RangesMoved.connect (playlist_connections, boost::bind (&Diskstream::playlist_ranges_moved, this, _1)); _playlist->RangesMoved.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_ranges_moved, this, _1));
} }
/* don't do this if we've already asked for it *or* if we are setting up /* don't do this if we've already asked for it *or* if we are setting up

View file

@ -108,7 +108,7 @@ RegionExportChannelFactory::RegionExportChannelFactory (Session * session, Audio
throw ExportFailed ("Unhandled type in ExportChannelFactory constructor"); throw ExportFailed ("Unhandled type in ExportChannelFactory constructor");
} }
session->ProcessExport.connect (export_connection, boost::bind (&RegionExportChannelFactory::new_cycle_started, this, _1)); session->ProcessExport.connect_same_thread (export_connection, boost::bind (&RegionExportChannelFactory::new_cycle_started, this, _1));
buffers.set_count (ChanCount (DataType::AUDIO, n_channels)); buffers.set_count (ChanCount (DataType::AUDIO, n_channels));
buffers.ensure_buffers (DataType::AUDIO, n_channels, frames_per_cycle); buffers.ensure_buffers (DataType::AUDIO, n_channels, frames_per_cycle);

View file

@ -211,13 +211,13 @@ void
ExportFormatManager::add_compatibility (CompatPtr ptr) ExportFormatManager::add_compatibility (CompatPtr ptr)
{ {
compatibilities.push_back (ptr); compatibilities.push_back (ptr);
ptr->SelectChanged.connect (*this, boost::bind (&ExportFormatManager::change_compatibility_selection, this, _1, WeakCompatPtr (ptr))); ptr->SelectChanged.connect_same_thread (*this, boost::bind (&ExportFormatManager::change_compatibility_selection, this, _1, WeakCompatPtr (ptr)));
} }
void void
ExportFormatManager::add_quality (QualityPtr ptr) ExportFormatManager::add_quality (QualityPtr ptr)
{ {
ptr->SelectChanged.connect (*this, boost::bind (&ExportFormatManager::change_quality_selection, this, _1, WeakQualityPtr (ptr))); ptr->SelectChanged.connect_same_thread (*this, boost::bind (&ExportFormatManager::change_quality_selection, this, _1, WeakQualityPtr (ptr)));
qualities.push_back (ptr); qualities.push_back (ptr);
} }
@ -225,7 +225,7 @@ void
ExportFormatManager::add_format (FormatPtr ptr) ExportFormatManager::add_format (FormatPtr ptr)
{ {
formats.push_back (ptr); formats.push_back (ptr);
ptr->SelectChanged.connect (*this, boost::bind (&ExportFormatManager::change_format_selection, this, _1, WeakFormatPtr (ptr))); ptr->SelectChanged.connect_same_thread (*this, boost::bind (&ExportFormatManager::change_format_selection, this, _1, WeakFormatPtr (ptr)));
universal_set = universal_set->get_union (*ptr); universal_set = universal_set->get_union (*ptr);
/* Encoding options */ /* Encoding options */
@ -233,15 +233,15 @@ ExportFormatManager::add_format (FormatPtr ptr)
boost::shared_ptr<HasSampleFormat> hsf; boost::shared_ptr<HasSampleFormat> hsf;
if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (ptr)) { if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (ptr)) {
hsf->SampleFormatSelectChanged.connect (*this, boost::bind (&ExportFormatManager::change_sample_format_selection, this, _1, _2)); hsf->SampleFormatSelectChanged.connect_same_thread (*this, boost::bind (&ExportFormatManager::change_sample_format_selection, this, _1, _2));
hsf->DitherTypeSelectChanged.connect (*this, boost::bind (&ExportFormatManager::change_dither_type_selection, this, _1, _2)); hsf->DitherTypeSelectChanged.connect_same_thread (*this, boost::bind (&ExportFormatManager::change_dither_type_selection, this, _1, _2));
} }
} }
void void
ExportFormatManager::add_sample_rate (SampleRatePtr ptr) ExportFormatManager::add_sample_rate (SampleRatePtr ptr)
{ {
ptr->SelectChanged.connect (*this, boost::bind (&ExportFormatManager::change_sample_rate_selection, this, _1, WeakSampleRatePtr (ptr))); ptr->SelectChanged.connect_same_thread (*this, boost::bind (&ExportFormatManager::change_sample_rate_selection, this, _1, WeakSampleRatePtr (ptr)));
sample_rates.push_back (ptr); sample_rates.push_back (ptr);
} }

View file

@ -59,10 +59,10 @@ HasSampleFormat::add_sample_format (ExportFormatBase::SampleFormat format)
SampleFormatPtr ptr (new SampleFormatState (format, get_sample_format_name (format))); SampleFormatPtr ptr (new SampleFormatState (format, get_sample_format_name (format)));
sample_format_states.push_back (ptr); sample_format_states.push_back (ptr);
ptr->SelectChanged.connect (*this, boost::bind (&HasSampleFormat::update_sample_format_selection, this, _1)); ptr->SelectChanged.connect_same_thread (*this, boost::bind (&HasSampleFormat::update_sample_format_selection, this, _1));
// BOOST SIGNALS how to connect one signal to another // BOOST SIGNALS how to connect one signal to another
// ptr->SelectChanged.connect (*this, boost::bind (SampleFormatSelectChanged, _1, WeakSampleFormatPtr (ptr)); // ptr->SelectChanged.connect_same_thread (*this, boost::bind (SampleFormatSelectChanged, _1, WeakSampleFormatPtr (ptr));
// ptr->CompatibleChanged.connect (*this, boost::bind (SampleFormatCompatibleChanged, _1, WeakSampleFormatPtr (ptr)); // ptr->CompatibleChanged.connect_same_thread (*this, boost::bind (SampleFormatCompatibleChanged, _1, WeakSampleFormatPtr (ptr));
} }
void void
@ -70,10 +70,10 @@ HasSampleFormat::add_dither_type (ExportFormatBase::DitherType type, Glib::ustri
{ {
DitherTypePtr ptr (new DitherTypeState (type, name)); DitherTypePtr ptr (new DitherTypeState (type, name));
dither_type_states.push_back (ptr); dither_type_states.push_back (ptr);
ptr->SelectChanged.connect (*this, boost::bind (&HasSampleFormat::update_dither_type_selection, this, _1)); ptr->SelectChanged.connect_same_thread (*this, boost::bind (&HasSampleFormat::update_dither_type_selection, this, _1));
// BOOST SIGNALS how to connect one signal to another // BOOST SIGNALS how to connect one signal to another
// ptr->SelectChanged.connect (*this, boost::bind (DitherTypeSelectChanged, _1, WeakDitherTypePtr (ptr)); // ptr->SelectChanged.connect_same_thread (*this, boost::bind (DitherTypeSelectChanged, _1, WeakDitherTypePtr (ptr));
// ptr->CompatibleChanged.connect (*this, boost::bind (DitherTypeCompatibleChanged, _1, WeakDitherTypePtr (ptr)); // ptr->CompatibleChanged.connect_same_thread (*this, boost::bind (DitherTypeCompatibleChanged, _1, WeakDitherTypePtr (ptr));
} }
HasSampleFormat::SampleFormatPtr HasSampleFormat::SampleFormatPtr

Some files were not shown because too many files have changed in this diff Show more