]> git.saurik.com Git - wxWidgets.git/blame - utils/wxMMedia2/lib/cdbase.h
Added new file dialog
[wxWidgets.git] / utils / wxMMedia2 / lib / cdbase.h
CommitLineData
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
18#ifdef WX_PRECOMP
19#include "wx_prec.h"
20#else
21#include "wx/wx.h"
22#endif
4d6306eb
GL
23
24typedef struct wxCDtime {
25 wxUint8 track;
26 wxUint8 hour, min, sec;
27} wxCDtime;
28
4d6306eb
GL
29class WXDLLEXPORT wxCDAudio : public wxObject {
30 DECLARE_ABSTRACT_CLASS(wxCDAudio)
31public:
4d6306eb 32 typedef enum { PLAYING, PAUSED, STOPPED } CDstatus;
526ddb13 33 // Table of contents manager
4d6306eb
GL
34 class CDtoc {
35 protected:
36 wxCDtime *tracks_time, *tracks_pos;
37 wxCDtime total_time;
38 public:
526ddb13 39 //
4d6306eb
GL
40 CDtoc(wxCDtime& tot_tm, wxCDtime *trks_tm, wxCDtime *trks_pos)
41 { tracks_time = trks_tm; total_time = tot_tm; tracks_pos = trks_pos; }
42
526ddb13
GL
43 // Returns the length of the specified track
44 // track: track to get length
4d6306eb 45 wxCDtime GetTrackTime(wxUint8 track) const;
526ddb13
GL
46 // Returns the position of the specified track
47 // track: track to get position
4d6306eb 48 wxCDtime GetTrackPos(wxUint8 track) const;
526ddb13 49 // Returns the total time
4d6306eb
GL
50 inline wxCDtime GetTotalTime() const { return total_time; }
51 };
52public:
526ddb13 53 //
4d6306eb 54 wxCDAudio() : wxObject() {}
526ddb13 55 //
4d6306eb
GL
56 virtual ~wxCDAudio() {}
57
526ddb13 58 // Play audio at the specified position
4d6306eb 59 virtual bool Play(const wxCDtime& beg_play, const wxCDtime& end_play) = 0;
526ddb13 60 // Play audio from the specified to the end of the CD audio
4d6306eb 61 bool Play(const wxCDtime& beg_play);
526ddb13 62 //
4d6306eb 63 bool Play(wxUint8 beg_track, wxUint8 end_track = 0);
526ddb13 64 // Pause the audio playing
4d6306eb 65 virtual bool Pause() = 0;
526ddb13 66 // Resume a paused audio playing
4d6306eb 67 virtual bool Resume() = 0;
526ddb13 68 // Get the current CD status
4d6306eb 69 virtual CDstatus GetStatus() = 0;
526ddb13 70 // Get the current playing time
4d6306eb 71 virtual wxCDtime GetTime() = 0;
526ddb13 72 // Returns the table of contents
4d6306eb 73 virtual const CDtoc& GetToc() = 0;
526ddb13 74 // CD ok
4d6306eb
GL
75 virtual bool Ok() const = 0;
76};
77
78#endif