441 |
UUID uuid; |
UUID uuid; |
442 |
UuidCreate(&uuid); |
UuidCreate(&uuid); |
443 |
pDLSID->ulData1 = uuid.Data1; |
pDLSID->ulData1 = uuid.Data1; |
444 |
pDLSID->usData1 = uuid.Data2; |
pDLSID->usData2 = uuid.Data2; |
445 |
pDLSID->usData2 = uuid.Data3; |
pDLSID->usData3 = uuid.Data3; |
446 |
memcpy(pDLSID->abData, uuid.Data4, 8); |
memcpy(pDLSID->abData, uuid.Data4, 8); |
447 |
|
|
448 |
#elif defined(__APPLE__) |
#elif defined(__APPLE__) |
512 |
if (pSampleLoops) delete[] pSampleLoops; |
if (pSampleLoops) delete[] pSampleLoops; |
513 |
} |
} |
514 |
|
|
515 |
|
void Sampler::SetGain(int32_t gain) { |
516 |
|
Gain = gain; |
517 |
|
} |
518 |
|
|
519 |
/** |
/** |
520 |
* Apply all sample player options to the respective RIFF chunk. You |
* Apply all sample player options to the respective RIFF chunk. You |
521 |
* have to call File::Save() to make changes persistent. |
* have to call File::Save() to make changes persistent. |
917 |
} |
} |
918 |
|
|
919 |
/** |
/** |
920 |
|
* Modifies the key range of this Region and makes sure the respective |
921 |
|
* chunks are in correct order. |
922 |
|
* |
923 |
|
* @param Low - lower end of key range |
924 |
|
* @param High - upper end of key range |
925 |
|
*/ |
926 |
|
void Region::SetKeyRange(uint16_t Low, uint16_t High) { |
927 |
|
KeyRange.low = Low; |
928 |
|
KeyRange.high = High; |
929 |
|
|
930 |
|
// make sure regions are already loaded |
931 |
|
Instrument* pInstrument = (Instrument*) GetParent(); |
932 |
|
if (!pInstrument->pRegions) pInstrument->LoadRegions(); |
933 |
|
if (!pInstrument->pRegions) return; |
934 |
|
|
935 |
|
// find the r which is the first one to the right of this region |
936 |
|
// at its new position |
937 |
|
Region* r = NULL; |
938 |
|
Region* prev_region = NULL; |
939 |
|
for ( |
940 |
|
Instrument::RegionList::iterator iter = pInstrument->pRegions->begin(); |
941 |
|
iter != pInstrument->pRegions->end(); iter++ |
942 |
|
) { |
943 |
|
if ((*iter)->KeyRange.low > this->KeyRange.low) { |
944 |
|
r = *iter; |
945 |
|
break; |
946 |
|
} |
947 |
|
prev_region = *iter; |
948 |
|
} |
949 |
|
|
950 |
|
// place this region before r if it's not already there |
951 |
|
if (prev_region != this) pInstrument->MoveRegion(this, r); |
952 |
|
} |
953 |
|
|
954 |
|
/** |
955 |
* Apply Region settings to the respective RIFF chunks. You have to |
* Apply Region settings to the respective RIFF chunks. You have to |
956 |
* call File::Save() to make changes persistent. |
* call File::Save() to make changes persistent. |
957 |
* |
* |
1002 |
} |
} |
1003 |
} |
} |
1004 |
} |
} |
|
if (index < 0) throw Exception("Could not save Region, could not find Region's sample"); |
|
1005 |
WavePoolTableIndex = index; |
WavePoolTableIndex = index; |
1006 |
// update 'wlnk' chunk |
// update 'wlnk' chunk |
1007 |
store16(&pData[0], WaveLinkOptionFlags); |
store16(&pData[0], WaveLinkOptionFlags); |