/** Main program entry point. This routine configures the hardware required by the application, then
 *  enters a loop to run the application tasks in sequence.
 */
int main(void)
{
	SetupHardware();
setOut(LED_PIN);
	puts_P(PSTR( "Still Image Host Demo running.\r\n" ));

//	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
	sei();

	uint32_t count = 0;
	for (;;)
	{
		Camera_Task();
		USB_USBTask();
		if(count++ >= 1000)
		{
			count = 0;
			if(isOut(LED_PIN) && !isHigh(LED_PIN))
			{
				setHigh(LED_PIN);
			}
			else
			{
				setLow(LED_PIN);
			}
		}
	}
}
Пример #2
0
void Player::onShowFrame(int position, double fps, int in, int out, int length, bool isPlaying)
{
    m_duration = length;
    MLT.producer()->set("length", length);
    m_durationLabel->setText(QString(MLT.producer()->get_length_time()).prepend(" / "));
    m_scrubber->setFramerate(fps);
    m_scrubber->setScale(m_duration);
    if (position < m_duration) {
        m_position = position;
        m_positionSpinner->blockSignals(true);
        m_positionSpinner->setValue(position);
        m_positionSpinner->blockSignals(false);
        m_scrubber->onSeek(position);
    }
    if (m_isMeltedPlaying == -1 || isPlaying != m_isMeltedPlaying) {
        m_isMeltedPlaying = isPlaying;
        if (isPlaying) {
            actionPlay->setIcon(m_pauseIcon);
            actionPlay->setText(tr("Pause"));
            actionPlay->setToolTip(tr("Pause playback (K)"));
        }
        else {
            actionPlay->setIcon(m_playIcon);
            actionPlay->setText(tr("Play"));
            actionPlay->setToolTip(tr("Start playback (L)"));
        }
    }
    m_previousIn = in;
    m_previousOut = out;
    m_scrubber->blockSignals(true);
    setIn(in);
    setOut(out);
    m_scrubber->blockSignals(false);
}
Пример #3
0
void Player::onMeltedUnitOpened()
{
    m_isMeltedPlaying = -1; // unknown
    m_duration = MLT.producer()->get_length();
    m_isSeekable = true;
    MLT.producer()->set("ignore_points", 1);
    m_scrubber->setFramerate(MLT.profile().fps());
    m_scrubber->setScale(m_duration);
    m_scrubber->setMarkers(QList<int>());
    m_inPointLabel->setText("--:--:--:-- / ");
    m_selectedLabel->setText("--:--:--:--");
    m_durationLabel->setText(QString(MLT.producer()->get_length_time()).prepend(" / "));
    m_previousIn = MLT.producer()->get_in();
    m_scrubber->setEnabled(true);
    m_scrubber->setInPoint(m_previousIn);
    m_previousOut = MLT.producer()->get_out();
    m_scrubber->setOutPoint(m_previousOut);
    m_positionSpinner->setEnabled(m_isSeekable);
    onVolumeChanged(m_volumeSlider->value());
    m_savedVolume = MLT.volume();
    onMuteButtonToggled(Settings.playerMuted());
    actionPlay->setEnabled(true);
    actionSkipPrevious->setEnabled(m_isSeekable);
    actionSkipNext->setEnabled(m_isSeekable);
    actionRewind->setEnabled(m_isSeekable);
    actionFastForward->setEnabled(m_isSeekable);
    setIn(-1);
    setOut(-1);
    setFocus();
}
Пример #4
0
 NConcept_(NConcept* o)
   : o_(o){
   setIn(true);
   setOut(false);
   setConst(false);
   undefLength();
   setPoly(false);
   setEnabled(true);
 }
