Changeset 195 for fm_server/trunk/src/fm_sync.h
- Timestamp:
- 01/16/08 13:40:24 (4 years ago)
- Files:
-
- 1 modified
-
fm_server/trunk/src/fm_sync.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fm_server/trunk/src/fm_sync.h
r143 r195 24 24 typedef struct _FmBeatSection FmBeatSection; 25 25 typedef struct _FmBeatInfo FmBeatInfo; 26 typedef struct _FmSync FmSync;27 26 28 27 … … 38 37 }; 39 38 39 /* 40 struct _FmBufferRequest { 41 gboolean cont; 42 guint64 pos; 43 guint req_samples; 44 }; 40 45 41 struct _FmSync { 42 FmElement *master; 46 enum FmBufferReturn { 47 FM_BUFFER_RETURN_OK, 48 FM_BUFFER_RETURN_DISCONT 43 49 44 /* written from fm_element_beacome_sync_master */ 45 gdouble bpm; 46 gint beat_per_bar; 47 48 /* automatically generated */ 49 gdouble ns_per_sample; 50 gdouble ns_per_beat; 51 52 /* automatically updated at the beginning of each cycle */ 53 gint bar; 54 gint beat; 55 gfloat beat_offset_ns; 56 57 /* can be updated with the functions below */ 58 gdouble bpm_new; 59 guint played_samples_new; 60 }; 50 };*/ 61 51 62 52 … … 64 54 fm_sync_new (void); 65 55 66 /* Every output element must call this after get_buffer*/56 /* The sync reference has to call this after calling fm_get_buffer() on its peer_sync_master port */ 67 57 void 68 58 fm_sync_update_cycle (FmSync *sync); … … 70 60 /* Callable from get_buffer, takes effect from next cycle */ 71 61 void 72 fm_sync_master_played_ samples (FmSync *sync,62 fm_sync_master_played_ns (FmSync *sync, 73 63 guint samples); 74 64 … … 78 68 gdouble bpm); 79 69 70 void 71 fm_sync_set (FmSync *sync, 72 guint64 offset, 73 guint64 timestamp); 74 80 75 /* Callable from get_buffer */ 81 76 gdouble … … 83 78 84 79 gint 85 fm_sync_ samples_to_next_beat(FmSync *sync);80 fm_sync_next_beat_is (FmSync *sync); 86 81 87 gint 88 fm_sync_ next_beat_is (FmSync *sync);82 void 83 fm_sync_show_pos (FmSync *sync);
