Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/audio/AudioManager.h @ 1049

Last change on this file since 1049 was 1039, checked in by rgrieder, 17 years ago
  • train riding doesn't have to be boring
  • added some license notes
  • removed certain header dependencies in audio
  • changed order of header file inclusion in orxonox and audio (coding style guide will be updated)
File size: 2.4 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *
4 *
5 *   License notice:
6 *
7 *   This program is free software; you can redistribute it and/or
8 *   modify it under the terms of the GNU General Public License
9 *   as published by the Free Software Foundation; either version 2
10 *   of the License, or (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, write to the Free Software
19 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 *
21 *   Author:
22 *      Nicolas Perrenoud <nicolape@ee.ethz.ch>
23 *   Co-authors:
24 *      ...
25 *
26 */
27
28#ifndef _AudioManager_H__
29#define _AudioManager_H__
30
31#include "AudioPrereqs.h"
32
33#include <vector>
34#include <string>
35
36#include "core/Tickable.h"
37#include "AudioBuffer.h"
38#include "AudioSource.h"
39#include "AudioStream.h"
40
41namespace audio
42{
43  class _AudioExport AudioManager : public orxonox::Tickable
44        {
45        public:
46
47                // Init audio
48                AudioManager();
49
50                // Kill audio and set buffers, sources and memory free
51                ~AudioManager();
52
53                // Set listener position
54                void setPos(std::vector<float> newPosition);
55
56                // Set listener speed
57                void setSpeed(std::vector<float> newSpeed);
58
59                // Set listener orientation (first is direction
60                // the listener looks at, the second is the direction
61                // upwards the listener)
62                void setOri(std::vector<float> at, std::vector<float> up);
63
64                // Parses given xml string
65                void loadParams();
66
67                // Update
68                void tick(float dt);
69
70                void ambientAdd(std::string file);
71                void ambientStart();
72                void ambientStop();
73
74        private:
75
76                // Background sound
77    std::vector<AudioStream> bgSounds;
78                int currentBgSound;
79
80
81
82                std::string ambientPath;
83       
84                // Vector containing all audio files
85                std::vector<AudioBuffer> buffers;
86                // Vector containing all audio sources which referer to one buffer
87                std::vector<AudioSource> sources;
88                // The ambient background sound         
89                AudioSource ambient;
90               
91                std::vector<float> listenerPosition;
92                std::vector<float> listenerSpeed;
93                std::vector<float> listenerAt;
94                std::vector<float> listenerup;         
95        };     
96}
97
98#endif /* _AudioManager_H__ */
Note: See TracBrowser for help on using the repository browser.