/[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 1322 by schoenebeck, Tue Sep 4 11:04:56 2007 UTC revision 1460 by persson, Sat Oct 27 12:28:33 2007 UTC
# Line 17  Line 17 
17   * 02110-1301 USA.   * 02110-1301 USA.
18   */   */
19    
 #include <libintl.h>  
20  #include <iostream>  #include <iostream>
21    
22  #include <gtkmm/filechooserdialog.h>  #include <gtkmm/filechooserdialog.h>
# Line 25  Line 24 
24  #include <gtkmm/stock.h>  #include <gtkmm/stock.h>
25  #include <gtkmm/targetentry.h>  #include <gtkmm/targetentry.h>
26  #include <gtkmm/main.h>  #include <gtkmm/main.h>
27    #include <gtkmm/toggleaction.h>
28    
29    #include "global.h"
30    
31  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION >= 6) || GTKMM_MAJOR_VERSION > 2  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION >= 6) || GTKMM_MAJOR_VERSION > 2
32  #define ABOUT_DIALOG  #define ABOUT_DIALOG
# Line 48  Glib::ustring filename_display_basename( Line 50  Glib::ustring filename_display_basename(
50    
51  #include "mainwindow.h"  #include "mainwindow.h"
52    
53  #define _(String) gettext(String)  #include "../../gfx/status_attached.xpm"
54    #include "../../gfx/status_detached.xpm"
55    
56  template<class T> inline std::string ToString(T o) {  template<class T> inline std::string ToString(T o) {
57      std::stringstream ss;      std::stringstream ss;
# Line 127  MainWindow::MainWindow() Line 130  MainWindow::MainWindow()
130                           *this, &MainWindow::on_action_quit));                           *this, &MainWindow::on_action_quit));
131      actionGroup->add(Gtk::Action::create("MenuInstrument", _("_Instrument")));      actionGroup->add(Gtk::Action::create("MenuInstrument", _("_Instrument")));
132    
133        actionGroup->add(Gtk::Action::create("MenuView", _("_View")));
134        Glib::RefPtr<Gtk::ToggleAction> toggle_action =
135            Gtk::ToggleAction::create("Statusbar", _("_Statusbar"));
136        toggle_action->set_active(true);
137        actionGroup->add(toggle_action,
138                         sigc::mem_fun(
139                             *this, &MainWindow::on_action_view_status_bar));
140    
141      action = Gtk::Action::create("MenuHelp", Gtk::Stock::HELP);      action = Gtk::Action::create("MenuHelp", Gtk::Stock::HELP);
142      actionGroup->add(Gtk::Action::create("MenuHelp",      actionGroup->add(Gtk::Action::create("MenuHelp",
143                                           action->property_label()));                                           action->property_label()));
# Line 182  MainWindow::MainWindow() Line 193  MainWindow::MainWindow()
193          "    </menu>"          "    </menu>"
194          "    <menu action='MenuInstrument'>"          "    <menu action='MenuInstrument'>"
195          "    </menu>"          "    </menu>"
196            "    <menu action='MenuView'>"
197            "      <menuitem action='Statusbar'/>"
198            "    </menu>"
199  #ifdef ABOUT_DIALOG  #ifdef ABOUT_DIALOG
200          "    <menu action='MenuHelp'>"          "    <menu action='MenuHelp'>"
201          "      <menuitem action='About'/>"          "      <menuitem action='About'/>"
# Line 211  MainWindow::MainWindow() Line 225  MainWindow::MainWindow()
225      m_VBox.pack_start(m_HPaned);      m_VBox.pack_start(m_HPaned);
226      m_VBox.pack_start(m_RegionChooser, Gtk::PACK_SHRINK);      m_VBox.pack_start(m_RegionChooser, Gtk::PACK_SHRINK);
227      m_VBox.pack_start(m_DimRegionChooser, Gtk::PACK_SHRINK);      m_VBox.pack_start(m_DimRegionChooser, Gtk::PACK_SHRINK);
228        m_VBox.pack_start(m_StatusBar, Gtk::PACK_SHRINK);
229    
230        // Status Bar:
231        m_StatusBar.pack_start(m_AttachedStateLabel, Gtk::PACK_SHRINK);
232        m_StatusBar.pack_start(m_AttachedStateImage, Gtk::PACK_SHRINK);
233        m_StatusBar.show();
234    
235      m_RegionChooser.signal_region_selected().connect(      m_RegionChooser.signal_region_selected().connect(
236          sigc::mem_fun(*this, &MainWindow::region_changed) );          sigc::mem_fun(*this, &MainWindow::region_changed) );
# Line 295  MainWindow::MainWindow() Line 315  MainWindow::MainWindow()
315    
316      file = 0;      file = 0;
317      file_is_changed = false;      file_is_changed = false;
318        set_file_is_shared(false);
319    
320      show_all_children();      show_all_children();
321    
# Line 308  MainWindow::~MainWindow() Line 329  MainWindow::~MainWindow()
329    
330  bool MainWindow::on_delete_event(GdkEventAny* event)  bool MainWindow::on_delete_event(GdkEventAny* event)
331  {  {
332      return file_is_changed && !close_confirmation_dialog();      return !file_is_shared && file_is_changed && !close_confirmation_dialog();
333  }  }
334    
335  void MainWindow::on_action_quit()  void MainWindow::on_action_quit()
336  {  {
337      if (file_is_changed && !close_confirmation_dialog()) return;      if (!file_is_shared && file_is_changed && !close_confirmation_dialog()) return;
338      hide();      hide();
339  }  }
340    
# Line 427  void MainWindow::__clear() { Line 448  void MainWindow::__clear() {
448      m_refTreeModel->clear();      m_refTreeModel->clear();
449      m_refSamplesTreeModel->clear();      m_refSamplesTreeModel->clear();
450      // free libgig's gig::File instance      // free libgig's gig::File instance
451      if (file) {      if (file && !file_is_shared) delete file;
452          delete file;      file = NULL;
453          file = NULL;      set_file_is_shared(false);
     }  
