31 |
|
|
32 |
#define _(String) gettext(String) |
#define _(String) gettext(String) |
33 |
|
|
|
|
|
34 |
bool update_gui; |
bool update_gui; |
35 |
|
|
36 |
uint8_t& access_UnityNote(gig::DimensionRegion* dimreg) |
uint8_t& access_UnityNote(gig::DimensionRegion* dimreg) |
816 |
actionGroup->add(Gtk::Action::create("Quit", Gtk::Stock::QUIT), |
actionGroup->add(Gtk::Action::create("Quit", Gtk::Stock::QUIT), |
817 |
sigc::mem_fun( |
sigc::mem_fun( |
818 |
*this, &MainWindow::hide)); |
*this, &MainWindow::hide)); |
819 |
|
actionGroup->add(Gtk::Action::create("MenuInstrument", _("_Instrument"))); |
820 |
|
|
821 |
action = Gtk::Action::create("MenuHelp", Gtk::Stock::HELP); |
action = Gtk::Action::create("MenuHelp", Gtk::Stock::HELP); |
822 |
actionGroup->add(Gtk::Action::create("MenuHelp", |
actionGroup->add(Gtk::Action::create("MenuHelp", |
823 |
action->property_label())); |
action->property_label())); |
849 |
" <separator/>" |
" <separator/>" |
850 |
" <menuitem action='Quit'/>" |
" <menuitem action='Quit'/>" |
851 |
" </menu>" |
" </menu>" |
852 |
|
" <menu action='MenuInstrument'>" |
853 |
|
" </menu>" |
854 |
#ifdef ABOUT_DIALOG |
#ifdef ABOUT_DIALOG |
855 |
" <menu action='MenuHelp'>" |
" <menu action='MenuHelp'>" |
856 |
" <menuitem action='About'/>" |
" <menuitem action='About'/>" |
1245 |
if (dialog.run() == Gtk::RESPONSE_OK) { |
if (dialog.run() == Gtk::RESPONSE_OK) { |
1246 |
printf("filename=%s\n", dialog.get_filename().c_str()); |
printf("filename=%s\n", dialog.get_filename().c_str()); |
1247 |
|
|
1248 |
|
// remove all entries from "Instrument" menu |
1249 |
|
Gtk::MenuItem* instrument_menu = |
1250 |
|
dynamic_cast<Gtk::MenuItem*>(uiManager->get_widget("/MenuBar/MenuInstrument")); |
1251 |
|
instrument_menu->hide(); |
1252 |
|
for (int i = 0; i < instrument_menu->get_submenu()->items().size(); i++) { |
1253 |
|
delete &instrument_menu->get_submenu()->items()[i]; |
1254 |
|
} |
1255 |
|
instrument_menu->get_submenu()->items().clear(); |
1256 |
|
|
1257 |
m_refTreeModel->clear(); |
m_refTreeModel->clear(); |
1258 |
if (file) delete file; |
if (file) delete file; |
1259 |
|
|
1486 |
|
|
1487 |
propDialog.set_info(gig->pInfo); |
propDialog.set_info(gig->pInfo); |
1488 |
|
|
1489 |
|
Gtk::MenuItem* instrument_menu = |
1490 |
|
dynamic_cast<Gtk::MenuItem*>(uiManager->get_widget("/MenuBar/MenuInstrument")); |
1491 |
|
|
1492 |
|
int instrument_index = 0; |
1493 |
for (gig::Instrument* instrument = gig->GetFirstInstrument() ; instrument ; |
for (gig::Instrument* instrument = gig->GetFirstInstrument() ; instrument ; |
1494 |
instrument = gig->GetNextInstrument()) { |
instrument = gig->GetNextInstrument()) { |
1495 |
Gtk::TreeModel::iterator iter = m_refTreeModel->append(); |
Gtk::TreeModel::iterator iter = m_refTreeModel->append(); |
1496 |
Gtk::TreeModel::Row row = *iter; |
Gtk::TreeModel::Row row = *iter; |
1497 |
row[m_Columns.m_col_name] = instrument->pInfo->Name.c_str(); |
row[m_Columns.m_col_name] = instrument->pInfo->Name.c_str(); |
1498 |
row[m_Columns.m_col_instr] = instrument; |
row[m_Columns.m_col_instr] = instrument; |
1499 |
|
// create a menu item for this instrument |
1500 |
|
Gtk::MenuItem* item= new Gtk::MenuItem(instrument->pInfo->Name.c_str()); |
1501 |
|
instrument_menu->get_submenu()->append(*item); |
1502 |
|
item->signal_activate().connect( |
1503 |
|
sigc::bind( |
1504 |
|
sigc::mem_fun(*this, &MainWindow::on_instrument_selection_change), |
1505 |
|
instrument_index |
1506 |
|
) |
1507 |
|
); |
1508 |
|
instrument_index++; |
1509 |
} |
} |
1510 |
|
instrument_menu->show(); |
1511 |
|
instrument_menu->get_submenu()->show_all_children(); |
1512 |
} |
} |
1513 |
|
|
1514 |
void MainWindow::on_button_release(GdkEventButton* button) |
void MainWindow::on_button_release(GdkEventButton* button) |
1530 |
popup_menu->popup(button->button, button->time); |
popup_menu->popup(button->button, button->time); |
1531 |
} |
} |
1532 |
} |
} |
1533 |
|
|
1534 |
|
void MainWindow::on_instrument_selection_change(int index) { |
1535 |
|
m_RegionChooser.set_instrument(file->GetInstrument(index)); |
1536 |
|
} |