예제 #1
0
	void Chorus::Update(int index, int sign, DWORD modifiers)
	{
		switch (index)
		{
		case TITLE:
			fx_active[BASS_FX_DX8_CHORUS] = sign > 0;
			EnableEffect(BASS_FX_DX8_CHORUS, fx_active[BASS_FX_DX8_CHORUS]);
			break;
		case WET_DRY_MIX:
			UpdateProperty(fx_chorus.fWetDryMix, sign, modifiers, 10, time_step, 0, 100);
			break;
		case DEPTH:
			UpdateProperty(fx_chorus.fDepth, sign, modifiers, 10, time_step, 0, 100);
			break;
		case FEEDBACK:
			UpdateProperty(fx_chorus.fFeedback, sign, modifiers, 10, time_step, -99, 99);
			break;
		case FREQUENCY:
			UpdateProperty(fx_chorus.fFrequency, sign, modifiers, 100, time_step, 0, 10);
			break;
		case WAVEFORM:
			fx_chorus.lWaveform = !fx_chorus.lWaveform;
			break;
		case DELAY:
			UpdateProperty(fx_chorus.fDelay, sign, modifiers, 100, time_step, 0, 20);
			break;
		case PHASE:
			fx_chorus.lPhase = (fx_chorus.lPhase + 5 + sign) % 5;
			break;
		default:
			__assume(0);
		}
		UpdateEffect(BASS_FX_DX8_CHORUS);
	}
예제 #2
0
void Controller::GetUpdate()
{
	MMThreadGuard myLock(lock_);
	{
		string propName;

		Purge();
		Send("CSS?");
		do {
			ReceiveOneLine();
		} while (0 != buf_string_.compare(0, 3, "CSS", 0, 3));

		globalState_ = false;

		//Record intensities and first LED on
		for (unsigned int i = 0; i < 3; i++) {
			//Read the intensity
			channelIntensities_[i] = atol(buf_string_.substr(6 + i * 6, 3).c_str());
			string t = buf_string_.substr(4 + i * 6, 1);
			channelSelection_[i] = buf_string_.substr(4 + i * 6, 1) == "S" ? 1 : 0;
			propName = g_Keyword_Intensity;
			propName.push_back('A' + (char)i);
			intensityUpdated_[i] = true;;
			UpdateProperty(propName.c_str());

			propName = g_Keyword_Selection;
			propName.push_back('A' + (char)i);
			selectionUpdated_[i] = true;
			UpdateProperty(propName.c_str());

			globalState_ |= buf_string_.substr(5 + i * 6, 1) == "N";
			globalStateUpdated_ = true;
		}
	}
}
예제 #3
0
	void Echo::Update(int index, int sign, DWORD modifiers)
	{
		switch (index)
		{
		case TITLE:
			fx_active[BASS_FX_DX8_ECHO] = sign > 0;
			EnableEffect(BASS_FX_DX8_ECHO, fx_active[BASS_FX_DX8_ECHO]);
			break;
		case WET_DRY_MIX:
			UpdateProperty(fx_echo.fWetDryMix, sign, modifiers, 10, time_step, 0, 100);
			break;
		case FEEDBACK:
			UpdateProperty(fx_echo.fFeedback, sign, modifiers, 10, time_step, 0, 100);
			break;
		case LEFT_DELAY:
			UpdateProperty(fx_echo.fLeftDelay, sign, modifiers, 10, time_step, 1, 2000);
			break;
		case RIGHT_DELAY:
			UpdateProperty(fx_echo.fRightDelay, sign, modifiers, 10, time_step, 1, 2000);
			break;
		case PAN_DELAY:
			fx_echo.lPanDelay = !fx_echo.lPanDelay;
			break;
		default:
			__assume(0);
		}
		UpdateEffect(BASS_FX_DX8_ECHO);
	}
