예제 #1
0
파일: game.cpp 프로젝트: Helyck/agot_timer
void Game::setPhase(int aphase)
{
	phase = aphase;

	for (MAPIntHouseTimer_it i = houseMap.begin(), end = houseMap.end(); i != end; ++i)
	{
		i->second->setPhase(aphase);
	}

	switch (phase)
	{
	case PHASE_WES:
	{
		setStep(0);
		break;
	}
	case PHASE_PLN:
	{
		setStep(1);
		break;
	}
	case PHASE_ACT:
	{
		setStep(1);
		break;
	}
	}
}
예제 #2
0
파일: Wind.cpp 프로젝트: damiannz/wind
void Wind::keyPressed( int key )
{
	switch (key){
		case 'c':
			setContrast1( contrast_1 * 1.05f );
			break;
		case 'C':
			setContrast1( contrast_1 / 1.05f );
			break;
		case 'r':
			setContrast2( contrast_2 * 1.05f );
			break;
		case 'R':
			setContrast2( contrast_2 / 1.05f );
			break;
		case 'd':
			draw_debug = !draw_debug;
			break;
			/*		case 'h':
			 which_hsv_channel = 0;
			 break;
			 case 's':
			 which_hsv_channel = 1;
			 break;
			 case 'v':
			 which_hsv_channel = 2;
			 break;
			 case 'g':
			 which_hsv_channel = 3;
			 break;*/
		case 's':
			setStride( stride+1 );
			break;
		case 'S':
			setStride( stride-1 );
			break;
		case 'o':
			setOffset( offset+1 );
			break;
		case 'O':
			setOffset( offset-1 );
			break;
		case 't':
			setStep( step+0.25f );
			break;
		case 'T':
			setStep( step-0.25f );
			break;
			
			
			
		default:
			break;
			
	}
	
}
예제 #3
0
파일: game.cpp 프로젝트: Helyck/agot_timer
void Game::nextStep()
{
	if ( phase == PHASE_PLN )
	{
		setStep(3);
	}
	else
	{
		setStep(step + 1);
	}
}
예제 #4
0
파일: lazyfn.c 프로젝트: fixed/ps2avrU
void putKeyindexLazyFn(uint8_t xCmd, uint8_t xKeyidx, uint8_t xCol, uint8_t xRow, uint8_t xIsDown){
	if(xCmd == CMD_TOGGLE_LAZY_FN){
		setStep(STEP_INPUT_COMMAND);
		toggleLazyFn();
		printLazyFnState();
		printEnter();
	}else if(xCmd == CMD_EXIT_LAZY_FN){
		setStep(STEP_EXIT);
		stopKeyMapping();
	}else if(xCmd == CMD_BACK_LAZY_FN){		
		setStep(STEP_BACK);
	}
}
예제 #5
0
void putKeyindexBeyondFn(uint8_t xCmd, uint8_t xKeyidx, uint8_t xCol, uint8_t xRow, uint8_t xIsDown){
    if(xCmd == CMD_TOGGLE_BEYOND_FN_LED){
        setStep(STEP_INPUT_COMMAND);
        toggleBeyondFnLedEnabled();
        printBeyondFnLedState();
        printEnter();
    }else if(xCmd == CMD_EXIT_BEYOND_FN_LED){
        setStep(STEP_EXIT);
        stopKeyMapping();
    }else if(xCmd == CMD_BACK_BEYOND_FN_LED){     
        setStep(STEP_BACK);
    }
}
예제 #6
0
void putKeyindexSmartKey(uint8_t xCmd, uint8_t xKeyidx, uint8_t xCol, uint8_t xRow, uint8_t xIsDown){
	if(xCmd == CMD_TOGGLE_SMART_KEY){
		setStep(STEP_INPUT_COMMAND);
		toggleSmartKeyEnabled();
		printSmartKeyState();
		printEnter();
	}else if(xCmd == CMD_EXIT_SMART_KEY){
		setStep(STEP_EXIT);
		stopKeyMapping();						
	}else if(xCmd == CMD_BACK_SMART_KEY){		
		setStep(STEP_BACK);
	}
}
예제 #7
0
int QwtCounter::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: buttonReleased((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 1: valueChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 2: btnReleased(); break;
        case 3: btnClicked(); break;
        case 4: textChanged(); break;
        }
        _id -= 5;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = numButtons(); break;
        case 1: *reinterpret_cast< double*>(_v) = step(); break;
        case 2: *reinterpret_cast< double*>(_v) = minVal(); break;
        case 3: *reinterpret_cast< double*>(_v) = maxVal(); break;
        case 4: *reinterpret_cast< int*>(_v) = stepButton1(); break;
        case 5: *reinterpret_cast< int*>(_v) = stepButton2(); break;
        case 6: *reinterpret_cast< int*>(_v) = stepButton3(); break;
        case 7: *reinterpret_cast< double*>(_v) = value(); break;
        case 8: *reinterpret_cast< bool*>(_v) = editable(); break;
        }
        _id -= 9;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setNumButtons(*reinterpret_cast< int*>(_v)); break;
        case 1: setStep(*reinterpret_cast< double*>(_v)); break;
        case 2: setMinValue(*reinterpret_cast< double*>(_v)); break;
        case 3: setMaxValue(*reinterpret_cast< double*>(_v)); break;
        case 4: setStepButton1(*reinterpret_cast< int*>(_v)); break;
        case 5: setStepButton2(*reinterpret_cast< int*>(_v)); break;
        case 6: setStepButton3(*reinterpret_cast< int*>(_v)); break;
        case 7: setValue(*reinterpret_cast< double*>(_v)); break;
        case 8: setEditable(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 9;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 9;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
예제 #8
0
ContentSlider::ContentSlider(QWidget *parent /*= 0*/)
        :QWidget(parent), slider_min_size_(21)
{
    view_size_ = content_size_ = 0;

    setStep(20);
}
예제 #9
0
/*!
  \brief Specify  range and step size

  \param vmin   lower boundary of the interval
  \param vmax   higher boundary of the interval
  \param vstep  step width
  \param pageSize  page size in steps
  \warning
  \li A change of the range changes the value if it lies outside the
      new range. The current value
      will *not* be adjusted to the new step raster.
  \li vmax < vmin is allowed.
  \li If the step size is left out or set to zero, it will be
      set to 1/100 of the interval length.
  \li If the step size has an absurd value, it will be corrected
      to a better one.
*/
void QwtDoubleRange::setRange(double vmin, double vmax, double vstep, int pageSize)
{
    bool rchg = ((d_maxValue != vmax) || (d_minValue != vmin));

    if (rchg)
    {
        d_minValue = vmin;
        d_maxValue = vmax;
    }

    //
    // look if the step width has an acceptable
    // value or otherwise change it.
    //
    setStep(vstep);

    //
    // limit page size
    //
    d_pageSize = qwtLim(pageSize,0,
                        int(qwtAbs((d_maxValue - d_minValue) / d_step)));

    //
    // If the value lies out of the range, it
    // will be changed. Note that it will not be adjusted to
    // the new step width.
    setNewValue(d_value, false);

    // call notifier after the step width has been
    // adjusted.
    if (rchg)
        rangeChange();
}
예제 #10
0
void Blinkink::setcolor(QColor arg) {
    if (m_color != arg) {
        m_color = arg;
        setStep(1);
        emit colorChanged(arg);
    }
}
예제 #11
0
ControlPotmeter::ControlPotmeter(ConfigKey key, double dMinValue, double dMaxValue)
        : ControlObject(key),
          m_controls(key) {
    setRange(dMinValue, dMaxValue);
    setStep(m_dValueRange / 10.f);
    setSmallStep(m_dValueRange / 100.f);
}
예제 #12
0
void Controller::nextStep()
{
    int delta = lastTime.elapsed();
    int steps = delta / MSEC_INTERVAL;
    step = (step + steps) % 360;
    lastTime.restart();
    setStep(step);
}
예제 #13
0
void PooferSequencer::startSequence(const char* sequence, bool preview)
{
    this->numSteps = strlen(sequence) / numPoofers;
    this->sequence = sequence;
    this->preview = preview;
    this->active = true;
    setStep(0);
}
예제 #14
0
void HotStepper::setNextStep(){
  if(_remaining > 0 && !_paused){
    _remaining--;
    setStep(nextStep());
  }else{
    release();
  }
}
예제 #15
0
///////////////**********[ CFileCreater ]**********///////////////
CFileCreater::CFileCreater()
	:m_strDirectoryPath(_T("")),m_iFileNumber(0),m_strAddFileName(_T("")),m_strFilePath(_T(""))
{
	setStep(0);
	m_pBufferData = NULL;
	m_dwBufferSize = 0;
	m_pAddData = NULL;
	m_dwAddSize = 0;
}
예제 #16
0
void Controller::init()
{
    model->invertButton(true);
    timer.stop();
    model->init();
    step = 0;
    setStep(0);
    update();
}
예제 #17
0
void PooferSequencer::timerExpired()
{
    if (hasMoreSteps()) {
        setStep(curStep + 1);
    }
    else if (sequenceCompleteCallback) {
        sequenceCompleteCallback();
        active = false;
    }
}
예제 #18
0
/*** Constructor ***/
For::For()
{
	setFrom(0);
	setTo(0);
	setStep(0);
	setFor(0);
	setWhileCondition(0);
	setUntilCondition(0);
	setStatements(0);
}
예제 #19
0
void
MSSOTLTrafficLightLogic::setToATargetPhase() {
    for (int step = 0; step < (int)getPhases().size(); step++) {
        if (getPhase(step).isTarget()) {
            setStep(step);
            lastChain = step;
            return;
        }
    }
    MsgHandler::getErrorInstance()->inform("No phase of type target found for traffic light logic " + myID + " The logic could malfunction. Check phases declaration.");
}
예제 #20
0
/*!
  Sets the timeline object used to control the rate of animation to the \a timeLine
  specified.

  \sa timeLine()
*/
void QGraphicsItemAnimation::setTimeLine(QTimeLine *timeLine)
{
    if (d->timeLine == timeLine)
        return;
    if (d->timeLine)
        delete d->timeLine;
    if (!timeLine)
        return;
    d->timeLine = timeLine;
    connect(timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(setStep(qreal)));
}
예제 #21
0
CleanAsyncRequest::CleanAsyncRequest(BasePlugin *plugin, gloox::Stanza *from, const QString& dest)
	:AsyncRequest(-1, plugin, from, 300)
{
	sent_   = 0;
	myDest_ = dest;
	setCount( myDest_.toInt() );
	setStep( 1500 );

	stanza_ = new gloox::Stanza(from);
	timer_  = new QTimer(this);
	connect(timer_, SIGNAL(timeout()), SLOT(sltTimerTimeout()));
}
예제 #22
0
void Blinkink::setblink(bool arg) {
    if (m_blink != arg) {
        m_blink = arg;
        if(arg)
            _animation.start();
        else
        {
            _animation.stop();
            setStep(1);
        }
        emit blinkChanged(arg);
    }
}
예제 #23
0
void LeapMotionPlugin::init() {
    loadSettings();

    auto preferences = DependencyManager::get<Preferences>();
    static const QString LEAPMOTION_PLUGIN { "Leap Motion" };
    {
        auto getter = [this]()->bool { return _enabled; };
        auto setter = [this](bool value) {
            _enabled = value;
            saveSettings();
            if (!_enabled) {
                auto userInputMapper = DependencyManager::get<controller::UserInputMapper>();
                userInputMapper->withLock([&, this]() {
                    _inputDevice->clearState();
                });
            }
        };
        auto preference = new CheckPreference(LEAPMOTION_PLUGIN, "Enabled", getter, setter);
        preferences->addPreference(preference);
    }
    {
        auto getter = [this]()->QString { return _sensorLocation; };
        auto setter = [this](QString value) {
            _sensorLocation = value;
            saveSettings();
            applySensorLocation();
        };
        auto preference = new ComboBoxPreference(LEAPMOTION_PLUGIN, "Sensor location", getter, setter);
        QStringList list = { SENSOR_ON_DESKTOP, SENSOR_ON_HMD };
        preference->setItems(list);
        preferences->addPreference(preference);
    }
    {
        auto getter = [this]()->float { return _desktopHeightOffset; };
        auto setter = [this](float value) {
            _desktopHeightOffset = value;
            saveSettings();
            applyDesktopHeightOffset();
        };
        auto preference = new SpinnerPreference(LEAPMOTION_PLUGIN, "Desktop height for horizontal forearms", getter, setter);
        float MIN_VALUE = 0.0f;
        float MAX_VALUE = 1.0f;
        float DECIMALS = 2.0f;
        float STEP = 0.01f;
        preference->setMin(MIN_VALUE);
        preference->setMax(MAX_VALUE);
        preference->setDecimals(DECIMALS);
        preference->setStep(STEP);
        preferences->addPreference(preference);
    }
}
예제 #24
0
std::shared_ptr<ScrollBar> SimpleScrollableAreaSkin::createScrollBar(
    const std::shared_ptr<FloatValue>& controlledValue,
    Direction::Enum direction) const
{
    if (!m_scrollBarEnabled[direction])
        return nullptr;
    auto skin = std::make_shared<CommonScrollBarSkin>(
        createScrollBarBox(direction, m_scrollBarWidth),
        createDragBarBox(direction, m_scrollBarWidth),
        direction);
    skin->setAlwaysShow(false);
    skin->setStep(m_scrollStep);

    auto scrollBarBackground = std::make_shared<StaticFilledRect>(
        std::make_shared<RelativeBox>(RelativeValue(), RelativeValue()));
    scrollBarBackground->setColor(m_backgroundColor);
    skin->addElement(scrollBarBackground);
    
    auto decButtonSkin = std::make_shared<ArrowButtonSkin>(std::make_shared<SquareBox>());
    fillSkin(decButtonSkin.get());
    decButtonSkin->setArrowType(direction == Direction::Horizontal
        ? ArrowButtonSkin::Left : ArrowButtonSkin::Down);
    decButtonSkin->setArrowColor(m_arrowColor);
    decButtonSkin->setArrowPadding(m_arrowPadding);
    skin->setDecButtonSkin(decButtonSkin);

    auto incButtonSkin = std::make_shared<ArrowButtonSkin>(std::make_shared<SquareBox>());
    fillSkin(incButtonSkin.get());
    incButtonSkin->setArrowType(direction == Direction::Horizontal
        ? ArrowButtonSkin::Right : ArrowButtonSkin::Up);
    incButtonSkin->setArrowColor(m_arrowColor);
    incButtonSkin->setArrowPadding(m_arrowPadding);
    skin->setIncButtonSkin(incButtonSkin);

    auto dragBar = std::make_shared<SimpleRectangleButtonSkin>(
        std::make_shared<RelativeBox>(RelativeValue(), RelativeValue()));
    fillSkin(dragBar.get());
    skin->setDragBarSkin(dragBar);

    auto scrollBar = std::make_shared<ScrollBar>(skin, createScrollBarOffset(direction));
    scrollBar->setControlledValue(controlledValue);
    return scrollBar;
}
   void ProgressCtrl::inspectRead(Inspect *inspect)
   {
      int iLo, iHi, iInc;

      Parent::inspectRead(inspect);

      inspect->read(IDITG_PC_RANGELO,   (Int32 &)iLo);
      inspect->read(IDITG_PC_RANGEHI,   (Int32 &)iHi);
      inspect->read(IDITG_PC_INCREMENT, (Int32 &)iInc);

      if (iLo != iRangeLo || iHi != iRangeHi)
      {
         setRange(iLo, iHi);
      }

      if (iInc != iIncrement)
      {
         setStep(iInc);
      }
   }   
ImplicitList::ImplicitList(InternalType* _poStart, InternalType* _poStep, InternalType* _poEnd)
{
    m_iSize     = -1;
    m_eOutType  = ScilabGeneric;
    m_bComputed = false;
    m_poStart   = NULL;
    m_poStep    = NULL;
    m_poEnd     = NULL;
    m_pDblStart = NULL;
    m_pDblStep  = NULL;
    m_pDblEnd   = NULL;

    setStart(_poStart);
    setStep(_poStep);
    setEnd(_poEnd);
    compute();
#ifndef NDEBUG
    Inspector::addItem(this);
#endif
}
void SymbolicList::evalDollar(GVN & gvn, const GVN::Value * dollarVal)
{
    if (GVN::Value * const dollar = gvn.getExistingValue(symbol::Symbol(L"$")))
    {
        if (GVN::Value * v = evalDollar(gvn, getStart(), dollar, dollarVal))
        {
            setStart(v);
        }

        if (GVN::Value * v = evalDollar(gvn, getStep(), dollar, dollarVal))
        {
            setStep(v);
        }

        if (GVN::Value * v = evalDollar(gvn, getEnd(), dollar, dollarVal))
        {
            setEnd(v);
        }
    }
}
예제 #28
0
void AutomatableModel::setRange( const float min, const float max,
							const float step )
{
	if( ( m_maxValue != max ) || ( m_minValue != min ) )
	{
		m_minValue = min;
		m_maxValue = max;
		if( m_minValue > m_maxValue )
		{
			qSwap<float>( m_minValue, m_maxValue );
		}
		m_range = m_maxValue - m_minValue;

		setStep( step );

		// re-adjust value
		setValue( value<float>() );

		emit propertiesChanged();
	}
}
예제 #29
0
    void EvaluatorModel::init(const ModelInfo::Params & params) {
        AbstractModel::init(params);

        setSize(params["width"].toInt(), params["height"].toInt());
        setStep(params["stepX"].toReal(), params["stepY"].toReal());
        setColor(params["color"].value<QColor>());

        ModelInfo::VerticesVPtr vertices = new ModelInfo::VerticesV;

        GLfloat scalingFactor = (GLfloat) (1.0f / scene()->scalingFactor());

        GLfloat xLeft = - _width * _stepX * scalingFactor;
        GLfloat yTop = - _height * _stepY * scalingFactor;

        GLfloat xCur = xLeft;
        GLfloat yCur = yTop;

        GLfloat stepX = _stepX * scalingFactor;
        GLfloat stepY = _stepY * scalingFactor;

        for (int i = 0; i <= 2 * _height; ++ i) {
            vertices->push_back(ModelInfo::VertexV(xLeft, yCur, 0.0f));
            vertices->push_back(ModelInfo::VertexV(- xLeft, yCur, 0.0f));

            yCur += stepY;
        }

        for (int i = 0; i <= 2 * _width; ++ i) {
            vertices->push_back(ModelInfo::VertexV(xCur, yTop, 0.0f));
            vertices->push_back(ModelInfo::VertexV(xCur, - yTop, 0.0f));

            xCur += stepX;
        }

        ModelInfo::BuffersV buffers;

        buffers.vertices = ModelInfo::VerticesVPointer(vertices);

        AbstractModel::fillBuffers<ModelInfo::BuffersV>(buffers);
    }
예제 #30
0
void Pattern::cloneSteps()
{
	int oldLength = m_steps;
	m_steps += MidiTime::stepsPerTact();
	ensureBeatNotes();
	for(int i = 0; i < MidiTime::stepsPerTact(); ++i )
	{
		Note *toCopy = noteAtStep( i );
		if( toCopy )
		{
			setStep( oldLength + i, true );
			Note *newNote = noteAtStep( oldLength + i );
			newNote->setKey( toCopy->key() );
			newNote->setLength( toCopy->length() );
			newNote->setPanning( toCopy->getPanning() );
			newNote->setVolume( toCopy->getVolume() );
		}
	}
	ensureBeatNotes();
	emit dataChanged();
	updateBBTrack();
}