128 |
*this, &MainWindow::on_action_quit)); |
*this, &MainWindow::on_action_quit)); |
129 |
actionGroup->add(Gtk::Action::create("MenuInstrument", _("_Instrument"))); |
actionGroup->add(Gtk::Action::create("MenuInstrument", _("_Instrument"))); |
130 |
|
|
131 |
actionGroup->add(Gtk::Action::create("MenuView", _("_View"))); |
|
132 |
|
actionGroup->add(Gtk::Action::create("MenuEdit", _("_Edit"))); |
133 |
|
|
134 |
Glib::RefPtr<Gtk::ToggleAction> toggle_action = |
Glib::RefPtr<Gtk::ToggleAction> toggle_action = |
135 |
|
Gtk::ToggleAction::create("CopySampleUnity", _("Copy Sample's _Unity Note"), "ffaga"); |
136 |
|
toggle_action->set_active(true); |
137 |
|
//FIXME: doesn't work, why? |
138 |
|
toggle_action->set_tooltip(_("Used when dragging a sample to a region's sample reference field.")); |
139 |
|
actionGroup->add(toggle_action); |
140 |
|
|
141 |
|
toggle_action = |
142 |
|
Gtk::ToggleAction::create("CopySampleTune", _("Copy Sample's _Fine Tune")); |
143 |
|
toggle_action->set_active(true); |
144 |
|
//FIXME: doesn't work, why? |
145 |
|
toggle_action->set_tooltip(_("Used when dragging a sample to a region's sample reference field.")); |
146 |
|
actionGroup->add(toggle_action); |
147 |
|
|
148 |
|
toggle_action = |
149 |
|
Gtk::ToggleAction::create("CopySampleLoop", _("Copy Sample's _Loop Points")); |
150 |
|
toggle_action->set_active(true); |
151 |
|
//FIXME: doesn't work, why? |
152 |
|
toggle_action->set_tooltip(_("Used when dragging a sample to a region's sample reference field.")); |
153 |
|
actionGroup->add(toggle_action); |
154 |
|
|
155 |
|
|
156 |
|
actionGroup->add(Gtk::Action::create("MenuView", _("_View"))); |
157 |
|
toggle_action = |
158 |
Gtk::ToggleAction::create("Statusbar", _("_Statusbar")); |
Gtk::ToggleAction::create("Statusbar", _("_Statusbar")); |
159 |
toggle_action->set_active(true); |
toggle_action->set_active(true); |
160 |
actionGroup->add(toggle_action, |
actionGroup->add(toggle_action, |
221 |
" <separator/>" |
" <separator/>" |
222 |
" <menuitem action='Quit'/>" |
" <menuitem action='Quit'/>" |
223 |
" </menu>" |
" </menu>" |
224 |
|
" <menu action='MenuEdit'>" |
225 |
|
" <menuitem action='CopySampleUnity'/>" |
226 |
|
" <menuitem action='CopySampleTune'/>" |
227 |
|
" <menuitem action='CopySampleLoop'/>" |
228 |
|
" </menu>" |
229 |
" <menu action='MenuInstrument'>" |
" <menu action='MenuInstrument'>" |
230 |
" </menu>" |
" </menu>" |
231 |
" <menu action='MenuView'>" |
" <menu action='MenuView'>" |
1269 |
else m_StatusBar.hide(); |
else m_StatusBar.hide(); |
1270 |
} |
} |
1271 |
|
|
1272 |
|
bool MainWindow::is_copy_samples_unity_note_enabled() const { |
1273 |
|
Gtk::CheckMenuItem* item = |
1274 |
|
dynamic_cast<Gtk::CheckMenuItem*>(uiManager->get_widget("/MenuBar/MenuEdit/CopySampleUnity")); |
1275 |
|
if (!item) { |
1276 |
|
std::cerr << "/MenuBar/MenuEdit/CopySampleUnity == NULL\n"; |
1277 |
|
return true; |
1278 |
|
} |
1279 |
|
return item->get_active(); |
1280 |
|
} |
1281 |
|
|
1282 |
|
bool MainWindow::is_copy_samples_fine_tune_enabled() const { |
1283 |
|
Gtk::CheckMenuItem* item = |
1284 |
|
dynamic_cast<Gtk::CheckMenuItem*>(uiManager->get_widget("/MenuBar/MenuEdit/CopySampleTune")); |
1285 |
|
if (!item) { |
1286 |
|
std::cerr << "/MenuBar/MenuEdit/CopySampleTune == NULL\n"; |
1287 |
|
return true; |
1288 |
|
} |
1289 |
|
return item->get_active(); |
1290 |
|
} |
1291 |
|
|
1292 |
|
bool MainWindow::is_copy_samples_loop_enabled() const { |
1293 |
|
Gtk::CheckMenuItem* item = |
1294 |
|
dynamic_cast<Gtk::CheckMenuItem*>(uiManager->get_widget("/MenuBar/MenuEdit/CopySampleLoop")); |
1295 |
|
if (!item) { |
1296 |
|
std::cerr << "/MenuBar/MenuEdit/CopySampleLoop == NULL\n"; |
1297 |
|
return true; |
1298 |
|
} |
1299 |
|
return item->get_active(); |
1300 |
|
} |
1301 |
|
|
1302 |
void MainWindow::on_button_release(GdkEventButton* button) |
void MainWindow::on_button_release(GdkEventButton* button) |
1303 |
{ |
{ |
1304 |
if (button->type == GDK_2BUTTON_PRESS) { |
if (button->type == GDK_2BUTTON_PRESS) { |
1921 |
channels_changed = true; |
channels_changed = true; |
1922 |
region_changed(); |
region_changed(); |
1923 |
} |
} |
1924 |
dimreg_edit.set_sample(sample); |
dimreg_edit.set_sample( |
1925 |
|
sample, |
1926 |
|
is_copy_samples_unity_note_enabled(), |
1927 |
|
is_copy_samples_fine_tune_enabled(), |
1928 |
|
is_copy_samples_loop_enabled() |
1929 |
|
); |
1930 |
|
|
1931 |
if (sample->Channels == 2 && !stereo_dimension) { |
if (sample->Channels == 2 && !stereo_dimension) { |
1932 |
// add samplechannel dimension |
// add samplechannel dimension |