예제 #1
0
파일: Slider.cpp 프로젝트: Felard/MoSync
bool Slider::pointerPressed(MAPoint2d p, int id) {
	int sliderPos = getSliderPos();

	if(mMoveToPoint || !mGripImage) {
		double newValue;
		if(mOrientation == HORIZONTAL) {
			newValue = 
				mMinValue
				+ (((double)(p.x-(mPaddedBounds.x+(mSliderGripWidth>>1))))
					* (mMaxValue-mMinValue)) 
				/ (double)(mPaddedBounds.width-mSliderGripWidth);
		}
예제 #2
0
void PanelPreviewSound::update() {
	uint64 t = SoundMan.getChannelDurationPlayed(_sound);

	Common::UString played  = formatTime(t);
	Common::UString total   = formatTime(_duration);
	Common::UString percent = formatPercent(_duration, t);

	_textPosition->SetLabelMarkup(Common::UString::format("<tt>%s</tt>", played.c_str()));
	_textPercent->SetLabelMarkup(Common::UString::format("<tt>%s</tt>", percent.c_str()));
	_textDuration->SetLabelMarkup(Common::UString::format("<tt>%s</tt>", total.c_str()));

	_sliderPosition->SetValue(getSliderPos(_duration, t));

	bool isPlaying = SoundMan.isPlaying(_sound);
	bool isPaused  = SoundMan.isPaused(_sound);

	setButtons(!isPlaying || isPaused, isPlaying && !isPaused, isPlaying);
}
예제 #3
0
/**
* FUNCTION CalculateExposureAndFlash
*
* @brief Calculates the Exposure and flash based on Slider Position.
*
* @version 1.0 
*
* @author David Libby
* @date 9/29/2015 1:35:50 PM
*
* @param exposurePos 
* @param flashPos 
*/
void AutoCamera::CalculateExposureAndFlash(int &exposurePos, int &flashPos)
{
	int scrollPos=getSliderPos();

	int whole=scrollPos/m_flashASize;
	int remainder=scrollPos%m_flashASize;

	exposurePos= whole + 0;

	//if(remainder>0)
	//	 exposurePos =  remainder + 1;


	if(whole==0)
		exposurePos=0;

	if(exposurePos>(int)m_CameraSpeedMap_uS.size()-1)
		exposurePos=m_CameraSpeedMap_uS.size()-1;

	flashPos= remainder+m_CtxFlashA.min;
}