78 |
loadBuiltInPix(); |
loadBuiltInPix(); |
79 |
|
|
80 |
// set_border_width(5); |
// set_border_width(5); |
81 |
// set_default_size(400, 200); |
|
82 |
|
if (!Settings::singleton()->autoRestoreWindowDimension) { |
83 |
|
set_default_size(800, 600); |
84 |
|
set_position(Gtk::WIN_POS_CENTER); |
85 |
|
} |
86 |
|
|
87 |
add(m_VBox); |
add(m_VBox); |
88 |
|
|
658 |
// Add the TreeView's view columns: |
// Add the TreeView's view columns: |
659 |
m_TreeView.append_column(_("Nr"), m_Columns.m_col_nr); |
m_TreeView.append_column(_("Nr"), m_Columns.m_col_nr); |
660 |
m_TreeView.append_column_editable(_("Instrument"), m_Columns.m_col_name); |
m_TreeView.append_column_editable(_("Instrument"), m_Columns.m_col_name); |
661 |
|
m_TreeView.append_column(_("Scripts"), m_Columns.m_col_scripts); |
662 |
m_TreeView.set_headers_visible(true); |
m_TreeView.set_headers_visible(true); |
663 |
|
|
664 |
// establish drag&drop within the instrument tree view, allowing to reorder |
// establish drag&drop within the instrument tree view, allowing to reorder |
1820 |
dialog.set_comments(sComment.c_str()); |
dialog.set_comments(sComment.c_str()); |
1821 |
dialog.set_website("http://www.linuxsampler.org"); |
dialog.set_website("http://www.linuxsampler.org"); |
1822 |
dialog.set_website_label("http://www.linuxsampler.org"); |
dialog.set_website_label("http://www.linuxsampler.org"); |
1823 |
|
dialog.set_position(Gtk::WIN_POS_CENTER); |
1824 |
dialog.run(); |
dialog.run(); |
1825 |
} |
} |
1826 |
|
|
1846 |
table(2, 1), |
table(2, 1), |
1847 |
m_file(NULL) |
m_file(NULL) |
1848 |
{ |
{ |
1849 |
|
if (!Settings::singleton()->autoRestoreWindowDimension) { |
1850 |
|
set_default_size(470, 390); |
1851 |
|
set_position(Gtk::WIN_POS_MOUSE); |
1852 |
|
} |
1853 |
|
|
1854 |
set_title(_("File Properties")); |
set_title(_("File Properties")); |
1855 |
eName.set_width_chars(50); |
eName.set_width_chars(50); |
1856 |
|
|
1985 |
eDimensionKeyRangeLow(_("Keyswitching range low")), |
eDimensionKeyRangeLow(_("Keyswitching range low")), |
1986 |
eDimensionKeyRangeHigh(_("Keyswitching range high")) |
eDimensionKeyRangeHigh(_("Keyswitching range high")) |
1987 |
{ |
{ |
1988 |
|
if (!Settings::singleton()->autoRestoreWindowDimension) { |
1989 |
|
//set_default_size(470, 390); |
1990 |
|
set_position(Gtk::WIN_POS_MOUSE); |
1991 |
|
} |
1992 |
|
|
1993 |
set_title(_("Instrument Properties")); |
set_title(_("Instrument Properties")); |
1994 |
|
|
1995 |
eDimensionKeyRangeLow.set_tip( |
eDimensionKeyRangeLow.set_tip( |
2114 |
for (gig::Instrument* instrument = gig->GetFirstInstrument() ; instrument ; |
for (gig::Instrument* instrument = gig->GetFirstInstrument() ; instrument ; |
2115 |
instrument = gig->GetNextInstrument(), ++index) { |
instrument = gig->GetNextInstrument(), ++index) { |
2116 |
Glib::ustring name(gig_to_utf8(instrument->pInfo->Name)); |
Glib::ustring name(gig_to_utf8(instrument->pInfo->Name)); |
2117 |
|
const int iScriptSlots = instrument->ScriptSlotCount(); |
2118 |
|
|
2119 |
Gtk::TreeModel::iterator iter = m_refTreeModel->append(); |
Gtk::TreeModel::iterator iter = m_refTreeModel->append(); |
2120 |
Gtk::TreeModel::Row row = *iter; |
Gtk::TreeModel::Row row = *iter; |
2121 |
row[m_Columns.m_col_nr] = index; |
row[m_Columns.m_col_nr] = index; |
2122 |
row[m_Columns.m_col_name] = name; |
row[m_Columns.m_col_name] = name; |
2123 |
row[m_Columns.m_col_instr] = instrument; |
row[m_Columns.m_col_instr] = instrument; |
2124 |
|
row[m_Columns.m_col_scripts] = iScriptSlots ? ToString(iScriptSlots) : ""; |
2125 |
|
|
2126 |
add_instrument_to_menu(name); |
add_instrument_to_menu(name); |
2127 |
} |
} |
2260 |
|
|
2261 |
ScriptSlots* window = new ScriptSlots; |
ScriptSlots* window = new ScriptSlots; |
2262 |
window->setInstrument(instrument); |
window->setInstrument(instrument); |
2263 |
|
window->signal_script_slots_changed().connect( |
2264 |
|
sigc::mem_fun(*this, &MainWindow::onScriptSlotsModified) |
2265 |
|
); |
2266 |
//window->reparent(*this); |
//window->reparent(*this); |
2267 |
window->show(); |
window->show(); |
2268 |
} |
} |
2269 |
|
|
2270 |
|
void MainWindow::onScriptSlotsModified(gig::Instrument* pInstrument) { |
2271 |
|
if (!pInstrument) return; |
2272 |
|
const int iScriptSlots = pInstrument->ScriptSlotCount(); |
2273 |
|
|
2274 |
|
Glib::RefPtr<Gtk::TreeModel> model = m_TreeView.get_model(); |
2275 |
|
for (int i = 0; i < model->children().size(); ++i) { |
2276 |
|
Gtk::TreeModel::Row row = model->children()[i]; |
2277 |
|
if (row[m_Columns.m_col_instr] != pInstrument) continue; |
2278 |
|
row[m_Columns.m_col_scripts] = iScriptSlots ? ToString(iScriptSlots) : ""; |
2279 |
|
break; |
2280 |
|
} |
2281 |
|
} |
2282 |
|
|
2283 |
void MainWindow::on_action_refresh_all() { |
void MainWindow::on_action_refresh_all() { |
2284 |
__refreshEntireGUI(); |
__refreshEntireGUI(); |
2285 |
} |
} |
2594 |
rowInstr[m_Columns.m_col_nr] = m_refTreeModel->children().size() - 1; |
rowInstr[m_Columns.m_col_nr] = m_refTreeModel->children().size() - 1; |
2595 |
rowInstr[m_Columns.m_col_name] = name; |
rowInstr[m_Columns.m_col_name] = name; |
2596 |
rowInstr[m_Columns.m_col_instr] = instrument; |
rowInstr[m_Columns.m_col_instr] = instrument; |
2597 |
|
rowInstr[m_Columns.m_col_scripts] = ""; |
2598 |
instrument_name_connection.unblock(); |
instrument_name_connection.unblock(); |
2599 |
|
|
2600 |
add_instrument_to_menu(name); |
add_instrument_to_menu(name); |
3573 |
void MainWindow::on_action_combine_instruments() { |
void MainWindow::on_action_combine_instruments() { |
3574 |
CombineInstrumentsDialog* d = new CombineInstrumentsDialog(*this, file); |
CombineInstrumentsDialog* d = new CombineInstrumentsDialog(*this, file); |
3575 |
d->show_all(); |
d->show_all(); |
|
d->resize(500, 400); |
|
3576 |
d->run(); |
d->run(); |
3577 |
if (d->fileWasChanged()) { |
if (d->fileWasChanged()) { |
3578 |
// update GUI with new instrument just created |
// update GUI with new instrument just created |