MyMusicTest::MyMusicTest(QWidget *parent): QMainWindow(parent) { setWindowTitle("My Music Player"); mStackedWidget = new QStackedWidget; setCentralWidget(mStackedWidget); mHttpWindow = new HttpWindow(); mStackedWidget->addWidget(mHttpWindow); mMyPlayerView = new MyPlayerView; mStackedWidget->addWidget(mMyPlayerView); mStackedWidget->setCurrentIndex(0); mAboutAction = new QAction(tr("About"), this); mExitAction = new QAction(tr("Exit"), this); mBackAction = new QAction(tr("Back"), this); connect(mHttpWindow, SIGNAL(streamSelected(QString)), this, SLOT(playStream(QString))); connect(mMyPlayerView, SIGNAL(backButtonPressed()), this, SLOT(showHttpView())); connect(mExitAction, SIGNAL(triggered()), this, SLOT(close())); connect(mAboutAction, SIGNAL(triggered()), this, SLOT(about())); connect(mBackAction, SIGNAL(triggered()), this, SLOT(showHttpView())); createMenus(true); }
/* * -------------------------------------------------------------- * -------------------------------------------------------------- */ void HttpWindow::PlayFile() { int selIndex = listWidget->currentRow(); if(selIndex >= 0 && selIndex < items.count()){ emit streamSelected(items[selIndex].audio); } }
void StreamsTab::streamAdded(int stream_index) { QtPulseAudio::Stream *s = manager->stream(stream_index); bool first = streamComboBox->count() == 0; //std::cout << s->name().toStdString() << std::endl; //std::cout << s->description().toStdString() << std::endl; streamComboBox->addItem(s->name(), stream_index); if(first) streamSelected(0); std::cout << "Stream added" << std::endl; }