834 |
SF_INFO info; |
SF_INFO info; |
835 |
info.format = 0; |
info.format = 0; |
836 |
SNDFILE* hFile = sf_open((*iter).sample_path.c_str(), SFM_READ, &info); |
SNDFILE* hFile = sf_open((*iter).sample_path.c_str(), SFM_READ, &info); |
837 |
|
sf_command(hFile, SFC_SET_SCALE_FLOAT_INT_READ, 0, SF_TRUE); |
838 |
try { |
try { |
839 |
if (!hFile) throw std::string(_("could not open file")); |
if (!hFile) throw std::string(_("could not open file")); |
840 |
// determine sample's bit depth |
// determine sample's bit depth |
1532 |
{ |
{ |
1533 |
sample->MIDIUnityNote = instrument.basenote; |
sample->MIDIUnityNote = instrument.basenote; |
1534 |
|
|
|
#if HAVE_SF_INSTRUMENT_LOOPS |
|
1535 |
if (instrument.loop_count && instrument.loops[0].mode != SF_LOOP_NONE) { |
if (instrument.loop_count && instrument.loops[0].mode != SF_LOOP_NONE) { |
1536 |
sample->Loops = 1; |
sample->Loops = 1; |
1537 |
|
|
1551 |
sample->LoopPlayCount = instrument.loops[0].count; |
sample->LoopPlayCount = instrument.loops[0].count; |
1552 |
sample->LoopSize = sample->LoopEnd - sample->LoopStart + 1; |
sample->LoopSize = sample->LoopEnd - sample->LoopStart + 1; |
1553 |
} |
} |
|
#endif |
|
1554 |
} |
} |
1555 |
|
|
1556 |
// schedule resizing the sample (which will be done |
// schedule resizing the sample (which will be done |