void Display::OnCancel() { log.WriteString("\n Closing the dialog box"); //Stop the recording and playing threads if(record->recording==TRUE) record->PostThreadMessage(WM_RECORDSOUND_STOPRECORDING,0,0); record->PostThreadMessage(WM_RECORDSOUND_ENDTHREAD,0,0); if(play->Playing==TRUE) play->PostThreadMessage(WM_PLAYSOUND_STOPPLAYING,0,0); play->PostThreadMessage(WM_PLAYSOUND_ENDTHREAD,0,0); write->PostThreadMessage(WM_WRITESOUND_ENDTHREAD,0,0); if(sockclt.closeflag==1) { showFlash(); MessageBox("Server has shutdown"); } if(isconnected==TRUE) sockclt.Close(); CDialog::OnCancel(); }
void SystemTrayIconBase::showFlash(const QString &iconName, const QString &toolTip, QMenu *menu, int millisecondsTimeoutHint) { QIcon ico = ImageResourceBase::createIcon(iconName); showFlash(ico, toolTip, menu, millisecondsTimeoutHint); }
bool FlashScene::init() { if ( !LayerColor::initWithColor(Color4B::WHITE) ) { return false; } loadedGameData = false; goToMenu = false; showFlash(); this->scheduleUpdate(); return true; }
SelectFile::SelectFile(QWidget *parent) : QDialog(parent),currentHeight(1), ui(new Ui::SelectFile) { ui->setupUi(this); setWindowFlags(Qt::FramelessWindowHint); QPixmap mask(":/Images/images/ui_selectfile.png");//加载掩码图像 setMask(QBitmap(mask.mask())); //设置窗体的掩码图像,抠除图像的白色区域实现不规则窗体 QPalette p;//设置调色板 p.setBrush(QPalette::Window, QBrush(mask));//将调色板的画刷设置为掩码位图,在不规则窗体上显示出掩码位图 setPalette(p); //添加渐变动画 QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity"); //动画对象类型:渐变 animation->setDuration(1000); //维持1秒 animation->setStartValue(0); //起始α值 animation->setEndValue(1); //结束α值 animation->start(); //动画开始 ui->label_5->hide(); loadMovie=new QMovie(":/Images/images/loading_2.gif"); ui->label_5->setMovie(loadMovie); ui->pushButton_4->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_select_work_normal.png);}" "QPushButton:hover{border-image: url(:/Images/images/pb_select_work_hover.png);}" "QPushButton:pressed{border-image: url(:/Images/images/pb_select_work_press.png);}"); ui->pushButton_5->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_mainui_close_normal.png);}" "QPushButton:hover{border-image: url(:/Images/images/pb_mainui_close_hover.png);}" "QPushButton:pressed{border-image: url(:/Images/images/pb_mainui_close_press.png);}"); timer_Expand = new QTimer() ; timer_Expand->start(5); connect(timer_Expand,SIGNAL(timeout()),this,SLOT(showFlash())); m_fsw = new QFileSystemWatcher; connect(m_fsw, SIGNAL(directoryChanged(QString)), this,SLOT(copyFile(QString))); QDir dir; root_path = QDir::currentPath() + "//release"; ; }
void Display::updateList(CString mesg) { int index,num,prevcount; CString name; static int first=0; CString disp; //Clear the combo box contents prevcount=cbox->GetCount(); cbox->ResetContent(); do { index=mesg.Find(';'); if(index==-1) break; name=mesg.Left(index); if(name.CompareNoCase(sockclt.name)!=0) cbox->AddString(name); mesg=mesg.Right(mesg.GetLength()-index-1); } while(TRUE); if(cbox->GetCount()==1) { cbox->SetCurSel(0); cbox->GetLBText(0,curuser); selectflag=1; if(prevcount==0 && first==1) { showFlash(); disp="New user " + curuser + " logged in"; SetDlgItemText(6051,(char*)(LPCTSTR)disp); } } first=1; if(cbox->GetCount()>1) { if(curuser.IsEmpty()==FALSE) { if((num=cbox->FindStringExact(-1,curuser))>=0) { selectflag=1; cbox->SetCurSel(num); return; } } selectflag=0; OnStop(); // stopRecording(); cbox->SetCurSel(0); if(curuser.IsEmpty()==FALSE && curuser!="ALL" ) { showFlash(); disp=curuser+" logged out \n Please select the user"; SetDlgItemText(6051,(char*)(LPCTSTR)disp); // MessageBox(curuser+" logged out ......Please select the user"); } else if(curuser!="ALL") { showFlash(); disp="New user logged in"; SetDlgItemText(6051,(char*)(LPCTSTR)disp); //MessageBox("New user logged in...."); } } if(cbox->GetCount()==0) { OnStop(); //stopRecording(); //stopPlaying(); //******* REMOVED *******// if(curuser.IsEmpty()==FALSE && curuser!="ALL") { showFlash(); disp=curuser+" logged out"; SetDlgItemText(6051,(char*)(LPCTSTR)disp); // MessageBox(curuser+" logged out"); } //SetDlgItemText(6051,""); //from->ResetContent(); //Clear the From Listbox curuser.Empty(); } }
void Display::Receive() { char buff[PLAYBUFFER+25],str[PLAYBUFFER+60]; int size=PLAYBUFFER+20,rcount,index,i,j,length; CString mesg,header,disp; rcount=sockclt.Receive(buff,size); if(rcount==SOCKET_ERROR) { log.WriteString("\nError in Receiving the data"); return; } if(rcount>(PLAYBUFFER+20)) { log.WriteString("\nMesg size exceeded buffer capacity"); return; } buff[rcount]=NULL; mesg=buff; // sprintf(str,"Received data len= %d , %s ",rcount,&buff[20]); // log.WriteString(str); index=mesg.Find(':'); //Invalid message Format --must have atleast one tag if(index==-1) return; header=mesg.Left(index); //Check if server has sent the list of clients if(header=="USER") { mesg=mesg.Right(mesg.GetLength()-index-1); updateList(mesg); return; } if(header=="WAIT") { if(isstart==0) //stop the chat OnStop(); start->EnableWindow(FALSE); mesg=mesg.Right(mesg.GetLength()-index-1); showFlash(); //disp=" Please wait....\n "+mesg+" is broadcasting"; //SetDlgItemText(6051,(char*)(LPCTSTR)disp); MessageBox("Please wait....\n "+mesg+" is broadcasting"); return; } if(header=="RESUME") { start->EnableWindow(TRUE); showFlash(); disp=" Broadcasting is over \n Now You can continue..."; SetDlgItemText(6051,(char*)(LPCTSTR)disp); // MessageBox(" Broadcasting is over \n Now You can continue..."); log.WriteString("\n****Received the resume message****"); return; } else //play the voice data { //No of messages received //*** Part of this code has to be removed later ***\\ //Get the legth of buffer length=0; sscanf(&buff[15],"%d",&length); if(length<1 || length>PLAYBUFFER) return; //If audio is not playing, start playing if(play->Playing==FALSE) play->PostThreadMessage(WM_PLAYSOUND_STARTPLAYING,0,0); LPWAVEHDR lpHdr=playhead[curhead]; curhead=(curhead+1)%MAXBUFFER; // playmesg=new char[2020]; for(i=20,j=0;j<length;i++,j++) lpHdr->lpData[j]=buff[i]; lpHdr->dwBufferLength=length; lpHdr->dwFlags=0; play->PostThreadMessage(WM_PLAYSOUND_PLAYBLOCK,0,(LPARAM)lpHdr); //If Save button is pressed.... //Save the Voice data from perticular user if(isSave==TRUE && writeuser.CompareNoCase(header)==0) { write->PostThreadMessage(WM_WRITESOUND_WRITEDATA,0,(LPARAM)lpHdr); log.WriteString("\n Writing to store"); } // log.WriteString("\nPlaying......"); disp=" "+header+" is talking..."; SetDlgItemText(6051,(char*)(LPCTSTR)disp); /* if(from->FindStringExact(-1,header)==LB_ERR) { from->ResetContent(); from->AddString(header); } */ // reccount++; // sprintf(str,"\n No of Messages received = %d ",reccount); // log.WriteString(str); } }