Space Fighter
A "shmup" game for Computer Programming C++
Loading...
Searching...
No Matches
AudioSample.h
Go to the documentation of this file.
1
2/*
3 ██╗ ██╗ █████╗ ████████╗ █████╗ ███╗ ██╗ █████╗
4 ██║ ██╔╝ ██╔══██╗ ╚══██╔══╝ ██╔══██╗ ████╗ ██║ ██╔══██╗
5 █████╔╝ ███████║ ██║ ███████║ ██╔██╗ ██║ ███████║
6 ██╔═██╗ ██╔══██║ ██║ ██╔══██║ ██║╚██╗██║ ██╔══██║
7 ██║ ██╗ ██║ ██║ ██║ ██║ ██║ ██║ ╚████║ ██║ ██║
8 ╚═╝ ╚═╝ ╚═╝ ╚═╝/\ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝
9 /vvvvvvvvvvvvvvvvvvv \=========================================,
10 `^^^^^^^^^^^^^^^^^^^ /---------------------------------------"
11 Katana Engine \/ © 2012 - Shuriken Studios LLC
12 http://www.shurikenstudios.com
13*/
14
15#pragma once
16
17namespace KatanaEngine
18{
20 class AudioSample : public Resource
21 {
22
23 public:
24
26 virtual ~AudioSample();
27
28 static void ReserveSamples(int count) { al_reserve_samples(count); }
29
34 virtual bool Load(const std::string& path, ResourceManager* pManager);
35
39 virtual bool IsCloneable() const { return true; }
40
41
42 virtual bool Play();
43
44 virtual void SetLooping(const bool loop = true);
45
46 virtual void SetVolume(const float volume);
47
48
49 protected:
50
51 virtual void SetSample(ALLEGRO_SAMPLE* pSample);
52
53
54 private:
55
56 static bool s_alAddonInitialized;
57
58 ALLEGRO_SAMPLE* m_pSample = nullptr;
59 ALLEGRO_PLAYMODE m_playMode = ALLEGRO_PLAYMODE_ONCE;
60
61 float m_volume = 1;
62 };
63
64}
Represents a 2D grid of texels.
Definition AudioSample.h:21
virtual bool Load(const std::string &path, ResourceManager *pManager)
Load the desired font into memory.
virtual bool IsCloneable() const
Used to determine if the texture is cloneable.
Definition AudioSample.h:39
static void ReserveSamples(int count)
Definition AudioSample.h:28
virtual void SetSample(ALLEGRO_SAMPLE *pSample)
virtual void SetVolume(const float volume)
virtual void SetLooping(const bool loop=true)
Base class for all resource types to be managed by the ResourceManager class.
Definition Resource.h:23
Loads and manages the lifespan of objects from external files.
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...
Definition Animation.cpp:18