Replace manual option handling by use of glib
[lcid-xwax.git] / player.h
blobedc9e9802358c253ef89868679376f504e437943
1 /*
2 * Copyright (C) 2008 Mark Hills <mark@pogo.org.uk>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License version 2 for more details.
13 * You should have received a copy of the GNU General Public License
14 * version 2 along with this program; if not, write to the Free
15 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16 * MA 02110-1301, USA.
20 #ifndef PLAYER_H
21 #define PLAYER_H
23 #include "track.h"
25 #define PLAYER_RATE 44100
26 #define PLAYER_CHANNELS 2
28 struct player_t {
29 int reconnect; /* Re-sync the offset at next opportunity */
31 /* Current playback parameters */
33 double position,
34 last_difference; /* last known position minus target_position */
35 float target_pitch, /* pitch from turntable */
36 sync_pitch, /* pitch required to sync to timecode signal */
37 pitch, /* after filtering */
38 volume;
40 signed int target_position,
41 offset, /* track start point in timecode */
42 safe; /* copied from timecoder_t */
44 struct track_t *track;
45 struct timecoder_t *timecoder;
48 void player_init(struct player_t *pl);
49 void player_clear(struct player_t *pl);
51 void player_connect_timecoder(struct player_t *pl, struct timecoder_t *tc);
52 void player_disconnect_timecoder(struct player_t *pl);
54 int player_control(struct player_t *pl, float pitch, float volume,
55 int timecode_known, double target_position);
56 int player_recue(struct player_t *pl);
58 int player_collect(struct player_t *pl, signed short *pcm, int samples);
60 void player_connect_track(struct player_t *pl, struct track_t *tr);
62 #endif