499 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
500 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
501 |
rowno++; |
rowno++; |
502 |
boolentry.signal_changed_by_user().connect(dimreg_changed_signal.make_slot()); |
boolentry.signal_changed_by_user().connect( |
503 |
|
sigc::bind(dimreg_changed_signal.make_slot(), sigc::ref(this->dimregion)) |
504 |
|
); |
505 |
} |
} |
506 |
|
|
507 |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
void DimRegionEdit::addProp(BoolEntryPlus6& boolentry) |
509 |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
table[pageno]->attach(boolentry.widget, 1, 3, rowno, rowno + 1, |
510 |
Gtk::FILL, Gtk::SHRINK); |
Gtk::FILL, Gtk::SHRINK); |
511 |
rowno++; |
rowno++; |
512 |
boolentry.signal_changed_by_user().connect(dimreg_changed_signal.make_slot()); |
boolentry.signal_changed_by_user().connect( |
513 |
|
sigc::bind(dimreg_changed_signal.make_slot(), sigc::ref(this->dimregion)) |
514 |
|
); |
515 |
} |
} |
516 |
|
|
517 |
void DimRegionEdit::addProp(LabelWidget& prop) |
void DimRegionEdit::addProp(LabelWidget& prop) |
521 |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
table[pageno]->attach(prop.widget, 2, 3, rowno, rowno + 1, |
522 |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); |
523 |
rowno++; |
rowno++; |
524 |
prop.signal_changed_by_user().connect(dimreg_changed_signal.make_slot()); |
prop.signal_changed_by_user().connect( |
525 |
|
sigc::bind(dimreg_changed_signal.make_slot(), sigc::ref(this->dimregion)) |
526 |
|
); |
527 |
} |
} |
528 |
|
|
529 |
|
|
797 |
loop.LoopStart = 0; |
loop.LoopStart = 0; |
798 |
loop.LoopLength = |
loop.LoopLength = |
799 |
(dimregion->pSample) ? dimregion->pSample->GetSize() : 0; |
(dimregion->pSample) ? dimregion->pSample->GetSize() : 0; |
800 |
|
dimreg_to_be_changed_signal.emit(dimregion); |
801 |
dimregion->AddSampleLoop(&loop); |
dimregion->AddSampleLoop(&loop); |
802 |
dimreg_changed_signal(); |
dimreg_changed_signal.emit(dimregion); |
803 |
} |
} |
804 |
} else { |
} else { |
805 |
if (dimregion->SampleLoops) { |
if (dimregion->SampleLoops) { |
806 |
|
dimreg_to_be_changed_signal.emit(dimregion); |
807 |
// delete ALL existing sample loops |
// delete ALL existing sample loops |
808 |
while (dimregion->SampleLoops) { |
while (dimregion->SampleLoops) { |
809 |
dimregion->DeleteSampleLoop(&dimregion->pSampleLoops[0]); |
dimregion->DeleteSampleLoop(&dimregion->pSampleLoops[0]); |
810 |
} |
} |
811 |
dimreg_changed_signal(); |
dimreg_changed_signal.emit(dimregion); |
812 |
} |
} |
813 |
} |
} |
814 |
updateLoopElements(); |
updateLoopElements(); |
874 |
bool DimRegionEdit::set_sample(gig::Sample* sample) |
bool DimRegionEdit::set_sample(gig::Sample* sample) |
875 |
{ |
{ |
876 |
if (dimregion) { |
if (dimregion) { |
877 |
|
//TODO: we should better move the code from MainWindow::on_sample_label_drop_drag_data_received() here |
878 |
|
|
879 |
|
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
880 |
|
//dimreg_to_be_changed_signal.emit(dimregion); |
881 |
|
|
882 |
|
gig::Sample* oldref = dimregion->pSample; |
883 |
dimregion->pSample = sample; |
dimregion->pSample = sample; |
884 |
|
|
885 |
// copy sample information from Sample to DimensionRegion |
// copy sample information from Sample to DimensionRegion |
909 |
eSampleLoopEnabled.set_active(dimregion->SampleLoops); |
eSampleLoopEnabled.set_active(dimregion->SampleLoops); |
910 |
updateLoopElements(); |
updateLoopElements(); |
911 |
|
|
912 |
dimreg_changed_signal(); |
sample_ref_changed_signal.emit(oldref, sample); |
913 |
|
// currently commented because we're sending a similar signal in MainWindow::on_sample_label_drop_drag_data_received() |
914 |
|
//dimreg_changed_signal.emit(dimregion); |
915 |
return true; |
return true; |
916 |
} |
} |
917 |
return false; |
return false; |
918 |
} |
} |
919 |
|
|
920 |
|
sigc::signal<void, gig::DimensionRegion*> DimRegionEdit::signal_dimreg_to_be_changed() { |
921 |
|
return dimreg_to_be_changed_signal; |
922 |
|
} |
923 |
|
|
924 |
|
sigc::signal<void, gig::DimensionRegion*> DimRegionEdit::signal_dimreg_changed() { |
925 |
|
return dimreg_changed_signal; |
926 |
|
} |
927 |
|
|
928 |
|
sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/> DimRegionEdit::signal_sample_ref_changed() { |
929 |
|
return sample_ref_changed_signal; |
930 |
|
} |