コード例 #1
0
ファイル: PlaybackWidget.cpp プロジェクト: yeoedward/UDJ
PlaybackWidget::PlaybackWidget(DataStore *dataStore, QWidget *parent):
  QWidget(parent), dataStore(dataStore), currentPlaybackState(PLAYING)
{
  audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
  mediaObject = new Phonon::MediaObject(this);
  createActions();
  setupUi();

  mediaObject->setTickInterval(1000);
  connect(mediaObject, SIGNAL(tick(qint64)), this, SLOT(tick(qint64)));
  connect(mediaObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)),
    this, SLOT(stateChanged(Phonon::State, Phonon::State)));
  connect(mediaObject, SIGNAL(currentSourceChanged(Phonon::MediaSource)),
    this, SLOT(sourceChanged(Phonon::MediaSource)));
  connect(mediaObject, SIGNAL(finished()), this, SLOT(playNextSong()));
  connect(
    mediaObject,
    SIGNAL(metaDataChanged()),
    this,
    SLOT(metaDataChanged()));
  connect(
    dataStore,
    SIGNAL(manualSongChange(Phonon::MediaSource)),
    this,
    SLOT(setNewSource(Phonon::MediaSource)));

  connect(
    dataStore,
    SIGNAL(eventEnded()),
    this,
    SLOT(clearWidget()));

  connect(
    dataStore,
    SIGNAL(eventCreated()),
    this,
    SLOT(enablePlayback()));

  connect(
    dataStore,
    SIGNAL(eventEnded()),
    this,
    SLOT(disablePlayback()));

  connect(
    dataStore,
    SIGNAL(activePlaylistModified()),
    this,
    SLOT(handlePlaylistChange()));

  Phonon::createPath(mediaObject, audioOutput);
  dataStore->isCurrentlyHosting() ? setEnabled(true) : setEnabled(false);
  playNextSong();
}
コード例 #2
0
ファイル: CreateEventWidget.cpp プロジェクト: fiendskull9/UDJ
CreateEventWidget::CreateEventWidget(
  DataStore *dataStore, 
  QWidget *parent):
  QWidget(parent),
  dataStore(dataStore)
{
  setupUi();
  connect(
    createEventButton,
    SIGNAL(clicked(bool)),
    this,
    SLOT(doLogin()));
  connect(
    dataStore,
    SIGNAL(eventCreated()),
    this,
    SLOT(eventCreateSuccess()));
  connect(
    dataStore,
    SIGNAL(eventCreationFailed()),
    this,
    SLOT(eventCreateFail()));
}
コード例 #3
0
ファイル: CreateEventWidget.cpp プロジェクト: fiendskull9/UDJ
void CreateEventWidget::eventCreateSuccess(){
  createProgress->setValue(1);
  emit eventCreated();
}