nick m's fix for markers etc ; several tweaks for mute/solo ; rename run_in_place...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 10 Jun 2009 18:10:07 +0000 (18:10 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 10 Jun 2009 18:10:07 +0000 (18:10 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@5155 d708f5d6-7413-0410-9779-e7cbd77b26cf

27 files changed:
gtk2_ardour/editor_canvas.cc
gtk2_ardour/route_ui.cc
libs/ardour/amp.cc
libs/ardour/ardour/amp.h
libs/ardour/ardour/delivery.h
libs/ardour/ardour/io_processor.h
libs/ardour/ardour/meter.h
libs/ardour/ardour/plugin_insert.h
libs/ardour/ardour/port_insert.h
libs/ardour/ardour/processor.h
libs/ardour/ardour/return.h
libs/ardour/ardour/route.h
libs/ardour/ardour/send.h
libs/ardour/ardour/session.h
libs/ardour/audio_track.cc
libs/ardour/delivery.cc
libs/ardour/enums.cc
libs/ardour/io.cc
libs/ardour/meter.cc
libs/ardour/mute_master.cc
libs/ardour/plugin_insert.cc
libs/ardour/port_insert.cc
libs/ardour/return.cc
libs/ardour/route.cc
libs/ardour/send.cc
libs/ardour/session.cc
libs/ardour/session_state.cc

index 0c10ebf8c334a4d4ab3da2148c29584b2f033a34..146f756225a83e51b2fb2f7343d9314fb50990e0 100644 (file)
@@ -776,16 +776,17 @@ Editor::scroll_canvas_horizontally ()
        nframes64_t time_origin = (nframes64_t) floor (horizontal_adjustment.get_value() * frames_per_unit);
 
        /* horizontal scrolling only */
-       double x_delta;
+       double x1, y1, x2, y2, x_delta;
+       _master_group->get_bounds (x1, y1, x2, y2);
 
-       x_delta = (leftmost_frame - time_origin) / frames_per_unit;
+       x_delta = - (x1 +  horizontal_adjustment.get_value());
 
        _master_group->move (x_delta, 0);
        timebar_group->move (x_delta, 0);
        time_line_group->move (x_delta, 0);
        cursor_group->move (x_delta, 0);
 
-       leftmost_frame = time_origin;
+       leftmost_frame = (nframes64_t) floor (horizontal_adjustment.get_value() * frames_per_unit);
 
        update_fixed_rulers ();
        redisplay_tempo (true);
index b62229a70cdacb59a75f523286ec40477270452f..c5e11e5aab1fe0df48a186bf816e27a0a3caa519 100644 (file)
@@ -1127,7 +1127,7 @@ RouteUI::toggle_polarity ()
                ENSURE_GUI_THREAD(mem_fun (*this, &RouteUI::toggle_polarity));
                
                if ((x = polarity_menu_item->get_active()) != _route->phase_invert()) {
-                       _route->set_phase_invert (x, this);
+                       _route->set_phase_invert (x);
                        if (x) {
                                name_label.set_text (X_("Ø ") + name_label.get_text());
                        } else {
@@ -1140,7 +1140,11 @@ RouteUI::toggle_polarity ()
 void
 RouteUI::polarity_changed ()
 {
-       /* no signal for this yet */
+       if (_route->phase_invert()) {
+               name_label.set_text (X_("Ø ") + name_label.get_text());
+       } else {
+               name_label.set_text (_route->name());
+       }
 }
 
 void
@@ -1153,7 +1157,7 @@ RouteUI::toggle_denormal_protection ()
                ENSURE_GUI_THREAD(mem_fun (*this, &RouteUI::toggle_denormal_protection));
                
                if ((x = denormal_menu_item->get_active()) != _route->denormal_protection()) {
-                       _route->set_denormal_protection (x, this);
+                       _route->set_denormal_protection (x);
                }
        }
 }
@@ -1161,7 +1165,9 @@ RouteUI::toggle_denormal_protection ()
 void
 RouteUI::denormal_protection_changed ()
 {
-       /* no signal for this yet */
+       if (denormal_menu_item) {
+               denormal_menu_item->set_active (_route->denormal_protection());
+       }
 }
 
 void
