Beispiel #1
0
void FileProcessor::readNextCommand() {
  if (file_ == NULL) { return; }
  if (file_->atEnd()) {
    stopSequence();
    return;
  }

  QString line = file_->readLine();

  QStringList tokens = line.split(QRegExp("[\\s,]"), QString::SkipEmptyParts);
  qDebug() << "Command: " << tokens;

  if (tokens.at(0) == "BASE" && tokens.length() == 2) {
    commandBase(tokens);
  } else if (tokens.at(0) == "VOLUME" && tokens.length() == 2) {
    commandVolume(tokens);
  } else if (tokens.at(0) == "SET" && tokens.length() == 2) {
    commandSet(tokens);
  } else if (tokens.at(0) == "HARMONICS" && tokens.length() == 2) {
    commandHarmonics(tokens);
  } else if (tokens.at(0) == "HOLD" && tokens.length() == 2) {
    commandHold(tokens);
  } else if (tokens.at(0) == "PAUSE" && tokens.length() == 1) {
    commandPause(tokens);
  } else if (tokens.at(0) == "END" && tokens.length() == 1) {
    commandEnd(tokens);
  } else if (tokens.at(0) == "EXIT" && tokens.length() == 1) {
    commandExit(tokens);
  } else if (tokens.at(0) == "FADE" && tokens.length() == 3) {
    commandFade(tokens);
  } else if (tokens.at(0) == "SLIDE" && tokens.length() == 3) {
    commandSlide(tokens);
  } else {
    qDebug() << "Invalid command: " << tokens;
    stopSequence();
  }
}
Beispiel #2
0
bool ViewerWindow::onCommand(WPARAM wParam, LPARAM lParam)
{
	if (HIWORD(wParam) == 1) {
		int transl = translateAccelToTB(LOWORD(wParam));

		if (transl != -1) {
			wParam = transl;
		}
	}
	switch (wParam) {
	case IDS_ABOUT_VIEWER:
		onAbout();
		return true;
	case IDS_TB_CONNOPTIONS:
		dialogConnectionOptions();
		return true;
	case IDS_TB_CONNINFO:
		dialogConnectionInfo();
		return true;
	case IDS_TB_PROCESSINFO:
		dialogProcessInfo();
		return true;
	case IDS_TB_PAUSE:
		commandPause();
		return true;
	case IDS_TB_REFRESH:
		m_viewerCore->refreshFrameBuffer();
		return true;
	case IDS_TB_CTRLALTDEL:
		commandCtrlAltDel();
		return true;
	case IDS_TB_CTRLESC:
		commandCtrlEsc();
		return true;
	case IDS_TB_CTRL:
		commandCtrl();
		return true;
	case IDS_TB_ALT:
		commandAlt();
		return true;
	case IDS_TB_TOOLBAR:
		commandToolBar();
		return true;
	case IDS_TB_TRANSFER:
		showFileTransferDialog();
		return true;
	case IDS_TB_NEWCONNECTION:
		commandNewConnection();
		return true;
	case IDS_TB_SAVESESSION:
		commandSaveSession();
		return true;
	case IDS_TB_SCALEIN:
		commandScaleIn();
		return true;
	case IDS_TB_SCALEOUT:
		commandScaleOut();
		return true;
	case IDS_TB_SCALE100:
		commandScale100();
		return true;
	case IDS_TB_SCALEAUTO:
		commandScaleAuto();
		return true;
	case IDS_TB_FULLSCREEN:
		switchFullScreenMode();
		return true;
	case IDS_TB_CONFIGURATION:
		dialogConfiguration();
		return true;
	}
	return false;
}