您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ tick函数代码示例

51自学网 2021-06-03 08:49:52
  C++
这篇教程C++ tick函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中tick函数的典型用法代码示例。如果您正苦于以下问题:C++ tick函数的具体用法?C++ tick怎么用?C++ tick使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了tick函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: tick

inline TTErr TTSvf::calculatePeak(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt channel){   	tick(x, channel);	y = 0.5 * (mLowpass_output[channel] - mHighpass_output[channel]);	return kTTErrNone;}
开发者ID:alexarje,项目名称:JamomaDSP,代码行数:6,


示例2: staff

qreal TimeSig::mag() const      {      return staff() ? staff()->mag(tick()) : 1.0;      }
开发者ID:akdor1154,项目名称:MuseScore,代码行数:4,


示例3: while

void DSP::enter() {  while(true) {    switch(state.sample_stage) {    case 0:      voice_5(voice[0]);      voice_2(voice[1]);      if(!tick()) break;    case 1:      voice_6(voice[0]);      voice_3(voice[1]);      if (!tick()) break;    case 2:      voice_7(voice[0]);      voice_4(voice[1]);      voice_1(voice[3]);      if (!tick()) break;    case 3:      voice_8(voice[0]);      voice_5(voice[1]);      voice_2(voice[2]);      if (!tick()) break;    case 4:      voice_9(voice[0]);      voice_6(voice[1]);      voice_3(voice[2]);      if (!tick()) break;    case 5:      voice_7(voice[1]);      voice_4(voice[2]);      voice_1(voice[4]);      if (!tick()) break;    case 6:      voice_8(voice[1]);      voice_5(voice[2]);      voice_2(voice[3]);      if (!tick()) break;    case 7:      voice_9(voice[1]);      voice_6(voice[2]);      voice_3(voice[3]);      if (!tick()) break;    case 8:      voice_7(voice[2]);      voice_4(voice[3]);      voice_1(voice[5]);      if (!tick()) break;    case 9:      voice_8(voice[2]);      voice_5(voice[3]);      voice_2(voice[4]);      if (!tick()) break;    case 10:      voice_9(voice[2]);      voice_6(voice[3]);      voice_3(voice[4]);      if (!tick()) break;    case 11:      voice_7(voice[3]);      voice_4(voice[4]);      voice_1(voice[6]);      if (!tick()) break;    case 12:      voice_8(voice[3]);      voice_5(voice[4]);      voice_2(voice[5]);      if (!tick()) break;    case 13:      voice_9(voice[3]);      voice_6(voice[4]);      voice_3(voice[5]);      if (!tick()) break;    case 14:      voice_7(voice[4]);      voice_4(voice[5]);      voice_1(voice[7]);      if (!tick()) break;    case 15:      voice_8(voice[4]);      voice_5(voice[5]);      voice_2(voice[6]);      if (!tick()) break;    case 16:      voice_9(voice[4]);      voice_6(voice[5]);//.........这里部分代码省略.........
开发者ID:kode54,项目名称:bsnes-libretro-cplusplus98,代码行数:101,


示例4: game_loop

void game_loop(int * input_key){	//init game data	init_game();		//control data	struct timeval *begin, *end, *tmp;	unsigned long diff;//in us	int key = 0; //for temporary storage of input_key, b/c of race conditions	int reached_bottom = 0;		begin=malloc(sizeof(struct timeval));	end=malloc(sizeof(struct timeval));	gettimeofday(begin, NULL);	diff = 0;		draw();	while(1){		//input		key=*input_key;		if(key != -1){			*input_key = -1;//input read->reset			switch(key){//TODO move block				case KEY_DOWN:						reached_bottom = go_down(&current_tetromino, &world);					break;				case KEY_LEFT: 						if(!reached_bottom){						go_left(&current_tetromino, &world);					}					break;				case KEY_RIGHT: 					if(!reached_bottom){						go_right(&current_tetromino, &world);					}					break;				case 'x':					if(!reached_bottom){						rotate(&current_tetromino, &world, 1);					}					break;				case 'c':					if(!reached_bottom){						rotate(&current_tetromino, &world, 0);					}					break;				case 27: /*ESC*/					switch(menu(input_key)){						case 0:break;//continue game						case 1:init_game();break;//new game						case -1://quit							free(begin);							free(end);							return;						default:break;					} 					gettimeofday(begin, NULL);					break;				case 32: /*Space*/					while(!go_down(&current_tetromino, &world));					reached_bottom=1;					diff=tick_time;					break;				case -2: 							free(begin);					free(end);					return;				default: break;			}		}				//game tick & time		gettimeofday(end, NULL);		diff+=(end->tv_sec-begin->tv_sec)*1000000 + end->tv_usec-begin->tv_usec;		tmp=begin;		begin=end;		end=tmp;				if(diff >= tick_time){			diff -= tick_time;			tick(&reached_bottom);		}				//gui update		draw();				//sleep		usleep(50*1000);	}}
开发者ID:Zinurist,项目名称:Tetris,代码行数:89,


示例5: _fight

/**   Animate and perform the fight routine*/static void _fight(NinjaState *state, NinjaPacket *packet) {  uint8_t result = results[state->p1Move][state->p2Move];  bool up = true;  char username[USERNAME_MAX_LENGTH];  ANXGetUsername(username);  //Animate the players getting ready to fight  for (uint8_t i = 0; i < 6; i++) {    display.clearDisplay();    display.setCursor(0, 0);    display.print(state->p1Score);    display.setCursor(120, 0);    display.print(state->p2Score);    display.setCursor(40, 28);    display.print("Round "); display.print(state->round);    display.drawFastHLine(0, display.height() - 10, display.width(), WHITE);    //Draw the usernames    display.setCursor(0, 56);    display.print(username);    printAlignRight(state->p2Name, 56);    //Animate the players idling    if (up) {      drawBitmapFlash(state->p1Idle1, PLAYER_1_X, PLAYER_1_Y);      drawBitmapFlash(state->p2Idle1, PLAYER_2_X, PLAYER_2_Y);    } else {      drawBitmapFlash(state->p1Idle2, PLAYER_1_X, PLAYER_1_Y);      drawBitmapFlash(state->p2Idle2, PLAYER_2_X, PLAYER_2_Y);    }    up = !up;    safeDisplay();    for (uint8_t i = 0; i < 15; i++) {      deepSleep(25);      tick();      _handlePackets(state, packet);    }  }  for (uint8_t i = 0; i < 6; i++) {    display.clearDisplay();    display.setCursor(0, 0);    display.print(state->p1Score);    display.setCursor(120, 0);    display.print(state->p2Score);    display.drawFastHLine(0, display.height() - 10, display.width(), WHITE);    //Draw the names    display.setCursor(0, 56);    display.print(username);    printAlignRight(state->p2Name, 56);    //Setup the animation graphics    if (up) {      if (state->p1Move == MOVE_PUNCH)   drawBitmapFlash(state->p1Punch1,     37, PLAYER_1_Y);      if (state->p1Move == MOVE_KICK)    drawBitmapFlash(state->p1Kick1,      37, PLAYER_1_Y);      if (state->p1Move == MOVE_NONE)    drawBitmapFlash(state->p1Idle1,      37, PLAYER_1_Y);      if (state->p1Move == MOVE_SHIELD)  drawBitmapFlash(state->p1Shield1,    37, PLAYER_1_Y);      if (state->p2Move == MOVE_PUNCH)   drawBitmapFlash(state->p2Punch2,     64, PLAYER_2_Y);      if (state->p2Move == MOVE_KICK)    drawBitmapFlash(state->p2Kick2,      64, PLAYER_2_Y);      if (state->p2Move == MOVE_NONE)    drawBitmapFlash(state->p2Idle2,      64, PLAYER_2_Y);      if (state->p2Move == MOVE_SHIELD)  drawBitmapFlash(state->p2Shield2,    64, PLAYER_2_Y);    } else {      if (state->p1Move == MOVE_PUNCH)   drawBitmapFlash(state->p1Punch2,     37, PLAYER_1_Y);      if (state->p1Move == MOVE_KICK)    drawBitmapFlash(state->p1Kick2,      37, PLAYER_1_Y);      if (state->p1Move == MOVE_NONE)    drawBitmapFlash(state->p1Idle2,      37, PLAYER_1_Y);      if (state->p1Move == MOVE_SHIELD)  drawBitmapFlash(state->p1Shield2,    37, PLAYER_2_Y);      if (state->p2Move == MOVE_PUNCH)   drawBitmapFlash(state->p2Punch1,     64, PLAYER_2_Y);      if (state->p2Move == MOVE_KICK)    drawBitmapFlash(state->p2Kick1,      64, PLAYER_2_Y);      if (state->p2Move == MOVE_NONE)    drawBitmapFlash(state->p2Idle1,      64, PLAYER_2_Y);      if (state->p2Move == MOVE_SHIELD)  drawBitmapFlash(state->p2Shield1,    64, PLAYER_2_Y);    }    if (state->p1Move == MOVE_TROLL)     drawBitmapFlash(state->troll,        23, PLAYER_1_Y);    if (state->p2Move == MOVE_TROLL)     drawBitmapFlash(state->troll,        64, PLAYER_2_Y);    up = !up;    safeDisplay();    for (uint8_t i = 0; i < 5; i++) {      deepSleep(100);      tick();    }  }  display.clearDisplay();  display.drawFastHLine(0, display.height() - 10, display.width(), WHITE);  //Draw the names  display.setCursor(0, 56);  display.print(username);//.........这里部分代码省略.........
开发者ID:ANDnXOR,项目名称:ANDnXOR_DC24_Badge,代码行数:101,


示例6: Java_br_odb_nehe_lesson07_GL2JNILib_tick

JNIEXPORT void JNICALL Java_br_odb_nehe_lesson07_GL2JNILib_tick(JNIEnv *env, jobject obj) {    tick();}
开发者ID:TheFakeMontyOnTheRun,项目名称:nehe-ndk-gles20,代码行数:3,


示例7: tick

 void Alias::process() {   for (int i = 0; i < buffer_size_; ++i)     tick(i); }
开发者ID:and3k5,项目名称:helm,代码行数:4,


示例8: canCollide

bool NounShip::canCollide() const{	if ( tick() < m_nIgnoreCollisionTick )		return false;	return true;}
开发者ID:BlackYoup,项目名称:darkspace,代码行数:6,


示例9: QWidget

SDRdaemonGui::SDRdaemonGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :	QWidget(parent),	ui(new Ui::SDRdaemonGui),	m_deviceAPI(deviceAPI),	m_sampleSource(NULL),	m_acquisition(false),	m_lastEngineState((DSPDeviceSourceEngine::State)-1),	m_sampleRate(0),	m_sampleRateStream(0),	m_centerFrequency(0),	m_syncLocked(false),	m_frameSize(0),	m_lz4(false),	m_compressionRatio(1.0),	m_nbLz4DataCRCOK(0),	m_nbLz4SuccessfulDecodes(0),	m_bufferLengthInSecs(0.0),    m_bufferGauge(-50),	m_samplesCount(0),	m_tickCount(0),	m_address("127.0.0.1"),	m_dataPort(9090),	m_controlPort(9091),	m_addressEdited(false),	m_dataPortEdited(false),	m_initSendConfiguration(false),	m_dcBlock(false),	m_iqCorrection(false),	m_autoFollowRate(false){	m_sender = nn_socket(AF_SP, NN_PAIR);	assert(m_sender != -1);	int millis = 500;    int rc = nn_setsockopt (m_sender, NN_SOL_SOCKET, NN_SNDTIMEO, &millis, sizeof (millis));    assert (rc == 0);	m_startingTimeStamp.tv_sec = 0;	m_startingTimeStamp.tv_usec = 0;	ui->setupUi(this);	ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));	ui->centerFrequency->setValueRange(7, 0, pow(10,7));	connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));	connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));	m_statusTimer.start(500);	connect(&(deviceAPI->getMainWindow()->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));	m_sampleSource = new SDRdaemonInput(deviceAPI->getMainWindow()->getMasterTimer(), m_deviceAPI);	connect(m_sampleSource->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));	m_deviceAPI->setSource(m_sampleSource);	displaySettings();	ui->applyButton->setEnabled(false);	ui->sendButton->setEnabled(false);    char recFileNameCStr[30];    sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());    m_fileSink = new FileRecord(std::string(recFileNameCStr));    m_deviceAPI->addSink(m_fileSink);    connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);}
开发者ID:f4exb,项目名称:sdrangel,代码行数:62,


