1 |
/* |
/* |
2 |
* Copyright (C) 2006-2014 Andreas Persson |
* Copyright (C) 2006-2015 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
217 |
sigc::mem_fun(*this, &MainWindow::on_action_warn_user_on_extensions) |
sigc::mem_fun(*this, &MainWindow::on_action_warn_user_on_extensions) |
218 |
); |
); |
219 |
|
|
220 |
|
toggle_action = |
221 |
|
Gtk::ToggleAction::create("SyncSamplerInstrumentSelection", _("Synchronize sampler's instrument selection")); |
222 |
|
toggle_action->set_active(Settings::singleton()->syncSamplerInstrumentSelection); |
223 |
|
actionGroup->add( |
224 |
|
toggle_action, |
225 |
|
sigc::mem_fun(*this, &MainWindow::on_action_sync_sampler_instrument_selection) |
226 |
|
); |
227 |
|
|
228 |
|
|
229 |
actionGroup->add(Gtk::Action::create("MenuTools", _("_Tools"))); |
actionGroup->add(Gtk::Action::create("MenuTools", _("_Tools"))); |
230 |
|
|
344 |
" </menu>" |
" </menu>" |
345 |
" <menu action='MenuSettings'>" |
" <menu action='MenuSettings'>" |
346 |
" <menuitem action='WarnUserOnExtensions'/>" |
" <menuitem action='WarnUserOnExtensions'/>" |
347 |
|
" <menuitem action='SyncSamplerInstrumentSelection'/>" |
348 |
" </menu>" |
" </menu>" |
349 |
" <menu action='MenuHelp'>" |
" <menu action='MenuHelp'>" |
350 |
" <menuitem action='About'/>" |
" <menuitem action='About'/>" |
406 |
} |
} |
407 |
{ |
{ |
408 |
Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>( |
Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>( |
409 |
|
uiManager->get_widget("/MenuBar/MenuSettings/SyncSamplerInstrumentSelection")); |
410 |
|
item->set_tooltip_text(_("If checked, the sampler's current instrument will automatically be switched whenever another instrument was selected in gigedit (only available in live-mode).")); |
411 |
|
} |
412 |
|
{ |
413 |
|
Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>( |
414 |
uiManager->get_widget("/MenuBar/MenuTools/CombineInstruments")); |
uiManager->get_widget("/MenuBar/MenuTools/CombineInstruments")); |
415 |
item->set_tooltip_text(_("Create combi sounds out of individual sounds of this .gig file.")); |
item->set_tooltip_text(_("Create combi sounds out of individual sounds of this .gig file.")); |
416 |
} |
} |
562 |
sigc::mem_fun(*this, &MainWindow::on_samples_to_be_removed) |
sigc::mem_fun(*this, &MainWindow::on_samples_to_be_removed) |
563 |
); |
); |
564 |
|
|
565 |
|
dimreg_edit.signal_select_sample().connect( |
566 |
|
sigc::mem_fun(*this, &MainWindow::select_sample) |
567 |
|
); |
568 |
|
|
569 |
m_RegionChooser.signal_instrument_struct_to_be_changed().connect( |
m_RegionChooser.signal_instrument_struct_to_be_changed().connect( |
570 |
sigc::hide( |
sigc::hide( |
571 |
sigc::bind( |
sigc::bind( |
706 |
} |
} |
707 |
|
|
708 |
m_RegionChooser.set_instrument(get_instrument()); |
m_RegionChooser.set_instrument(get_instrument()); |
709 |
|
|
710 |
|
if (Settings::singleton()->syncSamplerInstrumentSelection) { |
711 |
|
switch_sampler_instrument_signal.emit(get_instrument()); |
712 |
|
} |
713 |
} |
} |
714 |
|
|
715 |
void loader_progress_callback(gig::progress_t* progress) |
void loader_progress_callback(gig::progress_t* progress) |
1361 |
!Settings::singleton()->warnUserOnExtensions; |
!Settings::singleton()->warnUserOnExtensions; |
1362 |
} |
} |
1363 |
|
|
1364 |
|
void MainWindow::on_action_sync_sampler_instrument_selection() { |
1365 |
|
Settings::singleton()->syncSamplerInstrumentSelection = |
1366 |
|
!Settings::singleton()->syncSamplerInstrumentSelection; |
1367 |
|
} |
1368 |
|
|
1369 |
void MainWindow::on_action_help_about() |
void MainWindow::on_action_help_about() |
1370 |
{ |
{ |
1371 |
Gtk::AboutDialog dialog; |
Gtk::AboutDialog dialog; |
1375 |
dialog.set_name("Gigedit"); |
dialog.set_name("Gigedit"); |
1376 |
#endif |
#endif |
1377 |
dialog.set_version(VERSION); |
dialog.set_version(VERSION); |
1378 |
dialog.set_copyright("Copyright (C) 2006-2014 Andreas Persson"); |
dialog.set_copyright("Copyright (C) 2006-2015 Andreas Persson"); |
1379 |
const std::string sComment = |
const std::string sComment = |
1380 |
_("Built " __DATE__ "\nUsing ") + |
_("Built " __DATE__ "\nUsing ") + |
1381 |
::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" + |
::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" + |
1887 |
} |
} |
1888 |
} |
} |
1889 |
|
|
1890 |
|
void MainWindow::select_sample(gig::Sample* sample) { |
1891 |
|
Glib::RefPtr<Gtk::TreeModel> model = m_TreeViewSamples.get_model(); |
1892 |
|
for (int g = 0; g < model->children().size(); ++g) { |
1893 |
|
Gtk::TreeModel::Row rowGroup = model->children()[g]; |
1894 |
|
for (int s = 0; s < rowGroup.children().size(); ++s) { |
1895 |
|
Gtk::TreeModel::Row rowSample = rowGroup.children()[s]; |
1896 |
|
if (rowSample[m_SamplesModel.m_col_sample] == sample) { |
1897 |
|
show_samples_tab(); |
1898 |
|
m_TreeViewSamples.get_selection()->select(rowGroup.children()[s]); |
1899 |
|
Gtk::TreePath path( |
1900 |
|
m_TreeViewSamples.get_selection()->get_selected() |
1901 |
|
); |
1902 |
|
m_TreeViewSamples.scroll_to_row(path); |
1903 |
|
return; |
1904 |
|
} |
1905 |
|
} |
1906 |
|
} |
1907 |
|
} |
1908 |
|
|
1909 |
void MainWindow::on_sample_treeview_button_release(GdkEventButton* button) { |
void MainWindow::on_sample_treeview_button_release(GdkEventButton* button) { |
1910 |
if (button->type == GDK_BUTTON_PRESS && button->button == 3) { |
if (button->type == GDK_BUTTON_PRESS && button->button == 3) { |
1911 |
Gtk::Menu* sample_popup = |
Gtk::Menu* sample_popup = |
3042 |
Gdk::Pixbuf::create_from_xpm_data(status_detached_xpm) |
Gdk::Pixbuf::create_from_xpm_data(status_detached_xpm) |
3043 |
); |
); |
3044 |
} |
} |
3045 |
|
|
3046 |
|
{ |
3047 |
|
Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>( |
3048 |
|
uiManager->get_widget("/MenuBar/MenuSettings/SyncSamplerInstrumentSelection")); |
3049 |
|
if (item) item->set_sensitive(b); |
3050 |
|
} |
3051 |
} |
} |
3052 |
|
|
3053 |
void MainWindow::on_sample_ref_count_incremented(gig::Sample* sample, int offset) { |
void MainWindow::on_sample_ref_count_incremented(gig::Sample* sample, int offset) { |
3149 |
sigc::signal<void, int/*key*/, int/*velocity*/>& MainWindow::signal_keyboard_key_released() { |
sigc::signal<void, int/*key*/, int/*velocity*/>& MainWindow::signal_keyboard_key_released() { |
3150 |
return m_RegionChooser.signal_keyboard_key_released(); |
return m_RegionChooser.signal_keyboard_key_released(); |
3151 |
} |
} |
3152 |
|
|
3153 |
|
sigc::signal<void, gig::Instrument*>& MainWindow::signal_switch_sampler_instrument() { |
3154 |
|
return switch_sampler_instrument_signal; |
3155 |
|
} |