Small steps towards rolling backwards..
[ardour.git] / libs / ardour / meter.cc
index faedf344550a99b6161bfd238ae56fb5c7962309..da97041657f4380171fe49cc22540ef571a288eb 100644 (file)
@@ -38,10 +38,10 @@ using namespace ARDOUR;
 PeakMeter::PeakMeter (Session& s, const std::string& name)
     : Processor (s, string_compose ("meter-%1", name))
 {
-       Kmeterdsp::init(s.nominal_frame_rate());
-       Iec1ppmdsp::init(s.nominal_frame_rate());
-       Iec2ppmdsp::init(s.nominal_frame_rate());
-       Vumeterdsp::init(s.nominal_frame_rate());
+       Kmeterdsp::init(s.nominal_sample_rate());
+       Iec1ppmdsp::init(s.nominal_sample_rate());
+       Iec2ppmdsp::init(s.nominal_sample_rate());
+       Vumeterdsp::init(s.nominal_sample_rate());
        _pending_active = true;
        _meter_type = MeterPeak;
        _reset_dpm = true;
@@ -78,7 +78,7 @@ PeakMeter::~PeakMeter ()
  * (runs in jack realtime context)
  */
 void
-PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, double /*speed*/, pframes_t nframes, bool)
+PeakMeter::run (BufferSet& bufs, samplepos_t /*start_sample*/, samplepos_t /*end_sample*/, double /*speed*/, pframes_t nframes, bool)
 {
        if (!_active && !_pending_active) {
                return;
@@ -96,8 +96,8 @@ PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_fr
 
        uint32_t n = 0;
 
-       const float falloff_dB = Config->get_meter_falloff() * nframes / _session.nominal_frame_rate();
-       const uint32_t zoh = _session.nominal_frame_rate() * .021;
+       const float falloff_dB = Config->get_meter_falloff() * nframes / _session.nominal_sample_rate();
+       const uint32_t zoh = _session.nominal_sample_rate() * .021;
        _bufcnt += nframes;
 
        // Meter MIDI in to the first n_midi peaks
@@ -106,7 +106,7 @@ PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_fr
                const MidiBuffer& buf (bufs.get_midi(i));
 
                for (MidiBuffer::const_iterator e = buf.begin(); e != buf.end(); ++e) {
-                       const Evoral::Event<framepos_t> ev(*e, false);
+                       const Evoral::Event<samplepos_t> ev(*e, false);
                        if (ev.is_note_on()) {
                                const float this_vel = ev.buffer()[2] / 127.0;
                                if (this_vel > val) {
@@ -427,9 +427,9 @@ PeakMeter::set_type(MeterType t)
 }
 
 XMLNode&
-PeakMeter::state (bool full_state)
+PeakMeter::state ()
 {
-       XMLNode& node (Processor::state (full_state));
+       XMLNode& node (Processor::state ());
        node.set_property("type", "meter");
        return node;
 }