void	AUControlGroup::CreateLabelledSlider(
										AUCarbonViewBase *			auView,
										const CAAUParameter &		auvp,
										const Rect &				area,
										Point 						labelSize,
										const ControlFontStyleRec &	inFontStyle)
{
#if !__LP64__
	ControlFontStyleRec fontStyle = inFontStyle;
	Rect minValRect, maxValRect, sliderRect;
	ControlRef newControl;
	int width = area.right - area.left, height = area.bottom - area.top;
	CFStringRef cfstr;
	int sliderValueMax, sliderValueMin, sliderValueDefault;
	AUCarbonViewControl::ControlType sliderType;

	bool horizontal = (width > height);

	if (horizontal) {
		maxValRect.top = minValRect.top = area.top + (height - labelSize.v) / 2;
		minValRect.left = area.left;
		maxValRect.left = area.right - labelSize.h;

		minValRect.bottom = minValRect.top + labelSize.v;
		minValRect.right = minValRect.left + labelSize.h;
		maxValRect.bottom = maxValRect.top + labelSize.v;
		maxValRect.right = maxValRect.left + labelSize.h;

		sliderRect.left = minValRect.right + kLabelAndSliderSpacing;
		sliderRect.right = maxValRect.left - kLabelAndSliderSpacing;
		sliderRect.top = area.top + (height - kSliderThinDimension) / 2;
		sliderRect.bottom = sliderRect.top + kSliderThinDimension + 4;

		if (auvp.IsIndexedParam ()) {
			sliderValueMin = sliderValueDefault = int(auvp.ParamInfo().minValue);
			sliderValueMax = int(auvp.ParamInfo().maxValue);
			sliderType = AUCarbonViewControl::kTypeDiscrete;
		} else {
			sliderValueMin = sliderValueDefault = 0;
			sliderValueMax = sliderRect.right - sliderRect.left;
			sliderType = AUCarbonViewControl::kTypeContinuous;
		}
	} else {
		maxValRect.left = minValRect.left = area.left + (width - labelSize.h) / 2;
		maxValRect.top = area.top;
		minValRect.top = area.bottom - labelSize.v;

		minValRect.bottom = minValRect.top + labelSize.v;
		minValRect.right = minValRect.left + labelSize.h;
		maxValRect.bottom = maxValRect.top + labelSize.v;
		maxValRect.right = maxValRect.left + labelSize.h;

		sliderRect.left = area.left + (width - kSliderThinDimension) / 2;
		sliderRect.right = sliderRect.left + kSliderThinDimension + 4;
		sliderRect.top = maxValRect.bottom + kLabelAndSliderSpacing;
		sliderRect.bottom = minValRect.top - kLabelAndSliderSpacing;

		if (auvp.IsIndexedParam ()) {
			sliderValueMin = sliderValueDefault = int(auvp.ParamInfo().minValue);
			sliderValueMax = int(auvp.ParamInfo().maxValue);
			sliderType = AUCarbonViewControl::kTypeDiscrete;
		} else {
			sliderValueMin = sliderValueDefault = 0;
			sliderValueMax = sliderRect.bottom - sliderRect.top;
			sliderType = AUCarbonViewControl::kTypeContinuous;
		}
	}

	// minimum value label
	if (labelSize.v > 0 && labelSize.h > 0) {
		// check to see if the minimum value has a label
		cfstr = auvp.GetStringFromValueCopy(&auvp.ParamInfo().minValue);
		fontStyle.just = horizontal ? teFlushRight : teCenter;
		verify_noerr(CreateStaticTextControl(auView->GetCarbonWindow(), &minValRect, cfstr, &fontStyle, &newControl));
		CFRelease(cfstr);
		verify_noerr(auView->EmbedControl(newControl));

		// maximum value label
		cfstr = auvp.GetStringFromValueCopy(&auvp.ParamInfo().maxValue);
		fontStyle.just = horizontal ? teFlushLeft : teCenter;
		verify_noerr(CreateStaticTextControl(auView->GetCarbonWindow(), &maxValRect, cfstr, &fontStyle, &newControl));
		CFRelease(cfstr);
		verify_noerr(auView->EmbedControl(newControl));
	}

	// slider
	verify_noerr(CreateSliderControl(auView->GetCarbonWindow(), &sliderRect, sliderValueDefault, sliderValueMin, sliderValueMax, kControlSliderDoesNotPoint, 0, true, AUCarbonViewControl::SliderTrackProc, &newControl));


	ControlSize small = kControlSizeSmall;
	SetControlData(newControl, kControlEntireControl, kControlSizeTag, sizeof(ControlSize), &small);
	auView->AddCarbonControl(sliderType, auvp, newControl);
#endif
}