示例10: printf

// observe the raw infomation, but just like human ut will use some method to filter the noice// this is just for one robotvoid RobotTracker::observe(VisionRawInfo obs, double timestamp){    //如果有1秒没有来更新信号,自动复位,防止繁殖的程序内存不够    if(timestamp-time>0.5)    {        printf("Robot obvserve reset/r/n");        reset_on_observation = true;    }    // if there is no renew signal    // if the observation has been reset    if (reset_on_observation)    {        if (obs.conf <= 0.0)        {            return;        }        static Matrix observe_matrix(7,1), P(7);        observe_matrix.e(0,0) = obs.pos.x;        observe_matrix.e(1,0) = obs.pos.y;        observe_matrix.e(2,0) = obs.angle;        observe_matrix.e(3,0) = 0.0;        observe_matrix.e(4,0) = 0.0;        observe_matrix.e(5,0) = 0.0;        observe_matrix.e(6,0) = 0.0;        P.e(0,0) = DVAR(ROBOT_POSITION_VARIANCE);        P.e(1,1) = DVAR(ROBOT_POSITION_VARIANCE);        P.e(2,2) = DVAR(ROBOT_THETA_VARIANCE);        P.e(3,3) = 0.0; // 0m/s        if (type == ROBOT_TYPE_DIFF)        {            P.e(4,4) = 0.0;        }        else        {            P.e(4,4) = 0.0; // 0m/s        }        P.e(5,5) = 0.0;        P.e(6,6) = 0.0;        initial(obs.timestamp, observe_matrix, P);        reset_on_observation = false;    }    else    {        // If this is a new observation.        if (timestamp > time)        {            // Tick to current time.            tick(timestamp - time);            // Make observation            if (obs.timestamp == timestamp)            {                double xtheta = xs[0].e(2,0);                Matrix o(3,1);                o.e(0,0) = obs.pos.x;                o.e(1,0) = obs.pos.y;                o.e(2,0) = anglemod(obs.angle - xtheta) + xtheta;                update(o);            }            if (error_time_elapsed() > 10.0)            {                fprintf(stderr, "Kalman Error (pos, theta, vpos, vtheta): ");                fprintf(stderr, "%f ",                        hypot(error_mean().e(0, 0), error_mean().e(1, 0)));                fprintf(stderr, "%f ", error_mean().e(2, 0));                fprintf(stderr, "%f ",                        hypot(error_mean().e(3, 0), error_mean().e(4, 0)));                fprintf(stderr, "%f/n", error_mean().e(5, 0));                error_reset();            }        }    }}
开发者ID:barry963,项目名称:Robot_project,代码行数:87,


