Deluge Firmware
Loading...
Searching...
No Matches
samplebrowser.h
Go to the documentation of this file.
1/*
2 * Copyright © 2015-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#ifndef FILEBROWSER_H
19#define FILEBROWSER_H
20
21#include "Browser.h"
22
23extern "C" {
24
25#include "fatfs/ff.h"
26
27
29 DIR* dp, /* Pointer to the open directory object */
30 FILINFO* fno, /* Pointer to file information to return */
31 FilePointer* filePointer
32);
33}
34
35
36
37class SoundDrum;
39class Source;
40class Sample;
41
42class SampleBrowser final : public Browser
43{
44public:
46 bool getGreyoutRowsAndCols(uint32_t* cols, uint32_t* rows);
47 bool opened();
48 void focusRegained();
49 int buttonAction(int x, int y, bool on, bool inCardRoutine);
50 int verticalEncoderAction(int offset, bool inCardRoutine);
51 int horizontalEncoderAction(int offset);
52 int padAction(int x, int y, int velocity);
54 int claimAudioFileForInstrument(bool makeWaveTableWorkAtAllCosts = false);
56 void scrollFinished();
57 bool importFolderAsKit();
59 int timerCallback();
60 bool claimCurrentFile(int mayDoPitchDetection = 1, int mayDoSingleCycle = 1, int mayDoWaveTable = 1); // 0 means no. 1 means auto. 2 means yes definitely
61 bool renderMainPads(uint32_t whichRows, uint8_t image[][displayWidth + sideBarWidth][3], uint8_t occupancyMask[][displayWidth + sideBarWidth],
62 bool drawUndefinedArea = true);
64
66
67protected:
68 void enterKeyPress();
69 void exitAction();
70 int backButtonAction();
71 void folderContentsReady(int entryDirection);
72 void currentFileChanged(int movementDirection);
73
74private:
75 void displayCurrentFilename();
76 void previewIfPossible(int movementDirection = 1);
77 void audioFileIsNowSet();
78 bool canImportWholeKit();
79 bool loadAllSamplesInFolder(bool detectPitch, int* getNumSamples, Sample*** getSortArea, bool* getDoingSingleCycle = NULL, int* getNumCharsInPrefix = NULL);
80 int getCurrentFilePath(String* path);
81 void drawKeysOverWaveform();
82 void autoDetectSideChainSending(SoundDrum* drum, Source* source, char const* fileName);
83 void possiblySetUpBlinking();
84
85 bool currentlyShowingSamplePreview;
86
87 bool qwertyCurrentlyDrawnOnscreen; // This will linger as true even when qwertyVisible has been set to false
88
89};
90
92
93#endif // FILEBROWSER_H
Definition: Browser.h:64
Definition: NumericLayerScrollingText.h:23
Definition: samplebrowser.h:43
void scrollFinished()
Definition: samplebrowser.cpp:624
void currentFileChanged(int movementDirection)
Definition: samplebrowser.cpp:228
bool renderMainPads(uint32_t whichRows, uint8_t image[][displayWidth+sideBarWidth][3], uint8_t occupancyMask[][displayWidth+sideBarWidth], bool drawUndefinedArea=true)
Definition: samplebrowser.cpp:2015
SampleBrowser()
Definition: samplebrowser.cpp:85
int timerCallback()
Definition: samplebrowser.cpp:276
int buttonAction(int x, int y, bool on, bool inCardRoutine)
Definition: samplebrowser.cpp:392
int claimAudioFileForInstrument(bool makeWaveTableWorkAtAllCosts=false)
Definition: samplebrowser.cpp:712
bool importFolderAsMultisamples()
Definition: samplebrowser.cpp:1536
int horizontalEncoderAction(int offset)
Definition: samplebrowser.cpp:1940
void focusRegained()
Definition: samplebrowser.cpp:193
bool canSeeViewUnderneath()
Definition: samplebrowser.cpp:2009
void enterKeyPress()
Definition: samplebrowser.cpp:330
int verticalEncoderAction(int offset, bool inCardRoutine)
Definition: samplebrowser.cpp:1999
bool opened()
Definition: samplebrowser.cpp:97
void exitAndNeverDeleteDrum()
Definition: samplebrowser.cpp:248
int backButtonAction()
Definition: samplebrowser.cpp:386
int padAction(int x, int y, int velocity)
Definition: samplebrowser.cpp:641
int claimAudioFileForAudioClip()
Definition: samplebrowser.cpp:723
void folderContentsReady(int entryDirection)
Definition: samplebrowser.cpp:199
bool importFolderAsKit()
Definition: samplebrowser.cpp:1773
bool getGreyoutRowsAndCols(uint32_t *cols, uint32_t *rows)
Definition: samplebrowser.cpp:494
void exitAction()
Definition: samplebrowser.cpp:255
bool claimCurrentFile(int mayDoPitchDetection=1, int mayDoSingleCycle=1, int mayDoWaveTable=1)
Definition: samplebrowser.cpp:745
String lastFilePathLoaded
Definition: samplebrowser.h:65
Definition: Sample.h:49
Definition: sounddrum.h:29
Definition: source.h:31
Definition: DString.h:25
#define displayWidth
Definition: definitions.h:176
#define sideBarWidth
Definition: definitions.h:222
SampleBrowser sampleBrowser
Definition: samplebrowser.cpp:81
FRESULT f_readdir_get_filepointer(DIR *dp, FILINFO *fno, FilePointer *filePointer)