1999-08-14 08:06:35 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
1998-11-09 13:37:38 -05:00
|
|
|
// Name: sndsnd.cpp
|
|
|
|
// Purpose: wxMMedia
|
|
|
|
// Author: Guilhem Lavaux
|
|
|
|
// Created: 1997
|
1999-08-14 08:06:35 -04:00
|
|
|
// Updated: 1999
|
|
|
|
// Copyright: (C) 1997, 1998, 1999 Guilhem Lavaux
|
1998-11-09 13:37:38 -05:00
|
|
|
// License: wxWindows license
|
1999-08-14 08:06:35 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
1998-11-09 13:37:38 -05:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
1999-01-08 05:54:10 -05:00
|
|
|
#include "wx/wxprec.h"
|
1998-11-09 13:37:38 -05:00
|
|
|
#include "cdbase.h"
|
|
|
|
|
|
|
|
#ifdef __BORLANDC__
|
|
|
|
#pragma hdrstop
|
|
|
|
#endif
|
|
|
|
|
1999-08-14 08:06:35 -04:00
|
|
|
#if !USE_SHARED_LIBRARY
|
|
|
|
IMPLEMENT_ABSTRACT_CLASS(wxCDAudio, wxObject)
|
|
|
|
#endif
|
|
|
|
|
1998-11-09 13:37:38 -05:00
|
|
|
wxCDtime wxCDAudio::CDtoc::GetTrackTime(wxUint8 track) const
|
|
|
|
{
|
|
|
|
if (track > total_time.track) {
|
|
|
|
wxCDtime dummy_time = {0, 0, 0, 0};
|
|
|
|
return dummy_time;
|
|
|
|
}
|
|
|
|
return tracks_time[track];
|
|
|
|
}
|
|
|
|
|
|
|
|
wxCDtime wxCDAudio::CDtoc::GetTrackPos(wxUint8 track) const
|
|
|
|
{
|
|
|
|
if (track > total_time.track) {
|
|
|
|
wxCDtime dummy_time = {0, 0, 0, 0};
|
|
|
|
return dummy_time;
|
|
|
|
}
|
|
|
|
return tracks_pos[track];
|
|
|
|
}
|
|
|
|
|
|
|
|
bool wxCDAudio::Play(const wxCDtime& beg_play)
|
|
|
|
{
|
|
|
|
return Play(beg_play, GetToc().GetTotalTime());
|
|
|
|
}
|
|
|
|
|
|
|
|
bool wxCDAudio::Play(wxUint8 beg_track, wxUint8 end_track)
|
|
|
|
{
|
|
|
|
wxCDtime beg_play = GetToc().GetTrackPos(beg_track);
|
|
|
|
wxCDtime end_play;
|
|
|
|
|
|
|
|
if (end_track)
|
|
|
|
end_play = GetToc().GetTrackPos(end_track);
|
|
|
|
else
|
|
|
|
end_play = GetToc().GetTotalTime();
|
|
|
|
return Play(beg_play, end_play);
|
|
|
|
}
|