Exemplo n.º 1
0
void StopMovie(void) {

    if(Movie.Status == Recording && RecordingFileOpened) {
        WriteHeader(Movie.fp);
        fclose(Movie.fp);
        RecordingFileOpened=0;
        Movie.Status = Stopped;
        ClearInput();
        strcpy(MovieStatus, "Recording Stopped");
    }

    if(Movie.Status == Playback && PlaybackFileOpened && Movie.ReadOnly != 0) {
        fclose(Movie.fp);
        PlaybackFileOpened=0;
        Movie.Status = Stopped;
        ClearInput();
        strcpy(MovieStatus, "Playback Stopped");
    }
}
Exemplo n.º 2
0
media_input *
VideoMixerNode::CreateInput(uint32 inputID) {
	media_input *input = new media_input();

	ClearInput(input);

	// don't overwrite available space, and be sure to terminate
	sprintf(input->name, "VideoMixer Input %ld", inputID);
	
	return input;
}
Exemplo n.º 3
0
void DoMovie(void) {

	int x;
	if (Movie.Status == 0)
		return;

	IncrementLagAndFrameCounter();
	LagFrameFlag=1;
	SetInputDisplayCharacters();

	//Read/Write Controller Data
	if(Movie.Status == Recording) {
		for (x = 0; x < 8; x++) {
			fwrite(&PORTDATA1.data[x], 1, 1, Movie.fp);
		}
		for (x = 0; x < 8; x++) {
			fwrite(&PORTDATA2.data[x], 1, 1, Movie.fp);
		}
	}

	if(Movie.Status == Playback) {
		for (x = 0; x < 8; x++) {
			fread(&PORTDATA1.data[x], 1, 1, Movie.fp);
		}
		for (x = 0; x < 8; x++) {
			fread(&PORTDATA2.data[x], 1, 1, Movie.fp);
		}

		//if we get to the end of the movie
		if(((ftell(Movie.fp)-headersize)/framelength) >= Movie.Frames) {
			fclose(Movie.fp);
			PlaybackFileOpened=0;
			Movie.Status = Stopped;
			ClearInput();
			strcpy(MovieStatus, "Playback Stopped");
		}
	}

	//Stop Recording/Playback
	if(Movie.Status != Recording && RecordingFileOpened) {
		fclose(Movie.fp);
		RecordingFileOpened=0;
		Movie.Status = Stopped;
		strcpy(MovieStatus, "Recording Stopped");
	}

	if(Movie.Status != Playback && PlaybackFileOpened && Movie.ReadOnly != 0) {
		fclose(Movie.fp);
		PlaybackFileOpened=0;
		Movie.Status = Stopped;
		strcpy(MovieStatus, "Playback Stopped");
	}
}
void CCommandLineDisplay::InputEnter (void)

//	InputEnter
//
//	Invoke input

	{
	AppendHistory(m_sInput);
	Output(m_sInput, INPUT_COLOR);
	ClearInput();
	ClearHint();
	}
