void Seq::setScoreView(ScoreView* v) { if (oggInit) { ov_clear(&vf); oggInit = false; } if (cv !=v && cs) { unmarkNotes(); stopWait(); } cv = v; cs = cv ? cv->score() : 0; if (!heartBeatTimer->isActive()) heartBeatTimer->start(20); // msec playlistChanged = true; _synti->reset(); if (cs) { // _synti->setState(cs->synthesizerState()); initInstruments(); seek(cs->playPos()); } tackRest = 0; tickRest = 0; }
void Seq::setScoreView(ScoreView* v) { if (oggInit) { ov_clear(&vf); oggInit = false; } if (cv !=v && cs) { unmarkNotes(); stopWait(); } cv = v; if (cs) disconnect(cs, SIGNAL(playlistChanged()), this, SLOT(setPlaylistChanged())); cs = cv ? cv->score() : 0; if (!heartBeatTimer->isActive()) heartBeatTimer->start(20); // msec playlistChanged = true; _synti->reset(); if (cs) { initInstruments(); connect(cs, SIGNAL(playlistChanged()), this, SLOT(setPlaylistChanged())); } }
void CPosixThreadImpl::stop(unsigned int nTimeoutToKillMs) { stopWait(); //TODO: wait for nTimeoutToKill and kill thread void* status; pthread_join(m_thread,&status); }
void CThreadQueue::addQueueCommandToFront(IQueueCommand* pCmd) { addQueueCommandToFrontInt(pCmd); if ( isNoThreadedMode() ) processCommands(); else if ( isAlive() ) stopWait(); }
void Seq::exit() { if (_driver) { if (MScore::debugMode) qDebug("Stop I/O\n"); stopWait(); delete _driver; _driver = 0; } }
void CPosixThreadImpl::stop(unsigned int nTimeoutToKill) { stopWait(); //TODO: wait for nTimeoutToKill and kill thread void* status; pthread_join(m_thread,&status); pthread_cond_destroy(&m_condSync); }
void Seq::exit() { if (driver) { if (debugMode) qDebug("Stop I/O\n"); stopWait(); delete driver; driver = 0; } }
void CClientRegister::startUp() { if ( RHOCONF().getString("syncserver").length() > 0 ) { LOG(INFO) + "Starting ClientRegister..."; start(epLow); stopWait(); } }
bool CNetworkDetectionBase::SetNetworkPollInterval(int iInterval) { if (iInterval >= NETWORK_DETECT_MINIMUM_POLL_INTERVAL) { m_iNetworkPollInterval = iInterval; if (isWaiting()) stopWait(); return true; } else { LOG(INFO) + "Network Poll Interval property ignored, value is too small, it must be more than " + NETWORK_DETECT_MINIMUM_POLL_INTERVAL; return false; } }
void CRhoThreadImpl::stop(unsigned int nTimeoutToKillMs) { stopWait(); if ( m_hThread ) { DWORD dwRes = ::WaitForSingleObject( m_hThread, nTimeoutToKillMs ); if ( dwRes != WAIT_OBJECT_0 ) { LOG(INFO) + "Terminate thread. ID: " + ::GetCurrentThreadId() + "; Result: " + dwRes; ::TerminateThread(m_hThread,0); } ::CloseHandle(m_hThread); m_hThread = null; } }
bool VpeMain::reallyClose() { WRect rect; show( WWinStateShowNormal ); if( _quitAnyways || okToQuit() ) { startWait(); clearProject(); stopWait(); // write out .INI file stuff char buff[_MAX_PATH]; _ini.write( IDE_INI_IDENTIFIER, IDE_INI_EDITOR, (char*)_editor.gets() ); _ini.write( IDE_INI_IDENTIFIER, IDE_INI_EDITOR_ISDLL, _editorIsDll ? "1" : "0" ); _ini.write( IDE_INI_IDENTIFIER, IDE_INI_EDITOR_PARMS, _editorParms.gets() ); for( int i=0; i<_oldProjects.count(); i++ ) { itoa( i+1, buff, 10 ); _ini.write( IDE_INI_IDENTIFIER, buff, (const char*)*((WFileName*)_oldProjects[i]) ); } _ini.write( IDE_INI_IDENTIFIER, IDE_INI_TOOLBAR, _toolBarActive ? "1" : "0" ); _ini.write( IDE_INI_IDENTIFIER, IDE_INI_STATWND, (_statusBar != NULL) ? "1" : "0" ); _ini.write( IDE_INI_IDENTIFIER, IDE_INI_AUTOREFRESH, _autoRefresh ? "1" : "0" ); getRectangle( rect ); itoa( rect.w(), buff, 10 ); _ini.write( IDE_INI_IDENTIFIER, IDE_INI_WIDTH, buff ); itoa( rect.h(), buff, 10 ); _ini.write( IDE_INI_IDENTIFIER, IDE_INI_HEIGHT, buff ); itoa( rect.x(), buff, 10 ); _ini.write( IDE_INI_IDENTIFIER, IDE_INI_X, buff ); itoa( rect.y(), buff, 10 ); _ini.write( IDE_INI_IDENTIFIER, IDE_INI_Y, buff ); if( _otherhelp != NULL ) { delete _otherhelp; _otherhelp = NULL; } delete _help; _help = NULL; return( true ); } return( false ); }
void Seq::setScoreView(ScoreView* v) { if (cv !=v && cs) { cs->setSyntiState(synti->state()); markedNotes.clear(); stopWait(); } cv = v; cs = cv ? cv->score() : 0; if (!heartBeatTimer->isActive()) heartBeatTimer->start(1000/guiRefresh); playlistChanged = true; synti->reset(); if (cs) { synti->setState(cs->syntiState()); initInstruments(); seek(cs->playPos()); } tackRest = 0; tickRest = 0; }
bool VpeMain::executeOne( const WString& cmd ) { int i = 0; WWindowState wstate = WWinStateShowNormal; WWindowType wtype = WWinTypeDefault; if( strnicmp( cmd, "!FullScreen ", 12 ) == 0 ) { i += 12; wtype = WWinTypeFullScreen; } else if( strnicmp( cmd, "!Windowed ", 10 ) == 0 ) { i += 10; wtype = WWinTypeWindowed; } else if( strnicmp( cmd, "!Hidden ", 8 ) == 0 ) { i += 10; wstate = WWinStateHide; } int ret = WSystemService::sysExec( &cmd[i], wstate, wtype ); stopWait(); #ifdef __OS2__ if( ret == -1 ) { // this is a kludge because the WMessageDialog can only handle // finitely long strings WString cmdmsg; cmdmsg = cmd; cmdmsg.truncate( MAX_CMD_LINE ); // // WARNING - this may stop working if WCLASS modifies errno // WMessageDialog::messagef( this, MsgError, MsgOk, _viperError, "Unable to run %s: %s.", (const char*)cmdmsg, strerror( errno ) ); return( false ); } #endif #if defined( __WINDOWS__ ) || defined ( __NT__ ) if( ret <= 32 ) { // this is a kludge because the WMessageDialog can only handle // finitely long strings WString cmdmsg; cmdmsg = cmd; cmdmsg.truncate( MAX_CMD_LINE ); switch( ret ) { case 0: WMessageDialog::messagef( this, MsgError, MsgOk, _viperError, "%s: Out of memory.", (const char*)cmdmsg ); break; case 2: WMessageDialog::messagef( this, MsgError, MsgOk, _viperError, "%s: Program or one of its components not found.", (const char*)cmdmsg ); break; case 3: WMessageDialog::messagef( this, MsgError, MsgOk, _viperError, "%s: Path not found.", (const char*)cmdmsg ); break; case 16: WMessageDialog::messagef( this, MsgError, MsgOk, _viperError, "%s: Contains multiple writeable data segments.", (const char*)cmdmsg ); break; default: WMessageDialog::messagef( this, MsgError, MsgOk, _viperError, "%s: return code=%d.", (const char*)cmdmsg, ret ); } return( false ); } #endif return( true ); }
void Scene::setbg_3(){ QString load; if(difficulty==4) load=":/pics/pics/bg_oni.png"; else if(difficulty==3) load=":/pics/pics/bg_hard.png"; else if(difficulty==2) load=":/pics/pics/bg_normal.png"; else load=":/pics/pics/bg_easy.png"; QImage bg; bg.load(load); bg = bg.scaled(770,400); this->setBackgroundBrush(bg); text1->setText(title[s]); text1->setPos(488,9); addItem(text1); Map.setSongPlay(title[s]); track = new QMediaPlayer(this); track->setMedia(QUrl::fromLocalFile(QDir::toNativeSeparators(Map.trackPath))); VOL=(Map.map["SONGVOL"]-Map.map["SEVOL"])>0?(Map.map["SONGVOL"]-Map.map["SEVOL"]+50):70; track->setVolume(VOL); BPM=Map.map["BPM"]; Map.getMap(title[s],Map.star[difficulty-1]); Map.convert(setRandom); if(setRandom==true){ QPixmap ran; ran.load(":/pics/pics/optionicon_random.png"); randomTag = new QGraphicsPixmapItem; randomTag->setPos(199,83); randomTag->setPixmap(ran); addItem(randomTag); } if(setAuto==true){ QPixmap au; au.load(":/pics/pics/optionicon_auto.png"); autoTag = new QGraphicsPixmapItem; autoTag->setPos(394,72); autoTag->setPixmap(au); addItem(autoTag); } if(set30secMode==true){ QPixmap ctd; ctd.load(":/pics/pics/optionicon_demo.png"); countdownTag = new QGraphicsPixmapItem; countdownTag->setPos(294,72); countdownTag->setPixmap(ctd); addItem(countdownTag); countdown = new QTimer(this); QObject::connect(countdown , SIGNAL(timeout()) , this , SLOT(secondsLeft())); } songMap=Map.songMap; foreach (QString i, songMap) { qDebug()<<i<<endl; } RD = new QTimer(this); LD = new QTimer(this); RK = new QTimer(this); LK = new QTimer(this); rdp = new QGraphicsPixmapItem;ldp = new QGraphicsPixmapItem; rkp = new QGraphicsPixmapItem;lkp = new QGraphicsPixmapItem; QPixmap res; res.load(":/pics/pics/rd.png"); rdp->setPixmap(res);rdp->setPos(147,123); res.load(":/pics/pics/ld.png"); ldp->setPixmap(res);ldp->setPos(106,123); res.load(":/pics/pics/rk.png"); rkp->setPixmap(res);rkp->setPos(147,124); res.load(":/pics/pics/lk.png"); lkp->setPixmap(res);lkp->setPos(105,124); for(int i=0;i<4;i++){ add[i]=false; } QObject::connect(this , SIGNAL(PlayRdong()) , this , SLOT(playRdong())); QObject::connect(this , SIGNAL(PlayLdong()) , this , SLOT(playLdong())); QObject::connect(this , SIGNAL(PlayRka()) , this , SLOT(playRka())); QObject::connect(this , SIGNAL(PlayLka()) , this , SLOT(playLka())); QObject::connect(RD , SIGNAL(timeout()) , this , SLOT(playRdong())); QObject::connect(LD , SIGNAL(timeout()) , this , SLOT(playLdong())); QObject::connect(RK , SIGNAL(timeout()) , this , SLOT(playRka())); QObject::connect(LK , SIGNAL(timeout()) , this , SLOT(playLka())); AniTimer1 = new QTimer(this); QObject::connect(AniTimer1 , SIGNAL(timeout()) , this , SLOT(moveJudgement())); QObject::connect(AniTimer1 , SIGNAL(timeout()) , this , SLOT(FlySoul())); QObject::connect(AniTimer1 , SIGNAL(timeout()) , this , SLOT(MidSoul())); QObject::connect(AniTimer1 , SIGNAL(timeout()) , this , SLOT(WalkSoul())); QObject::connect(this , SIGNAL(Great()) , this , SLOT(GenGreat())); QObject::connect(this , SIGNAL(Good()) , this , SLOT(GenGood())); QObject::connect(this , SIGNAL(Miss()) , this , SLOT(GenMiss())); QObject::connect(this , SIGNAL(Combo()) , this , SLOT(ShowCombo())); QObject::connect(this , SIGNAL(Score()) , this , SLOT(ShowScore())); QObject::connect(this , SIGNAL(Jump()) , this , SLOT(donJump())); QObject::connect(this , SIGNAL(SoulF()) , this , SLOT(GenFlySoul())); QObject::connect(this , SIGNAL(SoulM()) , this , SLOT(GenMidSoul())); QObject::connect(this , SIGNAL(SoulW()) , this , SLOT(GenWalkSoul())); ex1.load(":/pics/pics/explosion_s4.png"); AniTimer2 = new QTimer(this); QObject::connect(AniTimer2 , SIGNAL(timeout()) , this , SLOT(RemoveExplode())); QObject::connect(this , SIGNAL(Explode()) , this , SLOT(GenExplode())); AniTimer3 = new QTimer(this); QObject::connect(AniTimer3 , SIGNAL(timeout()) , this , SLOT(Jumper())); jumper = new QGraphicsPixmapItem; jumper->setPos(0,0); addItem(jumper); AniTimer4 = new QTimer(this); QObject::connect(AniTimer4 , SIGNAL(timeout()) , this , SLOT(Dance())); loadDancerPic(); createDanceItem(); great=0;good=0;miss=0; combo=0;maxcombo=0;soul=0,score=0; secLeft=30;jumpPicNum=1; msec=60000/BPM/4+2; test=60000/BPM/16; waitfor=109*test/2+Map.map["OFFSET"]*1000; for(int i=0;i<10;i++){ numberPic[i].load(":/pics/pics/number_"+QString::number(i)+".png"); } for(int i=0;i<10;i++){ ctdnumberPic[i].load(":/pics/pics/number_"+QString::number(i)+".png"); } for(int i=0;i<10;i++){ scorenumberPic[i].load(":/pics/pics/scorenumber_"+QString::number(i)+".png"); } for(int i=50;i<1000;i+=100){ QSound *so; QString c; c=QString::number(i); so = new QSound(":/sound/sound/voice_"+c+"combo.wav"); comTrack.push_back(so); if(i==50)i+=50; } for(int i=0;i<3;i++){ jumpPic[i].load(":/pics/pics/playerchar_normal"+QString::number(i+1)+".png"); jumpPic[i] = jumpPic[i].scaled(jumpPic[i].width()*1.48,jumpPic[i].height()*1.48); } //Etimer = new QElapsedTimer; //Etimer->start(); timer = new QTimer(this); QObject::connect(timer , SIGNAL(timeout()) , this , SLOT(stopWait())); timer1 = new QTimer(this); timer2 = new QTimer(this); timer3 = new QTimer(this); cout<<"msec: "<<msec<<endl; cout<<"waitfor: "<<waitfor<<endl; QObject::connect(timer2 , SIGNAL(timeout()) , this , SLOT(Generate())); if(setAuto==false) QObject::connect(timer1 , SIGNAL(timeout()) , this , SLOT(Move())); else QObject::connect(timer1 , SIGNAL(timeout()) , this , SLOT(Auto())); QObject::connect(timer3 , SIGNAL(timeout()) , this , SLOT(startWave())); if(waitfor<0){ track->play(); timer->start(-waitfor); waitfor=0; } else timer->start(0); }
bool VpeMain::executeCommand( const char *cmdl, int location, const char* title ) { int i; if( cmdl != NULL && strlen( cmdl ) > 0 ) { WString* cur = NULL; WStringList opts; for( i=0; cmdl[i]!= '\0'; i++ ) { if( cur ) { if( cmdl[i] == '"' ) { opts.add( cur ); cur = NULL; } else { cur->concat( cmdl[i] ); } } else if( cmdl[i] == '$' && cmdl[i+1] == '"' ) { i++; cur = new WString(); } } delete cur; cur = NULL; WStringList reps; if( opts.count() > 0 ) { WString dTitle( title ); if( dTitle.size() == 0 ) dTitle = "AutoDialog"; WAutoDialog prompts( this, dTitle, opts ); if( !prompts.getInput( reps ) ) { setStatus( NULL ); return( false ); } } WString cmd; int j = 0; for( i=0; cmdl[i]!= '\0'; i++ ) { if( !cur ) { if( cmdl[i] == '$' && cmdl[i+1] == '"' ) { i++; cur = &reps.stringAt( j ); j++; } else { cmd.concat( cmdl[i] ); } } else if( cmdl[i] == '"' ) { cmd.concat( *cur ); cur = NULL; } } startWait(); switch( location ) { case EXECUTE_NORMAL: { setStatus( "Executing..." ); execute( cmd ); break; } case EXECUTE_BATCH: { runBatch( cmd ); break; } case EXECUTE_MAKE: { if( makeMake() ) { runBatch( cmd ); } break; } case EXECUTE_BROWSE: { executeBrowse( cmd ); break; } case EXECUTE_EDITOR: { executeEditor( cmd ); break; } case EXECUTE_TOUCH_ALL: { MsgRetType rc; unsigned i; VComponent *comp; rc = WMessageDialog::messagef( this, MsgQuestion, MsgYesNo, _viperRequest, "Do you really want to remake all targets and their components?" ); if( rc == MsgRetYes ) { i = _compViews.count(); while( i > 0 ) { comp = (VComponent *)_compViews[i-1]; comp->touchComponent( true ); i--; } } break; } case EXECUTE_HELP: { if( _otherhelp == NULL ) { delete _otherhelp; } _otherhelp = new WSystemHelp( this, "", cmd ); _otherhelp->sysHelpContent(); break; } } stopWait(); setStatus( NULL ); if( _quitAnyways ) { exit( NULL ); } } return( true ); }
void KRPleaseWaitHandler::killJob() { if (!job.isNull()) job->kill(KJob::EmitResult); stopWait(); _wasCancelled = true; }
void CThreadQueue::setPollInterval(int nInterval) { m_nPollInterval = nInterval; if ( isAlive() ) stopWait(); }