mirror of
https://github.com/thestk/stk
synced 2026-01-11 12:01:52 +00:00
Fix for FileWvIn and FileLoop classes so that files are closed unless chunking.
This commit is contained in:
@@ -95,7 +95,7 @@ class FileLoop : protected FileWvIn
|
||||
corresponds to file cycles per second. The frequency can be
|
||||
negative, in which case the loop is read in reverse order.
|
||||
*/
|
||||
void setFrequency( StkFloat frequency ) { this->setRate( file_.fileSize() * frequency / Stk::sampleRate() ); };
|
||||
void setFrequency( StkFloat frequency ) { this->setRate( fileSize_ * frequency / Stk::sampleRate() ); };
|
||||
|
||||
//! Increment the read pointer by \e time samples, modulo file size.
|
||||
void addTime( StkFloat time );
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
virtual void normalize( StkFloat peak );
|
||||
|
||||
//! Return the file size in sample frames.
|
||||
virtual unsigned long getSize( void ) const { return file_.fileSize(); };
|
||||
virtual unsigned long getSize( void ) const { return fileSize_; };
|
||||
|
||||
//! Return the input file sample rate in Hz (not the data read rate).
|
||||
/*!
|
||||
@@ -171,6 +171,7 @@ protected:
|
||||
bool chunking_;
|
||||
StkFloat time_;
|
||||
StkFloat rate_;
|
||||
unsigned long fileSize_;
|
||||
unsigned long chunkThreshold_;
|
||||
unsigned long chunkSize_;
|
||||
long chunkPointer_;
|
||||
|
||||
Reference in New Issue
Block a user