summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-01-06 14:52:31 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-01-06 14:52:31 (GMT)
commit216adf3dbe76f3c09340aafee875da28d3f36605 (patch)
tree87baec4b6c73ca569f4bbd74f86010cfa236c75a /demos
parent66275bc468339ec2599ba660b728304858e30b39 (diff)
parent3f648dc075689e2ffedda2769cc76b4a56fb1073 (diff)
downloadQt-216adf3dbe76f3c09340aafee875da28d3f36605.zip
Qt-216adf3dbe76f3c09340aafee875da28d3f36605.tar.gz
Qt-216adf3dbe76f3c09340aafee875da28d3f36605.tar.bz2
Merge branch 'mmfphonon' into 4.6
Diffstat (limited to 'demos')
-rw-r--r--demos/qmediaplayer/mediaplayer.cpp16
-rw-r--r--demos/qmediaplayer/mediaplayer.h1
2 files changed, 12 insertions, 5 deletions
diff --git a/demos/qmediaplayer/mediaplayer.cpp b/demos/qmediaplayer/mediaplayer.cpp
index 8f6848f..8471ebd 100644
--- a/demos/qmediaplayer/mediaplayer.cpp
+++ b/demos/qmediaplayer/mediaplayer.cpp
@@ -673,6 +673,13 @@ void MediaPlayer::setFile(const QString &fileName)
m_MediaObject.play();
}
+void MediaPlayer::setLocation(const QString& location)
+{
+ setWindowTitle(location.right(location.length() - location.lastIndexOf('/') - 1));
+ m_MediaObject.setCurrentSource(Phonon::MediaSource(QUrl::fromEncoded(location.toUtf8())));
+ m_MediaObject.play();
+}
+
bool MediaPlayer::playPauseForDialog()
{
// If we're running on a small screen, we want to pause the video when
@@ -850,9 +857,7 @@ void MediaPlayer::openUrl()
bool ok = false;
sourceURL = QInputDialog::getText(this, tr("Open Location"), tr("Please enter a valid address here:"), QLineEdit::Normal, sourceURL, &ok);
if (ok && !sourceURL.isEmpty()) {
- setWindowTitle(sourceURL.right(sourceURL.length() - sourceURL.lastIndexOf('/') - 1));
- m_MediaObject.setCurrentSource(Phonon::MediaSource(QUrl::fromEncoded(sourceURL.toUtf8())));
- m_MediaObject.play();
+ setLocation(sourceURL);
settings.setValue("location", sourceURL);
}
}
@@ -892,10 +897,11 @@ void MediaPlayer::openRamFile()
}
if (!list.isEmpty()) {
- m_MediaObject.setCurrentSource(Phonon::MediaSource(list[0]));
- m_MediaObject.play();
+ m_MediaObject.clearQueue();
+ setLocation(list[0].toString());
for (int i = 1; i < list.count(); i++)
m_MediaObject.enqueue(Phonon::MediaSource(list[i]));
+ m_MediaObject.play();
}
forwardButton->setEnabled(!m_MediaObject.queue().isEmpty());
diff --git a/demos/qmediaplayer/mediaplayer.h b/demos/qmediaplayer/mediaplayer.h
index 14ed4ac..fc1bd90 100644
--- a/demos/qmediaplayer/mediaplayer.h
+++ b/demos/qmediaplayer/mediaplayer.h
@@ -112,6 +112,7 @@ public:
void dropEvent(QDropEvent *e);
void handleDrop(QDropEvent *e);
void setFile(const QString &text);
+ void setLocation(const QString &location);
void initVideoWindow();
void initSettingsDialog();