samples may have loop points
This commit is contained in:
parent
755042a8fe
commit
785f7e4d40
4 changed files with 16 additions and 6 deletions
|
|
@ -1312,7 +1312,13 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
|||
sample->depth=reader.readC();
|
||||
|
||||
// reserved
|
||||
for (int j=0; j<7; j++) reader.readC();
|
||||
for (int j=0; j<3; j++) reader.readC();
|
||||
|
||||
if (ds.version>=18) {
|
||||
sample->loopStart=reader.readI();
|
||||
} else {
|
||||
reader.readI();
|
||||
}
|
||||
|
||||
sample->data=new short[sample->length];
|
||||
reader.read(sample->data,2*sample->length);
|
||||
|
|
@ -1777,9 +1783,10 @@ SafeWriter* DivEngine::saveFur() {
|
|||
w->writeS(sample->vol);
|
||||
w->writeS(sample->pitch);
|
||||
w->writeC(sample->depth);
|
||||
for (int j=0; j<7; j++) { // reserved
|
||||
for (int j=0; j<3; j++) { // reserved
|
||||
w->writeC(0);
|
||||
}
|
||||
w->writeI(sample->loopStart);
|
||||
|
||||
w->write(sample->data,sample->length*2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
#include <map>
|
||||
#include <queue>
|
||||
|
||||
#define DIV_VERSION "0.4pre2"
|
||||
#define DIV_ENGINE_VERSION 18
|
||||
#define DIV_VERSION "0.4pre3"
|
||||
#define DIV_ENGINE_VERSION 19
|
||||
|
||||
enum DivStatusView {
|
||||
DIV_STATUS_NOTHING=0,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
struct DivSample {
|
||||
String name;
|
||||
int length, rate;
|
||||
int length, rate, loopStart;
|
||||
signed char vol, pitch;
|
||||
unsigned char depth;
|
||||
short* data;
|
||||
|
|
@ -15,6 +15,7 @@ struct DivSample {
|
|||
name(""),
|
||||
length(0),
|
||||
rate(32000),
|
||||
loopStart(-1),
|
||||
vol(0),
|
||||
pitch(0),
|
||||
depth(16),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue