source: trunk/nv/sdl/sdl_audio.hh @ 543

Last change on this file since 543 was 543, checked in by epyon, 8 years ago
  • fixes in handle store
  • removal of get_handle
  • indices instead of handles
  • efficient handle store clears
File size: 1.3 KB
Line 
1// Copyright (C) 2012-2015 ChaosForge Ltd
2// http://chaosforge.org/
3//
4// This file is part of Nova libraries.
5// For conditions of distribution and use, see copying.txt file in root folder.
6
7/**
8 * @file sdl_audio.hh
9 * @author Kornel Kisielewicz epyon@chaosforge.org
10 * @brief SDL Audio interface
11 */
12
13#ifndef NV_SDL_AUDIO_HH
14#define NV_SDL_AUDIO_HH
15
16#include <nv/common.hh>
17#include <nv/interface/audio.hh>
18#include <nv/stl/handle_store.hh>
19
20namespace nv
21{
22
23        namespace sdl
24        {
25                struct sound_info
26                {
27                        void* sdl_sound;
28                };
29
30                class audio : public nv::audio
31                {
32                public:
33                        audio();
34                        virtual channel play_sound( sound a_sound, float volume = 1.0f, float pan = 0.0f );
35                        virtual channel play_sound( sound a_sound, vec3 position );
36                        virtual sound load_sound( const string_view& a_path );
37                        virtual void release( sound a_sound );
38                        virtual void set_orientation( vec3 forward, vec3 up );
39                        virtual void update( vec3 position );
40                        virtual ~audio();
41                private:
42                        void release( sound_info* info );
43
44                        vec3                                  m_position;
45                        vec3                                  m_forward;
46                        vec3                                  m_up;
47                        handle_store< sound_info, sound >     m_sounds;
48                };
49        }
50}
51
52#endif // NV_SDL_AUDIO_HH
Note: See TracBrowser for help on using the repository browser.