2 /*******************************************************************************/
3 /* Copyright (C) 2008 Jonathan Moore Liles */
5 /* This program is free software; you can redistribute it and/or modify it */
6 /* under the terms of the GNU General Public License as published by the */
7 /* Free Software Foundation; either version 2 of the License, or (at your */
8 /* option) any later version. */
10 /* This program is distributed in the hope that it will be useful, but WITHOUT */
11 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
12 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
15 /* You should have received a copy of the GNU General Public License along */
16 /* with This program; see the file COPYING. If not,write to the Free Software */
17 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18 /*******************************************************************************/
22 #include <sigc++/sigc++.h>
26 #include "event.H" // just for tick_t
28 #include <jack/transport.h>
30 typedef double playhead_t;
32 class Transport : public trackable {
34 double _master_beats_per_minute;
35 unsigned _master_beats_per_bar;
36 unsigned _master_beat_type;
40 signal <int, double> signal_tempo_change;
41 signal <int, double> signal_bpb_change;
42 signal <int, double> signal_beat_change;
44 bool master; /* are we driving the transport? */
47 volatile bool recording;
55 unsigned beats_per_bar;
57 double ticks_per_beat;
58 double beats_per_minute;
60 double ticks_per_period;
61 double frames_per_tick;
74 void locate ( tick_t ticks );
76 void set_beats_per_minute ( double n );
77 void set_beats_per_bar ( int n );
78 void set_beat_type ( int n );
80 static void timebase ( jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos, void *arg );
84 extern Transport transport;