diff --git a/mixer/src/JACK_Module.C b/mixer/src/JACK_Module.C index 65dbf84..3f5dba3 100644 --- a/mixer/src/JACK_Module.C +++ b/mixer/src/JACK_Module.C @@ -301,9 +301,9 @@ JACK_Module::update_connection_status ( void ) return; } - /* causes a lot of unnecessary redraws to do this when loading */ - if ( Project::is_opening() ) - return; + /* /\* causes a lot of unnecessary redraws to do this when loading *\/ */ + /* if ( Project::is_opening_closing() ) */ + /* return; */ /* FIXME: only do something if port list actually changed! */ std::list output_names = get_connections_for_ports( aux_audio_output ); diff --git a/mixer/src/Mixer.C b/mixer/src/Mixer.C index b01b5fb..08361c7 100644 --- a/mixer/src/Mixer.C +++ b/mixer/src/Mixer.C @@ -1099,7 +1099,7 @@ int Mixer::handle ( int m ) { /* if user presses certain keys when project is loading it can cause a crash. Don't respond to input. */ - if ( Project::is_opening() ) + if ( Project::is_opening_closing() ) return 0; if ( Fl_Group::handle( m ) ) @@ -1179,7 +1179,7 @@ Mixer::get_auto_connect_targets ( void ) void Mixer::auto_connect ( void ) { - if ( Project::is_opening() ) + if ( Project::is_opening_closing() ) /* it's more efficient to do this once at the end rather than as we go. */ return; @@ -1207,7 +1207,7 @@ Mixer::auto_connect ( void ) void Mixer::maybe_auto_connect_output ( Module::Port *p ) { - if ( Project::is_opening() ) + if ( Project::is_opening_closing() ) /* it's more efficient to do this once at the end rather than as we go. */ return; @@ -1223,7 +1223,7 @@ Mixer::maybe_auto_connect_output ( Module::Port *p ) return; } - /* now do that catch-alls, first one wins! */ + /* now do the catch-alls, first one wins! */ for ( int i = 0; i < mixer_strips->children(); i++ ) { Mixer_Strip *s = ((Mixer_Strip*)mixer_strips->child(i)); diff --git a/mixer/src/Mixer_Strip.C b/mixer/src/Mixer_Strip.C index ade7c33..371672f 100644 --- a/mixer/src/Mixer_Strip.C +++ b/mixer/src/Mixer_Strip.C @@ -1036,18 +1036,17 @@ Mixer_Strip::maybe_auto_connect_output ( Module::Port *p ) if ( ! _auto_input ) { - /* break any previous connection between this port and this module */ + /* not accepting auto inputs, so ensure all previous auto + input connection are broken and ignore this port. */ p->disconnect_from_strip(this); + return false; } - if ( _auto_input && matches_pattern( _auto_input, p ) ) + if ( _auto_input && + matches_pattern( _auto_input, p ) ) { - /* FIXME: would be faster if we avoided breaking and remaking - * the same connections, while still breaking connections that - * will not be remade */ + /* got a match, add this to list of accepted connections */ - /* break any prior auto-connection */ - p->disconnect(); // FIXME: Find a better way to get the port index. diff --git a/mixer/src/Module.C b/mixer/src/Module.C index 115db7b..dfb4381 100644 --- a/mixer/src/Module.C +++ b/mixer/src/Module.C @@ -1314,10 +1314,10 @@ Module::auto_disconnect_outputs ( void ) { Module::Port *p = &aux_audio_output[i]; - if ( p->connected_port() ) + while ( p->connected() ) { - p->connected_port()->jack_port()->disconnect( p->jack_port()->jack_name() ); - p->disconnect(); + p->connected_port()->jack_port()->disconnect( p->jack_port()->jack_name() ); + p->disconnect(p->connected_port()); } } } diff --git a/mixer/src/Project.C b/mixer/src/Project.C index 777704c..a629a31 100644 --- a/mixer/src/Project.C +++ b/mixer/src/Project.C @@ -58,7 +58,7 @@ char Project::_name[256]; char Project::_created_on[40]; char Project::_path[512]; bool Project::_is_open = false; -bool Project::_is_opening = false; +bool Project::_is_opening_closing = false; int Project::_lockfd = 0; @@ -193,6 +193,8 @@ Project::close ( void ) if ( ! save() ) return false; + Project::_is_opening_closing = true; + Loggable::close(); /* // write_info(); */ @@ -203,6 +205,8 @@ Project::close ( void ) release_lock( &_lockfd, ".lock" ); + Project::_is_opening_closing = false; + return true; } @@ -262,7 +266,7 @@ Project::open ( const char *name ) if ( version != PROJECT_VERSION ) return E_VERSION; - _is_opening = true; + _is_opening_closing = true; if ( ! Loggable::replay( "snapshot" ) ) return E_INVALID; @@ -282,7 +286,7 @@ Project::open ( const char *name ) _is_open = true; - _is_opening = false; + _is_opening_closing = false; // tle->load_timeline_settings(); // timeline->zoom_fit(); diff --git a/mixer/src/Project.H b/mixer/src/Project.H index 42328dc..7f02752 100644 --- a/mixer/src/Project.H +++ b/mixer/src/Project.H @@ -27,7 +27,7 @@ class Project static int _lockfd; static bool _is_open; - static bool _is_opening; + static bool _is_opening_closing; static char _name[256]; static char _path[512]; static char _created_on[40]; @@ -62,5 +62,5 @@ public: static const char *path ( void ) { return _path; } static const char *created_on ( void ) { return _created_on; } - static const bool is_opening ( void ) { return _is_opening; } + static const bool is_opening_closing ( void ) { return _is_opening_closing; } };