idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xnvolumecontroladapter.cpp
changeset 1 5315654608de
parent 0 f72a12da539e
child 2 08c6ee43b396
equal deleted inserted replaced
0:f72a12da539e 1:5315654608de
   212 // -----------------------------------------------------------------------------
   212 // -----------------------------------------------------------------------------
   213 //	
   213 //	
   214 void CXnVolumeControlAdapter::GetRangeL( TInt& aMinimumValue, TInt& aMaximumValue )
   214 void CXnVolumeControlAdapter::GetRangeL( TInt& aMinimumValue, TInt& aMaximumValue )
   215 	{
   215 	{
   216 	CXnProperty* minRange = iNode.GetPropertyL( XnPropertyNames::volumecontrol::KMinRange );
   216 	CXnProperty* minRange = iNode.GetPropertyL( XnPropertyNames::volumecontrol::KMinRange );
   217 	aMinimumValue = static_cast<TInt>( minRange->FloatValueL() );
   217 	if ( minRange )
       
   218 	    {
       
   219 	    aMinimumValue = static_cast<TInt>( minRange->FloatValueL() );
       
   220 	    }
       
   221 	else
       
   222 	    {
       
   223 	    aMinimumValue = 1;
       
   224 	    }
   218 	
   225 	
   219 	CXnProperty* maxRange = iNode.GetPropertyL( XnPropertyNames::volumecontrol::KMaxRange );
   226 	CXnProperty* maxRange = iNode.GetPropertyL( XnPropertyNames::volumecontrol::KMaxRange );
   220 	aMaximumValue = static_cast<TInt>( maxRange->FloatValueL() );
   227 	if ( maxRange )
       
   228 	    {
       
   229 	    aMaximumValue = static_cast<TInt>( maxRange->FloatValueL() );
       
   230 	    }
       
   231 	else
       
   232 	    {
       
   233 	    aMaximumValue = aMinimumValue;
       
   234 	    }
   221 	}
   235 	}
   222 
   236 
   223 // -----------------------------------------------------------------------------
   237 // -----------------------------------------------------------------------------
   224 // CXnVolumeControlAdapter::DoHandlePropertyChangeL
   238 // CXnVolumeControlAdapter::DoHandlePropertyChangeL
   225 // -----------------------------------------------------------------------------
   239 // -----------------------------------------------------------------------------
   515 // ----------------------------------------------------------------------------
   529 // ----------------------------------------------------------------------------
   516 //		
   530 //		
   517 TInt CXnVolumeControlAdapter::GetCurrentValueL()
   531 TInt CXnVolumeControlAdapter::GetCurrentValueL()
   518 	{
   532 	{
   519 	CXnProperty* valueProperty = iNode.GetPropertyL( XnPropertyNames::action::KValue );
   533 	CXnProperty* valueProperty = iNode.GetPropertyL( XnPropertyNames::action::KValue );
   520     return static_cast<TInt>( valueProperty->FloatValueL() );    
   534 	TInt retVal( 1 );
       
   535 	if ( valueProperty )
       
   536 	    {
       
   537 	    retVal = static_cast<TInt>( valueProperty->FloatValueL() );
       
   538 	    }
       
   539     return retVal;    
   521 	}
   540 	}
   522 	
   541 	
   523 // ----------------------------------------------------------------------------
   542 // ----------------------------------------------------------------------------
   524 // CXnVolumeControlAdapter::NotifyObserver
   543 // CXnVolumeControlAdapter::NotifyObserver
   525 // ----------------------------------------------------------------------------
   544 // ----------------------------------------------------------------------------