/[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 2688 by schoenebeck, Mon Dec 29 16:30:21 2014 UTC revision 2689 by schoenebeck, Sun Jan 4 17:19:19 2015 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (C) 2006-2014 Andreas Persson   * Copyright (C) 2006-2015 Andreas Persson
3   *   *
4   * This program is free software; you can redistribute it and/or   * This program is free software; you can redistribute it and/or
5   * modify it under the terms of the GNU General Public License as   * modify it under the terms of the GNU General Public License as
# Line 217  MainWindow::MainWindow() : Line 217  MainWindow::MainWindow() :
217          sigc::mem_fun(*this, &MainWindow::on_action_warn_user_on_extensions)          sigc::mem_fun(*this, &MainWindow::on_action_warn_user_on_extensions)
218      );      );
219    
220        toggle_action =
221            Gtk::ToggleAction::create("SyncSamplerInstrumentSelection", _("Synchronize sampler's instrument selection"));
222        toggle_action->set_active(Settings::singleton()->syncSamplerInstrumentSelection);
223        actionGroup->add(
224            toggle_action,
225            sigc::mem_fun(*this, &MainWindow::on_action_sync_sampler_instrument_selection)
226        );
227    
228    
229      actionGroup->add(Gtk::Action::create("MenuTools", _("_Tools")));      actionGroup->add(Gtk::Action::create("MenuTools", _("_Tools")));
230    
# Line 336  MainWindow::MainWindow() : Line 344  MainWindow::MainWindow() :
344          "    </menu>"          "    </menu>"
345          "    <menu action='MenuSettings'>"          "    <menu action='MenuSettings'>"
346          "      <menuitem action='WarnUserOnExtensions'/>"          "      <menuitem action='WarnUserOnExtensions'/>"
347            "      <menuitem action='SyncSamplerInstrumentSelection'/>"
348          "    </menu>"          "    </menu>"
349          "    <menu action='MenuHelp'>"          "    <menu action='MenuHelp'>"
350          "      <menuitem action='About'/>"          "      <menuitem action='About'/>"
# Line 397  MainWindow::MainWindow() : Line 406  MainWindow::MainWindow() :
406      }      }
407      {      {
408          Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>(          Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>(
409                uiManager->get_widget("/MenuBar/MenuSettings/SyncSamplerInstrumentSelection"));
410            item->set_tooltip_text(_("If checked, the sampler's current instrument will automatically be switched whenever another instrument was selected in gigedit (only available in live-mode)."));
411        }
412        {
413            Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>(
414              uiManager->get_widget("/MenuBar/MenuTools/CombineInstruments"));              uiManager->get_widget("/MenuBar/MenuTools/CombineInstruments"));
415          item->set_tooltip_text(_("Create combi sounds out of individual sounds of this .gig file."));          item->set_tooltip_text(_("Create combi sounds out of individual sounds of this .gig file."));
416      }      }
# Line 688  void MainWindow::on_sel_change() Line 702  void MainWindow::on_sel_change()
702      }      }
703    
704      m_RegionChooser.set_instrument(get_instrument());      m_RegionChooser.set_instrument(get_instrument());
705    
706        if (Settings::singleton()->syncSamplerInstrumentSelection) {
707            switch_sampler_instrument_signal.emit(get_instrument());
708        }
709  }  }
710    
711  void loader_progress_callback(gig::progress_t* progress)  void loader_progress_callback(gig::progress_t* progress)
# Line 1339  void MainWindow::on_action_warn_user_on_ Line 1357  void MainWindow::on_action_warn_user_on_
1357          !Settings::singleton()->warnUserOnExtensions;          !Settings::singleton()->warnUserOnExtensions;
1358  }  }
1359    
1360    void MainWindow::on_action_sync_sampler_instrument_selection() {
1361        Settings::singleton()->syncSamplerInstrumentSelection =
1362            !Settings::singleton()->syncSamplerInstrumentSelection;
1363    }
1364    
1365  void MainWindow::on_action_help_about()  void MainWindow::on_action_help_about()
1366  {  {
1367      Gtk::AboutDialog dialog;      Gtk::AboutDialog dialog;
# Line 1348  void MainWindow::on_action_help_about() Line 1371  void MainWindow::on_action_help_about()
1371      dialog.set_name("Gigedit");      dialog.set_name("Gigedit");
1372  #endif  #endif
1373      dialog.set_version(VERSION);      dialog.set_version(VERSION);
1374      dialog.set_copyright("Copyright (C) 2006-2014 Andreas Persson");      dialog.set_copyright("Copyright (C) 2006-2015 Andreas Persson");
1375      const std::string sComment =      const std::string sComment =
1376          _("Built " __DATE__ "\nUsing ") +          _("Built " __DATE__ "\nUsing ") +
1377          ::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" +          ::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" +
# Line 2996  void MainWindow::set_file_is_shared(bool Line 3019  void MainWindow::set_file_is_shared(bool
3019              Gdk::Pixbuf::create_from_xpm_data(status_detached_xpm)              Gdk::Pixbuf::create_from_xpm_data(status_detached_xpm)
3020          );          );
3021      }      }
3022    
3023        {
3024            Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>(
3025                uiManager->get_widget("/MenuBar/MenuSettings/SyncSamplerInstrumentSelection"));
3026            if (item) item->set_sensitive(b);
3027        }
3028  }  }
3029    
3030  void MainWindow::on_sample_ref_count_incremented(gig::Sample* sample, int offset) {  void MainWindow::on_sample_ref_count_incremented(gig::Sample* sample, int offset) {
# Line 3097  sigc::signal<void, int/*key*/, int/*velo Line 3126  sigc::signal<void, int/*key*/, int/*velo
3126  sigc::signal<void, int/*key*/, int/*velocity*/>& MainWindow::signal_keyboard_key_released() {  sigc::signal<void, int/*key*/, int/*velocity*/>& MainWindow::signal_keyboard_key_released() {
3127      return m_RegionChooser.signal_keyboard_key_released();      return m_RegionChooser.signal_keyboard_key_released();
3128  }  }
3129    
3130    sigc::signal<void, gig::Instrument*>& MainWindow::signal_switch_sampler_instrument() {
3131        return switch_sampler_instrument_signal;
3132    }

Legend:
Removed from v.2688  
changed lines
  Added in v.2689

  ViewVC Help
Powered by ViewVC