/[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 1436 by schoenebeck, Mon Oct 15 15:29:58 2007 UTC revision 1460 by persson, Sat Oct 27 12:28:33 2007 UTC
# Line 858  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 871  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 881  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 898  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 918  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 945  InstrumentProps::InstrumentProps() Line 983  InstrumentProps::InstrumentProps()
983    
984  void InstrumentProps::set_instrument(gig::Instrument* instrument)  void InstrumentProps::set_instrument(gig::Instrument* instrument)
985  {  {
986        this->instrument = instrument;
987    
988        update_model++;
989      eName.set_ptr(&instrument->pInfo->Name);      eName.set_ptr(&instrument->pInfo->Name);
990      eIsDrum.set_ptr(&instrument->IsDrum);      eIsDrum.set_value(instrument->IsDrum);
991      eMIDIBank.set_ptr(&instrument->MIDIBank);      eMIDIBank.set_value(instrument->MIDIBank);
992      eMIDIProgram.set_ptr(&instrument->MIDIProgram);      eMIDIProgram.set_value(instrument->MIDIProgram);
993      eAttenuation.set_ptr(&instrument->Attenuation);      eAttenuation.set_value(instrument->Attenuation);
994      eGainPlus6.set_ptr(&instrument->Attenuation);      eGainPlus6.set_value(instrument->Attenuation);
995      eEffectSend.set_ptr(&instrument->EffectSend);      eEffectSend.set_value(instrument->EffectSend);
996      eFineTune.set_ptr(&instrument->FineTune);      eFineTune.set_value(instrument->FineTune);
997      ePitchbendRange.set_ptr(&instrument->PitchbendRange);      ePitchbendRange.set_value(instrument->PitchbendRange);
998      ePianoReleaseMode.set_ptr(&instrument->PianoReleaseMode);      ePianoReleaseMode.set_value(instrument->PianoReleaseMode);
999      eDimensionKeyRangeLow.set_ptr(0);      eDimensionKeyRangeLow.set_value(instrument->DimensionKeyRange.low);
1000      eDimensionKeyRangeHigh.set_ptr(0);      eDimensionKeyRangeHigh.set_value(instrument->DimensionKeyRange.high);
1001      eDimensionKeyRangeLow.set_ptr(&instrument->DimensionKeyRange.low);      update_model--;
     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);  
 }  
   
 void InstrumentProps::key_range_high_changed()  
 {  
     double l = eDimensionKeyRangeLow.get_value();  
     double h = eDimensionKeyRangeHigh.get_value();  
     if (h < l) eDimensionKeyRangeLow.set_value(h);  
1002  }  }
1003    
1004  sigc::signal<void>& InstrumentProps::signal_instrument_changed()  sigc::signal<void>& InstrumentProps::signal_instrument_changed()
# Line 1506  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

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

  ViewVC Help
Powered by ViewVC