Replace manual option handling by use of glib
[lcid-xwax.git] / device.h
bloba78ea86b0c24db5f418b39053e6a7a8a6e18ecc2
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 DEVICE_H
21 #define DEVICE_H
23 #include <glib.h>
24 #include <sys/poll.h>
26 #define DEVICE_CHANNELS 2
27 #define DEVICE_RATE 44100
28 #define DEVICE_FRAME 32
30 struct device_t {
31 void *local;
33 struct timecoder_t *timecoder;
34 struct player_t *player;
36 int (*pollfds)(struct device_t *dv, struct pollfd *pe, int n);
37 int (*handle)(struct device_t *dv);
39 int (*start)(struct device_t *dv);
40 int (*stop)(struct device_t *dv);
42 int (*clear)(struct device_t *dv);
45 struct device_t* createDevice(GError**error);
46 gboolean connectAudio(struct device_t* device, int r);
48 guint get_device_count();
50 void device_connect_timecoder(struct device_t *dv, struct timecoder_t *tc);
51 void device_connect_player(struct device_t *dv, struct player_t *pl);
53 int device_start(struct device_t *dv);
54 int device_stop(struct device_t *dv);
56 int device_clear(struct device_t *dv);
58 int device_pollfds(struct device_t *dv, struct pollfd *pe, int n);
59 int device_handle(struct device_t *dv);
61 #endif