454  }  }
455    
456  void MainWindow::on_action_file_new()  void MainWindow::on_action_file_new()
457  {  {
458      if (file_is_changed && !close_confirmation_dialog()) return;      if (!file_is_shared && file_is_changed && !close_confirmation_dialog()) return;
459    
460        if (file_is_shared && !leaving_shared_mode_dialog()) return;
461    
462      // clear all GUI elements      // clear all GUI elements
463      __clear();      __clear();
# Line 467  bool MainWindow::close_confirmation_dial Line 489  bool MainWindow::close_confirmation_dial
489      return response != Gtk::RESPONSE_CANCEL;      return response != Gtk::RESPONSE_CANCEL;
490  }  }
491    
492    bool MainWindow::leaving_shared_mode_dialog() {
493        Glib::ustring msg = _("Detach from sampler and proceed working stand-alone?");
494        Gtk::MessageDialog dialog(*this, msg, false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE);
495    #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION >= 6) || GTKMM_MAJOR_VERSION > 2
496        dialog.set_secondary_text(
497            _("If you proceed to work on another instrument file, it won't be "
498              "used by the sampler until you tell the sampler explicitly to "
499              "load it.")
500       );
501    #endif
502        dialog.add_button(_("_Yes, Detach"), Gtk::RESPONSE_YES);
503        dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
504        dialog.set_default_response(Gtk::RESPONSE_CANCEL);
505        int response = dialog.run();
506        dialog.hide();
507        return response == Gtk::RESPONSE_YES;
508    }
509    
510  void MainWindow::on_action_file_open()  void MainWindow::on_action_file_open()
511  {  {
512      if (file_is_changed && !close_confirmation_dialog()) return;      if (!file_is_shared && file_is_changed && !close_confirmation_dialog()) return;
513    
514        if (file_is_shared && !leaving_shared_mode_dialog()) return;
515    
516      Gtk::FileChooserDialog dialog(*this, _("Open file"));      Gtk::FileChooserDialog dialog(*this, _("Open file"));
517      dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);      dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
# Line 510  void MainWindow::load_instrument(gig::In Line 552  void MainWindow::load_instrument(gig::In
552          msg.run();          msg.run();
553          Gtk::Main::quit();          Gtk::Main::quit();
554      }      }
555        // clear all GUI elements
556        __clear();
557        // load the instrument
558      gig::File* pFile = (gig::File*) instr->GetParent();      gig::File* pFile = (gig::File*) instr->GetParent();
559      load_gig(pFile, 0 /*file name*/);      load_gig(pFile, 0 /*file name*/, true /*shared instrument*/);
560      //TODO: automatically select the given instrument      //TODO: automatically select the given instrument
561  }  }
562    
# Line 560  bool MainWindow::check_if_savable() Line 605  bool MainWindow::check_if_savable()
605  bool MainWindow::file_save()  bool MainWindow::file_save()
606  {  {
607      if (!check_if_savable()) return false;      if (!check_if_savable()) return false;
608      if (!file_has_name) return file_save_as();      if (!file_is_shared && !file_has_name) return file_save_as();
609    
610      std::cout << "Saving file\n" << std::flush;      std::cout << "Saving file\n" << std::flush;
611      file_structure_to_be_changed_signal.emit(this->file);      file_structure_to_be_changed_signal.emit(this->file);
# Line 572  bool MainWindow::file_save() Line 617  bool MainWindow::file_save()
617          }          }
618      } catch (RIFF::Exception e) {      } catch (RIFF::Exception e) {
619          file_structure_changed_signal.emit(this->file);          file_structure_changed_signal.emit(this->file);
620          Glib::ustring txt = "Could not save file: " + e.Message;          Glib::ustring txt = _("Could not save file: ") + e.Message;
621          Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);          Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);
622          msg.run();          msg.run();
623          return false;          return false;
# Line 627  bool MainWindow::file_save_as() Line 672  bool MainWindow::file_save_as()
672              file_is_changed = false;              file_is_changed = false;
673          } catch (RIFF::Exception e) {          } catch (RIFF::Exception e) {
674              file_structure_changed_signal.emit(this->file);              file_structure_changed_signal.emit(this->file);
675              Glib::ustring txt = "Could not save file: " + e.Message;              Glib::ustring txt = _("Could not save file: ") + e.Message;
676              Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);              Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);
677              msg.run();              msg.run();
678              return false;              return false;
# Line 724  void MainWindow::__import_queued_samples Line 769  void MainWindow::__import_queued_samples
769      }      }
770      // show error message box when some sample(s) could not be imported      // show error message box when some sample(s) could not be imported
771      if (error_files.size()) {      if (error_files.size()) {
772          Glib::ustring txt = "Could not import the following sample(s):\n" + error_files;          Glib::ustring txt = _("Could not import the following sample(s):\n") + error_files;
773          Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);          Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);
774          msg.run();          msg.run();
775      }      }
# Line 741  void MainWindow::on_action_help_about() Line 786  void MainWindow::on_action_help_about()
786  #ifdef ABOUT_DIALOG  #ifdef ABOUT_DIALOG
787      Gtk::AboutDialog dialog;      Gtk::AboutDialog dialog;
788      dialog.set_version(VERSION);      dialog.set_version(VERSION);
789        dialog.set_copyright("Copyright (C) 2006,2007 Andreas Persson");
790        dialog.set_comments(
791            "Released under the GNU General Public License.\n"
792            "\n"
793            "Please notice that this is still a very young instrument editor. "
794            "So better backup your Gigasampler files before editing them with "
795            "this application.\n"
796            "\n"
797            "Please report bugs to: http://bugs.linuxsampler.org"
798        );
799        dialog.set_website("http://www.linuxsampler.org");
800        dialog.set_website_label("http://www.linuxsampler.org");
801      dialog.run();      dialog.run();
802  #endif  #endif
803  }  }
# Line 801  void PropDialog::set_info(DLS::Info* inf Line 858  void PropDialog::set_info(DLS::Info* inf
858      entry[15].set_text(info->Subject);      entry[15].set_text(info->Subject);
859  }  }
860    
861    void InstrumentProps::set_IsDrum(bool value)
862    {
863        instrument->IsDrum = value;
864    }
865    
866    void InstrumentProps::set_MIDIBank(uint16_t value)
867    {
868        instrument->MIDIBank = value;
869    }
870    
871    void InstrumentProps::set_MIDIProgram(uint32_t value)
872    {
873        instrument->MIDIProgram = value;
874    }
875    
876    void InstrumentProps::set_DimensionKeyRange_low(uint8_t value)
877    {
878        instrument->DimensionKeyRange.low = value;
879        if (value > instrument->DimensionKeyRange.high) {
880            eDimensionKeyRangeHigh.set_value(value);
881        }
882    }
883    
884    void InstrumentProps::set_DimensionKeyRange_high(uint8_t value)
885    {
886        instrument->DimensionKeyRange.high = value;
887        if (value < instrument->DimensionKeyRange.low) {
888            eDimensionKeyRangeLow.set_value(value);
889        }
890    }
891    
892  void InstrumentProps::add_prop(BoolEntry& boolentry)  void InstrumentProps::add_prop(BoolEntry& boolentry)
893  {  {
894      table.attach(boolentry.widget, 0, 2, rowno, rowno + 1,      table.attach(boolentry.widget, 0, 2, rowno, rowno + 1,
895                   Gtk::FILL, Gtk::SHRINK);                   Gtk::FILL, Gtk::SHRINK);
896      rowno++;      rowno++;
     boolentry.signal_changed_by_user().connect(instrument_changed.make_slot());  
897  }  }
898    
899  void InstrumentProps::add_prop(BoolEntryPlus6& boolentry)  void InstrumentProps::add_prop(BoolEntryPlus6& boolentry)
# Line 814  void InstrumentProps::add_prop(BoolEntry Line 901  void InstrumentProps::add_prop(BoolEntry
901      table.attach(boolentry.widget, 0, 2, rowno, rowno + 1,      table.attach(boolentry.widget, 0, 2, rowno, rowno + 1,
902                   Gtk::FILL, Gtk::SHRINK);                   Gtk::FILL, Gtk::SHRINK);
903      rowno++;      rowno++;
     boolentry.signal_changed_by_user().connect(instrument_changed.make_slot());  
