902 |
// load the instrument |
// load the instrument |
903 |
gig::File* pFile = (gig::File*) instr->GetParent(); |
gig::File* pFile = (gig::File*) instr->GetParent(); |
904 |
load_gig(pFile, 0 /*file name*/, true /*shared instrument*/); |
load_gig(pFile, 0 /*file name*/, true /*shared instrument*/); |
905 |
//TODO: automatically select the given instrument |
// automatically select the given instrument |
906 |
|
int i = 0; |
907 |
|
for (gig::Instrument* instrument = pFile->GetFirstInstrument(); instrument; |
908 |
|
instrument = pFile->GetNextInstrument(), ++i) |
909 |
|
{ |
910 |
|
if (instrument == instr) { |
911 |
|
// select item in "instruments" tree view |
912 |
|
m_TreeView.get_selection()->select(Gtk::TreePath(ToString(i))); |
913 |
|
// make sure the selected item in the "instruments" tree view is |
914 |
|
// visible (scroll to it) |
915 |
|
m_TreeView.scroll_to_row(Gtk::TreePath(ToString(i))); |
916 |
|
// select item in instrument menu |
917 |
|
{ |
918 |
|
const std::vector<Gtk::Widget*> children = |
919 |
|
instrument_menu->get_children(); |
920 |
|
static_cast<Gtk::RadioMenuItem*>(children[i])->set_active(); |
921 |
|
} |
922 |
|
// update region chooser and dimension region chooser |
923 |
|
m_RegionChooser.set_instrument(instr); |
924 |
|
break; |
925 |
|
} |
926 |
|
} |
927 |
} |
} |
928 |
|
|
929 |
void MainWindow::on_loader_progress() |
void MainWindow::on_loader_progress() |