//------------------------------------------------------------------------------------
// Creates and initializes the main window for application
//------------------------------------------------------------------------------------
Window::Window(QWidget *parent):QDialog(parent)
{
    //We create an instance of GLWidget component we built in glwidget.h
	m_glWidget = new GLWidget;
	
	//Setup application interface. Creates all the required components and sliders.
	setupUi(this);

    //We need to attach our m_glWidget to glWidgetArea
    //All our drawings will be on glWidgetArea
    glWidgetArea->setWidget(m_glWidget);

    stack_size = 0;


    //Setting up all the SIGNALS and SLOTS
    doubleSpinBox->setRange(-1000,1000);
    doubleSpinBox_2->setRange(-1000,1000);
    doubleSpinBox_3->setRange(-1000,1000);
    doubleSpinBox_4->setRange(-1000,1000);
    doubleSpinBox_5->setRange(-1000,1000);
    doubleSpinBox_6->setRange(-1000,1000);
    doubleSpinBox_7->setRange(-1000,1000);
    doubleSpinBox_8->setRange(-1000,1000);
    doubleSpinBox_9->setRange(-1000,1000);


    connect(clearButton, SIGNAL(clicked()), m_glWidget, SLOT(ClearInput()));
    connect(doubleSpinBox, SIGNAL(valueChanged(double)), m_glWidget, SLOT(setM11(double)));
    connect(doubleSpinBox_2, SIGNAL(valueChanged(double)), m_glWidget, SLOT(setM12(double)));
    connect(doubleSpinBox_3, SIGNAL(valueChanged(double)), m_glWidget, SLOT(setM13(double)));
    connect(doubleSpinBox_4, SIGNAL(valueChanged(double)), m_glWidget, SLOT(setM21(double)));
    connect(doubleSpinBox_5, SIGNAL(valueChanged(double)), m_glWidget, SLOT(setM22(double)));
    connect(doubleSpinBox_6, SIGNAL(valueChanged(double)), m_glWidget, SLOT(setM23(double)));
    connect(doubleSpinBox_7, SIGNAL(valueChanged(double)), m_glWidget, SLOT(setM31(double)));
    connect(doubleSpinBox_8, SIGNAL(valueChanged(double)), m_glWidget, SLOT(setM32(double)));
    connect(doubleSpinBox_9, SIGNAL(valueChanged(double)), m_glWidget, SLOT(setM33(double)));
    connect(btnTransform,SIGNAL(clicked()), m_glWidget, SLOT(transformMatrix()));
    connect(store, SIGNAL(clicked()), this, SLOT(on_store()));
    connect(push, SIGNAL(clicked()), this, SLOT(on_push()));
    connect(pop, SIGNAL(clicked()), this, SLOT(on_pop()));
    connect(apply, SIGNAL(clicked()), this, SLOT(on_stack()));

}
void CCommandLineDisplay::InputHistoryDown (void)

//	InputHistoryDown
//
//	Recalls a line from the history buffer

	{
	if (m_iHistoryIndex > 0)
		{
		m_iHistoryIndex--;
		m_sInput = GetHistory(m_iHistoryIndex);
		m_iCursorPos = m_sInput.GetLength();
		m_bInvalid = true;
		}
	else
		{
		m_iHistoryIndex = -1;
		ClearInput();
		}
	}