index 755dc8b8212d7f197a7a86b9ea22517b92ed5ae9..154d90956073110ae5bdbce946c0d0be96dad1f8 100644 (file)
@@ -16,6 +16,7 @@
     675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include <iostream>
 #include <cstring>
 #include <cmath>
 #include <algorithm>
@@ -64,7 +65,7 @@ Amp::configure_io (ChanCount in, ChanCount out)
 }
 
 void
-Amp::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
+Amp::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
 {
        gain_t mute_gain;
 
@@ -137,25 +138,15 @@ Amp::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame,
                                Amp::apply_gain (bufs, nframes, _current_gain, dg);
                                _current_gain = dg;
                                
-                       } else if ((_current_gain != 0.0f) && (_current_gain != 1.0f)) {
+                       } else if (_current_gain != 1.0f) {
                                
-                               /* gain has not changed, but its non-unity, so apply it unless
-                                  its zero.
+                               /* gain has not changed, but its non-unity
                                */
 
                                for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) {
-                                       Sample* const sp = i->data();
-                                       apply_gain_to_buffer(sp, nframes, _current_gain);
+                                       apply_gain_to_buffer (i->data(), nframes, _current_gain);
                                }
-
-                       } else if (_current_gain == 0.0f) {
-                               
-                               /* silence! */
-
-                               for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) {
-                                       i->clear();
-                               }
-                       }
+                       } 
                }
        }
 }
index 03cc3d02f7fd187470e64fe76b63ccf1de9a9139..f758ca4de89906245a9c7625fa1ae50180b94437 100644 (file)
@@ -40,7 +40,7 @@ public:
        bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
        bool configure_io (ChanCount in, ChanCount out);
        
-       void run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
+       void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
 
        bool apply_gain() const  { return _apply_gain; }
        void apply_gain(bool yn) { _apply_gain = yn; }
index 645b601251b03cf216af71f89cf16cf7963c7a14..c875f23fcced815ca1cfabeb02c7e6bdbcd065fc 100644 (file)
@@ -50,7 +50,7 @@ public:
        bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
        bool configure_io (ChanCount in, ChanCount out);
 
-       void run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
+       void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
 
        /* supplemental method use with MIDI */
 
index 72be2c0743a3a80e2aa1fa3a296507b36ee5602b..14d88d6b442830ba90d391151b8a32467aedb4f1 100644 (file)
@@ -64,7 +64,6 @@ class IOProcessor : public Processor
        void set_input (boost::shared_ptr<IO>);
        void set_output (boost::shared_ptr<IO>);
        
-       void run_in_place (BufferSet& in, sframes_t start, sframes_t end, nframes_t nframes) = 0;
        void silence (nframes_t nframes);
 
        sigc::signal<void,IOProcessor*,bool>     AutomationPlaybackChanged;
index 43df5e936cf4e02ad9c38ffd0ae5d2380e21eea0..57afcc39cad3a125497faa96b502679bd7877a1b 100644 (file)
@@ -61,7 +61,7 @@ public:
        bool configure_io (ChanCount in, ChanCount out);
        
        /** Compute peaks */
