summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMauricio Piacentini <mauricio.piacentini@collabora.co.uk>2010-11-01 09:07:11 -0200
committerMauricio Piacentini <mauricio.piacentini@collabora.co.uk>2010-11-03 11:34:52 -0200
commit551f3ad27b8db9cee5487c8bdae82f78088d1052 (patch)
tree97319b3cc425a84229fe18a450b111c21848b402 /examples
parentf70551a4ca93cc66d8b664c81415212c943905cc (diff)
Initial implementation of QGst::Event
Diffstat (limited to 'examples')
-rw-r--r--examples/player/main.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/examples/player/main.cpp b/examples/player/main.cpp
index 6d5f41f..e04697a 100644
--- a/examples/player/main.cpp
+++ b/examples/player/main.cpp
@@ -29,6 +29,7 @@
#include <QGst/Message>
#include <QGst/Query>
#include <QGst/Clock>
+#include <QGst/Event>
/* This is a simple example of a command-line audio player. It accepts the filename of
* an audio file as the first command line argument and then constructs a pipeline
@@ -104,7 +105,23 @@ void Player::onBusSyncMessage(const QGst::MessagePtr & message)
//This will create a temporary (cast to query).
m_pipeline->query(query);
- qDebug() << QGst::Clock::timeFromClockTime(query->duration());
+ //qDebug() << QGst::Clock::timeFromClockTime(query->duration());
+
+ /*Set the pipeline to seek to 6 seconds in the stream and play until it reaches 15 secs
+ * Notice that using element->seek() is probably better in most cases
+ *
+ QGst::SeekEventPtr evt = QGst::SeekEvent::create(1.0, QGst::FormatTime,
+ QGst::SeekFlagNone,
+ QGst::SeekTypeSet,
+ QGst::Clock::clockTimeFromTime(QTime(0,0,6)),
+ QGst::SeekTypeSet,
+ QGst::Clock::clockTimeFromTime(QTime(0,0,15))
+ );
+ m_pipeline->sendEvent(evt);*/
+
+ /* this is the simple seek version
+ m_pipeline->seek(QGst::FormatTime, QGst::SeekFlagNone,
+ QGst::Clock::clockTimeFromTime(QTime(0,0,15)) );*/
}
break;
default: