示例#1
0
void MainWindow::mkconnections()
{
    connect(bar,SIGNAL(closeClicked()),SLOT(close()));
    connect(bar,SIGNAL(maximizeClicked(bool)),SLOT(showWind(bool)));
    connect(bar,SIGNAL(hideClicked()),SLOT(showMinimized()));
    connect(playlists,SIGNAL(songAdded(QString,QString)),&library,SLOT(addSongInPlaylist(QString,QString)));
    connect(bar,SIGNAL(addFilePressed()),SLOT(addFiles()));
    connect(bar,SIGNAL(addFolderPressed()),SLOT(addFolder()));
    connect(&player,SIGNAL(inPlaylist(bool)),SLOT(changePlayerConnections(bool)));
    connect(&library,SIGNAL(newSong(Song)),table,SLOT(addSongInList(Song)));
    connect(&player,SIGNAL(positionChanged(qint64)),bar,SIGNAL(seekChanged(qint64)));
    connect(&player,SIGNAL(currentSongChanged(Song)),bar,SIGNAL(songChanged(Song)));
    connect(bar,SIGNAL(playClicked()),&player,SLOT(playpause()));
    connect(addFile,SIGNAL(triggered()),SLOT(addFiles()));
    connect(actionAddFolder,SIGNAL(triggered()),SLOT(addFolder()));
    connect(actionOuvrir,SIGNAL(triggered()),SLOT(openFile()));
    connect(bar,SIGNAL(volumeChanged(int)),&player,SLOT(setVolume(int)));
    connect(bar,SIGNAL(positionChanged(int)),&player,SLOT(setPosition(int)));
    connect(bar,SIGNAL(seekBarPressed()),&player,SLOT(pause()));
    connect(bar,SIGNAL(seekBarReleased()),&player,SLOT(play()));
    connect(&player,SIGNAL(playbackStateChanged(bool)),bar,SLOT(changeButton(bool)));
    connect(tree,SIGNAL(albumChosen(QString,QString)),table,SLOT(showSongsFrom(QString,QString)));
    connect(tree,SIGNAL(artistChosen(QString)),table,SLOT(showSongsBy(QString)));
    connect(&library,SIGNAL(libraryChanged(Library*)),tree,SLOT(updateTree(Library*)));
    connect(table,SIGNAL(newPlaylist(Song)),this,SLOT(mkPlaylist(Song)));
    connect(playlists,SIGNAL(playlistChosen(QString)),table,SLOT(showSongsIn(QString)));
    connect(table,SIGNAL(deleteSong(Song,bool)),&library,SLOT(deleteSong(Song,bool)));
    connect(bar,SIGNAL(newQuery(QString,int)),table,SLOT(setQuery(QString,int)));
    connect(bar,SIGNAL(newPlaybackMode(QMediaPlaylist::PlaybackMode)),&player,SLOT(setPlayBackMode(QMediaPlaylist::PlaybackMode)));
    connect(table,SIGNAL(songChosen(int)),&player,SLOT(play(int)));
    connect(table,SIGNAL(newSongList(SongList)),&player,SLOT(update(SongList)));
    connect(&player,SIGNAL(inPlaylist(bool)),bar,SLOT(enableNavigation(bool)));
    connect(bar,SIGNAL(miniLecteur()),&mLecteur,SLOT(show()));
    connect(bar,SIGNAL(miniLecteur()),SLOT(hide()));
    connect(&mLecteur,SIGNAL(windowedMode()),SLOT(show()));
    connect(&mLecteur,SIGNAL(positionChanged(int)),bar,SIGNAL(positionChanged(int)));
    connect(&mLecteur,SIGNAL(seekBarPressed()),bar,SIGNAL(seekBarPressed()));
    connect(&mLecteur,SIGNAL(seekBarReleased()),bar,SIGNAL(seekBarReleased()));
    connect(&mLecteur,SIGNAL(positionChanged(int)),bar,SIGNAL(positionChanged(int)));
    connect(&mLecteur,SIGNAL(playClicked()),bar,SIGNAL(playClicked()));
    connect(&mLecteur,SIGNAL(nextClicked()),bar,SIGNAL(nextClicked()));
    connect(&mLecteur,SIGNAL(previousClicked()),bar,SIGNAL(previousClicked()));
    connect(&mLecteur,SIGNAL(volumeChanged(int)),bar,SIGNAL(volumeChanged(int)));
    connect(&player,SIGNAL(currentSongChanged(Song)),&mLecteur,SLOT(setNewSong(Song)));
    connect(&player,SIGNAL(positionChanged(qint64)),&mLecteur,SLOT(setPosition(qint64)));
    connect(&player,SIGNAL(playbackStateChanged(bool)),&mLecteur,SLOT(changeButton(bool)));
    connect(&player,SIGNAL(indexChanged(int,int)),table,SLOT(setIconTo(int,int)));
    connect(table,SIGNAL(addFileTriggered()),SLOT(addFiles()));
    connect(table,SIGNAL(addFolderTriggered()),SLOT(addFolder()));

}
示例#2
0
void VideoItem::createPanel()
{
    _panel = new VideoControlPanel(this);
    _panel->setParentItem(this);
    setPanelPosition();

    _panel->setVolume(_player->volume());
    // _panel->show();
    _panel->hide();

    connect (this, SIGNAL(playMedia()),
             _panel, SLOT(on_play()));
    connect (this, SIGNAL(pauseMedia()),
             _panel, SLOT(on_pause()));
    connect (this, SIGNAL(stopMedia()),
             _panel, SLOT(on_stop()));

    connect (_panel, SIGNAL(positionChanged(qint64)),
             _player, SLOT(setPosition(qint64)));
    connect (_panel, SIGNAL(playClicked()),
             _player, SLOT(play()));
    connect (_panel, SIGNAL(pauseClicked()),
             _player, SLOT(pause()));
    connect (_panel, SIGNAL(volumeChanged(int)),
             _player, SLOT(setVolume(int)));
}
示例#3
0
Controls::Controls(QWidget *parent) :
    QWidget(parent),
   statePl(QMediaPlayer::StoppedState), volumeIcon(0), playerMute(false)
{
    toBegin = new QToolButton(this);
    toBegin ->setIcon(QIcon(":/images/backward.png"));
    connect(toBegin, SIGNAL(clicked()), this, SIGNAL(backward()));

    toEnd = new QToolButton(this);
    toEnd ->setIcon(QIcon(":/images/forward.png"));
    connect(toEnd, SIGNAL(clicked()), this, SIGNAL(forward()));

    playBut = new QToolButton(this);
    playBut->setIcon(QIcon(":/images/play.png"));
    connect(playBut, SIGNAL(clicked()), this, SLOT(playClicked()));

    volumeIcon = new QToolButton(this);
    volumeIcon ->setIcon(QIcon(":/images/volume.png"));

    connect(volumeIcon, SIGNAL(clicked()), this, SLOT(muteClick()));

    volSlider = new QSlider(Qt::Horizontal, this);
    volSlider -> setRange(0, 100);
    connect(volSlider, SIGNAL(sliderMoved(int)), this, SIGNAL(volumeChange(int)));

    QHBoxLayout *box = new QHBoxLayout;
    box ->setMargin(0);
    box -> addWidget( toBegin );
    box -> addWidget( playBut );
    box -> addWidget( toEnd );
    box -> addWidget( volumeIcon );
    box -> addWidget( volSlider);
    setLayout(box);
}
示例#4
0
QuickConnectDialog::QuickConnectDialog(ConfigManager *mgr, QWidget *parent)
  : QDialog(parent), _mgr(mgr)
{
  setupUi(this);

  QGraphicsScene *scene = new QGraphicsScene();
  scene->addPixmap(QPixmap(":/mainwindow/intro.png"));
  profilePicture->setScene(scene);
  profilePicture->show();

  playButton->setFocus();

  profileView->setModel(_mgr->model());
  profileView->setUniformRowHeights(true);
  profileView->setRootIsDecorated(false);
  profileView->setItemsExpandable(false);

  // Automatically select the last profile   TODO
  QModelIndex topLeft = profileView->model()->index(0, 0);
  QModelIndex bottomRight = profileView->model()->index(0, profileView->model()->columnCount()-1);
  QItemSelection selection(topLeft, bottomRight);
  profileView->selectionModel()->select(selection, QItemSelectionModel::Select);
  selectionChanged(profileView->selectionModel()->selection());


  connect(playButton, SIGNAL(clicked() ), this, SLOT(playClicked() ));
  connect(profileButton, SIGNAL(clicked() ), this, SLOT(profileClicked() ));

  connect(profileView->selectionModel(),
	  SIGNAL(selectionChanged(const QItemSelection&,
				  const QItemSelection&)),
	  this, SLOT(selectionChanged(const QItemSelection&)));
  connect(profileView, SIGNAL(doubleClicked(const QModelIndex&)),
          this, SLOT(doubleClicked(const QModelIndex&)));
}
示例#5
0
PlayerWidget::PlayerWidget(QWidget *parent) : QWidget(parent), ui(new Ui::PlayerWidget()){
  ui->setupUi(this); //load the designer form
  PLAYER = new QMediaPlayer(this);
    PLAYER->setVolume(100);
    PLAYER->setNotifyInterval(1000); //1 second interval (just needs to be a rough estimate)
  PLAYLIST = new QMediaPlaylist(this);
    PLAYLIST->setPlaybackMode(QMediaPlaylist::Sequential);
    PLAYER->setPlaylist(PLAYLIST);
	
  configMenu = new QMenu(this);
    ui->tool_config->setMenu(configMenu);
  addMenu = new QMenu(this);
    ui->tool_add->setMenu(addMenu);
	
  updatinglists = false; //start off as false
	
  LoadIcons();
  playerStateChanged(); //update button visibility
  currentSongChanged();
  //Connect all the signals/slots
  //connect(infoTimer, SIGNAL(timeout()), this, SLOT(rotateTrackInfo()) );
  connect(PLAYER, SIGNAL(positionChanged(qint64)),this, SLOT(updateProgress(qint64)) );
  connect(PLAYER, SIGNAL(durationChanged(qint64)), this, SLOT(updateMaxProgress(qint64)) );
  connect(PLAYLIST, SIGNAL(mediaChanged(int, int)), this, SLOT(playlistChanged()) );
  connect(PLAYER, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(playerStateChanged()) );
  connect(PLAYLIST, SIGNAL(currentMediaChanged(const QMediaContent&)), this, SLOT(currentSongChanged()) );
  connect(ui->combo_playlist, SIGNAL(currentIndexChanged(int)), this, SLOT(userlistSelectionChanged()) );
  connect(ui->tool_play, SIGNAL(clicked()), this, SLOT(playClicked()) );
  connect(ui->tool_pause, SIGNAL(clicked()), this, SLOT(pauseClicked()) );
  connect(ui->tool_stop, SIGNAL(clicked()), this, SLOT(stopClicked()) );
  connect(ui->tool_next, SIGNAL(clicked()), this, SLOT(nextClicked()) );
  connect(ui->tool_prev, SIGNAL(clicked()), this, SLOT(prevClicked()) );
  
}
示例#6
0
void PlayerController::setView(AbstractPlayerView *view)
{
    if (m_view == view)
        return;

    if (m_view) {
        m_view->disconnect(this);
    }

    m_view = view;

    if (m_view) {
        connect(m_view, SIGNAL(playClicked()), SLOT(play()));
        connect(m_view, SIGNAL(pauseClicked()), SLOT(pause()));
        connect(m_view, SIGNAL(stopClicked()), SLOT(stop()));
        connect(m_view, SIGNAL(nextClicked()), SLOT(next()));
        connect(m_view, SIGNAL(previousClicked()), SLOT(previous()));
        connect(m_view, SIGNAL(shuffleClicked()), SLOT(toggleShuffle()));
        connect(m_view, SIGNAL(muteClicked()), SLOT(toggleMute()));
        connect(m_view, SIGNAL(repeatClicked()), SLOT(toggleRepeat()));
        connect(m_view, SIGNAL(volumeChanged(qreal)), SLOT(setVolume(qreal)));
        connect(m_view, SIGNAL(songSelected(int)), SLOT(play(int)));
    }

    initializeView();
}
void servoboard_main::initBundles()
{

    ServoControlBundle* t;
    for (int i(1); i <= 12; ++i)//They are numbered with a 1 base, not a 0 base.
    {
        t = new ServoControlBundle(this);
        t->setServoNumber(i);
        ui->gridMainLayout->addWidget(t,(i/7)+1,(i-1)%6 ,1,1);//The columns start at 1 and the rows at 0
        //There is one handler for all the different buttons, so they notify which one.
        connect(t,SIGNAL(playClicked(quint8,quint8)),SLOT(servoPlayButtonClicked(quint8,quint8)));
        this->servoBundles.append(t);
    }
    this->servoBundles.squeeze();//Make sure we aren't wasting memory, this won't grow again.
}
示例#8
0
QseWidget::QseWidget(QWidget *parent) :
    QWidget(parent)
{
    // selection
    m_selection = new QseSelection(this);
    m_selectionPlot = new QseSelectionPlot(this);
    m_selectionPlot->setSelection(m_selection);

    // position cursor
    m_positionCursor = new QseCursor(this);
    m_positionCursorPlot = new QseCursorPlot(this);
    m_positionCursorPlot->setCursor(m_positionCursor);

    // play cursor
    m_playCursor = new QseCursor(this);
    m_playCursorPlot = new QseCursorPlot(this);
    m_playCursorPlot->setPen(QPen(Qt::darkGreen));
    m_playCursorPlot->setCursor(m_playCursor);

    // scroll bar
    m_scrollBar = new QseScrollBar(this);
    m_scrollBar->hide();
    connect(m_scrollBar, SIGNAL(valueChanged(int)), this, SLOT(slotScrollBarValueChanged(int)));

    // time widget && controller
    m_timeController = new QseHorizontalController(this);
    m_timeWidget = new QseAxisWidget(QseAxisWidget::Top, this);
    m_timeProvider = new QseTimeMetricProvider(m_timeWidget);
    m_timeWidget->setController(m_timeController);
    m_timeWidget->setMetricProvider(m_timeProvider);
    m_timeWidget->hide();
    connect(m_timeController, SIGNAL(geometryChanged(QseGeometry)), this, SLOT(setGeometry(QseGeometry)));

    // amplitude controller
    m_amplitudeController = new QseVerticalController(this);
    connect(m_amplitudeController, SIGNAL(geometryChanged(QseGeometry)), this, SLOT(setGeometry(QseGeometry)));

    // waveform controller
    m_waveformController = new QsePlotController(this);
    m_waveformController->setPosition(m_positionCursor);
    m_waveformController->setSelection(m_selection);
    connect(m_waveformController, SIGNAL(geometryChanged(QseGeometry)), this, SLOT(setGeometry(QseGeometry)));
    connect(m_waveformController, SIGNAL(playClicked(qint64)), this, SLOT(slotPlayClicked(qint64)));

    // in the thread will be calculated the all peak and somthing else
    m_readerThread = new QThread(this);
    m_readerThread->start();
}
示例#9
0
void PlaylistControl::mouseReleaseEvent(QMouseEvent *me)
{
	QPoint pt = me->pos();
    if(QRect(4*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt))
		emit previousClicked();
    else if(QRect(12*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt))
		emit playClicked();
    else if(QRect(21*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt))
		emit pauseClicked();
    else if(QRect(31*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt))
		emit stopClicked();
    else if(QRect(40*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt))
		emit nextClicked();
    else if(QRect(49*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt))
		emit ejectClicked();
}
示例#10
0
void PhMediaPanel::onPlayPause()
{
	if(_clock) {
		if(_clock->rate())
			_clock->setRate(0);
		else
			_clock->setRate(1);
	}
	else
		_playing = !_playing;
	updatePlayingState();

	if(_playing)
		emit playClicked();
	else
		emit pauseClicked();
}
示例#11
0
OsdWidget::OsdWidget(QWidget *parent)
    : StyledBar(parent),
      ui(new Ui::OsdWidget),
      _current(""),
      _file(new NetworkDownload())
{
    ui->setupUi(this);

    setLightColored(true);
    setSingleRow(false);

    setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);

    _info = new InfoBarWidget(this);
    ui->controls->addWidget(_info);

    ui->logo->hide();
    ui->teletext->hide();

    ui->buttonBack->setProperty("extraframe", true);
    ui->buttonMute->setProperty("extraframe", true);
    ui->buttonNext->setProperty("extraframe", true);
    ui->buttonPlay->setProperty("extraframe", true);
    ui->buttonRecordNow->setProperty("extraframe", true);
    ui->buttonSnapshot->setProperty("extraframe", true);
    ui->buttonStop->setProperty("extraframe", true);
    ui->buttonTeletext->setProperty("extraframe", true);

    connect(_info, SIGNAL(open(QString)), this, SIGNAL(openLink(QString)));
    connect(ui->teletext, SIGNAL(valueChanged(int)), this, SIGNAL(teletextPage(int)));

    connect(ui->buttonBack, SIGNAL(clicked()), this, SIGNAL(backClicked()));
    connect(ui->buttonMute, SIGNAL(clicked()), this, SIGNAL(muteClicked()));
    connect(ui->buttonNext, SIGNAL(clicked()), this, SIGNAL(nextClicked()));
    connect(ui->buttonPlay, SIGNAL(clicked()), this, SIGNAL(playClicked()));
    connect(ui->buttonRecordNow, SIGNAL(clicked()), this, SIGNAL(recordNowClicked()));
    connect(ui->buttonSnapshot, SIGNAL(clicked()), this, SIGNAL(snapshotClicked()));
    connect(ui->buttonStop, SIGNAL(clicked()), this, SIGNAL(stopClicked()));
    connect(ui->buttonTeletext, SIGNAL(clicked()), this, SIGNAL(teletextClicked()));

    connect(_file, SIGNAL(file(QFile *)), this, SLOT(setLogo(QFile *)));
}
示例#12
0
void HTML5FullScreenVideoHandler::enterFullScreen(QMediaPlayer *player)
{
    if (!player)
        return;

    m_videoWidget = new HTML5VideoWidget();
    if (!m_videoWidget)
        return;

    m_videoWidget->setDuration(player->duration() / 1000);

    CAknAppUi* appUi = dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi());
    if (appUi) {
        m_savedOrientation = appUi->Orientation();
        appUi->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape);
    }

    m_mediaPlayer = player;
    connect(m_mediaPlayer, SIGNAL(positionChanged(qint64)), m_videoWidget, SLOT(onPositionChanged(qint64)));
    connect(m_mediaPlayer, SIGNAL(durationChanged(qint64)), m_videoWidget, SLOT(setDuration(qint64)));
    connect(m_mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(onPlayerStateChanged(QMediaPlayer::State)));
    connect(m_mediaPlayer, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(onPlayerError(QMediaPlayer::Error)));
    connect(m_mediaPlayer, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(onMediaStatusChanged(QMediaPlayer::MediaStatus)));
    connect(m_videoWidget, SIGNAL(positionChangedByUser(qint64)), m_mediaPlayer, SLOT(setPosition(qint64)));
    connect(m_videoWidget, SIGNAL(closeClicked()), this, SIGNAL(fullScreenClosed()));
    connect(m_videoWidget, SIGNAL(muted(bool)), m_mediaPlayer, SLOT(setMuted(bool)));
    connect(m_videoWidget, SIGNAL(volumeChanged(int)), m_mediaPlayer, SLOT(setVolume(int)));
    connect(m_videoWidget, SIGNAL(pauseClicked()), m_mediaPlayer, SLOT(pause()));
    connect(m_videoWidget, SIGNAL(playClicked()), m_mediaPlayer, SLOT(play()));

    m_mediaPlayer->setVideoOutput(m_videoWidget);

    m_videoWidget->setVolume(m_mediaPlayer->volume());
    m_videoWidget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    m_videoWidget->showFullScreen();
    m_fullScreen = true;

    // Handle current Media Status and Media Player error.
    onMediaStatusChanged(m_mediaPlayer->mediaStatus());
    onPlayerError(m_mediaPlayer->error());
}
示例#13
0
void PlayerControls::MrccatoCommand(TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction aButtonAct)
{
    if (!coreTarget)
        return;

    switch (aOperationId){
        case ERemConCoreApiVolumeUp:
            if ((aButtonAct == ERemConCoreApiButtonClick) ||
                (aButtonAct == ERemConCoreApiButtonPress) ||
                (aButtonAct == ERemConCoreApiButtonRelease))
             emit changeVolume((iplayer->volume()) + 10);
             break;
        case ERemConCoreApiVolumeDown:
            if ((aButtonAct == ERemConCoreApiButtonClick) ||
                (aButtonAct == ERemConCoreApiButtonPress) ||
                (aButtonAct == ERemConCoreApiButtonRelease))
             emit changeVolume((iplayer->volume()) - 10);
             break;
        case ERemConCoreApiPausePlayFunction:
            if (aButtonAct == ERemConCoreApiButtonClick)
             playClicked();
             break;
        case ERemConCoreApiStop:
            if (aButtonAct == ERemConCoreApiButtonClick)
             emit stop();
             break;
        case ERemConCoreApiBackward:
            if (aButtonAct == ERemConCoreApiButtonClick)
             emit previous();
             break;
        case ERemConCoreApiForward:
            if (aButtonAct == ERemConCoreApiButtonClick)
             emit next();
             break;
    }
}
void ListWidgetButtonContainer::setButtons(const RecordItNow::CollectionListWidget::ButtonCodes &buttons)
{

    m_buttons.clear();

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setContentsMargins(-1, -1, -1, 0);
    mainLayout->setSizeConstraint(QVBoxLayout::SetMinimumSize);

    KSeparator *mainSeparator = new KSeparator(this);
    mainSeparator->setFrameShape(KSeparator::HLine);

    QHBoxLayout *layout = new QHBoxLayout;
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSizeConstraint(QLayout::SetMinimumSize);

    mainLayout->addLayout(layout);
    mainLayout->addWidget(mainSeparator);

    QToolButton *button = 0;
    if (buttons & CollectionListWidget::PlayButton) {
        button = newButton(this);
        button->setIcon(KIcon("media-playback-start"));
        button->setToolTip(i18n("Play"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(playClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::PlayButton, button);
    }
/*
    if (button) {
        KSeparator *separator = new KSeparator(this);
        separator->setFrameShape(QFrame::VLine);
        layout->addWidget(separator);
    }
*/

    if (buttons & CollectionListWidget::UploadButton) {
        button = newButton(this);
        button->setIcon(KIcon("recorditnow-upload-media"));
        button->setToolTip(i18n("Upload"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(uploadClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::UploadButton, button);
    }

    if (buttons & CollectionListWidget::AddButton) {
        button = newButton(this);
        button->setIcon(KIcon("list-add"));
        button->setToolTip(i18n("Add"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(addClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::AddButton, button);
    }

    if (buttons & CollectionListWidget::EditButton) {
        button = newButton(this);
        button->setIcon(KIcon("document-edit"));
        button->setToolTip(i18n("Edit"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(editClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::EditButton, button);
    }

    if (buttons & CollectionListWidget::DeleteButton) {
        button = newButton(this);
        button->setIcon(KIcon("edit-delete"));
        button->setToolTip(i18n("Delete"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(deleteClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::DeleteButton, button);
    }

    QWidget *spacer = new QWidget(this);
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    layout->addWidget(spacer);

    setLayout(mainLayout);

}
示例#15
0
PlayerControls::PlayerControls(QWidget *parent, QMediaPlayer *player)
    : QWidget(parent)
    , playerState(QMediaPlayer::StoppedState)
    , playerMuted(false)
    , playButton(0)
    , stopButton(0)
    , nextButton(0)
    , previousButton(0)
    , muteButton(0)
    , volumeSlider(0)
    , rateBox(0)
{
#ifdef Q_OS_SYMBIAN
    initRemCon();
#endif // Q_OS_SYMBIAN
    iplayer = player;

    playButton = new QToolButton(this);
    playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay));

    connect(playButton, SIGNAL(clicked()), this, SLOT(playClicked()));

    stopButton = new QToolButton(this);
    stopButton->setIcon(style()->standardIcon(QStyle::SP_MediaStop));
    stopButton->setEnabled(false);

    connect(stopButton, SIGNAL(clicked()), this, SIGNAL(stop()));

    nextButton = new QToolButton(this);
    nextButton->setIcon(style()->standardIcon(QStyle::SP_MediaSkipForward));

    connect(nextButton, SIGNAL(clicked()), this, SIGNAL(next()));

    previousButton = new QToolButton(this);
    previousButton->setIcon(style()->standardIcon(QStyle::SP_MediaSkipBackward));

    connect(previousButton, SIGNAL(clicked()), this, SIGNAL(previous()));

    muteButton = new QToolButton(this);
    muteButton->setIcon(style()->standardIcon(QStyle::SP_MediaVolume));

    connect(muteButton, SIGNAL(clicked()), this, SLOT(muteClicked()));

#ifndef Q_WS_MAEMO_5
    volumeSlider = new QSlider(Qt::Horizontal, this);
    volumeSlider->setRange(0, 100);

    connect(volumeSlider, SIGNAL(sliderMoved(int)), this, SIGNAL(changeVolume(int)));


    rateBox = new QComboBox(this);
    rateBox->addItem("0.5x", QVariant(0.5));
    rateBox->addItem("1.0x", QVariant(1.0));
    rateBox->addItem("2.0x", QVariant(2.0));
    rateBox->setCurrentIndex(1);

    connect(rateBox, SIGNAL(activated(int)), SLOT(updateRate()));
#endif

    QBoxLayout *layout = new QHBoxLayout;
    layout->setMargin(0);
    layout->addWidget(stopButton);
    layout->addWidget(previousButton);
    layout->addWidget(playButton);
    layout->addWidget(nextButton);
    layout->addWidget(muteButton);
    if (volumeSlider)
        layout->addWidget(volumeSlider);

    if (rateBox)
        layout->addWidget(rateBox);
    setLayout(layout);
}
示例#16
0
    connect(ui->actionMute, SIGNAL(toggled(bool)), _mediaPlayer->osd(), SLOT(mute(bool)));
    connect(ui->actionVolumeDown, SIGNAL(triggered()), _mediaPlayer->osd(), SLOT(volumeDown()));
    connect(ui->actionVolumeUp, SIGNAL(triggered()), _mediaPlayer->osd(), SLOT(volumeUp()));

#if defined(Q_OS_LINUX)
    if (_mediaPlayer->teletextEnabled()) {
        connect(ui->actionTeletext, SIGNAL(triggered(bool)), _mediaPlayer->osd(), SLOT(teletext(bool)));
        connect(ui->actionTeletext, SIGNAL(triggered(bool)), _mediaPlayer, SLOT(teletext(bool)));
        connect(_mediaPlayer->osd(), SIGNAL(teletextClicked()), ui->actionTeletext, SLOT(trigger()));
    }
#endif

    connect(_mediaPlayer->osd(), SIGNAL(backClicked()), ui->actionBack, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(muteClicked()), ui->actionMute, SLOT(toggle()));
    connect(_mediaPlayer->osd(), SIGNAL(nextClicked()), ui->actionNext, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(playClicked()), ui->actionPlay, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(recordNowClicked()), ui->actionRecordNow, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(snapshotClicked()), ui->actionSnapshot, SLOT(trigger()));
    connect(_mediaPlayer->osd(), SIGNAL(stopClicked()), ui->actionStop, SLOT(trigger()));

    connect(_xmltv, SIGNAL(current(QStringList)), _mediaPlayer->osd(), SLOT(setEpg(QStringList)));
    connect(_xmltv, SIGNAL(schedule(QString, XmltvProgrammeModel *)), _scheduleTab, SLOT(setEpg(QString, XmltvProgrammeModel *)));
    connect(_scheduleTab, SIGNAL(requestEpg(QString)), _xmltv, SLOT(request(QString)));
    connect(_scheduleTab, SIGNAL(itemSelected(QString)), _xmltv, SLOT(requestProgramme(QString)));
    connect(_xmltv, SIGNAL(programme(XmltvProgramme *)), _showInfoTab, SLOT(display(XmltvProgramme *)));
    connect(_mediaPlayer->osd(), SIGNAL(openLink(QString)), _xmltv, SLOT(requestProgramme(QString)));
    connect(_showInfoTab, SIGNAL(requestNext(QString, QString)), _xmltv, SLOT(requestProgrammeNext(QString, QString)));
    connect(_showInfoTab, SIGNAL(requestPrevious(QString, QString)), _xmltv, SLOT(requestProgrammePrevious(QString, QString)));
    connect(_playlistTab->playlist(), SIGNAL(scheduleRequested(Channel *)), _scheduleTab, SLOT(channel(Channel *)));

    connect(_mediaPlayer, SIGNAL(stateChanged(Vlc::State)), this, SLOT(setState(Vlc::State)));
示例#17
0
void QuickConnectDialog::doubleClicked(const QModelIndex &index) {
  // TODO: why does double clicking crash?!
  if (index.isValid())
    playClicked();
}
示例#18
0
文件: ltwindow.cpp 项目: HxCory/f1lt
LTWindow::LTWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::LTWindow), eventData(EventData::getInstance())
{    
    ui->setupUi(this);    

    currDriver = -1;

    streamReader = new DataStreamReader(this);
    prefs = new PreferencesDialog(this);
    settings = new QSettings(F1LTCore::iniFile(), QSettings::IniFormat, this);
    loginDialog = new LoginDialog(this);
    ltFilesManagerDialog = new LTFilesManagerDialog(this);
    trackRecordsDialog = new TrackRecordsDialog(this);
    saw = new SessionAnalysisWidget();
    stw = new SessionTimesWidget();
    driverTrackerWidget = new DriverTrackerWidget();
    aboutDialog = new AboutDialog(this);
    updatesCheckerDialog = new UpdatesCheckerDialog(this);

//    ui->trackStatusWidget->setupItems();

    connect(streamReader, SIGNAL(tryAuthorize()), this, SLOT(tryAuthorize()));
    connect(streamReader, SIGNAL(authorized(QString)), this, SLOT(authorized(QString)));
    connect(streamReader, SIGNAL(eventDataChanged(const DataUpdates&)), this, SLOT(eventDataChanged(const DataUpdates&)));
    connect(streamReader, SIGNAL(driverDataChanged(int, const DataUpdates&)), this, SLOT(driverDataChanged(int, const DataUpdates&)));
    connect(streamReader, SIGNAL(dataChanged(const DataUpdates&)), this, SLOT(dataChanged(const DataUpdates&)));
    connect(streamReader, SIGNAL(sessionStarted()), this, SLOT(sessionStarted()));
    connect(streamReader, SIGNAL(authorizationError()), this, SLOT(authorizationError()));
    connect(streamReader, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(error(QAbstractSocket::SocketError)));
    connect(streamReader, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError)));
    connect(streamReader, SIGNAL(noLiveSession(bool, QString)), this, SLOT(showNoSessionBoard(bool, QString)));

    connect(updatesCheckerDialog, SIGNAL(newVersionAvailable()), this, SLOT(onNewVersionAvailable()));

    sessionTimer = new SessionTimer(this);
    connect(sessionTimer, SIGNAL(updateWeather()), this, SLOT(updateWeather()));

    connect(&SeasonData::getInstance(), SIGNAL(seasonDataChanged()), &ImagesFactory::getInstance(), SLOT(reloadGraphics()));
    connect(&SeasonData::getInstance(), SIGNAL(seasonDataChanged()), &ColorsManager::getInstance(), SLOT(calculateDefaultDriverColors()));
    connect(&SeasonData::getInstance(), SIGNAL(seasonDataChanged()), saw, SLOT(setupColors()));


    connect(prefs, SIGNAL(driversColorsChanged()), saw, SLOT(setupColors()));

    eventRecorder = new EventRecorder(sessionTimer, this);
    eventPlayer = new EventPlayer(this);

    delayWidget = new DelayWidget(this);
    connect(delayWidget, SIGNAL(delayChanged(int, int)), streamReader, SLOT(setDelay(int, int)));
    connect(delayWidget, SIGNAL(delayChanged(int, int)), sessionTimer, SLOT(setDelay(int, int)));
    connect(sessionTimer, SIGNAL(synchronizingTimer(bool)), delayWidget, SLOT(synchronizingTimer(bool)));
    connect(sessionTimer, SIGNAL(synchronizingTimer(bool)), driverTrackerWidget, SLOT(pauseTimer(bool)));

    connect(ui->messageBoardWidget, SIGNAL(connectClicked()), this, SLOT(on_actionConnect_triggered()));
    connect(ui->messageBoardWidget, SIGNAL(playClicked()), this, SLOT(on_actionOpen_triggered()));
    connect(ui->messageBoardWidget, SIGNAL(loadClicked()), this, SLOT(on_actionLT_files_data_base_triggered()));

    loadSettings();
    ColorsManager::getInstance().calculateDefaultDriverColors();
    saw->setupColors();

    delayWidgetAction = ui->mainToolBar->addWidget(delayWidget);
    delayWidgetAction->setVisible(true);

    eventPlayerAction = ui->mainToolBar->addWidget(eventPlayer);
    eventPlayerAction->setVisible(false);
    recording = false;
    playing = false;

    connectionProgress = new QProgressDialog(this);

    connect(sessionTimer, SIGNAL(timeout()), this, SLOT(timeout()));
    connect(eventRecorder, SIGNAL(recordingStopped()), this, SLOT(autoStopRecording()));
    connect(eventPlayer, SIGNAL(playClicked(int)), this, SLOT(eventPlayerPlayClicked(int)));
    connect(eventPlayer, SIGNAL(pauseClicked()), this, SLOT(eventPlayerPauseClicked()));
    connect(eventPlayer, SIGNAL(rewindToStartClicked()), this, SLOT(eventPlayerRewindToStartClicked()));
    connect(eventPlayer, SIGNAL(forwardToEndClicked()), this, SLOT(eventPlayerForwardToEndClicked()));
    connect(eventPlayer, SIGNAL(rewindClicked()), this, SLOT(eventPlayerRewindClicked()));
    connect(eventPlayer, SIGNAL(stopClicked()), this, SLOT(eventPlayerStopClicked()));
    connect(eventPlayer, SIGNAL(nextPackets(QVector<Packet>)), streamReader, SLOT(parsePackets(QVector<Packet>)));

    connect(ui->ltWidget, SIGNAL(driverSelected(int)), ui->driverDataWidget, SLOT(printDriverData(int)));
    connect(ui->ltWidget, SIGNAL(driverDoubleClicked(int)), this, SLOT(ltWidgetDriverSelected(int)));


    ui->messageBoardWidget->setVisible(false);

    QStringList args = qApp->arguments();
    if (args.size() > 1)
    {
        if (eventPlayer->loadFromFile(args.at(1)) == false)
        {
            QMessageBox::critical(this, "Error opening file!", "Could not open specified file, or the file is corrupted.");
            connectToServer();
            return;
        }
        setWindowTitle("FILT - " + args.at(1));
        ui->actionRecord->setVisible(false);
        ui->actionStop_recording->setVisible(false);
        eventPlayerAction->setVisible(true);
        delayWidgetAction->setVisible(false);

        playing = true;

        eventPlayer->startPlaying();
    }
    else
    {
    	if (settings->value("ui/auto_connect").toBool())
    		connectToServer();
    	else
    	{
    		ui->messageBoardWidget->showStartupBoard();
    		showSessionBoard(true);
    	}
    }    

}
示例#19
0
void QuickConnectDialog::relayLoadProfile(const QString& /*profile*/) {
  playClicked();
}
示例#20
0
optionsDialog::optionsDialog(QWidget *parent, std::string name)
    : QDialog(parent)
{
    zoomLabel = new QLabel(tr("Zoom factor"));
    delayLabel = new QLabel(tr("Delay factor"));
    generationLabel = new QLabel(tr("Generation:"));
    numberLabel = new QLabel(tr("0"));

    zoomSB = new QSpinBox;
    zoomSB->setRange(1,30);
    delaySB = new QSpinBox;
    delaySB->setRange(1,10000);

    zoomSlid = new QSlider(Qt::Horizontal);
    zoomSlid->setRange(1,30);
    QObject::connect(zoomSB, SIGNAL(valueChanged(int)),
                     zoomSlid, SLOT(setValue(int)));
    QObject::connect(zoomSlid, SIGNAL(valueChanged(int)),
                     zoomSB, SLOT(setValue(int)));
    QObject::connect(zoomSB, SIGNAL(valueChanged(int)),
                     parent, SLOT(zoomChanged(int)));
    zoomSB->setValue(10);
    

    delaySlid = new QSlider(Qt::Horizontal);
    delaySlid->setRange(1,10000);
    QObject::connect(delaySB, SIGNAL(valueChanged(int)),
                     delaySlid, SLOT(setValue(int)));
    QObject::connect(delaySlid, SIGNAL(valueChanged(int)),
                     delaySB, SLOT(setValue(int)));
    QObject::connect(delaySB, SIGNAL(valueChanged(int)),
                     parent, SLOT(delayChanged(int)));
    delaySB->setValue(100);

    quitButton = new QPushButton(tr("&Quit"));
    playButton = new QPushButton(tr("&Play"));
    stepButton = new QPushButton(tr("&Step"));
    QObject::connect(quitButton, SIGNAL(clicked()),
            parent, SLOT(quitClicked()));
    QObject::connect(stepButton, SIGNAL(clicked()),
            parent, SLOT(stepClicked()));
    QObject::connect(playButton, SIGNAL(clicked()),
            parent, SLOT(playClicked()));


    QHBoxLayout *zoomLayout = new QHBoxLayout;
    zoomLayout->addWidget(zoomLabel);
    zoomLayout->addWidget(zoomSB);
    zoomLayout->addWidget(zoomSlid);

    QHBoxLayout *delayLayout = new QHBoxLayout;
    delayLayout->addWidget(delayLabel);
    delayLayout->addWidget(delaySB);
    delayLayout->addWidget(delaySlid);

    QHBoxLayout *generationLayout = new QHBoxLayout;
    generationLayout->addWidget(generationLabel);
    generationLayout->addStretch();
    generationLayout->addWidget(numberLabel);
    QHBoxLayout *buttonLayout = new QHBoxLayout;
    buttonLayout->addWidget(quitButton);
    buttonLayout->addWidget(playButton);
    buttonLayout->addWidget(stepButton);
    
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addLayout(zoomLayout);
    mainLayout->addLayout(delayLayout);
    mainLayout->addLayout(generationLayout);
    mainLayout->addLayout(buttonLayout);
    setLayout(mainLayout);

    QString *title = new QString((name + " Controls").c_str());
    setWindowTitle(*title);
    setFixedHeight(sizeHint().height());
}