gramods
OpenALContext.hh
1 
2 #ifndef GRAMODS_SOUND_OPENALCONTEXT
3 #define GRAMODS_SOUND_OPENALCONTEXT
4 
5 #include <gmSound/config.hh>
6 
7 #include <gmCore/OFactory.hh>
8 
9 #include <memory>
10 
11 namespace gramods {
12 namespace gmSound {
13 
18 class OpenALContext : public gmCore::Object {
19 
20 public:
21  OpenALContext();
22  virtual ~OpenALContext();
23 
29  void setDeviceName(std::string name);
30 
31  bool isOpen();
32 
33  static std::vector<std::string> getDeviceNames();
34 
38  void makeCurrent();
39 
40  std::string getDefaultKey() override { return "openALContext"; }
41  void initialize() override;
42 
43  GM_OFI_DECLARE;
44 
45 private:
46  struct Impl;
47  std::unique_ptr<Impl> _impl;
48 };
49 
50 }
51 }
52 
53 #endif
Base type for objects in the Gramods package for standardized handling of construction,...
Definition: Object.hh:42
The instantiation of this class will attempt to open a (specified) playback device and create a conte...
Definition: OpenALContext.hh:18
void makeCurrent()
Makes this context the current for subsequent calls.
Definition: OpenALContext.cpp:96
void setDeviceName(std::string name)
Sets the name of the playback device to open a context for.
Definition: OpenALContext.cpp:77
void initialize() override
Called to initialize the Object.
Definition: OpenALContext.cpp:32
std::string getDefaultKey() override
Returns the default key for the Object when automatically instantiated in a Configuration,...
Definition: OpenALContext.hh:40
Gramods, short for Graphics Modules, is a collection of weakly inter dependent and useful APIs for Vi...
Definition: config.hh:25