Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
source.h
1/*
2 * Copyright © 2014-2023 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20#include "definitions_cxx.hpp"
21#include "model/sample/sample_controls.h"
22#include "storage/multi_range/multi_range_array.h"
23#include "util/phase_increment_fine_tuner.h"
24
25class Sound;
27class WaveTable;
28class SampleHolder;
29class DxPatch;
30
31class Source {
32public:
33 Source();
34 ~Source();
35
36 SampleControls sampleControls;
37
38 OscType oscType;
39
40 // These are not valid for Samples
41 int16_t transpose;
42 int8_t cents;
44
45 MultiRangeArray ranges;
46
47 DxPatch* dxPatch;
48 bool dxPatchChanged = false;
49 SampleRepeatMode repeatMode;
50
51 int8_t timeStretchAmount;
52
53 int16_t defaultRangeI; // -1 means none yet
54
55 bool renderInStereo(Sound* s, SampleHolder* sampleHolder = nullptr);
56 void setCents(int32_t newCents);
57 void recalculateFineTuner();
58 int32_t getLengthInSamplesAtSystemSampleRate(int32_t note, bool forTimeStretching = false);
59 void detachAllAudioFiles();
60 Error loadAllSamples(bool mayActuallyReadFiles);
61 void setReversed(bool newReversed);
62 int32_t getRangeIndex(int32_t note);
63 MultiRange* getRange(int32_t note);
64 MultiRange* getOrCreateFirstRange();
65 bool hasAtLeastOneAudioFileLoaded();
66 void doneReadingFromFile(Sound* sound);
67 bool hasAnyLoopEndPoint();
68 void setOscType(OscType newType);
69
70 DxPatch* ensureDxPatch();
71
72private:
73 void destructAllMultiRanges();
74};
Definition dx7note.h:38
Definition multi_range_array.h:26
Definition multi_range.h:23
Definition param_manager.h:174
Definition phase_increment_fine_tuner.h:21
Definition sample_controls.h:22
Definition sample_holder.h:32
Definition sound.h:71
Definition wave_table.h:42