--- libgig/trunk/src/DLS.cpp 2008/03/06 20:42:22 1713 +++ libgig/trunk/src/DLS.cpp 2012/02/11 11:08:01 2310 @@ -2,7 +2,7 @@ * * * libgig - C++ cross-platform Gigasampler format file access library * * * - * Copyright (C) 2003-2007 by Christian Schoenebeck * + * Copyright (C) 2003-2009 by Christian Schoenebeck * * * * * * This library is free software; you can redistribute it and/or modify * @@ -600,8 +600,10 @@ // copy old loops array (skipping given loop) for (int i = 0, o = 0; i < SampleLoops; i++) { if (&pSampleLoops[i] == pLoopDef) continue; - if (o == SampleLoops - 1) + if (o == SampleLoops - 1) { + delete[] pNewLoops; throw Exception("Could not delete Sample Loop, because it does not exist"); + } pNewLoops[o] = pSampleLoops[i]; o++; } @@ -1430,6 +1432,17 @@ delete pInstrument; } + /** @brief File name of this DLS file. + * + * This method returns the file name as it was provided when loading + * the respective DLS file. However in case the File object associates + * an empty, that is new DLS file, which was not yet saved to disk, + * this method will return an empty string. + */ + String File::GetFileName() { + return pRIFF->GetFileName(); + } + /** * Apply all the DLS file's current instruments, samples and settings to * the respective RIFF chunks. You have to call Save() to make changes