/[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 3619 by schoenebeck, Tue Oct 1 16:21:28 2019 UTC revision 3636 by schoenebeck, Thu Oct 24 12:06:18 2019 UTC
# Line 1484  MainWindow::MainWindow() : Line 1484  MainWindow::MainWindow() :
1484          sigc::mem_fun(*this, &MainWindow::file_changed));          sigc::mem_fun(*this, &MainWindow::file_changed));
1485      instrumentProps.signal_changed().connect(      instrumentProps.signal_changed().connect(
1486          sigc::mem_fun(*this, &MainWindow::file_changed));          sigc::mem_fun(*this, &MainWindow::file_changed));
1487      propDialog.signal_changed().connect(      fileProps.signal_changed().connect(
1488          sigc::mem_fun(*this, &MainWindow::file_changed));          sigc::mem_fun(*this, &MainWindow::file_changed));
1489      midiRules.signal_changed().connect(      midiRules.signal_changed().connect(
1490          sigc::mem_fun(*this, &MainWindow::file_changed));          sigc::mem_fun(*this, &MainWindow::file_changed));
# Line 2603  void MainWindow::__import_queued_samples Line 2603  void MainWindow::__import_queued_samples
2603    
2604  void MainWindow::on_action_file_properties()  void MainWindow::on_action_file_properties()
2605  {  {
2606      propDialog.show();      fileProps.show();
2607      propDialog.deiconify();      fileProps.deiconify();
2608  }  }
2609    
2610  void MainWindow::on_action_warn_user_on_extensions() {  void MainWindow::on_action_warn_user_on_extensions() {
# Line 2675  void MainWindow::on_action_help_about() Line 2675  void MainWindow::on_action_help_about()
2675      dialog.run();      dialog.run();
2676  }  }
2677    
2678  PropDialog::PropDialog()  FilePropDialog::FilePropDialog()
2679      : eFileFormat(_("File Format")),      : eFileFormat(_("File Format")),
2680        eName(_("Name")),        eName(_("Name")),
2681        eCreationDate(_("Creation date")),        eCreationDate(_("Creation date")),
# Line 2709  PropDialog::PropDialog() Line 2709  PropDialog::PropDialog()
2709      set_title(_("File Properties"));      set_title(_("File Properties"));
2710      eName.set_width_chars(50);      eName.set_width_chars(50);
2711    
2712      connect(eFileFormat, &PropDialog::set_FileFormat);      connect(eFileFormat, &FilePropDialog::set_FileFormat);
2713      connect(eName, &DLS::Info::Name);      connect(eName, &DLS::Info::Name);
2714      connect(eCreationDate, &DLS::Info::CreationDate);      connect(eCreationDate, &DLS::Info::CreationDate);
2715      connect(eComments, &DLS::Info::Comments);      connect(eComments, &DLS::Info::Comments);
# Line 2770  PropDialog::PropDialog() Line 2770  PropDialog::PropDialog()
2770      quitButton.set_can_default();      quitButton.set_can_default();
2771      quitButton.grab_focus();      quitButton.grab_focus();
2772      quitButton.signal_clicked().connect(      quitButton.signal_clicked().connect(
2773          sigc::mem_fun(*this, &PropDialog::hide));          sigc::mem_fun(*this, &FilePropDialog::hide));
2774    
2775      quitButton.show();      quitButton.show();
2776      vbox.show();      vbox.show();
# Line 2779  PropDialog::PropDialog() Line 2779  PropDialog::PropDialog()
2779  #endif  #endif
2780  }  }
2781    
2782  void PropDialog::set_file(gig::File* file)  void FilePropDialog::set_file(gig::File* file)
2783  {  {
2784      m_file = file;      m_file = file;
2785      update(file->pInfo);      update(file->pInfo);
# Line 2805  void PropDialog::set_file(gig::File* fil Line 2805  void PropDialog::set_file(gig::File* fil
2805      update_model--;      update_model--;
2806  }  }
2807    
2808  void PropDialog::set_FileFormat(int value)  void FilePropDialog::set_FileFormat(int value)
2809  {  {
2810      m_file->pVersion->major = value;      m_file->pVersion->major = value;
2811  }  }
# Line 2856  InstrumentProps::InstrumentProps() : Line 2856  InstrumentProps::InstrumentProps() :
2856      ePitchbendRange(_("Pitchbend range"), 0, 48),      ePitchbendRange(_("Pitchbend range"), 0, 48),
2857      ePianoReleaseMode(_("Piano release mode")),      ePianoReleaseMode(_("Piano release mode")),
2858      eDimensionKeyRangeLow(_("Keyswitching range low")),      eDimensionKeyRangeLow(_("Keyswitching range low")),
2859      eDimensionKeyRangeHigh(_("Keyswitching range high"))      eDimensionKeyRangeHigh(_("Keyswitching range high")),
2860        table2(2,1),
2861        eName2(_("Name")),
2862        eCreationDate(_("Creation date")),
2863        eComments(_("Comments")),
2864        eProduct(_("Product")),
2865        eCopyright(_("Copyright")),
2866        eArtists(_("Artists")),
2867        eGenre(_("Genre")),
2868        eKeywords(_("Keywords")),
2869        eEngineer(_("Engineer")),
2870        eTechnician(_("Technician")),
2871        eSoftware(_("Software")),
2872        eMedium(_("Medium")),
2873        eSource(_("Source")),
2874        eSourceForm(_("Source form")),
2875        eCommissioned(_("Commissioned")),
2876        eSubject(_("Subject"))
2877  {  {
2878      if (!Settings::singleton()->autoRestoreWindowDimension) {      if (!Settings::singleton()->autoRestoreWindowDimension) {
2879          //set_default_size(470, 390);          //set_default_size(470, 390);
# Line 2865  InstrumentProps::InstrumentProps() : Line 2882  InstrumentProps::InstrumentProps() :
2882    
2883      set_title(_("Instrument Properties"));      set_title(_("Instrument Properties"));
2884    
2885        tabs.append_page(vbox[1], _("Settings"));
2886        tabs.append_page(vbox[2], _("Info"));
2887    
2888      eDimensionKeyRangeLow.set_tip(      eDimensionKeyRangeLow.set_tip(
2889          _("start of the keyboard area which should switch the "          _("start of the keyboard area which should switch the "
2890            "\"keyswitching\" dimension")            "\"keyswitching\" dimension")
# Line 2889  InstrumentProps::InstrumentProps() : Line 2909  InstrumentProps::InstrumentProps() :
2909    
2910      eName.signal_value_changed().connect(sig_name_changed.make_slot());      eName.signal_value_changed().connect(sig_name_changed.make_slot());
2911    
2912        connect(eName2, &InstrumentProps::set_Name);
2913        connectLambda(eCreationDate, [this](gig::String s) {
2914            m->pInfo->CreationDate = s;
2915        });
2916        connectLambda(eComments, [this](gig::String s) {
2917            m->pInfo->Comments = s;
2918        });
2919        connectLambda(eProduct, [this](gig::String s) {
2920            m->pInfo->Product = s;
2921        });
2922        connectLambda(eCopyright, [this](gig::String s) {
2923            m->pInfo->Copyright = s;
2924        });
2925        connectLambda(eArtists, [this](gig::String s) {
2926            m->pInfo->Artists = s;
2927        });
2928        connectLambda(eGenre, [this](gig::String s) {
2929            m->pInfo->Genre = s;
2930        });
2931        connectLambda(eKeywords, [this](gig::String s) {
2932            m->pInfo->Keywords = s;
2933        });
2934        connectLambda(eEngineer, [this](gig::String s) {
2935            m->pInfo->Engineer = s;
2936        });
2937        connectLambda(eTechnician, [this](gig::String s) {
2938            m->pInfo->Technician = s;
2939        });
2940        connectLambda(eSoftware, [this](gig::String s) {
2941            m->pInfo->Software = s;
2942        });
2943        connectLambda(eMedium, [this](gig::String s) {
2944            m->pInfo->Medium = s;
2945        });
2946        connectLambda(eSource, [this](gig::String s) {
2947            m->pInfo->Source = s;
2948        });
2949        connectLambda(eSourceForm, [this](gig::String s) {
2950            m->pInfo->SourceForm = s;
2951        });
2952        connectLambda(eCommissioned, [this](gig::String s) {
2953            m->pInfo->Commissioned = s;
2954        });
2955        connectLambda(eSubject, [this](gig::String s) {
2956            m->pInfo->Subject = s;
2957        });
2958    
2959        // tab 1
2960  #if USE_GTKMM_GRID  #if USE_GTKMM_GRID
2961      table.set_column_spacing(5);      table.set_column_spacing(5);
2962  #else  #else
2963      table.set_col_spacings(5);      table.set_col_spacings(5);
2964  #endif  #endif
   
2965      table.add(eName);      table.add(eName);
2966      table.add(eIsDrum);      table.add(eIsDrum);
2967      table.add(eMIDIBank);      table.add(eMIDIBank);
# Line 2908  InstrumentProps::InstrumentProps() : Line 2975  InstrumentProps::InstrumentProps() :
2975      table.add(eDimensionKeyRangeLow);      table.add(eDimensionKeyRangeLow);
2976      table.add(eDimensionKeyRangeHigh);      table.add(eDimensionKeyRangeHigh);
2977    
2978      add(vbox);      // tab 2
2979    #if USE_GTKMM_GRID
2980        table2.set_column_spacing(5);
2981    #else
2982        table2.set_col_spacings(5);
2983    #endif
2984        table2.add(eName2);
2985        table2.add(eCreationDate);
2986        table2.add(eComments);
2987        table2.add(eProduct);
2988        table2.add(eCopyright);
2989        table2.add(eArtists);
2990        table2.add(eGenre);
2991        table2.add(eKeywords);
2992        table2.add(eEngineer);
2993        table2.add(eTechnician);
2994        table2.add(eSoftware);
2995        table2.add(eMedium);
2996        table2.add(eSource);
2997        table2.add(eSourceForm);
2998        table2.add(eCommissioned);
2999        table2.add(eSubject);
3000    
3001        add(vbox[0]);
3002  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24)  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24)
3003      table.set_margin(5);      table.set_margin(5);
3004  #else  #else
3005      table.set_border_width(5);      table.set_border_width(5);
3006  #endif  #endif
3007      vbox.pack_start(table);      vbox[1].pack_start(table);
3008        vbox[2].pack_start(table2);
3009      table.show();      table.show();
3010      vbox.pack_start(buttonBox, Gtk::PACK_SHRINK);      table2.show();
3011        vbox[0].pack_start(tabs);
3012        vbox[0].pack_start(buttonBox, Gtk::PACK_SHRINK);
3013      buttonBox.set_layout(Gtk::BUTTONBOX_END);      buttonBox.set_layout(Gtk::BUTTONBOX_END);
3014  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24)  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24)
3015      buttonBox.set_margin(5);      buttonBox.set_margin(5);
# Line 2932  InstrumentProps::InstrumentProps() : Line 3025  InstrumentProps::InstrumentProps() :
3025          sigc::mem_fun(*this, &InstrumentProps::hide));          sigc::mem_fun(*this, &InstrumentProps::hide));
3026    
3027      quitButton.show();      quitButton.show();
3028      vbox.show();      vbox[0].show();
3029  #if HAS_GTKMM_SHOW_ALL_CHILDREN  #if HAS_GTKMM_SHOW_ALL_CHILDREN
3030      show_all_children();      show_all_children();
3031  #endif  #endif
# Line 2943  void InstrumentProps::set_instrument(gig Line 3036  void InstrumentProps::set_instrument(gig
3036      update(instrument);      update(instrument);
3037    
3038      update_model++;      update_model++;
3039    
3040        // tab 1
3041      eName.set_value(instrument->pInfo->Name);      eName.set_value(instrument->pInfo->Name);
3042      eIsDrum.set_value(instrument->IsDrum);      eIsDrum.set_value(instrument->IsDrum);
3043      eMIDIBank.set_value(instrument->MIDIBank);      eMIDIBank.set_value(instrument->MIDIBank);
3044      eMIDIProgram.set_value(instrument->MIDIProgram);      eMIDIProgram.set_value(instrument->MIDIProgram);
3045        // tab 2
3046        eName2.set_value(instrument->pInfo->Name);
3047        eCreationDate.set_value(instrument->pInfo->CreationDate);
3048        eComments.set_value(instrument->pInfo->Comments);
3049        eProduct.set_value(instrument->pInfo->Product);
3050        eCopyright.set_value(instrument->pInfo->Copyright);
3051        eArtists.set_value(instrument->pInfo->Artists);
3052        eGenre.set_value(instrument->pInfo->Genre);
3053        eKeywords.set_value(instrument->pInfo->Keywords);
3054        eEngineer.set_value(instrument->pInfo->Engineer);
3055        eTechnician.set_value(instrument->pInfo->Technician);
3056        eSoftware.set_value(instrument->pInfo->Software);
3057        eMedium.set_value(instrument->pInfo->Medium);
3058        eSource.set_value(instrument->pInfo->Source);
3059        eSourceForm.set_value(instrument->pInfo->SourceForm);
3060        eCommissioned.set_value(instrument->pInfo->Commissioned);
3061        eSubject.set_value(instrument->pInfo->Subject);
3062    
3063      update_model--;      update_model--;
3064  }  }
3065    
# Line 3042  void MainWindow::load_gig(gig::File* gig Line 3155  void MainWindow::load_gig(gig::File* gig
3155      file_has_name = filename;      file_has_name = filename;
3156      file_is_changed = false;      file_is_changed = false;
3157    
3158      propDialog.set_file(gig);      fileProps.set_file(gig);
3159    
3160      instrument_name_connection.block();      instrument_name_connection.block();
3161      int index = 0;      int index = 0;

Legend:
Removed from v.3619  
changed lines
  Added in v.3636

  ViewVC Help
Powered by ViewVC