ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
te_music.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 TETRAEDGE_TE_TE_MUSIC_H
23 #define TETRAEDGE_TE_TE_MUSIC_H
24 
25 #include "audio/mixer.h"
26 #include "common/mutex.h"
27 #include "common/fs.h"
28 #include "common/str.h"
29 
30 #include "tetraedge/te/te_resource.h"
31 #include "tetraedge/te/te_signal.h"
32 #include "tetraedge/tetraedge.h"
33 
34 namespace Tetraedge {
35 
36 class TeMusic : public TeResource {
37 public:
38  TeMusic();
39  ~TeMusic();
40 
41  void close() {
42  stop();
43  }
44  void pause();
45  bool play();
46  bool repeat();
47  void repeat(bool val);
48  void resume();
49  void stop();
50 
51  byte currentData();
52  void entry();
53  const Common::Path &filePath() const {
54  return _rawPath;
55  }
56  bool isPlaying();
57  bool load(const Common::Path &path);
58  bool onSoundManagerVolumeChanged();
59  Common::Path path();
60  void setChannelName(const Common::String &name) {
61  _channelName = name;
62  }
63  const Common::String &channelName() const {
64  return _channelName;
65  }
66  void setFilePath(const Common::Path &name);
67  void update();
68  void volume(float vol);
69  float volume();
70 
71  TeSignal0Param &onStopSignal() { return _onStopSignal; }
72 
73  void setRetain(bool retain) { _retain = retain; }
74  bool retain() const { return _retain; }
75 
76 private:
77  Common::Path _rawPath; // Plain name of file requested
78  TetraedgeFSNode _fileNode; // file after finding it
79  Common::String _channelName;
80 
81  bool _repeat;
82  byte _currentData;
83 
84  bool _isPlaying;
85  bool _isPaused;
86  bool _retain;
87 
88  float _volume;
89 
90  Audio::SoundHandle _sndHandle;
91  bool _sndHandleValid;
92 
93  Common::Mutex _mutex;
94  TeSignal0Param _onStopSignal;
95 };
96 
97 } // end namespace Tetraedge
98 
99 #endif // TETRAEDGE_TE_TE_MUSIC_H
Definition: te_signal.h:40
Definition: str.h:59
Definition: detection.h:27
Definition: te_resource.h:31
Definition: tetraedge.h:58
Definition: path.h:52
Definition: mixer.h:49
Definition: mutex.h:67
Definition: te_music.h:36