]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia2/lib/cdbase.h
2 // /////////////////////////////////////////////////////////////////////////////
5 // Author: Guilhem Lavaux
8 // Copyright: (C) 1997, 1998, Guilhem Lavaux
9 // License: wxWindows license
10 // /////////////////////////////////////////////////////////////////////////////
11 #ifndef __CDA_base_H__
12 #define __CDA_base_H__
24 typedef struct wxCDtime
{
26 wxUint8 hour
, min
, sec
;
29 class WXDLLEXPORT wxCDAudio
: public wxObject
{
30 DECLARE_ABSTRACT_CLASS(wxCDAudio
)
32 typedef enum { PLAYING
, PAUSED
, STOPPED
} CDstatus
;
33 // Table of contents manager
36 wxCDtime
*tracks_time
, *tracks_pos
;
40 CDtoc(wxCDtime
& tot_tm
, wxCDtime
*trks_tm
, wxCDtime
*trks_pos
)
41 { tracks_time
= trks_tm
; total_time
= tot_tm
; tracks_pos
= trks_pos
; }
43 // Returns the length of the specified track
44 // track: track to get length
45 wxCDtime
GetTrackTime(wxUint8 track
) const;
46 // Returns the position of the specified track
47 // track: track to get position
48 wxCDtime
GetTrackPos(wxUint8 track
) const;
49 // Returns the total time
50 inline wxCDtime
GetTotalTime() const { return total_time
; }
54 wxCDAudio() : wxObject() {}
56 virtual ~wxCDAudio() {}
58 // Play audio at the specified position
59 virtual bool Play(const wxCDtime
& beg_play
, const wxCDtime
& end_play
) = 0;
60 // Play audio from the specified to the end of the CD audio
61 bool Play(const wxCDtime
& beg_play
);
63 bool Play(wxUint8 beg_track
, wxUint8 end_track
= 0);
64 // Pause the audio playing
65 virtual bool Pause() = 0;
66 // Resume a paused audio playing
67 virtual bool Resume() = 0;
68 // Get the current CD status
69 virtual CDstatus
GetStatus() = 0;
70 // Get the current playing time
71 virtual wxCDtime
GetTime() = 0;
72 // Returns the table of contents
73 virtual const CDtoc
& GetToc() = 0;
75 virtual bool Ok() const = 0;