Пример #5
0
void CrabSprite::update(Uint32 ticks){
   advanceFrame(ticks);

   Vector2f incr = getVelocity() * static_cast<float>(ticks) * 0.001;
   setPosition(getPosition() + incr);

   if (X() < 0)
      setOut();
}
Пример #6
0
int DWF::f(ptime time, int dt) {
	if (dwf_work.front().first == 0) {
		dwf_work.pop_front();
		if (dwf_work.empty())
			dwf_work = dwf;
		setOut();
	}
	dwf_work.front().first -= dt;
	return dt;
}
Пример #7
0
bool DWF::init(ptime start, ptime end, int dt) {
	(void) end;
	(void) dt;
	(void) start;
	mdt = dt;
	if (!load(dt)) {
		return false;
	}
	dwf_work = dwf;
	setOut();
	return true;
}
Пример #8
0
char hardware_flashlight(char on)
{
    setOut(LED_PIN);
    
    if(on)
    {
        setLow(LED_PIN);
        return 1;
    }
    
    setHigh(LED_PIN);
    return 0;
}
Пример #9
0
void hardware_init(void)
{
    setOut(POWER_HOLD_PIN); // Hold PWR on
    setLow(POWER_HOLD_PIN);

#ifdef POWER_AUX_PIN
    setOut(POWER_AUX_PIN); // Hold AUX PWR on
    setLow(POWER_AUX_PIN);
#endif

#ifdef USB_ENABLE_PIN
    setOut(USB_ENABLE_PIN); // Hold AUX PWR on
    setLow(USB_ENABLE_PIN);
#endif

    setOut(LED_PIN);  // Red Flashlight
    setHigh(LED_PIN); // off
    setOut(IR_PIN);  // IR Transmitter
    setHigh(IR_PIN); // off

    hardware_USB_Enable();

    hardware_USB_SetDeviceMode();
}
Пример #10
0
Файл: PBC.cpp Проект: cran/PBC
// Initialization of parameters from R
void PBC::parametersInit(SEXP m_binMat, SEXP m_theta, SEXP m_x, SEXP m_root, SEXP m_f, SEXP m_nIteration, 
                         SEXP m_dxf, SEXP m_dxdyf, SEXP m_graf, SEXP m_gradxf, SEXP m_gradxdyf, SEXP m_type, SEXP m_g, SEXP m_dxg, SEXP m_out) {
  setType(m_type);
  setNIteration(m_nIteration);
  setFunction(m_f);
  setDxf(m_dxf);
  setDxdyf(m_dxdyf);
  setGraf(m_graf);
  setGradxf(m_gradxf);
  setGradxdyf(m_gradxdyf);
  setVector(m_x);  
  setTheta(m_theta);  
  setRoot(m_root);  
  setBinMat(m_binMat, m_x);
  setMargins(m_g);
  setDxg(m_dxg);
  setOut(m_out);
}
Пример #11
0
void Loader::saveGame(AI_Manager *game)
{
  ofstream teamOut(teamFile, ios::trunc);
  if(!(teamOut.is_open()))
  {
    errorStatement();
    return;
  }

  ofstream AIOut(AIFile, ios::trunc);
  if(!(AIOut.is_open()))
  {
    errorStatement();
    return;
  }

  ofstream brkOut(bracketFile, ios::trunc);
  if(!(brkOut.is_open()))
  {
    errorStatement();
    return;
  }
  ofstream setOut(setFile, ios::trunc);
  if(!(setOut.is_open()))
  {
    errorStatement();
    return;
  }
  ofstream masterOut(masterFile, ios::trunc);
  if(!(masterOut.is_open()))
  {
    errorStatement();
    return;
  }

  saveAI(game, AIOut);
  saveMaster(game, masterOut);
  saveSettings(game, setOut);
  saveBrackets(game, brkOut);
  saveTeams(game, teamOut);
}
Пример #12
0
double * layer::outputsOfLayer()
{
    setOut();
    return  outs_;
}
Пример #13
0
void eSource::stamp()
{
    m_ePin[0]->stampAdmitance( m_admit );
    setOut( m_out );
}
Пример #14
0
void eSource::setVoltHigh( double v )
{
    m_voltHigh = v;
    if( m_out ) setOut( true );
}
Пример #15
0
void eSource::setVoltLow( double v )
{
    m_voltLow = v;
    if( !m_out ) setOut( false );
}
Пример #16
0
void Player::setIn(int pos)
{
    m_scrubber->setInPoint(pos);
    if (pos >= 0 && pos > m_previousOut)
        setOut(m_duration - 1);
}
Пример #17
0
void TimersvSettings::set(int on,int off, int out, int flags) {
	setTimeOn(on);
	setTimeOff(off);
	setOut(out);
	setFlags(flags);
}
Пример #18
0
IR::IR()
{
    setOut(IR_PIN);
    setHigh(IR_PIN);
}