neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
audio_instrument_atlas.hpp
Go to the documentation of this file.
1
// audio_instrument_atlas.hpp
2
/*
3
neogfx C++ App/Game Engine
4
Copyright (c) 2021 Leigh Johnston. All Rights Reserved.
5
6
This program is free software: you can redistribute it and / or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#include <
neogfx/neogfx.hpp
>
21
#include <
neogfx/audio/audio_primitives.hpp
>
22
#include <
neogfx/audio/i_audio_instrument_atlas.hpp
>
23
24
#pragma once
25
26
namespace
neogfx
27
{
28
class
audio_instrument_atlas
:
public
i_audio_instrument_atlas
29
{
30
private
:
31
typedef
std::tuple<neogfx::instrument, audio_sample_rate, note> note_key;
32
struct
sample_info
33
{
34
std::string sampleFile;
35
note
midiKeyLow;
36
note
midiKeyPitchCentre;
37
note
midiKeyHigh;
38
};
39
public
:
40
audio_instrument_atlas
();
41
public
:
42
bool
load_instrument
(
neogfx::instrument
aInstrument,
audio_sample_rate
aSampleRate)
override
;
43
i_audio_bitstream
&
instrument
(
neogfx::instrument
aInstrument,
audio_sample_rate
aSampleRate,
note
aNote)
override
;
44
private
:
45
std::map<neogfx::instrument, std::map<note, sample_info>> iSamples;
46
std::map<note_key, ref_ptr<i_audio_bitstream>> iNotes;
47
};
48
}
audio_primitives.hpp
neogfx::audio_instrument_atlas
Definition
audio_instrument_atlas.hpp:29
neogfx::audio_instrument_atlas::instrument
i_audio_bitstream & instrument(neogfx::instrument aInstrument, audio_sample_rate aSampleRate, note aNote) override
neogfx::audio_instrument_atlas::audio_instrument_atlas
audio_instrument_atlas()
neogfx::audio_instrument_atlas::load_instrument
bool load_instrument(neogfx::instrument aInstrument, audio_sample_rate aSampleRate) override
neogfx::i_audio_bitstream
Definition
i_audio_bitstream.hpp:28
neogfx::i_audio_instrument_atlas
Definition
i_audio_instrument_atlas.hpp:34
i_audio_instrument_atlas.hpp
neogfx
Definition
action.hpp:28
neogfx::instrument
instrument
Definition
audio_primitives.hpp:478
neogfx::note
note
Definition
audio_primitives.hpp:29
neogfx::audio_sample_rate
std::uint64_t audio_sample_rate
Definition
audio_primitives.hpp:956
neogfx.hpp
include
neogfx
audio
audio_instrument_atlas.hpp
Generated by
1.9.8