1 // ---------------------------------------------------------------------------
4 // Author: Guilhem Lavaux
6 // Updated: 1998, 1999, 2000
7 // Copyright: (C) 1997, 1998, 1999, 2000 Guilhem Lavaux
8 // License: wxWindows license
9 // ---------------------------------------------------------------------------
10 #ifndef __CDA_base_H__
11 #define __CDA_base_H__
14 #include "wx/object.h"
15 #include "wx/mmedia/defs.h"
17 typedef struct wxCDtime
{
19 wxUint8 hour
, min
, sec
;
22 class WXDLLIMPEXP_MMEDIA wxCDAudio
: public wxObject
{
23 DECLARE_ABSTRACT_CLASS(wxCDAudio
)
25 typedef enum { PLAYING
, PAUSED
, STOPPED
} CDstatus
;
26 // Table of contents manager
27 class WXDLLIMPEXP_MMEDIA CDtoc
{
29 wxCDtime
*tracks_time
, *tracks_pos
;
33 CDtoc(wxCDtime
& tot_tm
, wxCDtime
*trks_tm
, wxCDtime
*trks_pos
)
34 { tracks_time
= trks_tm
; total_time
= tot_tm
; tracks_pos
= trks_pos
; }
36 // Returns the length of the specified track
37 // track: track to get length
38 wxCDtime
GetTrackTime(wxUint8 track
) const;
39 // Returns the position of the specified track
40 // track: track to get position
41 wxCDtime
GetTrackPos(wxUint8 track
) const;
42 // Returns the total time
43 inline wxCDtime
GetTotalTime() const { return total_time
; }
47 wxCDAudio() : wxObject() {}
49 virtual ~wxCDAudio() {}
51 // Play audio at the specified position
52 virtual bool Play(const wxCDtime
& beg_play
, const wxCDtime
& end_play
) = 0;
53 // Play audio from the specified to the end of the CD audio
54 bool Play(const wxCDtime
& beg_play
);
56 bool Play(wxUint8 beg_track
, wxUint8 end_track
= 0);
57 // Pause the audio playing
58 virtual bool Pause() = 0;
59 // Resume a paused audio playing
60 virtual bool Resume() = 0;
61 // Get the current CD status
62 virtual CDstatus
GetStatus() = 0;
63 // Get the current playing time
64 virtual wxCDtime
GetTime() = 0;
65 // Returns the table of contents
66 virtual const CDtoc
& GetToc() = 0;
68 virtual bool Ok() const = 0;