2 |
* * |
* * |
3 |
* libgig - C++ cross-platform Gigasampler format file access library * |
* libgig - C++ cross-platform Gigasampler format file access library * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003-2017 by Christian Schoenebeck * |
* Copyright (C) 2003-2019 by Christian Schoenebeck * |
6 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
1407 |
*/ |
*/ |
1408 |
File::File() : Resource(NULL, pRIFF = new RIFF::File(RIFF_TYPE_DLS)) { |
File::File() : Resource(NULL, pRIFF = new RIFF::File(RIFF_TYPE_DLS)) { |
1409 |
pRIFF->SetByteOrder(RIFF::endian_little); |
pRIFF->SetByteOrder(RIFF::endian_little); |
1410 |
|
bOwningRiff = true; |
1411 |
pVersion = new version_t; |
pVersion = new version_t; |
1412 |
pVersion->major = 0; |
pVersion->major = 0; |
1413 |
pVersion->minor = 0; |
pVersion->minor = 0; |
1438 |
File::File(RIFF::File* pRIFF) : Resource(NULL, pRIFF) { |
File::File(RIFF::File* pRIFF) : Resource(NULL, pRIFF) { |
1439 |
if (!pRIFF) throw DLS::Exception("NULL pointer reference to RIFF::File object."); |
if (!pRIFF) throw DLS::Exception("NULL pointer reference to RIFF::File object."); |
1440 |
this->pRIFF = pRIFF; |
this->pRIFF = pRIFF; |
1441 |
|
bOwningRiff = false; |
1442 |
RIFF::Chunk* ckVersion = pRIFF->GetSubChunk(CHUNK_ID_VERS); |
RIFF::Chunk* ckVersion = pRIFF->GetSubChunk(CHUNK_ID_VERS); |
1443 |
if (ckVersion) { |
if (ckVersion) { |
1444 |
pVersion = new version_t; |
pVersion = new version_t; |
1510 |
if (pVersion) delete pVersion; |
if (pVersion) delete pVersion; |
1511 |
for (std::list<RIFF::File*>::iterator i = ExtensionFiles.begin() ; i != ExtensionFiles.end() ; i++) |
for (std::list<RIFF::File*>::iterator i = ExtensionFiles.begin() ; i != ExtensionFiles.end() ; i++) |
1512 |
delete *i; |
delete *i; |
1513 |
|
if (bOwningRiff) |
1514 |
|
delete pRIFF; |
1515 |
} |
} |
1516 |
|
|
1517 |
Sample* File::GetFirstSample() { |
Sample* File::GetFirstSample() { |