1 /* vim: set ft=objc ts=4 nowrap: */
2 /*
3 **  AudioCDProtocol.h
4 **
5 **  Copyright (c) 2002
6 **
7 **  Author: Andreas Schik <andreas@schik.de>
8 **
9 **  This program is free software; you can redistribute it and/or modify
10 **  it under the terms of the GNU Lesser General Public License as published by
11 **  the Free Software Foundation; either version 2 of the License, or
12 **  (at your option) any later version.
13 **
14 **  This program is distributed in the hope that it will be useful,
15 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 **  GNU General Public License for more details.
18 **
19 **  You should have received a copy of the GNU Lesser General Public License
20 **  along with this program; if not, write to the Free Software
21 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22 */
23 
24 #ifndef __AUDIOCD_PROTOCOL_H_INCLUDED
25 #define __AUDIOCD_PROTOCOL_H_INCLUDED
26 
27 #include <Foundation/Foundation.h>
28 
29 
30 #define AUDIOCD_PLAYING			0
31 #define AUDIOCD_PAUSED			1
32 #define AUDIOCD_COMPLETED		2
33 #define AUDIOCD_NOSTATUS		3
34 
35 @protocol CDHandlerProtocol <NSObject>
36 
37 - (BOOL) audioCD: (id)sender error: (int)no message: (NSString *)msg;
38 - (void) audioCDChanged: (id)sender;
39 
40 @end
41 
42 @protocol AudioCDProtocol <NSObject>
43 
44 - initWithHandler: (id<CDHandlerProtocol>)handler;
45 
46 - (void) setHandler: (id<CDHandlerProtocol>)handler;
47 
48 - (void) startPollingWithPreferredDevice: (NSString *)device;
49 - (void) stopPolling;
50 
51 - (NSString *) device;
52 
53 - (NSMutableDictionary *) readTOC;
54 
55 - (void) playStart: (int)start End: (int)end;
56 - (void) pause;
57 - (void) resume;
58 - (void) stop;
59 - (void) eject;
60 - (void) close;
61 
62 - (BOOL) cdPresent;
63 - (BOOL) checkForCDWithId: (NSString *)cddbId;
64 
65 - (int) currentState;
66 - (int) currentTrack;
67 - (int) currentMin;
68 - (int) currentSec;
69 - (int) firstTrack;
70 - (int) totalTrack;
71 - (int) trackLength:(int)track;
72 
73 @end
74 
75 #endif
76