1303 |
|
|
1304 |
bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
bool DimRegionEdit::set_sample(gig::DimensionRegion* dimreg, gig::Sample* sample, bool copy_sample_unity, bool copy_sample_tune, bool copy_sample_loop) |
1305 |
{ |
{ |
1306 |
if (dimregion) { |
if (dimreg) { |
1307 |
//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 |
1308 |
|
|
1309 |
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
1312 |
// make sure stereo samples always are the same in both |
// make sure stereo samples always are the same in both |
1313 |
// dimregs in the samplechannel dimension |
// dimregs in the samplechannel dimension |
1314 |
int nbDimregs = 1; |
int nbDimregs = 1; |
1315 |
gig::DimensionRegion* d[2] = { dimregion, 0 }; |
gig::DimensionRegion* d[2] = { dimreg, 0 }; |
1316 |
if (sample->Channels == 2) { |
if (sample->Channels == 2) { |
1317 |
gig::Region* region = dimregion->GetParent(); |
gig::Region* region = dimreg->GetParent(); |
1318 |
|
|
1319 |
int bitcount = 0; |
int bitcount = 0; |
1320 |
int stereo_bit = 0; |
int stereo_bit = 0; |
1329 |
if (stereo_bit) { |
if (stereo_bit) { |
1330 |
int dimregno; |
int dimregno; |
1331 |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
for (dimregno = 0 ; dimregno < region->DimensionRegions ; dimregno++) { |
1332 |
if (region->pDimensionRegions[dimregno] == dimregion) { |
if (region->pDimensionRegions[dimregno] == dimreg) { |
1333 |
break; |
break; |
1334 |
} |
} |
1335 |
} |
} |
1339 |
} |
} |
1340 |
} |
} |
1341 |
|
|
1342 |
gig::Sample* oldref = dimregion->pSample; |
gig::Sample* oldref = dimreg->pSample; |
1343 |
|
|
1344 |
for (int i = 0 ; i < nbDimregs ; i++) { |
for (int i = 0 ; i < nbDimregs ; i++) { |
1345 |
d[i]->pSample = sample; |
d[i]->pSample = sample; |
1369 |
|
|
1370 |
// update ui |
// update ui |
1371 |
update_model++; |
update_model++; |
1372 |
wSample->set_text(gig_to_utf8(dimregion->pSample->pInfo->Name)); |
wSample->set_text(gig_to_utf8(dimreg->pSample->pInfo->Name)); |
1373 |
eUnityNote.set_value(dimregion->UnityNote); |
eUnityNote.set_value(dimreg->UnityNote); |
1374 |
eFineTune.set_value(dimregion->FineTune); |
eFineTune.set_value(dimreg->FineTune); |
1375 |
eSampleLoopEnabled.set_value(dimregion->SampleLoops); |
eSampleLoopEnabled.set_value(dimreg->SampleLoops); |
1376 |
update_loop_elements(); |
update_loop_elements(); |
1377 |
update_model--; |
update_model--; |
1378 |
|
|
1379 |
sample_ref_changed_signal.emit(oldref, sample); |
sample_ref_changed_signal.emit(oldref, sample); |
1380 |
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
1381 |
//dimreg_changed_signal.emit(dimregion); |
//dimreg_changed_signal.emit(dimreg); |
1382 |
return true; |
return true; |
1383 |
} |
} |
1384 |
return false; |
return false; |