Remove all use of nframes_t.
[ardour.git] / libs / ardour / ardour / ticker.h
index f87bca665d15b2a5e65c156c5b3ea6ea3201517c..0a24070608b654dfbb6002dd50aff20121e77ea0 100644 (file)
     $Id$
 */
 
-#include <sigc++/sigc++.h>
+
+#include "pbd/signals.h"
 
 #include "ardour/types.h"
-#include "midi++/jack.h"
+#include "ardour/session_handle.h"
+
 
 #ifndef TICKER_H_
 #define TICKER_H_
 
+namespace MIDI {
+       class Port;
+}
+
 namespace ARDOUR
 {
 
 class Session;
 
-class Ticker : public sigc::trackable
+class Ticker : public SessionHandlePtr
 {
 public:
-       Ticker() : _session(0) {};
-       virtual ~Ticker() {};
+       Ticker() {};
+       virtual ~Ticker() {}
 
-       virtual void tick(
-               const nframes_t& transport_frames,
+       virtual void tick (
+               const framepos_t& transport_frames,
                const BBT_Time& transport_bbt,
-               const SMPTE::Time& transport_smpte) = 0;
-
-       virtual void set_session(Session& s);
-       virtual void going_away() { _session = 0; }
+               const Timecode::Time& transport_timecode) = 0;
 
-protected:
-       Session* _session;
+       void set_session (Session* s);
 };
 
 class MidiClockTicker : public Ticker
@@ -66,12 +68,12 @@ public:
        }
 
        void tick(
-               const nframes_t& transport_frames,
+               const framepos_t& transport_frames,
                const BBT_Time& transport_bbt,
-               const SMPTE::Time& transport_smpte);
+               const Timecode::Time& transport_timecode);
 
-       void set_session(Session& s);
-       void going_away() { _midi_port = 0; Ticker::going_away(); }
+       void set_session (Session* s);
+       void session_going_away();
 
        /// slot for the signal session::MIDIClock_PortChanged
        void update_midi_clock_port();
@@ -80,7 +82,7 @@ public:
        void transport_state_changed();
 
        /// slot for the signal session::PositionChanged
-       void position_changed(nframes_t position);
+       void position_changed (framepos_t position);
 
        /// slot for the signal session::TransportLooped
        void transport_looped();
@@ -93,12 +95,12 @@ private:
        int          _ppqn;
        double       _last_tick;
 
-       double one_ppqn_in_frames(nframes_t transport_position);
+       double one_ppqn_in_frames (framepos_t transport_position);
 
-       void send_midi_clock_event(nframes_t offset);
-       void send_start_event(nframes_t offset);
-       void send_continue_event(nframes_t offset);
-       void send_stop_event(nframes_t offset);
+       void send_midi_clock_event (framecnt_t offset);
+       void send_start_event (framecnt_t offset);
+       void send_continue_event (framecnt_t offset);
+       void send_stop_event (framecnt_t offset);
 };
 
 }