mirror of
https://github.com/thestk/stk
synced 2026-01-11 20:11:52 +00:00
Merge branch 'master' of https://github.com/thestk/stk
This commit is contained in:
@@ -141,6 +141,10 @@ bool FileRead :: getRawInfo( const char *fileName, unsigned int nChannels, StkFo
|
||||
oStream_ << "FileRead: Could not stat RAW file (" << fileName << ").";
|
||||
return false;
|
||||
}
|
||||
if ( nChannels == 0 ) {
|
||||
oStream_ << "FileRead: number of channels can't be 0 (" << fileName << ").";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Rawwave files have no header and by default, are assumed to
|
||||
// contain a monophonic stream of 16-bit signed integers in
|
||||
@@ -155,6 +159,10 @@ bool FileRead :: getRawInfo( const char *fileName, unsigned int nChannels, StkFo
|
||||
else if ( format == STK_SINT16 ) sampleBytes = 2;
|
||||
else if ( format == STK_SINT32 || format == STK_FLOAT32 ) sampleBytes = 4;
|
||||
else if ( format == STK_FLOAT64 ) sampleBytes = 8;
|
||||
else {
|
||||
oStream_ << "FileRead: StkFormat " << format << " is invalid (" << fileName << ").";
|
||||
return false;
|
||||
}
|
||||
|
||||
fileSize_ = (long) filestat.st_size / sampleBytes / channels_; // length in frames
|
||||
|
||||
@@ -614,7 +622,7 @@ bool FileRead :: getMatInfo( const char *fileName )
|
||||
if ( fread(&rate, 1, 1, fd_) != 1 ) goto error;
|
||||
srate = (StkFloat) rate;
|
||||
}
|
||||
if ( type == 2 ) { // UINT8
|
||||
else if ( type == 2 ) { // UINT8
|
||||
unsigned char rate;
|
||||
if ( fread(&rate, 1, 1, fd_) != 1 ) goto error;
|
||||
srate = (StkFloat) rate;
|
||||
|
||||
@@ -67,11 +67,6 @@ void TapDelay :: setTapDelays( std::vector<unsigned long> taps )
|
||||
oStream_ << "TapDelay::setTapDelay: argument (" << taps[i] << ") greater than maximum!\n";
|
||||
handleError( StkError::WARNING ); return;
|
||||
}
|
||||
|
||||
if ( taps[i] < 0 ) {
|
||||
oStream_ << "TapDelay::setDelay: argument (" << taps[i] << ") less than zero!\n";
|
||||
handleError( StkError::WARNING ); return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( taps.size() != outPoint_.size() ) {
|
||||
|
||||
Reference in New Issue
Block a user