コード例 #1
0
QT_BEGIN_NAMESPACE

QAndroidMediaPlayerControl::QAndroidMediaPlayerControl(QObject *parent)
    : QMediaPlayerControl(parent),
      mMediaPlayer(new JMediaPlayer),
      mCurrentState(QMediaPlayer::StoppedState),
      mCurrentMediaStatus(QMediaPlayer::NoMedia),
      mMediaStream(0),
      mVideoOutput(0),
      mSeekable(true),
      mBufferPercent(-1),
      mAudioAvailable(false),
      mVideoAvailable(false),
      mBuffering(false),
      mMediaPlayerReady(false),
      mPendingPosition(-1),
      mPendingSetMedia(false)
{
    connect(mMediaPlayer, SIGNAL(bufferingUpdate(qint32)),
            this, SLOT(onBufferChanged(qint32)));
    connect(mMediaPlayer, SIGNAL(info(qint32, qint32)),
            this, SLOT(onInfo(qint32, qint32)));
    connect(mMediaPlayer, SIGNAL(error(qint32, qint32)),
            this, SLOT(onError(qint32, qint32)));
    connect(mMediaPlayer, SIGNAL(mediaPlayerInfo(qint32, qint32)),
            this, SLOT(onMediaPlayerInfo(qint32, qint32)));
    connect(mMediaPlayer, SIGNAL(videoSizeChanged(qint32,qint32)),
            this, SLOT(onVideoSizeChanged(qint32,qint32)));
}
コード例 #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    vcom(false),
    attenuation_tout(200),
    m_attn(-1),
    m_db(new EpcDb())
{
  ui->setupUi(this);
  createLogTable();

  stReader = new StReader(this);
  clk10msTimer = new QTimer(this);
  getReaderChannels();

  connect(stReader, SIGNAL(connection(bool)), this, SLOT(setConnectingControl(bool)));
  connect(stReader, SIGNAL(raiseErrorMessage(QString)), ui->statusBar, SLOT(showMessage(QString)));
  connect(stReader, SIGNAL(raiseStatusMessage(QString)), ui->statusBar, SLOT(showMessage(QString)));
  connect(stReader, SIGNAL(dataReceived(QByteArray)), this, SLOT(onReaderPacketIn(QByteArray)));
  connect(stReader, SIGNAL(readingEpc(QByteArray)), this, SLOT(onEpc(QByteArray)));
  connect(stReader, SIGNAL(attenuation(int)), this, SLOT(onAttenuation(int)));
  connect(ui->action_Info, SIGNAL(triggered()), this, SLOT(onInfo()));
  connect(ui->actionE_xit, SIGNAL(triggered()), this, SLOT(close()));
  connect(ui->actionE_xport, SIGNAL(triggered()), this, SLOT(onExportDatabase()));
  connect(ui->action_Delete, SIGNAL(triggered()), this, SLOT(onDeleteDatabase()));

  connect(clk10msTimer, SIGNAL(timeout()), this, SLOT(on10msTimer()));
  clk10msTimer->start(10);

  channel = ui->comboBoxPort->currentText();
  stReader->connectReader(channel);
  if (ui->comboBoxPort->count() > 0)
    ui->checkBoxConnect->setChecked(true);
  ui->statusBar->showMessage(tr("Started!"));
  this->setWindowTitle(this->windowTitle() + k_version);
}