use new syntax for connecting to backend signals that enforces explicit connection...
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 19 Dec 2009 20:26:31 +0000 (20:26 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 19 Dec 2009 20:26:31 +0000 (20:26 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6376 d708f5d6-7413-0410-9779-e7cbd77b26cf

257 files changed:
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui_dialogs.cc
gtk2_ardour/ardour_ui_options.cc
gtk2_ardour/audio_clock.cc
gtk2_ardour/audio_region_editor.cc
gtk2_ardour/audio_region_editor.h
gtk2_ardour/audio_region_view.cc
gtk2_ardour/audio_streamview.cc
gtk2_ardour/audio_time_axis.cc
gtk2_ardour/automation_controller.cc
gtk2_ardour/automation_controller.h
gtk2_ardour/automation_line.cc
gtk2_ardour/automation_line.h
gtk2_ardour/automation_region_view.cc
gtk2_ardour/automation_streamview.cc
gtk2_ardour/automation_time_axis.cc
gtk2_ardour/bundle_manager.cc
gtk2_ardour/bundle_manager.h
gtk2_ardour/crossfade_edit.cc
gtk2_ardour/crossfade_edit.h
gtk2_ardour/crossfade_view.cc
gtk2_ardour/crossfade_view.h
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_drag.cc
gtk2_ardour/editor_imageframe.cc
gtk2_ardour/editor_markers.cc
gtk2_ardour/editor_mixer.cc
gtk2_ardour/editor_regions.cc
gtk2_ardour/editor_regions.h
gtk2_ardour/editor_route_groups.cc
gtk2_ardour/editor_route_groups.h
gtk2_ardour/editor_routes.cc
gtk2_ardour/editor_routes.h
gtk2_ardour/editor_summary.cc
gtk2_ardour/editor_summary.h
gtk2_ardour/export_dialog.cc
gtk2_ardour/export_dialog.h
gtk2_ardour/export_file_notebook.cc
gtk2_ardour/export_file_notebook.h
gtk2_ardour/export_format_dialog.cc
gtk2_ardour/export_format_dialog.h
gtk2_ardour/gain_meter.cc
gtk2_ardour/gain_meter.h
gtk2_ardour/generic_pluginui.cc
gtk2_ardour/ghostregion.cc
gtk2_ardour/ghostregion.h
gtk2_ardour/group_tabs.cc
gtk2_ardour/imageframe_time_axis.cc
gtk2_ardour/imageframe_time_axis_group.cc
gtk2_ardour/imageframe_time_axis_view.cc
gtk2_ardour/imageframe_view.cc
gtk2_ardour/io_selector.cc
gtk2_ardour/level_meter.cc
gtk2_ardour/level_meter.h
gtk2_ardour/location_ui.cc
gtk2_ardour/location_ui.h
gtk2_ardour/lv2_plugin_ui.cc
gtk2_ardour/lv2_plugin_ui.h
gtk2_ardour/marker_time_axis_view.cc
gtk2_ardour/midi_region_view.cc
gtk2_ardour/midi_streamview.cc
gtk2_ardour/midi_time_axis.cc
gtk2_ardour/mixer_strip.cc
gtk2_ardour/mixer_ui.cc
gtk2_ardour/mixer_ui.h
gtk2_ardour/option_editor.cc
gtk2_ardour/option_editor.h
gtk2_ardour/panner2d.cc
gtk2_ardour/panner2d.h
gtk2_ardour/panner_ui.cc
gtk2_ardour/plugin_eq_gui.cc
gtk2_ardour/plugin_eq_gui.h
gtk2_ardour/plugin_selector.cc
gtk2_ardour/plugin_selector.h
gtk2_ardour/plugin_ui.cc
gtk2_ardour/plugin_ui.h
gtk2_ardour/port_group.cc
gtk2_ardour/port_group.h
gtk2_ardour/port_matrix.cc
gtk2_ardour/port_matrix.h
gtk2_ardour/port_matrix_body.cc
gtk2_ardour/processor_box.cc
gtk2_ardour/processor_box.h
gtk2_ardour/rc_option_editor.cc
gtk2_ardour/region_selection.cc
gtk2_ardour/region_view.cc
gtk2_ardour/region_view.h
gtk2_ardour/return_ui.cc
gtk2_ardour/return_ui.h
gtk2_ardour/route_params_ui.cc
gtk2_ardour/route_params_ui.h
gtk2_ardour/route_processor_selection.cc
gtk2_ardour/route_processor_selection.h
gtk2_ardour/route_time_axis.cc
gtk2_ardour/route_ui.cc
gtk2_ardour/route_ui.h
gtk2_ardour/selection.cc
gtk2_ardour/selection.h
gtk2_ardour/send_ui.cc
gtk2_ardour/send_ui.h
gtk2_ardour/session_import_dialog.cc
gtk2_ardour/session_import_dialog.h
gtk2_ardour/session_option_editor.cc
gtk2_ardour/splash.cc
gtk2_ardour/splash.h
gtk2_ardour/streamview.cc
gtk2_ardour/streamview.h
gtk2_ardour/tape_region_view.cc
gtk2_ardour/time_axis_view.cc
gtk2_ardour/time_axis_view.h
gtk2_ardour/time_axis_view_item.h
libs/ardour/ardour/ardour.h
libs/ardour/ardour/audioengine.h
libs/ardour/ardour/audiofilesource.h
libs/ardour/ardour/audioplaylist.h
libs/ardour/ardour/audiosource.h
libs/ardour/ardour/automation_list.h
libs/ardour/ardour/bundle.h
libs/ardour/ardour/configuration.h
libs/ardour/ardour/crossfade.h
libs/ardour/ardour/delivery.h
libs/ardour/ardour/diskstream.h
libs/ardour/ardour/element_importer.h
libs/ardour/ardour/export.h
libs/ardour/ardour/export_channel.h
libs/ardour/ardour/export_channel_configuration.h
libs/ardour/ardour/export_format_base.h
libs/ardour/ardour/export_format_manager.h
libs/ardour/ardour/export_formats.h
libs/ardour/ardour/export_handler.h
libs/ardour/ardour/export_multiplication.h
libs/ardour/ardour/export_processor.h
libs/ardour/ardour/export_profile_manager.h
libs/ardour/ardour/export_status.h
libs/ardour/ardour/export_timespan.h
libs/ardour/ardour/internal_return.h
libs/ardour/ardour/internal_send.h
libs/ardour/ardour/io.h
libs/ardour/ardour/io_processor.h
libs/ardour/ardour/location.h
libs/ardour/ardour/meter.h
libs/ardour/ardour/midi_model.h
libs/ardour/ardour/midi_patch_manager.h
libs/ardour/ardour/midi_source.h
libs/ardour/ardour/midi_ui.h
libs/ardour/ardour/mute_master.h
libs/ardour/ardour/named_selection.h
libs/ardour/ardour/panner.h
libs/ardour/ardour/playlist.h
libs/ardour/ardour/playlist_factory.h
libs/ardour/ardour/plugin.h
libs/ardour/ardour/plugin_insert.h
libs/ardour/ardour/plugin_manager.h
libs/ardour/ardour/port.h
libs/ardour/ardour/processor.h
libs/ardour/ardour/region.h
libs/ardour/ardour/region_factory.h
libs/ardour/ardour/route.h
libs/ardour/ardour/route_group.h
libs/ardour/ardour/route_group_member.h
libs/ardour/ardour/session.h
libs/ardour/ardour/session_handle.h
libs/ardour/ardour/session_object.h
libs/ardour/ardour/session_playlists.h
libs/ardour/ardour/slave.h
libs/ardour/ardour/sndfilesource.h
libs/ardour/ardour/source.h
libs/ardour/ardour/source_factory.h
libs/ardour/ardour/tempo.h
libs/ardour/ardour/ticker.h
libs/ardour/ardour/track.h
libs/ardour/audio_diskstream.cc
libs/ardour/audio_playlist.cc
libs/ardour/audio_track.cc
libs/ardour/audioengine.cc
libs/ardour/audiofilesource.cc
libs/ardour/audioregion.cc
libs/ardour/audiosource.cc
libs/ardour/auditioner.cc
libs/ardour/automation_list.cc
libs/ardour/delivery.cc
libs/ardour/diskstream.cc
libs/ardour/element_importer.cc
libs/ardour/export_channel.cc
libs/ardour/export_format_manager.cc
libs/ardour/export_formats.cc
libs/ardour/export_handler.cc
libs/ardour/export_processor.cc
libs/ardour/globals.cc
libs/ardour/internal_return.cc
libs/ardour/internal_send.cc
libs/ardour/io.cc
libs/ardour/meter.cc
libs/ardour/midi_clock_slave.cc
libs/ardour/midi_diskstream.cc
libs/ardour/midi_region.cc
libs/ardour/midi_source.cc
libs/ardour/midi_track.cc
libs/ardour/midi_ui.cc
libs/ardour/mtc_slave.cc
libs/ardour/named_selection.cc
libs/ardour/playlist.cc
libs/ardour/playlist_factory.cc
libs/ardour/processor.cc
libs/ardour/region.cc
libs/ardour/region_factory.cc
libs/ardour/route.cc
libs/ardour/route_group.cc
libs/ardour/session.cc
libs/ardour/session_export.cc
libs/ardour/session_handle.cc
libs/ardour/session_midi.cc
libs/ardour/session_playlists.cc
libs/ardour/session_state.cc
libs/ardour/sndfilesource.cc
libs/ardour/source_factory.cc
libs/ardour/ticker.cc
libs/gtkmm2ext/binding_proxy.cc
libs/midi++2/channel.cc
libs/midi++2/midi++/channel.h
libs/midi++2/midi++/manager.h
libs/midi++2/midi++/mmc.h
libs/midi++2/midi++/parser.h
libs/midi++2/midi++/port.h
libs/midi++2/mmc.cc
libs/midi++2/parser.cc
libs/pbd/controllable.cc
libs/pbd/pbd/controllable.h
libs/pbd/pbd/destructible.h
libs/pbd/pbd/memento_command.h
libs/pbd/pbd/scoped_connections.h [deleted file]
libs/pbd/pbd/signals.h [new file with mode: 0644]
libs/pbd/pbd/undo.h
libs/pbd/scoped_connections.cc [deleted file]
libs/pbd/signals.cc [new file with mode: 0644]
libs/pbd/undo.cc
libs/pbd/wscript
libs/surfaces/control_protocol/basic_ui.cc
libs/surfaces/control_protocol/control_protocol.cc
libs/surfaces/control_protocol/control_protocol/basic_ui.h
libs/surfaces/control_protocol/control_protocol/control_protocol.h
libs/surfaces/generic_midi/generic_midi_control_protocol.cc
libs/surfaces/generic_midi/midicontrollable.cc
libs/surfaces/generic_midi/midicontrollable.h
libs/surfaces/mackie/controls.h
libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/mackie_port.cc
libs/surfaces/mackie/mackie_port.h
libs/surfaces/mackie/route_signal.cc
libs/surfaces/mackie/route_signal.h
libs/surfaces/mackie/surface_port.h
libs/surfaces/osc/osc.cc
libs/surfaces/osc/osc.h
libs/surfaces/osc/osc_controllable.cc
libs/surfaces/osc/osc_controllable.h

index f97d892c4ceee1744c28ad8b466285e7f71c2499..7deeae7bf76ebd756c8c6708f20fd69a290ea6a2 100644 (file)
@@ -234,20 +234,20 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
 
        last_shuttle_request = last_peak_grab = 0; //  get_microseconds();
 
-       ARDOUR::Diskstream::DiskOverrun.connect (sigc::mem_fun(*this, &ARDOUR_UI::disk_overrun_handler));
-       ARDOUR::Diskstream::DiskUnderrun.connect (sigc::mem_fun(*this, &ARDOUR_UI::disk_underrun_handler));
+       ARDOUR::Diskstream::DiskOverrun.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::disk_overrun_handler));
+       ARDOUR::Diskstream::DiskUnderrun.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::disk_underrun_handler));
 
        /* handle dialog requests */
 
-       ARDOUR::Session::Dialog.connect (sigc::mem_fun(*this, &ARDOUR_UI::session_dialog));
+       ARDOUR::Session::Dialog.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::session_dialog));
 
        /* handle pending state with a dialog */
 
-       ARDOUR::Session::AskAboutPendingState.connect (sigc::mem_fun(*this, &ARDOUR_UI::pending_state_dialog));
+       ARDOUR::Session::AskAboutPendingState.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::pending_state_dialog));
 
        /* handle sr mismatch with a dialog */
 
-       ARDOUR::Session::AskAboutSampleRateMismatch.connect (sigc::mem_fun(*this, &ARDOUR_UI::sr_mismatch_dialog));
+       ARDOUR::Session::AskAboutSampleRateMismatch.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::sr_mismatch_dialog));
 
        /* lets get this party started */
 
@@ -329,10 +329,10 @@ ARDOUR_UI::create_engine ()
                return -1;
        }
 
-       engine->Stopped.connect (sigc::mem_fun(*this, &ARDOUR_UI::engine_stopped));
-       engine->Running.connect (sigc::mem_fun(*this, &ARDOUR_UI::engine_running));
-       engine->Halted.connect (sigc::mem_fun(*this, &ARDOUR_UI::engine_halted));
-       engine->SampleRateChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::update_sample_rate));
+       engine->Stopped.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::engine_stopped));
+       engine->Running.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::engine_running));
+       engine->Halted.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::engine_halted));
+       engine->SampleRateChanged.connect (forever_connections, sigc::mem_fun(*this, &ARDOUR_UI::update_sample_rate));
 
        post_engine ();
 
@@ -407,7 +407,7 @@ ARDOUR_UI::post_engine ()
        update_cpu_load ();
        update_sample_rate (engine->frame_rate());
 
-       Config->ParameterChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed));
+       Config->ParameterChanged.connect (forever_connections, sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed));
        boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
        Config->map_parameters (pc);
 
index d14aa7ce0c82c2b9011f73ad1a82d5ff2d1d2702..318d1892517056207aa783d16a79e42948fd6e0a 100644 (file)
@@ -694,6 +694,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        void platform_specific ();
        void platform_setup ();
        void fontconfig_dialog ();
+
+       PBD::ScopedConnectionList forever_connections;
 };
 
 #endif /* __ardour_gui_h__ */
index 87a8dede29e8b5c3aa957e646dfdbd21230bca67..7cbf0df3e2ca6d98f2af32766ede7fa4cd5d6472 100644 (file)
@@ -113,15 +113,14 @@ ARDOUR_UI::set_session (Session *s)
        Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::sync_blink));
        Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::audition_blink));
 
-       _session_connections.add_connection (_session->Xrun.connect (sigc::mem_fun(*this, &ARDOUR_UI::xrun_handler)));
-       _session_connections.add_connection (_session->RecordStateChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::record_state_changed)));
-       _session_connections.add_connection (_session->locations()->added.connect (sigc::mem_fun (*this, &ARDOUR_UI::handle_locations_change)));
-       _session_connections.add_connection (_session->locations()->removed.connect (sigc::mem_fun (*this, &ARDOUR_UI::handle_locations_change)));
-       _session_connections.add_connection (_session->TransportStateChange.connect (sigc::mem_fun(*this, &ARDOUR_UI::map_transport_state)));
-       _session_connections.add_connection (_session->AuditionActive.connect (sigc::mem_fun(*this, &ARDOUR_UI::auditioning_changed)));
-       _session_connections.add_connection (_session->SoloActive.connect (sigc::mem_fun(*this, &ARDOUR_UI::soloing_changed)));
-       _session_connections.add_connection (_session->DirtyChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::update_autosave)));
-
+       _session->Xrun.connect (_session_connections, sigc::mem_fun(*this, &ARDOUR_UI::xrun_handler));
+       _session->RecordStateChanged.connect (_session_connections, sigc::mem_fun (*this, &ARDOUR_UI::record_state_changed));
+       _session->locations()->added.connect (_session_connections, sigc::mem_fun (*this, &ARDOUR_UI::handle_locations_change));
+       _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->AuditionActive.connect (_session_connections, sigc::mem_fun(*this, &ARDOUR_UI::auditioning_changed));
+       _session->SoloActive.connect (_session_connections, sigc::mem_fun(*this, &ARDOUR_UI::soloing_changed));
+       _session->DirtyChanged.connect (_session_connections, sigc::mem_fun(*this, &ARDOUR_UI::update_autosave));
 
        /* Clocks are on by default after we are connected to a session, so show that here.
        */
index 20d492c71bfd0eb7bdd8f125d30bb6e2ecfd0d7f..f917fd429d6bf99c223f0be47e4e0f35e2831e6a 100644 (file)
@@ -270,7 +270,7 @@ ARDOUR_UI::toggle_editing_space()
 void
 ARDOUR_UI::setup_session_options ()
 {
-       _session->config.ParameterChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed));
+       _session->config.ParameterChanged.connect (_session_connections, sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed));
        boost::function<void (std::string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
        _session->config.map_parameters (pc);
 }
index c37c6cab9c5391c988c9f08712240988f44827f5..0847031df4afb84673d655679e4440c5095674b6 100644 (file)
@@ -214,7 +214,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.signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &AudioClock::field_button_release_event), Timecode_Hours));
 
-       Session::TimecodeOffsetChanged.connect (sigc::mem_fun (*this, &AudioClock::timecode_offset_changed));
+       Session::TimecodeOffsetChanged.connect (_session_connections, sigc::mem_fun (*this, &AudioClock::timecode_offset_changed));
 
        if (editable) {
                setup_events ();
index 2c26f562ff165f92658b0e8c072a7cf69e7d5149..c95ecc56168660bc9507cd46ecbf5746f205a887 100644 (file)
@@ -155,7 +155,7 @@ AudioRegionEditor::AudioRegionEditor (Session* s, boost::shared_ptr<AudioRegion>
        bounds_changed (Change (StartChanged|LengthChanged|PositionChanged|Region::SyncOffsetChanged));
        gain_changed ();
 
-       _region->StateChanged.connect (sigc::mem_fun(*this, &AudioRegionEditor::region_changed));
+       _region->StateChanged.connect (state_connection, sigc::mem_fun(*this, &AudioRegionEditor::region_changed));
 
        spin_arrow_grab = false;
 
@@ -228,7 +228,7 @@ AudioRegionEditor::connect_editor_events ()
        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));
-       _session->AuditionActive.connect (sigc::mem_fun(*this, &AudioRegionEditor::audition_state_changed));
+       _session->AuditionActive.connect (audition_connection, sigc::mem_fun(*this, &AudioRegionEditor::audition_state_changed));
 }
 
 void
index f4c99917d8606c4ca13985fefad0b894a7bec5c8..0450d0c293eff91b1ae08275510b3094811b3871 100644 (file)
@@ -35,7 +35,8 @@
 #include <gtkmm/spinbutton.h>
 
 #include <libgnomecanvas/libgnomecanvas.h>
-#include <sigc++/signal.h>
+
+#include "pbd/signals.h"
 
 #include "audio_clock.h"
 #include "ardour_dialog.h"
@@ -94,6 +95,9 @@ class AudioRegionEditor : public RegionEditor
        Gtk::VSeparator sep1;
        Gtk::VSeparator sep2;
 
+       PBD::ScopedConnection state_connection;
+       PBD::ScopedConnection audition_connection;
+
        void region_changed (ARDOUR::Change);
        void bounds_changed (ARDOUR::Change);
        void name_changed ();
index 30c426567f9a55d9125dd6aa5bc1c70764246d7d..371324210188b1d0fe200238c6a5456e0424df34 100644 (file)
@@ -1186,7 +1186,7 @@ AudioRegionView::add_ghost (TimeAxisView& tv)
        ghost->set_colors();
        ghosts.push_back (ghost);
 
-       ghost->GoingAway.connect (boost::bind (&RegionView::remove_ghost, this, _1));
+       ghost->GoingAway.connect (*this, boost::bind (&RegionView::remove_ghost, this, _1));
 
        return ghost;
 }
index 85ea02a197ad0c72471500c61b615087976864ed..6fb481db2d48a16551187261e50da0006023bb86 100644 (file)
@@ -66,7 +66,7 @@ AudioStreamView::AudioStreamView (AudioTimeAxisView& tv)
 
        use_rec_regions = tv.editor().show_waveforms_recording ();
 
-       Config->ParameterChanged.connect (sigc::mem_fun (*this, &AudioStreamView::parameter_changed));
+       Config->ParameterChanged.connect (*this, sigc::mem_fun (*this, &AudioStreamView::parameter_changed));
 }
 
 AudioStreamView::~AudioStreamView ()
@@ -190,7 +190,7 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
 
        /* catch region going away */
 
-       scoped_connect (r->GoingAway, 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)));
 
        RegionViewAdded (region_view);
 
@@ -281,12 +281,14 @@ AudioStreamView::playlist_changed (boost::shared_ptr<Diskstream> ds)
 {
        ENSURE_GUI_THREAD (*this, &AudioStreamView::playlist_changed_weak, boost::weak_ptr<Diskstream> (ds));
 
+       playlist_connections.drop_connections ();
+
        StreamView::playlist_changed(ds);
 
        boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(ds->playlist());
 
        if (apl) {
-               playlist_connections.add_connection (apl->NewCrossfade.connect (boost::bind (&AudioStreamView::add_crossfade, this, _1)));
+               apl->NewCrossfade.connect (playlist_connections, boost::bind (&AudioStreamView::add_crossfade, this, _1));
        }
 }
 
@@ -345,7 +347,7 @@ AudioStreamView::add_crossfade (boost::shared_ptr<Crossfade> crossfade)
                                               region_color,
                                               *lview, *rview);
        cv->set_valid (true);
-       crossfade->Invalidated.connect (sigc::mem_fun (*this, &AudioStreamView::remove_crossfade));
+       crossfade->Invalidated.connect (*this, sigc::mem_fun (*this, &AudioStreamView::remove_crossfade));
        crossfade_views[cv->crossfade] = cv;
        if (!_trackview.session()->config.get_xfades_visible() || !crossfades_visible) {
                cv->hide ();
@@ -481,9 +483,9 @@ AudioStreamView::setup_rec_box ()
                                        if (src) {
                                                sources.push_back (src);
 
-                                               rec_data_ready_connections.add_connection 
-                                                       (src->PeakRangeReady.connect 
-                                                        (boost::bind (&AudioStreamView::rec_peak_range_ready, this, _1, _2, boost::weak_ptr<Source>(src))));
+                                               (src->PeakRangeReady.connect (rec_data_ready_connections,
+                                                                             boost::bind (&AudioStreamView::rec_peak_range_ready, 
+                                                                                          this, _1, _2, boost::weak_ptr<Source>(src))));
                                        }
                                }
 
index 040e56a3232d90e1bfe6d25e90c6b4f883c142c2..0105e1846cc5e0214d4aed22bee3b27bb6f6f9ac 100644 (file)
@@ -108,9 +108,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session* sess, boost::sh
        }
 
        if (_route->panner()) {
-               _route->panner()->Changed.connect (sigc::bind (
-                               sigc::mem_fun(*this, &AudioTimeAxisView::ensure_pan_views),
-                               false));
+               _route->panner()->Changed.connect (*this, (boost::bind (&AudioTimeAxisView::ensure_pan_views, this, false)));
        }
 
        /* map current state of the route */
index 08b3f001cd9776da72165ad2386be199706f596a..ba0802416141face2dc03e16d963d7871ef80d37 100644 (file)
@@ -54,7 +54,7 @@ AutomationController::AutomationController(boost::shared_ptr<AutomationControl>
        _screen_update_connection = ARDOUR_UI::RapidScreenUpdate.connect (
                        sigc::mem_fun (*this, &AutomationController::display_effective_value));
 
-       ac->Changed.connect (sigc::mem_fun(*this, &AutomationController::value_changed));
+       ac->Changed.connect (_changed_connection, sigc::mem_fun(*this, &AutomationController::value_changed));
 }
 
 AutomationController::~AutomationController()
index 05170b2a6bf5d45f4b4c0863ed164cea07c9d726..e6d377ab262385a7da414cae0ed288418187cf90 100644 (file)
@@ -23,7 +23,9 @@
 
 #include <boost/shared_ptr.hpp>
 #include <gtkmm.h>
-#include <gtkmm2ext/barcontroller.h>
+
+#include "gtkmm2ext/barcontroller.h"
+#include "pbd/signals.h"
 
 namespace ARDOUR {
        class Session;
@@ -63,6 +65,7 @@ private:
        boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
        Gtk::Adjustment*                             _adjustment;
        sigc::connection                             _screen_update_connection;
+       PBD::ScopedConnection                        _changed_connection;
 };
 
 
index 7f9bd6b45551666bd2f68417ea561bd3cacd608b..726de984a001ab0f9169aace18db73b5ed403078 100644 (file)
@@ -85,7 +85,7 @@ AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanv
 
        line->signal_event().connect (sigc::mem_fun (*this, &AutomationLine::event_handler));
 
-       alist->StateChanged.connect (sigc::mem_fun(*this, &AutomationLine::list_changed));
+       alist->StateChanged.connect (_state_connection, boost::bind (&AutomationLine::list_changed, this));
 
        trackview.session()->register_with_memento_command_factory(alist->id(), this);
 
index c16bf60008b5939823cc189ca370ce83f8d86d0e..e3e185bf7275afe6564ee60bc28d0a905f8d9e62 100644 (file)
@@ -171,6 +171,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulDestructible
 
        void reset_callback (const Evoral::ControlList&);
        void list_changed ();
+       PBD::ScopedConnection _state_connection;
 
        virtual bool event_handler (GdkEvent*);
        virtual void add_model_point (ALPoints& tmp_points, double frame, double yfract);
index 9056adc6932eb938156b4c6debc0b32c5fed1915..bcb637602766019ba28461b202489de113478ad5 100644 (file)
@@ -59,7 +59,7 @@ AutomationRegionView::init (Gdk::Color const & basic_color, bool /*wfd*/)
 
        set_height (trackview.current_height());
 
-       _region->StateChanged.connect (sigc::mem_fun(*this, &AutomationRegionView::region_changed));
+       _region->StateChanged.connect (*this, boost::bind (&RegionView::region_changed, this, _1));
 
        set_colors ();
 
index 9c7cf50ac7b1f6a9d16cf238ab12316eb461de0a..731374eb2d59413382ae92351aba132df15d749c 100644 (file)
@@ -129,7 +129,7 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region
        display_region(region_view);
 
        /* catch regionview going away */
-       scoped_connect (region->GoingAway, 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)));
 
        RegionViewAdded (region_view);
 
index aee9b70726ff9f78aa3b5e391047b8ad8ce2343d..fa507448b4c7eb4e15cbcf3da5dec2184bd99dbd 100644 (file)
@@ -833,8 +833,7 @@ AutomationTimeAxisView::add_line (boost::shared_ptr<AutomationLine> line)
        assert(!_line);
        assert(line->the_list() == _control->list());
 
-       automation_connection = _control->alist()->automation_state_changed.connect
-               (boost::bind (&AutomationTimeAxisView::automation_state_changed, this));
+       _control->alist()->automation_state_changed.connect (automation_connection, boost::bind (&AutomationTimeAxisView::automation_state_changed, this));
 
        _line = line;
        //_controller = AutomationController::create(_session, line->the_list(), _control);
index ca047ebea01bb64844069ddee2c7988e73a78cde..9b4b2b6bdeaac7b45910bf7c9c403157697fa763 100644 (file)
@@ -395,7 +395,7 @@ BundleManager::add_bundle (boost::shared_ptr<Bundle> b)
        (*i)[_list_model_columns.name] = u->name ();
        (*i)[_list_model_columns.bundle] = u;
 
-       u->Changed.connect (sigc::bind (sigc::mem_fun (*this, &BundleManager::bundle_changed), u));
+       u->Changed.connect (bundle_connections, boost::bind (&BundleManager::bundle_changed, this, _1, u));
 }
 
 void
index d064e40bf65125b7dd0b3fa5d9793e5a42d002e6..4172330cf1bf37fb5d6b6152b81da94156e50c8d 100644 (file)
@@ -117,6 +117,7 @@ class BundleManager : public ArdourDialog
        ModelColumns _list_model_columns;
        Gtk::Button edit_button;
        Gtk::Button delete_button;
+       PBD::ScopedConnectionList bundle_connections;
 };
 
 class NameChannelDialog : public ArdourDialog
index 7a7b740a25059c200bec28a4877c49eea45e62c7..afb595938d47ed939094efbbf41a72a22cf33502 100644 (file)
@@ -291,9 +291,9 @@ CrossfadeEditor::CrossfadeEditor (Session* s, boost::shared_ptr<Crossfade> xf, d
 
        curve_select_clicked (In);
 
-       xfade->StateChanged.connect (sigc::mem_fun(*this, &CrossfadeEditor::xfade_changed));
+       xfade->StateChanged.connect (state_connection, boost::bind (&CrossfadeEditor::xfade_changed, this, _1));
 
-       _session_connections.add_connection (_session->AuditionActive.connect (sigc::mem_fun(*this, &CrossfadeEditor::audition_state_changed)));
+       _session->AuditionActive.connect (_session_connections, sigc::mem_fun(*this, &CrossfadeEditor::audition_state_changed));
        show_all_children();
 }
 
index 7334002abd8a677b7ad3681676e28d414bfd9088..29a66b3747aeb13a583d744954afb88c4542155e 100644 (file)
@@ -183,7 +183,8 @@ class CrossfadeEditor : public ArdourDialog
 
        void set (const ARDOUR::AutomationList& alist, WhichFade);
 
-       boost::signals2::scoped_connection peaks_ready_connection;
+       PBD::ScopedConnection peaks_ready_connection;
+       PBD::ScopedConnection state_connection;
 
        void make_waves (boost::shared_ptr<ARDOUR::AudioRegion>, WhichFade);
        void peaks_ready (boost::weak_ptr<ARDOUR::AudioRegion> r, WhichFade);
index 63868ca8955e83f847ab8f4996909c62a1741bd8..3a34ace7fa4f12004c876291f79878aa18ab8321 100644 (file)
@@ -39,7 +39,7 @@ using namespace Editing;
 using namespace Gnome;
 using namespace Canvas;
 
-boost::signals2::signal<void(CrossfadeView*)> CrossfadeView::GoingAway;
+PBD::Signal1<void,CrossfadeView*> CrossfadeView::GoingAway;
 
 CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
                              RouteTimeAxisView &tv,
@@ -83,7 +83,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
 
        crossfade_changed (Change (~0));
 
-       crossfade->StateChanged.connect (sigc::mem_fun(*this, &CrossfadeView::crossfade_changed));
+       crossfade->StateChanged.connect (*this, sigc::mem_fun(*this, &CrossfadeView::crossfade_changed));
        ColorsChanged.connect (sigc::mem_fun (*this, &CrossfadeView::color_handler));
 }
 
index a82387393fcc13368456ec031268c6f6b632e548..8e8c50e323635fbb0e3fa3ce73935c3cb78a3e35 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <vector>
 #include <libgnomecanvasmm.h>
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 #include "ardour/crossfade.h"
 
 #include "time_axis_view_item.h"
@@ -52,7 +52,7 @@ struct CrossfadeView : public TimeAxisViewItem
     bool visible() const { return _visible; }
     void set_valid (bool yn);
 
-    static boost::signals2::signal<void(CrossfadeView*)> GoingAway;
+    static PBD::Signal1<void,CrossfadeView*> GoingAway;
 
     AudioRegionView& upper_regionview () const;
 
index 7cc9e26339f2cce69cb05d4d7e333d13b92657ba..57d1ef092220f2d70594b1a60660452788fc9e23 100644 (file)
@@ -627,7 +627,7 @@ Editor::Editor ()
        _playlist_selector = new PlaylistSelector();
        _playlist_selector->signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), static_cast<Window *> (_playlist_selector)));
 
-       scoped_connect (RegionView::RegionViewGoingAway, boost::bind (&Editor::catch_vanishing_regionview, this, _1));
+       RegionView::RegionViewGoingAway.connect (*this, boost::bind (&Editor::catch_vanishing_regionview, this, _1));
 
        /* nudge stuff */
 
@@ -677,13 +677,13 @@ Editor::Editor ()
 
        /* allow external control surfaces/protocols to do various things */
 
-       ControlProtocol::ZoomToSession.connect (sigc::mem_fun (*this, &Editor::temporal_zoom_session));
-       ControlProtocol::ZoomIn.connect (sigc::bind (sigc::mem_fun (*this, &Editor::temporal_zoom_step), false));
-       ControlProtocol::ZoomOut.connect (sigc::bind (sigc::mem_fun (*this, &Editor::temporal_zoom_step), true));
-       ControlProtocol::ScrollTimeline.connect (sigc::mem_fun (*this, &Editor::control_scroll));
-       BasicUI::AccessAction.connect (sigc::mem_fun (*this, &Editor::access_action));
+       ControlProtocol::ZoomToSession.connect (*this, boost::bind (&Editor::temporal_zoom_session, this));
+       ControlProtocol::ZoomIn.connect (*this, boost::bind (&Editor::temporal_zoom_step, this, false));
+       ControlProtocol::ZoomOut.connect (*this, boost::bind (&Editor::temporal_zoom_step, this, true));
+       ControlProtocol::ScrollTimeline.connect (*this, boost::bind (&Editor::control_scroll, this, _1));
+       BasicUI::AccessAction.connect (*this, boost::bind (&Editor::access_action, this, _1, _2));
 
-       Config->ParameterChanged.connect (sigc::mem_fun (*this, &Editor::parameter_changed));
+       Config->ParameterChanged.connect (*this, boost::bind (&Editor::parameter_changed, this, _1));
 
        _last_normalization_value = 0;
 
@@ -1075,24 +1075,24 @@ Editor::set_session (Session *t)
 
        update_title ();
 
-       _session_connections.add_connection (_session->history().Changed.connect (boost::bind (&Editor::history_changed, this)));
+       _session->history().Changed.connect (_session_connections, boost::bind (&Editor::history_changed, this));
 
        /* These signals can all be emitted by a non-GUI thread. Therefore the
           handlers for them must not attempt to directly interact with the GUI,
           but use Gtkmm2ext::UI::instance()->call_slot();
        */
 
-       _session_connections.add_connection (_session->TransportStateChange.connect (boost::bind (&Editor::map_transport_state, this)));
-       _session_connections.add_connection (_session->PositionChanged.connect (boost::bind (&Editor::map_position_change, this, _1)));
-       _session_connections.add_connection (_session->RouteAdded.connect (boost::bind (&Editor::handle_new_route, this, _1)));
-       _session_connections.add_connection (_session->DurationChanged.connect (boost::bind (&Editor::handle_new_duration, this)));
-       _session_connections.add_connection (_session->DirtyChanged.connect (boost::bind (&Editor::update_title, this)));
-       _session_connections.add_connection (_session->StateSaved.connect (boost::bind (&Editor::update_title, this)));
-       _session_connections.add_connection (_session->AskAboutPlaylistDeletion.connect (boost::bind (&Editor::playlist_deletion_dialog, this, _1)));
-       _session_connections.add_connection (_session->TimecodeOffsetChanged.connect (boost::bind (&Editor::update_just_timecode, this)));
-       _session_connections.add_connection (_session->tempo_map().StateChanged.connect (boost::bind (&Editor::tempo_map_changed, this, _1)));
-       _session_connections.add_connection (_session->Located.connect (boost::bind (&Editor::located, this)));
-       _session_connections.add_connection (_session->config.ParameterChanged.connect (boost::bind (&Editor::parameter_changed, this, _1)));
+       _session->TransportStateChange.connect (_session_connections, boost::bind (&Editor::map_transport_state, this));
+       _session->PositionChanged.connect (_session_connections, boost::bind (&Editor::map_position_change, this, _1));
+       _session->RouteAdded.connect (_session_connections, boost::bind (&Editor::handle_new_route, this, _1));
+       _session->DurationChanged.connect (_session_connections, boost::bind (&Editor::handle_new_duration, this));
+       _session->DirtyChanged.connect (_session_connections, boost::bind (&Editor::update_title, this));
+       _session->StateSaved.connect (_session_connections, boost::bind (&Editor::update_title, this));
+       _session->AskAboutPlaylistDeletion.connect (_session_connections, boost::bind (&Editor::playlist_deletion_dialog, this, _1));
+       _session->TimecodeOffsetChanged.connect (_session_connections, boost::bind (&Editor::update_just_timecode, this));
+       _session->tempo_map().StateChanged.connect (_session_connections, boost::bind (&Editor::tempo_map_changed, this, _1));
+       _session->Located.connect (_session_connections, boost::bind (&Editor::located, this));
+       _session->config.ParameterChanged.connect (_session_connections, boost::bind (&Editor::parameter_changed, this, _1));
 
        if (Profile->get_sae()) {
                BBT_Time bbt;
@@ -1144,13 +1144,13 @@ Editor::set_session (Session *t)
 
        /* static signal - no need to drop connection when session is deleted (XXX or we are?)*/
 
-       _session->StateSaved.connect (sigc::mem_fun(*this, &Editor::session_state_saved));
+       _session->StateSaved.connect (*this, boost::bind (&Editor::session_state_saved, this, _1));
 
-       _session_connections.add_connection (_session->locations()->added.connect (sigc::mem_fun(*this, &Editor::add_new_location)));
-       _session_connections.add_connection (_session->locations()->removed.connect (sigc::mem_fun(*this, &Editor::location_gone)));
-       _session_connections.add_connection (_session->locations()->changed.connect (sigc::mem_fun(*this, &Editor::refresh_location_display)));
-       _session_connections.add_connection (_session->locations()->StateChanged.connect (sigc::mem_fun(*this, &Editor::refresh_location_display_s)));
-       _session_connections.add_connection (_session->locations()->end_location()->changed.connect (sigc::mem_fun(*this, &Editor::end_location_changed)));
+       _session->locations()->added.connect (_session_connections, sigc::mem_fun(*this, &Editor::add_new_location));
+       _session->locations()->removed.connect (_session_connections, sigc::mem_fun(*this, &Editor::location_gone));
+       _session->locations()->changed.connect (_session_connections, sigc::mem_fun(*this, &Editor::refresh_location_display));
+       _session->locations()->StateChanged.connect (_session_connections, sigc::mem_fun(*this, &Editor::refresh_location_display_s));
+       _session->locations()->end_location()->changed.connect (_session_connections, sigc::mem_fun(*this, &Editor::end_location_changed));
 
        handle_new_duration ();
 
@@ -3135,26 +3135,6 @@ Editor::State::~State ()
        delete selection;
 }
 
-void
-Editor::store_state (State& state) const
-{
-       *state.selection = *selection;
-}
-
-void
-Editor::restore_state (State *state)
-{
-       if (*selection == *state->selection) {
-               return;
-       }
-
-       *selection = *state->selection;
-       time_selection_changed ();
-       region_selection_changed ();
-
-       /* XXX other selection change handlers? */
-}
-
 void
 Editor::begin_reversible_command (string name)
 {
@@ -4829,7 +4809,7 @@ Editor::handle_new_route (RouteList& routes)
                rtv->view()->RegionViewAdded.connect (sigc::mem_fun (*this, &Editor::region_view_added));
                rtv->view()->HeightChanged.connect (sigc::mem_fun (*this, &Editor::streamview_height_changed));
 
-               scoped_connect (rtv->GoingAway, boost::bind (&Editor::remove_route, this, rtv));
+               rtv->GoingAway.connect (*this, boost::bind (&Editor::remove_route, this, rtv));
        }
 
        _routes->routes_added (new_views);
index a29df6ebb62ed6668aa82c2c385e70b544dd2640..e3cf417fa0ddd053d83961023634c2f3c5322866 100644 (file)
@@ -46,7 +46,7 @@
 #include <gtkmm2ext/dndtreeview.h>
 
 #include "pbd/stateful.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/import_status.h"
 #include "ardour/tempo.h"
@@ -154,7 +154,7 @@ struct EditorCursor {
        void set_length (double units);
        void set_y_axis (double position);
 
-       sigc::signal<void, nframes64_t> PositionChanged;
+        PBD::Signal1<void, nframes64_t> PositionChanged;
 };
 
 class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
@@ -1756,9 +1756,6 @@ public:
            ~State ();
        };
 
-       void store_state (State&) const;
-       void restore_state (State *);
-
        void instant_save ();
 
        boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
index bd97d42b4b7d89c970ce123f9469954c773b4ddb..4f864309f9bcd9ef370a283ed731f552c31eae43 100644 (file)
@@ -237,7 +237,7 @@ RegionDrag::RegionDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<Re
          _primary (p),
          _views (v)
 {
-       death_connection = RegionView::RegionViewGoingAway.connect (sigc::mem_fun (*this, &RegionDrag::region_going_away));
+       RegionView::RegionViewGoingAway.connect (death_connection, boost::bind (&RegionDrag::region_going_away, this, _1));
 }
 
 void
index 705c68586cdb4e3c019dab0876920b6346dc43e8..7f499c0c6fb504f8e41f94b32fc4468806b0ea8a 100644 (file)
@@ -1092,7 +1092,7 @@ Editor::handle_new_imageframe_time_axis_view(const string & track_name, void* sr
        row[route_display_columns.tv] = iftav;
        route_list_display.get_selection()->select (row);
 
-       scoped_connect (iftav->GoingAway, boost::bind (&Editor::remove_route, this, (TimeAxisView*)iftav));
+       iftav->GoingAway.connect (*this, boost::bind (&Editor::remove_route, this, (TimeAxisView*)iftav));
        iftav->gui_changed.connect(sigc::mem_fun(*this, &Editor::handle_gui_changes)) ;
 }
 
@@ -1109,7 +1109,7 @@ Editor::handle_new_imageframe_marker_time_axis_view(const string & track_name, T
        row[route_display_columns.tv] = mta;
        route_list_display.get_selection()->select (row);
 
-       scoped_connect (mta->GoingAway, boost::bind (&Editor::remove_route, this, (TimeAxisView*)mta));
+       mta->GoingAway.connect (*this, boost::bind (&Editor::remove_route, this, (TimeAxisView*)mta));
  }
 
 
index 4d9828a14d31f4c7a88677808ee14705eabb30af..dbee2fb9d2bd3e34c1fa967d4b7eea7e24e8831b 100644 (file)
@@ -123,11 +123,11 @@ Editor::add_new_location (Location *location)
                lam->show ();
        }
 
-       location->start_changed.connect (sigc::mem_fun(*this, &Editor::location_changed));
-       location->end_changed.connect (sigc::mem_fun(*this, &Editor::location_changed));
-       location->changed.connect (sigc::mem_fun(*this, &Editor::location_changed));
-       location->name_changed.connect (sigc::mem_fun(*this, &Editor::location_changed));
-       location->FlagsChanged.connect (sigc::mem_fun(*this, &Editor::location_flags_changed));
+       location->start_changed.connect (*this, boost::bind (&Editor::location_changed, this, _1));
+       location->end_changed.connect (*this, boost::bind (&Editor::location_changed, this, _1));
+       location->changed.connect (*this, boost::bind (&Editor::location_changed, this, _1));
+       location->name_changed.connect (*this, boost::bind (&Editor::location_changed, this, _1));
+       location->FlagsChanged.connect (*this, boost::bind (&Editor::location_flags_changed, this, _1, _2));
 
        pair<Location*,LocationMarkers*> newpair;
 
index 9decef5a2161b2e650c10f3c783fe3ef204511b9..6cb6046006ed0ad0e8cfa67b623e782e86c91d82 100644 (file)
@@ -168,7 +168,7 @@ Editor::create_editor_mixer ()
                                              _session,
                                              false);
        current_mixer_strip->Hiding.connect (sigc::mem_fun(*this, &Editor::current_mixer_strip_hidden));
-       scoped_connect (current_mixer_strip->GoingAway, boost::bind (&Editor::current_mixer_strip_removed, this));
+       current_mixer_strip->GoingAway.connect (*this, boost::bind (&Editor::current_mixer_strip_removed, this));
 #ifdef GTKOSX
        current_mixer_strip->WidthChanged.connect (sigc::mem_fun(*this, &Editor::ensure_all_elements_drawn));
 #endif
index 2501f93726dcedef1f134cc59a586d9bafc230ec..26ae2f6f502dd4fb7614886edd4b0c51feb3d4ae 100644 (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, &EditorRegions::update_all_rows));
-       ARDOUR::Region::RegionPropertyChanged.connect (sigc::mem_fun(*this, &EditorRegions::update_row));
+       ARDOUR::Region::RegionPropertyChanged.connect (region_property_connection, sigc::mem_fun(*this, &EditorRegions::update_row));
 
 }
 
@@ -135,9 +135,9 @@ EditorRegions::set_session (ARDOUR::Session* s)
        EditorComponent::set_session (s);
 
        if (_session) {
-               _session_connections.add_connection (_session->RegionsAdded.connect (boost::bind (&EditorRegions::handle_new_regions, this, _1)));
-               _session_connections.add_connection (_session->RegionRemoved.connect (boost::bind (&EditorRegions::handle_region_removed, this, _1)));
-               _session_connections.add_connection (_session->RegionHiddenChange.connect (boost::bind (&EditorRegions::region_hidden, this, _1)));
+               _session->RegionsAdded.connect (_session_connections, boost::bind (&EditorRegions::handle_new_regions, this, _1));
+               _session->RegionRemoved.connect (_session_connections, boost::bind (&EditorRegions::handle_region_removed, this, _1));
+               _session->RegionHiddenChange.connect (_session_connections, boost::bind (&EditorRegions::region_hidden, this, _1));
        }
 
        redisplay ();
index 59659d3879ff604969c05f0e0d515bf798138094..83fd91aacad101d92ea0df43f684271b190c3b42 100644 (file)
@@ -149,6 +149,7 @@ private:
        Editing::RegionListSortType _sort_type;
        bool _no_redisplay;
        std::list<boost::shared_ptr<ARDOUR::Region> > tmp_region_list;
+       PBD::ScopedConnection region_property_connection;
 };
 
 #endif /* __gtk_ardour_editor_regions_h__ */
index d0d0298c088c3521a68fea97cd1440550bfc900f..c52817a15aa17c878e8722b3cd1c07eebfb7578d 100644 (file)
@@ -574,7 +574,7 @@ EditorRouteGroups::add (RouteGroup* group)
                focus = true;
        }
 
-       group->FlagsChanged.connect (sigc::bind (sigc::mem_fun (*this, &EditorRouteGroups::flags_changed), group));
+       group->FlagsChanged.connect (flags_connection, boost::bind (&EditorRouteGroups::flags_changed, this, _1, group));
 
        if (focus) {
                TreeViewColumn* col = _display.get_column (0);
@@ -668,8 +668,8 @@ EditorRouteGroups::set_session (Session* s)
        EditorComponent::set_session (s);
 
        if (_session) {
-               _session_connections.add_connection (_session->route_group_added.connect (boost::bind (&EditorRouteGroups::add, this, _1)));
-               _session_connections.add_connection (_session->route_group_removed.connect (boost::bind (&EditorRouteGroups::groups_changed, this)));
+               _session->route_group_added.connect (_session_connections, boost::bind (&EditorRouteGroups::add, this, _1));
+               _session->route_group_removed.connect (_session_connections, boost::bind (&EditorRouteGroups::groups_changed, this));
        }
 
        groups_changed ();
index 5408649f9568bbc15ff250009c4a7da8c129986e..cb0162d142070d50982caf5f554123741cf68832 100644 (file)
@@ -93,6 +93,7 @@ private:
        Gtk::ScrolledWindow _scroller;
        Gtk::VBox* _display_packer;
        bool _in_row_change;
+       PBD::ScopedConnection flags_connection;
 };
 
 
index e3a831a8b907543cc0cb59896163e6f992442f24..3ef66161fbb53b5fc876d6cb3f6f5f00ac0e3d16 100644 (file)
@@ -150,7 +150,7 @@ EditorRoutes::EditorRoutes (Editor* e)
        _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);
 
-       scoped_connect (Route::SyncOrderKeys, (sigc::mem_fun (*this, &EditorRoutes::sync_order_keys)));
+       Route::SyncOrderKeys.connect (*this, (sigc::mem_fun (*this, &EditorRoutes::sync_order_keys)));
 }
 
 void
@@ -161,7 +161,7 @@ EditorRoutes::set_session (Session* s)
        initial_display ();
 
        if (_session) {
-               scoped_connect (_session->SoloChanged, (sigc::mem_fun (*this, &EditorRoutes::solo_changed_so_update_mute)));
+               _session->SoloChanged.connect (*this, (sigc::mem_fun (*this, &EditorRoutes::solo_changed_so_update_mute)));
        }
 }
 
@@ -383,18 +383,18 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes)
 
                boost::weak_ptr<Route> wr ((*x)->route());
 
-               scoped_connect ((*x)->route()->gui_changed, boost::bind (&EditorRoutes::handle_gui_changes, this, _1, _2));
-               scoped_connect ((*x)->route()->NameChanged, boost::bind (&EditorRoutes::route_name_changed, this, wr));
-               scoped_connect ((*x)->GoingAway, boost::bind (&EditorRoutes::route_removed, this, *x));
+               (*x)->route()->gui_changed.connect (*this, boost::bind (&EditorRoutes::handle_gui_changes, this, _1, _2));
+               (*x)->route()->NameChanged.connect (*this, boost::bind (&EditorRoutes::route_name_changed, this, wr));
+               (*x)->GoingAway.connect (*this, boost::bind (&EditorRoutes::route_removed, this, *x));
 
                if ((*x)->is_track()) {
                        boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> ((*x)->route());
-                       scoped_connect (t->diskstream()->RecordEnableChanged, boost::bind (&EditorRoutes::update_rec_display, this));
+                       t->diskstream()->RecordEnableChanged.connect (*this, boost::bind (&EditorRoutes::update_rec_display, this));
                }
 
-               scoped_connect ((*x)->route()->mute_changed, boost::bind (&EditorRoutes::update_mute_display, this));
-               scoped_connect ((*x)->route()->solo_changed, boost::bind (&EditorRoutes::update_solo_display, this));
-               scoped_connect ((*x)->route()->solo_isolated_changed, boost::bind (&EditorRoutes::update_solo_isolate_display, this));
+               (*x)->route()->mute_changed.connect (*this, boost::bind (&EditorRoutes::update_mute_display, this));
+               (*x)->route()->solo_changed.connect (*this, boost::bind (&EditorRoutes::update_solo_display, this));
+               (*x)->route()->solo_isolated_changed.connect (*this, boost::bind (&EditorRoutes::update_solo_isolate_display, this));
        }
 
        update_rec_display ();
index 23e1e9338894fcf67a61b93108c6d0d6f754a1e1..73a10c046c3c0628b1645989fa0a229cbd687a89 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef __ardour_gtk_editor_route_h__
 #define __ardour_gtk_editor_route_h__
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 #include "editor_component.h"
 
 class EditorRoutes : public EditorComponent, public PBD::ScopedConnectionList
index 8a62156a1921234b8812aec3cc8cdccfee93a0f7..93be5afd1330dced67636466c3ec1b76b2940245 100644 (file)
@@ -47,8 +47,8 @@ EditorSummary::EditorSummary (Editor* e)
          _zoom_dragging (false)
 
 {
-       Region::RegionPropertyChanged.connect (sigc::hide (sigc::mem_fun (*this, &EditorSummary::set_dirty)));
-       _editor->playhead_cursor->PositionChanged.connect (sigc::mem_fun (*this, &EditorSummary::playhead_position_changed));
+       Region::RegionPropertyChanged.connect (region_property_connection, boost::bind (&CairoWidget::set_dirty, this));
+       _editor->playhead_cursor->PositionChanged.connect (position_connection, boost::bind (&EditorSummary::playhead_position_changed, this, _1));
 }
 
 /** Connect to a session.
@@ -62,9 +62,9 @@ EditorSummary::set_session (Session* s)
        set_dirty ();
 
        if (_session) {
-               _session_connections.add_connection (_session->RegionRemoved.connect (boost::bind (&EditorSummary::set_dirty, this)));
-               _session_connections.add_connection (_session->StartTimeChanged.connect (boost::bind (&EditorSummary::set_dirty, this)));
-               _session_connections.add_connection (_session->EndTimeChanged.connect (boost::bind (&EditorSummary::set_dirty, this)));
+               _session->RegionRemoved.connect (_session_connections, boost::bind (&EditorSummary::set_dirty, this));
+               _session->StartTimeChanged.connect (_session_connections, boost::bind (&EditorSummary::set_dirty, this));
+               _session->EndTimeChanged.connect (_session_connections, boost::bind (&EditorSummary::set_dirty, this));
        }
 }
 
index e311b47ebd8a2b080ab628140a8abde619d8aed5..c59210e657b5b06d34d189779bb35e78ec5746c7 100644 (file)
@@ -78,6 +78,9 @@ private:
 
        bool _zoom_dragging;
        bool _zoom_left;
+
+       PBD::ScopedConnectionList position_connection;
+       PBD::ScopedConnectionList region_property_connection;
 };
 
 #endif
index 1ec466d44928d037b7ab4a91cb7485cbdf77823d..84202d57ea2149963672ef5b4c2c1a65abe0b3b8 100644 (file)
@@ -86,7 +86,7 @@ ExportDialog::set_session (ARDOUR::Session* s)
        timespan_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));
-       status->Aborting.connect (sigc::mem_fun (*this, &ExportDialog::notify_errors));
+       status->Aborting.connect (abort_connection, sigc::mem_fun (*this, &ExportDialog::notify_errors));
 
        update_warnings ();
 }
index 1895e5c3feaa3c20e04551d57edeedca3cf5d429..75511b5ad34b689044716b041fdf3cbb4965549b 100644 (file)
@@ -107,6 +107,7 @@ class ExportDialog : public ArdourDialog {
 
        PublicEditor &  editor;
        StatusPtr       status;
+       PBD::ScopedConnection abort_connection;
 
        /*** GUI components ***/
 
index 93a78cdad2fb1b5b16004d8fd2f024c40555035c..5961715d835450972221db171c08fa6cf4d07fe7 100644 (file)
@@ -196,7 +196,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));
 
-       profile_manager->FormatListChanged.connect (sigc::mem_fun (format_selector, &ExportFormatSelector::update_format_list));
+       profile_manager->FormatListChanged.connect (format_connection, boost::bind (&ExportFormatSelector::update_format_list, &format_selector));
 
        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));
index 720c3b4bfde9a3bc000e05ad4bb61553a7880857..35768d72a91958c1858e8fb884d7df391a12c802 100644 (file)
@@ -97,6 +97,7 @@ class ExportFileNotebook : public Gtk::Notebook, public ARDOUR::SessionHandlePtr
                Gtk::Label              format_label;
                Gtk::Alignment          format_align;
                ExportFormatSelector    format_selector;
+               PBD::ScopedConnection   format_connection;
 
                Gtk::Label              filename_label;
                Gtk::Alignment          filename_align;
index 05c17598670ece2f469a0e6b1472baaa99856002..1c93115da3275d9f2157d975608e73e928a191bc 100644 (file)
@@ -127,7 +127,7 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) :
        close_button = add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_APPLY);
        close_button->set_sensitive (false);
        close_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportFormatDialog::end_dialog));
-       manager.CompleteChanged.connect (sigc::mem_fun (*close_button, &Gtk::Button::set_sensitive));
+       manager.CompleteChanged.connect (*this, sigc::mem_fun (close_button, &Gtk::Button::set_sensitive));
 
        /* Load state before hooking up the rest of the signals */
 
@@ -319,7 +319,7 @@ ExportFormatDialog::init_format_table ()
                row[compatibility_cols.label] = (*it)->name();
 
                WeakCompatPtr ptr (*it);
-               (*it)->SelectChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_compatibility_selection), ptr));
+               (*it)->SelectChanged.connect (*this, boost::bind (&ExportFormatDialog::change_compatibility_selection, this, _1, ptr));
        }
 
        compatibility_view.append_column_editable ("", compatibility_cols.selected);
@@ -347,8 +347,8 @@ ExportFormatDialog::init_format_table ()
                row[quality_cols.label] = (*it)->name();
 
                WeakQualityPtr ptr (*it);
-               (*it)->SelectChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_quality_selection), ptr));
-               (*it)->CompatibleChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_quality_compatibility), ptr));
+               (*it)->SelectChanged.connect (*this, boost::bind (&ExportFormatDialog::change_quality_selection, this, _1, ptr));
+               (*it)->CompatibleChanged.connect (*this, boost::bind (&ExportFormatDialog::change_quality_compatibility, this, _1, ptr));
        }
 
        quality_view.append_column ("", quality_cols.label);
@@ -369,19 +369,19 @@ ExportFormatDialog::init_format_table ()
                row[format_cols.label] = (*it)->name();
 
                WeakFormatPtr ptr (*it);
-               (*it)->SelectChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_format_selection), ptr));
-               (*it)->CompatibleChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_format_compatibility), ptr));
+               (*it)->SelectChanged.connect (*this, boost::bind (&ExportFormatDialog::change_format_selection, this, _1, ptr));
+               (*it)->CompatibleChanged.connect (*this, boost::bind (&ExportFormatDialog::change_format_compatibility, this, _1, ptr));
 
                /* Encoding options */
 
                boost::shared_ptr<HasSampleFormat> hsf;
 
                if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (*it)) {
-                       hsf->SampleFormatSelectChanged.connect (sigc::mem_fun (*this, &ExportFormatDialog::change_sample_format_selection));
-                       hsf->SampleFormatCompatibleChanged.connect (sigc::mem_fun (*this, &ExportFormatDialog::change_sample_format_compatibility));
+                       hsf->SampleFormatSelectChanged.connect (*this, boost::bind (&ExportFormatDialog::change_sample_format_selection, this, _1, _2));
+                       hsf->SampleFormatCompatibleChanged.connect (*this, boost::bind (&ExportFormatDialog::change_sample_format_compatibility, this, _1, _2));
 
-                       hsf->DitherTypeSelectChanged.connect (sigc::mem_fun (*this, &ExportFormatDialog::change_dither_type_selection));
-                       hsf->DitherTypeCompatibleChanged.connect (sigc::mem_fun (*this, &ExportFormatDialog::change_dither_type_compatibility));
+                       hsf->DitherTypeSelectChanged.connect (*this, boost::bind (&ExportFormatDialog::change_dither_type_selection, this, _1, _2));
+                       hsf->DitherTypeCompatibleChanged.connect (*this, boost::bind (&ExportFormatDialog::change_dither_type_compatibility, this, _1, _2));
                }
        }
 
@@ -401,10 +401,10 @@ ExportFormatDialog::init_format_table ()
                row[sample_rate_cols.ptr] = *it;
                row[sample_rate_cols.color] = "white";
                row[sample_rate_cols.label] = (*it)->name();
-
+               
                WeakSampleRatePtr ptr (*it);
-               (*it)->SelectChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_sample_rate_selection), ptr));
-               (*it)->CompatibleChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_sample_rate_compatibility), ptr));
+               (*it)->SelectChanged.connect (*this, boost::bind (&ExportFormatDialog::change_sample_rate_selection, this, _1, ptr));
+               (*it)->CompatibleChanged.connect (*this, boost::bind (&ExportFormatDialog::change_sample_rate_compatibility, this, _1, ptr));
        }
 
        sample_rate_view.append_column ("", sample_rate_cols.label);
index 418b015d8ca628eb7e5daab2fd23f67200cf5f31..33a40150220cbed245b0d58953a4e459cc91ff99 100644 (file)
 #include "ardour/export_formats.h"
 
 #include "pbd/xml++.h"
+#include "pbd/signals.h"
 
 #include "ardour_dialog.h"
 #include "audio_clock.h"
 
 #include <gtkmm.h>
 
-class ExportFormatDialog : public ArdourDialog {
+class ExportFormatDialog : public ArdourDialog, public PBD::ScopedConnectionList {
   private:
 
        typedef ARDOUR::ExportFormatManager::WeakCompatPtr WeakCompatPtr;
index 26036f6e665f844097df5417f00faedc219f242b..3c3b70c7cfacbc96e6314730ec966f7451aa0edd 100644 (file)
@@ -226,13 +226,13 @@ GainMeterBase::set_controls (boost::shared_ptr<Route> r,
 
                boost::shared_ptr<AutomationControl> gc = amp->gain_control();
                
-               model_connections.add_connection (gc->alist()->automation_state_changed.connect (boost::bind (&GainMeter::gain_automation_state_changed, this)));
-               model_connections.add_connection (gc->alist()->automation_style_changed.connect (boost::bind (&GainMeter::gain_automation_style_changed, this)));
+               gc->alist()->automation_state_changed.connect (model_connections, boost::bind (&GainMeter::gain_automation_state_changed, this));
+               gc->alist()->automation_style_changed.connect (model_connections, boost::bind (&GainMeter::gain_automation_style_changed, this));
                
                gain_automation_state_changed ();
        }
        
-       model_connections.add_connection (amp->gain_control()->Changed.connect (boost::bind (&GainMeterBase::gain_changed, this)));
+       amp->gain_control()->Changed.connect (model_connections, boost::bind (&GainMeterBase::gain_changed, this));
 
        gain_changed ();
        show_gain ();
index 16c818deada582ed8594fe987fad364032382e9f..7d089e2ef12244e3321f069d1fdb3bd599c74547 100644 (file)
@@ -32,7 +32,7 @@
 #include <gtkmm/drawingarea.h>
 #include <gdkmm/colormap.h>
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/types.h"
 #include "ardour/session_handle.h"
index dc8307eecb8704730243df2388203e396b0179f6..1865c1e0a2d16e640efd9e278ec96a14bf1e5822 100644 (file)
@@ -125,8 +125,7 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
                main_contents.pack_start (hpacker, false, false);
        }
 
-       pi->ActiveChanged.connect (sigc::bind(sigc::mem_fun(*this, &GenericPluginUI::processor_active_changed),
-                                       boost::weak_ptr<Processor>(pi)));
+       pi->ActiveChanged.connect (active_connection, boost::bind (&GenericPluginUI::processor_active_changed, this, boost::weak_ptr<Processor>(pi)));
 
        bypass_button.set_active (!pi->active());
 
@@ -421,7 +420,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
                                //control_ui->combo->set_value_in_list(true, false);
                                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));
-                               mcontrol->Changed.connect (sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::parameter_changed), control_ui));
+                               mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::parameter_changed, this, control_ui));
                                control_ui->pack_start(control_ui->label, true, true);
                                control_ui->pack_start(*control_ui->combo, false, true);
 
@@ -442,7 +441,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
                                //control_ui->combo->set_value_in_list(true, false);
                                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));
-                               mcontrol->Changed.connect (sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::parameter_changed), control_ui));
+                               mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::parameter_changed, this, control_ui));
                                control_ui->pack_start(control_ui->label, true, true);
                                control_ui->pack_start(*control_ui->combo, false, true);
 
@@ -467,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->button->signal_clicked().connect (sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::control_port_toggled), control_ui));
-                       mcontrol->Changed.connect (sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::toggle_parameter_changed), control_ui));
+                       mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::toggle_parameter_changed, this, control_ui));
 
                        if (plugin->get_parameter (port_index) > 0.5){
                                control_ui->button->set_active(true);
@@ -543,9 +542,8 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
 
                automation_state_changed (control_ui);
 
-               mcontrol->Changed.connect (sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::parameter_changed), control_ui));
-               mcontrol->alist()->automation_state_changed.connect
-                       (sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::automation_state_changed), control_ui));
+               mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::parameter_changed, this, control_ui));
+               mcontrol->alist()->automation_state_changed.connect (control_connections, boost::bind (&GenericPluginUI::automation_state_changed, this, control_ui));
 
        } else if (plugin->parameter_is_output (port_index)) {
 
@@ -594,7 +592,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
                output_controls.push_back (control_ui);
        }
 
-       mcontrol->Changed.connect (sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::parameter_changed), control_ui));
+       mcontrol->Changed.connect (control_connections, boost::bind (&GenericPluginUI::parameter_changed, this, control_ui));
 
        return control_ui;
 }
index c7a10636ffcb89ade62d407a43f5882d83c29ebd..edf1e0e139568607bc1fd86a850d2d6a4290d342 100644 (file)
@@ -34,7 +34,7 @@ using namespace Editing;
 using namespace ArdourCanvas;
 using namespace ARDOUR;
 
-boost::signals2::signal<void(GhostRegion*)> GhostRegion::GoingAway;
+PBD::Signal1<void,GhostRegion*> GhostRegion::GoingAway;
 
 GhostRegion::GhostRegion (ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_pos)
        : trackview (tv)
index 0932594a6f8b5bccb8f04e43619d57ce853018bc..b2050996a67aff9a451ad51001392b0f881d197e 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <vector>
 #include <libgnomecanvasmm.h>
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 #include "canvas.h"
 
 namespace Gnome {
@@ -57,7 +57,7 @@ public:
        ArdourCanvas::Group* group;
        ArdourCanvas::SimpleRect* base_rect;
 
-       static boost::signals2::signal<void(GhostRegion*)> GoingAway;
+       static PBD::Signal1<void,GhostRegion*> GoingAway;
 };
 
 class AudioGhostRegion : public GhostRegion {
index 3a7206c9d420a857445edfca5456c5cf331eb405..17cec93f82f0e483079aea0aa8d9b560e13ea262 100644 (file)
@@ -45,7 +45,7 @@ GroupTabs::set_session (Session* s)
        EditorComponent::set_session (s);
 
        if (_session) {
-               _session_connections.add_connection (_session->RouteGroupChanged.connect (boost::bind (&GroupTabs::set_dirty, this)));
+               _session->RouteGroupChanged.connect (_session_connections, boost::bind (&GroupTabs::set_dirty, this));
        }
 }
 
index 9e1eef2b2e7bb8a8ce13e1c889323401afbcd30d..9dbcb313923a7aff54cf73182322a51566c412e0 100644 (file)
@@ -322,7 +322,7 @@ ImageFrameTimeAxis::add_marker_time_axis(MarkerTimeAxis* marker_track, void* src
        else
        {
                marker_time_axis_list.push_back(marker_track) ;
-               scoped_connect (marker_track->GoingAway, 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));
 
                 MarkerTimeAxisAdded(marker_track, src) ; /* EMIT_SIGNAL */
                ret = true ;
index 28d2aac1a16d4edc4b66002fa57377819c535edf..4c33d73dfcfd0c2bf015c2d0b598d341203c6010 100644 (file)
@@ -216,7 +216,7 @@ ImageFrameTimeAxisGroup::add_imageframe_item(const string & frame_id, nframes_t
 
                imageframe_views.push_front(ifv) ;
 
-               scoped_connect (ifv->GoingAway, boost::bind (&ImageFrameTimeAxisGroup::remove_imageframe_item, this, (void*)this));
+               ifv->GoingAway.connect (*this, boost::bind (&ImageFrameTimeAxisGroup::remove_imageframe_item, this, (void*)this));
 
                 ImageFrameAdded(ifv, src) ; /* EMIT_SIGNAL */
        }
index fa339b42ec23a211a24330b3838960dbba17db7f..05dda6bc8ea081b9845e6cc17e7167203cb46496 100644 (file)
@@ -214,9 +214,9 @@ ImageFrameTimeAxisView::add_imageframe_group(std::string group_id, void* src)
 
                imageframe_groups.push_front(iftag) ;
 
-               scoped_connect (iftag->GoingAway, boost::bind (&ImageFrameTimeAxisView::remove_imageframe_group, this, iftag, (void*)this)) ;
+               iftag->GoingAway.connect (*this, boost::bind (&ImageFrameTimeAxisView::remove_imageframe_group, this, iftag, (void*)this));
 
-                ImageFrameGroupAdded(iftag, src) ; /* EMIT_SIGNAL */
+               ImageFrameGroupAdded(iftag, src) ; /* EMIT_SIGNAL */
        }
 
        return(iftag) ;
index c704eb9768269b26bf9f187643d96983c9dc7590..273ac30b992ae63dd5fa80d56112d1b2b555a1be 100644 (file)
@@ -287,7 +287,7 @@ ImageFrameView::add_marker_view_item(MarkerView* item, void* src)
 {
        marker_view_list.push_back(item) ;
 
-       scoped_connect (item->GoingAway, boost::bind (&ImageFrameView::remove_marker_view_item, this, (void*)this));
+       item->GoingAway.connect (*this, boost::bind (&ImageFrameView::remove_marker_view_item, this, (void*)this));
 
         MarkerViewAdded(item, src) ; /* EMIT_SIGNAL */
 }
index 77f917d92b275bb4df93b6e6db303d81dd396fc3..e038035a95198e26e2ad15d8b471bd2b35ece463 100644 (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);
 
-       going_away_connection = pi->GoingAway.connect (sigc::mem_fun (*this, &PortInsertWindow::plugin_going_away));
+       pi->GoingAway.connect (going_away_connection, boost::bind (&PortInsertWindow::plugin_going_away, this));
 }
 
 bool
index bd85596a8cb3527cb9fdb86dc66da1f42760b45a..c0908d82953551290ac8a26423ec0f6ef5224df5 100644 (file)
@@ -59,7 +59,7 @@ LevelMeter::LevelMeter (Session* s)
 {
        set_session (s);
        set_spacing (1);
-       Config->ParameterChanged.connect (sigc::mem_fun (*this, &LevelMeter::parameter_changed));
+       Config->ParameterChanged.connect (_parameter_connection, boost::bind (&LevelMeter::parameter_changed, this, _1));
        UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &LevelMeter::on_theme_changed));
        ColorsChanged.connect (sigc::mem_fun (*this, &LevelMeter::color_handler));
        max_peak = minus_infinity();
@@ -85,7 +85,7 @@ LevelMeter::set_meter (PeakMeter* meter)
        _meter = meter;
 
        if (_meter) {
-               _configuration_connection = _meter->ConfigurationChanged.connect(boost::bind (&LevelMeter::configuration_changed, this, _1, _2));
+               _meter->ConfigurationChanged.connect (_configuration_connection, boost::bind (&LevelMeter::configuration_changed, this, _1, _2));
        }
 }
 
index cd2ccb7d7df612e16c72dcf26bd0480b2c42dc32..4b2a0cdbc95948a2dc2ba1faa491038a2786cfb9 100644 (file)
@@ -68,7 +68,7 @@ class LevelMeter : public Gtk::HBox, public ARDOUR::SessionHandlePtr
 
   private:
        ARDOUR::PeakMeter* _meter;
-
+       
        Width _width;
 
        struct MeterInfo {
@@ -91,7 +91,8 @@ class LevelMeter : public Gtk::HBox, public ARDOUR::SessionHandlePtr
        std::vector<MeterInfo> meters;
        float                  max_peak;
 
-       boost::signals2::scoped_connection _configuration_connection;
+       PBD::ScopedConnection _configuration_connection;
+       PBD::ScopedConnection _parameter_connection;
 
        void hide_all_meters ();
        gint meter_button_release (GdkEventButton*, uint32_t);
index 328d87b5449ec182a4805fce0d8d4c010e103f7d..61a0ec1405c2569673bfe4f9d1bee579e68858ef 100644 (file)
@@ -282,11 +282,11 @@ LocationEditRow::set_location (Location *loc)
        end_clock.set_sensitive (!location->locked());
        length_clock.set_sensitive (!location->locked());
 
-       connections.add_connection (location->start_changed.connect (boost::bind (&LocationEditRow::start_changed, this, _1)));
-       connections.add_connection (location->end_changed.connect (boost::bind (&LocationEditRow::end_changed, this, _1)));
-       connections.add_connection (location->name_changed.connect (boost::bind (&LocationEditRow::name_changed, this, _1)));
-       connections.add_connection (location->changed.connect (boost::bind (&LocationEditRow::location_changed, this, _1)));
-       connections.add_connection (location->FlagsChanged.connect (boost::bind (&LocationEditRow::flags_changed, this, _1, _2)));
+       location->start_changed.connect (connections, boost::bind (&LocationEditRow::start_changed, this, _1));
+       location->end_changed.connect (connections, boost::bind (&LocationEditRow::end_changed, this, _1));
+       location->name_changed.connect (connections, boost::bind (&LocationEditRow::name_changed, this, _1));
+       location->changed.connect (connections, boost::bind (&LocationEditRow::location_changed, this, _1));
+       location->FlagsChanged.connect (connections, boost::bind (&LocationEditRow::flags_changed, this, _1, _2));
 }
 
 void
@@ -860,10 +860,10 @@ LocationUI::set_session(ARDOUR::Session* s)
        SessionHandlePtr::set_session (s);
 
        if (_session) {
-               _session_connections.add_connection (_session->locations()->changed.connect (boost::bind (&LocationUI::refresh_location_list, this)));
-               _session_connections.add_connection (_session->locations()->StateChanged.connect (boost::bind (&LocationUI::refresh_location_list, this)));
-               _session_connections.add_connection (_session->locations()->added.connect (boost::bind (&LocationUI::location_added, this, _1)));
-               _session_connections.add_connection (_session->locations()->removed.connect (boost::bind (&LocationUI::location_removed, this, _1)));
+               _session->locations()->changed.connect (_session_connections, boost::bind (&LocationUI::refresh_location_list, this));
+               _session->locations()->StateChanged.connect (_session_connections, boost::bind (&LocationUI::refresh_location_list, this));
+               _session->locations()->added.connect (_session_connections, boost::bind (&LocationUI::location_added, this, _1));
+               _session->locations()->removed.connect (_session_connections, boost::bind (&LocationUI::location_removed, this, _1));
        }
 
        refresh_location_list ();
index dd735cddba96a571fbde2230646106bbd818139f..ea6b80f3a4f562396c8840e34c49e039dead60bc 100644 (file)
@@ -29,7 +29,7 @@
 #include <gtkmm/paned.h>
 #include <gtkmm/scrolledwindow.h>
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/location.h"
 #include "ardour/session_handle.h"
index 335c643373a76eac01346b32828847c7810c69cd..2f108efc8a928616b38d56d96abe9c4b8a5bc512 100644 (file)
@@ -227,7 +227,7 @@ LV2PluginUI::lv2ui_instantiate(const Glib::ustring& title)
                }
        }
 
-       _lv2->ParameterChanged.connect(sigc::mem_fun(*this, &LV2PluginUI::parameter_changed));
+       _lv2->ParameterChanged.connect (parameter_connection, boost::bind (&LV2PluginUI::parameter_changed, this, _1, _2));
 }
 
 LV2PluginUI::~LV2PluginUI ()
index cad242a6f021dc4a09f126b1048810ad7e901f2e..bc9b14c8f30ee570666b4e29dfd16589b1d6a744 100644 (file)
@@ -92,6 +92,8 @@ class LV2PluginUI : public PlugUIBase, public Gtk::VBox
 
        virtual bool on_window_show(const Glib::ustring& title);
        virtual void on_window_hide();
+
+       PBD::ScopedConnection parameter_connection;
 };
 
 #endif // HAVE_SLV2
index 402f2ac479a9a9e45b9ccd5b0728449e5bed8edc..2d9a30b0a32050c1f0a73cae1573aa8d4601ed9c 100644 (file)
@@ -211,7 +211,7 @@ MarkerTimeAxisView::add_marker_view(ImageFrameView* ifv, std::string mark_type,
        ifv->add_marker_view_item(mv, src) ;
        marker_view_list.push_front(mv) ;
 
-       scoped_connect (mv->GoingAway, boost::bind (&MarkerTimeAxisView::remove_marker_view, this, (void*)this));
+       mv->GoingAway.connect (*this, boost::bind (&MarkerTimeAxisView::remove_marker_view, this, (void*)this));
 
         MarkerViewAdded(mv,src) ; /* EMIT_SIGNAL */
 
index d2f1657821dfcee7abef49b6643599b05991bf00..4f0c25a72c9acca579b60b059d2d7991e996c35c 100644 (file)
@@ -585,7 +585,7 @@ MidiRegionView::display_model(boost::shared_ptr<MidiModel> model)
 {
        _model = model;
        content_connection.disconnect ();
-       content_connection = _model->ContentsChanged.connect (boost::bind (&MidiRegionView::redisplay_model, this));
+       _model->ContentsChanged.connect (content_connection, boost::bind (&MidiRegionView::redisplay_model, this));
 
        clear_events ();
 
@@ -1071,7 +1071,7 @@ MidiRegionView::add_ghost (TimeAxisView& tv)
                }
        }
 
-       ghost->GoingAway.connect (boost::bind (&RegionView::remove_ghost, this, _1));
+       ghost->GoingAway.connect (*this, boost::bind (&RegionView::remove_ghost, this, _1));
 
        return ghost;
 }
index 4d0c7fa3856dd439ea85891c312f03672acbe556..76d34a4a5079e4ff7e04fce79da3740b6b0591a5 100644 (file)
@@ -180,7 +180,7 @@ MidiStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wfd,
        display_region (region_view, wfd);
 
        /* catch regionview going away */
-       scoped_connect (region->GoingAway, boost::bind (&MidiStreamView::remove_region_view, this, region));
+       region->GoingAway.connect (*this, boost::bind (&MidiStreamView::remove_region_view, this, region));
 
        RegionViewAdded (region_view);
 
@@ -401,9 +401,9 @@ MidiStreamView::setup_rec_box ()
 
                                sources.push_back(mds->write_source());
 
-                               rec_data_ready_connections.add_connection (mds->write_source()->ViewDataRangeReady.connect 
-                                                                          (boost::bind (&MidiStreamView::rec_data_range_ready, this,
-                                                                                        _1, _2, boost::weak_ptr<Source>(mds->write_source()))));
+                               mds->write_source()->ViewDataRangeReady.connect 
+                                       (rec_data_ready_connections, boost::bind (&MidiStreamView::rec_data_range_ready, this,
+                                                                                 _1, _2, boost::weak_ptr<Source>(mds->write_source())));
 
                                // handle multi
 
index 9344e199430db8947ade7511b71635064e32a158..3b1ad17a2215664102b579e663027969c5e3af73 100644 (file)
@@ -137,7 +137,7 @@ MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session* sess,
 
        set_state (*xml_node, Stateful::loading_state_version);
 
-       _route->processors_changed.connect (sigc::mem_fun(*this, &MidiTimeAxisView::processors_changed));
+       _route->processors_changed.connect (*this, boost::bind (&MidiTimeAxisView::processors_changed, this, _1));
 
        if (is_track()) {
                _piano_roll_header = new PianoRollHeader(*midi_view());
index bfbdb6ac6e1040abe9b5b38dc48e17ec3c8813cb..275cd14b0276caf67a178ffa6b3a2342c95c6e8e 100644 (file)
@@ -257,8 +257,8 @@ MixerStrip::init ()
        _packed = false;
        _embedded = false;
 
-       _session->engine().Stopped.connect (sigc::mem_fun(*this, &MixerStrip::engine_stopped));
-       _session->engine().Running.connect (sigc::mem_fun(*this, &MixerStrip::engine_running));
+       _session->engine().Stopped.connect (*this, boost::bind (&MixerStrip::engine_stopped, this));
+       _session->engine().Running.connect (*this, boost::bind (&MixerStrip::engine_running, this));
 
        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);
@@ -363,7 +363,7 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
 
                boost::shared_ptr<AudioTrack> at = audio_track();
 
-               connections.add_connection (at->FreezeChange.connect (sigc::mem_fun(*this, &MixerStrip::map_frozen)));
+               at->FreezeChange.connect (route_connections, boost::bind (&MixerStrip::map_frozen, this));
 
                button_table.attach (*rec_enable_button, 0, 2, 2, 3);
                rec_enable_button->set_sensitive (_session->writable());
@@ -412,22 +412,22 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
                                                   _("Click to Add/Edit Comments"):
                                                   _route->comment());
 
-       connections.add_connection (_route->meter_change.connect (sigc::mem_fun(*this, &MixerStrip::meter_changed)));
-       connections.add_connection (_route->input()->changed.connect (sigc::mem_fun(*this, &MixerStrip::input_changed)));
-       connections.add_connection (_route->output()->changed.connect (sigc::mem_fun(*this, &MixerStrip::output_changed)));
-       connections.add_connection (_route->route_group_changed.connect (sigc::mem_fun(*this, &MixerStrip::route_group_changed)));
+       _route->meter_change.connect (route_connections, boost::bind (&MixerStrip::meter_changed, this, _1));
+       _route->input()->changed.connect (route_connections, boost::bind (&MixerStrip::input_changed, this, _1, _2));
+       _route->output()->changed.connect (route_connections, boost::bind (&MixerStrip::output_changed, this, _1, _2));
+       _route->route_group_changed.connect (route_connections, boost::bind (&MixerStrip::route_group_changed, this));
 
        if (_route->panner()) {
-               connections.add_connection (_route->panner()->Changed.connect (sigc::mem_fun(*this, &MixerStrip::connect_to_pan)));
+               _route->panner()->Changed.connect (route_connections, boost::bind (&MixerStrip::connect_to_pan, this));
        }
 
        if (is_audio_track()) {
-               connections.add_connection (audio_track()->DiskstreamChanged.connect (sigc::mem_fun(*this, &MixerStrip::diskstream_changed)));
+               audio_track()->DiskstreamChanged.connect (route_connections, boost::bind (&MixerStrip::diskstream_changed, this));
        }
 
-       connections.add_connection (_route->NameChanged.connect (sigc::mem_fun(*this, &RouteUI::name_changed)));
-       connections.add_connection (_route->comment_changed.connect (sigc::mem_fun(*this, &MixerStrip::comment_changed)));
-       connections.add_connection (_route->gui_changed.connect (sigc::mem_fun(*this, &MixerStrip::route_gui_changed)));
+       _route->NameChanged.connect (route_connections, boost::bind (&RouteUI::name_changed, this));
+       _route->comment_changed.connect (route_connections, boost::bind (&MixerStrip::comment_changed, this, _1));
+       _route->gui_changed.connect (route_connections, boost::bind (&MixerStrip::route_gui_changed, this, _1, _2));
 
        set_stuff_from_route ();
 
@@ -928,8 +928,8 @@ MixerStrip::connect_to_pan ()
                                _route->panner()->data().control(Evoral::Parameter(PanAutomation)));
 
        if (pan_control) {
-               panstate_connection = pan_control->alist()->automation_state_changed.connect (sigc::mem_fun(panners, &PannerUI::pan_automation_state_changed));
-               panstyle_connection = pan_control->alist()->automation_style_changed.connect (sigc::mem_fun(panners, &PannerUI::pan_automation_style_changed));
+               pan_control->alist()->automation_state_changed.connect (panstate_connection, boost::bind (&PannerUI::pan_automation_state_changed, &panners));
+               pan_control->alist()->automation_style_changed.connect (panstyle_connection, boost::bind (&PannerUI::pan_automation_style_changed, &panners));
        }
 
        panners.pan_changed (this);
@@ -1693,7 +1693,7 @@ MixerStrip::show_send (boost::shared_ptr<Send> send)
        _current_delivery = send;
 
        send->set_metering (true);
-       send_gone_connection = _current_delivery->GoingAway.connect (sigc::mem_fun (*this, &MixerStrip::revert_to_default_display));
+       _current_delivery->GoingAway.connect (send_gone_connection, boost::bind (&MixerStrip::revert_to_default_display, this));
 
        gain_meter().set_controls (_route, send->meter(), send->amp());
        gain_meter().setup_meters ();
index 9ec05c020ceb0a77814ffc4841bf4ad65bf1cce1..0484db6fe720b4ae19476d10a745106bc048d402 100644 (file)
@@ -74,7 +74,7 @@ Mixer_UI::Mixer_UI ()
        strip_redisplay_does_not_sync_order_keys = false;
        ignore_sync = false;
 
-       Route::SyncOrderKeys.connect (sigc::mem_fun (*this, &Mixer_UI::sync_order_keys));
+       Route::SyncOrderKeys.connect (*this, boost::bind (&Mixer_UI::sync_order_keys, this, _1));
 
        scroller_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
        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->NameChanged.connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_name_changed), strip));
+               route->NameChanged.connect (*this,  boost::bind (&Mixer_UI::strip_name_changed, this, strip));
 
-               scoped_connect (strip->GoingAway, boost::bind (&Mixer_UI::remove_strip, this, strip));
+               strip->GoingAway.connect (*this, boost::bind (&Mixer_UI::remove_strip, this, strip));
                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));
        }
@@ -476,10 +476,10 @@ Mixer_UI::set_session (Session* sess)
 
        initial_track_display ();
 
-       _session_connections.add_connection (_session->RouteAdded.connect (boost::bind (&Mixer_UI::add_strip, this, _1)));
-       _session_connections.add_connection (_session->route_group_added.connect (boost::bind (&Mixer_UI::add_route_group, this, _1)));
-       _session_connections.add_connection (_session->route_group_removed.connect (boost::bind (&Mixer_UI::route_groups_changed, this)));
-       _session_connections.add_connection (_session->config.ParameterChanged.connect (boost::bind (&Mixer_UI::parameter_changed, this, _1)));
+       _session->RouteAdded.connect (_session_connections, boost::bind (&Mixer_UI::add_strip, this, _1));
+       _session->route_group_added.connect (_session_connections, boost::bind (&Mixer_UI::add_route_group, this, _1));
+       _session->route_group_removed.connect (_session_connections, boost::bind (&Mixer_UI::route_groups_changed, this));
+       _session->config.ParameterChanged.connect (_session_connections, boost::bind (&Mixer_UI::parameter_changed, this, _1));
 
        route_groups_changed ();
 
@@ -1252,7 +1252,7 @@ Mixer_UI::add_route_group (RouteGroup* group)
                focus = true;
        }
 
-       group->FlagsChanged.connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::group_flags_changed), group));
+       group->FlagsChanged.connect (*this,  boost::bind (&Mixer_UI::group_flags_changed, this, _1, group));
 
        if (focus) {
                TreeViewColumn* col = group_display.get_column (0);
index 275c0151cda839b8198878cd27ae1da288dfc114..eeda3c406210993cf32e1dbfc728f354acb3d2d8 100644 (file)
@@ -33,7 +33,7 @@
 #include <gtkmm/treeview.h>
 
 #include "pbd/stateful.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/ardour.h"
 #include "ardour/session_handle.h"
index b67180cb09fc1142cdaa6455c2726dce08767d6a..f11731b6de7a2711163208dc65e74fa1bec55cca 100644 (file)
@@ -164,7 +164,7 @@ OptionEditor::OptionEditor (Configuration* c, std::string const & t)
        show_all_children();
 
        /* Watch out for changes to parameters */
-       _config->ParameterChanged.connect (sigc::mem_fun (*this, &OptionEditor::parameter_changed));
+       _config->ParameterChanged.connect (config_connection, boost::bind (&OptionEditor::parameter_changed, this, _1));
 }
 
 OptionEditor::~OptionEditor ()
index ec68a5d8d919d86048db5bfa57421409e3c0b2a8..0f14b05b2580e812709599ce041ddef782f80ca2 100644 (file)
@@ -364,6 +364,7 @@ protected:
 private:
 
        void parameter_changed (std::string const &);
+       PBD::ScopedConnection config_connection;
 
        Gtk::Notebook _notebook;
        std::map<std::string, OptionEditorPage*> _pages;
index 08a4aa7b1bf6ee28fba77026f9e51640c96df8a0..8b7f5802b56ac6173c809b852273d7458486b9cc 100644 (file)
@@ -72,8 +72,8 @@ Panner2d::Panner2d (boost::shared_ptr<Panner> p, int32_t h)
        allow_y = false;
        allow_target = false;
 
-       panner->StateChanged.connect (sigc::mem_fun(*this, &Panner2d::handle_state_change));
-       panner->Changed.connect (sigc::mem_fun(*this, &Panner2d::handle_position_change));
+       panner->StateChanged.connect (state_connection, boost::bind (&Panner2d::handle_state_change, this));
+       panner->Changed.connect (change_connection, boost::bind (&Panner2d::handle_position_change, this));
 
        drag_target = 0;
        set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);
index 91f4851746d1b0233934cd7765de881c4fe56e19..0299558f8f880a064532d5498b7f8a88723f0bca 100644 (file)
@@ -128,6 +128,9 @@ class Panner2d : public Gtk::DrawingArea
        void toggle_bypass ();
        void handle_state_change ();
        void handle_position_change ();
+
+       PBD::ScopedConnection state_connection;
+       PBD::ScopedConnection change_connection;
 };
 
 class Panner2dWindow : public Gtk::Window
index 7e80c9e641317bbbf3fcb528a188194465d2ccf3..4321a7ebad774c0f6d3dacfb03565c18e03570e6 100644 (file)
@@ -151,9 +151,9 @@ PannerUI::set_panner (boost::shared_ptr<Panner> p)
                return;
        }
 
-       connections.add_connection (_panner->Changed.connect (sigc::mem_fun(*this, &PannerUI::panner_changed)));
-       connections.add_connection (_panner->LinkStateChanged.connect (sigc::mem_fun(*this, &PannerUI::update_pan_linkage)));
-       connections.add_connection (_panner->StateChanged.connect (sigc::mem_fun(*this, &PannerUI::update_pan_state)));
+       _panner->Changed.connect (connections, boost::bind (&PannerUI::panner_changed, this));
+       _panner->LinkStateChanged.connect (connections, boost::bind (&PannerUI::update_pan_linkage, this));
+       _panner->StateChanged.connect (connections, boost::bind (&PannerUI::update_pan_state, this));
 
        setup_pan ();
 
@@ -404,8 +404,7 @@ PannerUI::setup_pan ()
                        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));
 
-                       _panner->pan_control( asz )->Changed.connect (sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_value_changed), (uint32_t) asz));
-
+                       _panner->pan_control( asz )->Changed.connect (connections, boost::bind (&PannerUI::pan_value_changed, this, (uint32_t) asz));
 
                        bc->set_name ("PanSlider");
                        bc->set_shadow_type (Gtk::SHADOW_NONE);
index 46eb34dd0a597e5a0e33b5854e9bae113b342d4e..3ee64fc9b54e87b874997900aef0b60dc93c5164 100644 (file)
@@ -115,7 +115,7 @@ PluginEqGui::PluginEqGui(boost::shared_ptr<ARDOUR::PluginInsert> pluginInsert)
 
 
        // Connect the realtime signal collection callback
-       _plugin_insert->AnalysisDataGathered.connect( sigc::mem_fun(*this, &PluginEqGui::signal_collect_callback ));
+       _plugin_insert->AnalysisDataGathered.connect (analysis_connection, boost::bind (&PluginEqGui::signal_collect_callback, this, _1, _2));
 }
 
 PluginEqGui::~PluginEqGui()
index 462cae7aa8689e972bd503d3fc223d437c1e8d68..163da38478bd1df3f82ad2f6a2f6546b095a0b0e 100644 (file)
@@ -137,6 +137,8 @@ class PluginEqGui : public Gtk::Table
                sigc::connection _update_connection;
                sigc::connection _window_unmap_connection;
                sigc::connection _window_map_connection;
+
+               PBD::ScopedConnection analysis_connection;
 };
 
 #endif
index 35befc0d697850fb30764c1e21b03d1c8f722404..48bb5f5c7e6b0a785ffced378449348df53fc056 100644 (file)
@@ -74,7 +74,7 @@ PluginSelector::PluginSelector (PluginManager *mgr)
        manager = mgr;
        in_row_change = false;
 
-       manager->PluginListChanged.connect (sigc::mem_fun (*this, &PluginSelector::build_plugin_menu));
+       manager->PluginListChanged.connect (plugin_list_changed_connection, boost::bind (&PluginSelector::build_plugin_menu, this));
        build_plugin_menu ();
 
        plugin_model = Gtk::ListStore::create (plugin_columns);
index 7e0c66b60f78c33f1caa836cb4cd68a52d4954c5..a9f9803809643b8cf9bab620b28abbbe002ebee6 100644 (file)
@@ -138,6 +138,7 @@ class PluginSelector : public ArdourDialog
        Gtk::Menu* create_by_creator_menu (ARDOUR::PluginInfoList&);
        Gtk::Menu* create_by_category_menu (ARDOUR::PluginInfoList&);
        void build_plugin_menu ();
+       PBD::ScopedConnection plugin_list_changed_connection;
 };
 
 #endif // __ardour_plugin_selector_h__
index dd2b0b204de49163ffb7a5157b69dac04eccebca..24106c4351bc24cc9535c9019cf76293ddd6f897 100644 (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);
 
        signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window*> (this)), false);
-       death_connection = insert->GoingAway.connect (sigc::mem_fun(*this, &PluginUIWindow::plugin_going_away));
+       insert->GoingAway.connect (death_connection, boost::bind (&PluginUIWindow::plugin_going_away, this));
 
        gint h = _pluginui->get_preferred_height ();
        gint w = _pluginui->get_preferred_width ();
@@ -390,9 +390,7 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi)
        save_button.set_name ("PluginSaveButton");
        save_button.signal_clicked().connect(sigc::mem_fun(*this, &PlugUIBase::save_plugin_setting));
 
-       insert->ActiveChanged.connect (sigc::bind(
-                       sigc::mem_fun(*this, &PlugUIBase::processor_active_changed),
-                       boost::weak_ptr<Processor>(insert)));
+       insert->ActiveChanged.connect (active_connection, boost::bind (&PlugUIBase::processor_active_changed, this,  boost::weak_ptr<Processor>(insert)));
 
        bypass_button.set_active (!pi->active());
 
@@ -416,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.set_expanded(false);
        
-       death_connection = insert->GoingAway.connect (sigc::mem_fun (*this, &PlugUIBase::plugin_going_away));
+       insert->GoingAway.connect (death_connection, boost::bind (&PlugUIBase::plugin_going_away, this));
 }
 
 PlugUIBase::~PlugUIBase()
index cf1bcd0ed8e435fd40e4e06ee02785ccc1285644..b2e0504538ae38b2ce6d8f062e949935680f0adc 100644 (file)
@@ -121,7 +121,10 @@ class PlugUIBase : public virtual sigc::trackable
        void toggle_plugin_analysis ();
        void processor_active_changed (boost::weak_ptr<ARDOUR::Processor> p);
        void plugin_going_away ();
-       boost::signals2::scoped_connection death_connection;
+
+       PBD::ScopedConnection death_connection;
+       PBD::ScopedConnection active_connection;
+       PBD::ScopedConnectionList control_connections;
 };
 
 class GenericPluginUI : public PlugUIBase, public Gtk::VBox
index 11e75c1fc34ef79c2ac839c6937b2e0f8ed31c57..4c983d1a62ebbfcfb0e3cfc145077f4f33a532b4 100644 (file)
@@ -116,7 +116,7 @@ PortGroup::add_bundle_internal (boost::shared_ptr<Bundle> b, boost::shared_ptr<I
        }
 
        BundleRecord* br = new BundleRecord (b, io, colour, has_colour);
-       br->changed_connection = b->Changed.connect (boost::bind (&PortGroup::bundle_changed, this, _1));
+       b->Changed.connect (br->changed_connection, boost::bind (&PortGroup::bundle_changed, this, _1));
        _bundles.push_back (br);
 
        Changed ();     
@@ -521,9 +521,8 @@ PortGroupList::add_group (boost::shared_ptr<PortGroup> g)
 {
        _groups.push_back (g);
 
-       g->Changed.connect (sigc::mem_fun (*this, &PortGroupList::emit_changed));
-
-       _bundle_changed_connections.add_connection (g->BundleChanged.connect (sigc::mem_fun (*this, &PortGroupList::emit_bundle_changed)));
+       g->Changed.connect (_changed_connections, boost::bind (&PortGroupList::emit_changed, this));
+       g->BundleChanged.connect (_bundle_changed_connections, boost::bind (&PortGroupList::emit_bundle_changed, this, _1));
 
        emit_changed ();
 }
index ebab997699d2a8b07b4bd684a2c4d70db9017175..bc0615a7a92a6ff574e66eb6aff3ad70035f7001 100644 (file)
@@ -24,7 +24,7 @@
 #include <string>
 #include <set>
 #include <boost/shared_ptr.hpp>
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 
 #include <gtkmm/widget.h>
 #include <gtkmm/checkbutton.h>
@@ -66,10 +66,10 @@ public:
        bool has_port (std::string const &) const;
 
        /** The bundle list has changed in some way; a bundle has been added or removed, or the list cleared etc. */
-       sigc::signal<void> Changed;
+       PBD::Signal0<void> Changed;
 
        /** An individual bundle on our list has changed in some way */
-       boost::signals2::signal<void(ARDOUR::Bundle::Change)> BundleChanged;
+       PBD::Signal1<void,ARDOUR::Bundle::Change> BundleChanged;
 
        struct BundleRecord {
            boost::shared_ptr<ARDOUR::Bundle> bundle;
@@ -132,10 +132,10 @@ class PortGroupList : public sigc::trackable
        bool empty () const;
 
        /** The group list has changed in some way; a group has been added or removed, or the list cleared etc. */
-       boost::signals2::signal<void()> Changed;
+       PBD::Signal0<void> Changed;
 
        /** A bundle in one of our groups has changed */
-       boost::signals2::signal<void(ARDOUR::Bundle::Change)> BundleChanged;
+       PBD::Signal1<void,ARDOUR::Bundle::Change> BundleChanged;
 
   private:
        bool port_has_prefix (std::string const &, std::string const &) const;
@@ -152,6 +152,7 @@ class PortGroupList : public sigc::trackable
        mutable PortGroup::BundleList _bundles;
        List _groups;
        PBD::ScopedConnectionList _bundle_changed_connections;
+       PBD::ScopedConnectionList _changed_connections;
        bool _signals_suspended;
        bool _pending_change;
        ARDOUR::Bundle::Change _pending_bundle_change;
index 9d5187ca2e1204d7ee4f9e5e71226c1bf38ad753..7e2a1d892ad79397ad36f5412d543083700cd9c4 100644 (file)
@@ -135,10 +135,10 @@ PortMatrix::init ()
 
        for (int i = 0; i < 2; ++i) {
                /* watch for the content of _ports[] changing */
-               _ports[i].Changed.connect (sigc::mem_fun (*this, &PortMatrix::setup));
+               _ports[i].Changed.connect (_changed_connections, boost::bind (&PortMatrix::setup, this));
 
                /* and for bundles in _ports[] changing */
-               _ports[i].BundleChanged.connect (sigc::hide (sigc::mem_fun (*this, &PortMatrix::setup)));
+               _ports[i].BundleChanged.connect (_bundle_changed_connections,  boost::bind (&PortMatrix::setup, this));
        }
 
        /* scrolling stuff */
@@ -149,13 +149,13 @@ PortMatrix::init ()
        /* Part 2: notice when things have changed that require our subclass to clear and refill _ports[] */
        
        /* watch for routes being added or removed */
-       _session_connections.add_connection (_session->RouteAdded.connect (boost::bind (&PortMatrix::routes_changed, this)));
+       _session->RouteAdded.connect (_session_connections, boost::bind (&PortMatrix::routes_changed, this));
 
        /* and also bundles */
-       _session_connections.add_connection (_session->BundleAdded.connect (boost::bind (&PortMatrix::setup_global_ports, this)));
+       _session->BundleAdded.connect (_session_connections, boost::bind (&PortMatrix::setup_global_ports, this));
 
        /* and also ports */
-       _session_connections.add_connection (_session->engine().PortRegisteredOrUnregistered.connect (boost::bind (&PortMatrix::setup_global_ports, this)));
+       _session->engine().PortRegisteredOrUnregistered.connect (_session_connections, boost::bind (&PortMatrix::setup_global_ports, this));
 
        reconnect_to_routes ();
        
@@ -170,7 +170,7 @@ PortMatrix::reconnect_to_routes ()
 
        boost::shared_ptr<RouteList> routes = _session->get_routes ();
        for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
-               _route_connections.add_connection ((*i)->processors_changed.connect (sigc::mem_fun (*this, &PortMatrix::route_processors_changed)));
+               (*i)->processors_changed.connect (_route_connections, boost::bind (&PortMatrix::route_processors_changed, this, _1));
        }
 }
 
index 950d5bfd3248b82421f7899537a99c144708477c..373a3162577b0d7b06906f35eb5ea1b793102ae6 100644 (file)
@@ -193,6 +193,8 @@ private:
        /// port type that we are working with
        ARDOUR::DataType _type;
        PBD::ScopedConnectionList _route_connections;
+       PBD::ScopedConnectionList _changed_connections;
+       PBD::ScopedConnectionList _bundle_changed_connections;
 
        PortMatrixBody* _body;
        Gtk::HScrollbar _hscroll;
index f448952c4a5df2af02e5efd81ca4c9a9b610cfcc..0732873f5cc705eacebf6d2a7b99d0605ead9c99 100644 (file)
@@ -254,7 +254,7 @@ PortMatrixBody::setup ()
                PortGroup::BundleList r = _matrix->visible_rows()->bundles ();
                for (PortGroup::BundleList::iterator i = r.begin(); i != r.end(); ++i) {
                        
-                       _bundle_connections.add_connection ((*i)->bundle->Changed.connect (boost::bind (&PortMatrixBody::rebuild_and_draw_row_labels, this)));
+                       (*i)->bundle->Changed.connect (_bundle_connections, boost::bind (&PortMatrixBody::rebuild_and_draw_row_labels, this));
                        
                }
        }
@@ -262,7 +262,7 @@ PortMatrixBody::setup ()
        if (_matrix->visible_columns()) {
                PortGroup::BundleList c = _matrix->visible_columns()->bundles ();
                for (PortGroup::BundleList::iterator i = c.begin(); i != c.end(); ++i) {
-                       _bundle_connections.add_connection ((*i)->bundle->Changed.connect (boost::bind (&PortMatrixBody::rebuild_and_draw_column_labels, this)));
+                       (*i)->bundle->Changed.connect (_bundle_connections, boost::bind (&PortMatrixBody::rebuild_and_draw_column_labels, this));
                }
        }
                
index 3e07305868ea833bf8a99d1aa8de525a0bbd1304..615294b6ac95b5f0abce5b1234323bc6f30c54e1 100644 (file)
@@ -106,8 +106,8 @@ ProcessorEntry::ProcessorEntry (boost::shared_ptr<Processor> p, Width w)
        _active.set_active (_processor->active ());
        _active.signal_toggled().connect (sigc::mem_fun (*this, &ProcessorEntry::active_toggled));
        
-       _processor->ActiveChanged.connect (sigc::mem_fun (*this, &ProcessorEntry::processor_active_changed));
-       _processor->NameChanged.connect (sigc::mem_fun (*this, &ProcessorEntry::processor_name_changed));
+       _processor->ActiveChanged.connect (active_connection, boost::bind (&ProcessorEntry::processor_active_changed, this));
+       _processor->NameChanged.connect (name_connection, boost::bind (&ProcessorEntry::processor_name_changed, this));
 }
 
 EventBox&
@@ -229,7 +229,7 @@ SendProcessorEntry::SendProcessorEntry (boost::shared_ptr<Send> s, Width w)
        _vbox.pack_start (_fader);
 
        _adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &SendProcessorEntry::gain_adjusted));
-       _send->amp()->gain_control()->Changed.connect (sigc::mem_fun (*this, &SendProcessorEntry::show_gain));
+       _send->amp()->gain_control()->Changed.connect (send_gain_connection, boost::bind (&SendProcessorEntry::show_gain, this));
        show_gain ();
 }
 
@@ -326,9 +326,9 @@ ProcessorBox::set_route (boost::shared_ptr<Route> r)
        no_processor_redisplay = false;
        _route = r;
 
-       connections.add_connection (_route->processors_changed.connect (sigc::mem_fun (*this, &ProcessorBox::route_processors_changed)));
-       connections.add_connection (_route->GoingAway.connect (sigc::mem_fun (*this, &ProcessorBox::route_going_away)));
-       connections.add_connection (_route->NameChanged.connect (sigc::mem_fun(*this, &ProcessorBox::route_name_changed)));
+       _route->processors_changed.connect (connections, boost::bind (&ProcessorBox::route_processors_changed, this, _1));
+       _route->GoingAway.connect (connections, boost::bind (&ProcessorBox::route_going_away, this));
+       _route->NameChanged.connect (connections, boost::bind (&ProcessorBox::route_name_changed, this));
 
        redisplay_processors ();
 }
index e704eba015f3002825fc4d3df392310c05727f1f..a80dce00feac7af3ae9d6b615abd30a478f8b363 100644 (file)
@@ -36,7 +36,7 @@
 #include <gtkmm2ext/pixfader.h>
 
 #include "pbd/stateful.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/types.h"
 #include "ardour/ardour.h"
@@ -100,6 +100,8 @@ private:
        Gtk::CheckButton _active;
        boost::shared_ptr<ARDOUR::Processor> _processor;
        Width _width;
+       PBD::ScopedConnection active_connection;
+       PBD::ScopedConnection name_connection;
 };
 
 class SendProcessorEntry : public ProcessorEntry
@@ -120,7 +122,8 @@ private:
        Gtk::Adjustment _adjustment;
        Gtkmm2ext::HSliderController _fader;
        bool _ignore_gain_change;
-       
+       PBD::ScopedConnection send_gain_connection;
+
        static Glib::RefPtr<Gdk::Pixbuf> _slider;
 };
 
index a3796a6746de90a349d4fb064832f9c191b53534..c4c75ea6d757a943a31e3225f41be213e855e4e0 100644 (file)
@@ -107,6 +107,7 @@ private:
                MIDI::Manager::PortList const & ports = MIDI::Manager::instance()->get_midi_ports ();
 
                _store->clear ();
+               port_connections.drop_connections ();
 
                for (MIDI::Manager::PortList::const_iterator i = ports.begin(); i != ports.end(); ++i) {
 
@@ -116,7 +117,7 @@ private:
 
                        if ((*i)->input()) {
                                r[_model.online] = !(*i)->input()->offline();
-                               (*i)->input()->OfflineStatusChanged.connect (sigc::bind (sigc::mem_fun (*this, &MIDIPorts::port_offline_changed), (*i)));
+                               (*i)->input()->OfflineStatusChanged.connect (port_connections, boost::bind (&MIDIPorts::port_offline_changed, this, (*i)));
                                r[_model.trace_input] = (*i)->input()->tracing();
                        }
 
@@ -216,6 +217,7 @@ private:
        ComboBoxText _mmc_combo;
        ComboBoxText _mpc_combo;
        list<ComboOption<string>* > _port_combos;
+        PBD::ScopedConnectionList port_connections;
 };
 
 
index 30f6dfb565af74a05583d627e78a6adb62670aed..bbb5d338652b4282ffb482e08a5358390959b458 100644 (file)
@@ -32,7 +32,7 @@ using namespace PBD;
  */
 RegionSelection::RegionSelection ()
 {
-       death_connection = RegionView::RegionViewGoingAway.connect (boost::bind (&RegionSelection::remove_it, this, _1));
+       RegionView::RegionViewGoingAway.connect (death_connection, boost::bind (&RegionSelection::remove_it, this, _1));
 
        _current_start = 0;
        _current_end = 0;
@@ -44,7 +44,7 @@ RegionSelection::RegionSelection ()
 RegionSelection::RegionSelection (const RegionSelection& other)
        : std::list<RegionView*>()
 {
-       death_connection = RegionView::RegionViewGoingAway.connect (boost::bind (&RegionSelection::remove_it, this, _1));
+       RegionView::RegionViewGoingAway.connect (death_connection, boost::bind (&RegionSelection::remove_it, this, _1));
 
        _current_start = other._current_start;
        _current_end = other._current_end;
index 5cc4df56693338564765f297a9e91e3df93e35df..cdfeceaa8d56634d059eee8ad9ea46b53756e557 100644 (file)
@@ -58,7 +58,7 @@ using namespace ArdourCanvas;
 
 static const int32_t sync_mark_width = 9;
 
-boost::signals2::signal<void(RegionView*)> RegionView::RegionViewGoingAway;
+PBD::Signal1<void,RegionView*> RegionView::RegionViewGoingAway;
 
 RegionView::RegionView (ArdourCanvas::Group*              parent,
                         TimeAxisView&                     tv,
@@ -178,8 +178,8 @@ RegionView::init (Gdk::Color const & basic_color, bool wfd)
 
        set_height (trackview.current_height());
 
-       _region->StateChanged.connect (sigc::mem_fun(*this, &RegionView::region_changed));
-
+       _region->StateChanged.connect (*this, boost::bind (&RegionView::region_changed, this, _1));
+       
        group->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_event), group, this));
 
        set_colors ();
index ad534c04bf27e5ca87f4795ab34e8708b632366d..9a663eac02171b72feb2de16e38f8f990d2c2e03 100644 (file)
@@ -89,7 +89,7 @@ class RegionView : public TimeAxisViewItem
        void enable_display(bool yn) { _enable_display = yn; }
        virtual void update_coverage_frames (LayerDisplay);
 
-       static boost::signals2::signal<void(RegionView*)> RegionViewGoingAway;
+       static PBD::Signal1<void,RegionView*> RegionViewGoingAway;
 
   protected:
 
@@ -139,7 +139,7 @@ class RegionView : public TimeAxisViewItem
     bool    in_destructor;
 
     bool             wait_for_data;
-    boost::signals2::scoped_connection data_ready_connection;
+    PBD::ScopedConnection data_ready_connection;
 
     std::vector<GhostRegion*> ghosts;
 
index 8a12a3ece9940450b9ce9d72f88d0e5014b026d2..fe1593a4aa941dd51c130e407387c969a52f088d 100644 (file)
@@ -57,7 +57,7 @@ ReturnUI::ReturnUI (Gtk::Window* parent, boost::shared_ptr<Return> r, Session* s
        show_all ();
 
        _return->set_metering (true);
-       _return->input()->changed.connect (sigc::mem_fun (*this, &ReturnUI::ins_changed));
+       _return->input()->changed.connect (input_change_connection, boost::bind (&ReturnUI::ins_changed, this, _1, _2));
 
        _gpm.setup_meters ();
        _gpm.set_fader_name ("ReturnUIFrame");
@@ -110,7 +110,7 @@ ReturnUIWindow::ReturnUIWindow (boost::shared_ptr<Return> r, ARDOUR::Session* s)
 
        set_name ("ReturnUIWindow");
 
-       going_away_connection = r->GoingAway.connect (sigc::mem_fun (*this, &ReturnUIWindow::return_going_away));
+       r->GoingAway.connect (going_away_connection, boost::bind (&ReturnUIWindow::return_going_away, this));
        signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window *> (this)));
 }
 
index ff1f2f35e58875fa4e8967cbfb78e0c35dc0cd39..0f6735c9eaea37d3bc9e8c8f73266731eb619973 100644 (file)
@@ -52,6 +52,7 @@ class ReturnUI : public Gtk::HBox
 
        sigc::connection screen_update_connection;
        sigc::connection fast_screen_update_connection;
+       PBD::ScopedConnection input_change_connection;
 
        void ins_changed (ARDOUR::IOChange, void*);
 };
index c948d388d8cbea75b29d766eb3c9c91c8361d0f0..cf37c2dad45a9cd429cb3fe49155eaf2b72b1af4 100644 (file)
@@ -181,8 +181,8 @@ RouteParams_UI::add_routes (RouteList& routes)
 
                //route_select_list.rows().back().select ();
 
-               scoped_connect (route->NameChanged, boost::bind (&RouteParams_UI::route_name_changed, this, boost::weak_ptr<Route>(route)));
-               scoped_connect (route->GoingAway, boost::bind (&RouteParams_UI::route_removed, this, boost::weak_ptr<Route>(route)));
+               route->NameChanged.connect (*this, boost::bind (&RouteParams_UI::route_name_changed, this, boost::weak_ptr<Route>(route)));
+               route->GoingAway.connect (*this, boost::bind (&RouteParams_UI::route_removed, this, boost::weak_ptr<Route>(route)));
        }
 }
 
@@ -293,8 +293,8 @@ RouteParams_UI::setup_latency_frame ()
        latency_packer.pack_start (delay_label);
 
        latency_click_connection = latency_apply_button.signal_clicked().connect (sigc::mem_fun (*latency_widget, &LatencyGUI::finish));
-       latency_connections.add_connection (_route->signal_latency_changed.connect (sigc::mem_fun (*this, &RouteParams_UI::refresh_latency)));
-       latency_connections.add_connection ( _route->initial_delay_changed.connect (sigc::mem_fun (*this, &RouteParams_UI::refresh_latency)));
+       _route->signal_latency_changed.connect (latency_connections, sigc::mem_fun (*this, &RouteParams_UI::refresh_latency));
+       _route->initial_delay_changed.connect (latency_connections, sigc::mem_fun (*this, &RouteParams_UI::refresh_latency));
 
        latency_frame.add (latency_packer);
        latency_frame.show_all ();
@@ -399,7 +399,7 @@ RouteParams_UI::set_session (Session *sess)
        if (_session) {
                boost::shared_ptr<RouteList> r = _session->get_routes();
                add_routes (*r);
-               _session_connections.add_connection (_session->RouteAdded.connect (sigc::mem_fun(*this, &RouteParams_UI::add_routes)));
+               _session->RouteAdded.connect (_session_connections, sigc::mem_fun(*this, &RouteParams_UI::add_routes));
                start_updating ();
        } else {
                stop_updating ();
@@ -458,7 +458,7 @@ RouteParams_UI::route_selected()
                setup_processor_boxes();
                setup_latency_frame ();
 
-               _route_processors_connection = route->processors_changed.connect (boost::bind (&RouteParams_UI::processors_changed, this, _1));
+               route->processors_changed.connect (_route_processors_connection, boost::bind (&RouteParams_UI::processors_changed, this, _1));
                
                track_input_label.set_text (_route->name());
 
@@ -522,9 +522,7 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> proc)
                SendUI *send_ui = new SendUI (this, send, _session);
 
                cleanup_view();
-               _processor_going_away_connection = send->GoingAway.connect (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)));
                _active_view = send_ui;
 
                redir_hpane.add2 (*_active_view);
@@ -535,8 +533,7 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> proc)
                ReturnUI *return_ui = new ReturnUI (this, retrn, _session);
 
                cleanup_view();
-               _processor_going_away_connection = retrn->GoingAway.connect (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)));
                _active_view = return_ui;
 
                redir_hpane.add2 (*_active_view);
@@ -547,9 +544,10 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> proc)
                GenericPluginUI *plugin_ui = new GenericPluginUI (plugin_insert, true);
 
                cleanup_view();
-               _processor_going_away_connection = plugin_insert->plugin()->GoingAway.connect (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));
                plugin_ui->start_updating (0);
                _active_view = plugin_ui;
+
                redir_hpane.pack2 (*_active_view);
                redir_hpane.show_all();
 
@@ -558,8 +556,9 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> proc)
                PortInsertUI *portinsert_ui = new PortInsertUI (this, _session, port_insert);
 
                cleanup_view();
-               _processor_going_away_connection = port_insert->GoingAway.connect (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)));
                _active_view = portinsert_ui;
+
                redir_hpane.pack2 (*_active_view);
                portinsert_ui->redisplay();
                redir_hpane.show_all();
index 2dcb1b921d2c03e75cebcad5b1ae9b97c3289407..a1a9323134fbc2448a62392b4e68262ff67ccbe7 100644 (file)
@@ -33,7 +33,7 @@
 #include <gtkmm/treeview.h>
 
 #include "pbd/stateful.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/ardour.h"
 
index 102cd724ddf6f5b8754b9d7090b7fc6ff9a2397a..2f4a31a3e0d8903e7f0a28b5d75d365c14b15f74 100644 (file)
@@ -69,6 +69,7 @@ void
 RouteRedirectSelection::clear_routes ()
 {
        routes.clear ();
+       drop_connections ();
        RoutesChanged ();
 }
 
@@ -93,7 +94,7 @@ RouteRedirectSelection::add (boost::shared_ptr<Route> r)
 {
        if (find (routes.begin(), routes.end(), r) == routes.end()) {
                routes.push_back (r);
-               r->GoingAway.connect (boost::bind (&RouteRedirectSelection::removed, this, boost::weak_ptr<Route>(r)));
+               r->GoingAway.connect (*this, boost::bind (&RouteRedirectSelection::removed, this, boost::weak_ptr<Route>(r)));
                RoutesChanged();
        }
 }
index eb76d481ddc031cfd347b77d212c7a61c923ad7a..df43019e91e75d4b0206e6801b7e2deea275ceb3 100644 (file)
@@ -21,7 +21,7 @@
 #define __ardour_gtk_route_processor_selection_h__
 
 #include <vector>
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "processor_selection.h"
 #include "route_selection.h"
index e652fbc4a3bd94895654d8a3c1e52befdec9aae9..442fb959c42de85fd9847f4d6b90af91647961f1 100644 (file)
@@ -193,9 +193,9 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, boost::sh
        }
 
        controls_hbox.pack_start(gm.get_level_meter(), false, false);
-       _route->meter_change.connect (sigc::mem_fun(*this, &RouteTimeAxisView::meter_changed));
-       _route->input()->changed.connect (sigc::mem_fun(*this, &RouteTimeAxisView::io_changed));
-       _route->output()->changed.connect (sigc::mem_fun(*this, &RouteTimeAxisView::io_changed));
+       _route->meter_change.connect (*this, boost::bind (&RouteTimeAxisView::meter_changed, this, _1));
+       _route->input()->changed.connect (*this, boost::bind (&RouteTimeAxisView::io_changed, this, _1, _2));
+       _route->output()->changed.connect (*this, boost::bind (&RouteTimeAxisView::io_changed, this, _1, _2));
 
        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);
@@ -234,19 +234,19 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, boost::sh
 
        _y_position = -1;
 
-       _route->mute_changed.connect (sigc::mem_fun(*this, &RouteUI::mute_changed));
-       _route->solo_changed.connect (sigc::mem_fun(*this, &RouteUI::solo_changed));
-       _route->processors_changed.connect (sigc::mem_fun(*this, &RouteTimeAxisView::processors_changed));
-       _route->NameChanged.connect (sigc::mem_fun(*this, &RouteTimeAxisView::route_name_changed));
-       _route->solo_isolated_changed.connect (sigc::mem_fun(*this, &RouteUI::solo_changed));
+       _route->mute_changed.connect (*this, boost::bind (&RouteUI::mute_changed, this, _1));
+       _route->solo_changed.connect (*this, boost::bind (&RouteUI::solo_changed, this, _1));
+       _route->processors_changed.connect (*this, boost::bind (&RouteTimeAxisView::processors_changed, this, _1));
+       _route->NameChanged.connect (*this, boost::bind (&RouteTimeAxisView::route_name_changed, this));
+       _route->solo_isolated_changed.connect (*this, boost::bind (&RouteUI::solo_changed, this, _1));
 
 
        if (is_track()) {
 
-               track()->TrackModeChanged.connect (sigc::mem_fun(*this, &RouteTimeAxisView::track_mode_changed));
-               track()->FreezeChange.connect (sigc::mem_fun(*this, &RouteTimeAxisView::map_frozen));
-               track()->DiskstreamChanged.connect (sigc::mem_fun(*this, &RouteTimeAxisView::diskstream_changed));
-               get_diskstream()->SpeedChanged.connect (sigc::mem_fun(*this, &RouteTimeAxisView::speed_changed));
+               track()->TrackModeChanged.connect (*this, boost::bind (&RouteTimeAxisView::track_mode_changed, this));
+               track()->FreezeChange.connect (*this, boost::bind (&RouteTimeAxisView::map_frozen, this));
+               track()->DiskstreamChanged.connect (*this, boost::bind (&RouteTimeAxisView::diskstream_changed, this));
+               get_diskstream()->SpeedChanged.connect (*this, boost::bind (&RouteTimeAxisView::speed_changed, this));
 
                /* pick up the correct freeze state */
                map_frozen ();
@@ -270,6 +270,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, boost::sh
 RouteTimeAxisView::~RouteTimeAxisView ()
 {
        drop_references ();
+       drop_connections ();
 
        for (list<ProcessorAutomationInfo*>::iterator i = processor_automation.begin(); i != processor_automation.end(); ++i) {
                delete *i;
@@ -531,8 +532,7 @@ RouteTimeAxisView::build_display_menu ()
 
                if (!Profile->get_sae()) {
                        items.push_back (MenuElem (_("Alignment"), *alignment_menu));
-                       get_diskstream()->AlignmentStyleChanged.connect (
-                                       sigc::mem_fun(*this, &RouteTimeAxisView::align_style_changed));
+                       get_diskstream()->AlignmentStyleChanged.connect (route_connections, boost::bind (&RouteTimeAxisView::align_style_changed, this));
 
                        RadioMenuItem::Group mode_group;
                        items.push_back (RadioMenuElem (mode_group, _("Normal mode"), sigc::bind (
@@ -564,8 +564,7 @@ RouteTimeAxisView::build_display_menu ()
                        }
                }
 
-               get_diskstream()->AlignmentStyleChanged.connect (
-                               sigc::mem_fun(*this, &RouteTimeAxisView::align_style_changed));
+               get_diskstream()->AlignmentStyleChanged.connect (route_connections, boost::bind (&RouteTimeAxisView::align_style_changed, this));
 
                mode_menu = build_mode_menu();
                if (mode_menu)
index c4fe713f585bf2278bc4d9735abb546fa9cc38c4..3eb72a9b535eae35505524d14917ed49f113913e 100644 (file)
@@ -136,17 +136,17 @@ RouteUI::init ()
        show_sends_button->set_self_managed (true);
        UI::instance()->set_tip (show_sends_button, _("make mixer strips show sends to this bus"), "");
 
-       _session_connections.add_connection (_session->SoloChanged.connect (sigc::mem_fun(*this, &RouteUI::solo_changed_so_update_mute)));
-       _session_connections.add_connection (_session->TransportStateChange.connect (sigc::mem_fun (*this, &RouteUI::check_rec_enable_sensitivity)));
+       _session->SoloChanged.connect (_session_connections, sigc::mem_fun(*this, &RouteUI::solo_changed_so_update_mute));
+       _session->TransportStateChange.connect (_session_connections, sigc::mem_fun (*this, &RouteUI::check_rec_enable_sensitivity));
+       _session->RecordStateChanged.connect (_session_connections, boost::bind (&RouteUI::session_rec_enable_changed, this));
 
-       Config->ParameterChanged.connect (sigc::mem_fun (*this, &RouteUI::parameter_changed));
+       Config->ParameterChanged.connect (*this, boost::bind (&RouteUI::parameter_changed, this, _1));
 }
 
 void
 RouteUI::reset ()
 {
-       route_going_away_connection.disconnect();
-       connections.drop_connections ();
+       route_connections.drop_connections ();
 
        delete solo_menu;
        solo_menu = 0;
@@ -172,8 +172,7 @@ RouteUI::self_delete ()
        cerr << "\n\nExpect to see route " << _route->name() << " be deleted\n";
        _route.reset (); /* drop reference to route, so that it can be cleaned up */
 
-       route_going_away_connection.disconnect ();
-       connections.drop_connections ();
+       route_connections.drop_connections ();
        delete_when_idle (this);
 }
 
@@ -189,23 +188,22 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
        }
 
        if (self_destruct) {
-               route_going_away_connection = rp->GoingAway.connect (boost::bind (&RouteUI::self_delete, this));
+               rp->GoingAway.connect (route_connections, boost::bind (&RouteUI::self_delete, this));
        }
 
        mute_button->set_controllable (_route->mute_control());
        solo_button->set_controllable (_route->solo_control());
 
-       connections.add_connection (_route->active_changed.connect (sigc::mem_fun (*this, &RouteUI::route_active_changed)));
-       connections.add_connection (_route->mute_changed.connect (sigc::mem_fun(*this, &RouteUI::mute_changed)));
-       connections.add_connection (_route->solo_changed.connect (sigc::mem_fun(*this, &RouteUI::solo_changed)));
-       connections.add_connection (_route->listen_changed.connect (sigc::mem_fun(*this, &RouteUI::listen_changed)));
-       connections.add_connection (_route->solo_isolated_changed.connect (sigc::mem_fun(*this, &RouteUI::solo_changed)));
+       _route->active_changed.connect (route_connections, boost::bind (&RouteUI::route_active_changed, this));
+       _route->mute_changed.connect (route_connections, boost::bind (&RouteUI::mute_changed, this, _1));
+       _route->solo_changed.connect (route_connections, boost::bind (&RouteUI::solo_changed, this, _1));
+       _route->listen_changed.connect (route_connections, boost::bind (&RouteUI::listen_changed, this, _1));
+       _route->solo_isolated_changed.connect (route_connections, boost::bind (&RouteUI::solo_changed, this, _1));
 
        if (_session->writable() && is_track()) {
                boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(_route);
 
-               connections.add_connection (t->diskstream()->RecordEnableChanged.connect (sigc::mem_fun (*this, &RouteUI::route_rec_enable_changed)));
-               connections.add_connection (_session->RecordStateChanged.connect (sigc::mem_fun (*this, &RouteUI::session_rec_enable_changed)));
+               t->diskstream()->RecordEnableChanged.connect (route_connections, boost::bind (&RouteUI::route_rec_enable_changed, this));
 
                rec_enable_button->show();
                rec_enable_button->set_controllable (t->rec_enable_control());
@@ -832,12 +830,20 @@ RouteUI::route_rec_enable_changed ()
 void
 RouteUI::session_rec_enable_changed ()
 {
+       if (!rec_enable_button) {
+               return;
+       }
+
        Gtkmm2ext::UI::instance()->call_slot (boost::bind (&RouteUI::update_rec_display, this));
 }
 
 void
 RouteUI::update_rec_display ()
 {
+       if (!rec_enable_button) {
+               return;
+       }
+                       
        bool model = _route->record_enabled();
        bool view = rec_enable_button->get_active();
 
@@ -887,14 +893,14 @@ RouteUI::build_solo_menu (void)
        check = new CheckMenuItem(_("Solo Isolate"));
        check->set_active (_route->solo_isolated());
        check->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_solo_isolated), check));
-       _route->solo_isolated_changed.connect(sigc::bind (sigc::mem_fun (*this, &RouteUI::solo_isolated_toggle), check));
+       _route->solo_isolated_changed.connect (route_connections, boost::bind (&RouteUI::solo_isolated_toggle, this, _1, check));
        items.push_back (CheckMenuElem(*check));
        check->show_all();
 
        check = new CheckMenuItem(_("Solo Safe"));
        check->set_active (_route->solo_safe());
        check->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_solo_safe), check));
-       _route->solo_safe_changed.connect(sigc::bind (sigc::mem_fun (*this, &RouteUI::solo_safe_toggle), check));
+       _route->solo_safe_changed.connect (route_connections, boost::bind (&RouteUI::solo_safe_toggle, this, _1, check));
        items.push_back (CheckMenuElem(*check));
        check->show_all();
 
@@ -940,7 +946,7 @@ RouteUI::build_mute_menu(void)
        //items.push_back (SeparatorElem());
        // items.push_back (MenuElem (_("MIDI Bind"), sigc::mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
 
-       _route->mute_points_changed.connect (sigc::mem_fun (*this, &RouteUI::muting_change));
+       _route->mute_points_changed.connect (route_connections, boost::bind (&RouteUI::muting_change, this));
 }
 
 void
index a4d7e43b7d27ce482646f7854f1ea06833aaf3a2..12a1cde7036549965e2576cf92c409b6e9408c7d 100644 (file)
@@ -23,7 +23,7 @@
 #include <list>
 
 #include "pbd/xml++.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/ardour.h"
 #include "ardour/mute_master.h"
@@ -199,8 +199,7 @@ class RouteUI : public virtual AxisView
        static int mute_visual_state (ARDOUR::Session*, boost::shared_ptr<ARDOUR::Route>);
 
    protected:
-       PBD::ScopedConnectionList connections;
-       boost::signals2::scoped_connection route_going_away_connection;
+       PBD::ScopedConnectionList route_connections;
        bool self_destruct;
 
        void init ();
index d2f1a674764b3942cd1723ce2aaf5b807e207e30..05cd154831b0a318c32be1b08be735d2d2f3cd55 100644 (file)
@@ -209,7 +209,7 @@ Selection::toggle (TimeAxisView* track)
 
        if ((i = find (tracks.begin(), tracks.end(), track)) == tracks.end()) {
                void (Selection::*pmf)(TimeAxisView*) = &Selection::remove;
-               track->GoingAway.connect (boost::bind (pmf, this, track));
+               track->GoingAway.connect (*this, boost::bind (pmf, this, track));
                tracks.push_back (track);
        } else {
                tracks.erase (i);
@@ -338,7 +338,7 @@ Selection::add (const TrackViewList& track_list)
 
        for (list<TimeAxisView*>::const_iterator i = added.begin(); i != added.end(); ++i) {
                void (Selection::*pmf)(TimeAxisView*) = &Selection::remove;
-               scoped_connect ((*i)->GoingAway, boost::bind (pmf, this, (*i)));
+               (*i)->GoingAway.connect (*this, boost::bind (pmf, this, (*i)));
        }
 
        if (!added.empty()) {
@@ -949,7 +949,7 @@ Selection::add (Marker* m)
 
                void (Selection::*pmf)(Marker*) = &Selection::remove;
 
-               scoped_connect (m->GoingAway, boost::bind (pmf, this, m));
+               m->GoingAway.connect (*this, boost::bind (pmf, this, m));
 
                markers.push_back (m);
                MarkersChanged();
index ad257e084875af5f43f08005ca3042b7cbab4f06..d838720d3691763441741d677bf636628dd2aaca 100644 (file)
 
 #include <vector>
 #include <boost/shared_ptr.hpp>
+#include <boost/noncopyable.hpp>
 
 #include <sigc++/signal.h>
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "time_selection.h"
 #include "region_selection.h"
@@ -187,7 +188,6 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
        template<class A> void foreach_region (void (ARDOUR::Region::*method)(A), A arg);
 
   private:
-       Selection (const Selection& other) : tracks (other.tracks) {}
        PublicEditor const * editor;
        uint32_t next_time_id;
        
index 1617ccd96ad0650f29fa589cfac48e4711c7a484..4c1bb9fec348204d19588bb291767fe7cb35bbc2 100644 (file)
@@ -61,8 +61,8 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session
 
        _send->set_metering (true);
 
-       _send->input()->changed.connect (sigc::mem_fun (*this, &SendUI::ins_changed));
-       _send->output()->changed.connect (sigc::mem_fun (*this, &SendUI::outs_changed));
+       _send->input()->changed.connect (connections, boost::bind (&SendUI::ins_changed, this, _1, _2));
+       _send->output()->changed.connect (connections, boost::bind (&SendUI::outs_changed, this, _1, _2));
 
        _panners.set_width (Wide);
        _panners.setup_pan ();
@@ -130,7 +130,7 @@ SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session* session)
 
        set_name ("SendUIWindow");
 
-       going_away_connection = s->GoingAway.connect (sigc::mem_fun (*this, &SendUIWindow::send_going_away));
+       s->GoingAway.connect (going_away_connection, boost::bind (&SendUIWindow::send_going_away, this));
 
        signal_delete_event().connect (sigc::bind (
                                               sigc::ptr_fun (just_hide_it),
index 16543140a80824382523d12d2df4e95dbda16061..2c71466518a762698c4b359d1874093a39c1b0cb 100644 (file)
@@ -56,6 +56,7 @@ class SendUI : public Gtk::HBox
 
        void ins_changed (ARDOUR::IOChange, void*);
        void outs_changed (ARDOUR::IOChange, void*);
+       PBD::ScopedConnectionList connections;
 };
 
 class SendUIWindow : public ArdourDialog
index 4b5793271be7dc7db9bca7371de0fbe45b33e7a4..5b6b8a71b40db4da7878954d2f43338ac977aa1f 100644 (file)
@@ -92,8 +92,8 @@ SessionImportDialog::SessionImportDialog (ARDOUR::Session* target) :
        ok_button->signal_clicked().connect (sigc::mem_fun (*this, &SessionImportDialog::do_merge));
 
        // prompt signals
-       ElementImporter::Rename.connect (sigc::mem_fun (*this, &SessionImportDialog::open_rename_dialog));
-       ElementImporter::Prompt.connect (sigc::mem_fun (*this, &SessionImportDialog::open_prompt_dialog));
+       ElementImporter::Rename.connect (connections, boost::bind (&SessionImportDialog::open_rename_dialog, this, _1, _2));
+       ElementImporter::Prompt.connect (connections, boost::bind (&SessionImportDialog::open_prompt_dialog, this, _1));
 
        // Finalize
        show_all();
index 01cbb6c0cccb4f4ce8e4e2fdec040a3bf7908d5a..ebfd49f8c975ce6d519ae5000d06c24fde5624fa 100644 (file)
@@ -93,6 +93,8 @@ class SessionImportDialog : public ArdourDialog
 
        Gtk::Button*                  ok_button;
        Gtk::Button*                  cancel_button;
+       
+       PBD::ScopedConnectionList connections;
 };
 
 #endif
index 08cd8ef260a2f7a2c16979e78a4f3510464b28cf..2cc6e253ba69b639f64cd4139379ee7424825e39 100644 (file)
@@ -160,9 +160,9 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
                sigc::mem_fun (*_session_config, &SessionConfiguration::set_sync_source)
                );
        
-       s->MTC_PortChanged.connect (sigc::bind (sigc::mem_fun (*this, &SessionOptionEditor::populate_sync_options), s, ssrc));
-       s->MIDIClock_PortChanged.connect (sigc::bind (sigc::mem_fun (*this, &SessionOptionEditor::populate_sync_options), s, ssrc));
-       s->config.ParameterChanged.connect (sigc::bind (sigc::mem_fun (*this, &SessionOptionEditor::follow_sync_state), s, ssrc));
+       s->MTC_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));
+       s->config.ParameterChanged.connect (_session_connections, boost::bind (&SessionOptionEditor::follow_sync_state, this, _1, s, ssrc));
 
        populate_sync_options (s, ssrc);
        follow_sync_state (string ("external-sync"), s, ssrc);
index f76ded4feb9cf7465cb8180310a74a4600c00802..6489efcdf79efc26e3073287a66f2b126c479fe7 100644 (file)
@@ -56,7 +56,7 @@ Splash::Splash ()
        set_default_size (pixbuf->get_width(), pixbuf->get_height());
        the_splash = this;
 
-       ARDOUR::BootMessage.connect (sigc::mem_fun (*this, &Splash::boot_message));
+       ARDOUR::BootMessage.connect (msg_connection, boost::bind (&Splash::boot_message, this, _1));
 }
 
 void
index 1c645d31cb9db61c84f1365ef64eb3362a643b76..56e159ebde46e9e825d4969c78017db2b0d0d0bd 100644 (file)
@@ -26,6 +26,8 @@
 #include <gtkmm/label.h>
 #include <gdkmm/pixbuf.h>
 
+#include "pbd/signals.h"
+
 class ARDOUR_UI;
 
 class Splash : public Gtk::Window
@@ -52,6 +54,7 @@ class Splash : public Gtk::Window
        Glib::RefPtr<Pango::Layout> layout;
 
        void boot_message (std::string);
+       PBD::ScopedConnection msg_connection;
 };
 
 #endif /* __ardour_gtk_splash_h__ */
index 41901162942505d1dd4ac188bea9c0028aedd2b3..39f98582c77976954bc7527a76a041680fdc0b57 100644 (file)
@@ -79,12 +79,12 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
                        canvas_rect, &_trackview));
 
        if (_trackview.is_track()) {
-               scoped_connect (_trackview.track()->DiskstreamChanged, boost::bind (&StreamView::diskstream_changed, this));
-               scoped_connect (_trackview.get_diskstream()->RecordEnableChanged, boost::bind (&StreamView::rec_enable_changed, this));
+               _trackview.track()->DiskstreamChanged.connect (*this, boost::bind (&StreamView::diskstream_changed, this));
+               _trackview.get_diskstream()->RecordEnableChanged.connect (*this, boost::bind (&StreamView::rec_enable_changed, this));
 
-               scoped_connect (_trackview.session()->TransportStateChange, boost::bind (&StreamView::transport_changed, this));
-               scoped_connect (_trackview.session()->TransportLooped, boost::bind (&StreamView::transport_looped, this));
-               scoped_connect (_trackview.session()->RecordStateChanged, boost::bind (&StreamView::sess_rec_enable_changed, this));
+               _trackview.session()->TransportStateChange.connect (*this, boost::bind (&StreamView::transport_changed, this));
+               _trackview.session()->TransportLooped.connect (*this, boost::bind (&StreamView::transport_looped, this));
+               _trackview.session()->RecordStateChanged.connect (*this, boost::bind (&StreamView::sess_rec_enable_changed, this));
        }
 
        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_changed (ds);
-       playlist_change_connection = ds->PlaylistChanged.connect (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)));
 }
 
 void
@@ -353,9 +353,9 @@ StreamView::playlist_changed (boost::shared_ptr<Diskstream> ds)
 
        /* catch changes */
 
-       playlist_connections.add_connection (ds->playlist()->Modified.connect (boost::bind (&StreamView::playlist_modified_weak, this, ds)));
-       playlist_connections.add_connection (ds->playlist()->RegionAdded.connect (boost::bind (&StreamView::add_region_view_weak, this, _1)));
-       playlist_connections.add_connection (ds->playlist()->RegionRemoved.connect (boost::bind (&StreamView::remove_region_view, this, _1)));
+       ds->playlist()->Modified.connect (playlist_connections, boost::bind (&StreamView::playlist_modified_weak, this, ds));
+       ds->playlist()->RegionAdded.connect (playlist_connections, boost::bind (&StreamView::add_region_view_weak, this, _1));
+       ds->playlist()->RegionRemoved.connect (playlist_connections, boost::bind (&StreamView::remove_region_view, this, _1));
 }
 
 void
index 0fe0b1a9ed5942c434fa68c16cf687e979ab5b33..effb9431d0fc9c762553ed471f697342322faa61 100644 (file)
@@ -22,7 +22,7 @@
 #include <list>
 #include <cmath>
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/location.h"
 #include "enums.h"
index 7397997a38162f770b608cda9b7ef89a6992a611..6fd2570c2783ee4fe53fcfe5a7c7a77d0c7cf285 100644 (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 */
 
        for (uint32_t n = 0; n < audio_region()->n_channels(); ++n) {
-               audio_region()->audio_source(n)->PeaksReady.connect (sigc::bind (sigc::mem_fun(*this, &TapeAudioRegionView::update), n));
+               audio_region()->audio_source(n)->PeaksReady.connect (*this, boost::bind (&TapeAudioRegionView::update, this, n));
        }
 
 }
index e1368dc5f339f0be168a59133a8aef4ff5ed3491..d3e3e880037226081a92be97b9c3f9b0589bacfc 100644 (file)
@@ -924,7 +924,7 @@ TimeAxisView::add_ghost (RegionView* rv)
 
        if(gr) {
                ghosts.push_back(gr);
-               scoped_connect (gr->GoingAway, boost::bind (&TimeAxisView::erase_ghost, this, _1));
+               gr->GoingAway.connect (*this, boost::bind (&TimeAxisView::erase_ghost, this, _1));
        }
 }
 
index 67aaa0d327e07084ea2f69dc2b51e1526c3821cc..3ad033417b132c598df447b989e6fee7331fe1f3 100644 (file)
@@ -34,7 +34,7 @@
 #include <gtkmm2ext/focus_entry.h>
 
 #include "pbd/stateful.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/types.h"
 #include "ardour/region.h"
index 1dd16043ad583e8943350f2bee2ece71881fad14..2e36f29fcf2bd6d0f484c3ff286d624063cc1e69 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <libgnomecanvasmm/pixbuf.h>
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "selectable.h"
 #include "simplerect.h"
index 1333b58d6f5c805efbc1522d3f965e106fe4e170..aaae8ba1c9d5b1baee9661fca159e14833868878 100644 (file)
@@ -26,7 +26,7 @@
 #include <limits.h>
 #include <signal.h>
 
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 
 #include "pbd/error.h"
 #include "pbd/failed_constructor.h"
@@ -46,7 +46,7 @@ namespace ARDOUR {
        class AudioEngine;
 
        static const nframes_t max_frames = JACK_MAX_FRAMES;
-       extern boost::signals2::signal<void(std::string)> BootMessage;
+       extern PBD::Signal1<void,std::string> BootMessage;
 
        int init (bool with_vst, bool try_optimization);
        void init_post_engine ();
index ac367ddd64bdeb96074f846bd3f3ab74cc209231..b22ca9790fc87d511f94e3cb4fff4dffb2d75b85 100644 (file)
@@ -30,7 +30,7 @@
 #include <glibmm/thread.h>
 
 #include "pbd/rcu.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/ardour.h"
 #include <jack/jack.h>
@@ -187,32 +187,32 @@ class AudioEngine : public SessionHandlePtr
 _         the regular process() call to session->process() is not made.
        */
 
-       boost::signals2::signal<int(nframes_t)> Freewheel;
+       PBD::Signal1<int,nframes_t> Freewheel;
 
-       boost::signals2::signal<void()> Xrun;
+       PBD::Signal0<void> Xrun;
 
        /* this signal is if JACK notifies us of a graph order event */
 
-       boost::signals2::signal<void()> GraphReordered;
+       PBD::Signal0<void> GraphReordered;
 
        /* this signal is emitted if the sample rate changes */
 
-       boost::signals2::signal<void(nframes_t)> SampleRateChanged;
+       PBD::Signal1<void,nframes_t> SampleRateChanged;
 
        /* this signal is sent if JACK ever disconnects us */
 
-       boost::signals2::signal<void()> Halted;
+       PBD::Signal0<void> Halted;
 
        /* these two are emitted when the engine itself is
           started and stopped
        */
 
-       boost::signals2::signal<void()> Running;
-       boost::signals2::signal<void()> Stopped;
+       PBD::Signal0<void> Running;
+       PBD::Signal0<void> Stopped;
 
        /* this signal is emitted if a JACK port is registered or unregistered */
 
-       boost::signals2::signal<void()> PortRegisteredOrUnregistered;
+       PBD::Signal0<void> PortRegisteredOrUnregistered;
 
        std::string make_port_name_relative (std::string);
        std::string make_port_name_non_relative (std::string);
index 3312bc889d6a3148d03941e6d6b8f3720b6446a2..f0710843f8c4e9a997f4fd629ed79343a8da9f42 100644 (file)
@@ -84,7 +84,7 @@ public:
        static void set_bwf_serial_number (int);
        static void set_header_position_offset (nframes_t offset );
 
-       static boost::signals2::signal<void()> HeaderPositionOffsetChanged;
+       static PBD::Signal0<void> HeaderPositionOffsetChanged;
 
 protected:
        /** Constructor to be called for existing external-to-session files */
index 927ccfbe1159c17445d42c2a99e797012fd0b444..9dd133cbc04d4eb1d55921dd7e7d3c6504085166 100644 (file)
@@ -52,7 +52,7 @@ class AudioPlaylist : public ARDOUR::Playlist
 
        int set_state (const XMLNode&, int version);
 
-       boost::signals2::signal<void(boost::shared_ptr<Crossfade>)>  NewCrossfade;
+       PBD::Signal1<void,boost::shared_ptr<Crossfade> >  NewCrossfade;
        
        void foreach_crossfade (boost::function<void (boost::shared_ptr<Crossfade>)>);
        void crossfades_at (nframes_t frame, Crossfades&);
index dfa103f2e3af1fa63e96fd173766b2067165f50e..4f4645190795cd1513d2bd78d66afca373fa122e 100644 (file)
@@ -72,10 +72,10 @@ class AudioSource : virtual public Source,
                        sframes_t start, nframes_t cnt, double samples_per_visual_peak) const;
 
        int  build_peaks ();
-       bool peaks_ready (boost::function<void()> callWhenReady, boost::signals2::connection& connection_established_if_not_ready) const;
+       bool peaks_ready (boost::function<void()> callWhenReady, PBD::Connection& connection_created_if_not_ready) const;
 
-       mutable boost::signals2::signal<void()>  PeaksReady;
-       mutable boost::signals2::signal<void(nframes_t,nframes_t)>  PeakRangeReady;
+       mutable PBD::Signal0<void>  PeaksReady;
+       mutable PBD::Signal2<void,nframes_t,nframes_t>  PeakRangeReady;
 
        XMLNode& get_state ();
        int set_state (const XMLNode&, int version);
index c75abda0b728971e8a1b9061cb364373effa6731..1778771c5fe54cb6d8fbb3cf0a17dadbd4cca55c 100644 (file)
@@ -56,11 +56,11 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL
 
        void set_automation_state (AutoState);
        AutoState automation_state() const { return _state; }
-       boost::signals2::signal<void()> automation_state_changed;
+       PBD::Signal0<void> automation_state_changed;
 
        void set_automation_style (AutoStyle m);
        AutoStyle automation_style() const { return _style; }
-       boost::signals2::signal<void()> automation_style_changed;
+       PBD::Signal0<void> automation_style_changed;
 
        bool automation_playback() const {
                return (_state & Play) || ((_state & Touch) && !_touching);
@@ -69,10 +69,10 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL
                return (_state & Write) || ((_state & Touch) && _touching);
        }
 
-       boost::signals2::signal<void()> StateChanged;
+       PBD::Signal0<void> StateChanged;
 
-       static boost::signals2::signal<void(AutomationList*)> AutomationListCreated;
-       mutable boost::signals2::signal<void()> Dirty;
+       static PBD::Signal1<void,AutomationList*> AutomationListCreated;
+       mutable PBD::Signal0<void> Dirty;
 
        void start_touch ();
        void stop_touch ();
index 662c3799a5292f569a282c055546cc734dfc34cc..cc2ee19155fdb067b6151f7578184609c51680bc 100644 (file)
@@ -25,7 +25,7 @@
 #include <glibmm/thread.h>
 #include <boost/shared_ptr.hpp>
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/data_type.h"
 
@@ -120,7 +120,7 @@ class Bundle : public PBD::ScopedConnectionList
                DirectionChanged = 0x10 ///< the direction (whether ports are inputs or outputs) has changed
        };
 
-       boost::signals2::signal<void(Change)> Changed;
+       PBD::Signal1<void,Change> Changed;
 
   protected:
 
index 1c82309d87fc0c567588510beaabecc3b08d2cf2..14a43e160c947c0f694a9c3ccd3b7c74c1ba4ad6 100644 (file)
@@ -21,7 +21,7 @@
 #define __ardour_configuration_h__
 
 #include <boost/function.hpp>
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 #include "pbd/stateful.h"
 #include "ardour/configuration_variable.h"
 
@@ -41,7 +41,7 @@ class Configuration : public PBD::Stateful
        virtual XMLNode & get_variables () = 0;
        virtual void set_variables (XMLNode const &) = 0;
 
-       boost::signals2::signal<void(std::string)> ParameterChanged;
+       PBD::Signal1<void,std::string> ParameterChanged;
 };
 
 } // namespace ARDOUR
index 1a492b742b9029a0b594910cd8f0d6c457ac62ed..5e25bbe00db436a2cdb356909f6b095bf77593ef 100644 (file)
@@ -105,8 +105,8 @@ class Crossfade : public ARDOUR::AudioRegion
 
        nframes_t overlap_length() const;
 
-       boost::signals2::signal<void(boost::shared_ptr<Region>)> Invalidated;
-       boost::signals2::signal<void(Change)>     StateChanged;
+       PBD::Signal1<void,boost::shared_ptr<Region> > Invalidated;
+       PBD::Signal1<void,Change>     StateChanged;
 
        bool covers (nframes_t frame) const {
                return _position <= frame && frame < _position + _length;
index 7a5931c5fb68551b4392a49ea1e3b6cf18074c6d..a7ccd96a2db96e39efcfa65ddb070c81e475ab5c 100644 (file)
@@ -85,9 +85,9 @@ public:
 
        BufferSet& output_buffers() { return *_output_buffers; }
 
-       boost::signals2::signal<void()> MuteChange;
+       PBD::Signal0<void> MuteChange;
 
-       static boost::signals2::signal<void(nframes_t)> CycleStart;
+       static PBD::Signal1<void,nframes_t> CycleStart;
 
        XMLNode& state (bool full);
        int set_state (const XMLNode&, int version);
@@ -120,10 +120,10 @@ public:
        boost::shared_ptr<Panner> _panner;
 
        static bool panners_legal;
-       static boost::signals2::signal<int()>            PannersLegal;
+       static PBD::Signal0<int>            PannersLegal;
 
        int panners_became_legal ();
-       boost::signals2::scoped_connection panner_legal_c;
+       PBD::ScopedConnection panner_legal_c;
        void output_changed (IOChange, void*);
 
        gain_t target_gain ();
index a9664daa3227512f4a5f41ea494561de90fe414a..85e3071021c0a87f4ca0c45345594eda9c41768c 100644 (file)
@@ -49,7 +49,7 @@ class Region;
 class Route;
 class Session;
 
-class Diskstream : public SessionObject, public boost::noncopyable
+class Diskstream : public SessionObject
 {
   public:
        enum Flag {
@@ -143,15 +143,15 @@ class Diskstream : public SessionObject, public boost::noncopyable
        void move_processor_automation (boost::weak_ptr<Processor>,
                        std::list< Evoral::RangeMove<nframes_t> > const &);
 
-       boost::signals2::signal<void()>            RecordEnableChanged;
-       boost::signals2::signal<void()>            SpeedChanged;
-       boost::signals2::signal<void()>            ReverseChanged;
-       boost::signals2::signal<void()>            PlaylistChanged;
-       boost::signals2::signal<void()>            AlignmentStyleChanged;
-       boost::signals2::signal<void(Location *)> LoopSet;
+       PBD::Signal0<void>            RecordEnableChanged;
+       PBD::Signal0<void>            SpeedChanged;
+       PBD::Signal0<void>            ReverseChanged;
+       PBD::Signal0<void>            PlaylistChanged;
+       PBD::Signal0<void>            AlignmentStyleChanged;
+       PBD::Signal1<void,Location *> LoopSet;
 
-       static boost::signals2::signal<void()>     DiskOverrun;
-       static boost::signals2::signal<void()>     DiskUnderrun;
+       static PBD::Signal0<void>     DiskOverrun;
+       static PBD::Signal0<void>     DiskUnderrun;
 
   protected:
        friend class Session;
@@ -306,7 +306,7 @@ class Diskstream : public SessionObject, public boost::noncopyable
 
        PBD::ScopedConnectionList playlist_connections;
 
-       boost::signals2::scoped_connection ic_connection;
+       PBD::ScopedConnection ic_connection;
 
        Flag _flags;
 
index d728a4b98997431973de1ea01ad96dd7cf9f0b65..8ffa3b90ba4f3e088b5528434c34066a6057248c 100644 (file)
@@ -24,7 +24,7 @@
 #include <string>
 #include <utility>
 
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 #include "ardour/types.h"
 
 class XMLTree;
@@ -72,10 +72,10 @@ class ElementImporter
        bool broken () { return _broken; }
 
        /// Signal that requests for anew name
-       static boost::signals2::signal <std::pair<bool, std::string> (std::string, std::string)> Rename;
+       static PBD::Signal2<std::pair<bool, std::string>,std::string, std::string> Rename;
 
        /// Signal for ok/cancel prompting
-       static boost::signals2::signal <bool(std::string)> Prompt;
+       static PBD::Signal1<bool,std::string> Prompt;
 
   protected:
 
index 055168118d8ed6a99dd53b813eb4a09737d4d2d6..ee533d4c6d05d97cefe20e3af8f6441b3c500daf 100644 (file)
@@ -84,7 +84,7 @@ namespace ARDOUR
                SRC_STATE*     src_state;
                nframes_t      pos;
 
-               boost::signals2::scoped_connection freewheel_connection;
+               PBD::ScopedConnection freewheel_connection;
 
                /* shared between UI thread and audio thread */
 
index 4a2f74b775843c6fef975257166b12d9714aa69d..73e3406869b4ea1bdedc2ae3c3527d17cc9d3825 100644 (file)
@@ -123,7 +123,7 @@ class RegionExportChannelFactory
        Sample * mixdown_buffer;
        Sample * gain_buffer;
 
-       boost::signals2::scoped_connection export_connection;
+       PBD::ScopedConnection export_connection;
 };
 
 /// Export channel that reads from region channel
index b8d7fa6bf178358e3d12fff974ef5877c27240b0..9ca49f452d1a6515c36d0bcaa832c6195543db43 100644 (file)
@@ -95,7 +95,7 @@ class ExportChannelConfiguration
 
        /// Writes all files for this channel config @return true if a new thread was spawned
        bool write_files (boost::shared_ptr<ExportProcessor> new_processor);
-       boost::signals2::signal<void()> FilesWritten;
+       PBD::Signal0<void> FilesWritten;
 
        // Tells the handler the necessary information for it to handle tempfiles
        void register_with_timespan (TimespanPtr timespan);
index ceb11a2cc9cecd5ea3ac7d0b9637dfd655f64bc3..dceb943e621c5705eacb733cf07b6ad41365617c 100644 (file)
@@ -115,8 +115,8 @@ class ExportFormatBase {
                        : _selected (false), _compatible (true) { }
                ~SelectableCompatible () {}
 
-               boost::signals2::signal<void(bool)> SelectChanged;
-               boost::signals2::signal<void(bool)> CompatibleChanged;
+               PBD::Signal1<void,bool> SelectChanged;
+               PBD::Signal1<void,bool> CompatibleChanged;
 
                bool selected () const { return _selected; }
                bool compatible () const { return _compatible; }
index 52463350fea3cab85821e77e14d90cf14b9262c4..0d1a0310d99a6f2fc3d599e40fa0c5832c7ff89b 100644 (file)
@@ -27,7 +27,7 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/export_formats.h"
 
@@ -92,7 +92,7 @@ class ExportFormatManager : public PBD::ScopedConnectionList
 
        /* Signals */
 
-       boost::signals2::signal<void(bool)> CompleteChanged;
+       PBD::Signal1<void,bool> CompleteChanged;
 
        /* Access to lists */
 
index 3ef207097b29776e6eb800309ae84cd856ae6336..03585f79a966afed24ea2aef16245e6b07f5c76c 100644 (file)
@@ -25,7 +25,7 @@
 #include <boost/weak_ptr.hpp>
 
 #include "pbd/failed_constructor.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/export_format_base.h"
 #include "ardour/export_format_compatibility.h"
@@ -128,11 +128,11 @@ class HasSampleFormat : public PBD::ScopedConnectionList {
 
        /* Proxies for signals from sample formats and dither types */
 
-       boost::signals2::signal<void(bool, WeakSampleFormatPtr)> SampleFormatSelectChanged;
-       boost::signals2::signal<void(bool, WeakSampleFormatPtr)> SampleFormatCompatibleChanged;
+       PBD::Signal2<void,bool, WeakSampleFormatPtr> SampleFormatSelectChanged;
+       PBD::Signal2<void,bool, WeakSampleFormatPtr> SampleFormatCompatibleChanged;
 
-       boost::signals2::signal<void(bool, WeakDitherTypePtr)> DitherTypeSelectChanged;
-       boost::signals2::signal<void(bool, WeakDitherTypePtr)> DitherTypeCompatibleChanged;
+       PBD::Signal2<void,bool, WeakDitherTypePtr> DitherTypeSelectChanged;
+       PBD::Signal2<void,bool, WeakDitherTypePtr> DitherTypeCompatibleChanged;
 
        static std::string get_sample_format_name (ExportFormatBase::SampleFormat format);
 
index ded6ed5b022d6f9898652a3291d6fcbf2887af92..bbf1f7e20844d7c5bc5b978cb7c400aa61b86614 100644 (file)
@@ -118,8 +118,8 @@ class ExportHandler : public ExportElementFactory
 
        bool               realtime;
 
-       boost::signals2::scoped_connection          files_written_connection;
-       boost::signals2::scoped_connection          export_read_finished_connection;
+       PBD::ScopedConnection          files_written_connection;
+       PBD::ScopedConnection          export_read_finished_connection;
        std::list<Glib::ustring> files_written;
        void add_file (const Glib::ustring&);
 
@@ -177,7 +177,7 @@ class ExportHandler : public ExportElementFactory
        TimespanPtr          current_timespan;
        ConfigMap::iterator  current_map_it;
        TimespanBounds       timespan_bounds;
-       boost::signals2::scoped_connection     channel_config_connection;
+       PBD::ScopedConnection     channel_config_connection;
 
 };
 
index aace72cc427acdd6123b622f5f3c45a30f79ab2e..eb90e62c478cb71cb06158bf224bf7e3f783151b 100644 (file)
@@ -36,7 +36,7 @@
                bool selected () const { return _selected; }
                void select (bool value);
 
-               boost::signals2::signal<void(bool)> SelectChanged;
+               PBD::Signal1<void,bool> SelectChanged;
 
          protected:
 
        void split_node (GraphNode * node, float position);
        void remove_node (GraphNode * node);
 
-       boost::signals2::signal<void()> GraphChanged;
+       PBD::Signal0<void> GraphChanged;
 
   private:
 
index 8e7918d7c514f8b9ba109da3b36ddec94a11dd99..493dd3231f7a2db06b474e41dcbf67289739fe27 100644 (file)
@@ -80,7 +80,7 @@ class ExportProcessor
 
        void write_files ();
 
-       static boost::signals2::signal<void(const Glib::ustring&)> WritingFile;
+       static PBD::Signal1<void,const Glib::ustring&> WritingFile;
 
   private:
 
index 30bb3c5b91becf1225d1015313f897e308822789..a29979460f45ada6ec561924bf7c8092d022488a 100644 (file)
@@ -206,7 +206,7 @@ class ExportProfileManager
        void remove_format_profile (FormatPtr format);
        FormatPtr get_new_format (FormatPtr original);
 
-       boost::signals2::signal<void()> FormatListChanged;
+       PBD::Signal0<void> FormatListChanged;
 
   private:
 
index 9fd3c84eccdaa77b799a04f84218b78cc77e4583..1613fffe525377db80f341ec0c27257ae92b3445 100644 (file)
@@ -22,7 +22,7 @@
 #define __ardour_export_status_h__
 
 #include <list>
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 
 #include <stdint.h>
 
@@ -46,12 +46,12 @@ struct ExportStatus {
        volatile bool           stop;
        volatile bool           running;
 
-       boost::signals2::signal<void()>      Aborting;
+       PBD::Signal0<void>      Aborting;
        void abort (bool error_occurred = false);
        bool aborted () const { return _aborted; }
        bool errors () const { return _errors; }
 
-       boost::signals2::signal<void()>      Finished;
+       PBD::Signal0<void>      Finished;
        void finish ();
        bool finished () const { return _finished; }
 
index 461caf6dd8bac0aa6224900c2e651c93394ddad5..7b7ae7cd9919a0bb9cdb0ea4d722bf7a35af4a94 100644 (file)
@@ -69,7 +69,7 @@ class ExportTimespan
        /// Reads data from each channel and writes to tempfile
        int process (nframes_t frames);
 
-       boost::signals2::scoped_connection  process_connection;
+       PBD::ScopedConnection  process_connection;
 
        void set_range (nframes_t start, nframes_t end);
        nframes_t get_length () const { return end_frame - start_frame; }
index 498c9f3605bd8a1681e362fcd635f7af32c128f5..c5facebef602303657cbf3bd3e1401ef02e97151 100644 (file)
@@ -47,7 +47,7 @@ class InternalReturn : public Return
        BufferSet* get_buffers();
        void release_buffers();
 
-       static boost::signals2::signal<void(nframes_t)> CycleStart;
+       static PBD::Signal1<void,nframes_t> CycleStart;
 
   private:
        BufferSet buffers;
index 7573efd685cff14e4050eaaf90b391938cd71912..2171462ab7aa9c08f370808dc92019a484457947 100644 (file)
@@ -53,7 +53,7 @@ class InternalSend : public Send
        BufferSet* target;
        boost::shared_ptr<Route> _send_to;
        PBD::ID _send_to_id;
-       boost::signals2::scoped_connection connect_c;
+       PBD::ScopedConnection connect_c;
 
        void send_to_going_away ();
        void send_to_name_changed ();
index eeb7ed64f0c06c39569a03986c279934bfa469e0..b718cfa5c9aeeed5b22ef460892d481f929a7ff7 100644 (file)
@@ -132,7 +132,7 @@ class IO : public SessionObject, public Latent
 
        const ChanCount& n_ports ()  const { return _ports.count(); }
 
-       boost::signals2::signal<void(IOChange,void*)> changed;
+       PBD::Signal2<void,IOChange,void*> changed;
 
        virtual XMLNode& state (bool full);
        XMLNode& get_state (void);
@@ -144,7 +144,7 @@ class IO : public SessionObject, public Latent
        static int  disable_ports (void);
        static int  enable_ports (void);
 
-       static boost::signals2::signal<void(ChanCount)> PortCountChanged; // emitted when the number of ports changes
+       static PBD::Signal1<void,ChanCount> PortCountChanged; // emitted when the number of ports changes
 
        static std::string name_from_state (const XMLNode&);
        static void set_name_in_state (XMLNode&, const std::string&);
@@ -152,7 +152,7 @@ class IO : public SessionObject, public Latent
        /* we have to defer/order port connection. this is how we do it.
        */
 
-       static boost::signals2::signal<int()> ConnectingLegal;
+       static PBD::Signal0<int> ConnectingLegal;
        static bool              connecting_legal;
 
        XMLNode *pending_state_node;
@@ -180,14 +180,14 @@ class IO : public SessionObject, public Latent
 
   private:
        int connecting_became_legal ();
-       boost::signals2::scoped_connection connection_legal_c;
+       PBD::ScopedConnection connection_legal_c;
 
        boost::shared_ptr<Bundle> _bundle; ///< a bundle representing our ports
 
        struct UserBundleInfo {
            UserBundleInfo (IO*, boost::shared_ptr<UserBundle> b);
            boost::shared_ptr<UserBundle> bundle;
-           boost::signals2::scoped_connection changed;
+           PBD::ScopedConnection changed;
        };
        
        std::vector<UserBundleInfo*> _bundles_connected; ///< user bundles connected to our ports
index e4a42a80e2840c68bf6c5094ae51ed7b789a1b88..2acf7337a71a82b3cbdf36ba5c268b264a9f909e 100644 (file)
@@ -67,8 +67,8 @@ class IOProcessor : public Processor
 
        virtual bool feeds (boost::shared_ptr<Route> other) const;
 
-       boost::signals2::signal<void(IOProcessor*,bool)>     AutomationPlaybackChanged;
-       boost::signals2::signal<void(IOProcessor*,uint32_t)> AutomationChanged;
+       PBD::Signal2<void,IOProcessor*,bool>     AutomationPlaybackChanged;
+       PBD::Signal2<void,IOProcessor*,uint32_t> AutomationChanged;
 
        XMLNode& state (bool full_state);
        int set_state (const XMLNode&, int version);
index b50a645a93aeeda8078314c84b339f8660a83296..1f2b80c831953c3237798b77c0616b1ccee45365 100644 (file)
@@ -108,15 +108,15 @@ class Location : public PBD::StatefulDestructible
        bool is_range_marker() const { return _flags & IsRangeMarker; }
        bool matches (Flags f) const { return _flags & f; }
 
-       boost::signals2::signal<void(Location*)> name_changed;
-       boost::signals2::signal<void(Location*)> end_changed;
-       boost::signals2::signal<void(Location*)> start_changed;
+       PBD::Signal1<void,Location*> name_changed;
+       PBD::Signal1<void,Location*> end_changed;
+       PBD::Signal1<void,Location*> start_changed;
 
-       boost::signals2::signal<void(Location*,void*)> FlagsChanged;
+       PBD::Signal2<void,Location*,void*> FlagsChanged;
 
        /* this is sent only when both start&end change at the same time */
 
-       boost::signals2::signal<void(Location*)> changed;
+       PBD::Signal1<void,Location*> changed;
 
        /* CD Track / CD-Text info */
 
@@ -175,11 +175,11 @@ class Locations : public PBD::StatefulDestructible
 
        void find_all_between (nframes64_t start, nframes64_t, LocationList&, Location::Flags);
 
-       boost::signals2::signal<void(Location*)> current_changed;
-       boost::signals2::signal<void()>           changed;
-       boost::signals2::signal<void(Location*)> added;
-       boost::signals2::signal<void(Location*)> removed;
-       boost::signals2::signal<void(Change)>    StateChanged;
+       PBD::Signal1<void,Location*> current_changed;
+       PBD::Signal0<void>           changed;
+       PBD::Signal1<void,Location*> added;
+       PBD::Signal1<void,Location*> removed;
+       PBD::Signal1<void,Change>    StateChanged;
 
        template<class T> void apply (T& obj, void (T::*method)(LocationList&)) {
                Glib::Mutex::Lock lm (lock);
index 1f5e3307d6079abbc28757ddd4022f32a86da143..2a283c0c641af5e84ef1334131489b88282ef396 100644 (file)
@@ -22,6 +22,7 @@
 #include <vector>
 #include "ardour/types.h"
 #include "ardour/processor.h"
+#include "pbd/signals.h"
 #include "pbd/fastlog.h"
 
 namespace ARDOUR {
@@ -33,16 +34,11 @@ class Session;
 class Metering {
   public:
        static void               update_meters ();
-       static boost::signals2::signal<void()> Meter;
-
-       static boost::signals2::connection connect (boost::function<void()>);
-       static void                        disconnect (boost::signals2::connection& c);
+       static PBD::Signal0<void> Meter;
 
   private:
        /* this object is not meant to be instantiated */
        Metering();
-
-       static Glib::StaticMutex    m_meter_signal_lock;
 };
 
 /** Meters peaks on the input and stores them for access.
index 9961b51528b5dad63b0f0c5dc71b697d8cbc23c8..3cf64da6ea4cd871f6822d39d39fc8c6c38e6836 100644 (file)
@@ -158,7 +158,7 @@ public:
        XMLNode& get_state();
        int set_state(const XMLNode&) { return 0; }
 
-       boost::signals2::signal<void()> ContentsChanged;
+       PBD::Signal0<void> ContentsChanged;
 
        const MidiSource* midi_source() const { return _midi_source; }
        void set_midi_source(MidiSource* source) { _midi_source = source; }
index 8c4ff43d5cdd7e4b04cac456d7885c34e236c9e1..f352009ba7ce731252fcdea814c9a000d69ae469 100644 (file)
@@ -22,7 +22,7 @@
 #define MIDI_PATCH_MANAGER_H_
 
 #include "midi++/midnam_patch.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 #include "ardour/session_handle.h"
 
 namespace ARDOUR {
index 74448991d99b3d190d9a6bf0f99ce1cc97b79636..7b867c70fd0a41eb7be9e9ec30ef6d42532a07dc 100644 (file)
@@ -86,10 +86,10 @@ class MidiSource : virtual public Source
        uint32_t read_data_count()  const { return _read_data_count; }
        uint32_t write_data_count() const { return _write_data_count; }
 
-       static boost::signals2::signal<void(MidiSource*)> MidiSourceCreated;
+       static PBD::Signal1<void,MidiSource*> MidiSourceCreated;
 
        // Signal a range of recorded data is available for reading from model()
-       mutable boost::signals2::signal<void(sframes_t,nframes_t)> ViewDataRangeReady;
+       mutable PBD::Signal2<void,sframes_t,nframes_t> ViewDataRangeReady;
 
        XMLNode& get_state ();
        int set_state (const XMLNode&, int version);
index 0ecf1b0589c79c4dd6f764d4dc57c02338d744b0..869d7ab7087c866ab70e519073b8f6ba5dce8295 100644 (file)
@@ -42,7 +42,7 @@ class MidiControlUI : public AbstractUI<MidiUIRequest>
        typedef std::list<GSource*> PortSources;
        PortSources port_sources;
        ARDOUR::Session& _session;
-       boost::signals2::scoped_connection rebind_connection;
+       PBD::ScopedConnection rebind_connection;
 
        bool midi_input_handler (Glib::IOCondition, MIDI::Port*);
        void reset_ports ();
index a76775c710aeff78d6bdccff1cbe38149776cb06..afc1037e42bbde37ea6a458c4893ea1d46435553 100644 (file)
@@ -64,7 +64,7 @@ class MuteMaster : public AutomationControl
        void set_value (float); /* note: float is used as a bitfield of MutePoints */
        float get_value () const;
 
-       boost::signals2::signal<void()> MutePointChanged;
+       PBD::Signal0<void> MutePointChanged;
 
        XMLNode& get_state();
        int set_state(const XMLNode&, int version);
index 0c930d5b72aed4a0830c657341c3a84d94d53f08..c17ef3bf4dff1ed00e1da217460b4832cbc6286e 100644 (file)
@@ -46,7 +46,7 @@ struct NamedSelection : public PBD::Stateful
 
     int set_state (const XMLNode&, int version);
 
-    static boost::signals2::signal<void(NamedSelection*)> NamedSelectionCreated;
+    static PBD::Signal1<void,NamedSelection*> NamedSelectionCreated;
 };
 
 }/* namespace ARDOUR */
index bf5a04c745d33191f6c62499ba82a606becebdcd..954727d2809f590f067366c43a60d6e867f2ad9b 100644 (file)
@@ -81,8 +81,8 @@ class StreamPanner : public PBD::Stateful
 
        boost::shared_ptr<AutomationControl> pan_control()  { return _control; }
 
-       boost::signals2::signal<void()> Changed;      /* for position */
-       boost::signals2::signal<void()> StateChanged; /* for mute */
+       PBD::Signal0<void> Changed;      /* for position */
+       PBD::Signal0<void> StateChanged; /* for mute */
 
        int set_state (const XMLNode&, int version);
        virtual XMLNode& state (bool full_state) = 0;
@@ -270,9 +270,9 @@ public:
        StreamPanner &streampanner( uint32_t n ) const { assert( n < _streampanners.size() ); return *_streampanners[n]; }
        uint32_t npanners() const { return _streampanners.size(); }
 
-       boost::signals2::signal<void()> Changed;
-       boost::signals2::signal<void()> LinkStateChanged;
-       boost::signals2::signal<void()> StateChanged; /* for bypass */
+       PBD::Signal0<void> Changed;
+       PBD::Signal0<void> LinkStateChanged;
+       PBD::Signal0<void> StateChanged; /* for bypass */
 
        /* only StreamPanner should call these */
 
index 9c089c2f05dae927aa42ebea4ca6dabf998c9706..8bcdc5540b1c30beb20dc449d77d8df843e39788 100644 (file)
@@ -51,7 +51,6 @@ class Session;
 class Region;
 
 class Playlist : public SessionObject
-              , public boost::noncopyable
               , public boost::enable_shared_from_this<Playlist> {
   public:
        typedef std::list<boost::shared_ptr<Region> >    RegionList;
@@ -130,13 +129,13 @@ class Playlist : public SessionObject
        int set_state (const XMLNode&, int version);
        XMLNode& get_template ();
 
-       boost::signals2::signal<void(bool)> InUse;
-       boost::signals2::signal<void()>      Modified;
-       boost::signals2::signal<void(boost::weak_ptr<Region>)> RegionAdded;
-       boost::signals2::signal<void(boost::weak_ptr<Region>)> RegionRemoved;
-       boost::signals2::signal<void()>      NameChanged;
-       boost::signals2::signal<void()>      LengthChanged;
-       boost::signals2::signal<void(std::list< Evoral::RangeMove<nframes_t> > const &)> RangesMoved;
+       PBD::Signal1<void,bool> InUse;
+       PBD::Signal0<void>      Modified;
+       PBD::Signal1<void,boost::weak_ptr<Region> > RegionAdded;
+       PBD::Signal1<void,boost::weak_ptr<Region> > RegionRemoved;
+       PBD::Signal0<void>      NameChanged;
+       PBD::Signal0<void>      LengthChanged;
+       PBD::Signal1<void,std::list< Evoral::RangeMove<nframes_t> > const &> RangesMoved;
 
        static std::string bump_name (std::string old_name, Session&);
 
index 4c3680ae8e8d1e6d1330a5e31783c94965dd3886..17645ad8a3bbd699a2b174da3079b4e08b434684 100644 (file)
@@ -31,7 +31,7 @@ class Session;
 class PlaylistFactory {
 
   public:
-       static boost::signals2::signal<void(boost::shared_ptr<Playlist>, bool)> PlaylistCreated;
+       static PBD::Signal2<void,boost::shared_ptr<Playlist>, bool> PlaylistCreated;
 
        static boost::shared_ptr<Playlist> create (Session&, const XMLNode&, bool hidden = false, bool unused = false);
        static boost::shared_ptr<Playlist> create (DataType type, Session&, std::string name, bool hidden = false);
index ea8f95d8f500c83f3f7b663959609d3df8aca906..4770c43511ec3d6f6249c3e1bc566df6d20c31f9 100644 (file)
@@ -143,7 +143,7 @@ class Plugin : public PBD::StatefulDestructible, public Latent
 
        virtual bool has_editor() const = 0;
 
-       boost::signals2::signal<void(uint32_t,float)> ParameterChanged;
+       PBD::Signal2<void,uint32_t,float> ParameterChanged;
 
        /* NOTE: this block of virtual methods looks like the interface
           to a Processor, but Plugin does not inherit from Processor.
index 6be8f1dda6d03a84bd620f5c9f1f461d65827c69..25f380c41b65dee8ee55bb2d16cf178725fdfa8c 100644 (file)
@@ -106,7 +106,7 @@ class PluginInsert : public Processor
 
        void collect_signal_for_analysis(nframes_t nframes);
 
-       boost::signals2::signal<void(BufferSet*, BufferSet*)> AnalysisDataGathered;
+       PBD::Signal2<void,BufferSet*, BufferSet*> AnalysisDataGathered;
 
   private:
        /* disallow copy construction */
index 44c529835e6d5952822da693365d2281598f1881..14c419078759040cc2a981f706603ba6634a1340 100644 (file)
@@ -70,7 +70,7 @@ class PluginManager : public boost::noncopyable {
        PluginStatusType get_status (const PluginInfoPtr&);
 
        /** plugins were added to or removed from one of the PluginInfoLists */
-       boost::signals2::signal<void()> PluginListChanged;
+       PBD::Signal0<void> PluginListChanged;
 
   private:
        struct PluginStatus {
index be4df6bd025486ca31165f8c615951f30a159167..ce4b88f8f2c37f9a451fa3780b70ef9b447a2636 100644 (file)
@@ -25,7 +25,7 @@
 #include <vector>
 #include <jack/jack.h>
 #include <boost/utility.hpp>
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 
 #include "ardour/data_type.h"
 #include "ardour/types.h"
@@ -118,7 +118,7 @@ public:
 
        static void set_engine (AudioEngine *);
 
-       boost::signals2::signal<void(bool)> MonitorInputChanged;
+       PBD::Signal1<void,bool> MonitorInputChanged;
 
 protected:
 
index 5962e8f44ecb95c54f8304d86fc5e01fdce2c023..2dd78c66f495d76d652550aa8326ba463ce79c51 100644 (file)
@@ -98,10 +98,10 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
        void *get_gui () const { return _gui; }
        void  set_gui (void *p) { _gui = p; }
 
-       static boost::signals2::signal<void(Processor*)> ProcessorCreated;
+       static PBD::Signal1<void,Processor*> ProcessorCreated;
 
-       boost::signals2::signal<void()>                     ActiveChanged;
-       boost::signals2::signal<void(ChanCount,ChanCount)> ConfigurationChanged;
+       PBD::Signal0<void>                     ActiveChanged;
+       PBD::Signal2<void,ChanCount,ChanCount> ConfigurationChanged;
 
 protected:
        int       _pending_active;
index a276fb19eee92ae2bcc0ba461c26719c02b5a074..4cae00c53209dea028f797cc0fc4de831328a3cc 100644 (file)
@@ -26,7 +26,7 @@
 #include <boost/utility.hpp>
 
 #include "pbd/undo.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/ardour.h"
 #include "ardour/data_type.h"
@@ -49,10 +49,9 @@ enum RegionEditState {
 };
 
 class Region
-               : public SessionObject
-               , public boost::noncopyable
-               , public boost::enable_shared_from_this<Region>
-               , public Readable
+       : public SessionObject
+       , public boost::enable_shared_from_this<Region>
+       , public Readable
 {
   public:
        typedef std::vector<boost::shared_ptr<Source> > SourceList;
@@ -96,8 +95,8 @@ class Region
        static Change LayerChanged;
        static Change HiddenChanged;
 
-       boost::signals2::signal<void(Change)> StateChanged;
-       static boost::signals2::signal<void(boost::shared_ptr<ARDOUR::Region>)> RegionPropertyChanged;
+       PBD::Signal1<void,Change> StateChanged;
+       static PBD::Signal1<void,boost::shared_ptr<ARDOUR::Region> > RegionPropertyChanged;
        void unlock_property_changes () { _flags = Flag (_flags & ~DoNotSendPropertyChanges); }
        void block_property_changes () { _flags = Flag (_flags | DoNotSendPropertyChanges); }
 
index 51858e4926072cedff6df1aa80c6fb77ac7de88c..b53e9490debf3733b6d2400eeba8739623aea461 100644 (file)
@@ -40,7 +40,7 @@ class RegionFactory {
           itself, to permit dynamic_cast<> to be used to
           infer the type of Region.
        */
-       static boost::signals2::signal<void(boost::shared_ptr<Region>)>  CheckNewRegion;
+       static PBD::Signal1<void,boost::shared_ptr<Region> >  CheckNewRegion;
 
        static boost::shared_ptr<Region> create (boost::shared_ptr<const Region>);
 
index dd6173e96329af237b245560e09140e43c8104de..9630975d1ffc9c71d0efd4ac3b599bb725089c96 100644 (file)
@@ -227,28 +227,28 @@ class Route : public SessionObject, public AutomatableControls, public RouteGrou
        void set_user_latency (nframes_t);
        nframes_t initial_delay() const { return _initial_delay; }
 
-       boost::signals2::signal<void()>       active_changed;
-       boost::signals2::signal<void()>       phase_invert_changed;
-       boost::signals2::signal<void()>       denormal_protection_changed;
-       boost::signals2::signal<void(void*)> listen_changed;
-       boost::signals2::signal<void(void*)> solo_changed;
-       boost::signals2::signal<void(void*)> solo_safe_changed;
-       boost::signals2::signal<void(void*)> solo_isolated_changed;
-       boost::signals2::signal<void(void*)> comment_changed;
-       boost::signals2::signal<void(void*)> mute_changed;
-       boost::signals2::signal<void()>       mute_points_changed;
+       PBD::Signal0<void>       active_changed;
+       PBD::Signal0<void>       phase_invert_changed;
+       PBD::Signal0<void>       denormal_protection_changed;
+       PBD::Signal1<void,void*> listen_changed;
+       PBD::Signal1<void,void*> solo_changed;
+       PBD::Signal1<void,void*> solo_safe_changed;
+       PBD::Signal1<void,void*> solo_isolated_changed;
+       PBD::Signal1<void,void*> comment_changed;
+       PBD::Signal1<void,void*> mute_changed;
+       PBD::Signal0<void>       mute_points_changed;
 
        /** the processors have changed; the parameter indicates what changed */
-       boost::signals2::signal<void(RouteProcessorChange)> processors_changed;
-       boost::signals2::signal<void(void*)> record_enable_changed;
+       PBD::Signal1<void,RouteProcessorChange> processors_changed;
+       PBD::Signal1<void,void*> record_enable_changed;
        /** the metering point has changed */
-       boost::signals2::signal<void(void*)> meter_change; 
-       boost::signals2::signal<void()>       signal_latency_changed;
-       boost::signals2::signal<void()>       initial_delay_changed;
+       PBD::Signal1<void,void*> meter_change; 
+       PBD::Signal0<void>       signal_latency_changed;
+       PBD::Signal0<void>       initial_delay_changed;
 
        /* gui's call this for their own purposes. */
 
-       boost::signals2::signal<void(std::string,void*)> gui_changed;
+       PBD::Signal2<void,std::string,void*> gui_changed;
 
        /* stateful */
 
@@ -261,7 +261,7 @@ class Route : public SessionObject, public AutomatableControls, public RouteGrou
 
        int save_as_template (const std::string& path, const std::string& name);
 
-       boost::signals2::signal<void(void*)> SelectedChanged;
+       PBD::Signal1<void,void*> SelectedChanged;
 
        int listen_via (boost::shared_ptr<Route>, Placement p, bool active, bool aux);
        void drop_listen (boost::shared_ptr<Route>);
@@ -306,10 +306,10 @@ class Route : public SessionObject, public AutomatableControls, public RouteGrou
 
        void set_remote_control_id (uint32_t id);
        uint32_t remote_control_id () const;
-       boost::signals2::signal<void()> RemoteControlIDChanged;
+       PBD::Signal0<void> RemoteControlIDChanged;
 
        void sync_order_keys (std::string const &);
-       static boost::signals2::signal<void(std::string const &)> SyncOrderKeys;
+       static PBD::Signal1<void,std::string const &> SyncOrderKeys;
 
   protected:
        friend class Session;
index fe4079050d754971d0cdc00c53f096c0e64ef886..48b5cb52db7cffe69c656982e10031bbd87e0f92 100644 (file)
 #include <set>
 #include <string>
 #include <stdint.h>
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 
 #include "pbd/stateful.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/types.h"
 
@@ -128,8 +128,8 @@ public:
 
        boost::shared_ptr<RouteList> route_list() { return routes; }
 
-       boost::signals2::signal<void()> changed;
-       boost::signals2::signal<void(void*)> FlagsChanged;
+       PBD::Signal0<void> changed;
+       PBD::Signal1<void,void*> FlagsChanged;
 
        XMLNode& get_state ();
        
index 8743423b1888e181b5254943a55a00274075a364..824fd52bd3c1dbf6d5c01a5409a1c471b9796947 100644 (file)
@@ -33,7 +33,7 @@ class RouteGroupMember
 
        RouteGroup* route_group () const { return _route_group; }
 
-       boost::signals2::signal<void()> route_group_changed;
+       PBD::Signal0<void> route_group_changed;
 
   protected:
        RouteGroup* _route_group;
index 273f251f3de0f75d37512b68ef68a42dd4cef8a7..7c6c83a121d8f68db3c87edbec9adf31054784e9 100644 (file)
@@ -38,7 +38,7 @@
 #include "pbd/error.h"
 #include "pbd/rcu.h"
 #include "pbd/statefuldestructible.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 #include "pbd/undo.h"
 
 #include "midi++/mmc.h"
@@ -118,7 +118,7 @@ class VSTPlugin;
 
 extern void setup_enum_writer ();
 
-class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionList, public SessionEventManager, public boost::noncopyable
+class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionList, public SessionEventManager
 {
   public:
        enum RecordState {
@@ -164,14 +164,14 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void set_deletion_in_progress ();
        void clear_deletion_in_progress ();
        bool deletion_in_progress() const { return _state_of_the_state & Deletion; }
-       boost::signals2::signal<void()> DirtyChanged;
+       PBD::Signal0<void> DirtyChanged;
 
        const SessionDirectory& session_directory () const { return *(_session_dir.get()); }
 
-       static boost::signals2::signal<void()> AutoBindingOn;
-       static boost::signals2::signal<void()> AutoBindingOff;
+       static PBD::Signal0<void> AutoBindingOn;
+       static PBD::Signal0<void> AutoBindingOff;
 
-       static boost::signals2::signal<void(std::string)> Dialog;
+       static PBD::Signal1<void,std::string> Dialog;
 
        std::string sound_dir (bool with_path = true) const;
        std::string peak_dir () const;
@@ -272,29 +272,29 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        /* Proxy signal for region hidden changes */
 
-       boost::signals2::signal<void(boost::shared_ptr<Region>)> RegionHiddenChange;
+       PBD::Signal1<void,boost::shared_ptr<Region> > RegionHiddenChange;
 
        /* Emitted when all i/o connections are complete */
 
-       boost::signals2::signal<void()> IOConnectionsComplete;
+       PBD::Signal0<void> IOConnectionsComplete;
 
        /* Record status signals */
 
-       boost::signals2::signal<void()> RecordStateChanged;
+       PBD::Signal0<void> RecordStateChanged;
 
        /* Transport mechanism signals */
 
-       boost::signals2::signal<void()> TransportStateChange; /* generic */
-       boost::signals2::signal<void(nframes64_t)> PositionChanged; /* sent after any non-sequential motion */
-       boost::signals2::signal<void()> DurationChanged;
-       boost::signals2::signal<void(nframes64_t)> Xrun;
-       boost::signals2::signal<void()> TransportLooped;
+       PBD::Signal0<void> TransportStateChange; /* generic */
+       PBD::Signal1<void,nframes64_t> PositionChanged; /* sent after any non-sequential motion */
+       PBD::Signal0<void> DurationChanged;
+       PBD::Signal1<void,nframes64_t> Xrun;
+       PBD::Signal0<void> TransportLooped;
 
        /** emitted when a locate has occurred */
-       boost::signals2::signal<void()> Located;
+       PBD::Signal0<void> Located;
 
-       boost::signals2::signal<void(RouteList&)> RouteAdded;
-       boost::signals2::signal<void()> RouteGroupChanged;
+       PBD::Signal1<void,RouteList&> RouteAdded;
+       PBD::Signal0<void> RouteGroupChanged;
 
        void queue_event (SessionEvent*);
 
@@ -348,9 +348,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        Locations *locations() { return &_locations; }
 
-       boost::signals2::signal<void(Location*)>    auto_loop_location_changed;
-       boost::signals2::signal<void(Location*)>    auto_punch_location_changed;
-       boost::signals2::signal<void()>              locations_modified;
+       PBD::Signal1<void,Location*>    auto_loop_location_changed;
+       PBD::Signal1<void,Location*>    auto_punch_location_changed;
+       PBD::Signal0<void>              locations_modified;
 
        void set_auto_punch_location (Location *);
        void set_auto_loop_location (Location *);
@@ -375,8 +375,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        static int rename_template (std::string old_name, std::string new_name);
        static int delete_template (std::string name);
 
-       boost::signals2::signal<void(std::string)> StateSaved;
-       boost::signals2::signal<void()> StateReady;
+       PBD::Signal1<void,std::string> StateSaved;
+       PBD::Signal0<void> StateReady;
 
        std::vector<std::string*>* possible_states() const;
        static std::vector<std::string*>* possible_states (std::string path);
@@ -406,8 +406,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        RouteGroup *route_group_by_name (std::string);
 
-       boost::signals2::signal<void(RouteGroup*)> route_group_added;
-       boost::signals2::signal<void()>             route_group_removed;
+       PBD::Signal1<void,RouteGroup*> route_group_added;
+       PBD::Signal0<void>             route_group_removed;
 
        void foreach_route_group (boost::function<void(RouteGroup*)> f) {
                for (std::list<RouteGroup *>::iterator i = _route_groups.begin(); i != _route_groups.end(); i++) {
@@ -476,9 +476,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        nframes_t convert_to_frames_at (nframes_t position, AnyTime const &);
 
-       static boost::signals2::signal<void()> StartTimeChanged;
-       static boost::signals2::signal<void()> EndTimeChanged;
-       static boost::signals2::signal<void()> TimecodeOffsetChanged;
+       static PBD::Signal0<void> StartTimeChanged;
+       static PBD::Signal0<void> EndTimeChanged;
+       static PBD::Signal0<void> TimecodeOffsetChanged;
 
         std::vector<SyncSource> get_available_sync_options() const;
        void   request_sync_source (Slave*);
@@ -496,15 +496,15 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        TempoMap& tempo_map() { return *_tempo_map; }
 
        /// signals the current transport position in frames, bbt and timecode time (in that order)
-       boost::signals2::signal<void(const nframes_t&, const BBT_Time&, const Timecode::Time&)> tick;
+       PBD::Signal3<void,const nframes_t&, const BBT_Time&, const Timecode::Time&> tick;
 
        /* region info  */
 
        void add_regions (std::vector<boost::shared_ptr<Region> >&);
 
-       boost::signals2::signal<void(boost::weak_ptr<Region>)>              RegionAdded;
-       boost::signals2::signal<void(std::vector<boost::weak_ptr<Region> >&)> RegionsAdded;
-       boost::signals2::signal<void(boost::weak_ptr<Region>)>              RegionRemoved;
+       PBD::Signal1<void,boost::weak_ptr<Region> >              RegionAdded;
+       PBD::Signal1<void,std::vector<boost::weak_ptr<Region> >&> RegionsAdded;
+       PBD::Signal1<void,boost::weak_ptr<Region> >              RegionRemoved;
 
        int region_name (std::string& result, std::string base = std::string(""), bool newlevel = false);
        std::string new_region_name (std::string);
@@ -529,9 +529,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        int  start_audio_export (nframes_t position, bool realtime);
 
-       boost::signals2::signal<int(nframes_t)> ProcessExport;
-       boost::signals2::signal<void()> ExportReadFinished;
-       static boost::signals2::signal<void(std::string, std::string)> Exported;
+       PBD::Signal1<int,nframes_t> ProcessExport;
+       PBD::Signal0<void> ExportReadFinished;
+       static PBD::Signal2<void,std::string, std::string> Exported;
 
        void add_source (boost::shared_ptr<Source>);
        void remove_source (boost::weak_ptr<Source>);
@@ -548,16 +548,16 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
            0 for "yes, delete this playlist",
            1 for "no, don't delete this playlist".
        */
-       boost::signals2::signal<void(boost::shared_ptr<Playlist>)>  AskAboutPlaylistDeletion;
+       PBD::Signal1<void,boost::shared_ptr<Playlist> >  AskAboutPlaylistDeletion;
 
        /** handlers should return 0 for "ignore the rate mismatch",
            !0 for "do not use this session"
        */
-       static boost::signals2::signal<int(nframes_t, nframes_t)> AskAboutSampleRateMismatch;
+       static PBD::Signal2<int,nframes_t, nframes_t> AskAboutSampleRateMismatch;
 
        /** handlers should return !0 for use pending state, 0 for ignore it.
        */
-       static boost::signals2::signal<int()> AskAboutPendingState;
+       static PBD::Signal0<int> AskAboutPendingState;
 
        boost::shared_ptr<AudioFileSource> create_audio_source_for_session (ARDOUR::AudioDiskstream&, uint32_t which_channel, bool destructive);
 
@@ -575,8 +575,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void remove_named_selection (NamedSelection *);
 
        template<class T> void foreach_named_selection (T& obj, void (T::*func)(NamedSelection&));
-       boost::signals2::signal<void()> NamedSelectionAdded;
-       boost::signals2::signal<void()> NamedSelectionRemoved;
+       PBD::Signal0<void> NamedSelectionAdded;
+       PBD::Signal0<void> NamedSelectionRemoved;
 
        /* Curves and AutomationLists (TODO when they go away) */
        void add_automation_list(AutomationList*);
@@ -595,7 +595,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void cancel_audition ();
        bool is_auditioning () const;
 
-       boost::signals2::signal<void(bool)> AuditionActive;
+       PBD::Signal1<void,bool> AuditionActive;
 
        /* flattening stuff */
 
@@ -617,8 +617,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void set_listen (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false);
        void set_record_enable (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false);
 
-       boost::signals2::signal<void(bool)> SoloActive;
-       boost::signals2::signal<void()> SoloChanged;
+       PBD::Signal1<void,bool> SoloActive;
+       PBD::Signal0<void> SoloChanged;
        
 
        /* control/master out */
@@ -656,8 +656,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void remove_bundle (boost::shared_ptr<Bundle>);
        boost::shared_ptr<Bundle> bundle_by_name (std::string) const;
 
-       boost::signals2::signal<void(boost::shared_ptr<Bundle>)> BundleAdded;
-       boost::signals2::signal<void(boost::shared_ptr<Bundle>)> BundleRemoved;
+       PBD::Signal1<void,boost::shared_ptr<Bundle> > BundleAdded;
+       PBD::Signal1<void,boost::shared_ptr<Bundle> > BundleRemoved;
 
        /* MIDI control */
 
@@ -671,10 +671,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        MIDI::Port *midi_port() const { return _midi_port; }
        MIDI::Port *midi_clock_port() const { return _midi_clock_port; }
 
-       boost::signals2::signal<void()> MTC_PortChanged;
-       boost::signals2::signal<void()> MMC_PortChanged;
-       boost::signals2::signal<void()> MIDI_PortChanged;
-       boost::signals2::signal<void()> MIDIClock_PortChanged;
+       PBD::Signal0<void> MTC_PortChanged;
+       PBD::Signal0<void> MMC_PortChanged;
+       PBD::Signal0<void> MIDI_PortChanged;
+       PBD::Signal0<void> MIDIClock_PortChanged;
 
        void set_trace_midi_input (bool, MIDI::Port* port = 0);
        void set_trace_midi_output (bool, MIDI::Port* port = 0);
@@ -691,7 +691,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void stop_scrub ();
        void set_scrub_speed (float);
        nframes_t scrub_buffer_size() const;
-       boost::signals2::signal<void()> ScrubReady;
+       PBD::Signal0<void> ScrubReady;
 
        /* History (for editors, mixers, UIs etc.) */
 
@@ -765,7 +765,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
                        void* ptr,
                        float opt);
 
-       static boost::signals2::signal<void()> SendFeedback;
+       static PBD::Signal0<void> SendFeedback;
 
        /* Controllables */
 
@@ -943,7 +943,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        int  stop_audio_export ();
        void finalize_audio_export ();
 
-       boost::signals2::scoped_connection export_freewheel_connection;
+       PBD::ScopedConnection export_freewheel_connection;
 
        void prepare_diskstreams ();
        void commit_diskstreams (nframes_t, bool& session_requires_butler);
index c747ee9976abfc75296b0e585cf92e2392ed84d8..87c6fb6670dacb7bd3edd78b9ea1ec66267fa905 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef __libardour_session_handle_h__
 #define __libardour_session_handle_h__
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 namespace ARDOUR {
        class Session;
index eb1a7c3e3093efbe4ad1cb55bb0a179e1a46b576..47caab54758ca438594bb8fe352baf162de51177 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <string>
 #include "pbd/statefuldestructible.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/session_handle.h"
 
@@ -53,7 +53,7 @@ class SessionObject : public SessionHandleRef, public PBD::StatefulDestructible
                return true;
        }
 
-       boost::signals2::signal<void()> NameChanged;
+       PBD::Signal0<void> NameChanged;
 
   protected:
        std::string _name;
index 8870794cc0ba0155513cd43da28c8c0bdb463e70..db29ee8c05fa281533a2007cd53f7efb354cb70e 100644 (file)
@@ -27,7 +27,7 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/function.hpp>
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 class XMLNode;
 
index 4fe8e1ec46865a8d83870d50c4164e6410758199..1cc73474d78a6393169894d75856fbdfea981a76 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <jack/jack.h>
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/types.h"
 #include "midi++/parser.h"
@@ -242,7 +242,7 @@ class MTC_Slave : public Slave {
   private:
        Session&    session;
        MIDI::Port* port;
-       PBD::ScopedConnectionList* port_connections;
+       PBD::ScopedConnectionList port_connections;
        bool        can_notify_on_unknown_rate;
        PIChaser* pic;
 
@@ -303,7 +303,7 @@ class MIDIClock_Slave : public Slave {
   private:
        ISlaveSessionProxy* session;
        MIDI::Port* port;
-       PBD::ScopedConnectionList* port_connections;
+       PBD::ScopedConnectionList port_connections;
 
        /// pulses per quarter note for one MIDI clock frame (default 24)
        int         ppqn;
index 45d535e9166f3a09fca861fb8dbca53a55c5f8c3..95829769f634fcf56340e7346dfdc607b440e6f8 100644 (file)
@@ -98,6 +98,7 @@ class SndFileSource : public AudioFileSource {
        nframes_t destructive_write_unlocked (Sample *dst, nframes_t cnt);
        nframes_t nondestructive_write_unlocked (Sample *dst, nframes_t cnt);
        void handle_header_position_change ();
+       PBD::ScopedConnection header_position_connection;
 };
 
 } // namespace ARDOUR
index a7a6e2207cc227aa562ace2575bdcf4896a9c22b..b91d8f129c8c0eaa48a85f6d4ff47104ff83d31b 100644 (file)
@@ -35,7 +35,7 @@ namespace ARDOUR {
 
 class Session;
 
-class Source : public SessionObject, public boost::noncopyable
+class Source : public SessionObject
 {
   public:
        enum Flag {
@@ -81,15 +81,15 @@ class Source : public SessionObject, public boost::noncopyable
        virtual bool set_destructive (bool /*yn*/) { return false; }
        virtual bool length_mutable() const    { return false; }
 
-       static boost::signals2::signal<void(Source*)>             SourceCreated;
-       boost::signals2::signal<void(boost::shared_ptr<Source>)> Switched;
+       static PBD::Signal1<void,Source*>             SourceCreated;
+       PBD::Signal1<void,boost::shared_ptr<Source> > Switched;
 
        bool has_been_analysed() const;
        virtual bool can_be_analysed() const { return false; }
        virtual void set_been_analysed (bool yn);
        virtual bool check_for_analysis_data_on_disk();
 
-       boost::signals2::signal<void()> AnalysisChanged;
+       PBD::Signal0<void> AnalysisChanged;
 
        AnalysisFeatureList transients;
        std::string get_transients_path() const;
index 4da285e980e75f2137c569d2d1ad5baa72fde306..c32b96ae975636d3d740950fd879e0d2fcd592f6 100644 (file)
@@ -37,7 +37,7 @@ class SourceFactory {
   public:
        static void init ();
 
-       static boost::signals2::signal<void(boost::shared_ptr<Source>)> SourceCreated;
+       static PBD::Signal1<void,boost::shared_ptr<Source> > SourceCreated;
 
        static boost::shared_ptr<Source> create (Session&, const XMLNode& node, bool async = false);
        static boost::shared_ptr<Source> createSilent (Session&, const XMLNode& node,
index ba7bbbcf7e60c17ec5ed3ec3fe3aafda33ef3ed9..9fe6f1fee5c116c8a9f5def71f0ab9a6a58d73c0 100644 (file)
@@ -258,7 +258,7 @@ class TempoMap : public PBD::StatefulDestructible
 
        nframes_t frame_rate () const { return _frame_rate; }
 
-       boost::signals2::signal<void(ARDOUR::Change)> StateChanged;
+       PBD::Signal1<void,ARDOUR::Change> StateChanged;
 
   private:
        static Tempo    _default_tempo;
index 9a26d4d3ff2eb0afa3baca9e2eff7c034f80662e..e133ad5d237fe6a19a0b6427fa3e1fbcafef7a56 100644 (file)
@@ -20,7 +20,7 @@
 
 
 #include "midi++/jack.h"
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "ardour/types.h"
 #include "ardour/session_handle.h"
index 82b4f701b454d4b3ee0c7c09392d46e90b8ba8e6..0ed4b8c70bd51d20346095699e996312637ca322 100644 (file)
@@ -43,7 +43,7 @@ class Track : public Route
        TrackMode mode () const { return _mode; }
        virtual int set_mode (TrackMode /*m*/) { return false; }
        virtual bool can_use_mode (TrackMode /*m*/, bool& /*bounce_required*/) { return false; }
-       boost::signals2::signal<void()> TrackModeChanged;
+       PBD::Signal0<void> TrackModeChanged;
 
        virtual int no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
                        bool state_changing, bool can_record, bool rec_monitors_input);
@@ -90,8 +90,8 @@ class Track : public Route
        bool record_enabled() const;
        void set_record_enable (bool yn, void *src);
 
-       boost::signals2::signal<void()> DiskstreamChanged;
-       boost::signals2::signal<void()> FreezeChange;
+       PBD::Signal0<void> DiskstreamChanged;
+       PBD::Signal0<void> FreezeChange;
 
   protected:
        Track (Session& sess, const XMLNode& node, DataType default_type = DataType::AUDIO);
index 2ad323ca1c391af4f0f03a5dde2409c6a5d16c37..f60d16391f3e6ced7fbf02f86f1c39d014c9a012 100644 (file)
@@ -1504,7 +1504,7 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca
                                continue; /* XXX is this OK? */
                        }
 
-                       scoped_connect (region->GoingAway, boost::bind (&Diskstream::remove_region_from_last_capture, this, boost::weak_ptr<Region>(region)));
+                       region->GoingAway.connect (*this, boost::bind (&Diskstream::remove_region_from_last_capture, this, boost::weak_ptr<Region>(region)));
 
                        _last_capture_regions.push_back (region);
 
index acb44e43c477b9841c4799a0db54c916d6c26c5a..85c3ffe1b2909511e411aebf656a5d2b2663e588 100644 (file)
@@ -528,8 +528,8 @@ AudioPlaylist::add_crossfade (boost::shared_ptr<Crossfade> xfade)
        } else {
                _crossfades.push_back (xfade);
 
-               scoped_connect (xfade->Invalidated, boost::bind (&AudioPlaylist::crossfade_invalidated, this, _1));
-               scoped_connect (xfade->StateChanged, boost::bind (&AudioPlaylist::crossfade_changed, this, _1));
+               xfade->Invalidated.connect (*this, boost::bind (&AudioPlaylist::crossfade_invalidated, this, _1));
+               xfade->StateChanged.connect (*this, boost::bind (&AudioPlaylist::crossfade_changed, this, _1));
 
                notify_crossfade_added (xfade);
        }
@@ -584,8 +584,8 @@ AudioPlaylist::set_state (const XMLNode& node, int version)
                try {
                        boost::shared_ptr<Crossfade> xfade = boost::shared_ptr<Crossfade> (new Crossfade (*((const Playlist *)this), *child));
                        _crossfades.push_back (xfade);
-                       scoped_connect (xfade->Invalidated, boost::bind (&AudioPlaylist::crossfade_invalidated, this, _1));
-                       scoped_connect (xfade->StateChanged, boost::bind (&AudioPlaylist::crossfade_changed, this, _1));
+                       xfade->Invalidated.connect (*this, boost::bind (&AudioPlaylist::crossfade_invalidated, this, _1));
+                       xfade->StateChanged.connect (*this, boost::bind (&AudioPlaylist::crossfade_changed, this, _1));
                        NewCrossfade(xfade);
                }
 
index 736fe417386a57b0a88a7b0f9211f52fda08e6cd..19b5bd7be594a8543e43b74508ef1085b649d8ee 100644 (file)
@@ -182,7 +182,7 @@ AudioTrack::set_diskstream (boost::shared_ptr<AudioDiskstream> ds, void * /*src*
        if (audio_diskstream()->deprecated_io_node) {
 
                if (!IO::connecting_legal) {
-                       scoped_connect (IO::ConnectingLegal, boost::bind (&AudioTrack::deprecated_use_diskstream_connections, this));
+                       IO::ConnectingLegal.connect (*this, boost::bind (&AudioTrack::deprecated_use_diskstream_connections, this));
                } else {
                        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);
 
        if (_session.state_of_the_state() & Session::Loading) {
-               scoped_connect (_session.StateReady, boost::bind (&AudioTrack::set_state_part_two, this));
+               _session.StateReady.connect (*this, boost::bind (&AudioTrack::set_state_part_two, this));
        } else {
                set_state_part_two ();
        }
index b1c55275702e86ac02b9136af0332cd87e124c38..5b6a7da73a3d200c531cd0e2a1d04c4af5a30615 100644 (file)
@@ -550,7 +550,7 @@ AudioEngine::meter_thread ()
                if (g_atomic_int_get(&m_meter_exit)) {
                        break;
                }
-               Metering::update_meters ();
+               Metering::Meter ();
        }
 }
 
@@ -735,9 +735,9 @@ AudioEngine::connect (const string& source, const string& destination)
        Port* dst = get_port_by_name_locked (d);
 
        if (src) {
-                       ret = src->connect (d);
+               ret = src->connect (d);
        } else if (dst) {
-                       ret = dst->connect (s);
+               ret = dst->connect (s);
        } else {
                /* neither port is known to us, and this API isn't intended for use as a general patch bay */
                ret = -1;
index 1500b139acdff2edf26c3b34e5428b2fa040d1e2..297c02e418dba264c2795be1a9abe808810302e8 100644 (file)
@@ -70,7 +70,7 @@ using namespace Glib;
 
 ustring AudioFileSource::peak_dir = "";
 
-boost::signals2::signal<void()> AudioFileSource::HeaderPositionOffsetChanged;
+PBD::Signal0<void> AudioFileSource::HeaderPositionOffsetChanged;
 uint64_t           AudioFileSource::header_position_offset = 0;
 
 /* XXX maybe this too */
index ac173db546c5bfb0e7f38178653101045fbc20d3..cce7869072ead4be929361e35408c390f751bbc5 100644 (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);
        if (afs) {
-               scoped_connect (afs->HeaderPositionOffsetChanged, boost::bind (&AudioRegion::source_offset_changed, this));
+               afs->HeaderPositionOffsetChanged.connect (*this, boost::bind (&AudioRegion::source_offset_changed, this));
        }
 
        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);
        if (afs) {
-               scoped_connect (afs->HeaderPositionOffsetChanged, boost::bind (&AudioRegion::source_offset_changed, this));
+               afs->HeaderPositionOffsetChanged.connect (*this, boost::bind (&AudioRegion::source_offset_changed, this));
        }
 
        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));
                if (afs) {
-                       scoped_connect (afs->HeaderPositionOffsetChanged, boost::bind (&AudioRegion::source_offset_changed, this));
+                       afs->HeaderPositionOffsetChanged.connect (*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);
        if (afs) {
-               scoped_connect (afs->HeaderPositionOffsetChanged, boost::bind (&AudioRegion::source_offset_changed, this));
+               afs->HeaderPositionOffsetChanged.connect (*this, boost::bind (&AudioRegion::source_offset_changed, this));
        }
 
        init ();
@@ -270,7 +270,7 @@ void
 AudioRegion::connect_to_analysis_changed ()
 {
        for (SourceList::const_iterator i = _sources.begin(); i != _sources.end(); ++i) {
-               scoped_connect ((*i)->AnalysisChanged, boost::bind (&AudioRegion::invalidate_transients, this));
+               (*i)->AnalysisChanged.connect (*this, boost::bind (&AudioRegion::invalidate_transients, this));
        }
 }
 
@@ -285,7 +285,7 @@ AudioRegion::connect_to_header_position_offset_changed ()
                        unique_srcs.insert (*i);
                        boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> (*i);
                        if (afs) {
-                               scoped_connect (afs->HeaderPositionOffsetChanged, boost::bind (&AudioRegion::source_offset_changed, this));
+                               afs->HeaderPositionOffsetChanged.connect (*this, boost::bind (&AudioRegion::source_offset_changed, this));
                        }
                }
        }
@@ -294,9 +294,9 @@ AudioRegion::connect_to_header_position_offset_changed ()
 void
 AudioRegion::listen_to_my_curves ()
 {
-       scoped_connect (_envelope->StateChanged, boost::bind (&AudioRegion::envelope_changed, this));
-       scoped_connect (_fade_in->StateChanged, boost::bind (&AudioRegion::fade_in_changed, this));
-       scoped_connect (_fade_out->StateChanged, boost::bind (&AudioRegion::fade_out_changed, this));
+       _envelope->StateChanged.connect (*this, boost::bind (&AudioRegion::envelope_changed, this));
+       _fade_in->StateChanged.connect (*this, boost::bind (&AudioRegion::fade_in_changed, this));
+       _fade_out->StateChanged.connect (*this, boost::bind (&AudioRegion::fade_out_changed, this));
 }
 
 void
index fd481c973009f2cfb0912e42e2e32c3a596c00b8..5fcabb0c774127b45607cbca6c852841cf9777a9 100644 (file)
@@ -149,7 +149,7 @@ AudioSource::update_length (sframes_t pos, sframes_t cnt)
  ***********************************************************************/
 
 bool
-AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, boost::signals2::connection& connect_here_if_not) const
+AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, Connection& connect_here_if_not) const
 {
        bool ret;
        Glib::Mutex::Lock lm (_peaks_ready_lock);
@@ -159,7 +159,7 @@ AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, boost::signal
        */
 
        if (!(ret = _peaks_built)) {
-               connect_here_if_not = PeaksReady.connect (doThisWhenReady);
+               PeaksReady.connect (connect_here_if_not, doThisWhenReady);
        }
 
        return ret;
index 7d353a1bddd88b302595c8f0dee6eaa6ba333490..1e28ebc8b4c88bf2e51ac587cc0e5b7d9ac23d60 100644 (file)
@@ -72,7 +72,7 @@ Auditioner::Auditioner (Session& s)
        _main_outs->allow_pan_reset ();
        _main_outs->reset_panner ();
 
-       scoped_connect (_output->changed, boost::bind (&Auditioner::output_changed, this, _1, _2));
+       _output->changed.connect (*this, boost::bind (&Auditioner::output_changed, this, _1, _2));
 
        the_region.reset ((AudioRegion*) 0);
        g_atomic_int_set (&_active, 0);
index 9a6eb08e453981ff69dc09bfd87e16b61de83ad0..3543f8b51f142565c570bd79ed3750de768d81c5 100644 (file)
@@ -35,7 +35,7 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
-boost::signals2::signal<void(AutomationList *)> AutomationList::AutomationListCreated;
+PBD::Signal1<void,AutomationList *> AutomationList::AutomationListCreated;
 
 #if 0
 static void dumpit (const AutomationList& al, string prefix = "")
index 7f159a441c62b0537d43279d986d7dc699bb0791..1438f937226ef923e852892c34a79fd0dc7f37b7 100644 (file)
@@ -42,8 +42,8 @@ using namespace std;
 using namespace PBD;
 using namespace ARDOUR;
 
-boost::signals2::signal<void(nframes_t)> Delivery::CycleStart;
-boost::signals2::signal<int()>           Delivery::PannersLegal;
+PBD::Signal1<void,nframes_t> Delivery::CycleStart;
+PBD::Signal0<int>           Delivery::PannersLegal;
 bool                                     Delivery::panners_legal = false;
 
 /* deliver to an existing IO object */
@@ -64,10 +64,10 @@ Delivery::Delivery (Session& s, boost::shared_ptr<IO> io, boost::shared_ptr<Mute
        _display_to_user = false;
 
        if (_output) {
-               scoped_connect (_output->changed, boost::bind (&Delivery::output_changed, this, _1, _2));
+               _output->changed.connect (*this, boost::bind (&Delivery::output_changed, this, _1, _2));
        }
 
-       scoped_connect (CycleStart, boost::bind (&Delivery::cycle_start, this, _1));
+       CycleStart.connect (*this, boost::bind (&Delivery::cycle_start, this, _1));
 }
 
 /* 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;
 
        if (_output) {
-               scoped_connect (_output->changed, boost::bind (&Delivery::output_changed, this, _1, _2));
+               _output->changed.connect (*this, boost::bind (&Delivery::output_changed, this, _1, _2));
        }
 
-       scoped_connect (CycleStart, boost::bind (&Delivery::cycle_start, this, _1));
+       CycleStart.connect (*this, boost::bind (&Delivery::cycle_start, this, _1));
 }
 
 /* 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) {
-               scoped_connect (_output->changed, boost::bind (&Delivery::output_changed, this, _1, _2));
+               _output->changed.connect (*this, boost::bind (&Delivery::output_changed, this, _1, _2));
        }
 
-       scoped_connect (CycleStart, boost::bind (&Delivery::cycle_start, this, _1));
+       CycleStart.connect (*this, boost::bind (&Delivery::cycle_start, this, _1));
 }
 
 /* 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) {
-               scoped_connect (_output->changed, boost::bind (&Delivery::output_changed, this, _1, _2));
+               _output->changed.connect (*this, boost::bind (&Delivery::output_changed, this, _1, _2));
        }
 
-       scoped_connect (CycleStart, boost::bind (&Delivery::cycle_start, this, _1));
+       CycleStart.connect (*this, boost::bind (&Delivery::cycle_start, this, _1));
 }
 
 std::string
@@ -419,7 +419,7 @@ Delivery::reset_panner ()
                }
        } else {
                panner_legal_c.disconnect ();
-               panner_legal_c = PannersLegal.connect (boost::bind (&Delivery::panners_became_legal, this));
+               PannersLegal.connect (panner_legal_c, boost::bind (&Delivery::panners_became_legal, this));
        }
 }
 
index f9e8202ebc5e8701fb504d25f25b8572cf8d5205..8af85a553c05ceb85a5c26b14e01b6c07834c311 100644 (file)
@@ -68,8 +68,8 @@ using namespace PBD;
  */
 ARDOUR::nframes_t Diskstream::disk_io_chunk_frames = 1024 * 256;
 
-boost::signals2::signal<void()>                Diskstream::DiskOverrun;
-boost::signals2::signal<void()>                Diskstream::DiskUnderrun;
+PBD::Signal0<void>                Diskstream::DiskOverrun;
+PBD::Signal0<void>                Diskstream::DiskUnderrun;
 
 Diskstream::Diskstream (Session &sess, const string &name, Flag flag)
        : SessionObject(sess, name)
@@ -142,13 +142,13 @@ Diskstream::set_route (Route& r)
        _io = _route->input();
 
        ic_connection.disconnect();
-       ic_connection = _io->changed.connect (boost::bind (&Diskstream::handle_input_change, this, _1, _2));
+       _io->changed.connect (ic_connection, boost::bind (&Diskstream::handle_input_change, this, _1, _2));
 
        input_change_pending = ConfigurationChanged;
        non_realtime_input_change ();
        set_align_style_from_io ();
 
-       scoped_connect (_route->GoingAway, boost::bind (&Diskstream::route_going_away, this));
+       _route->GoingAway.connect (*this, boost::bind (&Diskstream::route_going_away, this));
 }
 
 void
@@ -339,9 +339,9 @@ Diskstream::use_playlist (boost::shared_ptr<Playlist> playlist)
                        reset_write_sources (false);
                }
 
-               playlist_connections.add_connection (_playlist->Modified.connect (boost::bind (&Diskstream::playlist_modified, this)));
-               playlist_connections.add_connection (_playlist->GoingAway.connect (boost::bind (&Diskstream::playlist_deleted, this, boost::weak_ptr<Playlist>(_playlist))));
-               playlist_connections.add_connection (_playlist->RangesMoved.connect (boost::bind (&Diskstream::playlist_ranges_moved, this, _1)));
+               _playlist->Modified.connect (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->RangesMoved.connect (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
index 3e7c2c9a91db9639ece995444afcac6625e0e21e..9f217c2cd99b644b15241fafb1516443335ea17a 100644 (file)
@@ -32,8 +32,8 @@ using namespace std;
 using namespace PBD;
 using namespace ARDOUR;
 
-boost::signals2::signal <std::pair<bool, string> (string, string)> ElementImporter::Rename;
-boost::signals2::signal <bool (string)> ElementImporter::Prompt;
+Signal2<std::pair<bool, string>,string, string> ElementImporter::Rename;
+Signal1 <bool,string> ElementImporter::Prompt;
 
 ElementImporter::ElementImporter (XMLTree const & source, ARDOUR::Session & session) :
   source (source),
index 3006fbc3ee68bb85cec40311a3f07bc33a1288dc..dfe038734b60bbe77ebc9505b2092e39c3aa9ddf 100644 (file)
@@ -108,7 +108,7 @@ RegionExportChannelFactory::RegionExportChannelFactory (Session * session, Audio
                throw ExportFailed ("Unhandled type in ExportChannelFactory constructor");
        }
 
-       export_connection = session->ProcessExport.connect (boost::bind (&RegionExportChannelFactory::new_cycle_started, this, _1));
+       session->ProcessExport.connect (export_connection, boost::bind (&RegionExportChannelFactory::new_cycle_started, this, _1));
 
        buffers.set_count (ChanCount (DataType::AUDIO, n_channels));
        buffers.ensure_buffers (DataType::AUDIO, n_channels, frames_per_cycle);
index f26f0635d8cae6f4a8773aca52023e2e8b0284e8..d25877c5bcea7e91966d0e244be90755546c7a77 100644 (file)
@@ -211,13 +211,13 @@ void
 ExportFormatManager::add_compatibility (CompatPtr ptr)
 {
        compatibilities.push_back (ptr);
-       scoped_connect (ptr->SelectChanged, boost::bind (&ExportFormatManager::change_compatibility_selection, this, _1, WeakCompatPtr (ptr)));
+       ptr->SelectChanged.connect (*this, boost::bind (&ExportFormatManager::change_compatibility_selection, this, _1, WeakCompatPtr (ptr)));
 }
 
 void
 ExportFormatManager::add_quality (QualityPtr ptr)
 {
-       scoped_connect (ptr->SelectChanged, boost::bind (&ExportFormatManager::change_quality_selection, this, _1, WeakQualityPtr (ptr)));
+       ptr->SelectChanged.connect (*this, boost::bind (&ExportFormatManager::change_quality_selection, this, _1, WeakQualityPtr (ptr)));
        qualities.push_back (ptr);
 }
 
@@ -225,7 +225,7 @@ void
 ExportFormatManager::add_format (FormatPtr ptr)
 {
        formats.push_back (ptr);
-       scoped_connect (ptr->SelectChanged, boost::bind (&ExportFormatManager::change_format_selection, this, _1, WeakFormatPtr (ptr)));
+       ptr->SelectChanged.connect (*this, boost::bind (&ExportFormatManager::change_format_selection, this, _1, WeakFormatPtr (ptr)));
        universal_set = universal_set->get_union (*ptr);
 
        /* Encoding options */
@@ -233,15 +233,15 @@ ExportFormatManager::add_format (FormatPtr ptr)
        boost::shared_ptr<HasSampleFormat> hsf;
 
        if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (ptr)) {
-               scoped_connect (hsf->SampleFormatSelectChanged, boost::bind (&ExportFormatManager::change_sample_format_selection, this, _1, _2));
-               scoped_connect (hsf->DitherTypeSelectChanged, boost::bind (&ExportFormatManager::change_dither_type_selection, this, _1, _2));
+               hsf->SampleFormatSelectChanged.connect (*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));
        }
 }
 
 void
 ExportFormatManager::add_sample_rate (SampleRatePtr ptr)
 {
-       scoped_connect (ptr->SelectChanged, boost::bind (&ExportFormatManager::change_sample_rate_selection, this, _1, WeakSampleRatePtr (ptr)));
+       ptr->SelectChanged.connect (*this, boost::bind (&ExportFormatManager::change_sample_rate_selection, this, _1, WeakSampleRatePtr (ptr)));
        sample_rates.push_back (ptr);
 }
 
index b7637f3c07f5f9432788eb238225d3076d20dcab..a7dd544d47391f4e63dede355a3ec7f9b37e6114 100644 (file)
@@ -59,10 +59,10 @@ HasSampleFormat::add_sample_format (ExportFormatBase::SampleFormat format)
 
        SampleFormatPtr ptr (new SampleFormatState (format, get_sample_format_name (format)));
        sample_format_states.push_back (ptr);
-       scoped_connect (ptr->SelectChanged, boost::bind (&HasSampleFormat::update_sample_format_selection, this, _1));
+       ptr->SelectChanged.connect (*this, boost::bind (&HasSampleFormat::update_sample_format_selection, this, _1));
        // BOOST SIGNALS how to connect one signal to another
-       // scoped_connect (ptr->SelectChanged, boost::bind (SampleFormatSelectChanged, _1, WeakSampleFormatPtr (ptr));
-       // scoped_connect (ptr->CompatibleChanged, boost::bind (SampleFormatCompatibleChanged, _1, WeakSampleFormatPtr (ptr));
+       // ptr->SelectChanged.connect (*this, boost::bind (SampleFormatSelectChanged, _1, WeakSampleFormatPtr (ptr));
+       // ptr->CompatibleChanged.connect (*this, boost::bind (SampleFormatCompatibleChanged, _1, WeakSampleFormatPtr (ptr));
 }
 
 void
@@ -70,10 +70,10 @@ HasSampleFormat::add_dither_type (ExportFormatBase::DitherType type, Glib::ustri
 {
        DitherTypePtr ptr (new DitherTypeState (type, name));
        dither_type_states.push_back (ptr);
-       scoped_connect (ptr->SelectChanged, boost::bind (&HasSampleFormat::update_dither_type_selection, this, _1));
+       ptr->SelectChanged.connect (*this, boost::bind (&HasSampleFormat::update_dither_type_selection, this, _1));
        // BOOST SIGNALS how to connect one signal to another
-       // scoped_connect (ptr->SelectChanged, boost::bind (DitherTypeSelectChanged, _1, WeakDitherTypePtr (ptr));
-       // scoped_connect (ptr->CompatibleChanged, boost::bind (DitherTypeCompatibleChanged, _1, WeakDitherTypePtr (ptr));
+       // ptr->SelectChanged.connect (*this, boost::bind (DitherTypeSelectChanged, _1, WeakDitherTypePtr (ptr));
+       // ptr->CompatibleChanged.connect (*this, boost::bind (DitherTypeCompatibleChanged, _1, WeakDitherTypePtr (ptr));
 }
 
 HasSampleFormat::SampleFormatPtr
index 7bf231acd2f76ef9604148d8c42542d47f954d50..a85e41d40a64482380dac699aba1e427267bb83f 100644 (file)
@@ -106,7 +106,7 @@ ExportHandler::ExportHandler (Session & session)
 {
        processor.reset (new ExportProcessor (session));
 
-       files_written_connection = ExportProcessor::WritingFile.connect (boost::bind (&ExportHandler::add_file, this, _1));
+       ExportProcessor::WritingFile.connect (files_written_connection, boost::bind (&ExportHandler::add_file, this, _1));
 }
 
 ExportHandler::~ExportHandler ()
@@ -168,7 +168,7 @@ ExportHandler::do_export (bool rt)
 
        realtime = rt;
 
-       export_read_finished_connection = session.ExportReadFinished.connect (boost::bind (&ExportHandler::finish_timespan, this));
+       session.ExportReadFinished.connect (export_read_finished_connection, boost::bind (&ExportHandler::finish_timespan, this));
        start_timespan ();
 }
 
@@ -505,7 +505,7 @@ ExportHandler::start_timespan ()
 
        /* connect stuff and start export */
 
-       current_timespan->process_connection = session.ProcessExport.connect (boost::bind (&ExportTimespan::process, current_timespan, _1));
+       session.ProcessExport.connect (current_timespan->process_connection, boost::bind (&ExportTimespan::process, current_timespan, _1));
        session.start_audio_export (current_timespan->get_start(), realtime);
 }
 
@@ -566,7 +566,7 @@ ExportHandler::timespan_thread_finished ()
                        cc = current_map_it->second.channel_config;
                }
 
-               channel_config_connection = cc->FilesWritten.connect (boost::bind (&ExportHandler::timespan_thread_finished, this));
+               cc->FilesWritten.connect (channel_config_connection, boost::bind (&ExportHandler::timespan_thread_finished, this));
                ++current_map_it;
 
        } else { /* All files are written from current timespan, reset timespan and start new */
index 7d04e8f8d6cf33dc60e06cab4c061f394c63876d..c7fcbd55aa3beb3e7d3645d7af6fc0b3c50aa58a 100644 (file)
@@ -38,7 +38,7 @@ using namespace PBD;
 namespace ARDOUR
 {
 
-boost::signals2::signal<void (const Glib::ustring&)> ExportProcessor::WritingFile;
+PBD::Signal1<void,const Glib::ustring&> ExportProcessor::WritingFile;
 
 ExportProcessor::ExportProcessor (Session & session) :
   session (session),
index e3e37a710753b4533e282031ef3393380467a0b1..b2f71ca6e6865a48fca6829c43b7da82d8c19cd4 100644 (file)
@@ -109,7 +109,7 @@ apply_gain_to_buffer_t  ARDOUR::apply_gain_to_buffer = 0;
 mix_buffers_with_gain_t ARDOUR::mix_buffers_with_gain = 0;
 mix_buffers_no_gain_t   ARDOUR::mix_buffers_no_gain = 0;
 
-boost::signals2::signal<void(std::string)> ARDOUR::BootMessage;
+PBD::Signal1<void,std::string> ARDOUR::BootMessage;
 
 void ARDOUR::setup_enum_writer ();
 
index ccee62c9887daa4eefdd50c30e2b4daeba064225..f42d3c4e805c33a0fe056324624e870f8367c350 100644 (file)
 using namespace std;
 using namespace ARDOUR;
 
-boost::signals2::signal<void(nframes_t)> InternalReturn::CycleStart;
+PBD::Signal1<void,nframes_t> InternalReturn::CycleStart;
 
 InternalReturn::InternalReturn (Session& s)
        : Return (s, true)
        , user_count (0)
 {
-       scoped_connect (CycleStart, boost::bind (&InternalReturn::cycle_start, this, _1));
+       CycleStart.connect (*this, boost::bind (&InternalReturn::cycle_start, this, _1));
 }
 
 InternalReturn::InternalReturn (Session& s, const XMLNode& node)
        : Return (s, node, true)
        , user_count (0)
 {
-       scoped_connect (CycleStart, boost::bind (&InternalReturn::cycle_start, this, _1));
+       CycleStart.connect (*this, boost::bind (&InternalReturn::cycle_start, this, _1));
 }
 
 void
index d6489f8f496a9320f85c1cc9357bd529b2b4d386..7fc2efe9b9d315c7aef54062343ef8c58afc79a1 100644 (file)
@@ -43,8 +43,8 @@ InternalSend::InternalSend (Session& s, boost::shared_ptr<MuteMaster> mm, boost:
 
        set_name (sendto->name());
 
-       scoped_connect (_send_to->GoingAway, boost::bind (&InternalSend::send_to_going_away, this));
-       scoped_connect (_send_to->NameChanged, boost::bind (&InternalSend::send_to_name_changed, this));
+       _send_to->GoingAway.connect (*this, boost::bind (&InternalSend::send_to_going_away, this));
+       _send_to->NameChanged.connect (*this, boost::bind (&InternalSend::send_to_name_changed, this));
 }
 
 InternalSend::InternalSend (Session& s, boost::shared_ptr<MuteMaster> mm, const XMLNode& node)
@@ -187,7 +187,7 @@ InternalSend::set_our_state (const XMLNode& node, int version)
                */
 
                if (!IO::connecting_legal) {
-                       connect_c = IO::ConnectingLegal.connect (boost::bind (&InternalSend::connect_when_legal, this));
+                       IO::ConnectingLegal.connect (connect_c, boost::bind (&InternalSend::connect_when_legal, this));
                } else {
                        connect_when_legal ();
                }
index b9fd9ccbc66ed4bbfcbcad79e98a729f64972709..f47e147a18b4ea991a28f6163c525864d01cf358 100644 (file)
@@ -67,8 +67,8 @@ using namespace PBD;
 
 const string                 IO::state_node_name = "IO";
 bool                         IO::connecting_legal = false;
-boost::signals2::signal<int()>            IO::ConnectingLegal;
-boost::signals2::signal<void(ChanCount)> IO::PortCountChanged;
+PBD::Signal0<int>            IO::ConnectingLegal;
+PBD::Signal1<void,ChanCount> IO::PortCountChanged;
 
 /** @param default_type The type of port that will be created by ensure_io
  * and friends if no type is explicitly requested (to avoid breakage).
@@ -566,7 +566,7 @@ IO::set_state (const XMLNode& node, int version)
                pending_state_node = new XMLNode (node);
                pending_state_node_version = version;
                pending_state_node_in = false;
-               connection_legal_c = ConnectingLegal.connect (boost::bind (&IO::connecting_became_legal, this));
+               ConnectingLegal.connect (connection_legal_c, boost::bind (&IO::connecting_became_legal, this));
        }
 
 
@@ -619,7 +619,7 @@ IO::set_state_2X (const XMLNode& node, int version, bool in)
                pending_state_node = new XMLNode (node);
                pending_state_node_version = version;
                pending_state_node_in = in;
-               connection_legal_c = ConnectingLegal.connect (boost::bind (&IO::connecting_became_legal, this));
+               ConnectingLegal.connect (connection_legal_c, boost::bind (&IO::connecting_became_legal, this));
        }
 
        return 0;
@@ -1399,7 +1399,7 @@ IO::bundles_connected ()
 IO::UserBundleInfo::UserBundleInfo (IO* io, boost::shared_ptr<UserBundle> b)
 {
        bundle = b;
-       changed = b->Changed.connect (boost::bind (&IO::bundle_changed, io, _1));
+       b->Changed.connect (changed, boost::bind (&IO::bundle_changed, io, _1));
 }
 
 std::string
index 4ad0f585805092d7750051e58743744d67bdeb03..580fd7804cfa965d19650ccba9efa6ea82bf016c 100644 (file)
@@ -31,39 +31,7 @@ using namespace std;
 
 using namespace ARDOUR;
 
-boost::signals2::signal<void()> Metering::Meter;
-Glib::StaticMutex  Metering::m_meter_signal_lock;
-
-boost::signals2::connection
-Metering::connect (boost::function<void()> f)
-{
-       // SignalProcessor::Meter is emitted from another thread so the
-       // Meter signal must be protected.
-       Glib::Mutex::Lock guard (m_meter_signal_lock);
-       return Meter.connect (f);
-}
-
-void
-Metering::disconnect (boost::signals2::connection& c)
-{
-       Glib::Mutex::Lock guard (m_meter_signal_lock);
-       c.disconnect ();
-}
-
-/**
-    Update the meters.
-
-    The meter signal lock is taken to prevent modification of the
-    Meter signal while updating the meters, taking the meter signal
-    lock prior to taking the io_lock ensures that all IO will remain
-    valid while metering.
-*/
-void
-Metering::update_meters()
-{
-       Glib::Mutex::Lock guard (m_meter_signal_lock);
-       Meter(); /* EMIT SIGNAL */
-}
+PBD::Signal0<void> Metering::Meter;
 
 PeakMeter::PeakMeter (Session& s, const XMLNode& node)
        : Processor (s, node)
index 12d25ac9ae637a46be65540279db60b5ae643766..7303059207b420cbb263b5f722ffd902a31482f8 100644 (file)
@@ -43,8 +43,7 @@ using namespace MIDI;
 using namespace PBD;
 
 MIDIClock_Slave::MIDIClock_Slave (Session& s, MIDI::Port& p, int ppqn)
-       : port_connections (0)
-       , ppqn (ppqn)
+       : ppqn (ppqn)
        , bandwidth (30.0 / 60.0) // 1 BpM = 1 / 60 Hz
 {
        session = (ISlaveSessionProxy *) new SlaveSessionProxy(s);
@@ -54,7 +53,6 @@ MIDIClock_Slave::MIDIClock_Slave (Session& s, MIDI::Port& p, int ppqn)
 
 MIDIClock_Slave::MIDIClock_Slave (ISlaveSessionProxy* session_proxy, int ppqn)
        : session(session_proxy)
-       , port_connections (0)
        , ppqn (ppqn)
        , bandwidth (30.0 / 60.0) // 1 BpM = 1 / 60 Hz
 {
@@ -65,26 +63,24 @@ MIDIClock_Slave::MIDIClock_Slave (ISlaveSessionProxy* session_proxy, int ppqn)
 MIDIClock_Slave::~MIDIClock_Slave()
 {
        delete session;
-       delete port_connections;
 }
 
 void
 MIDIClock_Slave::rebind (MIDI::Port& p)
 {
-       delete port_connections;
-       port_connections = new ScopedConnectionList;
-       
+       port_connections.drop_connections();
+
        port = &p;
 
 #ifdef DEBUG_MIDI_CLOCK
        std::cerr << "MIDIClock_Slave: connecting to port " << port->name() << std::endl;
 #endif
 
-       port_connections->add_connection (port->input()->timing.connect (boost::bind (&MIDIClock_Slave::update_midi_clock, this, _1, _2)));
-       port_connections->add_connection (port->input()->start.connect (boost::bind (&MIDIClock_Slave::start, this, _1, _2)));
-       port_connections->add_connection (port->input()->contineu.connect (boost::bind (&MIDIClock_Slave::contineu, this, _1, _2)));
-       port_connections->add_connection (port->input()->stop.connect (boost::bind (&MIDIClock_Slave::stop, this, _1, _2)));
-       port_connections->add_connection (port->input()->position.connect (boost::bind (&MIDIClock_Slave::position, this, _1, _2, 3)));
+       port->input()->timing.connect (port_connections, boost::bind (&MIDIClock_Slave::update_midi_clock, this, _1, _2));
+       port->input()->start.connect (port_connections, boost::bind (&MIDIClock_Slave::start, this, _1, _2));
+       port->input()->contineu.connect (port_connections, boost::bind (&MIDIClock_Slave::contineu, this, _1, _2));
+       port->input()->stop.connect (port_connections, boost::bind (&MIDIClock_Slave::stop, this, _1, _2));
+       port->input()->position.connect (port_connections, boost::bind (&MIDIClock_Slave::position, this, _1, _2, 3));
 }
 
 void
index 6b181b1a2787c2ef8742430450f81f272755b763..2320bd4be447f4c97b37f402a86bcdaee143d72f 100644 (file)
@@ -1024,7 +1024,7 @@ MidiDiskstream::transport_stopped (struct tm& /*when*/, time_t /*twhen*/, bool a
                                continue; /* XXX is this OK? */
                        }
 
-                       scoped_connect (region->GoingAway, boost::bind (&Diskstream::remove_region_from_last_capture, this, boost::weak_ptr<Region>(region)));
+                       region->GoingAway.connect (*this, boost::bind (&Diskstream::remove_region_from_last_capture, this, boost::weak_ptr<Region>(region)));
 
                        _last_capture_regions.push_back (region);
 
index 3b13d4db8d07fe1042eaf5c6488229d3d3768b18..b477dbb2f9aeaa265955a1196372df242c740a2e 100644 (file)
@@ -52,7 +52,7 @@ MidiRegion::MidiRegion (boost::shared_ptr<MidiSource> src, nframes_t start, nfra
        : Region (src, start, length, PBD::basename_nosuffix(src->name()), DataType::MIDI, 0,  Region::Flag(Region::DefaultFlags|Region::External))
 {
        assert(_name.find("/") == string::npos);
-       scoped_connect (midi_source(0)->Switched, boost::bind (&MidiRegion::switch_source, this, _1));
+       midi_source(0)->Switched.connect (*this, boost::bind (&MidiRegion::switch_source, this, _1));
 }
 
 /* Basic MidiRegion constructor (one channel) */
@@ -60,7 +60,7 @@ MidiRegion::MidiRegion (boost::shared_ptr<MidiSource> src, nframes_t start, nfra
        : Region (src, start, length, name, DataType::MIDI, layer, flags)
 {
        assert(_name.find("/") == string::npos);
-       scoped_connect (midi_source(0)->Switched, boost::bind (&MidiRegion::switch_source, this, _1));
+       midi_source(0)->Switched.connect (*this, boost::bind (&MidiRegion::switch_source, this, _1));
 }
 
 /* Basic MidiRegion constructor (many channels) */
@@ -68,7 +68,7 @@ MidiRegion::MidiRegion (const SourceList& srcs, nframes_t start, nframes_t lengt
        : Region (srcs, start, length, name, DataType::MIDI, layer, flags)
 {
        assert(_name.find("/") == string::npos);
-       scoped_connect (midi_source(0)->Switched, boost::bind (&MidiRegion::switch_source, this, _1));
+       midi_source(0)->Switched.connect (*this, boost::bind (&MidiRegion::switch_source, this, _1));
 }
 
 
@@ -77,14 +77,14 @@ MidiRegion::MidiRegion (boost::shared_ptr<const MidiRegion> other, nframes_t off
        : Region (other, offset, length, name, layer, flags)
 {
        assert(_name.find("/") == string::npos);
-       scoped_connect (midi_source(0)->Switched, boost::bind (&MidiRegion::switch_source, this, _1));
+       midi_source(0)->Switched.connect (*this, boost::bind (&MidiRegion::switch_source, this, _1));
 }
 
 MidiRegion::MidiRegion (boost::shared_ptr<const MidiRegion> other)
        : Region (other)
 {
        assert(_name.find("/") == string::npos);
-       scoped_connect (midi_source(0)->Switched, boost::bind (&MidiRegion::switch_source, this, _1));
+       midi_source(0)->Switched.connect (*this, boost::bind (&MidiRegion::switch_source, this, _1));
 }
 
 MidiRegion::MidiRegion (boost::shared_ptr<MidiSource> src, const XMLNode& node)
@@ -94,7 +94,7 @@ MidiRegion::MidiRegion (boost::shared_ptr<MidiSource> src, const XMLNode& node)
                throw failed_constructor();
        }
 
-       scoped_connect (midi_source(0)->Switched, boost::bind (&MidiRegion::switch_source, this, _1));
+       midi_source(0)->Switched.connect (*this, boost::bind (&MidiRegion::switch_source, this, _1));
        assert(_name.find("/") == string::npos);
        assert(_type == DataType::MIDI);
 }
@@ -106,7 +106,7 @@ MidiRegion::MidiRegion (const SourceList& srcs, const XMLNode& node)
                throw failed_constructor();
        }
 
-       scoped_connect (midi_source(0)->Switched, boost::bind (&MidiRegion::switch_source, this, _1));
+       midi_source(0)->Switched.connect (*this, boost::bind (&MidiRegion::switch_source, this, _1));
        assert(_name.find("/") == string::npos);
        assert(_type == DataType::MIDI);
 }
index 14b096c915d5c623ce566af3fbd29ea04fa9b7fd..1e890170c46dc02aa8f3b6eebb0c34f112e3f21f 100644 (file)
@@ -49,7 +49,7 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
-boost::signals2::signal<void(MidiSource*)> MidiSource::MidiSourceCreated;
+PBD::Signal1<void,MidiSource*> MidiSource::MidiSourceCreated;
 
 MidiSource::MidiSource (Session& s, string name, Source::Flag flags)
        : Source(s, DataType::MIDI, name, flags)
index 179d0bb57c9b9856b2d56711e785416daf957fac..a6c64c3c307b6b64be88d16e823f22e23aeab36a 100644 (file)
@@ -230,7 +230,7 @@ MidiTrack::_set_state (const XMLNode& node, int version, bool call_base)
        pending_state = const_cast<XMLNode*> (&node);
 
        if (_session.state_of_the_state() & Session::Loading) {
-               scoped_connect (_session.StateReady, boost::bind (&MidiTrack::set_state_part_two, this));
+               _session.StateReady.connect (*this, boost::bind (&MidiTrack::set_state_part_two, this));
        } else {
                set_state_part_two ();
        }
index db26ee8e8303c93d62a1cac14271fc6b0c38da3a..be7a2bafc05f2b5f2cefe6c08c03a0b66e98ce0a 100644 (file)
@@ -46,7 +46,7 @@ MidiControlUI::MidiControlUI (Session& s)
        : AbstractUI<MidiUIRequest> (_("midiui"))
        , _session (s) 
 {
-       rebind_connection = MIDI::Manager::instance()->PortsChanged.connect (boost::bind (&MidiControlUI::change_midi_ports, this));
+       MIDI::Manager::instance()->PortsChanged.connect (rebind_connection, boost::bind (&MidiControlUI::change_midi_ports, this));
 }
 
 MidiControlUI::~MidiControlUI ()
index 50ef5011ba74dd83c5f0c096506cf7ad0f3aabb8..91ac47c883cbd676ddd53b8dd69527001515ea49 100644 (file)
@@ -52,7 +52,6 @@ const int MTC_Slave::frame_tolerance = 2;
 
 MTC_Slave::MTC_Slave (Session& s, MIDI::Port& p)
        : session (s)
-       , port_connections (0)
 {
        can_notify_on_unknown_rate = true;
        did_reset_tc_format = false;
@@ -71,8 +70,6 @@ MTC_Slave::MTC_Slave (Session& s, MIDI::Port& p)
 
 MTC_Slave::~MTC_Slave()
 {
-       delete port_connections;
-
        if (did_reset_tc_format) {
                session.config.set_timecode_format (saved_tc_format);
        }
@@ -91,14 +88,13 @@ MTC_Slave::give_slave_full_control_over_transport_speed() const
 void
 MTC_Slave::rebind (MIDI::Port& p)
 {
-       delete port_connections;
-       port_connections = new ScopedConnectionList;
+       port_connections.drop_connections ();
        
        port = &p;
        
-       port_connections->add_connection (port->input()->mtc_time.connect ( boost::bind (&MTC_Slave::update_mtc_time, this, _1, _2, _3)));
-       port_connections->add_connection (port->input()->mtc_qtr.connect (boost::bind (&MTC_Slave::update_mtc_qtr, this, _1, _2, _3)));
-       port_connections->add_connection (port->input()->mtc_status.connect (boost::bind (&MTC_Slave::update_mtc_status, this, _1)));
+       port->input()->mtc_time.connect (port_connections,  boost::bind (&MTC_Slave::update_mtc_time, this, _1, _2, _3));
+       port->input()->mtc_qtr.connect (port_connections, boost::bind (&MTC_Slave::update_mtc_qtr, this, _1, _2, _3));
+       port->input()->mtc_status.connect (port_connections, boost::bind (&MTC_Slave::update_mtc_status, this, _1));
 }
 
 void
index 81e9f9df8a8b116a2e47e87dfb40def669340983..a829c44a501af56edad8827c4b8c897c27bdbcd8 100644 (file)
@@ -32,7 +32,7 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
-boost::signals2::signal<void(NamedSelection*)> NamedSelection::NamedSelectionCreated;
+PBD::Signal1<void,NamedSelection*> NamedSelection::NamedSelectionCreated;
 
 typedef std::list<boost::shared_ptr<Playlist> > PlaylistList;
 
index b93e2b311a2d9e0cf78cd480c68db9572fd0991b..985cd6740a35cc46036a6e0642d85d5bae9b6e49 100644 (file)
@@ -270,7 +270,7 @@ Playlist::init (bool hide)
        freeze_length = 0;
        _explicit_relayering = false;
 
-       scoped_connect (Modified, boost::bind (&Playlist::mark_session_dirty, this));
+       Modified.connect (*this, boost::bind (&Playlist::mark_session_dirty, this));
 }
 
 Playlist::~Playlist ()
@@ -605,8 +605,7 @@ Playlist::add_region_internal (boost::shared_ptr<Region> region, nframes_t posit
                }
        }
 
-       region_state_changed_connections.add_connection 
-               (region->StateChanged.connect (boost::bind (&Playlist::region_changed_proxy, this, _1, boost::weak_ptr<Region> (region))));
+       region->StateChanged.connect (region_state_changed_connections, boost::bind (&Playlist::region_changed_proxy, this, _1, boost::weak_ptr<Region> (region)));
 
        return true;
 }
index cfcec40d1b6bece3cad0c1ca64385e640ec9c15f..2619d0e0c4dbc12fa6b2cc2c18981d8364732112 100644 (file)
@@ -31,7 +31,7 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
-boost::signals2::signal<void(boost::shared_ptr<Playlist>, bool)> PlaylistFactory::PlaylistCreated;
+PBD::Signal2<void,boost::shared_ptr<Playlist>, bool> PlaylistFactory::PlaylistCreated;
 
 boost::shared_ptr<Playlist>
 PlaylistFactory::create (Session& s, const XMLNode& node, bool hidden, bool unused)
index 54701ae8d4300a519f293b9cac0caf85191f8d31..65517be4b145ecedb74f53134d9d6ba760aa7f10 100644 (file)
@@ -56,7 +56,7 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
-boost::signals2::signal<void(Processor*)> Processor::ProcessorCreated;
+PBD::Signal1<void,Processor*> Processor::ProcessorCreated;
 
 // Always saved as Processor, but may be IOProcessor or Send in legacy sessions
 const string Processor::state_node_name = "Processor";
index 4fcb7de3cac0aa8896136ee820c3d44c93980261..731a7c04ddfb06545a03bfa19da785fa8700e8a5 100644 (file)
@@ -54,7 +54,7 @@ Change Region::LockChanged       = ARDOUR::new_change ();
 Change Region::LayerChanged      = ARDOUR::new_change ();
 Change Region::HiddenChanged     = ARDOUR::new_change ();
 
-boost::signals2::signal<void(boost::shared_ptr<ARDOUR::Region>)> Region::RegionPropertyChanged;
+PBD::Signal1<void,boost::shared_ptr<ARDOUR::Region> > Region::RegionPropertyChanged;
 
 /* derived-from-derived constructor (no sources in constructor) */
 Region::Region (Session& s, nframes_t start, nframes_t length, const string& name, DataType type, layer_t layer, Region::Flag flags)
@@ -109,7 +109,7 @@ Region::Region (boost::shared_ptr<Source> src, nframes_t start, nframes_t length
        _sources.push_back (src);
        _master_sources.push_back (src);
 
-       scoped_connect (src->GoingAway, boost::bind (&Region::source_deleted, this, boost::weak_ptr<Source>(src)));
+       src->GoingAway.connect (*this, boost::bind (&Region::source_deleted, this, boost::weak_ptr<Source>(src)));
 
        assert(_sources.size() > 0);
        _positional_lock_style = AudioTime;
@@ -1586,14 +1586,14 @@ Region::use_sources (SourceList const & s)
 
        for (SourceList::const_iterator i = s.begin (); i != s.end(); ++i) {
                _sources.push_back (*i);
-               scoped_connect ((*i)->GoingAway, boost::bind (&Region::source_deleted, this, boost::weak_ptr<Source>(*i)));
+               (*i)->GoingAway.connect (*this, boost::bind (&Region::source_deleted, this, boost::weak_ptr<Source>(*i)));
                unique_srcs.insert (*i);
        }
 
        for (SourceList::const_iterator i = s.begin (); i != s.end(); ++i) {
                _master_sources.push_back (*i);
                if (unique_srcs.find (*i) == unique_srcs.end()) {
-                       scoped_connect ((*i)->GoingAway, boost::bind (&Region::source_deleted, this, boost::weak_ptr<Source>(*i)));
+                       (*i)->GoingAway.connect (*this, boost::bind (&Region::source_deleted, this, boost::weak_ptr<Source>(*i)));
                }
        }
 }
index ff4b9d527082a92c255f41878b3d80f54d1a4e4d..6399645be1be685f0f0685141f03698f7070f73c 100644 (file)
@@ -34,7 +34,7 @@
 using namespace ARDOUR;
 using namespace PBD;
 
-boost::signals2::signal<void(boost::shared_ptr<Region>)> RegionFactory::CheckNewRegion;
+PBD::Signal1<void,boost::shared_ptr<Region> > RegionFactory::CheckNewRegion;
 
 boost::shared_ptr<Region>
 RegionFactory::create (boost::shared_ptr<Region> region, nframes_t start,
index 154c5fd0a06669381eec5c53775726a044c18232..eeb8ae83c17b28b77134f2033756591cf6c87898 100644 (file)
@@ -63,7 +63,7 @@ using namespace ARDOUR;
 using namespace PBD;
 
 uint32_t Route::order_key_cnt = 0;
-boost::signals2::signal<void(string const&)> Route::SyncOrderKeys;
+PBD::Signal1<void,string const&> Route::SyncOrderKeys;
 
 Route::Route (Session& sess, string name, Flag flg, DataType default_type)
        : SessionObject (sess, name)
@@ -93,7 +93,7 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type)
 
        /* now that we have _meter, its safe to connect to this */
 
-       scoped_connect (Metering::Meter, (boost::bind (&Route::meter, this)));
+       Metering::Meter.connect (*this, (boost::bind (&Route::meter, this)));
 }
 
 Route::Route (Session& sess, const XMLNode& node, DataType default_type)
@@ -109,7 +109,7 @@ Route::Route (Session& sess, const XMLNode& node, DataType default_type)
 
        /* now that we have _meter, its safe to connect to this */
 
-       scoped_connect (Metering::Meter, (boost::bind (&Route::meter, this)));
+       Metering::Meter.connect (*this, (boost::bind (&Route::meter, this)));
 }
 
 void
@@ -147,8 +147,8 @@ Route::init ()
        _input.reset (new IO (_session, _name, IO::Input, _default_type));
        _output.reset (new IO (_session, _name, IO::Output, _default_type));
 
-       scoped_connect (_input->changed, boost::bind (&Route::input_change_handler, this, _1, _2));
-       scoped_connect (_output->changed, boost::bind (&Route::output_change_handler, this, _1, _2));
+       _input->changed.connect (*this, boost::bind (&Route::input_change_handler, this, _1, _2));
+       _output->changed.connect (*this, boost::bind (&Route::output_change_handler, this, _1, _2));
 
        /* add amp processor  */
 
@@ -792,7 +792,7 @@ Route::add_processor (boost::shared_ptr<Processor> processor, ProcessorList::ite
                        // XXX: do we want to emit the signal here ? change call order.
                        processor->activate ();
                }
-               scoped_connect (processor->ActiveChanged, boost::bind (&Session::update_latency_compensation, &_session, false, false));
+               processor->ActiveChanged.connect (*this, boost::bind (&Session::update_latency_compensation, &_session, false, false));
 
                _output->set_user_latency (0);
        }
@@ -1047,7 +1047,7 @@ Route::add_processors (const ProcessorList& others, ProcessorList::iterator iter
                                return -1;
                        }
 
-                       scoped_connect ((*i)->ActiveChanged, boost::bind (&Session::update_latency_compensation, &_session, false, false));
+                       (*i)->ActiveChanged.connect (*this, boost::bind (&Session::update_latency_compensation, &_session, false, false));
                }
 
                _output->set_user_latency (0);
index 82953be0f869f12cbab9685cede091ed85cbe634..1da2eda67820fedd99bdd9a2f2e50945eab82944 100644 (file)
@@ -76,7 +76,7 @@ RouteGroup::add (boost::shared_ptr<Route> r)
        routes->push_back (r);
 
        r->join_route_group (this);
-       scoped_connect (r->GoingAway, boost::bind (&RouteGroup::remove_when_going_away, this, boost::weak_ptr<Route> (r)));
+       r->GoingAway.connect (*this, boost::bind (&RouteGroup::remove_when_going_away, this, boost::weak_ptr<Route> (r)));
        
        _session.set_dirty ();
        changed (); /* EMIT SIGNAL */
index d8e3b2843c6205b7d94d09d5036367e8c31071bc..b2a1aa8da8f2c15026a3a12a2a68f527f99fa49f 100644 (file)
@@ -103,17 +103,17 @@ using boost::weak_ptr;
 
 bool Session::_disable_all_loaded_plugins = false;
 
-boost::signals2::signal<void(std::string)> Session::Dialog;
-boost::signals2::signal<int()> Session::AskAboutPendingState;
-boost::signals2::signal<int(nframes_t,nframes_t)> Session::AskAboutSampleRateMismatch;
-boost::signals2::signal<void()> Session::SendFeedback;
-
-boost::signals2::signal<void()> Session::TimecodeOffsetChanged;
-boost::signals2::signal<void()> Session::StartTimeChanged;
-boost::signals2::signal<void()> Session::EndTimeChanged;
-boost::signals2::signal<void()> Session::AutoBindingOn;
-boost::signals2::signal<void()> Session::AutoBindingOff;
-boost::signals2::signal<void(std::string, std::string)> Session::Exported;
+PBD::Signal1<void,std::string> Session::Dialog;
+PBD::Signal0<int> Session::AskAboutPendingState;
+PBD::Signal2<int,nframes_t,nframes_t> Session::AskAboutSampleRateMismatch;
+PBD::Signal0<void> Session::SendFeedback;
+
+PBD::Signal0<void> Session::TimecodeOffsetChanged;
+PBD::Signal0<void> Session::StartTimeChanged;
+PBD::Signal0<void> Session::EndTimeChanged;
+PBD::Signal0<void> Session::AutoBindingOn;
+PBD::Signal0<void> Session::AutoBindingOff;
+PBD::Signal2<void,std::string, std::string> Session::Exported;
 
 static void clean_up_session_event (SessionEvent* ev) { delete ev; }
 const SessionEvent::RTeventCallback Session::rt_cleanup (clean_up_session_event);
@@ -189,8 +189,8 @@ Session::Session (AudioEngine &eng,
 
        _state_of_the_state = StateOfTheState (_state_of_the_state & ~Dirty);
 
-       scoped_connect (Config->ParameterChanged, boost::bind (&Session::config_changed, this, _1, false));
-       scoped_connect (config.ParameterChanged, boost::bind (&Session::config_changed, this, _1, true));
+       Config->ParameterChanged.connect (*this, boost::bind (&Session::config_changed, this, _1, false));
+       config.ParameterChanged.connect (*this, boost::bind (&Session::config_changed, this, _1, true));
 
        if (was_dirty) {
                DirtyChanged (); /* EMIT SIGNAL */
@@ -326,7 +326,7 @@ Session::Session (AudioEngine &eng,
 
        _state_of_the_state = StateOfTheState (_state_of_the_state & ~Dirty);
 
-       scoped_connect (Config->ParameterChanged, boost::bind (&Session::config_changed, this, _1, false));
+       Config->ParameterChanged.connect (*this, boost::bind (&Session::config_changed, this, _1, false));
 }
 
 Session::~Session ()
@@ -524,7 +524,7 @@ Session::when_engine_running ()
 
        /* every time we reconnect, recompute worst case output latencies */
 
-       scoped_connect (_engine.Running, boost::bind (&Session::set_worst_io_latencies, this));
+       _engine.Running.connect (*this, boost::bind (&Session::set_worst_io_latencies, this));
 
        if (synced_to_jack()) {
                _engine.transport_stop ();
@@ -878,7 +878,7 @@ Session::diskstream_playlist_changed (boost::weak_ptr<Diskstream> wp)
        boost::shared_ptr<Playlist> playlist;
 
        if ((playlist = dstream->playlist()) != 0) {
-               scoped_connect (playlist->LengthChanged, boost::bind (&Session::playlist_length_changed, this));
+               playlist->LengthChanged.connect (*this, boost::bind (&Session::playlist_length_changed, this));
        }
 
        /* see comment in playlist_length_changed () */
@@ -1014,9 +1014,9 @@ Session::set_auto_punch_location (Location* location)
 
        punch_connections.drop_connections ();
 
-       punch_connections.add_connection (location->start_changed.connect (boost::bind (&Session::auto_punch_start_changed, this, _1)));
-       punch_connections.add_connection (location->end_changed.connect (boost::bind (&Session::auto_punch_end_changed, this, _1)));
-       punch_connections.add_connection (location->changed.connect (boost::bind (&Session::auto_punch_changed, this, _1)));
+       location->start_changed.connect (punch_connections, boost::bind (&Session::auto_punch_start_changed, this, _1));
+       location->end_changed.connect (punch_connections, boost::bind (&Session::auto_punch_end_changed, this, _1));
+       location->changed.connect (punch_connections, boost::bind (&Session::auto_punch_changed, this, _1));
 
        location->set_auto_punch (true, this);
 
@@ -1052,9 +1052,9 @@ Session::set_auto_loop_location (Location* location)
 
        loop_connections.drop_connections ();
 
-       loop_connections.add_connection (location->start_changed.connect (boost::bind (&Session::auto_loop_changed, this, _1)));
-       loop_connections.add_connection (location->end_changed.connect (boost::bind (&Session::auto_loop_changed, this, _1)));
-       loop_connections.add_connection (location->changed.connect (boost::bind (&Session::auto_loop_changed, this, _1)));
+       location->start_changed.connect (loop_connections, boost::bind (&Session::auto_loop_changed, this, _1));
+       location->end_changed.connect (loop_connections, boost::bind (&Session::auto_loop_changed, this, _1));
+       location->changed.connect (loop_connections, boost::bind (&Session::auto_loop_changed, this, _1));
 
        location->set_auto_loop (true, this);
 
@@ -1648,7 +1648,7 @@ Session::new_midi_track (TrackMode mode, RouteGroup* route_group, uint32_t how_m
                                route_group->add (track);
                        }
 
-                       scoped_connect (track->DiskstreamChanged, boost::bind (&Session::resort_routes, this));
+                       track->DiskstreamChanged.connect (*this, boost::bind (&Session::resort_routes, this));
                        //track->set_remote_control_id (control_id);
 
                        new_routes.push_back (track);
@@ -1823,7 +1823,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
 
                        track->audio_diskstream()->non_realtime_input_change();
 
-                       scoped_connect (track->DiskstreamChanged, boost::bind (&Session::resort_routes, this));
+                       track->DiskstreamChanged.connect (*this, boost::bind (&Session::resort_routes, this));
                        track->set_remote_control_id (control_id);
                        ++control_id;
 
@@ -2150,12 +2150,12 @@ Session::add_routes (RouteList& new_routes, bool save)
 
                boost::weak_ptr<Route> wpr (*x);
 
-               scoped_connect ((*x)->listen_changed, boost::bind (&Session::route_listen_changed, this, _1, wpr));
-               scoped_connect ((*x)->solo_changed, boost::bind (&Session::route_solo_changed, this, _1, wpr));
-               scoped_connect ((*x)->mute_changed, boost::bind (&Session::route_mute_changed, this, _1));
-               scoped_connect ((*x)->output()->changed, boost::bind (&Session::set_worst_io_latencies_x, this, _1, _2));
-               scoped_connect ((*x)->processors_changed, boost::bind (&Session::route_processors_changed, this, _1));
-               scoped_connect ((*x)->route_group_changed, boost::bind (&Session::route_group_changed, this));
+               (*x)->listen_changed.connect (*this, boost::bind (&Session::route_listen_changed, this, _1, wpr));
+               (*x)->solo_changed.connect (*this, boost::bind (&Session::route_solo_changed, this, _1, wpr));
+               (*x)->mute_changed.connect (*this, boost::bind (&Session::route_mute_changed, this, _1));
+               (*x)->output()->changed.connect (*this, boost::bind (&Session::set_worst_io_latencies_x, this, _1, _2));
+               (*x)->processors_changed.connect (*this, boost::bind (&Session::route_processors_changed, this, _1));
+               (*x)->route_group_changed.connect (*this, boost::bind (&Session::route_group_changed, this));
 
                if ((*x)->is_master()) {
                        _master_out = (*x);
@@ -2295,11 +2295,11 @@ Session::add_diskstream (boost::shared_ptr<Diskstream> dstream)
                /* writer goes out of scope, copies ds back to main */
        }
 
-       scoped_connect (dstream->PlaylistChanged, boost::bind (&Session::diskstream_playlist_changed, this, boost::weak_ptr<Diskstream> (dstream)));
+       dstream->PlaylistChanged.connect (*this, boost::bind (&Session::diskstream_playlist_changed, this, boost::weak_ptr<Diskstream> (dstream)));
        /* this will connect to future changes, and check the current length */
        diskstream_playlist_changed (boost::weak_ptr<Diskstream> (dstream));
 
-       scoped_connect (dstream->RecordEnableChanged, boost::bind (&Session::update_have_rec_enabled_diskstream, this));
+       dstream->RecordEnableChanged.connect (*this, boost::bind (&Session::update_have_rec_enabled_diskstream, this));
 
        dstream->prepare ();
 
@@ -2813,8 +2813,8 @@ Session::add_regions (vector<boost::shared_ptr<Region> >& new_regions)
                                }
                        }
 
-                       scoped_connect (region->StateChanged, boost::bind (&Session::region_changed, this, _1, boost::weak_ptr<Region>(region)));
-                       scoped_connect (region->GoingAway, boost::bind (&Session::remove_region, this, boost::weak_ptr<Region>(region)));
+                       region->StateChanged.connect (*this, boost::bind (&Session::region_changed, this, _1, boost::weak_ptr<Region>(region)));
+                       region->GoingAway.connect (*this, boost::bind (&Session::remove_region, this, boost::weak_ptr<Region>(region)));
 
                        update_region_name_map (region);
                }
@@ -3002,7 +3002,7 @@ Session::add_source (boost::shared_ptr<Source> source)
        }
 
        if (result.second) {
-               scoped_connect (source->GoingAway, boost::bind (&Session::remove_source, this, boost::weak_ptr<Source> (source)));
+               source->GoingAway.connect (*this, boost::bind (&Session::remove_source, this, boost::weak_ptr<Source> (source)));
                set_dirty();
        }
 
@@ -3393,7 +3393,7 @@ Session::add_playlist (boost::shared_ptr<Playlist> playlist, bool unused)
 
        bool existing = playlists->add (playlist);
        if (!existing) {
-               scoped_connect (playlist->GoingAway, boost::bind (&Session::remove_playlist, this, boost::weak_ptr<Playlist>(playlist)));
+               playlist->GoingAway.connect (*this, boost::bind (&Session::remove_playlist, this, boost::weak_ptr<Playlist>(playlist)));
        }
 
        if (unused) {
@@ -3567,7 +3567,7 @@ Session::graph_reordered ()
 void
 Session::add_processor (Processor* processor)
 {
-       scoped_connect (processor->GoingAway, boost::bind (&Session::remove_processor, this, processor));
+       processor->GoingAway.connect (*this, boost::bind (&Session::remove_processor, this, processor));
        set_dirty();
 }
 
index 8b56271e42587c93152a916624ec715d21b11900..1bd0c2e7c7865ff41103852e67484cdafa307541 100644 (file)
@@ -91,8 +91,8 @@ Session::pre_export ()
 
        _exporting = true;
        export_status->running = true;
-       scoped_connect (export_status->Aborting, boost::bind (&Session::stop_audio_export, this));
-       scoped_connect (export_status->Finished, boost::bind (&Session::finalize_audio_export, this));
+       export_status->Aborting.connect (*this, boost::bind (&Session::stop_audio_export, this));
+       export_status->Finished.connect (*this, boost::bind (&Session::finalize_audio_export, this));
 
        return 0;
 }
@@ -150,7 +150,7 @@ Session::start_audio_export (nframes_t position, bool realtime)
                last_process_function = process_function;
                process_function = &Session::process_export;
        } else {
-               export_freewheel_connection = _engine.Freewheel.connect (boost::bind (&Session::process_export_fw, this, _1));
+               _engine.Freewheel.connect (export_freewheel_connection, boost::bind (&Session::process_export_fw, this, _1));
                return _engine.freewheel (true);
        }
 
index 03671cfa68f132f299c66e787c824e1cb6ee0a33..f1f6147960c088d26c25dfb722e2648646abea23 100644 (file)
@@ -32,7 +32,7 @@ SessionHandlePtr::SessionHandlePtr (Session* s)
        : _session (s) 
 {
        if (_session) {
-               _session_connections.add_connection (_session->GoingAway.connect (boost::bind (&SessionHandlePtr::session_going_away, this)));
+               _session->GoingAway.connect (_session_connections, boost::bind (&SessionHandlePtr::session_going_away, this));
        }
 }      
 
@@ -47,7 +47,7 @@ SessionHandlePtr::set_session (Session* s)
 
        if (s) {
                _session = s;
-               _session_connections.add_connection (_session->GoingAway.connect (boost::bind (&SessionHandlePtr::session_going_away, this)));
+               _session->GoingAway.connect (_session_connections, boost::bind (&SessionHandlePtr::session_going_away, this));
        }
 }
 
@@ -63,7 +63,7 @@ SessionHandlePtr::session_going_away ()
 SessionHandleRef::SessionHandleRef (Session& s)
        : _session (s) 
 {
-       scoped_connect (_session.GoingAway, boost::bind (&SessionHandleRef::session_going_away, this));
+       _session.GoingAway.connect (*this, boost::bind (&SessionHandleRef::session_going_away, this));
 }      
 
 void
index b2cece991c45ac77d93f9c17976914a81b4eac6e..4f0c70aa207b72c8ee6a4e09c430be93be227cba 100644 (file)
@@ -208,26 +208,26 @@ Session::set_mmc_port (string port_tag)
                mmc->set_send_device_id (old_send_device_id);
        }
 
-       scoped_connect (mmc->Play, boost::bind (&Session::mmc_deferred_play, this, _1));
-       scoped_connect (mmc->DeferredPlay, boost::bind (&Session::mmc_deferred_play, this, _1));
-       scoped_connect (mmc->Stop, boost::bind (&Session::mmc_stop, this, _1));
-       scoped_connect (mmc->FastForward, boost::bind (&Session::mmc_fast_forward, this, _1));
-       scoped_connect (mmc->Rewind, boost::bind (&Session::mmc_rewind, this, _1));
-       scoped_connect (mmc->Pause, boost::bind (&Session::mmc_pause, this, _1));
-       scoped_connect (mmc->RecordPause, boost::bind (&Session::mmc_record_pause, this, _1));
-       scoped_connect (mmc->RecordStrobe, boost::bind (&Session::mmc_record_strobe, this, _1));
-       scoped_connect (mmc->RecordExit, boost::bind (&Session::mmc_record_exit, this, _1));
-       scoped_connect (mmc->Locate, boost::bind (&Session::mmc_locate, this, _1, _2));
-       scoped_connect (mmc->Step, boost::bind (&Session::mmc_step, this, _1, _2));
-       scoped_connect (mmc->Shuttle, boost::bind (&Session::mmc_shuttle, this, _1, _2, _3));
-       scoped_connect (mmc->TrackRecordStatusChange, boost::bind (&Session::mmc_record_enable, this, _1, _2, _3));
+       mmc->Play.connect (*this, boost::bind (&Session::mmc_deferred_play, this, _1));
+       mmc->DeferredPlay.connect (*this, boost::bind (&Session::mmc_deferred_play, this, _1));
+       mmc->Stop.connect (*this, boost::bind (&Session::mmc_stop, this, _1));
+       mmc->FastForward.connect (*this, boost::bind (&Session::mmc_fast_forward, this, _1));
+       mmc->Rewind.connect (*this, boost::bind (&Session::mmc_rewind, this, _1));
+       mmc->Pause.connect (*this, boost::bind (&Session::mmc_pause, this, _1));
+       mmc->RecordPause.connect (*this, boost::bind (&Session::mmc_record_pause, this, _1));
+       mmc->RecordStrobe.connect (*this, boost::bind (&Session::mmc_record_strobe, this, _1));
+       mmc->RecordExit.connect (*this, boost::bind (&Session::mmc_record_exit, this, _1));
+       mmc->Locate.connect (*this, boost::bind (&Session::mmc_locate, this, _1, _2));
+       mmc->Step.connect (*this, boost::bind (&Session::mmc_step, this, _1, _2));
+       mmc->Shuttle.connect (*this, boost::bind (&Session::mmc_shuttle, this, _1, _2, _3));
+       mmc->TrackRecordStatusChange.connect (*this, boost::bind (&Session::mmc_record_enable, this, _1, _2, _3));
 
 
        /* also handle MIDI SPP because its so common */
 
-       scoped_connect (_mmc_port->input()->start, boost::bind (&Session::spp_start, this, _1, _2));
-       scoped_connect (_mmc_port->input()->contineu, boost::bind (&Session::spp_continue, this, _1, _2));
-       scoped_connect (_mmc_port->input()->stop, boost::bind (&Session::spp_stop, this, _1, _2));
+       _mmc_port->input()->start.connect (*this, boost::bind (&Session::spp_start, this, _1, _2));
+       _mmc_port->input()->contineu.connect (*this, boost::bind (&Session::spp_continue, this, _1, _2));
+       _mmc_port->input()->stop.connect (*this, boost::bind (&Session::spp_stop, this, _1, _2));
 
        Config->set_mmc_port_name (port_tag);
 
index ec9220ed410d60a7958a210be5cdc3078f5a08a8..0d32ea75d74f0e07681af1806b3b9858a927e321 100644 (file)
@@ -74,7 +74,7 @@ SessionPlaylists::add (boost::shared_ptr<Playlist> playlist)
 
        if (!existing) {
                playlists.insert (playlists.begin(), playlist);
-               scoped_connect (playlist->InUse, boost::bind (&SessionPlaylists::track, this, _1, boost::weak_ptr<Playlist>(playlist)));
+               playlist->InUse.connect (*this, boost::bind (&SessionPlaylists::track, this, _1, boost::weak_ptr<Playlist>(playlist)));
        }
 
        return existing;
index 4c7515f5e4e73e503caaa467c28768e13a336cb7..16cbfd1d3685da4f8d129b00879993ae8946a2c5 100644 (file)
@@ -164,7 +164,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
        _base_frame_rate = _current_frame_rate;
 
        _tempo_map = new TempoMap (_current_frame_rate);
-       scoped_connect (_tempo_map->StateChanged, boost::bind (&Session::tempo_map_changed, this, _1));
+       _tempo_map->StateChanged.connect (*this, boost::bind (&Session::tempo_map_changed, this, _1));
 
 
        _non_soloed_outs_muted = false;
@@ -266,21 +266,21 @@ Session::first_stage_init (string fullpath, string snapshot_name)
        delta_accumulator_cnt = 0;
        _slave_state = Stopped;
 
-       scoped_connect (_engine.GraphReordered, boost::bind (&Session::graph_reordered, this));
+       _engine.GraphReordered.connect (*this, boost::bind (&Session::graph_reordered, this));
 
        /* These are all static "per-class" signals */
 
-       scoped_connect (RegionFactory::CheckNewRegion, boost::bind (&Session::add_region, this, _1));
-       scoped_connect (SourceFactory::SourceCreated, boost::bind (&Session::add_source, this, _1));
-       scoped_connect (PlaylistFactory::PlaylistCreated, boost::bind (&Session::add_playlist, this, _1, _2));
-       scoped_connect (Processor::ProcessorCreated, boost::bind (&Session::add_processor, this, _1));
-       scoped_connect (NamedSelection::NamedSelectionCreated, boost::bind (&Session::add_named_selection, this, _1));
-       scoped_connect (AutomationList::AutomationListCreated, boost::bind (&Session::add_automation_list, this, _1));
+       RegionFactory::CheckNewRegion.connect (*this, boost::bind (&Session::add_region, this, _1));
+       SourceFactory::SourceCreated.connect (*this, boost::bind (&Session::add_source, this, _1));
+       PlaylistFactory::PlaylistCreated.connect (*this, boost::bind (&Session::add_playlist, this, _1, _2));
+       Processor::ProcessorCreated.connect (*this, boost::bind (&Session::add_processor, this, _1));
+       NamedSelection::NamedSelectionCreated.connect (*this, boost::bind (&Session::add_named_selection, this, _1));
+       AutomationList::AutomationListCreated.connect (*this, boost::bind (&Session::add_automation_list, this, _1));
 
        // BOOST SIGNALS
-       // scoped_connect (Controllable::Destroyed, boost::bind (&Session::remove_controllable, this, _1));
+       // Controllable::Destroyed.connect (*this, boost::bind (&Session::remove_controllable, this, _1));
 
-       scoped_connect (IO::PortCountChanged, boost::bind (&Session::ensure_buffers, this, _1));
+       IO::PortCountChanged.connect (*this, boost::bind (&Session::ensure_buffers, this, _1));
 
        /* stop IO objects from doing stuff until we're ready for them */
 
@@ -332,15 +332,15 @@ Session::second_stage_init (bool new_session)
        _state_of_the_state = StateOfTheState (_state_of_the_state|CannotSave|Loading);
 
 
-       scoped_connect (_locations.changed, boost::bind (&Session::locations_changed, this));
-       scoped_connect (_locations.added, boost::bind (&Session::locations_added, this, _1));
+       _locations.changed.connect (*this, boost::bind (&Session::locations_changed, this));
+       _locations.added.connect (*this, boost::bind (&Session::locations_added, this, _1));
        setup_click_sounds (0);
        setup_midi_control ();
 
        /* Pay attention ... */
 
-       scoped_connect (_engine.Halted, boost::bind (&Session::engine_halted, this));
-       scoped_connect (_engine.Xrun, boost::bind (&Session::xrun_recovery, this));
+       _engine.Halted.connect (*this, boost::bind (&Session::engine_halted, this));
+       _engine.Xrun.connect (*this, boost::bind (&Session::xrun_recovery, this));
 
        try {
                when_engine_running();
index 64cad0f2b614c90e695e3c9e3c11490126b1e885..6805e5f6dde292da47648a4474e4a2c4f9d02649 100644 (file)
@@ -192,8 +192,7 @@ SndFileSource::init_sndfile ()
                _timeline_position = header_position_offset;
        }
 
-       AudioFileSource::HeaderPositionOffsetChanged.connect (
-                       boost::bind (&SndFileSource::handle_header_position_change, this));
+       AudioFileSource::HeaderPositionOffsetChanged.connect (header_position_connection, boost::bind (&SndFileSource::handle_header_position_change, this));
 }
 
 int
index e401b010eaa20fb2b217bd82d394e59e55d711e5..9b9a28c69891abd8a1399a25fc693dda96dac187 100644 (file)
@@ -50,7 +50,7 @@ using namespace ARDOUR;
 using namespace std;
 using namespace PBD;
 
-boost::signals2::signal<void(boost::shared_ptr<Source>)> SourceFactory::SourceCreated;
+PBD::Signal1<void,boost::shared_ptr<Source> > SourceFactory::SourceCreated;
 Glib::Cond* SourceFactory::PeaksToBuild;
 Glib::StaticMutex SourceFactory::peak_building_lock = GLIBMM_STATIC_MUTEX_INIT;
 std::list<boost::weak_ptr<AudioSource> > SourceFactory::files_with_peaks;
index 0a6bb8b20ba5db2b65b8faaa441aa6b508c66af0..30d6c5f2d0a3f86e02712f371701808a850d1f85 100644 (file)
@@ -34,7 +34,7 @@ void Ticker::set_session (Session* s)
        SessionHandlePtr::set_session (s);
 
        if (_session) {
-               _session_connections.add_connection (_session->tick.connect (boost::bind (&Ticker::tick, this, _1, _2, _3)));
+               _session->tick.connect (_session_connections, boost::bind (&Ticker::tick, this, _1, _2, _3));
        }
 }
 
@@ -43,10 +43,10 @@ void MidiClockTicker::set_session (Session* s)
         Ticker::set_session (s);
 
         if (_session) {
-                _session_connections.add_connection (_session->MIDIClock_PortChanged.connect (boost::bind (&MidiClockTicker::update_midi_clock_port, this)));
-                _session_connections.add_connection (_session->TransportStateChange.connect (boost::bind (&MidiClockTicker::transport_state_changed, this)));
-                _session_connections.add_connection (_session->PositionChanged.connect (boost::bind (&MidiClockTicker::position_changed, this, _1)));
-                _session_connections.add_connection (_session->TransportLooped.connect (boost::bind (&MidiClockTicker::transport_looped, this)));
+                _session->MIDIClock_PortChanged.connect (_session_connections, boost::bind (&MidiClockTicker::update_midi_clock_port, this));
+                _session->TransportStateChange.connect (_session_connections, boost::bind (&MidiClockTicker::transport_state_changed, this));
+                _session->PositionChanged.connect (_session_connections, boost::bind (&MidiClockTicker::position_changed, this, _1));
+                _session->TransportLooped.connect (_session_connections, boost::bind (&MidiClockTicker::transport_looped, this));
                 update_midi_clock_port();
         }
 }
index 140dea7e5b5bbe50e5035bdd9292f7e19cfad99e..08d215036dac63933d34e25ce503a6bd427750b4 100644 (file)
@@ -88,7 +88,7 @@ BindingProxy::button_press_handler (GdkEventButton *ev)
                        }
                        prompter->set_text (prompt);
                        prompter->touch (); // shows popup
-                       learning_connection = controllable->LearningFinished.connect (boost::bind (&BindingProxy::learning_finished, this));
+                       controllable->LearningFinished.connect (learning_connection, boost::bind (&BindingProxy::learning_finished, this));
                }
                return true;
        }
index 9e339654b4f08ae56c5fd90b0f589c9276fa5b1b..bf71b0579c617760f61174f1f7c129984803e727 100644 (file)
@@ -35,44 +35,30 @@ Channel::Channel (byte channelnum, Port &p) : _port (p)
 void
 Channel::connect_input_signals ()
 {
-       add_connection (_port.input()->channel_pressure[_channel_number].connect
-                       (boost::bind (&Channel::process_chanpress, this, _1, _2)));
-       add_connection (_port.input()->channel_note_on[_channel_number].connect
-                       (boost::bind (&Channel::process_note_on, this, _1, _2)));
-       add_connection (_port.input()->channel_note_off[_channel_number].connect
-                       (boost::bind (&Channel::process_note_off, this, _1, _2)));
-       add_connection (_port.input()->channel_poly_pressure[_channel_number].connect
-                       (boost::bind (&Channel::process_polypress, this, _1, _2)));
-       add_connection (_port.input()->channel_program_change[_channel_number].connect
-                       (boost::bind (&Channel::process_program_change, this, _1, _2)));
-       add_connection (_port.input()->channel_controller[_channel_number].connect
-                       (boost::bind (&Channel::process_controller, this, _1, _2)));
-       add_connection (_port.input()->channel_pitchbend[_channel_number].connect
-                       (boost::bind (&Channel::process_pitchbend, this, _1, _2)));
-
-       add_connection (_port.input()->reset.connect (boost::bind (&Channel::process_reset, this, _1)));
+       _port.input()->channel_pressure[_channel_number].connect (*this, boost::bind (&Channel::process_chanpress, this, _1, _2));
+       _port.input()->channel_note_on[_channel_number].connect (*this, boost::bind (&Channel::process_note_on, this, _1, _2));
+       _port.input()->channel_note_off[_channel_number].connect (*this, boost::bind (&Channel::process_note_off, this, _1, _2));
+       _port.input()->channel_poly_pressure[_channel_number].connect (*this, boost::bind (&Channel::process_polypress, this, _1, _2));
+       _port.input()->channel_program_change[_channel_number].connect (*this, boost::bind (&Channel::process_program_change, this, _1, _2));
+       _port.input()->channel_controller[_channel_number].connect (*this, boost::bind (&Channel::process_controller, this, _1, _2));
+       _port.input()->channel_pitchbend[_channel_number].connect (*this, boost::bind (&Channel::process_pitchbend, this, _1, _2));
+
+       _port.input()->reset.connect (*this, boost::bind (&Channel::process_reset, this, _1));
 }
 
 void
 Channel::connect_output_signals ()
 
 {
-       add_connection (_port.output()->channel_pressure[_channel_number].connect
-                       (boost::bind (&Channel::process_chanpress, this, _1, _2)));
-       add_connection (_port.output()->channel_note_on[_channel_number].connect
-                       (boost::bind (&Channel::process_note_on, this, _1, _2)));
-       add_connection (_port.output()->channel_note_off[_channel_number].connect
-                       (boost::bind (&Channel::process_note_off, this, _1, _2)));
-       add_connection (_port.output()->channel_poly_pressure[_channel_number].connect
-                       (boost::bind (&Channel::process_polypress, this, _1, _2)));
-       add_connection (_port.output()->channel_program_change[_channel_number].connect
-                       (boost::bind (&Channel::process_program_change, this, _1, _2)));
-       add_connection (_port.output()->channel_controller[_channel_number].connect
-                       (boost::bind (&Channel::process_controller, this, _1, _2)));
-       add_connection (_port.output()->channel_pitchbend[_channel_number].connect
-                       (boost::bind (&Channel::process_pitchbend, this, _1, _2)));
-
-       add_connection (_port.output()->reset.connect (boost::bind (&Channel::process_reset, this, _1)));
+       _port.output()->channel_pressure[_channel_number].connect (*this, boost::bind (&Channel::process_chanpress, this, _1, _2));
+       _port.output()->channel_note_on[_channel_number].connect (*this, boost::bind (&Channel::process_note_on, this, _1, _2));
+       _port.output()->channel_note_off[_channel_number].connect (*this, boost::bind (&Channel::process_note_off, this, _1, _2));
+       _port.output()->channel_poly_pressure[_channel_number].connect (*this, boost::bind (&Channel::process_polypress, this, _1, _2));
+       _port.output()->channel_program_change[_channel_number].connect (*this, boost::bind (&Channel::process_program_change, this, _1, _2));
+       _port.output()->channel_controller[_channel_number].connect (*this, boost::bind (&Channel::process_controller, this, _1, _2));
+       _port.output()->channel_pitchbend[_channel_number].connect (*this, boost::bind (&Channel::process_pitchbend, this, _1, _2));
+
+       _port.output()->reset.connect (*this, boost::bind (&Channel::process_reset, this, _1));
 }
 
 void
index 617ae1443079d8514a95dba9cdbd8fa48994c478..470ccd447cfab54be705134a24c695605abdb520 100644 (file)
@@ -22,8 +22,7 @@
 
 #include <queue>
 
-#include <boost/signals2.hpp>
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "midi++/types.h"
 #include "midi++/parser.h"
index d451d234c88c94e97dc22ea1460ad4a130ff33df..90bdde3e708c5a46db2923c7f5a274d85541f7ed 100644 (file)
@@ -83,7 +83,7 @@ class Manager {
 
        int get_known_ports (std::vector<PortSet>&);
 
-       boost::signals2::signal<void()> PortsChanged;
+       PBD::Signal0<void> PortsChanged;
 
   private:
        /* This is a SINGLETON pattern */
index 0b062224386259e0861c3f5c5f65cff4c38c1679..687d0e14d89d06c2c10f64428da4c7ecbd76f6f5 100644 (file)
@@ -20,8 +20,7 @@
 #ifndef __midipp_mmc_h_h__
 #define __midipp_mmc_h_h__
 
-#include <boost/signals2.hpp>
-
+#include "pbd/signals.h"
 #include "midi++/types.h"
 
 namespace MIDI {
@@ -32,7 +31,7 @@ class Parser;
 class MachineControl 
 {
   public:
-       typedef boost::signals2::signal<void(MachineControl&)> MMCSignal;
+       typedef PBD::Signal1<void,MachineControl&> MMCSignal;
        typedef byte CommandSignature[60];
        typedef byte ResponseSignature[60];
 
@@ -144,20 +143,20 @@ class MachineControl
           true if the direction is "forwards", false for "reverse"
        */
        
-       boost::signals2::signal<void(MachineControl&,float,bool)> Shuttle;
+       PBD::Signal3<void,MachineControl&,float,bool> Shuttle;
 
        /* The second argument specifies the desired track record enabled
           status.
        */
 
-       boost::signals2::signal<void(MachineControl &,size_t,bool)
+       PBD::Signal3<void,MachineControl &,size_t,bool
                                             TrackRecordStatusChange;
        
        /* The second argument specifies the desired track record enabled
           status.
        */
 
-       boost::signals2::signal<void(MachineControl &,size_t,bool)
+       PBD::Signal3<void,MachineControl &,size_t,bool
                                             TrackMuteChange;
        
        /* The second argument points to a byte array containing
@@ -165,11 +164,11 @@ class MachineControl
           format (5 bytes, roughly: hrs/mins/secs/frames/subframes)
        */
 
-       boost::signals2::signal<void(MachineControl &, const byte *)> Locate;
+       PBD::Signal2<void,MachineControl &, const byte *> Locate;
 
        /* The second argument is the number of steps to jump */
        
-       boost::signals2::signal<void(MachineControl &, int)> Step;
+       PBD::Signal2<void,MachineControl &, int> Step;
        
   protected:
 
@@ -257,7 +256,7 @@ class MachineControl
        MIDI::Port &_port;
 
        void process_mmc_message (Parser &p, byte *, size_t len);
-       boost::signals2::scoped_connection mmc_connection;
+       PBD::ScopedConnection mmc_connection;
 
        int  do_masked_write (byte *, size_t len);
        int  do_locate (byte *, size_t len);
index 497a50abe8376ce2b0c0200744abbb03e8ae1ab2..43cf80c067aaefaef4cdd58bb538e29bd97b0552 100644 (file)
@@ -23,7 +23,7 @@
 #include <string>
 #include <iostream>
 
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 
 #include "midi++/types.h"
 
@@ -32,12 +32,12 @@ namespace MIDI {
 class Port;
 class Parser;
 
-typedef boost::signals2::signal<void(Parser&)>                   ZeroByteSignal;
-typedef boost::signals2::signal<void(Parser&,nframes_t)>         TimestampedSignal;
-typedef boost::signals2::signal<void(Parser&, byte)>             OneByteSignal;
-typedef boost::signals2::signal<void(Parser &, EventTwoBytes *)> TwoByteSignal;
-typedef boost::signals2::signal<void(Parser &, pitchbend_t)>     PitchBendSignal;
-typedef boost::signals2::signal<void(Parser &, byte *, size_t)>  Signal;
+typedef PBD::Signal1<void,Parser&>                   ZeroByteSignal;
+typedef PBD::Signal2<void,Parser&,nframes_t>         TimestampedSignal;
+typedef PBD::Signal2<void,Parser&, byte>             OneByteSignal;
+typedef PBD::Signal2<void,Parser &, EventTwoBytes *> TwoByteSignal;
+typedef PBD::Signal2<void,Parser &, pitchbend_t>     PitchBendSignal;
+typedef PBD::Signal3<void,Parser &, byte *, size_t>  Signal;
 
 class Parser {
  public:
@@ -109,9 +109,9 @@ class Parser {
 
        void set_offline (bool);
        bool offline() const { return _offline; }
-       boost::signals2::signal<void()> OfflineStatusChanged;
+       PBD::Signal0<void> OfflineStatusChanged;
 
-       boost::signals2::signal<int(byte *, size_t)> edit;
+       PBD::Signal2<int,byte *, size_t> edit;
 
        void set_mmc_forwarding (bool yn) {
                _mmc_forward = yn;
@@ -124,10 +124,10 @@ class Parser {
        const byte *mtc_current() const { return _mtc_time; }
        bool        mtc_locked() const  { return _mtc_locked; }
        
-       boost::signals2::signal<void(Parser&,int,nframes_t)>      mtc_qtr;
-       boost::signals2::signal<void(const byte*,bool,nframes_t)> mtc_time;
-       boost::signals2::signal<void(MTC_Status)>                 mtc_status;
-       boost::signals2::signal<bool()>                           mtc_skipped;
+       PBD::Signal3<void,Parser&,int,nframes_t>      mtc_qtr;
+       PBD::Signal3<void,const byte*,bool,nframes_t> mtc_time;
+       PBD::Signal1<void,MTC_Status>                 mtc_status;
+       PBD::Signal0<bool>                           mtc_skipped;
 
        void set_mtc_forwarding (bool yn) {
                _mtc_forward = yn;
@@ -142,7 +142,7 @@ class Parser {
        std::ostream *trace_stream;
        std::string trace_prefix;
        void trace_event (Parser &p, byte *msg, size_t len);
-       boost::signals2::scoped_connection trace_connection;
+       PBD::ScopedConnection trace_connection;
 
        size_t message_counter[256];
 
index 0c5fe4ae37570e7fe13faff47b82b8671442af7d..16db09f0e4d215f8413806765392aeb8461e03ea 100644 (file)
@@ -22,7 +22,6 @@
 #include <string>
 #include <iostream>
 
-#include <boost/signals2.hpp>
 #include "pbd/xml++.h"
 
 #include "midi++/types.h"
index e496e37aa97a4e954d62859bea546b34c262718f..eb1c6cb5b044a05eac3794afd3dcaf775ad67b2c 100644 (file)
@@ -206,7 +206,7 @@ MachineControl::MachineControl (Port &p, float /*version*/,
        _send_device_id = 0x7f;
        
        if ((parser = _port.input()) != 0) {
-               mmc_connection = parser->mmc.connect (boost::bind (&MachineControl::process_mmc_message, this, _1, _2, _3));
+               parser->mmc.connect (mmc_connection, boost::bind (&MachineControl::process_mmc_message, this, _1, _2, _3));
        } else {
                warning << "MMC connected to a non-input port: useless!"
                        << endmsg;
index 4f19c40ebe79d273305d85aab7362a8921bdb01f..2efa77ae0b21b3fb70254135c286e196e4e73cde 100644 (file)
@@ -316,7 +316,7 @@ Parser::trace (bool onoff, ostream *o, const string &prefix)
                cerr << "enabling tracing for port " << _port.name() << endl;
                trace_stream = o;
                trace_prefix = prefix;
-               trace_connection = any.connect (boost::bind (&Parser::trace_event, this, _1, _2, _3));
+               any.connect (trace_connection, boost::bind (&Parser::trace_event, this, _1, _2, _3));
        } else {
                trace_prefix = "";
                trace_stream = 0;
index 369e2bd5451d13677b8b7720738f45636ec29520..dd0dfd4445d4402deb6c6a78fb1eb33d1f4d3d9b 100644 (file)
 using namespace PBD;
 using namespace std;
 
-boost::signals2::signal<void(Controllable*)> Controllable::Destroyed;
-boost::signals2::signal<bool(Controllable*)> Controllable::StartLearning;
-boost::signals2::signal<void(Controllable*)> Controllable::StopLearning;
-boost::signals2::signal<void(Controllable*,int,int)> Controllable::CreateBinding;
-boost::signals2::signal<void(Controllable*)> Controllable::DeleteBinding;
+PBD::Signal1<void,Controllable*> Controllable::Destroyed;
+PBD::Signal1<bool,Controllable*> Controllable::StartLearning;
+PBD::Signal1<void,Controllable*> Controllable::StopLearning;
+PBD::Signal3<void,Controllable*,int,int> Controllable::CreateBinding;
+PBD::Signal1<void,Controllable*> Controllable::DeleteBinding;
 
 Glib::StaticRWLock Controllable::registry_lock = GLIBMM_STATIC_RW_LOCK_INIT;
 Controllable::Controllables Controllable::registry;
 Controllable::ControllablesByURI Controllable::registry_by_uri;
+PBD::ScopedConnectionList registry_connections;
 
 Controllable::Controllable (const string& name, const string& uri)
        : _name (name)
@@ -61,7 +62,7 @@ Controllable::add (Controllable& ctl)
 
        /* Controllable::remove() is static - no need to manage this connection */
 
-       ctl.GoingAway.connect (boost::bind (&Controllable::remove, ref (ctl)));
+       ctl.GoingAway.connect (registry_connections, boost::bind (&Controllable::remove, ref (ctl)));
 }
 
 void
index dbec03b3961b0ae87ff444f60ca0696afa98842c..d94c58d54f80790ea1a196b3d743719a32126a37 100644 (file)
@@ -24,7 +24,7 @@ v    it under the terms of the GNU General Public License as published by
 #include <set>
 #include <map>
 
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 #include <glibmm/thread.h>
 
 #include "pbd/statefuldestructible.h"
@@ -44,16 +44,16 @@ class Controllable : public PBD::StatefulDestructible {
        virtual void set_value (float) = 0;
        virtual float get_value (void) const = 0;
 
-       boost::signals2::signal<void()> LearningFinished;
-       static boost::signals2::signal<void(PBD::Controllable*,int,int)> CreateBinding;
-       static boost::signals2::signal<void(PBD::Controllable*)> DeleteBinding;
+       PBD::Signal0<void> LearningFinished;
+       static PBD::Signal3<void,PBD::Controllable*,int,int> CreateBinding;
+       static PBD::Signal1<void,PBD::Controllable*> DeleteBinding;
 
-       static boost::signals2::signal<bool(PBD::Controllable*)> StartLearning;
-       static boost::signals2::signal<void(PBD::Controllable*)> StopLearning;
+       static PBD::Signal1<bool,PBD::Controllable*> StartLearning;
+       static PBD::Signal1<void,PBD::Controllable*> StopLearning;
 
-       static boost::signals2::signal<void(Controllable*)> Destroyed;
+       static PBD::Signal1<void,Controllable*> Destroyed;
        
-       boost::signals2::signal<void()> Changed;
+       PBD::Signal0<void> Changed;
 
        int set_state (const XMLNode&, int version);
        XMLNode& get_state ();
index 241d847aff1940c526aed4d051e914d0963f37cd..8cc0113ff7f714a50341a495a0d4848725b0ef24 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef __pbd_destructible_h__
 #define __pbd_destructible_h__
 
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 
 namespace PBD {
 
@@ -29,7 +29,7 @@ class Destructible {
         Destructible() : refs_dropped (false){}
        virtual ~Destructible () {}
        
-       boost::signals2::signal<void ()> GoingAway;
+       PBD::Signal0<void> GoingAway;
        void drop_references () { if (!refs_dropped) { GoingAway(); } refs_dropped = true; }
 
   private:
index c5e8b19272d8356897d5578eac85e2f25c622269..b87f784334a87f1d6aee38e005989c9717efbf8d 100644 (file)
@@ -42,7 +42,7 @@ public:
                : obj(a_object), before(a_before), after(a_after)
        {
                /* if the object dies, make sure that we die and that everyone knows about it */
-               obj_death_connection = obj.GoingAway.connect (boost::bind (&MementoCommand::object_died, this));
+               obj.GoingAway.connect (obj_death_connection, boost::bind (&MementoCommand::object_died, this));
        }
 
        ~MementoCommand () {
@@ -97,7 +97,7 @@ protected:
        obj_T&   obj;
        XMLNode* before;
        XMLNode* after;
-       boost::signals2::scoped_connection obj_death_connection;
+       PBD::ScopedConnection obj_death_connection;
 };
 
 #endif // __lib_pbd_memento_h__
diff --git a/libs/pbd/pbd/scoped_connections.h b/libs/pbd/pbd/scoped_connections.h
deleted file mode 100644 (file)
index bb992e4..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-    Copyright (C) 2009 Paul Davis 
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_scoped_connections_h__
-#define __pbd_scoped_connections_h__
-
-#include <list>
-#include <glibmm/thread.h>
-#include <boost/signals2.hpp>
-
-#include "pbd/destructible.h"
-
-namespace PBD {
-
-class ScopedConnectionList 
-{
-  public:
-       ScopedConnectionList();
-       ~ScopedConnectionList ();
-       
-       void add_connection (const boost::signals2::connection& c);
-       void drop_connections ();
-
-       template<typename S> void scoped_connect (S& sig, const typename S::slot_function_type& sf) {
-               add_connection (sig.connect (sf));
-       }
-
-  private:
-       /* this class is not copyable */
-       ScopedConnectionList(const ScopedConnectionList&) {}
-
-       /* this lock is shared by all instances of a ScopedConnectionList.
-          We do not want one mutex per list, and since we only need the lock
-          when adding or dropping connections, which are generally occuring
-          in object creation and UI operations, the contention on this 
-          lock is low and not of significant consequence. Even though
-          boost::signals2 is thread-safe, this additional list of
-          scoped connections needs to be protected in 2 cases:
-
-          (1) (unlikely) we make a connection involving a callback on the
-              same object from 2 threads. (wouldn't that just be appalling 
-              programming style?)
-            
-          (2) where we are dropping connections in one thread and adding
-              one from another.
-        */
-
-       static Glib::StaticMutex _lock;
-
-       typedef std::list<boost::signals2::scoped_connection*> ConnectionList;
-       ConnectionList _list;
-};
-
-} /* namespace */
-
-#endif /* __pbd_scoped_connections_h__ */
diff --git a/libs/pbd/pbd/signals.h b/libs/pbd/pbd/signals.h
new file mode 100644 (file)
index 0000000..4ddd72e
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+    Copyright (C) 2009 Paul Davis 
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __pbd_signals_h__
+#define __pbd_signals_h__
+
+#include <list>
+#include <glibmm/thread.h>
+#include <boost/signals2.hpp>
+#include <boost/noncopyable.hpp>
+
+namespace PBD {
+
+typedef boost::signals2::connection UnscopedConnection;
+typedef boost::signals2::connection Connection;
+typedef boost::signals2::scoped_connection ScopedConnection;
+
+class ScopedConnectionList  : public boost::noncopyable
+{
+  public:
+       ScopedConnectionList();
+       ~ScopedConnectionList ();
+       
+       void add_connection (const UnscopedConnection& c);
+       void drop_connections ();
+
+       template<typename S> void scoped_connect (S& sig, const typename S::slot_function_type& sf) {
+               add_connection (sig.connect (sf));
+       }
+
+  private:
+       /* this class is not copyable */
+       ScopedConnectionList(const ScopedConnectionList&) {}
+
+       /* this lock is shared by all instances of a ScopedConnectionList.
+          We do not want one mutex per list, and since we only need the lock
+          when adding or dropping connections, which are generally occuring
+          in object creation and UI operations, the contention on this 
+          lock is low and not of significant consequence. Even though
+          boost::signals2 is thread-safe, this additional list of
+          scoped connections needs to be protected in 2 cases:
+
+          (1) (unlikely) we make a connection involving a callback on the
+              same object from 2 threads. (wouldn't that just be appalling 
+              programming style?)
+            
+          (2) where we are dropping connections in one thread and adding
+              one from another.
+        */
+
+       static Glib::StaticMutex _lock;
+
+       typedef std::list<ScopedConnection*> ConnectionList;
+       ConnectionList _list;
+};
+
+template<typename R>
+class Signal0 {
+public:
+    Signal0 () {}
+    typedef boost::signals2::signal<R()> SignalType;
+
+    void connect (ScopedConnectionList& clist, 
+                 const typename SignalType::slot_function_type& slot) {
+           clist.add_connection (_signal.connect (slot));
+    }
+    
+    void connect (Connection& c, 
+                 const typename SignalType::slot_function_type& slot) {
+           c = _signal.connect (slot);
+    }
+    
+    typename SignalType::result_type operator()() {
+           return _signal ();
+    }
+    
+private:
+    SignalType _signal;
+};
+
+template<typename R, typename A>
+class Signal1 {
+public:
+    Signal1 () {}
+    typedef boost::signals2::signal<R(A)> SignalType;
+
+    void connect (ScopedConnectionList& clist, 
+                 const typename SignalType::slot_function_type& slot) {
+           clist.add_connection (_signal.connect (slot));
+    }
+
+    void connect (Connection& c, 
+                 const typename SignalType::slot_function_type& slot) {
+           c = _signal.connect (slot);
+    }
+    
+    typename SignalType::result_type operator()(A arg1) {
+           return _signal (arg1);
+    }
+    
+private:
+    SignalType _signal;
+};
+
+template<typename R, typename A1, typename A2>
+class Signal2 {
+public:
+    Signal2 () {}
+    typedef boost::signals2::signal<R(A1, A2)> SignalType;
+
+    void connect (ScopedConnectionList& clist, 
+                 const typename SignalType::slot_function_type& slot) {
+           clist.add_connection (_signal.connect (slot));
+    }
+    
+    void connect (Connection& c, 
+                 const typename SignalType::slot_function_type& slot) {
+           c = _signal.connect (slot);
+    }
+    
+    typename SignalType::result_type operator()(A1 arg1, A2 arg2) {
+           return _signal (arg1, arg2);
+    }
+    
+private:
+    SignalType _signal;
+};
+
+template<typename R, typename A1, typename A2, typename A3>
+class Signal3 {
+public:
+    Signal3 () {}
+    typedef boost::signals2::signal<R(A1,A2,A3)> SignalType;
+
+    void connect (ScopedConnectionList& clist, 
+                 const typename SignalType::slot_function_type& slot) {
+           clist.add_connection (_signal.connect (slot));
+    }
+    
+    void connect (Connection& c, 
+                 const typename SignalType::slot_function_type& slot) {
+           c = _signal.connect (slot);
+    }
+    
+    typename SignalType::result_type operator()(A1 arg1, A2 arg2, A3 arg3) {
+           return _signal (arg1, arg2, arg3);
+    }
+    
+private:
+    SignalType _signal;
+};
+
+} /* namespace */
+
+#endif /* __pbd_signals_h__ */
index 6340ef04b9e79263f98f1df14e4e693db4b9bbef..bb910252c35d278e88b0509be7b9fa11d2c61c0b 100644 (file)
@@ -27,7 +27,7 @@
 #include <sigc++/bind.h>
 #include <sys/time.h>
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 #include "pbd/command.h"
 
 typedef sigc::slot<void> UndoAction;
@@ -106,7 +106,7 @@ class UndoHistory : public PBD::ScopedConnectionList
 
        void set_depth (uint32_t);
 
-       boost::signals2::signal<void()> Changed;
+       PBD::Signal0<void> Changed;
        
   private:
        bool _clearing;
diff --git a/libs/pbd/scoped_connections.cc b/libs/pbd/scoped_connections.cc
deleted file mode 100644 (file)
index 6878873..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-    Copyright (C) 2009 Paul Davis 
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "pbd/scoped_connections.h"
-
-using namespace PBD;
-
-Glib::StaticMutex ScopedConnectionList::_lock = GLIBMM_STATIC_MUTEX_INIT;
-
-ScopedConnectionList::ScopedConnectionList()
-{
-}
-
-ScopedConnectionList::~ScopedConnectionList()
-{
-       drop_connections ();
-}
-
-void
-ScopedConnectionList::add_connection (const boost::signals2::connection& c)
-{
-       Glib::Mutex::Lock lm (_lock);
-       _list.push_back (new boost::signals2::scoped_connection (c));
-}
-
-void
-ScopedConnectionList::drop_connections ()
-{
-       Glib::Mutex::Lock lm (_lock);
-
-       for (ConnectionList::iterator i = _list.begin(); i != _list.end(); ++i) {
-               delete *i;
-       }
-
-       _list.clear ();
-}
-
diff --git a/libs/pbd/signals.cc b/libs/pbd/signals.cc
new file mode 100644 (file)
index 0000000..62cabff
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+    Copyright (C) 2009 Paul Davis 
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "pbd/signals.h"
+
+using namespace PBD;
+
+Glib::StaticMutex ScopedConnectionList::_lock = GLIBMM_STATIC_MUTEX_INIT;
+
+ScopedConnectionList::ScopedConnectionList()
+{
+}
+
+ScopedConnectionList::~ScopedConnectionList()
+{
+       drop_connections ();
+}
+
+void
+ScopedConnectionList::add_connection (const UnscopedConnection& c)
+{
+       Glib::Mutex::Lock lm (_lock);
+       _list.push_back (new ScopedConnection (c));
+}
+
+void
+ScopedConnectionList::drop_connections ()
+{
+       Glib::Mutex::Lock lm (_lock);
+
+       for (ConnectionList::iterator i = _list.begin(); i != _list.end(); ++i) {
+               delete *i;
+       }
+
+       _list.clear ();
+}
+
index 78c16291b7d58f25050cac85503c695d54e04066..d3f01d5adaae4cd4b9e6c27d201f3ee9e9e1f6a4 100644 (file)
@@ -82,7 +82,7 @@ UndoTransaction::add_command (Command *const action)
           so there is no need to manage this connection.
         */
 
-       scoped_connect (action->GoingAway, boost::bind (&command_death, this, action));
+       action->GoingAway.connect (*this, boost::bind (&command_death, this, action));
        actions.push_back (action);
 }
 
@@ -185,7 +185,7 @@ UndoHistory::add (UndoTransaction* const ut)
 {
        uint32_t current_depth = UndoList.size();
 
-       scoped_connect (ut->GoingAway, boost::bind (&UndoHistory::remove, this, ut));
+       ut->GoingAway.connect (*this, boost::bind (&UndoHistory::remove, this, ut));
 
        /* if the current undo history is larger than or equal to the currently
           requested depth, then pop off at least 1 element to make space
index aacbd990ad538525e23d1c7e13a3572808cf0bb0..d7e456ada756514b0f02d2d527eb09e091abeb26 100644 (file)
@@ -73,9 +73,9 @@ def build(bld):
                pool.cc
                pthread_utils.cc
                receiver.cc
-               scoped_connections.cc
                search_path.cc
                shortpath.cc
+               signals.cc
                stacktrace.cc
                stateful.cc
                strreplace.cc
index f2a99296a1e7be82fff67c9255316e34f6640dd2..8c3eb029823d18a6d7bbad71b2aaff6caff73c8c 100644 (file)
@@ -30,7 +30,7 @@
 using namespace ARDOUR;
 using ARDOUR::nframes_t;
 
-sigc::signal<void,std::string,std::string> BasicUI::AccessAction;
+PBD::Signal2<void,std::string,std::string> BasicUI::AccessAction;
 
 BasicUI::BasicUI (Session& s)
        : session (&s)
index 2d59912dc8b9c35dcc504ba95b844420fd1c4061..d7f9d52efd184206c38e65ba19a103cc3652c27f 100644 (file)
 using namespace ARDOUR;
 using namespace std;
 
-sigc::signal<void> ControlProtocol::ZoomToSession;
-sigc::signal<void> ControlProtocol::ZoomOut;
-sigc::signal<void> ControlProtocol::ZoomIn;
-sigc::signal<void> ControlProtocol::Enter;
-sigc::signal<void,float> ControlProtocol::ScrollTimeline;
+PBD::Signal0<void> ControlProtocol::ZoomToSession;
+PBD::Signal0<void> ControlProtocol::ZoomOut;
+PBD::Signal0<void> ControlProtocol::ZoomIn;
+PBD::Signal0<void> ControlProtocol::Enter;
+PBD::Signal1<void,float> ControlProtocol::ScrollTimeline;
 
 ControlProtocol::ControlProtocol (Session& s, string str)
        : BasicUI (s),
          _name (str)
 {
        _active = false;
-       session->RouteAdded.connect (mem_fun(*this, &ControlProtocol::add_strip));
+       session->RouteAdded.connect (*this, boost::bind (&ControlProtocol::add_strip, this, _1));
 }
 
 ControlProtocol::~ControlProtocol ()
index 3456838041fb103a14bf97e4c5d5410ff42b8e9e..f1bfcaa87c7f43ce2057b2c4983ad26b1417c38c 100644 (file)
@@ -22,7 +22,7 @@
 #define __ardour_basic_ui_h__
 
 #include <string>
-
+#include "pbd/signals.h"
 
 #include <jack/types.h>
 
@@ -46,7 +46,7 @@ class BasicUI {
 
        void loop_toggle ();
        void access_action ( std::string action_path );
-       static sigc::signal<void,std::string,std::string> AccessAction;
+       static PBD::Signal2<void,std::string,std::string> AccessAction;
        void goto_start ();
        void goto_end ();
        void rewind ();
index a01dcd3ab460bd4fe9d796e98b2eb365cb3226be..8a50caf05f3cbb174941269c8b8a6810dc7d97e7 100644 (file)
@@ -25,8 +25,8 @@
 #include <vector>
 #include <list>
 #include <boost/shared_ptr.hpp>
-#include <sigc++/sigc++.h>
-#include <pbd/stateful.h>
+#include "pbd/stateful.h"
+#include "pbd/signals.h"
 #include "control_protocol/basic_ui.h"
 
 namespace ARDOUR {
@@ -34,7 +34,7 @@ namespace ARDOUR {
 class Route;
 class Session;
 
-class ControlProtocol : virtual public sigc::trackable, public PBD::Stateful, public BasicUI {
+class ControlProtocol : virtual public sigc::trackable, public PBD::Stateful, public PBD::ScopedConnectionList, public BasicUI {
   public:
        ControlProtocol (Session&, std::string name);
        virtual ~ControlProtocol();
@@ -49,17 +49,17 @@ class ControlProtocol : virtual public sigc::trackable, public PBD::Stateful, pu
 
        virtual void route_list_changed () {}
 
-       sigc::signal<void> ActiveChanged;
+       PBD::Signal0<void> ActiveChanged;
 
        /* signals that a control protocol can emit and other (presumably graphical)
           user interfaces can respond to
        */
 
-       static sigc::signal<void> ZoomToSession;
-       static sigc::signal<void> ZoomIn;
-       static sigc::signal<void> ZoomOut;
-       static sigc::signal<void> Enter;
-       static sigc::signal<void,float> ScrollTimeline;
+       static PBD::Signal0<void> ZoomToSession;
+       static PBD::Signal0<void> ZoomIn;
+       static PBD::Signal0<void> ZoomOut;
+       static PBD::Signal0<void> Enter;
+       static PBD::Signal1<void,float> ScrollTimeline;
 
        /* the model here is as follows:
 
@@ -107,6 +107,9 @@ class ControlProtocol : virtual public sigc::trackable, public PBD::Stateful, pu
 
        void next_track (uint32_t initial_id);
        void prev_track (uint32_t initial_id);
+
+  private:
+       ControlProtocol (const ControlProtocol&) {} /* noncopyable */
 };
 
 extern "C" {
index a20835dc051e8ede593f651617a0530a988a96a2..efe20892372c84f031e3637029dc1b8f1086e789 100644 (file)
@@ -61,15 +61,14 @@ GenericMidiControlProtocol::GenericMidiControlProtocol (Session& s)
 
        auto_binding = FALSE;
 
-       Controllable::StartLearning.connect (mem_fun (*this, &GenericMidiControlProtocol::start_learning));
-       Controllable::StopLearning.connect (mem_fun (*this, &GenericMidiControlProtocol::stop_learning));
-       Session::SendFeedback.connect (mem_fun (*this, &GenericMidiControlProtocol::send_feedback));
-       
-       Controllable::CreateBinding.connect (mem_fun (*this, &GenericMidiControlProtocol::create_binding));
-       Controllable::DeleteBinding.connect (mem_fun (*this, &GenericMidiControlProtocol::delete_binding));
-
-       Session::AutoBindingOn.connect (mem_fun (*this, &GenericMidiControlProtocol::auto_binding_on));
-       Session::AutoBindingOff.connect (mem_fun (*this, &GenericMidiControlProtocol::auto_binding_off));
+       Controllable::StartLearning.connect (*this, boost::bind (&GenericMidiControlProtocol::start_learning, this, _1));
+       Controllable::StopLearning.connect (*this, boost::bind (&GenericMidiControlProtocol::stop_learning, this, _1));
+       Controllable::CreateBinding.connect (*this, boost::bind (&GenericMidiControlProtocol::create_binding, this, _1, _2, _3));
+       Controllable::DeleteBinding.connect (*this, boost::bind (&GenericMidiControlProtocol::delete_binding, this, _1));
+
+       Session::SendFeedback.connect (*this, boost::bind (&GenericMidiControlProtocol::send_feedback, this));
+       Session::AutoBindingOn.connect (*this, boost::bind (&GenericMidiControlProtocol::auto_binding_on, this));
+       Session::AutoBindingOff.connect (*this, boost::bind (&GenericMidiControlProtocol::auto_binding_off, this));
 }
 
 GenericMidiControlProtocol::~GenericMidiControlProtocol ()
index 533bb6db21869854f51b58823eeb29a219371156..a1f5abf3b0e1028a1eeac1597c14fef8cabfa14d 100644 (file)
@@ -57,7 +57,6 @@ MIDIControllable::init ()
        control_type = none;
        _control_description = "MIDI Control: none";
        control_additional = (byte) -1;
-       connections = 0;
        feedback = true; // for now
 
        /* use channel 0 ("1") as the initial channel */
@@ -72,17 +71,20 @@ MIDIControllable::midi_forget ()
           our existing event + type information.
        */
 
-       if (connections > 0) {
-               midi_sense_connection[0].disconnect ();
-       }
-
-       if (connections > 1) {
-               midi_sense_connection[1].disconnect ();
-       }
+       midi_sense_connection[0].disconnect ();
+       midi_sense_connection[1].disconnect ();
+       midi_learn_connection.disconnect ();
+}
 
-       connections = 0;
+void
+MIDIControllable::drop_external_control ()
+{
+       midi_sense_connection[0].disconnect ();
+       midi_sense_connection[1].disconnect ();
        midi_learn_connection.disconnect ();
 
+       control_type = none;
+       control_additional = (byte) -1;
 }
 
 void
@@ -109,7 +111,7 @@ void
 MIDIControllable::learn_about_external_control ()
 {
        drop_external_control ();
-       midi_learn_connection = _port.input()->any.connect (boost::bind (&MIDIControllable::midi_receiver, this, _1, _2, _3));
+       _port.input()->any.connect (midi_learn_connection, boost::bind (&MIDIControllable::midi_receiver, this, _1, _2, _3));
 }
 
 void
@@ -118,23 +120,6 @@ MIDIControllable::stop_learning ()
        midi_learn_connection.disconnect ();
 }
 
-void
-MIDIControllable::drop_external_control ()
-{
-       if (connections > 0) {
-               midi_sense_connection[0].disconnect ();
-       }
-       if (connections > 1) {
-               midi_sense_connection[1].disconnect ();
-       }
-
-       connections = 0;
-       midi_learn_connection.disconnect ();
-
-       control_type = none;
-       control_additional = (byte) -1;
-}
-
 float
 MIDIControllable::control_to_midi(float val)
 {
@@ -300,58 +285,43 @@ MIDIControllable::bind_midi (channel_t chn, eventType ev, MIDI::byte additional)
        int chn_i = chn;
        switch (ev) {
        case MIDI::off:
-               midi_sense_connection[0] = p.channel_note_off[chn_i].connect
-                       (boost::bind (&MIDIControllable::midi_sense_note_off, this, _1, _2));
+               p.channel_note_off[chn_i].connect (midi_sense_connection[0], boost::bind (&MIDIControllable::midi_sense_note_off, this, _1, _2));
 
                /* if this is a bistate, connect to noteOn as well,
                   and we'll toggle back and forth between the two.
                */
 
                if (bistate) {
-                       midi_sense_connection[1] = p.channel_note_on[chn_i].connect
-                               (boost::bind (&MIDIControllable::midi_sense_note_on, this, _1, _2));
-                       connections = 2;
-               } else {
-                       connections = 1;
-               }
+                       p.channel_note_on[chn_i].connect (midi_sense_connection[1], boost::bind (&MIDIControllable::midi_sense_note_on, this, _1, _2));
+               } 
+
                _control_description = "MIDI control: NoteOff";
                break;
 
        case MIDI::on:
-               midi_sense_connection[0] = p.channel_note_on[chn_i].connect
-                       (boost::bind (&MIDIControllable::midi_sense_note_on, this, _1, _2));
+               p.channel_note_on[chn_i].connect (midi_sense_connection[0], boost::bind (&MIDIControllable::midi_sense_note_on, this, _1, _2));
                if (bistate) {
-                       midi_sense_connection[1] = p.channel_note_off[chn_i].connect
-                               (boost::bind (&MIDIControllable::midi_sense_note_off, this, _1, _2));
-                       connections = 2;
-               } else {
-                       connections = 1;
+                       p.channel_note_off[chn_i].connect (midi_sense_connection[1], boost::bind (&MIDIControllable::midi_sense_note_off, this, _1, _2));
                }
                _control_description = "MIDI control: NoteOn";
                break;
                
        case MIDI::controller:
-               midi_sense_connection[0] = p.channel_controller[chn_i].connect
-                       (boost::bind (&MIDIControllable::midi_sense_controller, this, _1, _2));
-               connections = 1;
+               p.channel_controller[chn_i].connect (midi_sense_connection[0], boost::bind (&MIDIControllable::midi_sense_controller, this, _1, _2));
                snprintf (buf, sizeof (buf), "MIDI control: Controller %d", control_additional);
                _control_description = buf;
                break;
 
        case MIDI::program:
                if (!bistate) {
-                       midi_sense_connection[0] = p.channel_program_change[chn_i].connect
-                               (boost::bind (&MIDIControllable::midi_sense_program_change, this, _1, _2));
-                       connections = 1;
+                       p.channel_program_change[chn_i].connect (midi_sense_connection[0], boost::bind (&MIDIControllable::midi_sense_program_change, this, _1, _2));
                        _control_description = "MIDI control: ProgramChange";
                }
                break;
 
        case MIDI::pitchbend:
                if (!bistate) {
-                       midi_sense_connection[0] = p.channel_pitchbend[chn_i].connect
-                               (boost::bind (&MIDIControllable::midi_sense_pitchbend, this, _1, _2));
-                       connections = 1;
+                       p.channel_pitchbend[chn_i].connect (midi_sense_connection[0], boost::bind (&MIDIControllable::midi_sense_pitchbend, this, _1, _2));
                        _control_description = "MIDI control: Pitchbend";
                }
                break;
index cc85cc42c198569f79397b1d7dc662fcc6c6a3b4..4661b2f4c62efdc665251b306a628825f572ef30 100644 (file)
 
 #include <string>
 
-#include <boost/signals2.hpp>
-
 #include "midi++/types.h"
+
 #include "pbd/controllable.h"
+#include "pbd/signals.h"
 #include "pbd/stateful.h"
+
 #include "ardour/types.h"
 
 namespace MIDI {
@@ -82,9 +83,8 @@ class MIDIControllable : public PBD::Stateful
        MIDI::byte       last_value;
        bool             bistate;
        int              midi_msg_id;      /* controller ID or note number */
-       boost::signals2::connection midi_sense_connection[2];
-       boost::signals2::connection midi_learn_connection;
-       size_t           connections;
+       PBD::ScopedConnection midi_sense_connection[2];
+       PBD::ScopedConnection midi_learn_connection;
        MIDI::eventType  control_type;
        MIDI::byte       control_additional;
        MIDI::channel_t  control_channel;
index acd91e60470b1514d044c01d2a50944e94e80eca..8a7740598f2d0703dbc434a9cc4c8ea62f12b951 100644 (file)
@@ -22,7 +22,7 @@
 #include <vector>
 #include <string>
 
-#include <boost/signals2.hpp>
+#include "pbd/signals.h"
 
 #include "mackie_control_exception.h"
 
@@ -228,7 +228,7 @@ public:
        virtual unsigned int in_use_timeout() { return _in_use_timeout; }
 
        /// Keep track of the timeout so it can be updated with more incoming events
-       boost::signals2::scoped_connection in_use_connection;
+       PBD::ScopedConnection in_use_connection;
        
 private:
        int _id;
index 7460b041ad7b930058a6bd9a38ec1a807067736e..9698b299b9c153f6c2173a345b43199b08ca2e5c 100644 (file)
@@ -562,23 +562,23 @@ void MackieControlProtocol::update_surface()
 void MackieControlProtocol::connect_session_signals()
 {
        // receive routes added
-       session_connections.add_connection (session->RouteAdded.connect(boost::bind (&MackieControlProtocol::notify_route_added, this, _1)));
+       session->RouteAdded.connect(session_connections, boost::bind (&MackieControlProtocol::notify_route_added, this, _1));
        // receive record state toggled
-       session_connections.add_connection (session->RecordStateChanged.connect(boost::bind (&MackieControlProtocol::notify_record_state_changed, this)));
+       session->RecordStateChanged.connect(session_connections, boost::bind (&MackieControlProtocol::notify_record_state_changed, this));
        // receive transport state changed
-       session_connections.add_connection (session->TransportStateChange.connect(boost::bind (&MackieControlProtocol::notify_transport_state_changed, this)));
+       session->TransportStateChange.connect(session_connections, boost::bind (&MackieControlProtocol::notify_transport_state_changed, this));
        // receive punch-in and punch-out
-       session_connections.add_connection (Config->ParameterChanged.connect(boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1)));
-       session_connections.add_connection (session->config.ParameterChanged.connect (boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1)));
+       Config->ParameterChanged.connect(session_connections, boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1));
+       session->config.ParameterChanged.connect (session_connections, boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1));
        // receive rude solo changed
-       session_connections.add_connection (session->SoloActive.connect(boost::bind (&MackieControlProtocol::notify_solo_active_changed, this, _1)));
+       session->SoloActive.connect(session_connections, boost::bind (&MackieControlProtocol::notify_solo_active_changed, this, _1));
 
        // make sure remote id changed signals reach here
        // see also notify_route_added
        Sorted sorted = get_sorted_routes();
        for ( Sorted::iterator it = sorted.begin(); it != sorted.end(); ++it )
        {
-               session_connections.add_connection ((*it)->RemoteControlIDChanged.connect (boost::bind(&MackieControlProtocol::notify_remote_id_changed, this)));
+               ((*it)->RemoteControlIDChanged.connect (route_connections, boost::bind(&MackieControlProtocol::notify_remote_id_changed, this)));
        }
 }
 
@@ -602,10 +602,10 @@ void MackieControlProtocol::add_port( MIDI::Port & midi_port, int number )
                MackiePort * sport = new MackiePort( *this, midi_port, number );
                _ports.push_back( sport );
                
-               port_connections.add_connection (sport->init_event.connect (boost::bind (&MackieControlProtocol::handle_port_init, this, sport)));
-               port_connections.add_connection (sport->active_event.connect (boost::bind (&MackieControlProtocol::handle_port_active, this, sport)));
-               port_connections.add_connection (sport->inactive_event.connect (boost::bind (&MackieControlProtocol::handle_port_inactive, this, sport)));
-
+               sport->init_event.connect (port_connections, boost::bind (&MackieControlProtocol::handle_port_init, this, sport));
+               sport->active_event.connect (port_connections, boost::bind (&MackieControlProtocol::handle_port_active, this, sport));
+               sport->inactive_event.connect (port_connections, boost::bind (&MackieControlProtocol::handle_port_inactive, this, sport));
+               
                _ports_changed = true;
        }
 }
@@ -682,7 +682,7 @@ void MackieControlProtocol::initialize_surface()
        // Connect events. Must be after route table otherwise there will be trouble
 
        for( MackiePorts::iterator it = _ports.begin(); it != _ports.end(); ++it ) {
-               port_connections.add_connection ((*it)->control_event.connect(boost::bind (&MackieControlProtocol::handle_control_event, this, _1, _2, _3)));
+               (*it)->control_event.connect (port_connections, boost::bind (&MackieControlProtocol::handle_control_event, this, _1, _2, _3));
        }
 }
 
@@ -1445,7 +1445,7 @@ void MackieControlProtocol::notify_route_added( ARDOUR::RouteList & rl )
        typedef ARDOUR::RouteList ARS;
 
        for (ARS::iterator it = rl.begin(); it != rl.end(); ++it) {
-               route_connections.add_connection ((*it)->RemoteControlIDChanged.connect (boost::bind (&MackieControlProtocol::notify_remote_id_changed, this)));
+               (*it)->RemoteControlIDChanged.connect (route_connections, boost::bind (&MackieControlProtocol::notify_remote_id_changed, this));
        }
 }
 
index 33164839142321116322f46d9d4a700558f5d2d4..8cf69585e3a393477e1d6fcea053d14863ae2827 100644 (file)
@@ -94,7 +94,7 @@ void MackiePort::open()
 #ifdef PORT_DEBUG
        cout << "MackiePort::open " << *this << endl;
 #endif
-       _sysex = port().input()->sysex.connect (boost::bind (&MackiePort::handle_midi_sysex, this, _1, _2, _3));
+       port().input()->sysex.connect (sysex_connection, boost::bind (&MackiePort::handle_midi_sysex, this, _1, _2, _3));
        
        // make sure the device is connected
        init();
@@ -107,8 +107,8 @@ void MackiePort::close()
 #endif
        
        // disconnect signals
-       _any.disconnect();
-       _sysex.disconnect();
+       any_connection.disconnect();
+       sysex_connection.disconnect();
        
        // TODO emit a "closing" signal?
 #ifdef PORT_DEBUG
@@ -288,26 +288,8 @@ void MackiePort::finalise_init( bool yn )
 
 void MackiePort::connect_any()
 {
-/*
-       Doesn't work because there isn't an == operator for slots
-       MIDI::Signal::slot_list_type slots = port().input()->any.slots();
-       
-       if ( find( slots.begin(), slots.end(), mem_fun( *this, &MackiePort::handle_midi_any ) ) == slots.end() )
-*/
-       // TODO but this will break if midi tracing is turned on
-       if ( port().input()->any.empty() )
-       {
-#ifdef DEBUG
-               cout << "connect input parser " << port().input() << " to handle_midi_any" << endl;
-#endif
-               _any = port().input()->any.connect (boost::bind (&MackiePort::handle_midi_any, this, _1, _2, _3));
-#ifdef DEBUG
-               cout << "input parser any connections: " << port().input()->any.size() << endl;
-#endif
-       }
-       else
-       {
-               cout << "MackiePort::connect_any already connected" << endl;
+       if (!any_connection.connected()) {
+               port().input()->any.connect (any_connection, boost::bind (&MackiePort::handle_midi_any, this, _1, _2, _3));
        }
 }
 
index 639183d066524b5e4dcebf539bc890cbb2ae4eb1..292fc2ac13866862c557468d1baede77e1ee3103 100644 (file)
 #ifndef mackie_port_h
 #define mackie_port_h
 
-#include "surface_port.h"
-
 #include <midi++/types.h>
-#include <boost/signals2.hpp>
-
 #include <glibmm/thread.h>
 
+#include "pbd/signals.h"
+
+#include "surface_port.h"
 #include "midi_byte_array.h"
 #include "types.h"
 
@@ -115,8 +114,8 @@ protected:
 private:
        MackieControlProtocol & _mcp;
        port_type_t _port_type;
-       boost::signals2::scoped_connection _any;
-       boost::signals2::scoped_connection _sysex;
+       PBD::ScopedConnection any_connection;
+       PBD::ScopedConnection sysex_connection;
        emulation_t _emulation;
 
        bool _initialising;
index fb6cf5b092c114938e81cd324020d69b078c4031..9a3dd41bf4ce29fa2bec337c1d1d0b8dad955290 100644 (file)
@@ -32,36 +32,36 @@ using namespace std;
 void RouteSignal::connect()
 {
        if (_strip.has_solo()) {
-               connections.add_connection (_route->solo_control()->Changed.connect(boost::bind (&MackieControlProtocol::notify_solo_changed, &_mcp, this)));
+               _route->solo_control()->Changed.connect(connections, boost::bind (&MackieControlProtocol::notify_solo_changed, &_mcp, this));
        }
 
        if (_strip.has_mute()) {
-               connections.add_connection (_route->mute_control()->Changed.connect(boost::bind (&MackieControlProtocol::notify_mute_changed, &_mcp, this)));
+               _route->mute_control()->Changed.connect(connections, boost::bind (&MackieControlProtocol::notify_mute_changed, &_mcp, this));
        }
 
        if (_strip.has_gain()) {
-               connections.add_connection (_route->gain_control()->Changed.connect(boost::bind (&MackieControlProtocol::notify_gain_changed, &_mcp, this, false)));
+               _route->gain_control()->Changed.connect(connections, boost::bind (&MackieControlProtocol::notify_gain_changed, &_mcp, this, false));
        }
 
-       connections.add_connection (_route->NameChanged.connect (boost::bind (&MackieControlProtocol::notify_name_changed, &_mcp, this)));
+       _route->NameChanged.connect (connections, boost::bind (&MackieControlProtocol::notify_name_changed, &_mcp, this));
        
        if (_route->panner()) {
-               connections.add_connection (_route->panner()->Changed.connect(boost::bind (&MackieControlProtocol::notify_panner_changed, &_mcp, this, false)));
+               _route->panner()->Changed.connect(connections, boost::bind (&MackieControlProtocol::notify_panner_changed, &_mcp, this, false));
                
                for ( unsigned int i = 0; i < _route->panner()->npanners(); ++i ) {
-                       connections.add_connection (_route->panner()->streampanner(i).Changed.connect (boost::bind (&MackieControlProtocol::notify_panner_changed, &_mcp, this, false)));
+                       _route->panner()->streampanner(i).Changed.connect (connections, boost::bind (&MackieControlProtocol::notify_panner_changed, &_mcp, this, false));
                }
        }
        
        boost::shared_ptr<Track> trk = boost::dynamic_pointer_cast<ARDOUR::Track>(_route);
        if (trk) {
-               connections.add_connection (trk->rec_enable_control()->Changed .connect(boost::bind (&MackieControlProtocol::notify_record_enable_changed, &_mcp, this)));
+               trk->rec_enable_control()->Changed .connect(connections, boost::bind (&MackieControlProtocol::notify_record_enable_changed, &_mcp, this));
        }
        
        // TODO this works when a currently-banked route is made inactive, but not
        // when a route is activated which should be currently banked.
-       connections.add_connection (_route->active_changed.connect (boost::bind (&MackieControlProtocol::notify_active_changed, &_mcp, this)));
-
+       _route->active_changed.connect (connections, boost::bind (&MackieControlProtocol::notify_active_changed, &_mcp, this));
+       
        // TODO
        // SelectedChanged
        // RemoteControlIDChanged. Better handled at Session level.
index 5b388a7da59e425207b8847e774a4c17617b5826..59bfc66e7b726553f034aab547f74acd9bfad89a 100644 (file)
@@ -21,7 +21,7 @@
 #include <vector>
 #include <boost/shared_ptr.hpp>
 
-#include "pbd/scoped_connections.h"
+#include "pbd/signals.h"
 
 #include "midi_byte_array.h"
 
index f41f2865bb0c5a0d23030c743c3d5c78820238a0..86ec8ffd9e38bd72f6283587df3885d552142683 100644 (file)
@@ -18,9 +18,9 @@
 #ifndef surface_port_h
 #define surface_port_h
 
-#include <boost/signals2.hpp>
 #include <glibmm/thread.h>
 
+#include "pbd/signals.h"
 #include "midi_byte_array.h"
 #include "types.h"
 
@@ -64,17 +64,17 @@ public:
        const MIDI::Port & port() const { return *_port; }
        
        // all control notofications are sent from here
-       boost::signals2::signal<void(SurfacePort &, Control &, const ControlState &)> control_event;
+       PBD::Signal3<void,SurfacePort &, Control &, const ControlState &> control_event;
        
        // emitted just before the port goes into initialisation
        // where it tries to establish that its device is connected
-       boost::signals2::signal<void()> init_event;
+       PBD::Signal0<void> init_event;
        
        // emitted when the port completes initialisation successfully
-       boost::signals2::signal<void()> active_event;
+       PBD::Signal0<void> active_event;
 
        // emitted when the port goes inactive (ie a read or write failed)
-       boost::signals2::signal<void()> inactive_event;
+       PBD::Signal0<void> inactive_event;
        
        // the port number - master is 0(extenders are 1((,4
        virtual int number() const { return _number; }
index 931a5c1a580f2a62433546c52fc396f36dc13574..a076b161e71022d1ca432e3fb1aacd0577ef7be7 100644 (file)
@@ -83,7 +83,7 @@ OSC::OSC (Session& s, uint32_t port)
 
        // "Application Hooks"
        session_loaded (s);
-       scoped_connect (session->Exported, boost::bind (&OSC::session_exported, this, _1, _2));
+       session->Exported.connect (*this, boost::bind (&OSC::session_exported, this, _1, _2));
 }
 
 OSC::~OSC()
@@ -573,7 +573,7 @@ OSC::listen_to_route (boost::shared_ptr<Route> route, lo_address addr)
        */
        
        if (!route_exists) {
-               scoped_connect (route->GoingAway, (boost::bind (&OSC::drop_route, this, boost::weak_ptr<Route> (route))));
+               route->GoingAway.connect (*this, boost::bind (&OSC::drop_route, this, boost::weak_ptr<Route> (route)));
        }
 }
 
index 314d37c7bde4a460fbf7da0977961740cf8a1893..15914bfbbd09c2d0ee24590d5926f4d03c05cef8 100644 (file)
@@ -32,7 +32,6 @@
 #include <glibmm/main.h>
 
 #include "pbd/abstract_ui.h"
-#include "pbd/scoped_connections.h"
 
 #include "ardour/types.h"
 #include "control_protocol/control_protocol.h"
@@ -55,7 +54,7 @@ struct OSCUIRequest : public BaseUI::BaseRequestObject {
        ~OSCUIRequest() {}
 };
 
-class OSC : public ARDOUR::ControlProtocol, public PBD::ScopedConnectionList, public AbstractUI<OSCUIRequest>
+class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
 {
   public:
        OSC (ARDOUR::Session&, uint32_t port);
index df3facfa8cac0c7e2f7d84ca8260fd81ff213a2e..f5deadd41db25874777caf366b51ad62288a69ac 100644 (file)
@@ -35,7 +35,7 @@ OSCControllable::OSCControllable (lo_address a, const std::string& p, boost::sha
        , addr (a)
        , path (p)
 {
-       c->Changed.connect (mem_fun (*this, &OSCControllable::send_change));
+       c->Changed.connect (changed_connection, mem_fun (*this, &OSCControllable::send_change));
 }
 
 OSCControllable::~OSCControllable ()
index 750cd12509ce6a412d608f78f6b1b48488a2846a..67b828446001d09238cdbda47dbfba96e69a9f6b 100644 (file)
@@ -48,6 +48,7 @@ class OSCControllable : public PBD::Stateful
 
   protected:
        boost::shared_ptr<PBD::Controllable> controllable;
+       PBD::ScopedConnection changed_connection;
        lo_address addr;
        std::string path;