GUI: sample resampling

This commit is contained in:
tildearrow 2022-03-20 03:14:00 -05:00
parent 90a18611cd
commit 03cb910e93
6 changed files with 517 additions and 4 deletions

View file

@ -19,6 +19,15 @@
#include "../ta-utils.h"
enum DivResampleFilters {
DIV_RESAMPLE_NONE=0,
DIV_RESAMPLE_LINEAR,
DIV_RESAMPLE_CUBIC,
DIV_RESAMPLE_BLEP,
DIV_RESAMPLE_SINC,
DIV_RESAMPLE_BEST
};
struct DivSample {
String name;
int rate, centerRate, loopStart, loopOffP;
@ -53,6 +62,15 @@ struct DivSample {
unsigned int samples;
/**
* @warning DO NOT USE - internal functions
*/
bool resampleNone(double rate);
bool resampleLinear(double rate);
bool resampleCubic(double rate);
bool resampleBlep(double rate);
bool resampleSinc(double rate);
/**
* save this sample to a file.
* @param path a path.
@ -84,6 +102,15 @@ struct DivSample {
*/
bool resize(unsigned int count);
/**
* change the sample rate.
* @warning do not attempt to resample outside of a synchronized block!
* @param rate number of samples.
* @param filter the interpolation filter.
* @return whether it was successful.
*/
bool resample(double rate, int filter);
/**
* initialize the rest of sample formats for this sample.
*/