本文整理汇总了C++中durationChanged函数的典型用法代码示例。如果您正苦于以下问题:C++ durationChanged函数的具体用法?C++ durationChanged怎么用?C++ durationChanged使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了durationChanged函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: mSession
QXAMediaPlayerControl::QXAMediaPlayerControl(QXAPlaySession *session, QObject *parent)
:QMediaPlayerControl(parent), mSession(session)
{
QT_TRACE_FUNCTION_ENTRY;
connect(mSession, SIGNAL(mediaChanged(const QMediaContent &)),
this, SIGNAL(mediaChanged(const QMediaContent& )));
connect(mSession, SIGNAL(durationChanged(qint64)),
this, SIGNAL(durationChanged(qint64)));
connect(mSession, SIGNAL(positionChanged(qint64)),
this, SIGNAL(positionChanged(qint64)));
connect(mSession, SIGNAL(stateChanged(QMediaPlayer::State)),
this, SIGNAL(stateChanged(QMediaPlayer::State)));
connect(mSession, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
this, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)));
connect(mSession, SIGNAL(volumeChanged(int)),
this, SIGNAL(volumeChanged(int)));
connect(mSession, SIGNAL(mutedChanged(bool)),
this, SIGNAL(mutedChanged(bool)));
connect(mSession, SIGNAL(audioAvailableChanged(bool)),
this, SIGNAL(audioAvailableChanged(bool)));
connect(mSession, SIGNAL(videoAvailableChanged(bool)),
this, SIGNAL(videoAvailableChanged(bool)));
connect(mSession,SIGNAL(bufferStatusChanged(int)),
this, SIGNAL(bufferStatusChanged(int)));
connect(mSession, SIGNAL(seekableChanged(bool)),
this, SIGNAL(seekableChanged(bool)));
connect(mSession, SIGNAL(availablePlaybackRangesChanged(const QMediaTimeRange&)),
this, SIGNAL(availablePlaybackRangesChanged(const QMediaTimeRange&)));
connect(mSession, SIGNAL(playbackRateChanged(qreal)),
this, SIGNAL(playbackRateChanged(qreal)));
connect(mSession, SIGNAL(error(int, const QString &)),
this, SIGNAL(error(int, const QString &)));
QT_TRACE_FUNCTION_EXIT;
}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:34,代码来源:qxamediaplayercontrol.cpp
示例2: QWidget
Player::Player(QWidget *parent)
: QWidget(parent)
, videoWidget(0)
, coverLabel(0)
, slider(0)
, audioEndpointSelector(0)
#ifdef Q_OS_SYMBIAN
// , mediaKeysObserver(0)
, playlistDialog(0)
, toggleAspectRatio(0)
, showYoutubeDialog(0)
, youtubeDialog(0)
#else
, colorDialog(0)
#endif
{
player = new QMediaPlayer(this);
// owned by PlaylistModel
playlist = new QMediaPlaylist();
player->setPlaylist(playlist);
connect(player, SIGNAL(durationChanged(qint64)), SLOT(durationChanged(qint64)));
connect(player, SIGNAL(positionChanged(qint64)), SLOT(positionChanged(qint64)));
connect(player, SIGNAL(metaDataChanged()), SLOT(metaDataChanged()));
connect(playlist, SIGNAL(currentIndexChanged(int)), SLOT(playlistPositionChanged(int)));
connect(player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
this, SLOT(statusChanged(QMediaPlayer::MediaStatus)));
connect(player, SIGNAL(bufferStatusChanged(int)), this, SLOT(bufferingProgress(int)));
connect(player, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(displayErrorMessage()));
videoWidget = new VideoWidget(this);
player->setVideoOutput(videoWidget);
playlistModel = new PlaylistModel(this);
playlistModel->setPlaylist(playlist);
playlistView = new QListView(this);
playlistView->setModel(playlistModel);
playlistView->setCurrentIndex(playlistModel->index(playlist->currentIndex(), 0));
connect(playlistView, SIGNAL(activated(QModelIndex)), this, SLOT(jump(QModelIndex)));
slider = new QSlider(Qt::Horizontal, this);
slider->setRange(0, player->duration() / 1000);
connect(slider, SIGNAL(sliderMoved(int)), this, SLOT(seek(int)));
QMediaService *service = player->service();
if (service) {
QMediaControl *control = service->requestControl(QAudioEndpointSelector_iid);
if (control) {
audioEndpointSelector = qobject_cast<QAudioEndpointSelector*>(control);
if (audioEndpointSelector) {
connect(audioEndpointSelector, SIGNAL(activeEndpointChanged(const QString&)),
this, SLOT(handleAudioOutputChangedSignal(const QString&)));
} else {
service->releaseControl(control);
}
}
}
开发者ID:abie0416,项目名称:Mashup,代码行数:60,代码来源:player.cpp
示例3: QMainWindow
ImageProcessing::ImageProcessing(QWidget *parent) : QMainWindow(parent) {
iImageIndex = 0;
m_NetTimeout = 0;
m_ImageTimeout = 0;
lbImage = new QLabel(this);
bTurnOff = false;
m_notRunning = true;
setWindowState(Qt::WindowFullScreen);
player = new QMediaPlayer(this);
playlist = new QMediaPlaylist();
player->setPlaylist(playlist);
m_contentList = new FileDownload(this);
m_imageFile = new FileDownload(this);
pNextImage = new QTimer();
connect(pNextImage, SIGNAL(timeout()), this, SLOT(timeout()));
connect(m_contentList, SIGNAL(downloaded()), this, SLOT(contentListDownloadComplete()));
connect(m_contentList, SIGNAL(downloadError(QNetworkReply::NetworkError)), this, SLOT(fileDownloadError(QNetworkReply::NetworkError)));
connect(m_imageFile, SIGNAL(downloaded()), this, SLOT(fileDownloadComplete()));
connect(m_imageFile, SIGNAL(downloadError(QNetworkReply::NetworkError)), this, SLOT(fileDownloadError(QNetworkReply::NetworkError)));
connect(player, SIGNAL(durationChanged(qint64)), this, SLOT(durationChanged(qint64)));
connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
connect(player, SIGNAL(metaDataChanged()), this, SLOT(metaDataChanged()));
connect(player, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(displayErrorMessage()));
connect(this, SIGNAL(fileDownloadsComplete()), this, SLOT(unlockShowEvent()));
videoWidget = new QVideoWidget(this);
player->setVideoOutput(videoWidget);
videoWidget->hide();
}
开发者ID:buelowp,项目名称:pictureframe,代码行数:34,代码来源:ImageProcessing.cpp
示例4: setAcceptDrops
void QSWindow::preload(){
//file control buttons and shortcuts
setAcceptDrops(true);
ui->tabWidget->setAcceptDrops(true);
connect(ui->actionOpen_File, SIGNAL(triggered()), SLOT(openFile()));
ui->actionOpen_File->setShortcut(QKeySequence::Open);
connect(ui->actionSave_File, SIGNAL(triggered()), SLOT(saveFile()));
ui->actionSave_File->setShortcut(QKeySequence::Save);
connect(ui->actionSave_File_as, SIGNAL(triggered()), SLOT(saveFileAs()));
ui->actionSave_File_as->setShortcut(QKeySequence::SaveAs);
connect(ui->actionClose, SIGNAL(triggered()), SLOT(closeFile()));
ui->actionClose->setShortcut(QKeySequence::Close);
connect(ui->actionPreset, SIGNAL(triggered()), SLOT(changePreset()));
connect(ui->actionDisplay_Keyboard, SIGNAL(triggered()), SLOT(displayKeyBoard()));
ui->actionDisplay_Keyboard->setShortcut(QKeySequence("ctrl+K"));
connect(ui->actionDisplay_specturm,SIGNAL(triggered()), SLOT(displaySpectrum()));
connect(ui->actionScore_to_wav, SIGNAL(triggered()), SLOT(scoreToWav()));
connect(ui->actionWav_to_score, SIGNAL(triggered()), SLOT(wavToScore()));
connect(ui->menuOpened, SIGNAL(triggered(QAction*)), SLOT(switchScene(QAction*)));
connect(this,SIGNAL(addFromLameSignal(QString)),this, SLOT(addFromLame(QString)), Qt::QueuedConnection);
//music state management
connect(mediaPlayer, SIGNAL(positionChanged(qint64)),
this,SLOT(positionChanged(qint64)),Qt::QueuedConnection);
connect(mediaPlayer, SIGNAL(durationChanged(qint64)),
this, SLOT(durationChanged(qint64)),Qt::QueuedConnection);
connect(mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), this,
SLOT(mediaStateChanged(QMediaPlayer::State)),Qt::QueuedConnection);
connect(positionSlider, SIGNAL(sliderReleased()), this, SLOT(setPosition()),Qt::QueuedConnection);
connect(playButton, SIGNAL(clicked()), this, SLOT(musicPlay()),Qt::QueuedConnection);
connect(recorder->recordButton, SIGNAL(clicked()), this, SLOT(record()));
}
开发者ID:scoreur,项目名称:QS,代码行数:35,代码来源:qswindow.cpp
示例5: QWidget
VideoPlayer::VideoPlayer(QWidget *parent)
: QWidget(parent)
, mediaPlayer(0, QMediaPlayer::VideoSurface)
, videoItem(0)
, playButton(0)
, positionSlider(0)
{
videoItem = new QGraphicsVideoItem;
videoItem->setSize(QSizeF(640, 480));
QGraphicsScene *scene = new QGraphicsScene(this);
QGraphicsView *graphicsView = new QGraphicsView(scene);
scene->addItem(videoItem);
QSlider *rotateSlider = new QSlider(Qt::Horizontal);
rotateSlider->setRange(-180, 180);
rotateSlider->setValue(0);
connect(rotateSlider, SIGNAL(valueChanged(int)),
this, SLOT(rotateVideo(int)));
QAbstractButton *openButton = new QPushButton(tr("Open..."));
connect(openButton, SIGNAL(clicked()), this, SLOT(openFile()));
playButton = new QPushButton;
playButton->setEnabled(false);
playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay));
connect(playButton, SIGNAL(clicked()),
this, SLOT(play()));
positionSlider = new QSlider(Qt::Horizontal);
positionSlider->setRange(0, 0);
connect(positionSlider, SIGNAL(sliderMoved(int)),
this, SLOT(setPosition(int)));
QBoxLayout *controlLayout = new QHBoxLayout;
controlLayout->setMargin(0);
controlLayout->addWidget(openButton);
controlLayout->addWidget(playButton);
controlLayout->addWidget(positionSlider);
QBoxLayout *layout = new QVBoxLayout;
layout->addWidget(graphicsView);
layout->addWidget(rotateSlider);
layout->addLayout(controlLayout);
setLayout(layout);
mediaPlayer.setVideoOutput(videoItem);
connect(&mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)),
this, SLOT(mediaStateChanged(QMediaPlayer::State)));
connect(&mediaPlayer, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
connect(&mediaPlayer, SIGNAL(durationChanged(qint64)), this, SLOT(durationChanged(qint64)));
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:57,代码来源:videoplayer.cpp
示例6: QWidget
VideoPlayer::VideoPlayer(QWidget *parent)
: QWidget(parent)
, mediaPlayer(0, QMediaPlayer::VideoSurface)
, playButton(0)
, positionSlider(0)
, errorLabel(0)
{
QVideoWidget *videoWidget = new QVideoWidget;
QAbstractButton *openButton = new QPushButton(tr("Open..."));
connect(openButton, SIGNAL(clicked()), this, SLOT(openFile()));
playButton = new QPushButton;
playButton->setEnabled(false);
playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay));
connect(playButton, SIGNAL(clicked()),
this, SLOT(play()));
positionSlider = new QSlider(Qt::Horizontal);
positionSlider->setRange(0, 0);
connect(positionSlider, SIGNAL(sliderMoved(int)),
this, SLOT(setPosition(int)));
errorLabel = new QLabel;
errorLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
QBoxLayout *controlLayout = new QHBoxLayout;
controlLayout->setMargin(0);
controlLayout->addWidget(openButton);
controlLayout->addWidget(playButton);
controlLayout->addWidget(positionSlider);
QBoxLayout *layout = new QVBoxLayout;
layout->addWidget(videoWidget);
layout->addLayout(controlLayout);
layout->addWidget(errorLabel);
setLayout(layout);
mediaPlayer.setVideoOutput(videoWidget);
connect(&mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)),
this, SLOT(mediaStateChanged(QMediaPlayer::State)));
connect(&mediaPlayer, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
connect(&mediaPlayer, SIGNAL(durationChanged(qint64)), this, SLOT(durationChanged(qint64)));
connect(&mediaPlayer, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(handleError()));
QFileInfo info("C:\\Users\\MichaU\\Desktop\\ResonanceP1.mp4");
QMediaPlaylist *lista = new QMediaPlaylist;
lista->addMedia(QUrl::fromLocalFile(info.absoluteFilePath()));
mediaPlayer.setPlaylist(lista);
mediaPlayer.play();
connect(lista,SIGNAL(currentIndexChanged(int)),this,SLOT(ChangePlaylist()));
}
开发者ID:MichalMierzwa,项目名称:AnimatedTiles,代码行数:57,代码来源:videoplayer.cpp
示例7: connect
void SMActionVideoNative::connectPlayer()
{
connect(mediaPlayer, SIGNAL(positionChanged(qint64)), SLOT(positionChanged(qint64)));
connect(mediaPlayer, SIGNAL(durationChanged(qint64)), SLOT(durationChanged(qint64)));
connect(mediaPlayer,
SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
SLOT(mediaStatusChanged(QMediaPlayer::MediaStatus)));
}
开发者ID:psmokotnin,项目名称:ShowManager,代码行数:9,代码来源:smactionvideonative.cpp
示例8: connect
MyPlayer::MyPlayer()
{
playerState = NOMUSIC;
connect(&player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(playNext(QMediaPlayer::MediaStatus)));
connect(&player, SIGNAL(durationChanged(qint64)), this, SIGNAL(durationChanged(qint64)));
connect(&player, SIGNAL(durationChanged(qint64)), this, SLOT(musicChanged()));
connect(&player, SIGNAL(positionChanged(qint64)), this, SIGNAL(positionChanged(qint64)));
connect(this, SIGNAL(playerStateChanged(int)), this, SLOT(stateChanged(int)));
}
开发者ID:AndyQsmart,项目名称:QtMusic-1.0,代码行数:9,代码来源:myplayer.cpp
示例9: m_session
QXAMediaRecoderControl::QXAMediaRecoderControl(QXARecordSession *session, QObject *parent)
:QMediaRecorderControl(parent), m_session(session)
{
connect(m_session, SIGNAL(stateChanged(QMediaRecorder::State)),
this, SIGNAL(stateChanged(QMediaRecorder::State)));
connect(m_session, SIGNAL(error(int,QString)),
this,SIGNAL(error(int,QString)));
connect(m_session, SIGNAL(durationChanged(qint64)),
this, SIGNAL(durationChanged(qint64)));
}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:10,代码来源:qxamediarecordercontrol.cpp
示例10: QMediaRecorderControl
BbCameraMediaRecorderControl::BbCameraMediaRecorderControl(BbCameraSession *session, QObject *parent)
: QMediaRecorderControl(parent)
, m_session(session)
{
connect(m_session, SIGNAL(videoStateChanged(QMediaRecorder::State)), this, SIGNAL(stateChanged(QMediaRecorder::State)));
connect(m_session, SIGNAL(videoStatusChanged(QMediaRecorder::Status)), this, SIGNAL(statusChanged(QMediaRecorder::Status)));
connect(m_session, SIGNAL(durationChanged(qint64)), this, SIGNAL(durationChanged(qint64)));
connect(m_session, SIGNAL(actualLocationChanged(QUrl)), this, SIGNAL(actualLocationChanged(QUrl)));
connect(m_session, SIGNAL(videoError(int,QString)), this, SIGNAL(error(int,QString)));
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:10,代码来源:bbcameramediarecordercontrol.cpp
示例11: QMediaPlayerControl
QT_BEGIN_NAMESPACE
QGstreamerPlayerControl::QGstreamerPlayerControl(QGstreamerPlayerSession *session, QObject *parent)
: QMediaPlayerControl(parent)
, m_ownStream(false)
, m_session(session)
, m_userRequestedState(QMediaPlayer::StoppedState)
, m_currentState(QMediaPlayer::StoppedState)
, m_mediaStatus(QMediaPlayer::NoMedia)
, m_bufferProgress(-1)
, m_pendingSeekPosition(-1)
, m_setMediaPending(false)
, m_stream(0)
{
m_resources = QMediaResourcePolicy::createResourceSet<QMediaPlayerResourceSetInterface>();
Q_ASSERT(m_resources);
connect(m_session, SIGNAL(positionChanged(qint64)),
this, SIGNAL(positionChanged(qint64)));
connect(m_session, SIGNAL(durationChanged(qint64)),
this, SIGNAL(durationChanged(qint64)));
connect(m_session, SIGNAL(mutedStateChanged(bool)),
this, SIGNAL(mutedChanged(bool)));
connect(m_session, SIGNAL(volumeChanged(int)),
this, SIGNAL(volumeChanged(int)));
connect(m_session, SIGNAL(stateChanged(QMediaPlayer::State)),
this, SLOT(updateSessionState(QMediaPlayer::State)));
connect(m_session,SIGNAL(bufferingProgressChanged(int)),
this, SLOT(setBufferProgress(int)));
connect(m_session, SIGNAL(playbackFinished()),
this, SLOT(processEOS()));
connect(m_session, SIGNAL(audioAvailableChanged(bool)),
this, SIGNAL(audioAvailableChanged(bool)));
connect(m_session, SIGNAL(videoAvailableChanged(bool)),
this, SIGNAL(videoAvailableChanged(bool)));
connect(m_session, SIGNAL(seekableChanged(bool)),
this, SIGNAL(seekableChanged(bool)));
connect(m_session, SIGNAL(error(int,QString)),
this, SIGNAL(error(int,QString)));
connect(m_session, SIGNAL(invalidMedia()),
this, SLOT(handleInvalidMedia()));
connect(m_session, SIGNAL(playbackRateChanged(qreal)),
this, SIGNAL(playbackRateChanged(qreal)));
connect(m_resources, SIGNAL(resourcesGranted()), SLOT(handleResourcesGranted()));
//denied signal should be queued to have correct state update process,
//since in playOrPause, when acquire is call on resource set, it may trigger a resourcesDenied signal immediately,
//so handleResourcesDenied should be processed later, otherwise it will be overwritten by state update later in playOrPause.
connect(m_resources, SIGNAL(resourcesDenied()), this, SLOT(handleResourcesDenied()), Qt::QueuedConnection);
connect(m_resources, SIGNAL(resourcesLost()), SLOT(handleResourcesLost()));
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:51,代码来源:qgstreamerplayercontrol.cpp
示例12: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setWindowFlags(Qt::FramelessWindowHint);
setAttribute(Qt::WA_TranslucentBackground);
ui->horizontalSlider->setRange(0, 0);
ui->tableWidget->hide();
ui->tableWidget->hideColumn(2);
volume=80;
createContextMenu();
createSystemTrayIcon();
playList=new QMediaPlaylist;
playList->setPlaybackMode(QMediaPlaylist::Loop);
player=new QMediaPlayer;
player->setPlaylist(playList);
player->setVolume(volume);
connect(ui->horizontalSlider, SIGNAL(sliderMoved(int)), this, SLOT(setPosition(int)));
connect(ui->tableWidget, SIGNAL(cellClicked(int,int)), this, SLOT(playTo(int, int)));
connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
connect(player, SIGNAL(durationChanged(qint64)), this, SLOT(durationChanged(qint64)));
connect(playList, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSongList(int)));
connect(ui->action_SongList, SIGNAL(triggered()), this, SLOT(showOrHideSongList()));
connect(ui->action_Import, SIGNAL(triggered()), this, SLOT(importSongs()));
connect(ui->action_Last, SIGNAL(triggered()), this, SLOT(playLast()));
connect(ui->action_Play, SIGNAL(triggered()), this, SLOT(playOrPause()));
connect(ui->action_Stop, SIGNAL(triggered()), player, SLOT(stop()));
connect(ui->action_Next, SIGNAL(triggered()), this, SLOT(playNext()));
connect(ui->action_SoundPlus, SIGNAL(triggered()), this, SLOT(plusSound()));
connect(ui->action_SoundReduce, SIGNAL(triggered()), this, SLOT(reduceSound()));
connect(ui->action_Mode1, SIGNAL(triggered()), this, SLOT(setPlaybackMode1()));
connect(ui->action_Mode2, SIGNAL(triggered()), this, SLOT(setPlaybackMode2()));
connect(ui->action_Mode3, SIGNAL(triggered()), this, SLOT(setPlaybackMode3()));
connect(ui->action_Mode4, SIGNAL(triggered()), this, SLOT(setPlaybackMode4()));
connect(ui->action_Support, SIGNAL(triggered()), this, SLOT(support()));
connect(ui->action_About, SIGNAL(triggered()), this, SLOT(aboutUs()));
connect(ui->action_Quit, SIGNAL(triggered()), this, SLOT(close()));
connect(ui->toolButton_Last, SIGNAL(clicked()), this, SLOT(playLast()));
connect(ui->toolButton_Play, SIGNAL(clicked()), this, SLOT(playOrPause()));
connect(ui->toolButton_Stop, SIGNAL(clicked()), player, SLOT(stop()));
connect(ui->toolButton_Next, SIGNAL(clicked()), this, SLOT(playNext()));
}
开发者ID:JasonDean-1,项目名称:Qt-Training,代码行数:51,代码来源:mainwindow.cpp
示例13: connect
void Music::setConnect()
{
connect(ui->actionAddfile, SIGNAL(triggered()), this, SLOT(add_file_triggered()));
connect(ui->actionAddFolder, SIGNAL(triggered()), this, SLOT(add_folder_triggered()));
connect(ui->actionClear, SIGNAL(triggered()), this, SLOT(clear_clicked()));
connect(ui->action_once, SIGNAL(triggered()), this, SLOT(once_clicked()));
connect(ui->action_repeat, SIGNAL(triggered()), this, SLOT(repeat_clicked()));
connect(ui->action_shuffle, SIGNAL(triggered()), this, SLOT(shuffle_clicked()));
connect(ui->locate, SIGNAL(sliderMoved(int)), this, SLOT(setPosition(int)));
connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
connect(player, SIGNAL(durationChanged(qint64)), this, SLOT(durationChanged(qint64)));
connect(ui->listMusic,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(listMusic_customContextMenuRequested(QPoint)));
}
开发者ID:listenmer,项目名称:music,代码行数:15,代码来源:music.cpp
示例14: QWidget
VideoPlayer::VideoPlayer(QWidget *parent)
: QWidget(parent)
, mediaPlayer(0, QMediaPlayer::VideoSurface)
, playButton(0)
, positionSlider(0)
// , errorLabel(0)
{
QVideoWidget *videoWidget = new QVideoWidget;
QAbstractButton *openButton = new QPushButton(tr("Open..."));
connect(openButton, SIGNAL(clicked()), this, SLOT(openFile()));
playButton = new QPushButton;
playButton->setEnabled(false);
playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay));
connect(playButton, SIGNAL(clicked()),
this, SLOT(play()));
positionSlider = new QSlider(Qt::Horizontal);
positionSlider->setRange(0, 0);
connect(positionSlider, SIGNAL(sliderMoved(int)),
this, SLOT(setPosition(int)));
//errorLabel = new QLabel;
//errorLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
QBoxLayout *controlLayout = new QHBoxLayout;
controlLayout->setMargin(0);
controlLayout->addWidget(openButton);
controlLayout->addWidget(playButton);
controlLayout->addWidget(positionSlider);
QBoxLayout *layout = new QVBoxLayout;
layout->addWidget(videoWidget);
layout->addLayout(controlLayout);
//layout->addWidget(errorLabel);
setLayout(layout);
mediaPlayer.setVideoOutput(videoWidget);
connect(&mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)),
this, SLOT(mediaStateChanged(QMediaPlayer::State)));
connect(&mediaPlayer, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
connect(&mediaPlayer, SIGNAL(durationChanged(qint64)), this, SLOT(durationChanged(qint64)));
connect(&mediaPlayer, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(handleError()));
}
开发者ID:hehaocong,项目名称:ivp,代码行数:48,代码来源:videoplayer.cpp
示例15: QMainWindow
MusicPlayer::MusicPlayer(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MusicPlayer)
{
ui->setupUi(this);
Player = new QMediaPlayer(this);
PlayList = new QMediaPlaylist;
connect(Player,SIGNAL(positionChanged(qint64)),this,SLOT(PositionChanged(qint64)));
connect(ui->LengthSlider,SIGNAL(sliderMoved(int)),this,SLOT(SetPosition(int)));
connect(Player,SIGNAL(durationChanged(qint64)),this,SLOT(DurationChanged(qint64)));
connect(Player,SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),this,SLOT(StatusChanged(QMediaPlayer::MediaStatus)));
connect(ui->VolumeSlider,SIGNAL(valueChanged(int)),this,SLOT(SetVolume(int)));
connect(ui->button_start,SIGNAL(released()),this,SLOT(Play()));
connect(ui->button_stop,SIGNAL(released()),this,SLOT(Stop()));
connect(ui->button_next,SIGNAL(released()),this,SLOT(Next()));
connect(ui->button_prev,SIGNAL(released()),this,SLOT(Prev()));
connect(ui->button_add,SIGNAL(released()),this,SLOT(Add()));
connect(ui->button_remove,SIGNAL(released()),this,SLOT(Remove()));
connect(ui->playlist,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(PlaySelected(QModelIndex)));
connect(ui->actionSave,SIGNAL(triggered()),this,SLOT(SavePlayList()));
connect(ui->actionLoad,SIGNAL(triggered()),this,SLOT(OpenPlayList()));
Player->setPlaylist(PlayList);
ui->VolumeSlider->setRange(0,100);
ui->VolumeSlider->setValue(100);
}
开发者ID:insectoman,项目名称:MusicPlayer,代码行数:34,代码来源:musicplayer.cpp
示例16: QWidget
MultimediaWidget::MultimediaWidget(QWidget *parent) : QWidget(parent), ui(new Ui::MultimediaWidget){
ui->setupUi(this); //load the designer file
//Add in the special QMultimediaWidgets
mediaObj = new QMediaPlayer(this);
mediaObj->setVolume(100);
mediaObj->setNotifyInterval(500); //only every 1/2 second update
videoDisplay = new QVideoWidget(this);
videoDisplay->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
ui->videoLayout->addWidget(videoDisplay);
mediaObj->setVideoOutput(videoDisplay);
videoDisplay->setVisible(false);
UpdateIcons();
UpdateText();
//Connect the special signals/slots for the media object
connect(mediaObj, SIGNAL(durationChanged(qint64)), this, SLOT(playerDurationChanged(qint64)) );
connect(mediaObj, SIGNAL(seekableChanged(bool)), ui->playerSlider, SLOT(setEnabled(bool)) );
connect(mediaObj, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(playerStatusChanged(QMediaPlayer::MediaStatus)) );
connect(mediaObj, SIGNAL(positionChanged(qint64)), this, SLOT(playerTimeChanged(qint64)) );
connect(mediaObj, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(playerStateChanged(QMediaPlayer::State)) );
connect(mediaObj, SIGNAL(videoAvailableChanged(bool)), this, SLOT(playerVideoAvailable(bool)) );
connect(mediaObj, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(playerError()) );
//Disable some of the initial states
ui->tool_player_stop->setEnabled(false); //nothing to stop yet
ui->tool_player_pause->setVisible(false); //nothing to pause yet
ui->playerSlider->setEnabled(false); //nothing to seek yet
}
开发者ID:trueos,项目名称:lumina,代码行数:30,代码来源:MultimediaWidget.cpp
示例17: durationChanged
void TestItem::setDuration(int duration){
if (duration != m_duration){
m_duration = duration;
emit durationChanged();
emit dataChanged();
}
}
开发者ID:Roadmaster,项目名称:checkbox,代码行数:7,代码来源:testitem.cpp
示例18: tr
void MainWindow::on_actionImport_Song_triggered()
{
audioFileName = QFileDialog::getOpenFileName(this, tr("Open File"),"/home/matt/Desktop",tr("Audio (*.mp3 *.wav)"));
if(audioFileName!="")
{
if(thePlayer!=NULL)
{
delete thePlayer;
thePlayer=NULL;
}
thePlayer = new QMediaPlayer();
thePlayer->setNotifyInterval(20);
connect(thePlayer,SIGNAL(durationChanged(qint64)),this,SLOT(updateSongDuration(qint64)));
connect(thePlayer,SIGNAL(stateChanged(QMediaPlayer::State)),this,SLOT(checkForNextSong(QMediaPlayer::State)));
connect(thePlayer,SIGNAL(positionChanged(qint64)),ui->label_2,SLOT(playPositionChanged(qint64)));
connect(ui->label_2,SIGNAL(userChangePlayPosition(qint64)),thePlayer,SLOT(setPosition(qint64)));
thePlayer->setMedia(QUrl::fromLocalFile(audioFileName));
if(ui->label_2->isSongAdded())
{
tempTrackCount=ui->label_2->getChannelSize();
ui->label_2->clearAllData();
ui->label_2->resetSongAdded();
}
}
}
开发者ID:madmaps,项目名称:XmasLightShow,代码行数:27,代码来源:mainwindow.cpp
示例19: QWidget
PlayerWidget::PlayerWidget(QWidget *parent) : QWidget(parent), ui(new Ui::PlayerWidget()){
ui->setupUi(this); //load the designer form
PLAYER = new QMediaPlayer(this);
PLAYER->setVolume(100);
PLAYER->setNotifyInterval(1000); //1 second interval (just needs to be a rough estimate)
PLAYLIST = new QMediaPlaylist(this);
PLAYLIST->setPlaybackMode(QMediaPlaylist::Sequential);
PLAYER->setPlaylist(PLAYLIST);
configMenu = new QMenu(this);
ui->tool_config->setMenu(configMenu);
addMenu = new QMenu(this);
ui->tool_add->setMenu(addMenu);
updatinglists = false; //start off as false
LoadIcons();
playerStateChanged(); //update button visibility
currentSongChanged();
//Connect all the signals/slots
//connect(infoTimer, SIGNAL(timeout()), this, SLOT(rotateTrackInfo()) );
connect(PLAYER, SIGNAL(positionChanged(qint64)),this, SLOT(updateProgress(qint64)) );
connect(PLAYER, SIGNAL(durationChanged(qint64)), this, SLOT(updateMaxProgress(qint64)) );
connect(PLAYLIST, SIGNAL(mediaChanged(int, int)), this, SLOT(playlistChanged()) );
connect(PLAYER, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(playerStateChanged()) );
connect(PLAYLIST, SIGNAL(currentMediaChanged(const QMediaContent&)), this, SLOT(currentSongChanged()) );
connect(ui->combo_playlist, SIGNAL(currentIndexChanged(int)), this, SLOT(userlistSelectionChanged()) );
connect(ui->tool_play, SIGNAL(clicked()), this, SLOT(playClicked()) );
connect(ui->tool_pause, SIGNAL(clicked()), this, SLOT(pauseClicked()) );
connect(ui->tool_stop, SIGNAL(clicked()), this, SLOT(stopClicked()) );
connect(ui->tool_next, SIGNAL(clicked()), this, SLOT(nextClicked()) );
connect(ui->tool_prev, SIGNAL(clicked()), this, SLOT(prevClicked()) );
}
开发者ID:HenryHu,项目名称:lumina,代码行数:34,代码来源:PlayerWidget.cpp
示例20: error
void DirectShowPlayerControl::emitPropertyChanges()
{
int properties = m_updateProperties;
m_updateProperties = 0;
if ((properties & ErrorProperty) && m_error != QMediaPlayer::NoError)
emit error(m_error, m_errorString);
if (properties & PlaybackRateProperty)
emit playbackRateChanged(m_playbackRate);
if (properties & StreamTypesProperty) {
emit audioAvailableChanged(m_streamTypes & DirectShowPlayerService::AudioStream);
emit videoAvailableChanged(m_streamTypes & DirectShowPlayerService::VideoStream);
}
if (properties & PositionProperty)
emit positionChanged(m_position);
if (properties & DurationProperty)
emit durationChanged(m_duration);
if (properties & SeekableProperty)
emit seekableChanged(m_seekable);
if (properties & StatusProperty)
emit mediaStatusChanged(m_status);
if (properties & StateProperty)
emit stateChanged(m_state);
}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:31,代码来源:directshowplayercontrol.cpp
注:本文中的durationChanged函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论