void PlayList::insert(const QString &url, int row) { PlayListItem item; item.setUrl(url); item.setDuration(0); item.setLastTime(0); QString title = url; if (!url.contains("://") || url.startsWith("file://")) { title = QFileInfo(url).fileName(); } item.setTitle(title); insertItemAt(item, row); }
void PlayerWindow::play(const QString &name) { mFile = name; mTitle = mFile; if (!mFile.contains(QLatin1String("://")) || mFile.startsWith(QLatin1String("file://"))) { mTitle = QFileInfo(mFile).fileName(); } setWindowTitle(mTitle); PlayListItem item; item.setUrl(mFile); item.setTitle(mTitle); item.setLastTime(0); //m_vo->setOrientation(180); m_player->play(name); m_player2->play(name); m_player2->setVideoStream(1); m_player2->audio()->setMute(true); //totalTime->setText(QString::number(m_player->duration())); m_playBtn->setStyleSheet("QPushButton { border-image: url(:/images/images/music_player/pause_hover_and_active.png);}"); currentTime->setText("00:00:00"); totalTime->setText("00:00:00"); //m_vo->setOutAspectRatio(1.42529); m_vo->setOutAspectRatio(double(m_vo->widget()->width())/double(m_vo->widget()->height())); m_vo2->setOutAspectRatio(double(m_vo2->widget()->width())/double(m_vo2->widget()->height())); if (mpPlayList->isClicked){ rowForPlay = mpPlayList->rowIndex; } if (mpPlayListEvent->isClicked){ rowForPlay = mpPlayListEvent->rowIndex; } container->show(); }