]> git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia/cdbase.h
fixed somebody's poorly done StreamSize-->GetSize transition
[wxWidgets.git] / utils / wxMMedia / cdbase.h
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
18 #ifdef WX_PRECOMP
19 #include "wx_prec.h"
20 #else
21 #include "wx/wx.h"
22 #endif
23 #include "mmtype.h"
24
25 typedef struct wxCDtime {
26 wxUint8 track;
27 wxUint8 hour, min, sec;
28 } wxCDtime;
29
30 ///
31 class WXDLLEXPORT wxCDAudio : public wxObject {
32 DECLARE_ABSTRACT_CLASS(wxCDAudio)
33 public:
34 ///
35 typedef enum { PLAYING, PAUSED, STOPPED } CDstatus;
36 /// Table of contents manager
37 class CDtoc {
38 protected:
39 wxCDtime *tracks_time, *tracks_pos;
40 wxCDtime total_time;
41 public:
42 ///
43 CDtoc(wxCDtime& tot_tm, wxCDtime *trks_tm, wxCDtime *trks_pos)
44 { tracks_time = trks_tm; total_time = tot_tm; tracks_pos = trks_pos; }
45
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; }
54 };
55 public:
56 ///
57 wxCDAudio() : wxObject() {}
58 ///
59 virtual ~wxCDAudio() {}
60
61 /// Play audio at the specified position
62 /**
63 * @param beg_play start position
64 * @param end_play end position
65 */
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
68 /**
69 * @param beg_play start position
70 */
71 bool Play(const wxCDtime& beg_play);
72 ///
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;
84 /// CD ok
85 virtual bool Ok() const = 0;
86 };
87
88 #endif