96 |
|
|
97 |
if (!Settings::singleton()->autoRestoreWindowDimension) { |
if (!Settings::singleton()->autoRestoreWindowDimension) { |
98 |
#if GTKMM_MAJOR_VERSION >= 3 |
#if GTKMM_MAJOR_VERSION >= 3 |
99 |
set_default_size(960, 600); |
set_default_size(1010, -1); |
100 |
#else |
#else |
101 |
set_default_size(865, 600); |
set_default_size(915, -1); |
102 |
#endif |
#endif |
103 |
set_position(Gtk::WIN_POS_CENTER); |
set_position(Gtk::WIN_POS_CENTER); |
104 |
} |
} |
1549 |
sigc::mem_fun(*this, &MainWindow::select_sample) |
sigc::mem_fun(*this, &MainWindow::select_sample) |
1550 |
); |
); |
1551 |
|
|
1552 |
|
dimreg_edit.editScriptSlotsButton.signal_clicked().connect( |
1553 |
|
sigc::mem_fun(*this, &MainWindow::show_script_slots) |
1554 |
|
); |
1555 |
|
// simply sending the same signal (pair) to the sampler on 'patch' variable |
1556 |
|
// changes as the already existing signal (pair) when the user edits the |
1557 |
|
// script's source code, because the sampler would reload the source code |
1558 |
|
// and the 'patch' variables from the instrument on this signal anyway |
1559 |
|
dimreg_edit.scriptVars.signal_vars_to_be_changed.connect( |
1560 |
|
[this](gig::Instrument* instr) { |
1561 |
|
for (int i = 0; i < instr->ScriptSlotCount(); ++i) { |
1562 |
|
gig::Script* script = instr->GetScriptOfSlot(i); |
1563 |
|
signal_script_to_be_changed.emit(script); |
1564 |
|
} |
1565 |
|
} |
1566 |
|
); |
1567 |
|
dimreg_edit.scriptVars.signal_vars_changed.connect( |
1568 |
|
[this](gig::Instrument* instr) { |
1569 |
|
for (int i = 0; i < instr->ScriptSlotCount(); ++i) { |
1570 |
|
gig::Script* script = instr->GetScriptOfSlot(i); |
1571 |
|
signal_script_changed.emit(script); |
1572 |
|
} |
1573 |
|
} |
1574 |
|
); |
1575 |
|
dimreg_edit.scriptVars.signal_edit_script.connect( |
1576 |
|
[this](gig::Script* script) { |
1577 |
|
editScript(script); |
1578 |
|
} |
1579 |
|
); |
1580 |
|
|
1581 |
m_RegionChooser.signal_instrument_struct_to_be_changed().connect( |
m_RegionChooser.signal_instrument_struct_to_be_changed().connect( |
1582 |
sigc::hide( |
sigc::hide( |
1583 |
sigc::bind( |
sigc::bind( |
1951 |
|
|
1952 |
updateScriptListOfMenu(); |
updateScriptListOfMenu(); |
1953 |
|
|
1954 |
m_RegionChooser.set_instrument(get_instrument()); |
gig::Instrument* instr = get_instrument(); |
1955 |
|
|
1956 |
|
m_RegionChooser.set_instrument(instr); |
1957 |
|
dimreg_edit.scriptVars.setInstrument(instr, true/*force update*/); |
1958 |
|
|
1959 |
if (Settings::singleton()->syncSamplerInstrumentSelection) { |
if (Settings::singleton()->syncSamplerInstrumentSelection) { |
1960 |
switch_sampler_instrument_signal.emit(get_instrument()); |
switch_sampler_instrument_signal.emit(get_instrument()); |
4558 |
if (!it) return; |
if (!it) return; |
4559 |
Gtk::TreeModel::Row row = *it; |
Gtk::TreeModel::Row row = *it; |
4560 |
gig::Script* script = row[m_ScriptsModel.m_col_script]; |
gig::Script* script = row[m_ScriptsModel.m_col_script]; |
4561 |
if (!script) return; |
editScript(script); |
4562 |
|
} |
4563 |
|
|
4564 |
|
void MainWindow::editScript(gig::Script* script) { |
4565 |
|
if (!script) return; |
4566 |
ScriptEditor* editor = new ScriptEditor; |
ScriptEditor* editor = new ScriptEditor; |
4567 |
editor->signal_script_to_be_changed.connect( |
editor->signal_script_to_be_changed.connect( |
4568 |
signal_script_to_be_changed.make_slot() |
signal_script_to_be_changed.make_slot() |