]> git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia/cdbase.cpp
wxPython 2.1b1:
[wxWidgets.git] / utils / wxMMedia / cdbase.cpp
1 ////////////////////////////////////////////////////////////////////////////////
2 // Name: sndsnd.cpp
3 // Purpose: wxMMedia
4 // Author: Guilhem Lavaux
5 // Created: 1997
6 // Updated: 1998
7 // Copyright: (C) 1997, 1998, Guilhem Lavaux
8 // License: wxWindows license
9 ////////////////////////////////////////////////////////////////////////////////
10 #ifdef __GNUG__
11 #pragma implementation
12 #endif
13 #include "wx/wxprec.h"
14 #include "cdbase.h"
15
16 #ifdef __BORLANDC__
17 #pragma hdrstop
18 #endif
19
20 wxCDtime wxCDAudio::CDtoc::GetTrackTime(wxUint8 track) const
21 {
22 if (track > total_time.track) {
23 wxCDtime dummy_time = {0, 0, 0, 0};
24 return dummy_time;
25 }
26 return tracks_time[track];
27 }
28
29 wxCDtime wxCDAudio::CDtoc::GetTrackPos(wxUint8 track) const
30 {
31 if (track > total_time.track) {
32 wxCDtime dummy_time = {0, 0, 0, 0};
33 return dummy_time;
34 }
35 return tracks_pos[track];
36 }
37
38 bool wxCDAudio::Play(const wxCDtime& beg_play)
39 {
40 return Play(beg_play, GetToc().GetTotalTime());
41 }
42
43 bool wxCDAudio::Play(wxUint8 beg_track, wxUint8 end_track)
44 {
45 wxCDtime beg_play = GetToc().GetTrackPos(beg_track);
46 wxCDtime end_play;
47
48 if (end_track)
49 end_play = GetToc().GetTrackPos(end_track);
50 else
51 end_play = GetToc().GetTotalTime();
52 return Play(beg_play, end_play);
53 }