--- libgig/trunk/src/DLS.cpp 2005/11/22 09:11:17 808 +++ libgig/trunk/src/DLS.cpp 2005/11/22 11:26:55 809 @@ -1136,6 +1136,7 @@ * @returns pointer to new Sample object */ Sample* File::AddSample() { + if (!pSamples) LoadSamples(); __ensureMandatoryChunksExist(); RIFF::List* wvpl = pRIFF->GetSubList(LIST_TYPE_WVPL); // create new Sample object and its respective 'wave' list chunk @@ -1196,6 +1197,7 @@ * @returns pointer to new Instrument object */ Instrument* File::AddInstrument() { + if (!pInstruments) LoadInstruments(); __ensureMandatoryChunksExist(); if (!pInstruments) pInstruments = new InstrumentList; RIFF::List* lstInstruments = pRIFF->GetSubList(LIST_TYPE_LINS); @@ -1205,7 +1207,7 @@ return pInstrument; } - /** @brief Delete a instrument. + /** @brief Delete an instrument. * * This will delete the given Instrument object from the DLS file. You * have to call Save() to make this persistent to the file.