Esempio n. 1
0
CCutContainingDialog::CCutContainingDialog(BRect frame, const char *name, window_type type, int flags,
			BWindow *owner, BPositionIO* data)
	: HDialog(frame, name, type, flags, owner, data)
{
	SetOn("sel", sSelectionOnly);
	BView *textView = FindView("text");
	if (textView)
		textView->MakeFocus(true);
} /* CCutContainingDialog::CCutContainingDialog */
Esempio n. 2
0
void GOrgueSoundingPipe::Change(unsigned velocity, unsigned last_velocity)
{
	if (!m_Instances && velocity)
		SetOn(velocity);
	else if (m_Instances && !velocity)
		SetOff();
	else if (m_Sampler && last_velocity != velocity)
		m_organfile->UpdateVelocity(m_Sampler, velocity);
}
Esempio n. 3
0
bool MuteButton::SetOnBySolo(bool p_vOn)
{
/*
	if(GetOn() && !m_vOnBySolo) // This is if the track is muted and soloed and then solo button is pressed
	{
		ExecuteCommand();
		return false;
	}
	else if(GetOn() && m_vOnBySolo) // This is if the track is muted and not soloed and then solo button is pressed
	{
		ExecuteCommand();
		return false;
	}
*/
	if(m_vOnBySolo == p_vOn)
		return false;

	m_vOnBySolo = p_vOn;
	if(m_vOnBySolo)
	{
		SetColors(m_oOnBySoloColor);
		SetOn(true);
		ExecuteCommand();
		return true;
	}
	SetOn(false);
	SetColors(m_oOnByUserColor);

	EMMuteState eMuteState;
	if(GetOn())
	{
eo << "Setting mute state for track with ID " << m_vMediaTrackID << " to EM_MUTE_ON_BY_SOLO" << ef;
		eMuteState = EM_MUTE_ON_BY_SOLO;
	}
	else
	{
eo << "Setting mute state for track with ID " << m_vMediaTrackID << " to EM_MUTE_OFF" << ef;
		eMuteState = EM_MUTE_OFF;
	}
	EMCommandRepository::Instance() -> ExecuteCommand(MEDIA_COMMAND_SET_TRACK_MUTE_STATE, &m_vMediaTrackID, &eMuteState);

//	ExecuteCommand();
	return false;
}
Esempio n. 4
0
bool CInfoDialog::CancelClicked()
{
	char s[32];
	sprintf(s, "%d", (int)fDoc->TextView()->Font().Size());
	SetText("size", s);

	sprintf(s, "%d", fDoc->TextView()->TabStops());
	SetText("tabs", s);

	font_family ff;
	font_style fs;
	fDoc->TextView()->Font().GetFamilyAndStyle(&ff, &fs);

	BMenuItem *item = fMenu->FindItem(ff);
	if (item)
	{
		item->SetMarked(true);
		item = item->Submenu()->FindItem(fs);
		if (item) item->SetMarked(true);
	}

	fSourceEncoding->ItemAt(fDoc->Encoding())->SetMarked(true);
	fEncoding->ItemAt(fDoc->Encoding())->SetMarked(true);
	fLineBreaks->ItemAt(fDoc->LineEndType())->SetMarked(true);

	SetOn("syntaxcol", fDoc->TextView()->SyntaxColoring());
	SetOn("show tabs", fDoc->ToolBar()->ShowsTabs());
	SetOn("show invisibles", fDoc->TextView()->ShowInvisibles());

	bool softwrap = fDoc->TextView()->SoftWrap();
	SetOn("softwrap", softwrap);
	switch (fDoc->TextView()->WrapType())
	{
		case 1:	SetOn("wrapwindow"); break;
		case 2:	SetOn("wrappaper"); break;
		default:	SetOn("wrapfixed");
	}
	sprintf(s, "%d", fDoc->TextView()->WrapWidth());
	SetText("wrapfixedto", s);

//	SetEnabled("wrapwindow", softwrap);
//	SetEnabled("wrappaper", softwrap);
//	SetEnabled("wrapfixed", softwrap);
//	SetEnabled("wrapfixedto", softwrap && IsOn("wrapfixed"));

	SetEnabled("ok", false);
	SetEnabled("cancel", false);

	return false;
} /* CInfoDialog::CancelClicked */
BOOL CGCColorStatic::FlashBackgroundPulsed(const BOOL bFlash, 
											const BOOL bFinalState,
											const float pulseDuration,
											const int pulseRep,
											const float onDuration) 
{
	if (m_bTimerFlag) KillTimer(m_uiTimerID);		// If a timer is active, kill it.

	if (bFlash)
	{
		m_pulseDuration = pulseDuration * 1000;
		m_pulseOnDuration = onDuration * 1000;
		m_pulseRep = pulseRep * 2 + 1;

		// We are turning on flashing of the background.

		SetOn(TRUE);							// Resync text with background and
												// set to on state.  Start pulsed
												// flashing out in ON state.


		m_FlashTypeFlag = PULSED_BACKGROUND;	// Set flash type to PULSED_BACKGROUND.
												// This is the Pulsed Flash mode.

		m_bTimerFlag = TRUE;					// Yes, a timer process exists.

		m_pulseCounter += 1;
		m_uiTimerID = SetTimer(FLASH_TIMER_ID,int(m_pulseDuration),NULL);	// Create the timer.
		if (!m_uiTimerID) return FALSE;
	}
	else
	{
		// If we are turning off the flashing, make sure the background is left
		// in the state specified by bFinalState.
		m_bBackgroundOn = bFinalState;			// Set final state of background.
		m_bTextOn = bFinalState;				// Resync text state with background state.
		m_FlashTypeFlag = NONE;					// No flash state exists.
		Invalidate(TRUE);					// Force repaint.
		PostMessage(WM_GECCOLORSTATIC_DRAWFRAME);
	}

	return TRUE;
}
Esempio n. 6
0
void SpinningWorldModel::UpdatePowerOn( const LTFLOAT &fCurTime )
{
	LTBOOL	bDoneInX = LTFALSE;
	LTBOOL	bDoneInY = LTFALSE;
	LTBOOL	bDoneInZ = LTFALSE;
	LTFLOAT	fPercent;
	LTFLOAT	fRate;
	LTFLOAT	fFrameTm = g_pLTServer->GetFrameTime();
	
	fPercent = (fCurTime - m_fMoveStartTm) / m_fPowerOnTime;

	if( m_bUpdateSpin )
	{
		// Update Pitch PowerUP...

		if( m_vFinalVelocity.x )
		{
			fRate = m_vFinalVelocity.x / m_fPowerOnTime;
					
			m_vVelocity.x += GetWaveformValue( fRate, fPercent ) * fFrameTm * m_vRotateDir.x;

			if( m_vVelocity.x >= m_vFinalVelocity.x )
			{
				m_vVelocity.x = m_vFinalVelocity.x;
				bDoneInX = LTTRUE;
			}
		}
		else
		{
			bDoneInX = LTTRUE;
		}

		// Update Yaw PowerUP...

		if( m_vFinalVelocity.y )
		{
			fRate = m_vFinalVelocity.y / m_fPowerOnTime;
			
			m_vVelocity.y += GetWaveformValue( fRate, fPercent ) * fFrameTm * m_vRotateDir.y;

			if( m_vVelocity.y >= m_vFinalVelocity.y )
			{
				m_vVelocity.y = m_vFinalVelocity.y;
				bDoneInY = LTTRUE;
			}
		}
		else
		{
			bDoneInY = LTTRUE;
		}

		// Update Roll PowerUP...

		if( m_vFinalVelocity.z )
		{
			fRate = m_vFinalVelocity.z / m_fPowerOnTime;

			m_vVelocity.z += GetWaveformValue( fRate, fPercent ) * fFrameTm * m_vRotateDir.z;

			if( m_vVelocity.z >= m_vFinalVelocity.z )
			{
				m_vVelocity.z = m_vFinalVelocity.z;
				bDoneInZ = LTTRUE;
			}
		}
		else
		{
			bDoneInZ = LTTRUE;
		}
	}

	if( fPercent > 1.0f )
	{
		bDoneInX = LTTRUE;
		bDoneInY = LTTRUE;
		bDoneInZ = LTTRUE;

		m_vVelocity = m_vFinalVelocity;
	}

	// Let the "on" update do the actual rotating

	UpdateOn( fCurTime );

	if( bDoneInX && bDoneInY && bDoneInZ )
	{
		SetOn();
	}
}
void CGCColorStatic::OnTimer(UINT nIDEvent) 
{
#if 0
	// Toggle the state of the appropriate item.
	switch (m_FlashTypeFlag)
	{
		case TEXT:
			// If the flash type is TEXT...

			m_bTextOn = !m_bTextOn;					// Invert state.

			Invalidate(TRUE);					// Force to redraw.
			PostMessage(WM_GECCOLORSTATIC_DRAWFRAME);

			break;
		case BACKGROUND:
			// If the flash type is BACKGROUND...

			m_bBackgroundOn = !m_bBackgroundOn;		// Invert state.
			m_bTextOn = !m_bTextOn;					// Invert state.  Yes, I do this here 
													// but not for TEXT above.
			Invalidate(TRUE);					// Force to redraw.
			PostMessage(WM_GECCOLORSTATIC_DRAWFRAME);

			break;
		case ASYM_BACKGROUND:
			// If the flash type is Asymmetrical Background...

			KillTimer(m_uiTimerID);	// Kill previous timer.

			// When FlashBackgroundAsym() is called, the control is immediately updated
			// to the "ON" state by that method.  So, we want to start out with 
			// setting the timer for the OnDuration as specified by m_fOnDuration 
			// member variable.
			m_bBackgroundOn = !m_bBackgroundOn;		// Invert state.
			m_bTextOn = !m_bTextOn;					// Invert state.  Yes, I do this here 

			Invalidate(TRUE);
			PostMessage(WM_GECCOLORSTATIC_DRAWFRAME);

			switch (m_bBackgroundOn)
			{
				case TRUE:
					m_uiTimerID = SetTimer(FLASH_TIMER_ID,int(m_fOnDuration),NULL);	// Create the "ON" timer.
					break;
				case FALSE:
					m_uiTimerID = SetTimer(FLASH_TIMER_ID,int(m_fOffDuration),NULL);	// Create the "OFF" timer.
			}
			break;
		case PULSED_BACKGROUND:

			// If the flash type is Pulsed Background...

			// When FlashBackgroundPulsed() is called, the control is immediately updated
			// to the "ON" state by that method.  So, we want to start out with 
			// setting the timer for the pulse's on duration as specified by m_pulseDuration 
			// member variable.
			m_bBackgroundOn = !m_bBackgroundOn;		// Invert state.
			m_bTextOn = !m_bTextOn;					// Invert state.  Yes, I do this here 

			Invalidate(TRUE);
			PostMessage(WM_GECCOLORSTATIC_DRAWFRAME);

			m_pulseCounter += 1;

			if (m_pulseCounter <= m_pulseRep) 
			{
				m_uiTimerID = SetTimer(FLASH_TIMER_ID,int(m_pulseDuration),NULL);   	// Create a pulse timer.
			}
			else
			{
				m_pulseCounter = 0;
				SetOn();
				m_uiTimerID = SetTimer(FLASH_TIMER_ID,int(m_pulseOnDuration),NULL);	// Create the "ON" timer.
			}

	}
#endif	
	CStatic::OnTimer(nIDEvent);
}
Esempio n. 8
0
void SpinningWorldModel::UpdatePowerOn( const double &fCurTime )
{
	bool	bDoneInX = false;
	bool	bDoneInY = false;
	bool	bDoneInZ = false;
	float	fPercent;
	float	fRate;
	float	fFrameTm = g_pLTServer->GetFrameTime();
	
	fPercent = ((float)(fCurTime - m_fMoveStartTm)) / m_fPowerOnTime;

	if( m_bUpdateSpin )
	{
		// Update Pitch PowerUP...

		if( m_vFinalVelocity.x )
		{
			fRate = m_vFinalVelocity.x / m_fPowerOnTime;
					
			m_vVelocity.x += GetWaveformValue( fRate, fPercent ) * fFrameTm * m_vInitRotDir.x;

			if( m_vVelocity.x >= m_vFinalVelocity.x )
			{
				m_vVelocity.x = m_vFinalVelocity.x;
				bDoneInX = true;
			}
		}
		else
		{
			bDoneInX = true;
		}

		// Update Yaw PowerUP...

		if( m_vFinalVelocity.y )
		{
			fRate = m_vFinalVelocity.y / m_fPowerOnTime;
			
			m_vVelocity.y += GetWaveformValue( fRate, fPercent ) * fFrameTm * m_vInitRotDir.y;

			if( m_vVelocity.y >= m_vFinalVelocity.y )
			{
				m_vVelocity.y = m_vFinalVelocity.y;
				bDoneInY = true;
			}
		}
		else
		{
			bDoneInY = true;
		}

		// Update Roll PowerUP...

		if( m_vFinalVelocity.z )
		{
			fRate = m_vFinalVelocity.z / m_fPowerOnTime;

			m_vVelocity.z += GetWaveformValue( fRate, fPercent ) * fFrameTm * m_vInitRotDir.z;

			if( m_vVelocity.z >= m_vFinalVelocity.z )
			{
				m_vVelocity.z = m_vFinalVelocity.z;
				bDoneInZ = true;
			}
		}
		else
		{
			bDoneInZ = true;
		}
	}

	if( fPercent > 1.0f )
	{
		bDoneInX = true;
		bDoneInY = true;
		bDoneInZ = true;

		m_vVelocity = m_vFinalVelocity;
	}

	// Let the "on" update do the actual rotating

	UpdateOn( fCurTime );

	if( bDoneInX && bDoneInY && bDoneInZ )
	{
		SetOn();
	}
}
void DigitalOutput::SetOn(unsigned long timeInMs)
{
	SetOn();
	delay(timeInMs);
}
Esempio n. 10
0
void CEnvHudCounter::InputHideHudCounter( inputdata_t &inputdata )
{
	SetOn( false );
	m_OnCounterHidden.FireOutput( this, this );
}
Esempio n. 11
0
void CEnvHudCounter::InputShowHudCounter( inputdata_t &inputdata )
{
	SetOn( true );
	m_OnCounterShown.FireOutput( this, this );
}
Esempio n. 12
0
bool CPrefsDialog::CancelClicked()
{
	char s[256];
	
	ResetFontSheet();
	
	SetOn("autorecalc", fAutoRecalc);
	SetOn("displayzero", fDisplayZero);
	
	s[1] = 0;
	s[0] = gDecimalPoint;
	SetText("decsep", s);
	s[0] = gThousandSeparator;
	SetText("thoussep", s);
	s[0] = gListSeparator;
	SetText("listsep", s);
	s[0] = gTimeSeparator;
	SetText("timesep", s);
	s[0] = gDateSeparator;
	SetText("datesep", s);
	fDMY->FindItem(gPrefs->GetPrefString("date order"))->SetMarked(true);
	SetOn("24 hours", g24Hours);
	SetOn("excel", gPrefs->GetPrefInt("Excel keys", 0));
	SetOn("grayselect", gPrefs->GetPrefInt("Select Gray", 0));
	SetOn(gPrefs->GetPrefInt("start with new", 1) ? "donew" : "doopen", B_CONTROL_ON);
	SetOn("formula starts with equal", gPrefs->GetPrefInt("formula starts with equal", 0));
	SetOn("dark gridlines", gPrefs->GetPrefInt("dark gridlines"));
	
	SetText("c_symbol", gPrefs->GetPrefString("c_symbol", "$"));
	SetOn(gPrefs->GetPrefInt("c_before", 1) ? "c_before" : "c_after", B_CONTROL_ON);
	SetOn("c_neg_par", gPrefs->GetPrefInt("c_neg_par", 1) ? B_CONTROL_ON : B_CONTROL_OFF);
	sprintf(s, "%d", gPrefs->GetPrefInt("c_digits"));
	SetText("c_digits", s);

	if (fPageSetup) FREE(fPageSetup);
	fPageSetup = (char *)Hex2Bin(gPrefs->GetPrefString("default page setup", ""), fPageSetupSize);
	
	SetOn("prgrid", fPrGrid);
	SetOn("prhead", fPrBorders);
	SetOn("dispgrid", fShGrid);
	SetOn("disphead", fShBorders);
	
	BButton *b;
	b = (BButton *)FindView("ok");
	b->SetEnabled(false);
	b = (BButton *)FindView("cancel");
	b->SetEnabled(false);
	
	return false;
} /* CPrefsDialog::CancelClicked */
Esempio n. 13
0
void UpdateDataSector(BYTE n)
{
	BYTE in;
	
	if(n>3) return;
	
	if(digit(Ndd.PowerOld,n) == 1)	// рабочий режим
	{
		SetOn(n);
		switch (Ndd.St1[n])
		{
			case 1:		//читаем все
			{
				SetRegim(n, REGIM_WORK);
				
				if(Ndd.Timer2[n]>10) 
				{
					GetDataInput(n);
					Ndd.Timer2[n] = 0;
					Ndd.Read[n][Ndd.CurStep[n]]=~GetDataBunk(n);
					Ndd.St1[n]=2;
				}
			}
			break;
			case 2:		// провереям можно ли в данный момент провести тест 0
			{
				if(ReqwestTest0(n) == 1)
				{
					Ndd.St1[n]=3;
					Ndd.Timer2[n] = 0;
				}
			}break;
			case 3:		//читаем тест 0
			{
				Ndd.Test0_Last = n;	// мы в последними выполнили тест 0
				SetRegim(n, REGIM_TEST_0);
				if(Ndd.Timer2[n]>10) 
				{
					Ndd.Timer2[n] = 0;
					Ndd.TestR[n][Ndd.CurStep[n]]=GetDataBunk(n);
					Ndd.CurStep[n]++;
					if(Ndd.CurStep[n]>2)
					{
						Ndd.CurStep[n]=0;
						AnalizeTestData(n);
					}
					Ndd.St1[n]=1;
					SetRegim(n, REGIM_WORK);
					Ndd.Test0_Run[n]	=0;
				}
			}
			break;
			default:
				Ndd.St1[n] = 1;
		}
	}else	// тестовый режим
	{
		SetOff(n);
		switch (Ndd.St1[n])
		{
			case 1:	// ждем когда можно будет провести тест 0
			{
				if(Ndd.Timer2[n]>StartTimeOut)
				{
					StartTimeOut = 10;
					Ndd.Timer2[n] = 11;
				}else break;
				
				if(ReqwestTest0(n) == 1)
				{
					Ndd.St1[n]=2;
					Ndd.Timer2[n] = 0;
				}
			}break;
			case 2:	// тест 0
			{
				SetRegim(n, REGIM_TEST_0);	// test 0 
				if(Ndd.Timer2[n]>StartTimeOut) 
				{
					StartTimeOut=10;
					//============================
					//in = GetDataBunk(n);
					
					//if(n<2) tmp = Ndd.test[0] & MASK_FF[n];
					//else	tmp = Ndd.test[1] & MASK_FF[n];
					
					Ndd.Test_Bunk[n] = GetDataBunk(n);
					
					//if(n<2)	Ndd.tmp_test[0] = tmp;
					//else	Ndd.tmp_test[1] = tmp;
					//============================
					Ndd.Timer2[n] = 0;
					Ndd.St1[n] = 3;
					SetRegim(n, REGIM_TEST_1);	// test 1 
					Ndd.Test0_Run[n]	=0;
				}		
			}
			break;
			case 3:
			{
				SetRegim(n, REGIM_TEST_1); // test 1 
				if(Ndd.Timer2[n]>10) 
				{
					//==============================
					in = GetDataBunk(n);
					
					//if(n<2)	tmp = Ndd.tmp_test[0] & MASK_FF[n];
					//else	tmp = Ndd.tmp_test[1] & MASK_FF[n];
					//if(n<2)	tmp = Ndd.tmp_test[0];
					//else	tmp = Ndd.tmp_test[1];
					
					Ndd.Test_Bunk[n] |=  ((~in) & MASK_FF_INV[n]);
					
					if(n<2)	Ndd.test[0] = (Ndd.test[0]&MASK_FF[n]) | Ndd.Test_Bunk[n];
					else	Ndd.test[1] = (Ndd.test[1]&MASK_FF[n]) | Ndd.Test_Bunk[n];
					//==============================
					Ndd.Timer2[n] 	= 0;
					Ndd.St1[n] 		= 4;
				}
			}
			break;
			//-------------------------------------------------------
			case 4:
			{
				SetRegim(n, REGIM_WORK);
				if(Ndd.Timer2[n]>5000/*60000*/) 
				{
					Ndd.Timer2[n] = 0;
					Ndd.St1[n] = 1;
				}
			}
			break;
			default:
				Ndd.St1[n] = 1;
		}
	}
}