diff options
author | Torben Hohn <torbenh@gmx.de> | 2010-06-02 16:21:02 +0000 |
---|---|---|
committer | Torben Hohn <torbenh@gmx.de> | 2010-06-02 16:21:02 +0000 |
commit | 51ad790745400eeb38547fa4de842202fec934b8 (patch) | |
tree | 6532300509bf85246573699c71c00ec25bc0b57b /libs/ardour | |
parent | b65fe35f675293fb31e0b1a34cb6ac541773edc0 (diff) |
add -P flag blocking port connections while loading session
git-svn-id: svn://localhost/ardour2/branches/3.0@7213 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/port.h | 8 | ||||
-rw-r--r-- | libs/ardour/port.cc | 4 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 3 |
3 files changed, 15 insertions, 0 deletions
diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h index cc37bf0821..3a677d293f 100644 --- a/libs/ardour/ardour/port.h +++ b/libs/ardour/ardour/port.h @@ -56,6 +56,13 @@ public: static void set_buffer_size (nframes_t sz) { _buffer_size = sz; } + static void set_connecting_blocked( bool yn ) { + _connecting_blocked = yn; + } + static bool connecting_blocked() { + return _connecting_blocked; + } + /** @return Port short name */ std::string name () const { @@ -130,6 +137,7 @@ protected: static nframes_t _port_offset; static nframes_t _buffer_size; + static bool _connecting_blocked; static AudioEngine* _engine; ///< the AudioEngine diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc index 9cbdd14172..6ae0c5d92b 100644 --- a/libs/ardour/port.cc +++ b/libs/ardour/port.cc @@ -36,6 +36,7 @@ using namespace ARDOUR; AudioEngine* Port::_engine = 0; nframes_t Port::_port_offset = 0; nframes_t Port::_buffer_size = 0; +bool Port::_connecting_blocked = false; /** @param n Port short name */ Port::Port (std::string const & n, DataType t, Flags f) @@ -116,6 +117,9 @@ Port::connect (std::string const & other) int r = 0; + if (_connecting_blocked) + return r; + if (sends_output ()) { r = jack_connect (_engine->jack (), this_shrt.c_str (), other_shrt.c_str ()); } else { diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 2b3bd39b6a..19b8b58fbe 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -92,6 +92,7 @@ #include "ardour/midi_track.h" #include "ardour/named_selection.h" #include "ardour/processor.h" +#include "ardour/port.h" #include "ardour/region_factory.h" #include "ardour/route_group.h" #include "ardour/send.h" @@ -365,6 +366,8 @@ Session::second_stage_init () _state_of_the_state = Clean; + Port::set_connecting_blocked (false); + DirtyChanged (); /* EMIT SIGNAL */ if (state_was_pending) { |