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( |
1886 |
} |
} |
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) { |