remove PBD::Connection (replace use with PBD::ScopedConnection); remove limitation on transport roll after session end

git-svn-id: svn://localhost/ardour2/branches/3.0@6834 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-04-02 15:24:53 +00:00
parent 3dd7f05fb1
commit a48742043b
7 changed files with 16 additions and 27 deletions

View file

@ -54,7 +54,7 @@ class MidiTracer : public ArdourDialog
void connect ();
void disconnect ();
PBD::Connection connection;
PBD::ScopedConnection connection;
};
#endif /* __ardour_gtk_midi_tracer_h__ */

View file

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

View file

@ -149,7 +149,7 @@ AudioSource::update_length (sframes_t pos, sframes_t cnt)
***********************************************************************/
bool
AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, Connection& connect_here_if_not, EventLoop* event_loop) const
AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, ScopedConnection& connect_here_if_not, EventLoop* event_loop) const
{
bool ret;
Glib::Mutex::Lock lm (_peaks_ready_lock);

View file

@ -933,10 +933,6 @@ Session::set_transport_speed (double speed, bool abort, bool clear_state)
/* we are stopped and we want to start rolling at speed 1 */
if (!get_record_enabled() && Config->get_stop_at_session_end() && _transport_frame >= current_end_frame()) {
return;
}
if (Config->get_monitoring_model() == HardwareMonitoring) {
boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
@ -957,12 +953,6 @@ Session::set_transport_speed (double speed, bool abort, bool clear_state)
} else {
/* if not recording, don't roll forward past end if told to stop there */
if (!get_record_enabled() && (speed > 0.0 && Config->get_stop_at_session_end() && _transport_frame >= current_end_frame())) {
return;
}
if ((synced_to_jack()) && speed != 0.0 && speed != 1.0) {
warning << string_compose (_("Global varispeed cannot be supported while %1 is connected to JACK transport control"),
PROGRAM_NAME)

View file

@ -89,8 +89,8 @@ private:
CrossThreadChannel xthread;
std::string _inbound_connections;
std::string _outbound_connections;
PBD::Connection connect_connection;
PBD::Connection halt_connection;
PBD::ScopedConnection connect_connection;
PBD::ScopedConnection halt_connection;
void flush (void* jack_port_buffer);
void jack_halted ();
void make_connections();

View file

@ -33,7 +33,6 @@
namespace PBD {
typedef boost::signals2::connection UnscopedConnection;
typedef boost::signals2::connection Connection;
typedef boost::signals2::scoped_connection ScopedConnection;
class ScopedConnectionList : public boost::noncopyable
@ -77,7 +76,7 @@ public:
Signal0 () {}
typedef boost::signals2::signal<R()> SignalType;
void connect_same_thread (Connection& c,
void connect_same_thread (ScopedConnection& c,
const typename SignalType::slot_function_type& slot) {
c = _signal.connect (slot);
}
@ -94,7 +93,7 @@ public:
clist.add_connection (_signal.connect (boost::bind (&EventLoop::call_slot, event_loop, ir, slot)));
}
void connect (Connection& c,
void connect (ScopedConnection& c,
PBD::EventLoop::InvalidationRecord* ir,
const typename SignalType::slot_function_type& slot,
PBD::EventLoop* event_loop) {
@ -122,7 +121,7 @@ public:
clist.add_connection (_signal.connect (slot));
}
void connect_same_thread (Connection& c,
void connect_same_thread (ScopedConnection& c,
const typename SignalType::slot_function_type& slot) {
c = _signal.connect (slot);
}
@ -138,7 +137,7 @@ public:
clist.add_connection (_signal.connect (boost::bind (&compositor, slot, event_loop, ir, _1)));
}
void connect (Connection& c,
void connect (ScopedConnection& c,
PBD::EventLoop::InvalidationRecord* ir,
const typename SignalType::slot_function_type& slot,
PBD::EventLoop* event_loop) {
@ -167,7 +166,7 @@ public:
clist.add_connection (_signal.connect (slot));
}
void connect_same_thread (Connection& c,
void connect_same_thread (ScopedConnection& c,
const typename SignalType::slot_function_type& slot) {
c = _signal.connect (slot);
}
@ -185,7 +184,7 @@ public:
clist.add_connection (_signal.connect (boost::bind (&compositor, slot, event_loop, ir, _1, _2)));
}
void connect (Connection& c,
void connect (ScopedConnection& c,
PBD::EventLoop::InvalidationRecord* ir,
const typename SignalType::slot_function_type& slot,
PBD::EventLoop* event_loop) {
@ -213,7 +212,7 @@ public:
clist.add_connection (_signal.connect (slot));
}
void connect_same_thread (Connection& c,
void connect_same_thread (ScopedConnection& c,
const typename SignalType::slot_function_type& slot) {
c = _signal.connect (slot);
}
@ -231,7 +230,7 @@ public:
clist.add_connection (_signal.connect (boost::bind (&compositor, slot, event_loop, ir, _1, _2, _3)));
}
void connect (Connection& c,
void connect (ScopedConnection& c,
PBD::EventLoop::InvalidationRecord* ir,
const typename SignalType::slot_function_type& slot,
PBD::EventLoop* event_loop) {
@ -259,7 +258,7 @@ public:
clist.add_connection (_signal.connect (slot));
}
void connect_same_thread (Connection& c,
void connect_same_thread (ScopedConnection& c,
const typename SignalType::slot_function_type& slot) {
c = _signal.connect (slot);
}
@ -277,7 +276,7 @@ public:
clist.add_connection (_signal.connect (boost::bind (&compositor, slot, event_loop, ir, _1, _2, _3, _4)));
}
void connect (Connection& c,
void connect (ScopedConnection& c,
PBD::EventLoop::InvalidationRecord* ir,
const typename SignalType::slot_function_type& slot,
PBD::EventLoop* event_loop) {

View file

@ -94,7 +94,7 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol {
typedef std::list<MIDIFunction*> MIDIFunctions;
MIDIFunctions functions;
typedef std::pair<MIDIControllable*,PBD::Connection> MIDIPendingControllable;
typedef std::pair<MIDIControllable*,PBD::ScopedConnection> MIDIPendingControllable;
typedef std::list<MIDIPendingControllable* > MIDIPendingControllables;
MIDIPendingControllables pending_controllables;
Glib::Mutex controllables_lock;