ScummVM API documentation
cdplayer.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21#ifndef PELROCK_CDPLAYER_H
22#define PELROCK_CDPLAYER_H
23
24namespace Pelrock {
25
26class PelrockEventManager;
27class ResourceManager;
28class SoundManager;
29
30class CDPlayer {
31
32 enum CDControls {
33 STOP_BUTTON,
34 PAUSE_BUTTON,
35 PLAY_BUTTON,
36 PREVIOUS_BUTTON,
37 NEXT_BUTTON,
38 NO_CDBUTTON
39 };
40
41public:
43 ~CDPlayer();
44
45 void run();
46
47private:
48 void init();
49 void loadTrackNames();
50 void drawScreen();
51 void drawButtons();
52 void loadBackground();
53 void loadControls();
54 void checkMouse(int x, int y);
55 void cleanup();
56 CDControls isButtonClicked(int x, int y);
57
58 ResourceManager *_res;
59 SoundManager *_sound;
60 PelrockEventManager *_events;
61 Graphics::ManagedSurface _backgroundScreen;
62 Graphics::ManagedSurface _compositeScreen;
63 byte *_palette;
64 byte *_controls;
65 Common::String trackNames[31];
66 byte *_buttons[5][2];
67 Common::Rect _buttonRects[5] = {
68 Common::Rect(Common::Point(17, 46), 37, 26), // Stop
69 Common::Rect(Common::Point(57, 48), 33, 23), // Pause
70 Common::Rect(Common::Point(92, 44), 34, 28), // Play
71 Common::Rect(Common::Point(128, 45), 38, 24), // Previous
72 Common::Rect(Common::Point(168, 44), 41, 28) // Next
73 };
74 int _selectedTrack = 2;
75 CDControls _selectedButton = NO_CDBUTTON;
76};
77
78} // End of namespace Pelrock
79
80#endif
Definition: str.h:59
Definition: managed_surface.h:51
Definition: cdplayer.h:30
Definition: events.h:28
Definition: resources.h:30
Definition: sound.h:55
Definition: rect.h:144
Definition: rect.h:536