void CMVSVolumeDialog::InitControl( const TInt aId, const TInt aRamp, const TInt aStart, const TInt aFinish )
	{
	CEikNumberEditor* control = static_cast<CEikNumberEditor*> ( Control(aId) );        
	if(control)
		{
		control->SetNumber(aRamp);
		control->SetMinimumAndMaximum( aStart, aFinish );
		}
	
	}
void CSettingsDialog::PreLayoutDynInitL()
	{
	// Populate dialog with initial settings
	CEikEdwin* name=(CEikEdwin*)Control(EServerName);
	name->SetTextL(&iConnectSettings.iAddress);
	CEikEdwin* page=(CEikEdwin*)Control(EPage);
	TBuf<KSettingFieldWidth> temp;
	temp.Copy(iConnectSettings.iPage);
	page->SetTextL(&temp);
	CEikNumberEditor* port = (CEikNumberEditor*)Control(EPort);
	port->SetNumber(iConnectSettings.iPortNum);
	}
void CMVSMultipleScreenDialog::PreLayoutDynInitL()
    {
    // Get a downcasted pointer to the controls
    CEikNumberEditor* myScreenControl = static_cast<CEikNumberEditor*>(Control(EMVSCmdMultiScreen));
	
    //Now seed the controls with appropriate values
    if(myScreenControl)
    	{
    	myScreenControl->SetNumber(iScreenNumber);
    	myScreenControl->SetMinimumAndMaximum(0, ControlEnv()->WsSession().NumberOfScreens() - 1);
    	}
    }
TBool CRecordFormatOptionsDialog::OkToExitL(TInt /*aKeycode*/)
	{
	// get bit rate, sample, channel, codec settings
	CFormatOptionsDialog::OkToExitL(0);
	// get gain and balance, which are recording specific parameters
    CEikNumberEditor* gain = static_cast<CEikNumberEditor*>(Control(EGain));
	iRecordFormatOptions.iGain = gain->Number();
    CEikNumberEditor* balance = static_cast<CEikNumberEditor*>(Control(EBalance));
	iRecordFormatOptions.iBalance = balance->Number();
	iRecordFormatOptions.iGainSet = iRecordFormatOptions.iBalanceSet = ETrue;

	return ETrue;
	}
TBool CSettingsDialog::OkToExitL(TInt /*aButtonId*/)
	{
	// Store dialog input
	CEikEdwin* name=(CEikEdwin*)Control(EServerName);
	name->GetText(iConnectSettings.iAddress);
	CEikEdwin* page=(CEikEdwin*)Control(EPage);
	TBuf<KSettingFieldWidth> temp;
	page->GetText(temp);
	iConnectSettings.iPage.Copy(temp);
	CEikNumberEditor* port = (CEikNumberEditor*)Control(EPort);
	iConnectSettings.iPortNum = port->Number();

	return ETrue;
	}
TBool CMVSCropDialog::OkToExitL(TInt aButtonId)
	{
    //Get a pointer to the Option Button List control
    CEikHorOptionButtonList* button = static_cast<CEikHorOptionButtonList*>(Control(EMVSCmdCropLeftRight));
	//Get a pointer to the number editor
    CEikNumberEditor* control = static_cast<CEikNumberEditor*> ( Control(EMVSCmdCropPositionNumber) );
	TInt position = control->Number()*KMicroSecs;
    TInt64 pos64(position);
    iPosition = TTimeIntervalMicroSeconds(pos64);
    if(iPosition > iClipLength)
    	{
     	iPosition = iClipLength;
     	}
	if(iPosition < iCropStart)
	 	{
	 	iPosition = iCropStart; 
	 	}
    TInt buttonId = button->LabeledButtonId();
	switch (aButtonId)
    	{
        case(EMVSButtonUpdate):
        	//update prog info based on num-editor
        	if(buttonId == EMVSHorOptButtonCropFromBeginning) //'From Beginning' selected
            	{
               	iCropFromBeginning = ETrue;
               	iCropStart = iPosition;
               	}
          	else
            	{
               	iCropFromBeginning = EFalse;
               	iCropStart = iPosition;
               	}
            iAppUi->SetCropL(iCropStart, iCropFromBeginning);
            break;

        case(EMVSButtonCancel):
            break;

        default:
 		    break;
        }
    return ETrue;    
    }
