1998-11-09 18:37:38 +00:00
|
|
|
// -*- c++ -*-
|
|
|
|
// /////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: cdbase.h
|
|
|
|
// Purpose: wxMMedia
|
|
|
|
// Author: Guilhem Lavaux
|
|
|
|
// Created: 1997
|
|
|
|
// Updated: 1998
|
|
|
|
// Copyright: (C) 1997, 1998, Guilhem Lavaux
|
|
|
|
// License: wxWindows license
|
|
|
|
// /////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef __CDA_base_H__
|
|
|
|
#define __CDA_base_H__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WX_PRECOMP
|
|
|
|
#include "wx_prec.h"
|
|
|
|
#else
|
|
|
|
#include "wx/wx.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct wxCDtime {
|
|
|
|
wxUint8 track;
|
|
|
|
wxUint8 hour, min, sec;
|
|
|
|
} wxCDtime;
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxCDAudio : public wxObject {
|
|
|
|
DECLARE_ABSTRACT_CLASS(wxCDAudio)
|
|
|
|
public:
|
|
|
|
typedef enum { PLAYING, PAUSED, STOPPED } CDstatus;
|
1999-08-14 12:06:35 +00:00
|
|
|
// Table of contents manager
|
1998-11-09 18:37:38 +00:00
|
|
|
class CDtoc {
|
|
|
|
protected:
|
|
|
|
wxCDtime *tracks_time, *tracks_pos;
|
|
|
|
wxCDtime total_time;
|
|
|
|
public:
|
1999-08-14 12:06:35 +00:00
|
|
|
//
|
1998-11-09 18:37:38 +00:00
|
|
|
CDtoc(wxCDtime& tot_tm, wxCDtime *trks_tm, wxCDtime *trks_pos)
|
|
|
|
{ tracks_time = trks_tm; total_time = tot_tm; tracks_pos = trks_pos; }
|
|
|
|
|
1999-08-14 12:06:35 +00:00
|
|
|
// Returns the length of the specified track
|
|
|
|
// track: track to get length
|
1998-11-09 18:37:38 +00:00
|
|
|
wxCDtime GetTrackTime(wxUint8 track) const;
|
1999-08-14 12:06:35 +00:00
|
|
|
// Returns the position of the specified track
|
|
|
|
// track: track to get position
|
1998-11-09 18:37:38 +00:00
|
|
|
wxCDtime GetTrackPos(wxUint8 track) const;
|
1999-08-14 12:06:35 +00:00
|
|
|
// Returns the total time
|
1998-11-09 18:37:38 +00:00
|
|
|
inline wxCDtime GetTotalTime() const { return total_time; }
|
|
|
|
};
|
|
|
|
public:
|
1999-08-14 12:06:35 +00:00
|
|
|
//
|
1998-11-09 18:37:38 +00:00
|
|
|
wxCDAudio() : wxObject() {}
|
1999-08-14 12:06:35 +00:00
|
|
|
//
|
1998-11-09 18:37:38 +00:00
|
|
|
virtual ~wxCDAudio() {}
|
|
|
|
|
1999-08-14 12:06:35 +00:00
|
|
|
// Play audio at the specified position
|
1998-11-09 18:37:38 +00:00
|
|
|
virtual bool Play(const wxCDtime& beg_play, const wxCDtime& end_play) = 0;
|
1999-08-14 12:06:35 +00:00
|
|
|
// Play audio from the specified to the end of the CD audio
|
1998-11-09 18:37:38 +00:00
|
|
|
bool Play(const wxCDtime& beg_play);
|
1999-08-14 12:06:35 +00:00
|
|
|
//
|
1998-11-09 18:37:38 +00:00
|
|
|
bool Play(wxUint8 beg_track, wxUint8 end_track = 0);
|
1999-08-14 12:06:35 +00:00
|
|
|
// Pause the audio playing
|
1998-11-09 18:37:38 +00:00
|
|
|
virtual bool Pause() = 0;
|
1999-08-14 12:06:35 +00:00
|
|
|
// Resume a paused audio playing
|
1998-11-09 18:37:38 +00:00
|
|
|
virtual bool Resume() = 0;
|
1999-08-14 12:06:35 +00:00
|
|
|
// Get the current CD status
|
1998-11-09 18:37:38 +00:00
|
|
|
virtual CDstatus GetStatus() = 0;
|
1999-08-14 12:06:35 +00:00
|
|
|
// Get the current playing time
|
1998-11-09 18:37:38 +00:00
|
|
|
virtual wxCDtime GetTime() = 0;
|
1999-08-14 12:06:35 +00:00
|
|
|
// Returns the table of contents
|
1998-11-09 18:37:38 +00:00
|
|
|
virtual const CDtoc& GetToc() = 0;
|
1999-08-14 12:06:35 +00:00
|
|
|
// CD ok
|
1998-11-09 18:37:38 +00:00
|
|
|
virtual bool Ok() const = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|