ScummVM API documentation
diskplayerscene.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 
22 #ifndef NEVERHOOD_DISKPLAYERSCENE_H
23 #define NEVERHOOD_DISKPLAYERSCENE_H
24 
25 #include "neverhood/neverhood.h"
26 #include "neverhood/resourceman.h"
27 #include "neverhood/scene.h"
28 
29 namespace Neverhood {
30 
31 class DiskplayerScene;
32 class SmackerPlayer;
33 
35 public:
37  void stDropKey();
38 protected:
39  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
40  void stDropKeyDone();
41 };
42 
44 public:
46  void press();
47  void release();
48 protected:
49  DiskplayerScene *_diskplayerScene;
50  bool _isPlaying;
51  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
52 };
53 
54 class DiskplayerSlot : public Entity {
55 public:
56  DiskplayerSlot(NeverhoodEngine *vm, DiskplayerScene *diskplayerScene, int slotIndex, bool isAvailable);
57  void activate();
58  void stop();
59  void appear();
60  void play();
61  void setLocked(bool isLocked) { _isLocked = isLocked; }
62 protected:
63  DiskplayerScene *_diskplayerScene;
64  Sprite *_inactiveSlot;
65  Sprite *_appearSlot;
66  Sprite *_activeSlot;
67  int _initialBlinkCountdown;
68  int _blinkCountdown;
69  bool _isLocked;
70  bool _isBlinking;
71  void update();
72 };
73 
74 enum {
75  kUSStopped = 0,
76  kUSTuningIn = 1,
77  kUSPlaying = 2,
78  kUSPlayingFinal = 3
79 };
80 
81 class DiskplayerScene : public Scene {
82 public:
83  DiskplayerScene(NeverhoodEngine *vm, Module *parentModule, int paletteIndex);
84  bool getDropKey() const { return _dropKey; }
85 protected:
86  SmackerPlayer *_diskSmackerPlayer;
87  DiskplayerPlayButton *_ssPlayButton;
88  AsDiskplayerSceneKey *_asKey;
89  DiskplayerSlot *_diskSlots[20];
90  DiskplayerSlot *_finalDiskSlot;
91  int _updateStatus;
92  bool _diskAvailable[20];
93  int _diskIndex;
94  int _appearCountdown;
95  int _tuneInCountdown;
96  bool _hasAllDisks;
97  bool _inputDisabled;
98  bool _dropKey;
99  void update();
100  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
101  void openSmacker(uint32 fileHash, bool keepLastFrame);
102  void stop();
103  void tuneIn();
104  void playDisk();
105  void playStatic();
106 };
107 
108 } // End of namespace Neverhood
109 
110 #endif /* NEVERHOOD_DISKPLAYERSCENE_H */
Definition: diskplayerscene.h:54
Definition: diskplayerscene.h:43
Definition: background.h:30
Definition: neverhood.h:60
Definition: diskplayerscene.h:81
Definition: sprite.h:140
Definition: entity.h:42
Definition: entity.h:77
Definition: smackerplayer.h:61
Definition: scene.h:41
Definition: sprite.h:54
Definition: sprite.h:119
Definition: module.h:45
Definition: diskplayerscene.h:34