]>
Commit | Line | Data |
---|---|---|
4d6306eb GL |
1 | // -*- c++ -*- |
2 | // ///////////////////////////////////////////////////////////////////////////// | |
3 | // Name: cdbase.h | |
4 | // Purpose: wxMMedia | |
5 | // Author: Guilhem Lavaux | |
6 | // Created: 1997 | |
7 | // Updated: 1998 | |
8 | // Copyright: (C) 1997, 1998, Guilhem Lavaux | |
9 | // License: wxWindows license | |
10 | // ///////////////////////////////////////////////////////////////////////////// | |
11 | #ifndef __CDA_base_H__ | |
12 | #define __CDA_base_H__ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
6c5e6376 | 18 | #include "wx/wxprec.h" |
4d6306eb | 19 | |
e2acb9ae RR |
20 | #include "wx/object.h" |
21 | ||
4d6306eb GL |
22 | typedef struct wxCDtime { |
23 | wxUint8 track; | |
24 | wxUint8 hour, min, sec; | |
25 | } wxCDtime; | |
26 | ||
4d6306eb GL |
27 | class WXDLLEXPORT wxCDAudio : public wxObject { |
28 | DECLARE_ABSTRACT_CLASS(wxCDAudio) | |
29 | public: | |
4d6306eb | 30 | typedef enum { PLAYING, PAUSED, STOPPED } CDstatus; |
526ddb13 | 31 | // Table of contents manager |
4d6306eb GL |
32 | class CDtoc { |
33 | protected: | |
34 | wxCDtime *tracks_time, *tracks_pos; | |
35 | wxCDtime total_time; | |
36 | public: | |
526ddb13 | 37 | // |
4d6306eb GL |
38 | CDtoc(wxCDtime& tot_tm, wxCDtime *trks_tm, wxCDtime *trks_pos) |
39 | { tracks_time = trks_tm; total_time = tot_tm; tracks_pos = trks_pos; } | |
40 | ||
526ddb13 GL |
41 | // Returns the length of the specified track |
42 | // track: track to get length | |
4d6306eb | 43 | wxCDtime GetTrackTime(wxUint8 track) const; |
526ddb13 GL |
44 | // Returns the position of the specified track |
45 | // track: track to get position | |
4d6306eb | 46 | wxCDtime GetTrackPos(wxUint8 track) const; |
526ddb13 | 47 | // Returns the total time |
4d6306eb GL |
48 | inline wxCDtime GetTotalTime() const { return total_time; } |
49 | }; | |
50 | public: | |
526ddb13 | 51 | // |
4d6306eb | 52 | wxCDAudio() : wxObject() {} |
526ddb13 | 53 | // |
4d6306eb GL |
54 | virtual ~wxCDAudio() {} |
55 | ||
526ddb13 | 56 | // Play audio at the specified position |
4d6306eb | 57 | virtual bool Play(const wxCDtime& beg_play, const wxCDtime& end_play) = 0; |
526ddb13 | 58 | // Play audio from the specified to the end of the CD audio |
4d6306eb | 59 | bool Play(const wxCDtime& beg_play); |
526ddb13 | 60 | // |
4d6306eb | 61 | bool Play(wxUint8 beg_track, wxUint8 end_track = 0); |
526ddb13 | 62 | // Pause the audio playing |
4d6306eb | 63 | virtual bool Pause() = 0; |
526ddb13 | 64 | // Resume a paused audio playing |
4d6306eb | 65 | virtual bool Resume() = 0; |
526ddb13 | 66 | // Get the current CD status |
4d6306eb | 67 | virtual CDstatus GetStatus() = 0; |
526ddb13 | 68 | // Get the current playing time |
4d6306eb | 69 | virtual wxCDtime GetTime() = 0; |
526ddb13 | 70 | // Returns the table of contents |
4d6306eb | 71 | virtual const CDtoc& GetToc() = 0; |
526ddb13 | 72 | // CD ok |
4d6306eb GL |
73 | virtual bool Ok() const = 0; |
74 | }; | |
75 | ||
76 | #endif |