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>
23
24#pragma once
25
26namespace neogfx
27{
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:
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}
i_audio_bitstream & instrument(neogfx::instrument aInstrument, audio_sample_rate aSampleRate, note aNote) override
bool load_instrument(neogfx::instrument aInstrument, audio_sample_rate aSampleRate) override
std::uint64_t audio_sample_rate