Fix typo in 37aaa2d1
[ardour.git] / gtk2_ardour / midi_tracer.h
index 682217be5ba24e830a6d5debfd584dc34be88c47..83e99ef979bf977d2f2db0ec1105b5dc27440787 100644 (file)
@@ -1,3 +1,22 @@
+/*
+    Copyright (C) 2012 Paul Davis
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
 #ifndef __ardour_gtk_midi_tracer_h__
 #define __ardour_gtk_midi_tracer_h__
 
@@ -20,25 +39,27 @@ namespace MIDI {
        class Parser;
 }
 
+namespace ARDOUR {
+       class MidiPort;
+}
+
 class MidiTracer : public ArdourWindow
 {
-  public:
+public:
        MidiTracer ();
        ~MidiTracer();
 
-  private:
-       MIDI::Parser* parser;
+private:
        Gtk::TextView text;
        Gtk::ScrolledWindow scroller;
        Gtk::Adjustment line_count_adjustment;
        Gtk::SpinButton line_count_spinner;
        Gtk::Label line_count_label;
        Gtk::HBox line_count_box;
-       struct timeval _last_receipt;
-       
+       MIDI::samplecnt_t _last_receipt;
+
        bool autoscroll;
        bool show_hex;
-       bool collect;
        bool show_delta_time;
 
        /** Incremented when an update is requested, decremented when one is handled; hence
@@ -47,11 +68,11 @@ class MidiTracer : public ArdourWindow
         */
        volatile gint _update_queued;
 
-       RingBuffer<char *> fifo;
+       PBD::RingBuffer<char *> fifo;
        Pool buffer_pool;
        static const size_t buffer_size = 256;
 
-       void tracer (MIDI::Parser&, MIDI::byte*, size_t);
+       void tracer (MIDI::Parser&, MIDI::byte*, size_t, MIDI::samplecnt_t);
        void update ();
 
        Gtk::CheckButton autoscroll_button;
@@ -70,6 +91,9 @@ class MidiTracer : public ArdourWindow
        void disconnect ();
        PBD::ScopedConnection _parser_connection;
        PBD::ScopedConnection _manager_connection;
+       MIDI::Parser my_parser;
+
+       boost::shared_ptr<ARDOUR::MidiPort> traced_port;
 };
 
 #endif /* __ardour_gtk_midi_tracer_h__ */