--- libgig/trunk/src/SF.cpp 2019/02/22 11:17:58 3480 +++ libgig/trunk/src/SF.cpp 2019/02/22 12:12:50 3481 @@ -147,7 +147,8 @@ ::LoadString(ck, s); // function from helper.h } - Sample::Sample(RIFF::Chunk* ck, RIFF::Chunk* pCkSmpl, RIFF::Chunk* pCkSm24) { + Sample::Sample(File* file, RIFF::Chunk* ck, RIFF::Chunk* pCkSmpl, RIFF::Chunk* pCkSm24) { + this->pFile = file; this->pCkSmpl = pCkSmpl; this->pCkSm24 = pCkSm24; @@ -1122,7 +1123,7 @@ } count = int(ck->GetSize() / 46); for (int i = 0; i < count; i++) { - Samples.push_back(new Sample(ck, pCkSmpl, pCkSm24)); + Samples.push_back(new Sample(this, ck, pCkSmpl, pCkSm24)); } // Loading instrument regions @@ -1251,6 +1252,10 @@ return false; } + RIFF::File* File::GetRiffFile() { + return pRIFF; + } + /** * Loads the whole sample wave into RAM. Use * ReleaseSampleData() to free the memory if you don't need the cached