YSE sound engine  1.0
cross platform sound engine
 All Classes Namespaces Functions Pages
channelInterface.hpp
1 /*
2  ==============================================================================
3 
4  channel.h
5  Created: 30 Jan 2014 4:20:50pm
6  Author: yvan
7 
8  ==============================================================================
9 */
10 
11 #ifndef CHANNELINTERFACE_H_INCLUDED
12 #define CHANNELINTERFACE_H_INCLUDED
13 
14 #include <string>
15 #include "../headers/defines.hpp"
16 #include "../headers/types.hpp"
17 #include "channel.hpp"
18 
19 
20 namespace YSE {
21 
22  namespace SOUND {
23  class managerObject;
24  class implementationObject;
25  }
26 
27  namespace CHANNEL{
28 
29 
50  class API interfaceObject {
51  public:
52 
60  interfaceObject& create(const char * name, channel& parent);
61 
65  interfaceObject& setVolume(Flt value);
66 
70  Flt getVolume();
71 
78  interfaceObject& moveTo(interfaceObject& parent);
79 
85  interfaceObject& attachReverb();
86 
91  interfaceObject& setVirtual(Bool value);
92 
95  bool getVirtual();
96 
97  bool isValid();
98 
99  const char * getName() { return name.c_str(); }
100 
104  interfaceObject();
105  ~interfaceObject();
106  private:
107 
111  void createGlobal();
112 
113  Flt volume; // to remember the channel volume
114  Bool allowVirtual; // allows virtual sounds in this channel (defaults to true)
115  std::string name;
116  implementationObject * pimpl;
117 
118  // friend classes
119  friend class CHANNEL::implementationObject;
120  friend class SOUND::implementationObject;
121  friend class YSE::system;
122  friend class SOUND::managerObject;
123  };
124  }
125 
129  API channel& ChannelMaster();
130  API channel& ChannelFX();
131  API channel& ChannelMusic();
132  API channel& ChannelAmbient();
133  API channel& ChannelVoice();
134  API channel& ChannelGui();
135 }
136 
137 
138 
139 
140 #endif // CHANNEL_H_INCLUDED
Channels are used to control groups of sounds simultaniously.