void SigParamSaturationDialog::findNextSpot(int direction)
{
    qint64 pos = curPos;
    qint64 fileSize = file.size();
    while(1) {
        pos += direction*PassBytes;
        if(pos < 0 || pos >= fileSize)
            break;
        file.seek(pos);

        memset(findBuf, 0, PassBytes);
        file.read((char*)findBuf, PassBytes);

        for(int i = 0; i < PassItems; i++) {
            if(findBuf[i] >= sigMax || findBuf[i] <= sigMin) {
                sbChannel->setValue(i % NumChannels);
                changePos(pos);
                return;
            }
        }
    }
    if(pos < 0)
        changePos(0);
    else if(pos > fileSize)
        changePos(pos - PassBytes);
}
void SigParamSelectionDialog::on_btnLeft_clicked()
{
    qint64 newPos = curPos - PassBytes;
    if(newPos < 0)
        newPos = 0;
    changePos(newPos);
}
Exemple #3
0
void Widget::start()
{
    if(vec.isEmpty())
    {
     QColor *col;
     for(int i=0; i<100;i++)
     {
       int speedx=min_x+rand()%(max-min_y);
       int speedy=min_y+rand()%(max-min_y);
         if(speedx%2)
           speedx*=-1;
         if(speedy%2)
            speedy*=-1;
         if(rand()%2)
             col = new QColor(Qt::black);
         else
             col = new QColor(Qt::red);

         molecula *dot = new molecula(rand()%331-3,rand()%271-3,*col,speedx,speedy);

         vec.push_back(dot);
         QObject::connect(timer,SIGNAL(timeout()),vec.back(),SLOT(changePos()));
         scene->addItem(vec.back());
         delete(col);
     }
         timer->start();

    }
    else
    {
        timer->start();
    }

}
void PlayerController::PlaybackPositionChanged(TInt aPosition)
{
TInt len=iPlayer->Duration();
qDebug()<<aPosition<<len;
emit changePos(aPosition,len);
if (!checkTimer->isActive()) checkTimer->start();
}
Exemple #5
0
void imgLabel::mouseReleaseEvent(QMouseEvent *event)
 {
    if (event->button() == Qt::LeftButton) {
        changePos(event->x(), event->y());
     } else {
         QLabel::mousePressEvent(event);
     }
 }
void SigParamSelectionDialog::on_btnGo_clicked()
{
    bool ok;
    double t = curPos/(double)BytesPerSample/(double)SamplingRate;
    t = QInputDialog::getDouble(this, "Go to", "Jump to time (in seconds):", t, 0, 2e9, 3, &ok);
    if(ok) {
        qint64 newPos = round(t*SamplingRate)*BytesPerSample;
        changePos(newPos);
    }
}
Exemple #7
0
void AgiEngine::checkMotion(VtEntry *v) {
	switch (v->motion) {
	case MOTION_WANDER:
		motionWander(v);
		break;
	case MOTION_FOLLOW_EGO:
		motionFollowEgo(v);
		break;
	case MOTION_MOVE_OBJ:
		motionMoveObj(v);
		break;
	}

	if ((_game.block.active && (~v->flags & IGNORE_BLOCKS)) && v->direction)
		changePos(v);
}
Exemple #8
0
void AgiEngine::checkMotion(ScreenObjEntry *screenObj) {
	switch (screenObj->motionType) {
	case kMotionNormal:
		break;
	case kMotionWander:
		motionWander(screenObj);
		break;
	case kMotionFollowEgo:
		motionFollowEgo(screenObj);
		break;
	case kMotionEgo:
	case kMotionMoveObj:
		motionMoveObj(screenObj);
		break;
	}

	if ((_game.block.active && (~screenObj->flags & fIgnoreBlocks)) && screenObj->direction)
		changePos(screenObj);
}
Exemple #9
0
void DraggableLabel::dropEvent(QDropEvent *event)
{
    if(!m_drop)
        return;

    int myPos = labelLayout->getLabelPos(this);
    int pos;

    QByteArray data = event->mimeData()->data("analyzer/dropLabel");
    QDataStream str(data);
    str >> pos;

    emit changePos(myPos, pos);

    QString css = valueLabel->styleSheet();
    css.replace(QRegExp("red"), "orange");
    valueLabel->setStyleSheet(css);

    event->acceptProposedAction();
}
int PlayerController::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: playing(); break;
        case 1: stopped(); break;
        case 2: paused(); break;
        case 3: playerStarted((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 4: playerClosed(); break;
        case 5: changeTrackInfo((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 6: changePos((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 7: passAlbumArt((*reinterpret_cast< CFbsBitmap*(*)>(_a[1]))); break;
        case 8: updateAlbumArt((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 9: CheckPlayerState(); break;
        case 10: Tick(); break;
        case 11: Play(); break;
        case 12: Pause(); break;
        case 13: Next(); break;
        case 14: Previous(); break;
        case 15: SeekForward(); break;
        case 16: SeekBack(); break;
        case 17: StopSeeking(); break;
        case 18: AlbumArtSaved((*reinterpret_cast< CFbsBitmap*(*)>(_a[1]))); break;
        case 19: GoToNowPlaying(); break;
        case 20: ClosePlayer(); break;
        case 21: SeekToPos((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 22: GetState(); break;
        default: ;
        }
        _id -= 23;
    }
    return _id;
}
void SigParamSelectionDialog::on_btnRight_clicked()
{
    qint64 newPos = curPos + PassBytes;
    changePos(newPos);
}
Exemple #12
0
void Stage::changePos(sf::Vector2f posDelta) {
	changePos(posDelta.x, posDelta.y);
}
Exemple #13
0
void GuideLabelNode::update() {
    changePos(labelPos);
}
Exemple #14
0
void FlowArea::add(const std::string& text, const ColorValue& color,const DWORD font)
{
	const wchar_t* str = autostring::to_wchar(text.c_str());

	FlowItem item;
	item.text = str;
	item.color = color;
	item.scale = 1.0f;
	item.font = (SysFont)font;
	item.offY = 0;//mList.empty() ? 0 : mList.back().offY;

	// 分拆长字符串
	int w = getTextWidth(str);
	if (w > getWidth()) // 太长
	{
		wchar_t c[2] = {0,0};
		int i = 0;
		int off = 0;
		int count = 0;
		int width = 0;
		float offY = item.offY;
		bool isFirst = true;
		while (str[i])
		{
			c[0] = str[i];
			int charW = getTextWidth(c);
			if (width + charW > getWidth()) // 需要分拆
			{
				FlowItem fi;
				wchar_t* s = new wchar_t[count+1];
				wcsncpy(s, &str[off], count);
				s[count] = 0;
				fi.text = s;
				fi.color = color;
				fi.scale = 1.0f;
				fi.offY = offY;
				fi.font = (SysFont)font;
				if (isFirst) changePos();
				isFirst = false;
				mList.push_back(fi);

				off = i;
				count = 1;
				width = charW;
				offY -= gGlobalClient->getFont(font)->getLineHeight();
			}
			else
			{
				width += charW;
				count++;
			}

			i++;
		}

		if (count >= 1)
		{
			FlowItem fi;
			wchar_t* s = new wchar_t[count+1];
			wcsncpy(s, &str[off], count);
			s[count] = 0;
			fi.text = s;
			fi.color = color;
			fi.offY = offY;
			fi.font = (SysFont)font;
			if (isFirst) changePos();
			isFirst = false;
			mList.push_back(fi);
		}

		delete str;
	}
	else
	{
		changePos();
		mList.push_back(item);
	}
}