-       void run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
+       void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
        
        float peak_power (uint32_t n) { 
                if (n < _visible_peak_power.size()) {
index 01cf9bedfdbd1bf984f11b3f580aa9976c71c4e9..2908803aab02742f12aae5bd0ba46037a996455c 100644 (file)
@@ -54,7 +54,7 @@ class PluginInsert : public Processor
        XMLNode& get_state(void);
        int set_state(const XMLNode&);
 
-       void run_in_place (BufferSet& in, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
+       void run (BufferSet& in, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
        void silence (nframes_t nframes);
        
        void activate ();
index fa9c31efe6a45aacc9c302465917f69061ca966f..7447c5b3e8485adba46d12c6ba2dce95497f521c 100644 (file)
@@ -51,7 +51,7 @@ class PortInsert : public IOProcessor
        XMLNode& get_state(void);
        int set_state(const XMLNode&);
 
-       void run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
+       void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
 
        nframes_t signal_latency() const;
 
index 61a266e9c5e333226fe032165f8ce7988361b332..06fcb81ce702c90a170dec8ef6435681a87658eb 100644 (file)
@@ -76,14 +76,7 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
        
        virtual void set_block_size (nframes_t nframes) {}
 
-       virtual void run_in_place (BufferSet& bufs,
-                                  sframes_t start_frame, sframes_t end_frame,
-                                  nframes_t nframes) { assert(is_in_place()); }
-       
-       virtual void run_out_of_place (BufferSet& input, BufferSet& output,
-                                      sframes_t start_frame, sframes_t end_frame,
-                                      nframes_t nframes) { assert(is_out_of_place()); }
-       
+       virtual void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes) {}
        virtual void silence (nframes_t nframes) {}
        
        void activate ()   { _active = true; ActiveChanged(); }
@@ -93,13 +86,6 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
 
        /* Derived classes should override these, or processor appears as an in-place pass-through */
 
-       /** In-place processors implement run_in_place and modify thee input buffer parameter */
-       virtual bool is_in_place () const { return true; }
-
-       /* Out-Of-Place processors implement run_out_of_place, don't modify the input parameter
-        * and write to their output parameter */
-       virtual bool is_out_of_place () const { return false; }
-
        virtual bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const = 0;
        virtual ChanCount input_streams () const { return _configured_input; }
        virtual ChanCount output_streams() const { return _configured_output; }
index 5c2a82e3aa6cf48f0b1565dbd682f616e1878020..3f75cc57b7335d2f5e46061491e9549a805e0b89 100644 (file)
@@ -44,7 +44,7 @@ public:
        
        uint32_t bit_slot() const { return _bitslot; }
 
-       void run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
+       void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
        
        boost::shared_ptr<Amp> amp() const { return _amp; }
        boost::shared_ptr<PeakMeter> meter() const { return _meter; }
index a2ad7165921fa8826b544d40c23a6d183a4f3c92..2a3580b1875cf542977426b35a9a58fd00482ed1 100644 (file)
@@ -129,10 +129,10 @@ class Route : public SessionObject, public AutomatableControls
        void set_solo_isolated (bool yn, void *src);
        bool solo_isolated() const;
        
-       void set_phase_invert (bool yn, void* src);
+       void set_phase_invert (bool yn);
        bool phase_invert() const;
 
-       void set_denormal_protection (bool yn, void* src);
+       void set_denormal_protection (bool yn);
        bool denormal_protection() const;
 
        void       set_edit_group (RouteGroup *, void *);
@@ -226,6 +226,8 @@ class Route : public SessionObject, public AutomatableControls
        nframes_t initial_delay() const { return _initial_delay; }
 
        sigc::signal<void>       active_changed;
+       sigc::signal<void>       phase_invert_changed;
+       sigc::signal<void>       denormal_protection_changed;
        sigc::signal<void,void*> solo_changed;
        sigc::signal<void,void*> solo_safe_changed;
        sigc::signal<void,void*> solo_isolated_changed;
index 302f512c9c71926f712fb4d8de4d2e2d54d2ddf5..3a0eae21e51409fb5c580dbdf727032cdf1a1bdc 100644 (file)
@@ -55,7 +55,7 @@ class Send : public Delivery
 
        uint32_t pans_required() const { return _configured_input.n_audio(); }
 
-       void run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
+       void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
 
        bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
 
index 614ab42eeba38e58cf0866576d9593971635bb95..2e161ff776d97531f6328192e4b218e1a2b798d9 100644 (file)
@@ -1466,13 +1466,12 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
        /* mixer stuff */
 
        bool       solo_update_disabled;
-       bool       currently_soloing;
 
        void route_mute_changed (void *src);
        void route_solo_changed (void *src, boost::weak_ptr<Route>);
        void catch_up_on_solo ();
        void catch_up_on_solo_mute_override ();
-       void update_route_solo_state ();
+       void update_route_solo_state (boost::shared_ptr<RouteList> r = boost::shared_ptr<RouteList>());
        void modify_solo_mute (bool, bool);
        void strip_portname_for_solo (std::string& portname);
 
index a41fdbe6b6d0a93b08d37f25f325d611c97dc898..1db11472059f168f10a03d68fa3e7e8769cbb1ba 100644 (file)
@@ -667,7 +667,7 @@ AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes
        for (i = _processors.begin(); i != _processors.end(); ++i) {
                boost::shared_ptr<Processor> processor;
                if ((processor = boost::dynamic_pointer_cast<Processor>(*i)) != 0) {
-                       processor->run_in_place (buffers, start, start+nframes, nframes);
+                       processor->run (buffers, start, start+nframes, nframes);
                }
        }
        
index 4d79aad2b97f6808d522a325a8ee5d55699dc191..0a49a47a7fc22bda1835ae1c25e1b36be0ef635a 100644 (file)
@@ -142,18 +142,22 @@ Delivery::configure_io (ChanCount in, ChanCount out)
 }
 
 void
-Delivery::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
+Delivery::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
 {
        if (_output->n_ports ().get (_output->default_type()) == 0) {
                return;
        }
 
+       /* this setup is not just for our purposes, but for anything that comes after us in the 
+          processing pathway that wants to use this->output_buffers() for some reason.
+       */
+
        PortSet& ports (_output->ports());
        output_buffers().attach_buffers (ports, nframes, _output_offset);
 
        // this Delivery processor is not a derived type, and thus we assume
        // we really can modify the buffers passed in (it is almost certainly
-       // the main output stage of a Route). Contrast with Send::run_in_place()
+       // the main output stage of a Route). Contrast with Send::run()
        // which cannot do this.
 
        gain_t tgain = target_gain ();
index 1d0f811aeaa0897a59d91ff071bb13cabafeeab8..6e98fdf5a71a480b36947a8420558edb30387f4e 100644 (file)
@@ -509,7 +509,7 @@ setup_enum_writer ()
        REGISTER_CLASS_ENUM (MuteMaster, PostFader);
        REGISTER_CLASS_ENUM (MuteMaster, Listen);
        REGISTER_CLASS_ENUM (MuteMaster, Main);
-       REGISTER (_MuteMaster_MutePoint);
+       REGISTER_BITS (_MuteMaster_MutePoint);
 
        REGISTER_CLASS_ENUM (IO, Input);
        REGISTER_CLASS_ENUM (IO, Output);
index 014c0056779332adb44304fb362e953fcbb3fa66..302a4cdfdbe86431e84a01cd5f7548d972933ace 100644 (file)
@@ -1280,7 +1280,7 @@ IO::process_input (boost::shared_ptr<Processor> proc, sframes_t start_frame, sfr
        /* don't read the data into new buffers - just use the port buffers directly */
 
        bufs.attach_buffers (_ports, nframes, 0);
-       proc->run_in_place (bufs, start_frame, end_frame, nframes);
+       proc->run (bufs, start_frame, end_frame, nframes);
 }
 
 void
index ed50479c743de4aadb753a981e591ece8b1c6860..0675e14cef1dd2fa03ecce9915cb37e66407dbc6 100644 (file)
@@ -71,7 +71,7 @@ Metering::update_meters()
  * be set to 0.
  */
 void
-PeakMeter::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
+PeakMeter::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
 {
        const uint32_t n_audio = min(_configured_input.n_audio(), bufs.count().n_audio());
        const uint32_t n_midi  = min(_configured_input.n_midi(), bufs.count().n_midi());
index bbf1036dd4f4398ada42dbf25eb84273ca90f234..db4b6ca178a4264972241555b091e38de36ed03b 100644 (file)
@@ -17,7 +17,8 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 */
-#include <iostream>
+
+#include "pbd/enumwriter.h"
 
 #include "ardour/mute_master.h"
 #include "ardour/rc_configuration.h"
@@ -104,11 +105,19 @@ MuteMaster::get_value () const
 int
 MuteMaster::set_state (const XMLNode& node)
 {
+       const XMLProperty* prop;
+
+       if ((prop = node.property ("mute-point")) != 0) {
+               _mute_point = (MutePoint) string_2_enum (prop->value(), _mute_point);
+       }
+
        return 0;
 }
 
 XMLNode&
 MuteMaster::get_state()
 {
-       return *(new XMLNode (X_("MuteMaster")));
+       XMLNode* node = new XMLNode (X_("MuteMaster"));
+       node->add_property ("mute-point", enum_2_string (_mute_point));
+       return *node;
 }
index b2b3f4af91669bbb24c2a8a8680967966aef6fa7..bf8f0071048cf05d3d4033116a4b15aba004e1a2 100644 (file)
@@ -371,7 +371,7 @@ PluginInsert::silence (nframes_t nframes)
 }
        
 void
-PluginInsert::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
+PluginInsert::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
 {
        if (active()) {
 
index 8ff26337715fb0a43f84b509c17e538260c03563..ffddc681c76802ca901741b470cc719dcf6da12f 100644 (file)
@@ -66,7 +66,7 @@ PortInsert::~PortInsert ()
 }
 
 void
-PortInsert::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
+PortInsert::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
 {
        if (_output->n_ports().n_total() == 0) {
                return;
@@ -78,7 +78,7 @@ PortInsert::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_
                return;
        }
 
-       _out->run_in_place (bufs, start_frame, end_frame, nframes);
+       _out->run (bufs, start_frame, end_frame, nframes);
        _input->collect_input (bufs, nframes, ChanCount::ZERO);
 }
 
index 4942f9023b02bf2bc72688d368b743afcc7f926c..574b6736a05ef4b591c6c7bf675519bb6b655b0d 100644 (file)
@@ -119,7 +119,7 @@ Return::set_state(const XMLNode& node)
 }
 
 void
-Return::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
+Return::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
 {
        if (!active() || _input->n_ports() == ChanCount::ZERO) {
                return;
@@ -131,13 +131,13 @@ Return::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_fram
        // Can't automate gain for sends or returns yet because we need different buffers
        // so that we don't overwrite the main automation data for the route amp
        // _amp->setup_gain_automation (start_frame, end_frame, nframes);
-       _amp->run_in_place (bufs, start_frame, end_frame, nframes);
+       _amp->run (bufs, start_frame, end_frame, nframes);
        
        if (_metering) {
                if (_amp->gain_control()->get_value() == 0) {
                        _meter->reset();
                } else {
-                       _meter->run_in_place (bufs, start_frame, end_frame, nframes);
+                       _meter->run (bufs, start_frame, end_frame, nframes);
                }
        }
 }
index dd0c8579ffe8b236f036b6b8d3fe95e74c537fc9..e7d68c488438d55636b15c050d798d287d877180 100644 (file)
@@ -383,6 +383,19 @@ Route::process_output_buffers (BufferSet& bufs,
                                } 
                        }
                }
+
+       } else {
+
+               if (_denormal_protection || Config->get_denormal_protection()) {
+                       
+                       for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) {
+                               Sample* const sp = i->data();
+                               for (nframes_t nx = 0; nx < nframes; ++nx) {
+                                       sp[nx] += 1.0e-27f;
+                               }
+                       }
+
+               } 
        }
 
        /* -------------------------------------------------------------------------------------------
@@ -394,7 +407,7 @@ Route::process_output_buffers (BufferSet& bufs,
        if (rm.locked()) {
                for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
                        bufs.set_count (ChanCount::max(bufs.count(), (*i)->input_streams()));
-                       (*i)->run_in_place (bufs, start_frame, end_frame, nframes);
+                       (*i)->run (bufs, start_frame, end_frame, nframes);
                        bufs.set_count (ChanCount::max(bufs.count(), (*i)->output_streams()));
                }
 
@@ -1471,11 +1484,11 @@ Route::_set_state (const XMLNode& node, bool call_base)
        }
        
        if ((prop = node.property (X_("phase-invert"))) != 0) {
-               set_phase_invert (prop->value()=="yes"?true:false, this);
+               set_phase_invert (prop->value()=="yes"?true:false);
        }
 
        if ((prop = node.property (X_("denormal-protection"))) != 0) {
-               set_denormal_protection (prop->value()=="yes"?true:false, this);
+               set_denormal_protection (prop->value()=="yes"?true:false);
        }
        
        if ((prop = node.property (X_("active"))) != 0) {
@@ -1589,7 +1602,10 @@ Route::_set_state (const XMLNode& node, bool call_base)
                                sscanf (prop->value().c_str(), "%d", &x);
                                set_remote_control_id (x);
                        }
-               } 
+
+               } else if (child->name() == X_("MuteMaster")) {
+                       _mute_master->set_state (*child);
+               }
        }
 
        if ((prop = node.property (X_("mix-group"))) != 0) {
@@ -2414,11 +2430,11 @@ Route::send_for (boost::shared_ptr<const IO> target) const
 }
 
 void
-Route::set_phase_invert (bool yn, void *src)
+Route::set_phase_invert (bool yn)
 {
        if (_phase_invert != yn) {
-               _phase_invert = yn;
-               //  phase_invert_changed (src); /* EMIT SIGNAL */
+               _phase_invert = 0xffff; // XXX all channels
+               phase_invert_changed (); /* EMIT SIGNAL */
        }
 }
 
