Deluge Firmware
1.3.0
Build date: 2026.08.29
Toggle main menu visibility
Loading...
Searching...
No Matches
audio_recorder.h
1
/*
2
* Copyright © 2016-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 "gui/ui/ui.h"
22
#include "hid/button.h"
23
24
extern
"C"
{
25
#include "fatfs/ff.h"
26
}
27
28
class
SampleRecorder
;
29
30
class
AudioRecorder final :
public
UI {
31
public
:
32
AudioRecorder();
33
bool
opened()
override
;
34
bool
getGreyoutColsAndRows(uint32_t* cols, uint32_t* rows)
override
;
35
36
ActionResult buttonAction(deluge::hid::Button b,
bool
on,
bool
inCardRoutine)
override
;
37
bool
beginOutputRecording(AudioRecordingFolder folder = AudioRecordingFolder::RESAMPLE,
38
AudioInputChannel channel = AudioInputChannel::OUTPUT,
bool
writeLoopPoints =
false
,
39
bool
shouldNormalize =
true
);
40
void
process();
41
void
slowRoutine();
42
bool
isCurrentlyResampling();
43
44
AudioInputChannel recordingSource;
45
46
SampleRecorder
* recorder;
47
48
void
endRecordingSoon(int32_t buttonLatency = 0);
49
50
void
renderOLED(
deluge::hid::display::oled_canvas::Canvas
& canvas)
override
;
51
52
bool
updatedRecordingStatus =
false
;
53
54
// ui
55
UIType
getUIType
()
override
{
return
UIType::AUDIO_RECORDER; }
56
57
private
:
58
void
finishRecording();
59
bool
setupRecordingToFile(AudioInputChannel newMode, int32_t newNumChannels, AudioRecordingFolder folderID,
60
bool
writeLoopPoints =
false
,
bool
shouldNormalize =
true
);
61
};
62
63
extern
AudioRecorder
audioRecorder;
AudioRecorder
Definition
audio_recorder.h:30
AudioRecorder::getUIType
UIType getUIType() override
What type of UI is this? e.g. UIType::ARRANGER.
Definition
audio_recorder.h:55
SampleRecorder
Definition
sample_recorder.h:53
deluge::hid::display::oled_canvas::Canvas
Definition
canvas.h:52