void TFrameHandle::stopPlaying() { if (m_timerId != 0) killTimer(m_timerId); m_timerId = 0; m_looping = false; emit playStopped(); }
WPiano::WPiano(File *_file, vmd_track_t *_track, vmd_time_t time, Player *_player) :file_(_file), track_(_track), grid_size_(file()->division), mouse_captured_(false), cursor_time_(grid_snap_left(this, time)), cursor_size_(file()->division), cursor_level_(0), pivot_enabled_(false), selection_(NULL), player_(_player) { int w = time2x(vmd_file_length(file())); int h = margin * 2 + level_height * levels(track()); setMinimumSize(w, h); setPalette(PianoPalette()); setFocusPolicy(Qt::StrongFocus); connect(file_, SIGNAL(acted()), this, SLOT(update())); connect(player_, SIGNAL(started()), this, SLOT(playStarted())); connect(player_, SIGNAL(finished()), this, SLOT(playStopped())); if (playing()) playStarted(); }
void RDCae::DispatchCommand(RDCmdCache *cmd) { int pos; int card; if(!strcmp(cmd->arg(0),"PW")) { // Password Response if(cmd->arg(1)[0]=='+') { emit isConnected(true); } else { emit isConnected(false); } } if(!strcmp(cmd->arg(0),"LP")) { // Load Play int handle=GetHandle(cmd->arg(4)); int card=CardNumber(cmd->arg(1)); int stream=StreamNumber(cmd->arg(3)); syslog(LOG_ERR,"*** RDCae::DispatchCommand: received unhandled play stream from CAE, handle=%d, card=%d, stream=%d, name=\"%s\" ***", handle,card,stream,cmd->arg(2)); unloadPlay(handle); } if(!strcmp(cmd->arg(0),"UP")) { // Unload Play if(cmd->arg(2)[0]=='+') { int handle=GetHandle(cmd->arg(1)); for(int i=0;i<RD_MAX_CARDS;i++) { for(int j=0;j<RD_MAX_STREAMS;j++) { if(cae_handle[i][j]==handle) { cae_handle[i][j]=-1; for(unsigned k=0;k<RD_MAX_PORTS;k++) { cae_output_status_flags[i][k][j]=false; } } } } emit playUnloaded(handle); } } if(!strcmp(cmd->arg(0),"PP")) { // Position Play if(cmd->arg(3)[0]=='+') { int handle=GetHandle(cmd->arg(1)); sscanf(cmd->arg(2),"%u",&pos); for(int i=0;i<RD_MAX_CARDS;i++) { for(int j=0;j<RD_MAX_STREAMS;j++) { if(cae_handle[i][j]==handle) { //emit playPositionChanged(handle,cae_output_positions[i][j]); emit playPositionChanged(handle,pos); } } } emit playPositioned(handle,pos); } } if(!strcmp(cmd->arg(0),"PY")) { // Play if(cmd->arg(4)[0]=='+') { emit playing(GetHandle(cmd->arg(1))); } } if(!strcmp(cmd->arg(0),"SP")) { // Stop Play if(cmd->arg(2)[0]=='+') { emit playStopped(GetHandle(cmd->arg(1))); } } if(!strcmp(cmd->arg(0),"TS")) { // Timescale Supported if(sscanf(cmd->arg(1),"%d",&card)==1) { if(cmd->arg(2)[0]=='+') { emit timescalingSupported(card,true); } else { emit timescalingSupported(card,false); } } } if(!strcmp(cmd->arg(0),"LR")) { // Load Record if(cmd->arg(8)[0]=='+') { emit recordLoaded(CardNumber(cmd->arg(1)),StreamNumber(cmd->arg(2))); } } if(!strcmp(cmd->arg(0),"UR")) { // Unload Record if(cmd->arg(4)[0]=='+') { emit recordUnloaded(CardNumber(cmd->arg(1)),StreamNumber(cmd->arg(2)), QString(cmd->arg(3)).toUInt()); } } if(!strcmp(cmd->arg(0),"RD")) { // Record } if(!strcmp(cmd->arg(0),"RS")) { // Record Start if(cmd->arg(3)[0]=='+') { emit recording(CardNumber(cmd->arg(1)),StreamNumber(cmd->arg(2))); } } if(!strcmp(cmd->arg(0),"SR")) { // Stop Record if(cmd->arg(3)[0]=='+') { emit recordStopped(CardNumber(cmd->arg(1)),StreamNumber(cmd->arg(2))); } } if(!strcmp(cmd->arg(0),"IS")) { // Input Status switch(cmd->arg(3)[0]) { case '0': emit inputStatusChanged(CardNumber(cmd->arg(1)), StreamNumber(cmd->arg(2)),true); input_status[CardNumber(cmd->arg(1))][StreamNumber(cmd->arg(2))]= true; break; case '1': emit inputStatusChanged(CardNumber(cmd->arg(1)), StreamNumber(cmd->arg(2)),false); input_status[CardNumber(cmd->arg(1))][StreamNumber(cmd->arg(2))]= false; break; } } }