当前位置: 首页>>代码示例>>C++>>正文


C++ AudioPlayer::playbackOrder方法代码示例

本文整理汇总了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();
}
开发者ID:,项目名称:,代码行数:80,代码来源:


注:本文中的AudioPlayer::playbackOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。