2 Copyright (C) 2008 Hans Baier
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <boost/noncopyable.hpp>
23 #include "pbd/signals.h"
25 #include "ardour/types.h"
26 #include "ardour/session_handle.h"
41 class MidiClockTicker : public SessionHandlePtr, boost::noncopyable
45 virtual ~MidiClockTicker();
47 void tick (const framepos_t& transport_frames);
49 bool has_midi_port() const { return _midi_port != 0; }
51 void set_session (Session* s);
52 void session_going_away();
54 /// slot for the signal session::MIDIClock_PortChanged
55 void update_midi_clock_port();
57 /// slot for the signal session::TransportStateChange
58 void transport_state_changed();
60 /// slot for the signal session::PositionChanged
61 void position_changed (framepos_t position);
63 /// slot for the signal session::TransportLooped
64 void transport_looped();
66 /// slot for the signal session::Located
67 void session_located();
69 /// pulses per quarter note (default 24)
70 void set_ppqn(int ppqn) { _ppqn = ppqn; }
73 MIDI::Port* _midi_port;
80 double one_ppqn_in_frames (framepos_t transport_position);
82 void send_midi_clock_event (pframes_t offset);
83 void send_start_event (pframes_t offset);
84 void send_continue_event (pframes_t offset);
85 void send_stop_event (pframes_t offset);
86 void send_position_event (framepos_t transport_position, pframes_t offset);
91 #endif /* TICKER_H_ */