1 |
/* |
/* |
2 |
* Copyright (C) 2006-2013 Andreas Persson |
* Copyright (C) 2006-2014 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
94 |
} |
} |
95 |
} |
} |
96 |
int bitcount = 0; |
int bitcount = 0; |
|
int layer_bit = 0; |
|
97 |
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
for (int dim = 0 ; dim < region->Dimensions ; dim++) { |
98 |
if (region->pDimensionDefinitions[dim].dimension == |
if (region->pDimensionDefinitions[dim].dimension == |
99 |
gig::dimension_layer) { |
gig::dimension_layer) { |
|
layer_bit = 1 << bitcount; |
|
|
|
|
100 |
int mask = |
int mask = |
101 |
~(((1 << region->pDimensionDefinitions[dim].bits) - 1) << |
~(((1 << region->pDimensionDefinitions[dim].bits) - 1) << |
102 |
bitcount); |
bitcount); |
221 |
ePitchTrack(_("Pitch track")), |
ePitchTrack(_("Pitch track")), |
222 |
eDimensionBypass(_("Dimension bypass")), |
eDimensionBypass(_("Dimension bypass")), |
223 |
ePan(_("Pan"), -64, 63), |
ePan(_("Pan"), -64, 63), |
224 |
eSelfMask(_("Self mask")), |
eSelfMask(_("One note/voice per key (a.k.a \"Self mask\")")), |
225 |
eAttenuationController(_("Attenuation controller")), |
eAttenuationController(_("Attenuation controller")), |
226 |
eInvertAttenuationController(_("Invert attenuation controller")), |
eInvertAttenuationController(_("Invert attenuation controller")), |
227 |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
eAttenuationControllerThreshold(_("Attenuation controller threshold")), |
228 |
eChannelOffset(_("Channel offset"), 0, 9), |
eChannelOffset(_("Channel offset"), 0, 9), |
229 |
eSustainDefeat(_("Sustain defeat")), |
eSustainDefeat(_("Ignore Hold Pedal (a.k.a. \"Sustain defeat\")")), |
230 |
eMSDecode(_("MS decode")), |
eMSDecode(_("MS decode")), |
231 |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
eSampleStartOffset(_("Sample start offset"), 0, 2000), |
232 |
eUnityNote(_("Unity note")), |
eUnityNote(_("Unity note")), |
397 |
addString(_("Sample"), lSample, wSample); |
addString(_("Sample"), lSample, wSample); |
398 |
//TODO: the following would break drag&drop: wSample->property_editable().set_value(false); or this: wSample->set_editable(false); |
//TODO: the following would break drag&drop: wSample->property_editable().set_value(false); or this: wSample->set_editable(false); |
399 |
#ifdef OLD_TOOLTIPS |
#ifdef OLD_TOOLTIPS |
400 |
tooltips.set_tip(*wSample, _("Drop a sample here")); |
tooltips.set_tip(*wSample, _("Drag & drop a sample here")); |
401 |
#else |
#else |
402 |
wSample->set_tooltip_text(_("Drop a sample here")); |
wSample->set_tooltip_text(_("Drag & drop a sample here")); |
403 |
#endif |
#endif |
404 |
addProp(eUnityNote); |
addProp(eUnityNote); |
405 |
addHeader(_("Optional Settings")); |
addHeader(_("Optional Settings")); |
682 |
eDimensionBypass.set_choices(choices, values); |
eDimensionBypass.set_choices(choices, values); |
683 |
} |
} |
684 |
addProp(eDimensionBypass); |
addProp(eDimensionBypass); |
685 |
|
eSelfMask.widget.set_tooltip_text(_("If enabled: high velocity notes will stop low velocity notes at the same note, that way you can save voices that wouldn't be audible anyway.")); |
686 |
addProp(eSelfMask); |
addProp(eSelfMask); |
687 |
|
eSustainDefeat.widget.set_tooltip_text(_("If enabled: sustain pedal will not hold a note.")); |
688 |
addProp(eSustainDefeat); |
addProp(eSustainDefeat); |
689 |
|
eMSDecode.widget.set_tooltip_text(_("Gigastudio specific flag: defines if Mid Side Recordings should be decoded.")); |
690 |
addProp(eMSDecode); |
addProp(eMSDecode); |
691 |
|
|
692 |
nextPage(); |
nextPage(); |
928 |
d->pSample ? d->pSample->LoopPlayCount : 0); |
d->pSample ? d->pSample->LoopPlayCount : 0); |
929 |
update_model--; |
update_model--; |
930 |
|
|
931 |
wSample->set_text(d->pSample ? d->pSample->pInfo->Name.c_str() : _("NULL")); |
wSample->set_text(d->pSample ? gig_to_utf8(d->pSample->pInfo->Name) : |
932 |
|
_("NULL")); |
933 |
|
|
934 |
update_loop_elements(); |
update_loop_elements(); |
935 |
VCFEnabled_toggled(); |
VCFEnabled_toggled(); |
1151 |
update_model--; |
update_model--; |
1152 |
} |
} |
1153 |
|
|
1154 |
bool DimRegionEdit::set_sample(gig::Sample* sample) |
bool DimRegionEdit::set_sample(gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1155 |
{ |
{ |
1156 |
if (dimregion) { |
if (dimregion) { |
1157 |
//TODO: we should better move the code from MainWindow::on_sample_label_drop_drag_data_received() here |
//TODO: we should better move the code from MainWindow::on_sample_label_drop_drag_data_received() here |
1195 |
d[i]->pSample = sample; |
d[i]->pSample = sample; |
1196 |
|
|
1197 |
// copy sample information from Sample to DimensionRegion |
// copy sample information from Sample to DimensionRegion |
1198 |
|
if (copy_sample_unity) |
1199 |
d[i]->UnityNote = sample->MIDIUnityNote; |
d[i]->UnityNote = sample->MIDIUnityNote; |
1200 |
d[i]->FineTune = sample->FineTune; |
if (copy_sample_tune) |
1201 |
|
d[i]->FineTune = sample->FineTune; |
1202 |
int loops = sample->Loops ? 1 : 0; |
if (copy_sample_loop) { |
1203 |
while (d[i]->SampleLoops > loops) { |
int loops = sample->Loops ? 1 : 0; |
1204 |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
while (d[i]->SampleLoops > loops) { |
1205 |
} |
d[i]->DeleteSampleLoop(&d[i]->pSampleLoops[0]); |
1206 |
while (d[i]->SampleLoops < sample->Loops) { |
} |
1207 |
DLS::sample_loop_t loop; |
while (d[i]->SampleLoops < sample->Loops) { |
1208 |
d[i]->AddSampleLoop(&loop); |
DLS::sample_loop_t loop; |
1209 |
} |
d[i]->AddSampleLoop(&loop); |
1210 |
if (loops) { |
} |
1211 |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
if (loops) { |
1212 |
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
d[i]->pSampleLoops[0].Size = sizeof(DLS::sample_loop_t); |
1213 |
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
d[i]->pSampleLoops[0].LoopType = sample->LoopType; |
1214 |
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
d[i]->pSampleLoops[0].LoopStart = sample->LoopStart; |
1215 |
|
d[i]->pSampleLoops[0].LoopLength = sample->LoopEnd - sample->LoopStart + 1; |
1216 |
|
} |
1217 |
} |
} |
1218 |
} |
} |
1219 |
|
|
1220 |
// update ui |
// update ui |
1221 |
update_model++; |
update_model++; |
1222 |
wSample->set_text(dimregion->pSample->pInfo->Name); |
wSample->set_text(gig_to_utf8(dimregion->pSample->pInfo->Name)); |
1223 |
eUnityNote.set_value(dimregion->UnityNote); |
eUnityNote.set_value(dimregion->UnityNote); |
1224 |
eFineTune.set_value(dimregion->FineTune); |
eFineTune.set_value(dimregion->FineTune); |
1225 |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |