]>
Commit | Line | Data |
---|---|---|
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 "cdbase.h" | |
14 | ||
15 | #ifdef __BORLANDC__ | |
16 | #pragma hdrstop | |
17 | #endif | |
18 | ||
19 | wxCDtime wxCDAudio::CDtoc::GetTrackTime(wxUint8 track) const | |
20 | { | |
21 | if (track > total_time.track) { | |
22 | wxCDtime dummy_time = {0, 0, 0, 0}; | |
23 | return dummy_time; | |
24 | } | |
25 | return tracks_time[track]; | |
26 | } | |
27 | ||
28 | wxCDtime wxCDAudio::CDtoc::GetTrackPos(wxUint8 track) const | |
29 | { | |
30 | if (track > total_time.track) { | |
31 | wxCDtime dummy_time = {0, 0, 0, 0}; | |
32 | return dummy_time; | |
33 | } | |
34 | return tracks_pos[track]; | |
35 | } | |
36 | ||
37 | bool wxCDAudio::Play(const wxCDtime& beg_play) | |
38 | { | |
39 | return Play(beg_play, GetToc().GetTotalTime()); | |
40 | } | |
41 | ||
42 | bool wxCDAudio::Play(wxUint8 beg_track, wxUint8 end_track) | |
43 | { | |
44 | wxCDtime beg_play = GetToc().GetTrackPos(beg_track); | |
45 | wxCDtime end_play; | |
46 | ||
47 | if (end_track) | |
48 | end_play = GetToc().GetTrackPos(end_track); | |
49 | else | |
50 | end_play = GetToc().GetTotalTime(); | |
51 | return Play(beg_play, end_play); | |
52 | } |