예제 #4
0
//--------------------------------------------------------------------------
//	功能:响应点击按钮
//--------------------------------------------------------------------------
void KUiNewPlayer2::OnClickButton(KWndWindow* pWnd)
{
    if (pWnd == (KWndWindow*)&m_OK)
        OnOk();
    else if (pWnd == (KWndWindow*)&m_Cancel)
        OnCancel();
    else if (pWnd == (KWndWindow*)&m_Gold)
    {
        m_Info.Attribute = series_metal;
        UpdateProperty();
    }
    else if (pWnd == (KWndWindow*)&m_Wood)
    {
        m_Info.Attribute = series_wood;
        UpdateProperty();
    }
    else if (pWnd == (KWndWindow*)&m_Water)
    {
        m_Info.Attribute = series_water;
        UpdateProperty();
    }
    else if (pWnd == (KWndWindow*)&m_Fire)
    {
        m_Info.Attribute = series_fire;
        UpdateProperty();
    }
    else if (pWnd == (KWndWindow*)&m_Earth)
    {
        m_Info.Attribute = series_earth;
        UpdateProperty();
    }
}
예제 #5
0
//----------------------------------------------------------------------------
void medPipeComputeWrapping::OnEvent(mafEventBase *maf_event)
//----------------------------------------------------------------------------
{
    if (mafEvent *e = mafEvent::SafeDownCast(maf_event))
    {
        mmaMeter *meter_attrib = m_WrappedMeterVME->GetMeterAttributes();
        switch(e->GetId())
        {
        case ID_SHOW_LABEL:
            UpdateProperty();
            break;
        case ID_COLOR_MODE:
            m_Gui->Enable(ID_DISTANCE_RANGE,meter_attrib->m_ColorMode == medVMEComputeWrapping::RANGE_COLOR);
            m_MaterialButton->Enable(meter_attrib->m_ColorMode == medVMEComputeWrapping::ONE_COLOR);
            UpdateProperty();
            break;
        case ID_METER_REPRESENTATION:
            m_Gui->Enable(ID_TUBE_RADIUS, meter_attrib->m_Representation == medVMEComputeWrapping::TUBE_REPRESENTATION);
            m_Gui->Enable(ID_TUBE_CAPPING, meter_attrib->m_Representation == medVMEComputeWrapping::TUBE_REPRESENTATION);
            UpdateProperty();
            break;
        case ID_TUBE_RADIUS:
            m_Tube->SetRadius(meter_attrib->m_TubeRadius);
            break;
        case ID_TUBE_CAPPING:
            m_Tube->SetCapping(meter_attrib->m_Capping);
            break;
        case ID_DISTANCE_RANGE:
            break;
        case ID_METER_MEASURE_TYPE:
        case ID_INIT_MEASURE:
        case ID_DELTA_PERCENT:
        case ID_GENERATE_EVENT:
            m_WrappedMeterVME->GetDataPipe()->Update();
            break;
        default:
            m_WrappedMeterVME->ForwardUpEvent(*e);
            break;
        }
        mafEventMacro(mafEvent(this,CAMERA_UPDATE));
    }
    else if (maf_event->GetSender() == m_WrappedMeterVME)
    {
        if(maf_event->GetId() == VME_OUTPUT_DATA_UPDATE)
        {
            UpdateProperty();
        }
        else if(maf_event->GetId() == medVMEComputeWrapping::LENGTH_THRESHOLD_EVENT)
        {
        }
    }
}
예제 #6
0
void ezQtTypeWidget::PropertyEventHandler(const ezDocumentObjectPropertyEvent& e)
{
  if (m_bUndead)
    return;

  UpdateProperty(e.m_pObject, e.m_sProperty);
}
예제 #7
0
void CNativeRibbonApp::UpdateCmdUI(BOOL bDisableIfNoHandler)
{
	for (auto it = m_commandIds.begin(); it != m_commandIds.end(); ++it)
	{
		CRibbonCmdUI ui(*it);
		ui.DoUpdate(m_pFrame, bDisableIfNoHandler);
		if (ui.m_bEnableChanged)
		{
			PROPVARIANT val = { 0 };
			UIInitPropertyFromBoolean(UI_PKEY_Enabled, ui.m_bOn, &val);
			m_pFramework->SetUICommandProperty(*it, UI_PKEY_Enabled, val);
		}

		if (ui.m_bCheckChanged)
		{
			PROPVARIANT val = { 0 };
			UIInitPropertyFromBoolean(UI_PKEY_BooleanValue, ui.m_nCheck, &val);
			m_pFramework->SetUICommandProperty(*it, UI_PKEY_BooleanValue, val);
		}
	}

	for (auto it = m_collectionCommandIds.begin(); it != m_collectionCommandIds.end(); ++it)
	{
		PROPVARIANT currentValue = { 0 };
		PROPVARIANT newValue = { 0 };

		UpdateProperty(*it, UI_PKEY_SelectedItem, &currentValue, &newValue);
		m_pFramework->SetUICommandProperty(*it, UI_PKEY_SelectedItem, newValue);
	}
}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CLogicNavigation::TurnOn()
{
	if ( m_isOn )
		return;
	m_isOn = true;
	gEntList.AddListenerEntity( this );
	UpdateProperty();
}
void CustomPropertyAutomator::SetCustomProperty( const CStdString& sName, const _variant_t& value )
{
    _variant_t vt = GetCustomProperty( sName );
    if( vt.vt == VT_EMPTY )
        AddProperty( sName, value );
    else
        UpdateProperty( sName, value );

}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CLogicNavigation::TurnOff()
{
	if ( !m_isOn )
		return;

	m_isOn = false;
	gEntList.RemoveListenerEntity( this );
	UpdateProperty();
}
예제 #11
0
XnStatus XnSensorFirmwareParams::UpdateAllProperties()
{
	XnStatus nRetVal = XN_STATUS_OK;

	xnLogVerbose(XN_MASK_DEVICE_SENSOR, "Reading all params from firmware...");

	for (XnFirmwareParamsHash::Iterator it = m_AllFirmwareParams.begin(); it != m_AllFirmwareParams.end(); ++it)
	{
		XnFirmwareParam& param = it.Value();
		nRetVal = UpdateProperty(&param);
		XN_IS_STATUS_OK(nRetVal);
	}

	xnLogVerbose(XN_MASK_DEVICE_SENSOR, "Firmware params were updated.");

	return (XN_STATUS_OK);
}
예제 #12
0
int CGigECamera::OnBinningV( MM::PropertyBase* pProp, MM::ActionType eAct )
{
	int ret = DEVICE_OK;
	switch(eAct)
	{
	case MM::AfterSet:
		{
			if(IsCapturing())
				return DEVICE_CAMERA_BUSY_ACQUIRING;

			long binFactor;
			pProp->Get( binFactor );
			int64_t oldBin, oldh;
			nodes->get( oldBin, BINNING_VERTICAL );
			nodes->get( oldh, HEIGHT );
			if( binFactor != (long) oldBin )
			{
				bool retval = nodes->set( binFactor, BINNING_VERTICAL ); 
				if( retval == false )
				{
					// set it back
					nodes->set( oldBin, BINNING_VERTICAL );
					pProp->Set( (long) oldBin );
					ret = DEVICE_INVALID_PROPERTY_VALUE;
				}
				else
				{
					// new limits
					int64_t high, low;
					high = nodes->getMax( HEIGHT );
					low = nodes->getMin( HEIGHT );
					SetPropertyLimits( MM::g_Keyword_Image_Height, (double) low, (double) high );

					// new height
					int64_t dim;
					nodes->get( dim, HEIGHT );
					if( dim == oldh ) // this camera doesn't auto-adjust its height w/ binning change
					{
						dim = dim * oldBin / binFactor;
					}
					SetProperty( MM::g_Keyword_Image_Height, CDeviceUtils::ConvertToString( (long) dim ) );
					UpdateProperty( MM::g_Keyword_Image_Height );
					LogMessage( (std::string) "setting v bin to " + boost::lexical_cast<std::string>( binFactor ) 
								+ " and height to " + boost::lexical_cast<std::string>( dim ) 
								+ " (oldBin:  " + boost::lexical_cast<std::string>( oldBin ) + ")  " 
								+ " new limits (" + boost::lexical_cast<std::string>( low ) + 
								+ " " + boost::lexical_cast<std::string>( high ) + ")", true );

					if( nodes->isAvailable( HEIGHT_MAX ) )
					{
						UpdateProperty( MM::g_Keyword_Image_Height_Max );
					}
					OnPropertiesChanged();
					ret = DEVICE_OK;
				}
				ResizeImageBuffer();
			}
		}
		break;
	case MM::BeforeGet:
		{
			int64_t vBin;
			nodes->get( vBin, BINNING_VERTICAL );
			pProp->Set( (long) vBin );
			ret=DEVICE_OK;
		}
		break;
	}
	return ret; 
} // OnBinningV
예제 #13
0
int CGigECamera::OnBinningH( MM::PropertyBase* pProp, MM::ActionType eAct )
{
	int ret = DEVICE_OK;

	switch(eAct)
	{
	case MM::AfterSet:
		{
			if(IsCapturing())
				return DEVICE_CAMERA_BUSY_ACQUIRING;

			long binFactor;
			pProp->Get( binFactor );
			int64_t oldBin, oldw;
			nodes->get( oldBin, BINNING_HORIZONTAL );
			nodes->get( oldw, WIDTH );
			if( binFactor != (long) oldBin )
			{
				bool retval = nodes->set( (int64_t) binFactor, BINNING_HORIZONTAL );
				if( retval == false )
				{
					// set it back
					nodes->set( oldBin, BINNING_HORIZONTAL );
					pProp->Set( (long) oldBin );
					ret = DEVICE_INVALID_PROPERTY_VALUE;
				}
				else
				{
					int64_t dim;
					nodes->get( dim, WIDTH );
					if( dim == oldw )
					{
						dim = dim * oldBin / binFactor;
					}
					SetProperty( MM::g_Keyword_Image_Width, CDeviceUtils::ConvertToString( (long) dim ) );
					int64_t high, low;
					high = nodes->getMax( WIDTH );
					low = nodes->getMin( WIDTH );
					SetPropertyLimits( MM::g_Keyword_Image_Width, (double) low, (double) high );
					UpdateProperty( MM::g_Keyword_Image_Width );
					LogMessage( (std::string) "setting h bin to " + boost::lexical_cast<std::string>( binFactor ) 
								+ " and width to " + boost::lexical_cast<std::string>( dim ) 
								+ " (oldBin:  " + boost::lexical_cast<std::string>( oldBin ) + ")  " 
								+ " new limits (" + boost::lexical_cast<std::string>( low ) + 
								+ " " + boost::lexical_cast<std::string>( high ) + ")", true );
					if( nodes->isAvailable( WIDTH_MAX ) )
					{
						UpdateProperty( MM::g_Keyword_Image_Width_Max );
					}
					OnPropertiesChanged();
					ret = DEVICE_OK;
				}
				ResizeImageBuffer();
			}
		}
		break;
	case MM::BeforeGet:
		{
			int64_t hBin;
			nodes->get( hBin, BINNING_HORIZONTAL );
			pProp->Set( (long) hBin );
			ret=DEVICE_OK;
		}
		break;
	}
	return ret; 
} // OnBinningH