Deluge Firmware 1.3.0
Build date: 2025.04.16
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
24extern "C" {
25#include "fatfs/ff.h"
26}
27
28class SampleRecorder;
29
30class AudioRecorder final : public UI {
31public:
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
57private:
58 void finishRecording();
59 bool setupRecordingToFile(AudioInputChannel newMode, int32_t newNumChannels, AudioRecordingFolder folderID,
60 bool writeLoopPoints = false, bool shouldNormalize = true);
61};
62
63extern AudioRecorder audioRecorder;
Definition audio_recorder.h:30
Definition sample_recorder.h:49