]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia/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__
25 typedef struct wxCDtime
{
27 wxUint8 hour
, min
, sec
;
31 class WXDLLEXPORT wxCDAudio
: public wxObject
{
32 DECLARE_ABSTRACT_CLASS(wxCDAudio
)
35 typedef enum { PLAYING
, PAUSED
, STOPPED
} CDstatus
;
36 /// Table of contents manager
39 wxCDtime
*tracks_time
, *tracks_pos
;
43 CDtoc(wxCDtime
& tot_tm
, wxCDtime
*trks_tm
, wxCDtime
*trks_pos
)
44 { tracks_time
= trks_tm
; total_time
= tot_tm
; tracks_pos
= trks_pos
; }
46 /// Returns the length of the specified track
47 /** @param track track to get length */
48 wxCDtime
GetTrackTime(wxUint8 track
) const;
49 /** Returns the position of the specified
50 @param track track to get position */
51 wxCDtime
GetTrackPos(wxUint8 track
) const;
52 /// Returns the total time
53 inline wxCDtime
GetTotalTime() const { return total_time
; }
57 wxCDAudio() : wxObject() {}
59 virtual ~wxCDAudio() {}
61 /// Play audio at the specified position
63 * @param beg_play start position
64 * @param end_play end position
66 virtual bool Play(const wxCDtime
& beg_play
, const wxCDtime
& end_play
) = 0;
67 /// Play audio from the specified to the end of the CD audio
69 * @param beg_play start position
71 bool Play(const wxCDtime
& beg_play
);
73 bool Play(wxUint8 beg_track
, wxUint8 end_track
= 0);
74 /// Pause the audio playing
75 virtual bool Pause() = 0;
76 /// Resume a paused audio playing
77 virtual bool Resume() = 0;
78 /// Get the current CD status
79 virtual CDstatus
GetStatus() = 0;
80 /// Get the current playing time
81 virtual wxCDtime
GetTime() = 0;
82 /// Returns the table of contents
83 virtual const CDtoc
& GetToc() = 0;
85 virtual bool Ok() const = 0;