712 |
entry[15].set_text(info->Subject); |
entry[15].set_text(info->Subject); |
713 |
} |
} |
714 |
|
|
715 |
|
void InstrumentProps::add_prop(BoolEntry& boolentry) |
716 |
|
{ |
717 |
|
table.attach(boolentry.widget, 0, 2, rowno, rowno + 1, |
718 |
|
Gtk::FILL, Gtk::SHRINK); |
719 |
|
rowno++; |
720 |
|
boolentry.signal_changed_by_user().connect(instrument_changed.make_slot()); |
721 |
|
} |
722 |
|
|
723 |
|
void InstrumentProps::add_prop(BoolEntryPlus6& boolentry) |
724 |
|
{ |
725 |
|
table.attach(boolentry.widget, 0, 2, rowno, rowno + 1, |
726 |
|
Gtk::FILL, Gtk::SHRINK); |
727 |
|
rowno++; |
728 |
|
boolentry.signal_changed_by_user().connect(instrument_changed.make_slot()); |
729 |
|
} |
730 |
|
|
731 |
void InstrumentProps::add_prop(LabelWidget& prop) |
void InstrumentProps::add_prop(LabelWidget& prop) |
732 |
{ |
{ |
733 |
table.attach(prop.label, 0, 1, rowno, rowno + 1, |
table.attach(prop.label, 0, 1, rowno, rowno + 1, |
742 |
: table(2,1), |
: table(2,1), |
743 |
quitButton(Gtk::Stock::CLOSE), |
quitButton(Gtk::Stock::CLOSE), |
744 |
eName("Name"), |
eName("Name"), |
745 |
eIsDrum("IsDrum"), |
eIsDrum("Is drum"), |
746 |
eMIDIBank("MIDIBank", 0, 16383), |
eMIDIBank("MIDI bank", 0, 16383), |
747 |
eMIDIProgram("MIDIProgram"), |
eMIDIProgram("MIDI program"), |
748 |
eAttenuation("Attenuation", 0, 96, 0, 1), |
eAttenuation("Attenuation", 0, 96, 0, 1), |
749 |
eGainPlus6("Gain +6dB", eAttenuation, -6), |
eGainPlus6("Gain +6dB", eAttenuation, -6), |
750 |
eEffectSend("EffectSend", 0, 65535), |
eEffectSend("Effect send", 0, 65535), |
751 |
eFineTune("FineTune", -8400, 8400), |
eFineTune("Fine tune", -8400, 8400), |
752 |
ePitchbendRange("PitchbendRange", 0, 12), |
ePitchbendRange("Pitchbend range", 0, 12), |
753 |
ePianoReleaseMode("PianoReleaseMode"), |
ePianoReleaseMode("Piano release mode"), |
754 |
eDimensionKeyRangeLow("DimensionKeyRangeLow"), |
eDimensionKeyRangeLow("Dimension key range low"), |
755 |
eDimensionKeyRangeHigh("DimensionKeyRangeHigh") |
eDimensionKeyRangeHigh("Dimension key range high") |
756 |
{ |
{ |
757 |
set_title("Instrument properties"); |
set_title("Instrument properties"); |
758 |
|
|
1043 |
dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); |
dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); |
1044 |
dialog.set_select_multiple(true); |
dialog.set_select_multiple(true); |
1045 |
Gtk::FileFilter soundfilter; // matches all file types supported by libsndfile |
Gtk::FileFilter soundfilter; // matches all file types supported by libsndfile |
1046 |
const char* supportedFileTypes[] = { |
const char* const supportedFileTypes[] = { |
1047 |
"*.wav", "*.WAV", "*.aiff", "*.AIFF", "*.aifc", "*.AIFC", "*.snd", |
"*.wav", "*.WAV", "*.aiff", "*.AIFF", "*.aifc", "*.AIFC", "*.snd", |
1048 |
"*.SND", "*.au", "*.AU", "*.paf", "*.PAF", "*.iff", "*.IFF", |
"*.SND", "*.au", "*.AU", "*.paf", "*.PAF", "*.iff", "*.IFF", |
1049 |
"*.svx", "*.SVX", "*.sf", "*.SF", "*.voc", "*.VOC", "*.w64", |
"*.svx", "*.SVX", "*.sf", "*.SF", "*.voc", "*.VOC", "*.w64", |
1100 |
// add a new sample to the .gig file |
// add a new sample to the .gig file |
1101 |
gig::Sample* sample = file->AddSample(); |
gig::Sample* sample = file->AddSample(); |
1102 |
// file name without path |
// file name without path |
1103 |
sample->pInfo->Name = (*iter).substr((*iter).rfind('/') + 1).raw(); |
Glib::ustring filename = Glib::filename_display_basename(*iter); |
1104 |
|
// remove file extension if there is one |
1105 |
|
for (int i = 0; supportedFileTypes[i]; i++) { |
1106 |
|
if (Glib::str_has_suffix(filename, supportedFileTypes[i] + 1)) { |
1107 |
|
filename.erase(filename.length() - strlen(supportedFileTypes[i] + 1)); |
1108 |
|
break; |
1109 |
|
} |
1110 |
|
} |
1111 |
|
sample->pInfo->Name = filename; |
1112 |
sample->Channels = info.channels; |
sample->Channels = info.channels; |
1113 |
sample->BitDepth = bitdepth; |
sample->BitDepth = bitdepth; |
1114 |
sample->FrameSize = bitdepth / 8/*1 byte are 8 bits*/ * info.channels; |
sample->FrameSize = bitdepth / 8/*1 byte are 8 bits*/ * info.channels; |
1128 |
Gtk::TreeModel::iterator iterSample = |
Gtk::TreeModel::iterator iterSample = |
1129 |
m_refSamplesTreeModel->append(row.children()); |
m_refSamplesTreeModel->append(row.children()); |
1130 |
Gtk::TreeModel::Row rowSample = *iterSample; |
Gtk::TreeModel::Row rowSample = *iterSample; |
1131 |
rowSample[m_SamplesModel.m_col_name] = sample->pInfo->Name.c_str(); |
rowSample[m_SamplesModel.m_col_name] = filename; |
1132 |
rowSample[m_SamplesModel.m_col_sample] = sample; |
rowSample[m_SamplesModel.m_col_sample] = sample; |
1133 |
rowSample[m_SamplesModel.m_col_group] = NULL; |
rowSample[m_SamplesModel.m_col_group] = NULL; |
1134 |
// close sound file |
// close sound file |