@@ -2429,11 +2445,11 @@ Route::phase_invert () const
 }
 
 void
-Route::set_denormal_protection (bool yn, void *src)
+Route::set_denormal_protection (bool yn)
 {
        if (_denormal_protection != yn) {
                _denormal_protection = yn;
-               //  denormal_protection_changed (src); /* EMIT SIGNAL */
+               denormal_protection_changed (); /* EMIT SIGNAL */
        }
 }
 
index 61c235e60ae395ce9afc7d5885b33d43d1722b0e..ad66f7379663a75183b5d7a185de12fec66586c5 100644 (file)
@@ -66,7 +66,7 @@ Send::~Send ()
 }
 
 void
-Send::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
+Send::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
 {
        if (!_active || _output->n_ports() == ChanCount::ZERO) {
                _meter->reset ();
@@ -85,11 +85,11 @@ Send::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame,
        // Can't automate gain for sends or returns yet because we need different buffers
        // so that we don't overwrite the main automation data for the route amp
        // _amp->setup_gain_automation (start_frame, end_frame, nframes);
-       _amp->run_in_place (sendbufs, start_frame, end_frame, nframes);
+       _amp->run (sendbufs, start_frame, end_frame, nframes);
 
        /* deliver to outputs */
 
-       Delivery::run_in_place (sendbufs, start_frame, end_frame, nframes);
+       Delivery::run (sendbufs, start_frame, end_frame, nframes);
 
        /* consider metering */
        
@@ -97,7 +97,7 @@ Send::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame,
                if (_amp->gain_control()->get_value() == 0) {
                        _meter->reset();
                } else {
-                       _meter->run_in_place (*_output_buffers, start_frame, end_frame, nframes);
+                       _meter->run (*_output_buffers, start_frame, end_frame, nframes);
                }
        }
 }
