Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimpleScene.h
Go to the documentation of this file.
1 //
2 // C++ Interface: Audio::SimpleScene
3 //
4 #ifndef __AUDIO_SIMPLESCENE_H__INCLUDED__
5 #define __AUDIO_SIMPLESCENE_H__INCLUDED__
6 
7 #include "Exceptions.h"
8 #include "Types.h"
9 #include "Scene.h"
10 #include "Listener.h"
11 
12 #include <set>
13 
14 
15 namespace Audio {
16 
17  // Forwards
18  class Source;
19  class SimpleSource;
20 
27  class SimpleScene : public Scene, public SharedFromThis<SimpleScene>
28  {
29  typedef std::set<SharedPtr<Source> > SourceSet;
30 
31  Listener listener;
32 
33  SourceSet activeSources;
34 
35  public:
36  typedef SourceSet::iterator SourceIterator;
37 
38  public:
39 
40  //
41  // Standard Scene interface
42  //
43 
45  SimpleScene(const std::string &name) throw();
46 
47  virtual ~SimpleScene();
48 
52  virtual void add(SharedPtr<Source> source) throw(Exception);
53 
57  virtual void remove(SharedPtr<Source> source) throw(NotFoundException);
58 
60  virtual Listener& getListener() throw();
61 
62 
63  //
64  // SimpleScene-specific interface
65  //
66 
68  virtual void notifySourcePlaying(SharedPtr<Source> source, bool playing) throw(Exception);
69 
72 
75 
76  protected:
77  void attach(SimpleSource *source) throw();
78  void detach(SimpleSource *source) throw();
79  };
80 
81 };
82 
83 #endif//__AUDIO_SIMPLESCENE_H__INCLUDED__