904  }  }
905    
906  void InstrumentProps::add_prop(LabelWidget& prop)  void InstrumentProps::add_prop(LabelWidget& prop)
# Line 824  void InstrumentProps::add_prop(LabelWidg Line 910  void InstrumentProps::add_prop(LabelWidg
910      table.attach(prop.widget, 1, 2, rowno, rowno + 1,      table.attach(prop.widget, 1, 2, rowno, rowno + 1,
911                   Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK);                   Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK);
912      rowno++;      rowno++;
     prop.signal_changed_by_user().connect(instrument_changed.make_slot());  
913  }  }
914    
915  InstrumentProps::InstrumentProps()  InstrumentProps::InstrumentProps()
# Line 841  InstrumentProps::InstrumentProps() Line 926  InstrumentProps::InstrumentProps()
926        ePitchbendRange("Pitchbend range", 0, 12),        ePitchbendRange("Pitchbend range", 0, 12),
927        ePianoReleaseMode("Piano release mode"),        ePianoReleaseMode("Piano release mode"),
928        eDimensionKeyRangeLow("Dimension key range low"),        eDimensionKeyRangeLow("Dimension key range low"),
929        eDimensionKeyRangeHigh("Dimension key range high")        eDimensionKeyRangeHigh("Dimension key range high"),
930          update_model(0)
931  {  {
932      set_title("Instrument properties");      set_title("Instrument properties");
933    
934        connect(eIsDrum, &InstrumentProps::set_IsDrum);
935        connect(eMIDIBank, &InstrumentProps::set_MIDIBank);
936        connect(eMIDIProgram, &InstrumentProps::set_MIDIProgram);
937        connect(eAttenuation, &gig::Instrument::Attenuation);
938        connect(eGainPlus6, &gig::Instrument::Attenuation);
939        connect(eEffectSend, &gig::Instrument::EffectSend);
940        connect(eFineTune, &gig::Instrument::FineTune);
941        connect(ePitchbendRange, &gig::Instrument::PitchbendRange);
942        connect(ePianoReleaseMode, &gig::Instrument::PianoReleaseMode);
943        connect(eDimensionKeyRangeLow,
944                &InstrumentProps::set_DimensionKeyRange_low);
945        connect(eDimensionKeyRangeHigh,
946                &InstrumentProps::set_DimensionKeyRange_high);
947    
948      rowno = 0;      rowno = 0;
949      table.set_col_spacings(5);      table.set_col_spacings(5);
950    
# Line 861  InstrumentProps::InstrumentProps() Line 961  InstrumentProps::InstrumentProps()
961      add_prop(eDimensionKeyRangeLow);      add_prop(eDimensionKeyRangeLow);
962      add_prop(eDimensionKeyRangeHigh);      add_prop(eDimensionKeyRangeHigh);
963    
     eDimensionKeyRangeLow.signal_changed_by_user().connect(  
         sigc::mem_fun(*this, &InstrumentProps::key_range_low_changed));  
     eDimensionKeyRangeHigh.signal_changed_by_user().connect(  
         sigc::mem_fun(*this, &InstrumentProps::key_range_high_changed));  
   
964      add(vbox);      add(vbox);
965      table.set_border_width(5);      table.set_border_width(5);
966      vbox.pack_start(table);      vbox.pack_start(table);
# Line 888  InstrumentProps::InstrumentProps() Line 983  InstrumentProps::InstrumentProps()
983    
984  void InstrumentProps::set_instrument(gig::Instrument* instrument)  void InstrumentProps::set_instrument(gig::Instrument* instrument)
985  {  {
986      eName.set_ptr(&instrument->pInfo->Name);      this->instrument = instrument;
     eIsDrum.set_ptr(&instrument->IsDrum);  
     eMIDIBank.set_ptr(&instrument->MIDIBank);  
     eMIDIProgram.set_ptr(&instrument->MIDIProgram);  
     eAttenuation.set_ptr(&instrument->Attenuation);  
     eGainPlus6.set_ptr(&instrument->Attenuation);  
     eEffectSend.set_ptr(&instrument->EffectSend);  
     eFineTune.set_ptr(&instrument->FineTune);  
     ePitchbendRange.set_ptr(&instrument->PitchbendRange);  
     ePianoReleaseMode.set_ptr(&instrument->PianoReleaseMode);  
     eDimensionKeyRangeLow.set_ptr(0);  
     eDimensionKeyRangeHigh.set_ptr(0);  
     eDimensionKeyRangeLow.set_ptr(&instrument->DimensionKeyRange.low);  
     eDimensionKeyRangeHigh.set_ptr(&instrument->DimensionKeyRange.high);  
 }  
   
 void InstrumentProps::key_range_low_changed()  
 {  
     double l = eDimensionKeyRangeLow.get_value();  
     double h = eDimensionKeyRangeHigh.get_value();  
     if (h < l) eDimensionKeyRangeHigh.set_value(l);  
 }  
987    
988  void InstrumentProps::key_range_high_changed()      update_model++;
989  {      eName.set_ptr(&instrument->pInfo->Name);
990      double l = eDimensionKeyRangeLow.get_value();      eIsDrum.set_value(instrument->IsDrum);
991      double h = eDimensionKeyRangeHigh.get_value();      eMIDIBank.set_value(instrument->MIDIBank);
992      if (h < l) eDimensionKeyRangeLow.set_value(h);      eMIDIProgram.set_value(instrument->MIDIProgram);
993        eAttenuation.set_value(instrument->Attenuation);
994        eGainPlus6.set_value(instrument->Attenuation);
995        eEffectSend.set_value(instrument->EffectSend);
996        eFineTune.set_value(instrument->FineTune);
997        ePitchbendRange.set_value(instrument->PitchbendRange);
998        ePianoReleaseMode.set_value(instrument->PianoReleaseMode);
999        eDimensionKeyRangeLow.set_value(instrument->DimensionKeyRange.low);
1000        eDimensionKeyRangeHigh.set_value(instrument->DimensionKeyRange.high);
1001        update_model--;
1002  }  }
1003    
1004  sigc::signal<void> InstrumentProps::signal_instrument_changed()  sigc::signal<void>& InstrumentProps::signal_instrument_changed()
1005  {  {
1006      return instrument_changed;      return instrument_changed;
1007  }  }
# Line 931  void MainWindow::file_changed() Line 1014  void MainWindow::file_changed()
1014      }      }
1015  }  }
1016    
1017  void MainWindow::load_gig(gig::File* gig, const char* filename)  void MainWindow::load_gig(gig::File* gig, const char* filename, bool isSharedInstrument)
1018  {  {
1019      file = 0;      file = 0;
1020        set_file_is_shared(isSharedInstrument);
1021    
1022      this->filename = filename ? filename : _("Unsaved Gig File");      this->filename = filename ? filename : _("Unsaved Gig File");
1023      set_title(Glib::filename_display_basename(this->filename));      set_title(Glib::filename_display_basename(this->filename));
# Line 1010  void MainWindow::show_instr_props() Line 1094  void MainWindow::show_instr_props()
1094      }      }
1095  }  }
1096    
1097    void MainWindow::on_action_view_status_bar() {
1098        Gtk::CheckMenuItem* item =
1099            dynamic_cast<Gtk::CheckMenuItem*>(uiManager->get_widget("/MenuBar/MenuView/Statusbar"));
1100        if (!item) {
1101            std::cerr << "/MenuBar/MenuView/Statusbar == NULL\n";
1102            return;
1103        }
1104        if (item->get_active()) m_StatusBar.show();
1105        else                    m_StatusBar.hide();
1106    }
1107    
1108  void MainWindow::on_button_release(GdkEventButton* button)  void MainWindow::on_button_release(GdkEventButton* button)
1109  {  {
1110      if (button->type == GDK_2BUTTON_PRESS) {      if (button->type == GDK_2BUTTON_PRESS) {
# Line 1067  void MainWindow::on_action_add_instrumen Line 1162  void MainWindow::on_action_add_instrumen
1162    
1163  void MainWindow::on_action_remove_instrument() {  void MainWindow::on_action_remove_instrument() {
1164      if (!file) return;      if (!file) return;
1165        if (file_is_shared) {
1166            Gtk::MessageDialog msg(
1167                *this,
1168                 _("You cannot delete an instrument from this file, since it's "
1169                   "currently used by the sampler."),
1170                 false, Gtk::MESSAGE_INFO
1171            );
1172            msg.run();
1173            return;
1174        }
1175    
1176      Glib::RefPtr<Gtk::TreeSelection> sel = m_TreeView.get_selection();      Glib::RefPtr<Gtk::TreeSelection> sel = m_TreeView.get_selection();
1177      Gtk::TreeModel::iterator it = sel->get_selected();      Gtk::TreeModel::iterator it = sel->get_selected();
1178      if (it) {      if (it) {
# Line 1253  void MainWindow::on_action_add_sample() Line 1359  void MainWindow::on_action_add_sample()
1359          }          }
1360          // show error message box when some file(s) could not be opened / added          // show error message box when some file(s) could not be opened / added
1361          if (error_files.size()) {          if (error_files.size()) {
1362              Glib::ustring txt = "Could not add the following sample(s):\n" + error_files;              Glib::ustring txt = _("Could not add the following sample(s):\n") + error_files;
1363              Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);              Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);
1364              msg.run();              msg.run();
1365          }          }
# Line 1426  void MainWindow::on_sample_label_drop_dr Line 1532  void MainWindow::on_sample_label_drop_dr
1532          // notify we're done with altering          // notify we're done with altering
1533          region_changed_signal.emit(region);          region_changed_signal.emit(region);
1534    
1535            file_changed();
1536    
1537          return;          return;
1538      }      }
1539      // drop failed      // drop failed
# Line 1466  void MainWindow::instrument_name_changed Line 1574  void MainWindow::instrument_name_changed
1574      }      }
1575  }  }
1576    
1577  sigc::signal<void, gig::File*> MainWindow::signal_file_structure_to_be_changed() {  void MainWindow::set_file_is_shared(bool b) {
1578        this->file_is_shared = b;
1579    
1580        if (file_is_shared) {
1581            m_AttachedStateLabel.set_label(_("live-mode"));
1582            m_AttachedStateImage.set(
1583                Gdk::Pixbuf::create_from_xpm_data(status_attached_xpm)
1584            );
1585        } else {
1586            m_AttachedStateLabel.set_label(_("stand-alone"));
1587            m_AttachedStateImage.set(
1588                Gdk::Pixbuf::create_from_xpm_data(status_detached_xpm)
1589            );
1590        }
1591    }
1592    
1593    sigc::signal<void, gig::File*>& MainWindow::signal_file_structure_to_be_changed() {
1594      return file_structure_to_be_changed_signal;      return file_structure_to_be_changed_signal;
1595  }  }
1596    
1597  sigc::signal<void, gig::File*> MainWindow::signal_file_structure_changed() {  sigc::signal<void, gig::File*>& MainWindow::signal_file_structure_changed() {
1598      return file_structure_changed_signal;      return file_structure_changed_signal;
1599  }  }
1600    
1601  sigc::signal<void, std::list<gig::Sample*> > MainWindow::signal_samples_to_be_removed() {  sigc::signal<void, std::list<gig::Sample*> >& MainWindow::signal_samples_to_be_removed() {
1602      return samples_to_be_removed_signal;      return samples_to_be_removed_signal;
1603  }  }
1604    
1605  sigc::signal<void> MainWindow::signal_samples_removed() {  sigc::signal<void>& MainWindow::signal_samples_removed() {
1606      return samples_removed_signal;      return samples_removed_signal;
1607  }  }
1608    
1609  sigc::signal<void, gig::Region*> MainWindow::signal_region_to_be_changed() {  sigc::signal<void, gig::Region*>& MainWindow::signal_region_to_be_changed() {
1610      return region_to_be_changed_signal;      return region_to_be_changed_signal;
1611  }  }
1612    
1613  sigc::signal<void, gig::Region*> MainWindow::signal_region_changed() {  sigc::signal<void, gig::Region*>& MainWindow::signal_region_changed() {
1614      return region_changed_signal;      return region_changed_signal;
1615  }  }
1616    
1617  sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/> MainWindow::signal_sample_ref_changed() {  sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& MainWindow::signal_sample_ref_changed() {
1618      return sample_ref_changed_signal;      return sample_ref_changed_signal;
1619  }  }
1620    
1621  sigc::signal<void, gig::DimensionRegion*> MainWindow::signal_dimreg_to_be_changed() {  sigc::signal<void, gig::DimensionRegion*>& MainWindow::signal_dimreg_to_be_changed() {
1622      return dimreg_to_be_changed_signal;      return dimreg_to_be_changed_signal;
1623  }  }
1624    
1625  sigc::signal<void, gig::DimensionRegion*> MainWindow::signal_dimreg_changed() {  sigc::signal<void, gig::DimensionRegion*>& MainWindow::signal_dimreg_changed() {
1626      return dimreg_changed_signal;      return dimreg_changed_signal;
1627  }  }

Legend:
Removed from v.1322  
changed lines
  Added in v.1460

  ViewVC Help
Powered by ViewVC