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__
13 #if defined(__GNUG__) && !defined(__APPLE__)
14 #pragma interface "cdbase.h"
18 #include "wx/object.h"
19 #include "wx/mmedia/defs.h"
21 typedef struct wxCDtime
{
23 wxUint8 hour
, min
, sec
;
26 class WXDLLIMPEXP_MMEDIA wxCDAudio
: public wxObject
{
27 DECLARE_ABSTRACT_CLASS(wxCDAudio
)
29 typedef enum { PLAYING
, PAUSED
, STOPPED
} CDstatus
;
30 // Table of contents manager
31 class WXDLLIMPEXP_MMEDIA CDtoc
{
33 wxCDtime
*tracks_time
, *tracks_pos
;
37 CDtoc(wxCDtime
& tot_tm
, wxCDtime
*trks_tm
, wxCDtime
*trks_pos
)
38 { tracks_time
= trks_tm
; total_time
= tot_tm
; tracks_pos
= trks_pos
; }
40 // Returns the length of the specified track
41 // track: track to get length
42 wxCDtime
GetTrackTime(wxUint8 track
) const;
43 // Returns the position of the specified track
44 // track: track to get position
45 wxCDtime
GetTrackPos(wxUint8 track
) const;
46 // Returns the total time
47 inline wxCDtime
GetTotalTime() const { return total_time
; }
51 wxCDAudio() : wxObject() {}
53 virtual ~wxCDAudio() {}
55 // Play audio at the specified position
56 virtual bool Play(const wxCDtime
& beg_play
, const wxCDtime
& end_play
) = 0;
57 // Play audio from the specified to the end of the CD audio
58 bool Play(const wxCDtime
& beg_play
);
60 bool Play(wxUint8 beg_track
, wxUint8 end_track
= 0);
61 // Pause the audio playing
62 virtual bool Pause() = 0;
63 // Resume a paused audio playing
64 virtual bool Resume() = 0;
65 // Get the current CD status
66 virtual CDstatus
GetStatus() = 0;
67 // Get the current playing time
68 virtual wxCDtime
GetTime() = 0;
69 // Returns the table of contents
70 virtual const CDtoc
& GetToc() = 0;
72 virtual bool Ok() const = 0;