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 /*******************************************************************************/
26 #include "JACK/Client.H"
30 class Engine : public JACK::Client, public Mutex
32 Thread _thread; /* only used for thread checking */
34 int _buffers_dropped; /* buffers dropped because of locking */
35 /* int _buffers_dropped; /\* buffers dropped because of locking *\/ */
37 void shutdown ( void );
38 int process ( nframes_t nframes );
39 int sync ( jack_transport_state_t state, jack_position_t *pos );
41 void timebase ( jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos );
42 void freewheel ( bool yes );
43 int buffer_size ( nframes_t nframes );
44 void thread_init ( void );
46 Engine ( const Engine &rhs );
47 Engine & operator = ( const Engine &rhs );
49 void request_locate ( nframes_t frame );
54 friend class Transport;
61 int dropped ( void ) const { return _buffers_dropped; }
63 nframes_t system_latency ( void ) const { return nframes(); }
65 float frames_to_milliseconds ( nframes_t frames )
67 return ( frames * 1000 ) / (float)frame_rate();
71 extern Engine * engine;