~ubuntu-branches/ubuntu/edgy/muse/edgy

« back to all changes in this revision

Viewing changes to synti/organ/organgui.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2006-01-03 20:18:47 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060103201847-r9poqt6y5gu9hnji
Tags: 0.7.1+0.7.2pre5-1
* New upstream version.
* Updated patches:
  + [20_allow_system_timer]
    Rediffed for 0.7.2pre5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//=========================================================
2
2
//  MusE
3
3
//  Linux Music Editor
4
 
//  $Id: organgui.cpp,v 1.16 2004/02/14 14:00:41 wschweer Exp $
 
4
//  $Id: organgui.cpp,v 1.16.2.1 2005/12/29 23:33:50 spamatica Exp $
5
5
//
6
6
//    This is a simple GUI implemented with QT for
7
7
//    organ software synthesizer.
86
86
      }
87
87
 
88
88
//---------------------------------------------------------
 
89
//   getControllerInfo
 
90
//    return min max values for controllers
 
91
//---------------------------------------------------------
 
92
int OrganGui::getControllerMinMax(int id, int* min, int* max) const
 
93
      {
 
94
      if (id >= NUM_GUI_CONTROLLER)
 
95
            return 0;
 
96
 
 
97
      const SynthGuiCtrl* ctrl = (const SynthGuiCtrl*)&dctrl[id];
 
98
      //int val = 0;
 
99
      if (ctrl->type == SynthGuiCtrl::SLIDER) {
 
100
            QSlider* slider = (QSlider*)(ctrl->editor);
 
101
            *max = slider->maxValue();
 
102
            *min = slider->minValue();
 
103
            //val = (slider->value() * 16383 + max/2) / max;
 
104
            
 
105
            //val = 16383 + 1/2 
 
106
            }
 
107
      else if (ctrl->type == SynthGuiCtrl::SWITCH) {
 
108
            //val = ((QCheckBox*)(ctrl->editor))->isOn();
 
109
            *min=0;
 
110
            *max=1;
 
111
            }
 
112
      return ++id;
 
113
      }
 
114
 
 
115
//---------------------------------------------------------
89
116
//   setParam
90
117
//    set param in gui
91
118
//---------------------------------------------------------
101
128
      ctrl->editor->blockSignals(true);
102
129
      if (ctrl->type == SynthGuiCtrl::SLIDER) {
103
130
            QSlider* slider = (QSlider*)(ctrl->editor);
 
131
//             int max = slider->maxValue();
 
132
//             if(val < 0) val = (val * max + 8191) / 16383 - 1;
 
133
//             else val = (val * max + 8191) / 16383;
104
134
            slider->setValue(val);
105
135
            if (ctrl->label)
106
136
                  ((QSpinBox*)(ctrl->label))->setValue(val);