示例11: while

void MpvAudioOutput::event_loop() {    while (true) {        auto event = mpv_wait_event(handle_, -1);        //         qDebug() << "mpv event " << mpv_event_name(event->event_id);        switch (event->event_id) {        case MPV_EVENT_SHUTDOWN:            return;        case MPV_EVENT_QUEUE_OVERFLOW:            qWarning() << "mpv queue overflow";            break;        case MPV_EVENT_START_FILE:            setState(AudioState::Buffering);            break;        case MPV_EVENT_FILE_LOADED:            setState(AudioState::Playing);            emit currentSourceChanged();            setVolume();            if (seek_offset_ != -1) {                seek(seek_offset_);                seek_offset_ = -1;            }            break;        case MPV_EVENT_END_FILE: {            auto end_ev = reinterpret_cast<mpv_event_end_file *>(event->data);            if (end_ev->reason == MPV_END_FILE_REASON_ERROR)                qWarning() << "Ended file: " << mpv_error_string(end_ev->error);            break;        }        case MPV_EVENT_LOG_MESSAGE: {            auto log = reinterpret_cast<mpv_event_log_message *>(event->data);            qDebug() << "mpv [" << log->prefix << "] " << log->text;            break;        }        case MPV_EVENT_PROPERTY_CHANGE: {            auto prop = reinterpret_cast<mpv_event_property *>(event->data);            if (prop->format != MPV_FORMAT_NONE && prop->data) {                if (std::string(prop->name) == "playback-time") {                    std::string pos(*(reinterpret_cast<char **>(prop->data)));                    emit tick(pos_to_qint64(pos));                    if (volumeNeverSet_)                        setVolume();                } else if (std::string(prop->name) == "idle") {                    int idle = *reinterpret_cast<int *>(prop->data);                    if (idle) {                        setState(AudioState::Stopped);                        emit finished();                    } else                        setState(AudioState::Playing);                } else if (std::string(prop->name) == "pause") {                    int pause = *reinterpret_cast<int *>(prop->data);                    if (pause)                        setState(AudioState::Paused);                    else if (state_ == AudioState::Paused)                        setState(AudioState::Playing);                } else if (std::string(prop->name) == "duration") {                    double v = *reinterpret_cast<double *>(prop->data);                    emit durationChanged(v);                } else if (std::string(prop->name) == "metadata") {                    emit metadataChanged(get_property("media-title").toString(),                                         get_property("audio-format").toString(),                                         get_property("audio-params/samplerate").toInt());                }            }            break;        }        default:            break;        }    }}
开发者ID:abenea,项目名称:fubar,代码行数:70,


示例12: connect

void NPlayer::connectSignals(){	connect(m_playbackEngine, SIGNAL(mediaChanged(const QString &)), this, SLOT(on_playbackEngine_mediaChanged(const QString &)));	connect(m_playbackEngine, SIGNAL(mediaChanged(const QString &)), m_waveformSlider, SLOT(setMedia(const QString &)));	connect(m_playbackEngine, SIGNAL(stateChanged(N::PlaybackState)), this, SLOT(on_playbackEngine_stateChanged(N::PlaybackState)));	connect(m_playbackEngine, SIGNAL(aboutToFinish()), m_playlistWidget, SLOT(currentFinished()), Qt::BlockingQueuedConnection);	connect(m_playbackEngine, SIGNAL(positionChanged(qreal)), m_waveformSlider, SLOT(setValue(qreal)));	connect(m_playbackEngine, SIGNAL(tick(qint64)), m_trackInfoWidget, SLOT(tick(qint64)));	connect(m_playbackEngine, SIGNAL(finished()), m_playlistWidget, SLOT(currentFinished()));	connect(m_playbackEngine, SIGNAL(failed()), this, SLOT(on_playbackEngine_failed()));	connect(m_playbackEngine, SIGNAL(message(QMessageBox::Icon, const QString &, const QString &)), m_logDialog, SLOT(showMessage(QMessageBox::Icon, const QString &, const QString &)));	connect(m_mainWindow, SIGNAL(closed()), this, SLOT(on_mainWindow_closed()));	connect(m_preferencesDialog, SIGNAL(settingsChanged()), this, SLOT(on_preferencesDialog_settingsChanged()));	if (m_coverWidget)		connect(m_playbackEngine, SIGNAL(mediaChanged(const QString &)), m_coverWidget, SLOT(setSource(const QString &)));	if (QAbstractButton *playButton = qFindChild<QAbstractButton *>(m_mainWindow, "playButton"))		connect(playButton, SIGNAL(clicked()), this, SLOT(on_playButton_clicked()));	if (QAbstractButton *stopButton = qFindChild<QAbstractButton *>(m_mainWindow, "stopButton"))		connect(stopButton, SIGNAL(clicked()), m_playbackEngine, SLOT(stop()));	if (QAbstractButton *prevButton = qFindChild<QAbstractButton *>(m_mainWindow, "prevButton"))		connect(prevButton, SIGNAL(clicked()), m_playlistWidget, SLOT(playPrevItem()));	if (QAbstractButton *nextButton = qFindChild<QAbstractButton *>(m_mainWindow, "nextButton"))		connect(nextButton, SIGNAL(clicked()), m_playlistWidget, SLOT(playNextItem()));	if (QAbstractButton *closeButton = qFindChild<QAbstractButton *>(m_mainWindow, "closeButton"))		connect(closeButton, SIGNAL(clicked()), m_mainWindow, SLOT(close()));	if (QAbstractButton *minimizeButton = qFindChild<QAbstractButton *>(m_mainWindow, "minimizeButton"))		connect(minimizeButton, SIGNAL(clicked()), m_mainWindow, SLOT(showMinimized()));	if (m_volumeSlider) {		connect(m_volumeSlider, SIGNAL(sliderMoved(qreal)), m_playbackEngine, SLOT(setVolume(qreal)));		connect(m_playbackEngine, SIGNAL(volumeChanged(qreal)), m_volumeSlider, SLOT(setValue(qreal)));		connect(m_mainWindow, SIGNAL(scrolled(int)), this, SLOT(on_mainWindow_scrolled(int)));	}	if (QAbstractButton *repeatButton = qFindChild<QAbstractButton *>(m_mainWindow, "repeatButton")) {		connect(repeatButton, SIGNAL(clicked(bool)), m_playlistWidget, SLOT(setRepeatMode(bool)));		connect(m_playlistWidget, SIGNAL(repeatModeChanged(bool)), repeatButton, SLOT(setChecked(bool)));	}	if (QAbstractButton *shuffleButton = qFindChild<QAbstractButton *>(m_mainWindow, "shuffleButton")) {		connect(shuffleButton, SIGNAL(clicked(bool)), m_playlistWidget, SLOT(setShuffleMode(bool)));		connect(m_playlistWidget, SIGNAL(shuffleModeChanged(bool)), shuffleButton, SLOT(setChecked(bool)));	}	connect(m_playlistWidget, SIGNAL(setMedia(const QString &)), m_playbackEngine, SLOT(setMedia(const QString &)));	connect(m_playlistWidget, SIGNAL(currentActivated()), m_playbackEngine, SLOT(play()));	connect(m_playlistWidget, SIGNAL(shuffleModeChanged(bool)), m_shufflePlaylistAction, SLOT(setChecked(bool)));	connect(m_playlistWidget, SIGNAL(repeatModeChanged(bool)), m_repeatPlaylistAction, SLOT(setChecked(bool)));	connect(m_waveformSlider, SIGNAL(filesDropped(const QStringList &)), m_playlistWidget, SLOT(playFiles(const QStringList &)));	connect(m_waveformSlider, SIGNAL(sliderMoved(qreal)), m_playbackEngine, SLOT(setPosition(qreal)));	connect(m_showHideAction, SIGNAL(triggered()), this, SLOT(toggleWindowVisibility()));	connect(m_playAction, SIGNAL(triggered()), m_playbackEngine, SLOT(play()));	connect(m_stopAction, SIGNAL(triggered()), m_playbackEngine, SLOT(stop()));	connect(m_prevAction, SIGNAL(triggered()), m_playlistWidget, SLOT(playPrevItem()));	connect(m_nextAction, SIGNAL(triggered()), m_playlistWidget, SLOT(playNextItem()));	connect(m_preferencesAction, SIGNAL(triggered()), m_preferencesDialog, SLOT(exec()));	connect(m_exitAction, SIGNAL(triggered()), this, SLOT(quit()));	connect(m_addFilesAction, SIGNAL(triggered()), this, SLOT(showOpenFileDialog()));	connect(m_playlistWidget, SIGNAL(activateEmptyFail()), m_addFilesAction, SLOT(trigger()));	connect(m_addDirAction, SIGNAL(triggered()), this, SLOT(showOpenDirDialog()));	connect(m_savePlaylistAction, SIGNAL(triggered()), this, SLOT(showSavePlaylistDialog()));	connect(m_showCoverAction, SIGNAL(toggled(bool)), this, SLOT(on_showCoverAction_toggled(bool)));	connect(m_aboutAction, SIGNAL(triggered()), this, SLOT(showAboutMessageBox()));	connect(m_playingOnTopAction, SIGNAL(toggled(bool)), this, SLOT(on_whilePlayingOnTopAction_toggled(bool)));	connect(m_alwaysOnTopAction, SIGNAL(toggled(bool)), this, SLOT(on_alwaysOnTopAction_toggled(bool)));	connect(m_fullScreenAction, SIGNAL(triggered()), m_mainWindow, SLOT(toggleFullScreen()));	connect(m_shufflePlaylistAction, SIGNAL(triggered(bool)), m_playlistWidget, SLOT(setShuffleMode(bool)));	connect(m_repeatPlaylistAction, SIGNAL(triggered(bool)), m_playlistWidget, SLOT(setRepeatMode(bool)));	connect(m_loopPlaylistAction, SIGNAL(triggered()), this, SLOT(on_playlistAction_triggered()));	connect(m_nextFileEnableAction, SIGNAL(triggered()), this, SLOT(on_playlistAction_triggered()));	connect(m_nextFileByNameAscdAction, SIGNAL(triggered()), this, SLOT(on_playlistAction_triggered()));	connect(m_nextFileByNameDescAction, SIGNAL(triggered()), this, SLOT(on_playlistAction_triggered()));	connect(m_nextFileByDateAscd, SIGNAL(triggered()), this, SLOT(on_playlistAction_triggered()));	connect(m_nextFileByDateDesc, SIGNAL(triggered()), this, SLOT(on_playlistAction_triggered()));	foreach (NAction *action, findChildren<NAction *>()) {		if (action->objectName().startsWith("Jump"))			connect(action, SIGNAL(triggered()), this, SLOT(on_jumpAction_triggered()));	}	connect(m_mainWindow, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));	connect(m_systemTray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(on_trayIcon_activated(QSystemTrayIcon::ActivationReason)));	connect(m_trayClickTimer, SIGNAL(timeout()), this, SLOT(on_trayClickTimer_timeout()));}
开发者ID:susnux,项目名称:nulloy,代码行数:95,


示例13: QMainWindow

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){	setWindowTitle("MD VideoConference " MDVC_VERSION);	posted = true;	ws = new QWorkspace(this);	ws->setScrollBarsEnabled(TRUE);	setCentralWidget(ws);	if (! prefs->bNoReceive) {		dice=new DiceWindow(ws);		ws->addWindow(dice);		dice->show();		dice->parentWidget()->installEventFilter(this);	} else {		dice = NULL;	}	timer=new QTimer(this);	connect(timer, SIGNAL(timeout()), this, SLOT(tick()));	timer->start(60000);	readyWin = NULL;	QActionGroup *ag;	QAction *a;	QMenu *submenu;	int i;	videoSizeMenu = new QMenu( "&Video", this );	ag=new QActionGroup(this);	submenu=new QMenu("&Bitrate", videoSizeMenu);	i = 0;	while(bitrates[i] != -1) {		QString bitrate=QString::number(bitrates[i] / 1000) + " kbit";		a = new QAction(bitrate, this);		a->setCheckable(TRUE);		a->setData(bitrates[i]);		ag->addAction(a);		submenu->addAction(a);		if (bitrates[i] == prefs->iVideoBitrate)			a->setChecked(TRUE);		i++;	}	connect(ag, SIGNAL(triggered(QAction *)), this, SLOT(videoBitrate(QAction *)));	videoSizeMenu->addMenu(submenu);	videoSizeMenu->addAction("Settings", this, SLOT(videoDialog()));	videoSizeMenu->addAction("Stream", this, SLOT(videoStreamDialog()));	videoSizeMenu->addAction("&Denoise", this, SLOT(videoDenoise()));	videoSizeMenu->addAction("Statistics", this, SLOT(videoStats()));	if (! prefs->bNoSendAudio) {		audioMenu = new QMenu( "&Audio", this );		ag=new QActionGroup(this);		submenu=new QMenu("&Decodelag", audioMenu);		for(i=1;i<=7;i++) {			a = new QAction(QString::number((i-1)*10) + "ms", this);			a->setCheckable(TRUE);			a->setData(i);			ag->addAction(a);			submenu->addAction(a);			if (prefs->iAudioDecodeLag == i)				a->setChecked(TRUE);		}		connect(ag, SIGNAL(triggered(QAction *)), this, SLOT(audioDecodeLag(QAction *)));		audioMenu->addMenu(submenu);		audioMenu->addAction("&Statistics", this, SLOT(audioStats()));		audioMenu->addAction("Max &Gain", this, SLOT(audioGain()));		audioMenu->addAction("&Reset PP", this, SLOT(audioResetPP()));		aAudioInput = audioMenu->addAction("&InputMonitor", this, SLOT(audioInputMonitor()));		aAudioInput->setCheckable(TRUE);		aAudioInput->setChecked(prefs->bAudioInput);	} else {
开发者ID:thorvald,项目名称:mdvc,代码行数:85,


示例14: _doNinja

/**   Primary state machine for ninja fight game handles exchange of packets and setting up game   between the two players*/static void _doNinja(NinjaState *state, NinjaPacket *packet) {  uint32_t endTime = 0;  //Init the game state  state->p1Idle1 = getBitmapMetadata(NINJA_P1_IDLE1_address);  state->p2Idle1 = getBitmapMetadata(NINJA_P2_IDLE1_address);  state->p1Idle2 = getBitmapMetadata(NINJA_P1_IDLE2_address);  state->p2Idle2 = getBitmapMetadata(NINJA_P2_IDLE2_address);  state->p1Punch1 = getBitmapMetadata(NINJA_P1_PUNCH1_address);  state->p2Punch1 = getBitmapMetadata(NINJA_P2_PUNCH1_address);  state->p1Punch2 = getBitmapMetadata(NINJA_P1_PUNCH2_address);  state->p2Punch2 = getBitmapMetadata(NINJA_P2_PUNCH2_address);  state->p1Kick1 = getBitmapMetadata(NINJA_P1_KICK1_address);  state->p2Kick1 = getBitmapMetadata(NINJA_P2_KICK1_address);  state->p1Kick2 = getBitmapMetadata(NINJA_P1_KICK2_address);  state->p2Kick2 = getBitmapMetadata(NINJA_P2_KICK2_address);  state->p1Shield1 = getBitmapMetadata(NINJA_P1_SHIELD1_address);  state->p2Shield1 = getBitmapMetadata(NINJA_P2_SHIELD1_address);  state->p1Shield2 = getBitmapMetadata(NINJA_P1_SHIELD2_address);  state->p2Shield2 = getBitmapMetadata(NINJA_P2_SHIELD2_address);  state->p1Dead = getBitmapMetadata(NINJA_P1_DEAD_address);  state->p2Dead = getBitmapMetadata(NINJA_P2_DEAD_address);  state->troll = getBitmapMetadata(NINJA_DT_address);  state->punch = getBitmapMetadata(NINJA_PUNCH_address);  state->kick = getBitmapMetadata(NINJA_KICK_address);  state->shield = getBitmapMetadata(NINJA_SHIELD_address);  state->up = getBitmapMetadata(NINJA_UP_address);  state->down = getBitmapMetadata(NINJA_DOWN_address);  state->right = getBitmapMetadata(NINJA_RIGHT_address);  state->state = STATE_SELECT_MOVE;  state->round = 1;  state->p1Score = 0;  state->p2Score = 0;  while (state->p1Score < 2 && state->p2Score < 2) {    if (state->state == STATE_SELECT_MOVE) {      state->lastACK = -1;      //Set p2Move to -1 *before* _getPlayerMove (which could change it!)      state->p2Move = -1; //other player move      state->p1Move = _getPlayerMove(state, packet);      endTime = rtMillis() + 20000;      bool ackRecv = false;      bool moveRecv = false;      //Wait for a bit sending and receiving until we're synced with other player      while (state->lastACK != TYPE_MOVE || state->p2Move < 0) {        //Show a dialog to the player        char wait[32];        sprintf(wait, "Waiting for/nplayer %d", (endTime - rtMillis()) / 1000);        statusDialog(wait);        safeDisplay();        //Keep sending until an ACK is received        if (state->lastACK != TYPE_MOVE) {          //Fill out the rest of the packet          packet->type = TYPE_MOVE;          packet->data = state->p1Move;          packet->round = state->round;          ANXRFSend(packet, NINJA_PACKET_SIZE);        }        //Delay and do some ticking (400ms)        for (uint8_t i = 0; i < 16; i++) {          deepSleep(25);          tick();          //Process any data that comes in          _handlePackets(state, packet);        }        //give up on other player        if (rtMillis() > endTime) {          state->state = STATE_ABORT;          break;        }      }      //Bump them over to fight      if (state->state != STATE_ABORT) state->state = STATE_FIGHT;    } else if (state->state == STATE_FIGHT) {      _fight(state, packet);      state->state = STATE_SELECT_MOVE;      state->round++;    } else if (state->state == STATE_ABORT) {      break;    }//.........这里部分代码省略.........
开发者ID:ANDnXOR,项目名称:ANDnXOR_DC24_Badge,代码行数:101,


示例15: maxDamage

void NounShip::destroyShip( Noun * pKiller, bool bZeroVelocity ){	// make sure the damage is enough	m_Damage = maxDamage();	// clear the current order & command, so if they respawn the ship doesn't try to keep doing it's last command	setCommand( NOCOMMAND, NULL );	setOrder( NOORDER, NULL, NULL );	// inform the context user first	if ( pKiller != this )	{		gameContext()->gameUser()->onDestroyed( this, pKiller );		if ( pKiller != NULL )			gameContext()->gameUser()->onKill( pKiller, this );	}	else 		gameContext()->gameUser()->onSelfDestruct( this );	if ( WidgetCast<NounPlanet>( pKiller ) )		gameContext()->gameUser()->onCollidePlanet( this );	// create the primary explosion	if ( context()->isClient() )	{		Scene * pScene = destroyEffect();		if ( pScene != NULL )		{			// TODO: no need to add this explosion of this player is nowhere near the explosion			// ship destroyed, create the explosion effect			SceneryDebris * pEffect = new SceneryDebris;			pEffect->setNounContext( new NounContext( pScene ) );			pEffect->setContext( context() );			pEffect->setPosition( worldPosition() );			pEffect->setDelay( 0.0f );			pEffect->setFrame( frame() );			if (! bZeroVelocity )				pEffect->setVelocity( Vector3( sin( m_fHeading ) * m_fVelocity, 0.0f, cos( m_fHeading) * m_fVelocity ) );			if (! pEffect->setSegment( "Effect" ) )				pEffect->setLife( 15.0f );			context()->attachNoun( pEffect );		}		NounTrail::CopyTrailsIntoZone( this );	}	// list of destroyed items to remove from ship..	std::list< Noun * > destroyed;	// damage enhancements, once they reach their maxDamage() they are destroyed..	for(int i=0;i<childCount();++i)	{		NounEnhancement * pEnh = WidgetCast<NounEnhancement>( child(i) );		if ( pEnh != NULL )		{			if ( pEnh->incrementDamage() )			{				LOG_STATUS( "NounShip", "[ENHANCEMENT]:Destroyed:%s:%s:%u", pEnh->getName(), name(), userId() );				message( CharString().format( "<color;ffffff>Comms: Enhancement '%s' destroyed!", pEnh->getName() ) );				destroyed.push_back( pEnh );			}			continue;		}		// remove any beacons on death..		NounBeacon * pBeacon = WidgetCast<NounBeacon>( child(i) );		if ( pBeacon != NULL )		{			destroyed.push_back( pBeacon );			continue;		}	}	// server-side only logic	if ( isServer() )	{		// check for area damage		Array< GameContext::NounCollision > collide;		if ( context()->proximityCheck( worldPosition(), explodeArea(), collide ) )		{			for(int i=0;i<collide.size();i++)			{				NounGame * pCollide = WidgetCast<NounGame>( collide[i].pNoun );				if ( !pCollide || pCollide == this )					continue;				if ( pCollide->canDamage( DAMAGE_ENERGY | DAMAGE_KINETIC ) &&					collide[i].fDistance < explodeArea() )				{					float damageRatio = 1.0f - (collide[i].fDistance / explodeArea());					int damage = damageRatio * explodeDamage();										if ( damage > 0 )					{						pCollide->inflictDamage( tick(), this, damage, DAMAGE_ENERGY | DAMAGE_KINETIC, 							pCollide->worldFrame() * (worldPosition() - pCollide->worldPosition()) );					}				}			}//.........这里部分代码省略.........
开发者ID:BlackYoup,项目名称:darkspace,代码行数:101,


示例16: ninja

/**   Challenge another player at ninja*/void ninja() {  //Used to store game state  NinjaState state;  state.lastACK = -1;  state.lastNACK = -1;  //Used as a timer to timeout of things  uint32_t endTime;  //Reset game packet state  ninjaPacketAvailable = false;  //Select a peer  int16_t nodeid = getPeerFromUser();  if (nodeid == -1) {    return;  }  //Up until this point we can interrupt the user  disablePopups();  //Establish game state  PeerNode peer = peers[nodeid];  state.p2nodeid = peer.nodeid;  state.p2Level = peer.level;  state.p2Name = peer.name;  //Pre-determine tiebreakers by round based on selected player  int16_t wthreshold = (100 * (ANXGetLevel() - state.p2Level + 3)) / 6;  for (uint8_t i = 0; i < 3; i++) {    state.tiebreaker[i] = random(100) <= wthreshold;  }  //Construct most of the packet now, we'll re-use it later  NinjaPacket packet;  packet.port = PORT_NINJA;  packet.src = getNodeID();  packet.dest = peer.nodeid;  packet.gameid = random(256);  //Setup game with another player  packet.type = TYPE_INIT;  packet.data = state.tiebreaker[0] << 2 | state.tiebreaker[1] << 1 | state.tiebreaker[2];  //Wait for the other player to accept  endTime = rtMillis() + 20000;  char challenge[40];  memset(challenge, '/0', 40);  sprintf(challenge, "Challenging/n%s/nLevel %d...", peer.name, peer.level);  statusDialog(challenge);  safeDisplay();  //Wait for ack  while (state.lastACK != TYPE_INIT) {    ANXRFSend(&packet, NINJA_PACKET_SIZE);    //Roughly wait 200ms until next send    for (uint8_t i = 0; i < 8; i++) {      tick();      _handlePackets(&state, &packet);      deepSleep(random(80));    }    //Quit if time expires    if (rtMillis() > endTime) {      statusDialog("Challenge/nTimed out.");      safeWaitForButton();      enablePopups();      return;    }    //Quit if NACKed by other user    if ( state.lastNACK == TYPE_INIT) {      statusDialog("Challenge/nRejected :(");      safeWaitForButton();      enablePopups();      return;    }  }  //Play the game  _doNinja(&state, &packet);}
开发者ID:ANDnXOR,项目名称:ANDnXOR_DC24_Badge,代码行数:86,


示例17: Sprite

System::System(CGEEngine *vm) : Sprite(vm, NULL), _vm(vm) {	_funDel = kHeroFun0;	setPal();	tick();}
开发者ID:dividedmind,项目名称:scummvm,代码行数:5,


示例18: main

int main(int argc, char **argv){	int N;	int nThreads;	int nColumns;	int i,j,k;	double *A,*Bi,*C,*Ci;	int BiRows, BiColumns;	CompressedMatrix *cBi;	CompressedMatrix *cCi;	double elapsed;	char printDebug;	//************ Check Input **************/	if(argc < 3){		printf("Usage: %s MaxtrixSize NumberOfThreads/n" , argv[0] );		exit(EXIT_FAILURE);	}	N = atoi(argv[1]);	if( N <= 1){		printf("MatrixSize must be bigger than 1!");		exit(EXIT_FAILURE);	}	nThreads = atoi(argv[2]);	if( nThreads <= 1){		printf("NumberOfThreads must be bigger than 1!");		exit(EXIT_FAILURE);	}	omp_set_num_threads(nThreads);	omp_set_schedule(omp_sched_dynamic, N/10);	MPI_Init(&argc, &argv);	MPI_Comm_rank(MPI_COMM_WORLD, &mpi_id);	MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);	nColumns = N / mpi_size; //For the moment depend on N being a multiple the number of MPI nodes	//************ Prepare Matrix **************/	A = (double *) malloc( N*N * sizeof(double) );	if((A == NULL) ){	  printf("Running out of memory!/n"); exit(EXIT_FAILURE);	}//	if(mpi_id != 0){//		MPI_Finalize();//		exit(0);//	}	if(mpi_id == 0)	{		printDebug = 0;		if(printDebug) printf("[%d] Generating A ...",mpi_id);		//Fill matrixes. Generate Identity like matrix for A and B , So C should result in an matrix with a single major diagonal		for(i=0; i < N; i++ ){		 for(j=0; j < N; j++){			A[i+N*j] = (i==j)?i:0.0;//			//Sparse Matrix with 10% population//			A[i+N*j] = rand()%10;//			if(A[i+N*j] == 0)//				A[i+N*j] = rand()%10;//			else//				A[i+N*j] = 0;		 }		}//		printMatrix(A, N, nColumns);//		cA = compressMatrix(A, N, nColumns);//		printCompressedMatrix(cA);//		uncompressMatrix(cA, &Bi, &i, &j);//		printMatrix(Bi, i, j);////		MPI_Finalize();//		exit(0);		tick();		if(printDebug) printf("[%d] Broadcasting A ...",mpi_id);		MPI_Bcast( A, N*N, MPI_DOUBLE, 0, MPI_COMM_WORLD);		if(printDebug) printf("[%d] Generating B ...",mpi_id);		double* B; CompressedMatrix* cB;		B = (double *) malloc( N*N * sizeof(double) );		for(i=0; i < N; i++ ){		 for(j=0; j < N; j++){			B[j+N*i] = (i==j)?1.0:0.0;		 }		}		if(printDebug) printf("[%d] Compressing and distributing Bi ...",mpi_id);		cB = compressMatrix(B, N, N);		for(i=1; i < mpi_size; i++){			mpiSendCompressedMatrix(cB, i*nColumns, (i+1)*nColumns, i);		}		//Fake shorten cB//.........这里部分代码省略.........
开发者ID:mapa17,项目名称:teacup,代码行数:101,


示例19: score

void TempoText::updateRelative()      {      qreal tempoBefore = score()->tempo(tick() - 1);      setTempo(tempoBefore * _relative);      }
开发者ID:Gai-Luron,项目名称:MuseScore,代码行数:5,


示例20: KXmlGuiWindow

//.........这里部分代码省略.........	qw_ok_button->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);		QVBoxLayout *qw_buttons_layout = new QVBoxLayout;	KPushButton *qw_top_button     = new KPushButton(KIcon("go-top"),      "", queue_window);	KPushButton *qw_up_button      = new KPushButton(KIcon("go-up"),       "", queue_window);	KPushButton *qw_down_button    = new KPushButton(KIcon("go-down"),     "", queue_window);	KPushButton *qw_bottom_button  = new KPushButton(KIcon("go-bottom"),   "", queue_window);	KPushButton *qw_remove_button  = new KPushButton(KIcon("edit-delete"), "", queue_window);	qw_buttons_layout->addWidget(qw_top_button);	qw_buttons_layout->addWidget(qw_up_button);	qw_buttons_layout->addWidget(qw_down_button);	qw_buttons_layout->addWidget(qw_bottom_button);	qw_buttons_layout->addWidget(qw_remove_button);		QHBoxLayout *qw_list_buttons_layout = new QHBoxLayout;	qw_queue_list = new KListWidget(queue_window);	QWidget *qw_button_holder = new QWidget(queue_window);	qw_button_holder->setLayout(qw_buttons_layout);	qw_list_buttons_layout->addWidget(qw_queue_list);	qw_list_buttons_layout->addWidget(qw_button_holder);		QVBoxLayout *qwLayout = new QVBoxLayout;	QWidget *qw_list_buttons = new QWidget(queue_window);	qw_list_buttons->setLayout(qw_list_buttons_layout);	qwLayout->addWidget(qw_list_buttons);	qwLayout->addWidget(qw_ok_button, 0, Qt::AlignCenter);	queue_window->setLayout(qwLayout);		//SETUP ACTIONS 	KStandardAction::quit(kapp, SLOT(quit()), actionCollection());	connect(kapp, SIGNAL(aboutToQuit()), this, SLOT(quit()));	connect(now_playing, SIGNAL(aboutToFinish()), this, SLOT(enqueueNext()));	connect(now_playing, SIGNAL(totalTimeChanged(qint64)), this, SLOT(updateDuration(qint64)));	connect(now_playing, SIGNAL(tick(qint64)), this, SLOT(tick(qint64)));	KAction *openFilesAction = setupKAction("document-open", i18n("Open"), i18n("Load the selected files"), "files");	openFilesAction->setShortcut(QKeySequence::Open);	connect(openFilesAction, SIGNAL(triggered(bool)), this, SLOT(loadFiles()));	KAction *openDirectoryAction = setupKAction("document-open-folder", i18n("Open Directory..."), i18n("Load all files in the selected directory and its subdirectories"), "directory");	openDirectoryAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D));	connect(openDirectoryAction, SIGNAL(triggered(bool)), this, SLOT(loadDirectory()));	KAction *previousAction = setupKAction("media-skip-backward", i18n("Previous"), previousHelpText, "previous");	previousAction->setShortcut(QKeySequence(Qt::Key_Z));	connect(previousAction, SIGNAL(triggered(bool)), this, SLOT(previous()));	connect(tb_previousAction, SIGNAL(triggered(bool)), this, SLOT(previous()));	KAction *pauseAction = setupKAction("media-playback-pause", i18n("Pause"), plauseHelpText, "pause");	pauseAction->setShortcut(QKeySequence(Qt::Key_C));	connect(pauseAction, SIGNAL(triggered(bool)), this, SLOT(pause()));	connect(tb_pauseAction, SIGNAL(triggered(bool)), this, SLOT(pause()));	KAction *playAction = setupKAction("media-playback-start", i18n("Play"), playHelpText, "play");	playAction->setShortcut(QKeySequence(Qt::Key_X));	connect(playAction, SIGNAL(triggered(bool)), this, SLOT(play()));	connect(tb_playAction, SIGNAL(triggered(bool)), this, SLOT(play()));	KAction *nextAction = setupKAction("media-skip-forward", i18n("Next"), nextHelpText, "next");	nextAction->setShortcut(QKeySequence(Qt::Key_V));	connect(nextAction, SIGNAL(triggered(bool)), this, SLOT(next()));	connect(tb_nextAction, SIGNAL(triggered(bool)), this, SLOT(next()));	KAction *queueAction = setupKAction("go-next-view", i18n("Queue Track"), "Enqueue the current track", "queue");	queueAction->setShortcut(QKeySequence(Qt::Key_Q));	connect(queueAction, SIGNAL(triggered(bool)), this, SLOT(queue()));	shuffleAction = setupKAction("media-playlist-shuffle", i18n("Suffle"), "The next track will be random when checked", "shuffle");	shuffleAction->setCheckable(true);	connect(shuffleAction, SIGNAL(triggered(bool)), this, SLOT(shuffle(bool)));	KAction *viewCurrentTrackAction = setupKAction("go-last", i18n("Current Track"), i18n("Show the Current Track in the Playlist"), "current_track");	connect(viewCurrentTrackAction, SIGNAL(triggered(bool)), this, SLOT(viewCurrentTrack()));	KAction *viewTrackDetailsAction = setupKAction("view-media-lyrics", i18n("Track Details"), i18n("View the playing track's metadata"), "track_details");	connect(viewTrackDetailsAction, SIGNAL(triggered(bool)), this, SLOT(viewTrackDetails()));
开发者ID:detaos,项目名称:projekt7,代码行数:67,


示例21: while

void DSP::enter() {  while(true) {    if(scheduler.sync.i == Scheduler::SynchronizeMode::All) {      scheduler.exit(Scheduler::ExitReason::SynchronizeEvent);    }    voice_5(voice[0]);    voice_2(voice[1]);    tick();    voice_6(voice[0]);    voice_3(voice[1]);    tick();    voice_7(voice[0]);    voice_4(voice[1]);    voice_1(voice[3]);    tick();    voice_8(voice[0]);    voice_5(voice[1]);    voice_2(voice[2]);    tick();    voice_9(voice[0]);    voice_6(voice[1]);    voice_3(voice[2]);    tick();    voice_7(voice[1]);    voice_4(voice[2]);    voice_1(voice[4]);    tick();    voice_8(voice[1]);    voice_5(voice[2]);    voice_2(voice[3]);    tick();    voice_9(voice[1]);    voice_6(voice[2]);    voice_3(voice[3]);    tick();    voice_7(voice[2]);    voice_4(voice[3]);    voice_1(voice[5]);    tick();    voice_8(voice[2]);    voice_5(voice[3]);    voice_2(voice[4]);    tick();    voice_9(voice[2]);    voice_6(voice[3]);    voice_3(voice[4]);    tick();    voice_7(voice[3]);    voice_4(voice[4]);    voice_1(voice[6]);    tick();    voice_8(voice[3]);    voice_5(voice[4]);    voice_2(voice[5]);    tick();    voice_9(voice[3]);    voice_6(voice[4]);    voice_3(voice[5]);    tick();    voice_7(voice[4]);    voice_4(voice[5]);    voice_1(voice[7]);    tick();    voice_8(voice[4]);    voice_5(voice[5]);    voice_2(voice[6]);    tick();    voice_9(voice[4]);    voice_6(voice[5]);    voice_3(voice[6]);    tick();    voice_1(voice[0]);    voice_7(voice[5]);    voice_4(voice[6]);    tick();    voice_8(voice[5]);    voice_5(voice[6]);    voice_2(voice[7]);    tick();    voice_9(voice[5]);//.........这里部分代码省略.........
开发者ID:libretro,项目名称:bsnes-libretro-cplusplus98,代码行数:101,


示例22: RollupWidget

AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent) :	RollupWidget(parent),	ui(new Ui::AMDemodGUI),	m_pluginAPI(pluginAPI),	m_deviceAPI(deviceAPI),	m_channelMarker(this),	m_basicSettingsShown(false),	m_doApplySettings(true),	m_squelchOpen(false){	ui->setupUi(this);	setAttribute(Qt::WA_DeleteOnClose, true);	connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));	connect(this, SIGNAL(menuDoubleClickEvent()), this, SLOT(onMenuDoubleClicked()));	m_amDemod = new AMDemod();	m_channelizer = new DownChannelizer(m_amDemod);	m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);	//m_pluginAPI->addThreadedSink(m_threadedChannelizer);    m_deviceAPI->addThreadedSink(m_threadedChannelizer);	connect(&m_pluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms	ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));	ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);	//m_channelMarker = new ChannelMarker(this);	m_channelMarker.setColor(Qt::yellow);	m_channelMarker.setBandwidth(5000);	m_channelMarker.setCenterFrequency(0);	m_channelMarker.setVisible(true);	connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));	m_deviceAPI->registerChannelInstance(m_channelID, this);    m_deviceAPI->addChannelMarker(&m_channelMarker);    m_deviceAPI->addRollupWidget(this);	applySettings();}
开发者ID:f4exb,项目名称:sdrangel,代码行数:40,


示例23: tick

 void SmoothValue::process() {   for (int i = 0; i < buffer_size_; ++i)     outputs_[0]->buffer[i] = tick(); }
开发者ID:AndroidMarv,项目名称:cursynth,代码行数:4,


示例24: setPos

void TimeSig::layout()      {      setPos(0.0, 0.0);      qreal _spatium = spatium();      setbbox(QRectF());                  // prepare for an empty time signature      pointLargeLeftParen = QPointF();      pz = QPointF();      pn = QPointF();      pointLargeRightParen = QPointF();      qreal lineDist;      int   numOfLines;      TimeSigType sigType = timeSigType();      Staff* _staff       = staff();      if (_staff) {            // if staff is without time sig, format as if no text at all            if (!_staff->staffType(tick())->genTimesig() ) {                  // reset position and box sizes to 0                  // qDebug("staff: no time sig");                  pointLargeLeftParen.rx() = 0.0;                  pn.rx() = 0.0;                  pz.rx() = 0.0;                  pointLargeRightParen.rx() = 0.0;                  setbbox(QRectF());                  // leave everything else as it is:                  // draw() will anyway skip any drawing if staff type has no time sigs                  return;                  }            numOfLines  = _staff->lines(tick());            lineDist    = _staff->lineDistance(tick());            }      else {            // assume dimensions of a standard staff            lineDist = 1.0;            numOfLines = 5;            }      // if some symbol      // compute vert. displacement to center in the staff height      // determine middle staff position:      qreal yoff = _spatium * (numOfLines-1) *.5 * lineDist;      // C and Ccut are placed at the middle of the staff: use yoff directly      if (sigType ==  TimeSigType::FOUR_FOUR) {            pz = QPointF(0.0, yoff);            setbbox(symBbox(SymId::timeSigCommon).translated(pz));            ns.clear();            ns.push_back(SymId::timeSigCommon);            ds.clear();            }      else if (sigType == TimeSigType::ALLA_BREVE) {            pz = QPointF(0.0, yoff);            setbbox(symBbox(SymId::timeSigCutCommon).translated(pz));            ns.clear();            ns.push_back(SymId::timeSigCutCommon);            ds.clear();            }      else {            ns = toTimeSigString(_numeratorString.isEmpty()   ? QString::number(_sig.numerator())   : _numeratorString);            ds = toTimeSigString(_denominatorString.isEmpty() ? QString::number(_sig.denominator()) : _denominatorString);            ScoreFont* font = score()->scoreFont();            QSizeF mag(magS() * _scale);            QRectF numRect = font->bbox(ns, mag);            QRectF denRect = font->bbox(ds, mag);            // position numerator and denominator; vertical displacement:            // number of lines is odd: 0.0 (strings are directly above and below the middle line)            // number of lines even:   0.05 (strings are moved up/down to leave 1/10sp between them)            qreal displ = (numOfLines & 1) ? 0.0 : (0.05 * _spatium);            //align on the wider            qreal pzY = yoff - (denRect.width() < 0.01 ? 0.0 : (displ + numRect.height() * .5));            qreal pnY = yoff + displ + denRect.height() * .5;            if (numRect.width() >= denRect.width()) {                  // numerator: one space above centre line, unless denomin. is empty (if so, directly centre in the middle)                  pz = QPointF(0.0, pzY);                  // denominator: horiz: centred around centre of numerator | vert: one space below centre line                  pn = QPointF((numRect.width() - denRect.width())*.5, pnY);                  }            else {                  // numerator: one space above centre line, unless denomin. is empty (if so, directly centre in the middle)                  pz = QPointF((denRect.width() - numRect.width())*.5, pzY);                  // denominator: horiz: centred around centre of numerator | vert: one space below centre line                  pn = QPointF(0.0, pnY);                  }            // centering of parenthesis so the middle of the parenthesis is at the divisor marking level            int centerY = yoff/2 + _spatium;            int widestPortion = numRect.width() > denRect.width() ? numRect.width() : denRect.width();            pointLargeLeftParen = QPointF(-_spatium, centerY);            pointLargeRightParen = QPointF(widestPortion + _spatium, centerY);            setbbox(numRect.translated(pz));   // translate bounding boxes to actual string positions//.........这里部分代码省略.........
开发者ID:akdor1154,项目名称:MuseScore,代码行数:101,


示例25: tick

void ToyMetroWidget::onTick(int pos){	emit tick(this, pos);}
开发者ID:richardwilliamson,项目名称:OSCWidgets,代码行数:4,


示例26: gst_pipeline_get_bus

void NPlaybackEngineGStreamer::checkStatus(){	GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(m_playbin));	GstMessage *msg;	while ((msg = gst_bus_pop_filtered(bus, GstMessageType(GST_MESSAGE_EOS | GST_MESSAGE_ERROR))) != NULL) {		switch (GST_MESSAGE_TYPE(msg)) {			case GST_MESSAGE_EOS: {				stop();				emit finished();				emit stateChanged(m_oldState = N::PlaybackStopped);				break;			}			case GST_MESSAGE_ERROR: {				gchar *debug;				GError *err = NULL;				gst_message_parse_error(msg, &err, &debug);				g_free(debug);				emit message(QMessageBox::Critical, QFileInfo(m_currentMedia).absoluteFilePath(), err ? QString::fromUtf8(err->message) : "unknown error");				fail();				if (err)					g_error_free(err);				break;			}			default:				break;		}		gst_message_unref(msg);	}	gst_object_unref(bus);	GstState gstState;	if (gst_element_get_state(m_playbin, &gstState, NULL, 0) != GST_STATE_CHANGE_SUCCESS)		return;	N::PlaybackState state = fromGstState(gstState);	if (m_oldState != state)		emit stateChanged(m_oldState = state);	if (state == N::PlaybackPlaying || state == N::PlaybackPaused) {		// duration may change for some reason		// TODO use DURATION_CHANGED in gstreamer1.0		gboolean res = gst_element_query_duration(m_playbin, GST_FORMAT_TIME, &m_durationNsec);		if (!res)			m_durationNsec = 0;	}	if (m_posponedPosition >= 0 && m_durationNsec > 0) {		setPosition(m_posponedPosition);		m_posponedPosition = -1;		emit positionChanged(m_posponedPosition);	} else {		qreal pos;		gint64 gstPos = 0;		if (!hasMedia() || m_durationNsec <= 0) {			pos = -1;		} else {			gboolean res = gst_element_query_position(m_playbin, GST_FORMAT_TIME, &gstPos);			if (!res)				gstPos = 0;			pos = (qreal)gstPos / m_durationNsec;		}		if (m_oldPosition != pos) {			if (m_oldPosition > pos)				m_crossfading = false;			m_oldPosition = pos;			emit positionChanged(m_crossfading ? 0 : m_oldPosition);		}		emit tick(m_crossfading ? 0 : gstPos / NSEC_IN_MSEC);	}	qreal vol = volume();	if (qAbs(m_oldVolume - vol) > 0.0001) {		m_oldVolume = vol;		emit volumeChanged(vol);	}	if (state == N::PlaybackStopped)		m_timer->stop();}
开发者ID:susnux,项目名称:nulloy,代码行数:84,


示例27: tick

void Stopwatch::computeOverhead() {    cycleOverhead = 0;    tick();    tock();    cycleOverhead = elapsedCycles();}
开发者ID:madisodr,项目名称:legacy-core,代码行数:6,


示例28: reset

		void reset()		{			deltaStart_ = start_ = tick();		}
开发者ID:NextGenIntelligence,项目名称:virtualgo,代码行数:4,



注:本文中的tick函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ tick_broadcast_start_periodic函数代码示例
C++ ticalcs_info函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。