Exemplo n.º 7
0
Arquivo: codec.c Projeto: Jsoucek/q3ce
static void Delete(codec* p)
{
	ClearInput(p);
	if (p->UpdateInput)
		p->UpdateInput(p);
}
Exemplo n.º 8
0
void ICPClass::HandleInput(int mode, CPButtonObject *pbutton) 
{
	AircraftClass *playerAC = SimDriver.GetPlayerAircraft();

	if(!g_bRealisticAvionics)
	{
		//MI original code
		if(mode == AA_BUTTON || mode == AG_BUTTON || mode == NAV_BUTTON) 
		{
			if(pbutton != mpPrimaryExclusiveButton) 
			{
				mpPrimaryExclusiveButton->SetCurrentState(0);
				mICPPrimaryMode				= mode;
				mpPrimaryExclusiveButton	= pbutton;
				if(mICPSecondaryMode == NONE_MODE) 
				{
					mUpdateFlags |= CNI_UPDATE;
					ExecCNIMode();
				}
			}
		}
		else if(mode == PREV_BUTTON || mode == NEXT_BUTTON) 
		{
			HandlePrevNext(mode, mICPSecondaryMode);
		}
		else if(mode == ENTR_BUTTON) 
		{
			HandleENTR(mICPSecondaryMode);
		}
		else if(mode == COMM1_BUTTON || mode == COMM2_BUTTON) 
		{
			if(pbutton != mpTertiaryExclusiveButton) 
			{
				mpTertiaryExclusiveButton->SetCurrentState(0);
				mICPTertiaryMode				= mode;
				mpTertiaryExclusiveButton	= pbutton;
				mUpdateFlags |= CNI_UPDATE;
				if(VM) {
					if(mode == COMM1_BUTTON) 
					{
						VM->SetRadio(0);
					}
					else 
					{
						VM->SetRadio(1);
					}
				}
			}				
		}
		else 
		{
			if(pbutton == mpSecondaryExclusiveButton) 
			{
				mICPSecondaryMode = NONE_MODE;
				mpSecondaryExclusiveButton->SetCurrentState(0);
				mpSecondaryExclusiveButton  = NULL;
				mUpdateFlags |= CNI_UPDATE;
				ExecCNIMode();
			}
			else 
			{
				if(mpSecondaryExclusiveButton != NULL) 
				{
					mpSecondaryExclusiveButton->SetCurrentState(0);			
				}

				mICPSecondaryMode				= mode;
				mpSecondaryExclusiveButton = pbutton;


				switch(mode) 
				{
				case NONE_MODE:
					break;
				case STPT_BUTTON:
					playerAC->FCC->SetStptMode(FireControlComputer::FCCWaypoint);
					playerAC->FCC->waypointStepCmd = 127;
					mUpdateFlags |= STPT_UPDATE;
					break;
				case DLINK_BUTTON:
					playerAC->FCC->SetStptMode(FireControlComputer::FCCDLinkpoint);
					playerAC->FCC->waypointStepCmd = 127;
					mUpdateFlags |= DLINK_UPDATE;
					ExecDLINKMode();
					break;
				case MARK_BUTTON:
					playerAC->FCC->SetStptMode(FireControlComputer::FCCMarkpoint);
					playerAC->FCC->waypointStepCmd = 127;
					mUpdateFlags |= MARK_UPDATE;
					ExecMARKMode();
					break;
				case ILS_BUTTON:
					mUpdateFlags |= ILS_UPDATE;
					ExecILSMode();
					break;
				case CRUS_BUTTON:
					mUpdateFlags |= CRUS_UPDATE;
					ExecCRUSMode();
					break;
				case FACK_BUTTON:
					mUpdateFlags |= FACK_UPDATE;
				PNUpdateFACKMode (NEXT_BUTTON, FACK_BUTTON);
					ExecFACKMode();
					break;
				case ALOW_BUTTON:
					mUpdateFlags |= ALOW_UPDATE;
					break;
				}
			}
		}
	}
	else
	{
		if(!playerAC->HasPower(AircraftClass::UFCPower) ||
			playerAC->mFaults->GetFault(FaultClass::ufc_fault))
			return;

		//Master Modes
		if(mode == AA_BUTTON || mode == AG_BUTTON || mode == NAV_BUTTON) 
		{
			mICPPrimaryMode	= mode;
			if(IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == EIGHT_BUTTON)
				ExecMODEMode();
			if(mode == AA_BUTTON)
			{
				IN_AA = TRUE;
				IN_AG = FALSE;
			}
			else if(mode == AG_BUTTON)
			{
				IN_AA = FALSE;
				IN_AG = TRUE;
			}
		}

		/****************************************************/
		/*These are OVERRIDE buttons. With each of these	*/
		/*we can get into specific DED pages, no matter in	*/
		/*what mode we've been before.						*/
		/****************************************************/

		else if(mode == COMM1_BUTTON || mode == COMM2_BUTTON ||
			mode == LIST_BUTTON || mode == IFF_BUTTON) 
		{
			//This results in a new DED page, clear our strings
			ClearStrings();

			//Did we push the same button as before?
			if(mICPTertiaryMode == mode && mode != CNI_MODE)
				PushedSame(LastMode);
			else
				NewMode(mode);
		}
		//END OVERRIDE FUNCTIONS
		//special case, FACK
		else if(mode == FACK_BUTTON)
		{
		    if (playerAC && playerAC->mFaults) { 
			if (m_FaultDisplay == false) { // was off
			    m_FaultDisplay = true; // now on
			    //have a fault, update our display
			    playerAC->mFaults->GetFirstFault(&m_subsystem, &m_function);
			}
			else { // move to next fault
			    if (playerAC->mFaults->GetFFaultCount() <= 0 ||
				playerAC->mFaults->GetNextFault(&m_subsystem, &m_function) == FALSE)
				m_FaultDisplay = false;
			}
			mUpdateFlags |= FACK_UPDATE; // we need to do some work
		    }
		}

		//SENCONDAR FUNCTIONS
		else if(mode == PREV_BUTTON || mode == NEXT_BUTTON) 
		{
			ClearStrings();
			if(IsICPSet(ICPClass::EDIT_STPT))
				PNUpdateSTPTMode(mode, 0);

			else if(mICPSecondaryMode == CRUS_MODE)
				StepHOMERNGSTPT(mode);
			else if(IsICPSet(ICPClass::MODE_CNI) && mICPSecondaryMode == SEVEN_BUTTON)
				PNUpdateMARKMode(mode, 0);

			else if(IsICPSet(ICPClass::EDIT_VHF) || IsICPSet(ICPClass::EDIT_UHF))
				PNUpdateCOMMMode(mode, 0);

			else if(IsICPSet(ICPClass::MODE_DLINK))
				PNUpdateDLINKMode(mode, 0);

			else if(IsICPSet(ICPClass::MODE_COMM1))//Cobra 10/31/04 TJL
			{
				if(mode == NEXT_BUTTON)
				{
					if(PREUHF == NUM_COMM_CHANNELS)	// ASSO:
						PREUHF = 1;
					else
						PREUHF++;
				}
				else
				{
					if(PREUHF == 1)
						PREUHF = NUM_COMM_CHANNELS;	// ASSO:
					else
						PREUHF--;
				}
			}
			else if(IsICPSet(ICPClass::MODE_COMM2))
			{
				if(mode == NEXT_BUTTON)
				{
					if(PREVHF == NUM_COMM_CHANNELS)	// ASSO:
						PREVHF = 1;
					else
						PREVHF++;
				}
				else
				{
					if(PREVHF == 1)
						PREVHF = NUM_COMM_CHANNELS;	// ASSO:
					else
						PREVHF--;
				}
			}
			else if(IsICPSet(ICPClass::MODE_CNI) && mICPSecondaryMode == SIX_BUTTON)
			{
				if(mode == NEXT_BUTTON)
				{
					if(running)
					{
						running = FALSE;
						stopped = TRUE;
					}
					else if(stopped)
					{
						running = TRUE;
						stopped = FALSE;
					}
					else
					{
						Start = vuxGameTime;
						running = TRUE;
					}
				}
				else
				{
					Start = vuxGameTime;
					Difference = 0;
					running = FALSE;
					stopped = FALSE;
				}
			}
			else if(IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == EWS_MODE)
			{
				if(PGMFlare || PGMChaff)
					StepEWSProg(mode);
				else
					PNUpdateSTPTMode(mode, 0);
			}
			// Retro 3Jan2004 start
			else if ((g_bPilotEntertainment)&&(winamp)&&(IsICPSet(ICPClass::MISC_MODE) && mICPSecondaryMode == ZERO_MODE))
			{
				if (mode == PREV_BUTTON)
					winamp->VolDown();
				else if (mode == NEXT_BUTTON)
					winamp->VolUp();
			} // Retro 3Jan2004 end
		}
		else if(mode == ENTR_BUTTON) 
			ICPEnter();
		else if(mode == CLEAR_BUTTON)
		{
			if(IsICPSet(ICPClass::MODE_LIST) && mICPSecondaryMode == 0)
			{
				ClearStrings();
				ExecINTGMode();
				mICPSecondaryMode = 100;	//small hack
			}
			else
				ClearInput();
		}
		else if (mode == UP_MODE || mode == DOWN_MODE || mode == SEQ_MODE || mode == CNI_BUTTON)
		{
			if(mode == CNI_MODE)
				mICPTertiaryMode = CNI_MODE;
			CNISwitch(mode);

			// Retro 3Jan2004 start
			// Retro from here, kind of a hack having this here..
			if ((g_bPilotEntertainment)&&(winamp)&&(IsICPSet(ICPClass::MISC_MODE) && mICPSecondaryMode == ZERO_MODE))
			{
				if (mode == UP_MODE)
					winamp->Next();
				else if (mode == DOWN_MODE)
					winamp->Previous();
				else if (mode == SEQ_MODE)
					winamp->TogglePlayback();
			} // Retro 3Jan2004 end
		}
		//******************
		//******************
		//SECONDARY BUTTONS*
		//******************
		//******************

		//'1' BUTTON
		else if(mode == ONE_BUTTON)
		{
			if(CheckMode())
				return;
			else if(ManualInput())
				HandleManualInput(mode);
			else if(IsICPSet(ICPClass::EDIT_JAMMER) || IsICPSet(ICPClass::EWS_EDIT_BINGO))
				EWSOnOff();
			else
				OneButton(mode);
		}
		//'2' BUTTON
		else if(mode == TWO_BUTTON)
		{
			if(CheckMode())
				return;
			else if(ManualInput())
				HandleManualInput(mode);
			else if(IsICPSet(ICPClass::EDIT_JAMMER) || IsICPSet(ICPClass::EWS_EDIT_BINGO))
				EWSOnOff();
			else
				TwoButton(mode);
		}
		//'3' BUTTON
		else if(mode == THREE_BUTTON)
		{
			if(CheckMode())
				return;
			else if(ManualInput())
				HandleManualInput(mode);
			else if(IsICPSet(ICPClass::EDIT_JAMMER) || IsICPSet(ICPClass::EWS_EDIT_BINGO))
				EWSOnOff();
			else
				ThreeButton(mode);
		}
		//'4' BUTTON
		else if(mode  == FOUR_BUTTON)
		{
			if(CheckMode())
				return;
			else if(ManualInput())
				HandleManualInput(mode);
			else if(IsICPSet(ICPClass::EDIT_JAMMER) || IsICPSet(ICPClass::EWS_EDIT_BINGO))
				EWSOnOff();
			else
				FourButton(mode);
		}
		//'5' BUTTON
		else if(mode == FIFE_BUTTON)
		{
			if(CheckMode())
				return;
			else if(ManualInput())
				HandleManualInput(mode);
			else if(IsICPSet(ICPClass::EDIT_JAMMER) || IsICPSet(ICPClass::EWS_EDIT_BINGO))
				EWSOnOff();
			else
				FifeButton(mode);
		}
		//'6' BUTTON
		else if(mode == SIX_BUTTON)
		{
			if(CheckMode())
				return;
			else if(ManualInput())
				HandleManualInput(mode);
			else if(IsICPSet(ICPClass::EDIT_JAMMER) || IsICPSet(ICPClass::EWS_EDIT_BINGO))
				EWSOnOff();
			else
				SixButton(mode);
		}
		//'7' BUTTON
		else if(mode == SEVEN_BUTTON)
		{
			if(CheckMode())
				return;
			else if(ManualInput())
				HandleManualInput(mode);
			else if(IsICPSet(ICPClass::EDIT_JAMMER) || IsICPSet(ICPClass::EWS_EDIT_BINGO))
				EWSOnOff();
			else
				SevenButton(mode);
		}
		//'8' BUTTON
		else if(mode == EIGHT_BUTTON)
		{
			if(CheckMode())
				return;
			else if(ManualInput())
				HandleManualInput(mode);
			else if(IsICPSet(ICPClass::EDIT_JAMMER) || IsICPSet(ICPClass::EWS_EDIT_BINGO))
				EWSOnOff();
			else
				EightButton(mode);
		}
		//'9' BUTTON
		else if(mode == NINE_BUTTON)
		{
			if(CheckMode())
				return;
			else if(ManualInput())
				HandleManualInput(mode);
			else if(IsICPSet(ICPClass::EDIT_JAMMER) || IsICPSet(ICPClass::EWS_EDIT_BINGO))
				EWSOnOff();
			else
				NineButton(mode);
		}
		//'0' BUTTON
		else if(mode == ZERO_BUTTON)
		{
			if((IsICPSet(ICPClass::MODE_CNI) && mICPSecondaryMode == FIFE_BUTTON) && !IsICPSet(ICPClass::BLOCK_MODE))
			{
				if(Cruise_RNG)
				{
					if(GetCruiseIndex() == 1)
						SetCruiseIndex(-1);
					else
						SetCruiseIndex(1);
				}
				else if(Cruise_HOME)
				{
					if(GetCruiseIndex() == 2)
						SetCruiseIndex(-1);
					else
						SetCruiseIndex(2);
				}
				else if(Cruise_EDR)
				{
					if(GetCruiseIndex() == 3)
						SetCruiseIndex(-1);
					else
						SetCruiseIndex(3);
				}
				else
				{
					if(GetCruiseIndex() == 0)
						SetCruiseIndex(-1);
					else
						SetCruiseIndex(0);
				}
				return;
			}
			else if(IsICPSet(ICPClass::MISC_MODE) && mICPSecondaryMode == EIGHT_BUTTON)
			{
				if(ShowBullseyeInfo)
					ShowBullseyeInfo = FALSE;
				else
					ShowBullseyeInfo = TRUE;
				return;
			}
			if(CheckMode())
				return;
			else if(IsICPSet(ICPClass::EDIT_JAMMER) || IsICPSet(ICPClass::EWS_EDIT_BINGO))
				return;
			else if(ManualInput())
				HandleManualInput(mode);
			else
				ZeroButton(mode);
		}
		/*else if(mode == FACK_BUTTON)
		{
			ClearStrings();
			ClearFlags();
			SetICPFlag(ICPClass::MODE_FACK);
			PNUpdateFACKMode (NEXT_BUTTON, FACK_BUTTON);
			ExecFACKMode();
		}*/
	}
}
Exemplo n.º 9
0
	void SearchWidget::searchCompleted()
	{
		ClearInput();
		setActive(false);
		emit searchEnd();
	}