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   $Id: transport.h,v 1.8.2.5 2006/06/20 14:44:00 letz Exp $
00020 */
00021 
00022 #ifndef __jack_transport_h__
00023 #define __jack_transport_h__
00024 
00025 #ifdef __cplusplus
00026 extern "C"
00027 {
00028 #endif
00029 
00030 //#include <jack/types.h>
00031 #include "types.h"
00032 
00036     typedef enum {
00037 
00038         /* the order matters for binary compatibility */
00039         JackTransportStopped = 0,       
00040         JackTransportRolling = 1,       
00041         JackTransportLooping = 2,       
00042         JackTransportStarting = 3,      
00043         JackTransportSynching = 4       
00045     } jack_transport_state_t;
00046 
00047     typedef uint64_t jack_unique_t;             
00052     typedef enum {
00053 
00054         JackPositionBBT = 0x10,         
00055         JackPositionTimecode = 0x20     
00057     } jack_position_bits_t;
00058 
00060 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
00061 #define EXTENDED_TIME_INFO
00062 
00066     typedef struct {
00067 
00068         /* these four cannot be set from clients: the server sets them */
00069         jack_unique_t   unique_1;       
00070         jack_time_t     usecs;          
00071         jack_nframes_t  frame_rate;     
00072         jack_nframes_t  frame;          
00074         jack_position_bits_t valid;             
00076         /* JackPositionBBT fields: */
00077         int32_t bar;            
00078         int32_t beat;           
00079         int32_t tick;           
00080         double  bar_start_tick;
00081 
00082         float   beats_per_bar;  
00083         float   beat_type;      
00084         double  ticks_per_beat;
00085         double  beats_per_minute;
00086 
00087         /* JackPositionTimecode fields: (EXPERIMENTAL: could change) */
00088         double  frame_time;     
00089         double  next_time;      
00092         /* For binary compatibility, new fields should be allocated from
00093          * this padding area with new valid bits controlling access, so
00094          * the existing structure size and offsets are preserved. */
00095         int32_t padding[10];
00096 
00097         /* When (unique_1 == unique_2) the contents are consistent. */
00098         jack_unique_t   unique_2;       
00100     }
00101     jack_position_t;
00102 
00120     int jack_release_timebase (jack_client_t *client);
00121 
00143     typedef int (*JackSyncCallback)(jack_transport_state_t state,
00144                                     jack_position_t *pos,
00145                                     void *arg);
00146 
00168     int jack_set_sync_callback (jack_client_t *client,
00169                                 JackSyncCallback sync_callback,
00170                                 void *arg);
00189     int jack_set_sync_timeout (jack_client_t *client,
00190                                jack_time_t timeout);
00220     typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
00221                                          jack_nframes_t nframes,
00222                                          jack_position_t *pos,
00223                                          int new_pos,
00224                                          void *arg);
00225 
00252     int jack_set_timebase_callback (jack_client_t *client,
00253                                     int conditional,
00254                                     JackTimebaseCallback timebase_callback,
00255                                     void *arg);
00273     int jack_transport_locate (jack_client_t *client,
00274                                jack_nframes_t frame);
00291     jack_transport_state_t jack_transport_query (const jack_client_t *client,
00292             jack_position_t *pos);
00301     jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client);
00319     int jack_transport_reposition (jack_client_t *client,
00320                                    jack_position_t *pos);
00333     void jack_transport_start (jack_client_t *client);
00343     void jack_transport_stop (jack_client_t *client);
00344 
00345     /*********************************************************************
00346      * The following interfaces are DEPRECATED.  They are only provided
00347      * for compatibility with the earlier JACK transport implementation.
00348      *********************************************************************/
00349 
00355     typedef enum {
00356 
00357         JackTransportState = 0x1,       
00358         JackTransportPosition = 0x2,    
00359         JackTransportLoop = 0x4,        
00360         JackTransportSMPTE = 0x8,       
00361         JackTransportBBT = 0x10 
00363     } jack_transport_bits_t;
00364 
00371     typedef struct {
00372 
00373         /* these two cannot be set from clients: the server sets them */
00374 
00375         jack_nframes_t frame_rate;              
00376         jack_time_t usecs;              
00378         jack_transport_bits_t valid;    
00379         jack_transport_state_t transport_state;
00380         jack_nframes_t frame;
00381         jack_nframes_t loop_start;
00382         jack_nframes_t loop_end;
00383 
00384         long smpte_offset;      
00385         float smpte_frame_rate; 
00387         int bar;
00388         int beat;
00389         int tick;
00390         double bar_start_tick;
00391 
00392         float beats_per_bar;
00393         float beat_type;
00394         double ticks_per_beat;
00395         double beats_per_minute;
00396 
00397     }
00398     jack_transport_info_t;
00399 
00413     void jack_get_transport_info (jack_client_t *client,
00414                                   jack_transport_info_t *tinfo);
00423     void jack_set_transport_info (jack_client_t *client,
00424                                   jack_transport_info_t *tinfo);
00425 
00426 #ifdef __cplusplus
00427 }
00428 #endif
00429 
00430 #endif /* __jack_transport_h__ */

Generated on Wed Jan 10 11:42:47 2007 for Jackdmp by  doxygen 1.4.5