index 54bada345ad58cda90b153489cb22f550bd4be19..394193e8b210d1f184428ec4d96eb7332756954e 100644 (file)
@@ -1889,7 +1889,7 @@ Session::new_audio_route (int input_channels, int output_channels, uint32_t how_
                try {
                        shared_ptr<Route> bus (new Route (*this, bus_name, Route::Flag(0), DataType::AUDIO));
 
-                       if (bus->output()->ensure_io (ChanCount(DataType::AUDIO, input_channels), false, this)) {
+                       if (bus->input()->ensure_io (ChanCount(DataType::AUDIO, input_channels), false, this)) {
                                error << string_compose (_("cannot configure %1 in/%2 out configuration for new audio track"),
                                                         input_channels, output_channels)
                                      << endmsg;
@@ -1904,22 +1904,17 @@ Session::new_audio_route (int input_channels, int output_channels, uint32_t how_
                                goto failure;
                        }
 
-
-
-                       /*
-                       for (uint32_t x = 0; n_physical_audio_inputs && x < bus->n_inputs(); ++x) {
-                                       
+                       for (uint32_t x = 0; n_physical_audio_inputs && x < bus->input()->n_ports().n_audio(); ++x) {
                                port = "";
                                
                                if (Config->get_input_auto_connect() & AutoConnectPhysical) {
                                        port = physinputs[((n+x)%n_physical_audio_inputs)];
                                } 
                                
-                               if (port.length() && bus->connect_input (bus->input (x), port, this)) {
+                               if (port.length() && bus->input()->connect (bus->input()->nth (x), port, this)) {
                                        break;
                                }
                        }
-                       */
 
                        for (uint32_t x = 0; n_physical_audio_outputs && x < bus->n_outputs().n_audio(); ++x) {
                                port = "";
@@ -2218,8 +2213,6 @@ Session::route_mute_changed (void* src)
 void
 Session::route_solo_changed (void* src, boost::weak_ptr<Route> wpr)
 {
-       cerr << "RSC sud = " << solo_update_disabled << endl;
-
        if (solo_update_disabled) {
                // We know already
                return;
@@ -2242,16 +2235,13 @@ Session::route_solo_changed (void* src, boost::weak_ptr<Route> wpr)
                delta = -1;
        }
 
-       cerr << "\tshift solo level by " << delta << endl;
-
+       solo_update_disabled = true;
        for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
 
                if ((*i)->feeds (route->input())) {
                        /* do it */
                        
-                       solo_update_disabled = true;
                        (*i)->main_outs()->mod_solo_level (delta);
-                       solo_update_disabled = false;
                }
        }
 
@@ -2261,72 +2251,36 @@ Session::route_solo_changed (void* src, boost::weak_ptr<Route> wpr)
                _master_out->main_outs()->mod_solo_level (1);
        }
 
-       /* now figure out if anything that matters is soloed */
-
-       bool something_soloed = false;
-
-       for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
-               if (!(*i)->is_master() && !(*i)->is_hidden() && (*i)->soloed()) {
-                       something_soloed = true;
-                       break;
-               }
-       }
-
-       if (something_soloed != _non_soloed_outs_muted) {
-               _non_soloed_outs_muted = something_soloed;
-               SoloActive (_non_soloed_outs_muted); /* EMIT SIGNAL */
-       }
-
+       solo_update_disabled = false;
+       update_route_solo_state (r);
        SoloChanged (); /* EMIT SIGNAL */
-
        set_dirty();
 }
 
 void
-Session::update_route_solo_state ()
+Session::update_route_solo_state (boost::shared_ptr<RouteList> r)
 {
-       bool mute = false;
-       bool is_track = false;
-       bool signal = false;
+       /* now figure out if anything that matters is soloed */
 
-       /* this is where we actually implement solo by changing
-          the solo mute setting of each track.
-       */
+       bool something_soloed = false;
 
-       shared_ptr<RouteList> r = routes.reader ();
+       if (!r) {
+               r = routes.reader();
+       }
 
        for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
-               if ((*i)->soloed()) {
-                       mute = true;
-                       if (boost::dynamic_pointer_cast<Track>(*i)) {
-                               is_track = true;
-                       }
+               if (!(*i)->is_master() && !(*i)->is_hidden() && (*i)->soloed()) {
+                       something_soloed = true;
                        break;
                }
        }
 
-       if (mute != currently_soloing) {
-               signal = true;
-               currently_soloing = mute;
-       }
-
-       if (!is_track && !mute) {
-
-               /* nothing is soloed */
-
-               if (signal) {
-                       SoloActive (false);
-               }
-
-               return;
-       }
-       
-       if (signal) {
-               SoloActive (currently_soloing);
+       if (something_soloed != _non_soloed_outs_muted) {
+               _non_soloed_outs_muted = something_soloed;
+               SoloActive (_non_soloed_outs_muted); /* EMIT SIGNAL */
        }
 }
 
-
 void
 Session::catch_up_on_solo ()
 {
index fff8803b5a38e4b62309f7ffd95e90def5eaaf82..955da881d19fc52cbb0daee7d9a85d94e3e4ca77 100644 (file)
@@ -179,7 +179,6 @@ Session::first_stage_init (string fullpath, string snapshot_name)
        next_quarter_frame_to_send = -1;
        current_block_size = 0;
        solo_update_disabled = false;
-       currently_soloing = false;
        _have_captured = false;
        _worst_output_latency = 0;
        _worst_input_latency = 0;