1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
/* gstcdplay
* Copyright (c) 2002 Charles Schmidt <cbschmid@uiuc.edu>
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/* THIS DOES NOT WORK YET */
#define CDPLAYER(x) ((CDPlayer *)x)
#define FD(x) ((int)x)
gboolean cd_init(struct cd *cd,const gchar *device)
{
CDPLAYER *cdplayer;
CDSTATUS status;
CDTRACKINFO info;
guint i;
cdplayer = CDOpen(device,"r");
if (cdplayer == NULL) {
return FALSE;
}
cd->fd = FD(cdplayer);
if (CDgetstatus(cdplayer,&status) == 0) {
CDclose(cdplayer);
cd->fd = 0;
return FALSE;
}
for (i = 1; i < status.last; i++) {
if (CDgettrackinfo(cdplayer,i,&info) == 0) {
CDclose(cdplayer);
cd->fd = 0;
return FALSE;
}
cd->tracks[i].minute = info.start_min;
cd->tracks[i].second = info.start_sec;
cd->tracks[i].frame = info.start_frame;
}
/* there is no leadout information */
cd->num_tracks = status.last;
return TRUE;
}
gboolean cd_start(struct cd *cd,gint start_track,gint end_track)
{
if (cd->fd == 0) {
return FALSE;
}
cd_fix_track_range(cd,&start_track,&end_track);
}
gboolean cd_pause(struct cd *cd)
{
}
gboolean cd_resume(struct cd *cd)
{
}
gboolean cd_stop(struct cd *cd)
{
}
/* -1 for error, 0 for not playing, 1 for playing */
CDStatus cd_status(struct cd *cd)
{
}
gint cd_current_track(struct cd *cd)
{
}
gboolean cd_close(struct cd *cd)
{
}
|