352 |
SaveString(CHUNK_ID_ITCH, lstINFO, Technician, String(""), UseFixedLengthStrings, 128); |
SaveString(CHUNK_ID_ITCH, lstINFO, Technician, String(""), UseFixedLengthStrings, 128); |
353 |
SaveString(CHUNK_ID_ISFT, lstINFO, Software, defaultSoftware, UseFixedLengthStrings, |
SaveString(CHUNK_ID_ISFT, lstINFO, Software, defaultSoftware, UseFixedLengthStrings, |
354 |
resourceType == LIST_TYPE_INS ? |
resourceType == LIST_TYPE_INS ? |
355 |
(Software == "" ? defaultSoftware.length() : Software.length()) : 128); |
(Software == "" ? defaultSoftware.length()+1 : Software.length()+1) : 128); |
356 |
SaveString(CHUNK_ID_IMED, lstINFO, Medium, String(""), UseFixedLengthStrings, 128); |
SaveString(CHUNK_ID_IMED, lstINFO, Medium, String(""), UseFixedLengthStrings, 128); |
357 |
SaveString(CHUNK_ID_ISRC, lstINFO, Source, String(""), UseFixedLengthStrings, 128); |
SaveString(CHUNK_ID_ISRC, lstINFO, Source, String(""), UseFixedLengthStrings, 128); |
358 |
SaveString(CHUNK_ID_ISRF, lstINFO, SourceForm, String(""), UseFixedLengthStrings, 128); |
SaveString(CHUNK_ID_ISRF, lstINFO, SourceForm, String(""), UseFixedLengthStrings, 128); |
481 |
} |
} |
482 |
} |
} |
483 |
|
|
484 |
|
/** |
485 |
|
* Adds a new sample loop with the provided loop definition. |
486 |
|
* |
487 |
|
* @param - points to a loop definition that is to be copied |
488 |
|
*/ |
489 |
|
void Sampler::AddSampleLoop(sample_loop_t* pLoopDef) { |
490 |
|
sample_loop_t* pNewLoops = new sample_loop_t[SampleLoops + 1]; |
491 |
|
// copy old loops array |
492 |
|
for (int i = 0; i < SampleLoops; i++) { |
493 |
|
pNewLoops[i] = pSampleLoops[i]; |
494 |
|
} |
495 |
|
// add the new loop |
496 |
|
pNewLoops[SampleLoops] = *pLoopDef; |
497 |
|
// free the old array and update the member variables |
498 |
|
if (SampleLoops) delete[] pSampleLoops; |
499 |
|
pSampleLoops = pNewLoops; |
500 |
|
SampleLoops++; |
501 |
|
} |
502 |
|
|
503 |
|
/** |
504 |
|
* Deletes an existing sample loop. |
505 |
|
* |
506 |
|
* @param pLoopDef - pointer to existing loop definition |
507 |
|
* @throws Exception - if given loop definition does not exist |
508 |
|
*/ |
509 |
|
void Sampler::DeleteSampleLoop(sample_loop_t* pLoopDef) { |
510 |
|
sample_loop_t* pNewLoops = new sample_loop_t[SampleLoops - 1]; |
511 |
|
// copy old loops array (skipping given loop) |
512 |
|
for (int i = 0, o = 0; i < SampleLoops; i++) { |
513 |
|
if (&pSampleLoops[i] == pLoopDef) continue; |
514 |
|
if (o == SampleLoops - 1) |
515 |
|
throw Exception("Could not delete Sample Loop, because it does not exist"); |
516 |
|
pNewLoops[o] = pSampleLoops[i]; |
517 |
|
o++; |
518 |
|
} |
519 |
|
// free the old array and update the member variables |
520 |
|
if (SampleLoops) delete[] pSampleLoops; |
521 |
|
pSampleLoops = pNewLoops; |
522 |
|
SampleLoops--; |
523 |
|
} |
524 |
|
|
525 |
|
|
526 |
|
|
527 |
// *************** Sample *************** |
// *************** Sample *************** |