]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/mmedia/cdbase.h
generate makefile.unx files using bakefile
[wxWidgets.git] / contrib / include / wx / mmedia / cdbase.h
1 // ---------------------------------------------------------------------------
2 // Name: cdbase.h
3 // Purpose: wxMMedia
4 // Author: Guilhem Lavaux
5 // Created: 1997
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__
12
13 #include "wx/defs.h"
14 #include "wx/object.h"
15 #include "wx/mmedia/defs.h"
16
17 typedef struct wxCDtime {
18 wxUint8 track;
19 wxUint8 hour, min, sec;
20 } wxCDtime;
21
22 class WXDLLIMPEXP_MMEDIA wxCDAudio : public wxObject {
23 DECLARE_ABSTRACT_CLASS(wxCDAudio)
24 public:
25 typedef enum { PLAYING, PAUSED, STOPPED } CDstatus;
26 // Table of contents manager
27 class WXDLLIMPEXP_MMEDIA CDtoc {
28 protected:
29 wxCDtime *tracks_time, *tracks_pos;
30 wxCDtime total_time;
31 public:
32 //
33 CDtoc(wxCDtime& tot_tm, wxCDtime *trks_tm, wxCDtime *trks_pos)
34 { tracks_time = trks_tm; total_time = tot_tm; tracks_pos = trks_pos; }
35
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; }
44 };
45 public:
46 //
47 wxCDAudio() : wxObject() {}
48 //
49 virtual ~wxCDAudio() {}
50
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);
55 //
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;
67 // CD ok
68 virtual bool Ok() const = 0;
69 };
70
71 #endif