small tweak to allow control of continuous parameter range 0.0 to 1.0
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4564 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
eced90ea7a
commit
f2f96e6f06
@ -280,11 +280,11 @@ ContinuousMessageFilter::ContinuousMessageFilter(BControl *control, BContinuousP
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (BSlider *slider = dynamic_cast<BSlider *>(control)) {
|
if (BSlider *slider = dynamic_cast<BSlider *>(control)) {
|
||||||
slider->SetValue((int32)value[0]);
|
slider->SetValue((int32) (1000 * value[0]));
|
||||||
slider->SetModificationMessage(new BMessage(kMsgParameterChanged));
|
slider->SetModificationMessage(new BMessage(kMsgParameterChanged));
|
||||||
} else if (BChannelSlider *slider = dynamic_cast<BChannelSlider *>(control)) {
|
} else if (BChannelSlider *slider = dynamic_cast<BChannelSlider *>(control)) {
|
||||||
for (int32 i = 0; i < fParameter.CountChannels(); i++)
|
for (int32 i = 0; i < fParameter.CountChannels(); i++)
|
||||||
slider->SetValueFor(i, (int32)value[i]);
|
slider->SetValueFor(i, (int32) (1000 * value[i]));
|
||||||
|
|
||||||
slider->SetModificationMessage(new BMessage(kMsgParameterChanged));
|
slider->SetModificationMessage(new BMessage(kMsgParameterChanged));
|
||||||
} else
|
} else
|
||||||
@ -312,10 +312,10 @@ ContinuousMessageFilter::Filter(BMessage *message, BHandler **target)
|
|||||||
float value[fParameter.CountChannels()];
|
float value[fParameter.CountChannels()];
|
||||||
|
|
||||||
if (BSlider *slider = dynamic_cast<BSlider *>(control)) {
|
if (BSlider *slider = dynamic_cast<BSlider *>(control)) {
|
||||||
value[0] = (float)slider->Value();
|
value[0] = (float)(slider->Value() / 1000.0);
|
||||||
} else if (BChannelSlider *slider = dynamic_cast<BChannelSlider *>(control)) {
|
} else if (BChannelSlider *slider = dynamic_cast<BChannelSlider *>(control)) {
|
||||||
for (int32 i = 0; i < fParameter.CountChannels(); i++)
|
for (int32 i = 0; i < fParameter.CountChannels(); i++)
|
||||||
value[i] = (float)slider->ValueFor(i);
|
value[i] = (float)(slider->ValueFor(i) / 1000.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("update view %s, %ld channels\n", control->Name(), fParameter.CountChannels());
|
printf("update view %s, %ld channels\n", control->Name(), fParameter.CountChannels());
|
||||||
@ -742,7 +742,7 @@ DefaultMediaTheme::MakeViewFor(BParameter *parameter, const BRect *hintRect)
|
|||||||
// ToDo: take BContinuousParameter::GetResponse() & ValueStep() into account!
|
// ToDo: take BContinuousParameter::GetResponse() & ValueStep() into account!
|
||||||
|
|
||||||
for (int32 i = 0; i < continuous.CountChannels(); i++)
|
for (int32 i = 0; i < continuous.CountChannels(); i++)
|
||||||
slider->SetLimitsFor(i, continuous.MinValue(), continuous.MaxValue());
|
slider->SetLimitsFor(i, continuous.MinValue() * 1000, continuous.MaxValue() * 1000);
|
||||||
|
|
||||||
return slider;
|
return slider;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user