transport.h

00001 /*
00002   Copyright (C) 2002 Paul Davis
00003   Copyright (C) 2003 Jack O'Quin
00004   
00005   This program is free software; you can redistribute it and/or modify
00006   it under the terms of the GNU Lesser General Public License as published by
00007   the Free Software Foundation; either version 2.1 of the License, or
00008   (at your option) any later version.
00009   
00010   This program is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013   GNU Lesser General Public License for more details.
00014   
00015   You should have received a copy of the GNU Lesser General Public License
00016   along with this program; if not, write to the Free Software 
00017   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 
00019 */
00020 
00021 #ifndef __jack_transport_h__
00022 #define __jack_transport_h__
00023 
00024 #ifdef __cplusplus
00025 extern "C"
00026 {
00027 #endif
00028 
00029 //#include <jack/types.h>
00030 #include "types.h"
00031 
00035     typedef enum {
00036 
00037         /* the order matters for binary compatibility */
00038         JackTransportStopped = 0,       
00039         JackTransportRolling = 1,       
00040         JackTransportLooping = 2,       
00041         JackTransportStarting = 3,      
00042         JackTransportSynching = 4       
00044     } jack_transport_state_t;
00045 
00046     typedef uint64_t jack_unique_t;             
00051     typedef enum {
00052 
00053         JackPositionBBT = 0x10,         
00054         JackPositionTimecode = 0x20     
00056     } jack_position_bits_t;
00057 
00059 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
00060 #define EXTENDED_TIME_INFO
00061 
00065     typedef struct {
00066 
00067         /* these four cannot be set from clients: the server sets them */
00068         jack_unique_t   unique_1;       
00069         jack_time_t     usecs;          
00070         jack_nframes_t  frame_rate;     
00071         jack_nframes_t  frame;          
00073         jack_position_bits_t valid;             
00075         /* JackPositionBBT fields: */
00076         int32_t bar;            
00077         int32_t beat;           
00078         int32_t tick;           
00079         double  bar_start_tick;
00080 
00081         float   beats_per_bar;  
00082         float   beat_type;      
00083         double  ticks_per_beat;
00084         double  beats_per_minute;
00085 
00086         /* JackPositionTimecode fields: (EXPERIMENTAL: could change) */
00087         double  frame_time;     
00088         double  next_time;      
00091         /* For binary compatibility, new fields should be allocated from
00092          * this padding area with new valid bits controlling access, so
00093          * the existing structure size and offsets are preserved. */
00094         int32_t padding[10];
00095 
00096         /* When (unique_1 == unique_2) the contents are consistent. */
00097         jack_unique_t   unique_2;       
00099     }
00100     jack_position_t;
00101 
00119     int jack_release_timebase (jack_client_t *client);
00120 
00142     typedef int (*JackSyncCallback)(jack_transport_state_t state,
00143                                     jack_position_t *pos,
00144                                     void *arg);
00145 
00167     int jack_set_sync_callback (jack_client_t *client,
00168                                 JackSyncCallback sync_callback,
00169                                 void *arg);
00188     int jack_set_sync_timeout (jack_client_t *client,
00189                                jack_time_t timeout);
00219     typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
00220                                          jack_nframes_t nframes,
00221                                          jack_position_t *pos,
00222                                          int new_pos,
00223                                          void *arg);
00224 
00251     int jack_set_timebase_callback (jack_client_t *client,
00252                                     int conditional,
00253                                     JackTimebaseCallback timebase_callback,
00254                                     void *arg);
00272     int jack_transport_locate (jack_client_t *client,
00273                                jack_nframes_t frame);
00290     jack_transport_state_t jack_transport_query (const jack_client_t *client,
00291             jack_position_t *pos);
00300     jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client);
00318     int jack_transport_reposition (jack_client_t *client,
00319                                    jack_position_t *pos);
00332     void jack_transport_start (jack_client_t *client);
00342     void jack_transport_stop (jack_client_t *client);
00343 
00344     /*********************************************************************
00345      * The following interfaces are DEPRECATED.  They are only provided
00346      * for compatibility with the earlier JACK transport implementation.
00347      *********************************************************************/
00348 
00354     typedef enum {
00355 
00356         JackTransportState = 0x1,       
00357         JackTransportPosition = 0x2,    
00358         JackTransportLoop = 0x4,        
00359         JackTransportSMPTE = 0x8,       
00360         JackTransportBBT = 0x10 
00362     } jack_transport_bits_t;
00363 
00370     typedef struct {
00371 
00372         /* these two cannot be set from clients: the server sets them */
00373 
00374         jack_nframes_t frame_rate;              
00375         jack_time_t usecs;              
00377         jack_transport_bits_t valid;    
00378         jack_transport_state_t transport_state;
00379         jack_nframes_t frame;
00380         jack_nframes_t loop_start;
00381         jack_nframes_t loop_end;
00382 
00383         long smpte_offset;      
00384         float smpte_frame_rate; 
00386         int bar;
00387         int beat;
00388         int tick;
00389         double bar_start_tick;
00390 
00391         float beats_per_bar;
00392         float beat_type;
00393         double ticks_per_beat;
00394         double beats_per_minute;
00395 
00396     }
00397     jack_transport_info_t;
00398 
00412     void jack_get_transport_info (jack_client_t *client,
00413                                   jack_transport_info_t *tinfo);
00422     void jack_set_transport_info (jack_client_t *client,
00423                                   jack_transport_info_t *tinfo);
00424 
00425 #ifdef __cplusplus
00426 }
00427 #endif
00428 
00429 #endif /* __jack_transport_h__ */

Generated on Mon Oct 15 17:11:14 2007 for Jackdmp by  doxygen 1.5.1