// ----------------------------------------------------------------------------
// CCreateSpeakerSinkDialog::PreLayoutDynInitL()
// .
// ----------------------------------------------------------------------------
//
void CCreateSpeakerSinkDialog::PreLayoutDynInitL()
    {
    CAknForm::PreLayoutDynInitL();
    
    const RPointerArray<CMCETestUIEngineSink>& sinks = 
            iStream.SinksL();
   	CMceMediaSink& mediaSink = static_cast<CMceMediaSink&>(sinks[iSinkIndex]->Sink());
    	CMceSpeakerSink& speakerSink = static_cast<CMceSpeakerSink&>(mediaSink);
    	
    CEikNumberEditor* volume = static_cast<CEikNumberEditor*>(
                                  Control( ESpeakerSinkVolumeSetting ) );
    volume->SetNumber(speakerSink.VolumeL());   
 //   volume->SetNumber(50);   
 
 	CEikNumberEditor* routing = static_cast<CEikNumberEditor*>(
                                  Control( ESpeakerSinkRoutingSetting ) );
    routing->SetNumber(speakerSink.RoutingL());   
    
    
    }
TBool CMVSVolumeDialog::OkToExitL(TInt aButtonId)
	{
    // Get a pointer to the progress bar control.
    // Downcast the returned CCoeControl* pointer to the correct type.
    CCoeControl* myControlPtr = this->Control(EMVSCmdSetVolume);
    iProgInfo = static_cast<CEikProgressInfo*>(myControlPtr);
    CEikNumberEditor* control = static_cast<CEikNumberEditor*>(Control(EMVSCmdSetVolumeRamp));
    switch(aButtonId)
    	{
    	case (EMVSButtonCancel):
    		iAppUi->SetVolumeL(iOldVolume, iRamp);
         	return ETrue;
         	
        case(EMVSButtonDown):
        	if(iProgInfo)
	        	{
	        	iProgInfo->IncrementAndDraw(-5);
	        	iVolume = iProgInfo->CurrentValue();
	          	iRamp = control->Number()*1000;
	        	iAppUi->SetVolumeL(iVolume, iRamp);
	        	}
        	break;

        case(EMVSButtonUp):
            if(iProgInfo)
	            {
	            iProgInfo->IncrementAndDraw(5);
	        	iVolume = iProgInfo->CurrentValue();
	          	iRamp = control->Number()*1000;
	            iAppUi->SetVolumeL(iVolume, iRamp);
	            }
           	break;

        case(EMVSButtonOk):
        default:
        	return ETrue;
        }
     
    return EFalse;
    }
TBool CCreateSpeakerSinkDialog::OkToExitL( TInt aKey )
    {
    if ( aKey == EEikCmdCanceled )
        {
        // Cancel pressed. Just exit.
        return ETrue;
        }
    const RPointerArray<CMCETestUIEngineSink>& sinks = 
            iStream.SinksL();
            
   	CMceMediaSink& mediaSink = static_cast<CMceMediaSink&>(sinks[iSinkIndex]->Sink());
    CMceSpeakerSink& speakerSink = static_cast<CMceSpeakerSink&>(mediaSink);
    	
    CEikNumberEditor* volume = static_cast<CEikNumberEditor*>(
                              Control( ESpeakerSinkVolumeSetting ) );
    speakerSink.SetVolumeL( volume->Number() );  
        
    CEikNumberEditor* routing = static_cast<CEikNumberEditor*>(
                              Control( ESpeakerSinkRoutingSetting ) );
    speakerSink.SetRoutingL( routing->Number() );  
    return ETrue;
    }
TBool CSendDTMFDialog::OkToExitL( TInt aKey )
    {
    if ( aKey == EEikCmdCanceled )
        {
        // Cancel pressed. Just exit.
        return ETrue;
        }
    TBuf<1> buffer;
    
	CEikEdwin* dtmf_char = static_cast<CEikEdwin*>(
                             Control( ESendDtmfTone ) );
	dtmf_char->GetText( buffer );
	
	iChar = buffer[0];
   	
   	CEikNumberEditor* interval = static_cast<CEikNumberEditor*>(
                                  Control( ESendDtmfTone_duration ) );
	iInterval = interval->Number();
	    
	           	  
    return ETrue;
    }
void CRecordFormatOptionsDialog::PreLayoutDynInitL()
	{
	// set up bit rate, sample, channel, codec lists
	CFormatOptionsDialog::PreLayoutDynInitL();
	// add gain and balance, which are recording specific parameters
    CEikNumberEditor* gain = static_cast<CEikNumberEditor*>(Control(EGain));
	gain->SetMinimumAndMaximum(0,iMaxGain);
	gain->SetNumber(iMaxGain/2);
    CEikNumberEditor* balance = static_cast<CEikNumberEditor*>(Control(EBalance));
	balance->SetMinimumAndMaximum(KMMFBalanceMaxLeft,KMMFBalanceMaxRight);
	balance->SetNumber(KMMFBalanceCenter);
	}
void CMVSCropDialog::InitControl( const TInt aId, const TInt aPos, const TInt aStart, const TInt aFinish )
	{
	CEikNumberEditor* control = static_cast<CEikNumberEditor*> ( Control(aId) );        
	control->SetNumber(aPos);
	control->SetMinimumAndMaximum( aStart, aFinish );
	}