merge keybindings/menus from SAE; report duplicate port errors during session loading...
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 7 Jan 2008 20:14:16 +0000 (20:14 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 7 Jan 2008 20:14:16 +0000 (20:14 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2834 d708f5d6-7413-0410-9779-e7cbd77b26cf

13 files changed:
gtk2_ardour/ardour.bindings.in
gtk2_ardour/ardour.menus
gtk2_ardour/ardour_ui.cc
libs/ardour/ardour/audioengine.h
libs/ardour/ardour/io.h
libs/ardour/ardour/route.h
libs/ardour/audio_diskstream.cc
libs/ardour/audioengine.cc
libs/ardour/io.cc
libs/ardour/route.cc
libs/ardour/session_butler.cc
libs/ardour/session_state.cc
libs/gtkmm2ext/gtk_ui.cc

index c07f3d4ff56f4c572fc27436ced8313b8a19b7ef..a171e903496656c2301aac037ba019cd47dd006a 100644 (file)
@@ -9,7 +9,8 @@
 ; (gtk_accel_path "<Actions>/JACK/JACKReconnect" "")
 ; (gtk_accel_path "<Actions>/Editor/Autoconnect" "")
 ; (gtk_accel_path "<Actions>/Editor/Edit" "")
-(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-end" "<%PRIMARY%>comma")
+(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary" "comma")
+(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-sync" "<%PRIMARY%>comma")
 ; (gtk_accel_path "<Actions>/redirectmenu/copy" "")
 ; (gtk_accel_path "<Actions>/options/MeterFalloffFaster" "")
 (gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<%PRIMARY%>space")
@@ -24,7 +25,7 @@
 ; (gtk_accel_path "<Actions>/options/MeterFalloffSlow" "")
 ; (gtk_accel_path "<Actions>/RegionList/rlHide" "")
 ; (gtk_accel_path "<Actions>/Main/Metering" "")
-(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-end" "<%PRIMARY%>period")
+(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-sync" "<%PRIMARY%>period")
 ; (gtk_accel_path "<Actions>/Zoom/zoom-focus-playhead" "")
 ; (gtk_accel_path "<Actions>/Editor/center-edit-cursor" "")
 ; (gtk_accel_path "<Actions>/Editor/Monitoring" "")
@@ -84,7 +85,6 @@
 (gtk_accel_path "<Actions>/Editor/undo" "<%PRIMARY%>z")
 (gtk_accel_path "<Actions>/Editor/insert-region" "i")
 ; (gtk_accel_path "<Actions>/Editor/center-playhead" "")
-(gtk_accel_path "<Actions>/Editor/edit-cursor-to-next-region-start" "bracketright")
 ; (gtk_accel_path "<Actions>/Snap/snap-to-region-start" "")
 ; (gtk_accel_path "<Actions>/Editor/View" "")
 ; (gtk_accel_path "<Actions>/Editor/Layering" "")
@@ -93,7 +93,6 @@
 (gtk_accel_path "<Actions>/Editor/set-edit-point" "e")
 ; (gtk_accel_path "<Actions>/Editor/Smpte30drop" "")
 ; (gtk_accel_path "<Actions>/Zoom/zoom-focus-edit" "")
-(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-start" "comma")
 ; (gtk_accel_path "<Actions>/Editor/EditCursorMovementOptions" "")
 ; (gtk_accel_path "<Actions>/redirectmenu/activate_all" "")
 ; (gtk_accel_path "<Actions>/redirectmenu/paste" "")
 ; (gtk_accel_path "<Actions>/Main/CleanupUnused" "")
 ; (gtk_accel_path "<Actions>/redirectmenu/deselectall" "")
 ; (gtk_accel_path "<Actions>/options/SoloViaBus" "")
-(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-zoom" "z")
+(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-zoom" "<Shift>z")
 ; (gtk_accel_path "<Actions>/RegionList/rlAudition" "")
 (gtk_accel_path "<Actions>/Editor/set-region-sync-position" "v")
 ; (gtk_accel_path "<Actions>/Editor/PullupPlus4Plus1" "")
 ; (gtk_accel_path "<Actions>/options/VerifyRemoveLastCapture" "")
 ; (gtk_accel_path "<Actions>/options/OutputAutoConnectPhysical" "")
 (gtk_accel_path "<Actions>/Editor/step-tracks-up" "uparrow")
-(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-start" "period")
+(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary" "period")
 ; (gtk_accel_path "<Actions>/options/SendMMC" "")
 ; (gtk_accel_path "<Actions>/Editor/toggle-auto-xfades" "")
 ; (gtk_accel_path "<Actions>/Main/AudioFileFormatHeader" "")
 ; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurfaceFeedback" "")
 ; (gtk_accel_path "<Actions>/Editor/PullupPlus4Minus1" "")
 ; (gtk_accel_path "<Actions>/JACK/JACKLatency512" "")
-(gtk_accel_path "<Actions>/Editor/edit-cursor-to-next-region-end" "<%PRIMARY%>bracketright")
 ; (gtk_accel_path "<Actions>/Main/Recent" "")
 ; (gtk_accel_path "<Actions>/redirectmenu/newplugin" "")
 ; (gtk_accel_path "<Actions>/options/InputAutoConnectManual" "")
 (gtk_accel_path "<Actions>/Editor/goto-mark-9" "KP_9")
 (gtk_accel_path "<Actions>/Transport/ToggleClick" "5")
 (gtk_accel_path "<Actions>/Transport/ToggleAutoReturn" "4")
+(gtk_accel_path "<Actions>/Transport/focus-on-clock" "KP_Divide")
+(gtk_accel_path "<Actions>/Editor/set-loop-from-edit-range" "bracketright")
+(gtk_accel_path "<Actions>/Editor/set-punch-from-edit-range" "bracketleft")
+(gtk_accel_path "<Actions>/Editor/set-loop-from-region" "<%PRIMARY%><%SECONDARY%>bracketright")
+(gtk_accel_path "<Actions>/Editor/toggle-zoom" "<%TERTIARY%>z")
+(gtk_accel_path "<Actions>/Editor/zoom-to-region" "z")
index a60e52561e3a1831821b8765af13b2b229021eba..9e70e65e60103af6ef27a9e658739087d80beae5 100644 (file)
         </menu>
         <menu name='Transport' action='Transport'>
                <menuitem action='ToggleRoll'/>
+               <menuitem action='play-from-edit-point-and-return'/>
+               <menuitem action='play-edit-range'/>
+               <menuitem action='record-roll'/>
                <menuitem action='ToggleRollForgetCapture'/>
                <menuitem action='Loop'/>
+               <menuitem action='loop-region'/>
                <menuitem action='PlaySelection'/>
                <menuitem action='play-edit-range'/>
                <menuitem action='Forward'/>
                <menuitem action='jump-backward-to-mark'/>
                <menuitem action='add-location-from-playhead'/>
                <separator/> 
-               <menuitem action='playhead-to-next-region-start'/>
-               <menuitem action='playhead-to-next-region-end'/>
-               <menuitem action='playhead-to-previous-region-start'/>
-               <menuitem action='playhead-to-previous-region-end'/>
+               <menuitem action='playhead-to-next-region-boundary'/>
+               <menuitem action='playhead-to-previous-region-boundary'/>
                <menuitem action='playhead-to-next-region-sync'/>
                <menuitem action='playhead-to-previous-region-sync'/>
                <menuitem action='center-playhead'/>
@@ -82,6 +84,9 @@
                     <menuitem action='toggle-follow-playhead'/>
                     <menuitem action='ToggleVideoSync'/>
                </menu>
+              <menuitem action='set-loop-from-edit-range'/>
+              <menuitem action='set-loop-from-region'/>
+              <menuitem action='set-punch-from-edit-range'/>
        </menu>
        <menu name='Edit' action='Edit'>
                <menuitem action='undo'/>
                        <menuitem action='set-mouse-mode-timefx'/>
                        <separator/>
                        <menuitem action='cycle-edit-point'/>
+                       <menuitem action='cycle-edit-point-with-marker'/>
                        <menuitem action='toggle-edit-mode'/>
           </menu>
         </menu>         
                    <menuitem action='select-all-within-cursors'/>
                    <menuitem action='select-all-in-punch-range'/>
                    <menuitem action='select-all-in-loop-range'/>
+                  <separator/>
+                   <menuitem action='select-next-route'/>
+                   <menuitem action='select-prev-route'/>
        </menu>
        <menu name='Regions' action='Regions'>
                    <menuitem action='crop'/>
                    <separator/>       
                   <menuitem action='set-fade-in-length'/>
                   <menuitem action='set-fade-out-length'/>
+                  <menuitem action='toggle-fade-in-active'/>
+                  <menuitem action='toggle-fade-out-active'/>
                    <separator/>       
                   <menuitem action='trim-back'/>
                   <menuitem action='trim-front'/>
                   <menuitem action='trim-to-end'/>
                   <menuitem action='trim-region-to-loop'/>
                   <menuitem action='trim-region-to-punch'/>
+                  <separator/>
+                  <menuitem action='pitch-shift-region'/>
        </menu>
         <menu name='View' action = 'View'>
                <menu name='ZoomFocus' action='ZoomFocus'>
                   <menuitem action='snap-magnetic'/>
                   <separator/>
                   <menuitem action='cycle-snap-mode'/>
+                  <menuitem action='cycle-snap-choice'/>
               </menu>
                <menu name='SnapTo' action='SnapTo'>
                   <menuitem action='snap-to-cd-frame'/>
                <menuitem action='temporal-zoom-in'/>
                <menuitem action='temporal-zoom-out'/>
                <menuitem action='zoom-to-session'/>
+               <menuitem action='zoom-to-region'/>
+               <menuitem action='toggle-zoom'/>
                <menuitem action='scroll-tracks-down'/>
                <menuitem action='scroll-tracks-up'/>
                <menuitem action='scroll-tracks-down'/>
index a557f08ca9575b70a27c644b117596dea7aa9f15..ab3d5e5e8cc68dd4a420aa4e31d8537dbcb95a8d 100644 (file)
@@ -2444,7 +2444,35 @@ ARDOUR_UI::load_session (const Glib::ustring& path, const Glib::ustring& snap_na
                new_session = new Session (*engine, path, snap_name, mix_template);
        }
 
+       /* this one is special */
+
+       catch (AudioEngine::PortRegistrationFailure& err) {
+
+               MessageDialog msg (err.what(),
+                                  true,
+                                  Gtk::MESSAGE_INFO,
+                                  Gtk::BUTTONS_OK_CANCEL);
+               
+               msg.set_title (_("Loading Error"));
+               msg.set_secondary_text (_("Click the OK button to try again."));
+               msg.set_position (Gtk::WIN_POS_CENTER);
+               msg.present ();
+
+               int response = msg.run ();
+
+               msg.hide ();
+
+               switch (response) {
+               case RESPONSE_CANCEL:
+                       exit (1);
+               default:
+                       break;
+               }
+               goto out;
+       }
+
        catch (...) {
+               cerr << "Caught something\n";
                MessageDialog msg (string_compose(_("Session \"%1 (snapshot %2)\" did not load successfully"), path, snap_name),
                                   true,
                                   Gtk::MESSAGE_INFO,
index d13c4e92517a115c3f142798dd5c27939150aeb4..3329a036e428b5cbb86393c8ae58eb412f363dd2 100644 (file)
@@ -103,7 +103,13 @@ class AudioEngine : public sigc::trackable
 
        class PortRegistrationFailure : public std::exception {
          public:
-               virtual const char *what() const throw() { return "failed port registration"; }
+               PortRegistrationFailure (const char* why) {
+                       reason = why;
+               }
+               virtual const char *what() const throw() { return reason; }
+
+         private:
+               const char* reason;
        };
 
        class NoBackendAvailable : public std::exception {
@@ -227,6 +233,8 @@ class AudioEngine : public sigc::trackable
 
        std::string get_nth_physical_audio (uint32_t which, int flags);
 
+       void port_registration_failure (const std::string& portname);
+
        static int  _xrun_callback (void *arg);
        static int  _graph_order_callback (void *arg);
        static int  _process_callback (nframes_t nframes, void *arg);
index a5a6ebd20edaddae0b04cbb66339873269518f3f..1bd913aec9bb832338f03c7e433460c077879a62 100644 (file)
@@ -72,6 +72,9 @@ class IO : public PBD::StatefulDestructible
 
        virtual ~IO();
 
+       bool active() const { return _active; }
+       void set_active (bool yn);
+
        int input_minimum() const { return _input_minimum; }
        int input_maximum() const { return _input_maximum; }
        int output_minimum() const { return _output_minimum; }
@@ -158,6 +161,8 @@ class IO : public PBD::StatefulDestructible
        uint32_t n_inputs () const { return _ninputs; }
        uint32_t n_outputs () const { return _noutputs; }
 
+       sigc::signal<void>                active_changed;
+
        sigc::signal<void,IOChange,void*> input_changed;
        sigc::signal<void,IOChange,void*> output_changed;
 
@@ -210,39 +215,41 @@ class IO : public PBD::StatefulDestructible
        void reset_max_peak_meters ();
 
        
-    static void update_meters();
+       static void update_meters();
 
   private: 
 
-    static sigc::signal<void>   Meter;
-    static Glib::StaticMutex    m_meter_signal_lock;
-    sigc::connection            m_meter_connection;
+       static sigc::signal<void>   Meter;
+       static Glib::StaticMutex    m_meter_signal_lock;
+       sigc::connection            m_meter_connection;
 
   public:
 
-       /* automation */
-
-       static void set_automation_interval (jack_nframes_t frames) {
-               _automation_interval = frames;
-       }
-
-       static jack_nframes_t automation_interval() { 
-               return _automation_interval;
-       }
-
-       void clear_automation ();
+         bool                     _active;
 
-       bool gain_automation_recording() const { 
-               return (_gain_automation_curve.automation_state() & (Write|Touch));
-       }
-
-       bool gain_automation_playback() const {
-               return (_gain_automation_curve.automation_state() & Play) ||
-                       ((_gain_automation_curve.automation_state() & Touch) && 
-                        !_gain_automation_curve.touching());
-       }
+        /* automation */
+        
+        static void set_automation_interval (jack_nframes_t frames) {
+                _automation_interval = frames;
+        }
+        
+        static jack_nframes_t automation_interval() { 
+                return _automation_interval;
+        }
+        
+        void clear_automation ();
+        
+        bool gain_automation_recording() const { 
+                return (_gain_automation_curve.automation_state() & (Write|Touch));
+        }
+        
+        bool gain_automation_playback() const {
+                return (_gain_automation_curve.automation_state() & Play) ||
+                        ((_gain_automation_curve.automation_state() & Touch) && 
+                         !_gain_automation_curve.touching());
+        }
 
-       virtual void set_gain_automation_state (AutoState);
+        virtual void set_gain_automation_state (AutoState);
        AutoState gain_automation_state() const { return _gain_automation_curve.automation_state(); }
        sigc::signal<void> gain_automation_state_changed;
 
index a0f5319576acd35fe698b613258d0b173c7a0e2a..5b927d255fa7eb3a79b3ef31583a11a754e521aa 100644 (file)
@@ -109,9 +109,6 @@ class Route : public IO
        void set_gain (gain_t val, void *src);
        void inc_gain (gain_t delta, void *src);
 
-       bool active() const { return _active; }
-       void set_active (bool yn);
-
        void set_solo (bool yn, void *src);
        bool soloed() const { return _soloed; }
 
@@ -193,7 +190,6 @@ class Route : public IO
        sigc::signal<void,void*> record_enable_changed;
        sigc::signal<void,void*> edit_group_changed;
        sigc::signal<void,void*> mix_group_changed;
-       sigc::signal<void>       active_changed;
        sigc::signal<void,void*> meter_change;
 
        /* gui's call this for their own purposes. */
@@ -267,7 +263,6 @@ class Route : public IO
        bool                     _phase_invert : 1;
        bool                     _denormal_protection : 1;
        bool                     _recordable : 1;
-       bool                     _active : 1;
        bool                     _mute_affects_pre_fader : 1;
        bool                     _mute_affects_post_fader : 1;
        bool                     _mute_affects_control_outs : 1;
index 346e973376971013b6c9222850ad835c3c81e931..7931200714e16dbf4b2edc8bf9d5371b786c8ae3 100644 (file)
@@ -847,10 +847,18 @@ AudioDiskstream::commit (nframes_t nframes)
        }
        
        if (_slaved) {
-               need_butler = c->front()->playback_buf->write_space() >= c->front()->playback_buf->bufsize() / 2;
+               if (_io && _io->active()) {
+                       need_butler = c->front()->playback_buf->write_space() >= c->front()->playback_buf->bufsize() / 2;
+               } else {
+                       need_butler = false;
+               }
        } else {
-               need_butler = c->front()->playback_buf->write_space() >= disk_io_chunk_frames
-                       || c->front()->capture_buf->read_space() >= disk_io_chunk_frames;
+               if (_io && _io->active()) {
+                       need_butler = c->front()->playback_buf->write_space() >= disk_io_chunk_frames
+                               || c->front()->capture_buf->read_space() >= disk_io_chunk_frames;
+               } else {
+                       need_butler = c->front()->capture_buf->read_space() >= disk_io_chunk_frames;
+               }
        }
 
        if (commit_should_unlock) {
index 1b6756e6fa8dc8f52375369c34118d6af936d117..2d8d225630afbc78469aa9e4b8af5810bad711a7 100644 (file)
@@ -481,6 +481,26 @@ AudioEngine::remove_session ()
        remove_all_ports ();
 }
 
+void
+AudioEngine::port_registration_failure (const std::string& portname)
+{
+       string full_portname = jack_client_name;
+       full_portname += ':';
+       full_portname += portname;
+       
+       
+       jack_port_t* p = jack_port_by_name (_jack, full_portname.c_str());
+       string reason;
+       
+       if (p) {
+               reason = _("a port with this name already exists: check for duplicated track/bus names");
+       } else {
+               reason = _("unknown error");
+       }
+       
+       throw PortRegistrationFailure (string_compose (_("AudioEngine: cannot register port \"%1\": %2"), portname, reason).c_str());
+}      
+
 Port *
 AudioEngine::register_input_port (DataType type, const string& portname)
 {
@@ -509,7 +529,7 @@ AudioEngine::register_input_port (DataType type, const string& portname)
                return newport;
 
        } else {
-               throw PortRegistrationFailure();
+               port_registration_failure (portname);
        }
 
        return 0;
@@ -547,7 +567,7 @@ AudioEngine::register_output_port (DataType type, const string& portname)
                return newport;
 
        } else {
-               throw PortRegistrationFailure ();
+               port_registration_failure (portname);
        }
 
        return 0;
index 4f207172ca8be1cd418eae6b41609c6d0708c37c..cc5c812af85b42b657751d00b515103a781ec509 100644 (file)
@@ -113,6 +113,7 @@ IO::IO (Session& s, string name,
          _output_maximum (output_max)
 {
        _panner = new Panner (name, _session);
+       _active = true;
        _gain = 1.0;
        _desired_gain = 1.0;
        _input_connection = 0;
@@ -148,6 +149,7 @@ IO::IO (Session& s, const XMLNode& node, DataType dt)
          _gain_automation_curve (0, 0, 0) // all reset in set_state()
 {
        _panner = 0;
+       _active = true;
        deferred_state = 0;
        no_panner_reset = false;
        _desired_gain = 1.0;
@@ -1088,7 +1090,7 @@ IO::ensure_inputs_locked (uint32_t n, bool clear, void* src)
                        setup_peak_meters ();
                        reset_panner ();
                        /* pass it on */
-                       throw AudioEngine::PortRegistrationFailure();
+                       throw;
                }
                
                _inputs.push_back (input_port);
@@ -1193,7 +1195,7 @@ IO::ensure_io (uint32_t nin, uint32_t nout, bool clear, void* src)
                                setup_peak_meters ();
                                reset_panner ();
                                /* pass it on */
-                               throw AudioEngine::PortRegistrationFailure();
+                               throw;
                        }
                
                        _inputs.push_back (port);
@@ -1226,7 +1228,7 @@ IO::ensure_io (uint32_t nin, uint32_t nout, bool clear, void* src)
                                setup_peak_meters ();
                                reset_panner ();
                                /* pass it on */
-                               throw AudioEngine::PortRegistrationFailure ();
+                               throw;
                        }
                
                        _outputs.push_back (port);
@@ -1469,6 +1471,7 @@ IO::state (bool full_state)
        node->add_property("name", _name);
        id().print (buf, sizeof (buf));
        node->add_property("id", buf);
+       node->add_property("active", _active? "yes" : "no");
 
        str = "";
 
@@ -1621,6 +1624,10 @@ IO::set_state (const XMLNode& node)
                /* old school automation handling */
        }
 
+       if ((prop = node.property (X_("active"))) != 0) {
+               set_active (prop->value() == "yes");
+       }
+
        for (iter = node.children().begin(); iter != node.children().end(); ++iter) {
 
                if ((*iter)->name() == "Panner") {
@@ -2718,3 +2725,11 @@ IO::find_output_port_hole ()
        
        return n;
 }
+
+void
+IO::set_active (bool yn)
+{
+       _active = yn; 
+        active_changed(); /* EMIT SIGNAL */
+}
+
index d6df1c2a2bd53fad989d19c4bb7aff329ff8df76..34602bf2daaa891f23d34bb0ba778ec93bf13867 100644 (file)
@@ -79,7 +79,6 @@ Route::init ()
        _phase_invert = false;
        _denormal_protection = false;
        order_keys[strdup (N_("signal"))] = order_key_cnt++;
-       _active = true;
        _silent = false;
        _meter_point = MeterPostFader;
        _initial_delay = 0;
@@ -1455,7 +1454,6 @@ Route::state(bool full_state)
        
        node->add_property("default-type", _default_type.to_string());
 
-       node->add_property("active", _active?"yes":"no");
        node->add_property("muted", _muted?"yes":"no");
        node->add_property("soloed", _soloed?"yes":"no");
        node->add_property("phase-invert", _phase_invert?"yes":"no");
@@ -1641,10 +1639,6 @@ Route::_set_state (const XMLNode& node, bool call_base)
                set_denormal_protection (prop->value()=="yes"?true:false, this);
        }
 
-       if ((prop = node.property (X_("active"))) != 0) {
-               set_active (prop->value() == "yes");
-       }
-
        if ((prop = node.property (X_("muted"))) != 0) {
                bool yn = prop->value()=="yes"?true:false; 
 
@@ -2176,13 +2170,6 @@ Route::get_mute_config (mute_type t)
        return onoff;
 }
 
-void
-Route::set_active (bool yn)
-{
-       _active = yn; 
-        active_changed(); /* EMIT SIGNAL */
-}
-
 void
 Route::handle_transport_stopped (bool abort_ignored, bool did_locate, bool can_flush_redirects)
 {
index afb284b0f49a4ab549eee18002894b8929c11e2f..eba5e65525d24dc06a95b935300d1e1b10caa8ab 100644 (file)
@@ -233,10 +233,6 @@ Session::butler_thread_work ()
                        }
                }
 
-               //for (i = diskstreams.begin(); i != diskstreams.end(); ++i) {
-                       // cerr << "BEFORE " << (*i)->name() << ": pb = " << (*i)->playback_buffer_load() << " cp = " << (*i)->capture_buffer_load() << endl;
-               //}
-
                if (transport_work_requested()) {
                        butler_transport_work ();
                }
@@ -249,10 +245,23 @@ Session::butler_thread_work ()
 
                boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader ();
 
+//             for (i = dsl->begin(); i != dsl->end(); ++i) {
+//                     cerr << "BEFORE " << (*i)->name() << ": pb = " << (*i)->playback_buffer_load() << " cp = " << (*i)->capture_buffer_load() << endl;
+//             }
+
                for (i = dsl->begin(); !transport_work_requested() && butler_should_run && i != dsl->end(); ++i) {
 
                        boost::shared_ptr<Diskstream> ds = *i;
 
+                       /* don't read inactive tracks */
+
+                       IO* io = ds->io();
+                       
+                       if (ds->io() && !ds->io()->active()) {
+                               cerr << "Skip inactive diskstream " << ds->io()->name() << endl;
+                               continue;
+                       }
+
                        switch (ds->do_refill ()) {
                        case 0:
                                bytes += ds->read_data_count();
@@ -294,6 +303,9 @@ Session::butler_thread_work ()
 
                for (i = dsl->begin(); !transport_work_requested() && butler_should_run && i != dsl->end(); ++i) {
                        // cerr << "write behind for " << (*i)->name () << endl;
+
+                       /* note that we still try to flush diskstreams attached to inactive routes
+                        */
                        
                        switch ((*i)->do_flush (Session::ButlerContext)) {
                        case 0:
index f4fceb1d91d1575153de7b419fd543ccc7da4e94..03428f6035315ab273a50f11abd1fc9c70989e4a 100644 (file)
@@ -323,11 +323,10 @@ Session::second_stage_init (bool new_session)
        }
 
        /* handle this one in a different way than all others, so that its clear what happened */
-       
+
        catch (AudioEngine::PortRegistrationFailure& err) {
-               error << _("Unable to create all required ports")
-                     << endmsg;
-               return -1;
+               destroy ();
+               throw;
        }
 
        catch (...) {
index 8622aae9b4584bc9c153bcd06120ac15051e21ef..eed78e1fdb5620893bcdf845d3f9ace2b671d589 100644 (file)
@@ -560,19 +560,17 @@ UI::handle_fatal (const char *message)
 void
 UI::popup_error (const char *text)
 {
-       PopUp *pup;
-
        if (!caller_is_ui_thread()) {
                error << "non-UI threads can't use UI::popup_error" 
                      << endmsg;
                return;
        }
-       
-       pup = new PopUp (WIN_POS_MOUSE, 0, true);
-       pup->set_text (text);
-       pup->touch ();
-}
 
+       MessageDialog msg (text, true, MESSAGE_ERROR, BUTTONS_OK);
+       msg.set_title (_("Error"));
+       msg.set_position (WIN_POS_MOUSE);
+       msg.run ();
+}
 
 void
 UI::flush_pending ()