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