transport_types.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   $Id: transport_types.h,v 1.1.2.2 2006/06/20 14:44:00 letz Exp $
00020 */
00021 
00022 #ifndef __jack_transport_aux_h__
00023 #define __jack_transport_aux_h__
00024 
00025 #ifdef __cplusplus
00026 extern "C"
00027 {
00028 #endif
00029 
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 
00123     typedef int (*JackSyncCallback)(jack_transport_state_t state,
00124                                     jack_position_t *pos,
00125                                     void *arg);
00126 
00127 
00157     typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
00158                                          jack_nframes_t nframes,
00159                                          jack_position_t *pos,
00160                                          int new_pos,
00161                                          void *arg);
00162 
00163     /*********************************************************************
00164         * The following interfaces are DEPRECATED.  They are only provided
00165         * for compatibility with the earlier JACK transport implementation.
00166         *********************************************************************/
00167 
00173     typedef enum {
00174 
00175         JackTransportState = 0x1,       
00176         JackTransportPosition = 0x2,    
00177         JackTransportLoop = 0x4,        
00178         JackTransportSMPTE = 0x8,       
00179         JackTransportBBT = 0x10 
00181     } jack_transport_bits_t;
00182 
00189     typedef struct {
00190 
00191         /* these two cannot be set from clients: the server sets them */
00192 
00193         jack_nframes_t frame_rate;              
00194         jack_time_t usecs;              
00196         jack_transport_bits_t valid;    
00197         jack_transport_state_t transport_state;
00198         jack_nframes_t frame;
00199         jack_nframes_t loop_start;
00200         jack_nframes_t loop_end;
00201 
00202         long smpte_offset;      
00203         float smpte_frame_rate; 
00205         int bar;
00206         int beat;
00207         int tick;
00208         double bar_start_tick;
00209 
00210         float beats_per_bar;
00211         float beat_type;
00212         double ticks_per_beat;
00213         double beats_per_minute;
00214 
00215     }
00216     jack_transport_info_t;
00217 
00218 #ifdef __cplusplus
00219 }
00220 #endif
00221 
00222 #endif /* __jack_transport_aux_h__ */

Generated on Thu Feb 14 11:16:02 2008 for Jackdmp by  doxygen 1.5.1