/[svn]/gigedit/trunk/src/gigedit/mainwindow.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/mainwindow.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2446 by persson, Sun Apr 28 15:40:43 2013 UTC revision 2476 by schoenebeck, Mon Sep 16 13:20:46 2013 UTC
# Line 128  MainWindow::MainWindow() : Line 128  MainWindow::MainWindow() :
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,
# Line 196  MainWindow::MainWindow() : Line 221  MainWindow::MainWindow() :
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'>"
# Line 907  void MainWindow::on_action_help_about() Line 937  void MainWindow::on_action_help_about()
937  #endif  #endif
938      dialog.set_version(VERSION);      dialog.set_version(VERSION);
939      dialog.set_copyright("Copyright (C) 2006-2013 Andreas Persson");      dialog.set_copyright("Copyright (C) 2006-2013 Andreas Persson");
940      dialog.set_comments(_(      const std::string sComment =
941          "Released under the GNU General Public License.\n"          _("Built " __DATE__ "\nUsing ") +
942          "\n"          ::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" +
943          "Please notice that this is still a very young instrument editor. "          _(
944          "So better backup your Gigasampler files before editing them with "              "Gigedit is released under the GNU General Public License.\n"
945          "this application.\n"              "\n"
946          "\n"              "Please notice that this is still a very young instrument editor. "
947          "Please report bugs to: http://bugs.linuxsampler.org")              "So better backup your Gigasampler files before editing them with "
948      );              "this application.\n"
949                "\n"
950                "Please report bugs to: http://bugs.linuxsampler.org"
951            );
952        dialog.set_comments(sComment.c_str());
953      dialog.set_website("http://www.linuxsampler.org");      dialog.set_website("http://www.linuxsampler.org");
954      dialog.set_website_label("http://www.linuxsampler.org");      dialog.set_website_label("http://www.linuxsampler.org");
955      dialog.run();      dialog.run();
# Line 1239  void MainWindow::on_action_view_status_b Line 1273  void MainWindow::on_action_view_status_b
1273      else                    m_StatusBar.hide();      else                    m_StatusBar.hide();
1274  }  }
1275    
1276    bool MainWindow::is_copy_samples_unity_note_enabled() const {
1277        Gtk::CheckMenuItem* item =
1278            dynamic_cast<Gtk::CheckMenuItem*>(uiManager->get_widget("/MenuBar/MenuEdit/CopySampleUnity"));
1279        if (!item) {
1280            std::cerr << "/MenuBar/MenuEdit/CopySampleUnity == NULL\n";
1281            return true;
1282        }
1283        return item->get_active();
1284    }
1285    
1286    bool MainWindow::is_copy_samples_fine_tune_enabled() const {
1287        Gtk::CheckMenuItem* item =
1288            dynamic_cast<Gtk::CheckMenuItem*>(uiManager->get_widget("/MenuBar/MenuEdit/CopySampleTune"));
1289        if (!item) {
1290            std::cerr << "/MenuBar/MenuEdit/CopySampleTune == NULL\n";
1291            return true;
1292        }
1293        return item->get_active();
1294    }
1295    
1296    bool MainWindow::is_copy_samples_loop_enabled() const {
1297        Gtk::CheckMenuItem* item =
1298            dynamic_cast<Gtk::CheckMenuItem*>(uiManager->get_widget("/MenuBar/MenuEdit/CopySampleLoop"));
1299        if (!item) {
1300            std::cerr << "/MenuBar/MenuEdit/CopySampleLoop == NULL\n";
1301            return true;
1302        }
1303        return item->get_active();
1304    }
1305    
1306  void MainWindow::on_button_release(GdkEventButton* button)  void MainWindow::on_button_release(GdkEventButton* button)
1307  {  {
1308      if (button->type == GDK_2BUTTON_PRESS) {      if (button->type == GDK_2BUTTON_PRESS) {
# Line 1564  void MainWindow::on_action_add_sample() Line 1628  void MainWindow::on_action_add_sample()
1628                                 &instrument, sizeof(instrument)) != SF_FALSE)                                 &instrument, sizeof(instrument)) != SF_FALSE)
1629                  {                  {
1630                      sample->MIDIUnityNote = instrument.basenote;                      sample->MIDIUnityNote = instrument.basenote;
1631                        sample->FineTune      = instrument.detune;
1632    
1633                      if (instrument.loop_count && instrument.loops[0].mode != SF_LOOP_NONE) {                      if (instrument.loop_count && instrument.loops[0].mode != SF_LOOP_NONE) {
1634                          sample->Loops = 1;                          sample->Loops = 1;
# Line 1861  void MainWindow::on_sample_label_drop_dr Line 1926  void MainWindow::on_sample_label_drop_dr
1926              channels_changed = true;              channels_changed = true;
1927              region_changed();              region_changed();
1928          }          }
1929          dimreg_edit.set_sample(sample);          dimreg_edit.set_sample(
1930                sample,
1931                is_copy_samples_unity_note_enabled(),
1932                is_copy_samples_fine_tune_enabled(),
1933                is_copy_samples_loop_enabled()
1934            );
1935    
1936          if (sample->Channels == 2 && !stereo_dimension) {          if (sample->Channels == 2 && !stereo_dimension) {
1937              // add samplechannel dimension              // add samplechannel dimension

Legend:
Removed from v.2446  
changed lines
  Added in v.2476

  ViewVC Help
Powered by ViewVC