[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/graphics/gwenview
From:       Aurélien Gâteau <aurelien.gateau () free ! fr>
Date:       2006-09-07 22:26:03
Message-ID: 1157667963.870559.1275.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 581917 by gateau:

Make the slideshow waits for the video to finish if it can find the video
duration. So far this works with Avi and Ogg/Theora videos, not with Mpeg nor
QuickTime videos.


 M  +5 -0      NEWS  
 M  +1 -0      gvcore/Makefile.am  
 M  +8 -0      gvcore/document.cpp  
 M  +2 -0      gvcore/document.h  
 M  +4 -0      gvcore/documentimpl.cpp  
 M  +2 -0      gvcore/documentimpl.h  
 A             gvcore/documentotherloadedimpl.cpp   [License: GPL (v2+) (wrong address)]
 M  +2 -0      gvcore/documentotherloadedimpl.h  
 M  +13 -3     gvcore/slideshow.cpp  
 M  +1 -0      gvcore/slideshow.h  


--- trunk/extragear/graphics/gwenview/NEWS #581916:581917
@@ -1,3 +1,8 @@
+2006.xx.xx - v1.4.0
+- Fixes:
+ - In a slideshow, let videos play to the end before showing next image/video.
+   For now it works with Avi and Ogg videos, not with Mpeg or Quicktime videos.
+
 2006.07.19 - v1.3.93
 - New features:
  - Use the same delete dialog as Amarok and Juk, to easily choose between
--- trunk/extragear/graphics/gwenview/gvcore/Makefile.am #581916:581917
@@ -47,6 +47,7 @@
 	documentloadedimpl.cpp \
 	documentjpegloadedimpl.cpp \
 	documentanimatedloadedimpl.cpp \
+	documentotherloadedimpl.cpp \
 	busylevelmanager.cpp \
 	cache.cpp \
 	threadgate.cpp \
--- trunk/extragear/graphics/gwenview/gvcore/document.cpp #581916:581917
@@ -278,6 +278,14 @@
 	return d->mImpl->commentState();
 }
 
+/**
+ * Returns the duration of the document in seconds, or 0 if there is no
+ * duration
+ */
+int Document::duration() const {
+	return d->mImpl->duration();
+}
+
 int Document::fileSize() const {
 	return d->mFileSize;
 }
--- trunk/extragear/graphics/gwenview/gvcore/document.h #581916:581917
@@ -77,6 +77,8 @@
 	Document::CommentState commentState() const;
 	QString comment() const;
 	void setComment(const QString&);
+
+	int duration() const;
 	
 public slots:
 	void setURL(const KURL&);
--- trunk/extragear/graphics/gwenview/gvcore/documentimpl.cpp #581916:581917
@@ -60,6 +60,10 @@
 void DocumentImpl::setComment(const QString&) {
 }
 
+int DocumentImpl::duration() const {
+	return 0;
+}
+
 void DocumentImpl::transform(ImageUtils::Orientation) {
 }
 
--- trunk/extragear/graphics/gwenview/gvcore/documentimpl.h #581916:581917
@@ -50,12 +50,14 @@
 	virtual QString comment() const;
 	virtual Document::CommentState commentState() const;
 	virtual void setComment(const QString&);
+	virtual int duration() const;
 	
 	virtual void transform(ImageUtils::Orientation);
 	virtual QString save(const KURL&, const QCString& format) const;
 
 	virtual MimeTypeUtils::Kind urlKind() const=0;
 
+
 signals:
 	void finished(bool success);
 	void sizeUpdated(int width, int height);
--- trunk/extragear/graphics/gwenview/gvcore/documentotherloadedimpl.h #581916:581917
@@ -41,6 +41,8 @@
 	}
 
 	virtual MimeTypeUtils::Kind urlKind() const { return MimeTypeUtils::KIND_FILE; }
+
+	virtual int duration() const;
 };
 
 } // namespace
--- trunk/extragear/graphics/gwenview/gvcore/slideshow.cpp #581916:581917
@@ -65,11 +65,21 @@
 
 void SlideShow::slotSettingsChanged() {
 	if (mTimer->isActive()) {
-		mTimer->changeInterval(int(SlideShowConfig::delay()*1000));
+		mTimer->changeInterval(timerInterval());
 	}
 }
 
 
+int SlideShow::timerInterval() {
+	int documentDuration = mDocument->duration();
+	if (documentDuration != 0) {
+		return documentDuration * 1000;
+	} else {
+		return int(SlideShowConfig::delay()*1000);
+	}
+}
+
+
 void SlideShow::start(const KURL::List& urls) {
 	mURLs.resize(urls.size());
 	qCopy(urls.begin(), urls.end(), mURLs.begin());
@@ -83,7 +93,7 @@
 		return;
 	}
 	
-	mTimer->start(int(SlideShowConfig::delay()*1000), true);
+	mTimer->start(timerInterval(), true);
 	mStarted=true;
 	prefetch();
 	emit stateChanged(true);
@@ -144,7 +154,7 @@
 
 void SlideShow::slotLoaded() {
 	if (mStarted) {
-		mTimer->start(int(SlideShowConfig::delay()*1000), true);
+		mTimer->start(timerInterval(), true);
 		prefetch();
 	}
 }
--- trunk/extragear/graphics/gwenview/gvcore/slideshow.h #581916:581917
@@ -70,6 +70,7 @@
 private:
 	QValueVector<KURL>::ConstIterator findNextURL() const;
 	void prefetch();
+	int timerInterval();
 
 	QTimer* mTimer;
 	Document* mDocument;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic