2022-02-14 22:12:20 -05:00
|
|
|
/**
|
|
|
|
* Furnace Tracker - multi-system chiptune tracker
|
|
|
|
* Copyright (C) 2021-2022 tildearrow and contributors
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2021-12-15 14:15:44 -05:00
|
|
|
#include "../ta-utils.h"
|
|
|
|
|
2021-05-11 16:08:08 -04:00
|
|
|
struct DivSample {
|
|
|
|
String name;
|
2022-01-27 16:52:06 -05:00
|
|
|
int length, rate, centerRate, loopStart, loopOffP;
|
2021-05-11 16:26:38 -04:00
|
|
|
signed char vol, pitch;
|
2022-02-02 23:17:16 -05:00
|
|
|
// valid values are:
|
|
|
|
// - 0: ZX Spectrum overlay drum (1-bit PCM)
|
|
|
|
// - 1: 1-bit NES DPCM
|
|
|
|
// - 4: BRR
|
|
|
|
// - 5: raw ADPCM-A
|
|
|
|
// - 6: raw ADPCM-B
|
|
|
|
// - 8: 8-bit PCM
|
|
|
|
// - 16: 16-bit PCM
|
2021-05-11 16:26:38 -04:00
|
|
|
unsigned char depth;
|
2021-05-11 16:08:08 -04:00
|
|
|
short* data;
|
2022-02-22 04:01:57 -05:00
|
|
|
unsigned int rendLength, adpcmRendLength, rendOff, rendOffP, rendOffContiguous, rendOffQsound;
|
2021-05-13 03:39:26 -04:00
|
|
|
short* rendData;
|
2021-12-10 04:22:13 -05:00
|
|
|
unsigned char* adpcmRendData;
|
2021-05-13 03:39:26 -04:00
|
|
|
|
2021-12-18 01:03:59 -05:00
|
|
|
bool save(const char* path);
|
2021-05-13 03:39:26 -04:00
|
|
|
DivSample():
|
|
|
|
name(""),
|
|
|
|
length(0),
|
2021-12-23 18:04:44 -05:00
|
|
|
rate(32000),
|
2022-01-27 16:52:06 -05:00
|
|
|
centerRate(8363),
|
2022-01-15 17:54:21 -05:00
|
|
|
loopStart(-1),
|
2022-01-24 17:13:47 -05:00
|
|
|
loopOffP(0),
|
2021-05-13 03:39:26 -04:00
|
|
|
vol(0),
|
|
|
|
pitch(0),
|
|
|
|
depth(16),
|
|
|
|
data(NULL),
|
|
|
|
rendLength(0),
|
2021-12-10 22:51:50 -05:00
|
|
|
adpcmRendLength(0),
|
2021-12-10 23:41:00 -05:00
|
|
|
rendOff(0),
|
2022-01-24 12:39:05 -05:00
|
|
|
rendOffP(0),
|
2022-01-25 03:12:53 -05:00
|
|
|
rendOffContiguous(0),
|
2022-02-22 04:01:57 -05:00
|
|
|
rendOffQsound(0),
|
2021-12-10 04:22:13 -05:00
|
|
|
rendData(NULL),
|
|
|
|
adpcmRendData(NULL) {}
|
2021-12-15 14:15:44 -05:00
|
|
|
~DivSample();
|
2021-05-11 16:08:08 -04:00
|
|
|
};
|