本文整理汇总了C++中AudioPlayer::playbackOrder方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioPlayer::playbackOrder方法的具体用法?C++ AudioPlayer::playbackOrder怎么用?C++ AudioPlayer::playbackOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AudioPlayer
的用法示例。
在下文中一共展示了AudioPlayer::playbackOrder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QMainWindow
MainWindow::MainWindow(AudioPlayer &player, QWidget *parent)
: QMainWindow(parent),
statusBar_(this),
player_(player),
cursorFollowsPlayback_(false),
saveTabs_(false) {
setupUi(this);
// Not saving a pointer to this
QActionGroup *playbackOrderGroup = new QActionGroup(this);
playbackOrderGroup->addAction(defaultAction);
playbackOrderGroup->addAction(randomAction);
playbackOrderGroup->addAction(repeatTrackAction);
playbackOrderGroup->addAction(repeatPlaylistAction);
installEventFilter(this);
player.setMainWindow(this);
QObject::connect(&player_, SIGNAL(playbackOrderChanged(PlaybackOrder)), this,
SLOT(playbackOrderChanged(PlaybackOrder)));
QObject::connect(&player_, SIGNAL(audioStateChanged(AudioState)), this,
SLOT(slotAudioStateChanged(AudioState)));
QObject::connect(&player_, SIGNAL(trackPlaying(PTrack)), this, SLOT(updateUI(PTrack)));
playbackOrderChanged(player.playbackOrder());
QObject::connect(&player_, SIGNAL(tick(qint64)), this, SLOT(tick(qint64)));
seekSlider_ = new SeekSlider(player_, this);
volumeSlider_ = new QSlider(this);
volumeSlider_->setOrientation(Qt::Horizontal);
volumeSlider_->setMaximum(100);
volumeSlider_->setMinimum(0);
volumeSlider_->setValue(player_.volume() * 100);
volumeSlider_->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
QObject::connect(volumeSlider_, SIGNAL(valueChanged(int)), this, SLOT(volumeChanged(int)));
mainToolBar->addWidget(seekSlider_);
mainToolBar->addWidget(volumeSlider_);
trayIcon_ = new QSystemTrayIcon(this);
setTrayIcon(false);
connect(trayIcon_, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this,
SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
trayIcon_->show();
setStatusBar(&statusBar_);
QObject::connect(&statusBar_, SIGNAL(statusBarDoubleClicked()), this,
SLOT(statusBarDoubleClicked()));
lyricsDock_ = new QDockWidget("Lyrics", this);
// Not setting an object name because we don't want save its state
// since Qt doesn't restore it correctly
// lyricsDock_->setObjectName("LyricsDock");
lyricsWidget_ = new QPlainTextEdit(lyricsDock_);
// lyricsWidget_->setObjectName("LyricsWidget");
lyricsWidget_->setReadOnly(true);
lyricsDock_->setWidget(lyricsWidget_);
QObject::connect(lyricsDock_, SIGNAL(visibilityChanged(bool)), this,
SLOT(dockVisibilityChanged(bool)));
// playlistTabs->setTabsClosable(true);
QObject::connect(playlistTabs, SIGNAL(tabCloseRequested(int)), this,
SLOT(removePlaylistTab(int)));
QObject::connect(playlistTabs, SIGNAL(newTabRequested()), this, SLOT(newTabRequested()));
QObject::connect(menu_File, SIGNAL(aboutToShow()), this, SLOT(menuFileAboutToShow()));
setWindowIcon(QIcon(":/icon/logo22.png"));
instance = this;
console_ = new ConsoleWindow(this);
QObject::connect(console_, SIGNAL(visibilityChanged(bool)), this,
SLOT(consoleVisibilityChanged(bool)));
readSettings();
config_.set("mainwindow.save_tabs", QVariant(saveTabs_));
QObject::connect(&config_, SIGNAL(keySet(QString, QVariant)), this,
SLOT(configChanged(QString, QVariant)));
setShortcuts();
}