commit kde4-kaffeine for openSUSE:Factory
Hello community, here is the log from the commit of package kde4-kaffeine for openSUSE:Factory checked in at Thu Feb 26 17:02:15 CET 2009. -------- --- KDE/kde4-kaffeine/kde4-kaffeine.changes 2009-02-18 11:08:21.000000000 +0100 +++ kde4-kaffeine/kde4-kaffeine.changes 2009-02-25 10:45:04.000000000 +0100 @@ -1,0 +2,5 @@ +Wed Feb 25 10:45:01 CET 2009 - stbinner@suse.de + +- update to r931423 + +------------------------------------------------------------------- calling whatdependson for head-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kde4-kaffeine.spec ++++++ --- /var/tmp/diff_new_pack.n23084/_old 2009-02-26 17:01:54.000000000 +0100 +++ /var/tmp/diff_new_pack.n23084/_new 2009-02-26 17:01:54.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package kde4-kaffeine (Version 4.2.0.svn927725) +# spec file for package kde4-kaffeine (Version 4.2.0.svn931423) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -24,8 +24,8 @@ License: GPL v2 or later Group: Productivity/Multimedia/Video/Players Summary: Xine-Based Multimedia Player -Version: 4.2.0.svn927725 -Release: 2 +Version: 4.2.0.svn931423 +Release: 1 # svn.kde.org/home/kde/trunk/extragear/multimedia/kaffeine Source0: kaffeine.tar.bz2 Patch: desktop-files.diff @@ -72,6 +72,8 @@ /usr/share/applications/kde4/kaffeine4.desktop %changelog +* Wed Feb 25 2009 stbinner@suse.de +- update to r931423 * Wed Feb 18 2009 stbinner@suse.de - update to r927725 * Wed Jan 07 2009 stbinner@suse.de ++++++ kaffeine.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kaffeine/README new/kaffeine/README --- old/kaffeine/README 2009-02-18 11:07:59.000000000 +0100 +++ new/kaffeine/README 2009-02-24 18:46:11.000000000 +0100 @@ -1,3 +1,8 @@ +Requirements +============ + +Phonon 4.3 and KDE 4.2 are strongly recommended. + Naming ====== @@ -11,6 +16,3 @@ You are welcome to report crashes and stuff that doesn't work the right way. We know what stuff isn't implemented yet, so please don't report that (ok, I admit that this distinction sometimes isn't too easy if you don't know the code). - -One known bug is that you can only switch channels once (and kaffeine will crash -at exit); this is being investigated. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kaffeine/src/dvb/dvbtab.cpp new/kaffeine/src/dvb/dvbtab.cpp --- old/kaffeine/src/dvb/dvbtab.cpp 2009-02-18 11:07:59.000000000 +0100 +++ new/kaffeine/src/dvb/dvbtab.cpp 2009-02-20 15:41:24.000000000 +0100 @@ -20,19 +20,17 @@ #include "dvbtab.h" -#include <QHBoxLayout> -#include <QLabel> +#include <QBoxLayout> #include <QSplitter> +#include <Phonon/AbstractMediaStream> #include <KAction> #include <KActionCollection> -#include <KDebug> #include <KLineEdit> #include <KLocalizedString> #include <KMenu> #include <KMessageBox> #include "../mediawidget.h" #include "../proxytreeview.h" -#include "dvbchannel.h" #include "dvbchannelview.h" #include "dvbconfigdialog.h" #include "dvbdevice.h" @@ -40,13 +38,11 @@ #include "dvbrecording.h" #include "dvbscandialog.h" -// FIXME - DvbStream is just a demo hack - -class DvbStream : public DvbLiveFeed, public DvbPidFilter +class DvbStream : public Phonon::AbstractMediaStream, public DvbPidFilter { public: - DvbStream(DvbManager *dvbManager_, DvbDevice *device_, DvbSharedChannel channel_) : - dvbManager(dvbManager_), device(device_), channel(channel_), bufferPos(0) + DvbStream(DvbDevice *device_, const DvbSharedChannel &channel_) : device(device_), + channel(channel_), bufferPos(0) { setStreamSize(-1); buffer.resize(188 * 64); @@ -54,21 +50,6 @@ ~DvbStream() { } - void livePaused(bool /*paused*/) - { - // FIXME timeshift & co - } - - void liveStopped() - { - if (device != NULL) { - device->stopDevice(); - dvbManager->releaseDevice(device); - device = NULL; - } - } - - DvbManager *dvbManager; DvbDevice *device; DvbSharedChannel channel; @@ -221,37 +202,29 @@ void DvbTab::liveStopped() { + DvbDevice *device = liveStream->device; + device->stopDevice(); + dvbManager->releaseDevice(device); liveStream = NULL; } void DvbTab::playChannel(const DvbSharedChannel &channel) { - if (liveStream != NULL) { - liveStream->liveStopped(); - // FIXME hacky; but ok for now - disconnect(liveStream, SIGNAL(destroyed(QObject *)), this, SLOT(liveStopped())); - liveStream = NULL; - } - - // don't call mediaWidget->stop() here - // otherwise the media widget runs into trouble - // because the stop event arrives after starting playback ... + delete liveStream; // liveStream is set to NULL by liveStopped() if (channel == NULL) { - mediaWidget->stop(); return; } DvbDevice *device = dvbManager->requestDevice(channel->source); if (device == NULL) { - mediaWidget->stop(); KMessageBox::sorry(this, i18n("No suitable device found.")); return; } - liveStream = new DvbStream(dvbManager, device, channel); - connect(liveStream, SIGNAL(destroyed(QObject *)), this, SLOT(liveStopped())); + liveStream = new DvbStream(device, channel); + connect(liveStream, SIGNAL(destroyed(QObject*)), this, SLOT(liveStopped())); device->tuneDevice(channel->transponder); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kaffeine/src/dvb/dvbtab.h new/kaffeine/src/dvb/dvbtab.h --- old/kaffeine/src/dvb/dvbtab.h 2009-02-18 11:07:59.000000000 +0100 +++ new/kaffeine/src/dvb/dvbtab.h 2009-02-20 15:41:24.000000000 +0100 @@ -51,7 +51,6 @@ void showChannelDialog(); void showRecordingDialog(); void configureDvb(); - void playLive(const QModelIndex &index); void liveStopped(); @@ -66,7 +65,6 @@ ProxyTreeView *channelView; - // FIXME - just a demo hack DvbStream *liveStream; }; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kaffeine/src/kaffeine.cpp new/kaffeine/src/kaffeine.cpp --- old/kaffeine/src/kaffeine.cpp 2009-02-18 11:07:59.000000000 +0100 +++ new/kaffeine/src/kaffeine.cpp 2009-02-24 18:46:11.000000000 +0100 @@ -23,7 +23,6 @@ #include <QLabel> #include <QPushButton> #include <QStackedLayout> -#include <QTimer> #include <KActionCollection> #include <KCmdLineOptions> #include <KFileDialog> @@ -129,9 +128,6 @@ Kaffeine::Kaffeine() { - // unlike qt, kde sets this flag - setAttribute(Qt::WA_DeleteOnClose, false); - // menu structure KMenuBar *menuBar = KMainWindow::menuBar(); @@ -215,7 +211,7 @@ stackedLayout = new QStackedLayout(widget); setCentralWidget(widget); - mediaWidget = new MediaWidget(widget, toolBar, collection); + mediaWidget = new MediaWidget(toolBar, collection, widget); connect(mediaWidget, SIGNAL(toggleFullscreen()), this, SLOT(toggleFullscreen())); // tabs @@ -248,11 +244,6 @@ // workaround setAutoSaveSettings() which doesn't accept "IconOnly" as initial state toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); - // workaround broken size restoring - if (KConfig().group("Workarounds").readEntry("Maximized", false)) { - QTimer::singleShot(0, this, SLOT(showMaximized())); - } - parseArgs(); show(); @@ -260,9 +251,6 @@ Kaffeine::~Kaffeine() { - // workaround broken size restoring - KConfig().group("Workarounds").writeEntry("Maximized", isMaximized()); - actionOpenRecent->saveEntries(KConfigGroup(KGlobal::config(), "Recent Files")); } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kaffeine/src/main.cpp new/kaffeine/src/main.cpp --- old/kaffeine/src/main.cpp 2009-02-18 11:07:59.000000000 +0100 +++ new/kaffeine/src/main.cpp 2009-02-24 18:46:11.000000000 +0100 @@ -28,13 +28,20 @@ class KaffeineApplication : public KUniqueApplication { public: - KaffeineApplication() { } - ~KaffeineApplication() { } + KaffeineApplication() + { + kaffeine = new Kaffeine(); + } + + ~KaffeineApplication() + { + // unlike qt, kde sets Qt::WA_DeleteOnClose and needs it to work properly ... + } private: int newInstance(); - Kaffeine kaffeine; + Kaffeine *kaffeine; }; int KaffeineApplication::newInstance() @@ -42,7 +49,7 @@ // for window activation - FIXME do some checks about behaviour KUniqueApplication::newInstance(); - kaffeine.parseArgs(); + kaffeine->parseArgs(); return 0; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kaffeine/src/mediawidget.cpp new/kaffeine/src/mediawidget.cpp --- old/kaffeine/src/mediawidget.cpp 2009-02-18 11:07:59.000000000 +0100 +++ new/kaffeine/src/mediawidget.cpp 2009-02-21 13:24:30.000000000 +0100 @@ -1,7 +1,7 @@ /* * mediawidget.cpp * - * Copyright (C) 2007-2008 Christoph Pfister <christophpfister@gmail.com> + * Copyright (C) 2007-2009 Christoph Pfister <christophpfister@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,21 +23,22 @@ #include <QBoxLayout> #include <Phonon/AbstractMediaStream> #include <Phonon/AudioOutput> +#include <Phonon/MediaController> #include <Phonon/MediaObject> -#include <Phonon/Path> #include <Phonon/SeekSlider> #include <Phonon/VideoWidget> #include <Phonon/VolumeSlider> #include <KAction> #include <KActionCollection> +#include <KComboBox> #include <KLocalizedString> #include <KMessageBox> #include <KToolBar> #include <KUrl> -#include "kaffeine.h" -MediaWidget::MediaWidget(QWidget *parent, KToolBar *toolBar, KActionCollection *collection) : - QWidget(parent), liveFeed(NULL), playing(true) +MediaWidget::MediaWidget(KToolBar *toolBar, KActionCollection *collection, QWidget *parent) : + QWidget(parent), playing(true), titleCount(0), chapterCount(0), audioChannelsReady(false), + subtitlesReady(false) { QBoxLayout *layout = new QVBoxLayout(this); layout->setMargin(0); @@ -53,30 +54,52 @@ Phonon::createPath(mediaObject, videoWidget); layout->addWidget(videoWidget); - actionBackward = new KAction(KIcon("media-skip-backward"), i18n("Previous"), collection); - toolBar->addAction(collection->addAction("controls_previous", actionBackward)); + mediaController = new Phonon::MediaController(mediaObject); + connect(mediaController, SIGNAL(availableTitlesChanged(int)), + this, SLOT(titleCountChanged(int))); + connect(mediaController, SIGNAL(availableChaptersChanged(int)), + this, SLOT(chapterCountChanged(int))); + connect(mediaController, SIGNAL(availableAudioChannelsChanged()), + this, SLOT(audioChannelsChanged())); + connect(mediaController, SIGNAL(availableSubtitlesChanged()), + this, SLOT(subtitlesChanged())); + + actionPrevious = new KAction(KIcon("media-skip-backward"), i18n("Previous"), collection); + connect(actionPrevious, SIGNAL(triggered(bool)), this, SLOT(previous())); + toolBar->addAction(collection->addAction("controls_previous", actionPrevious)); actionPlayPause = new KAction(collection); - connect(actionPlayPause, SIGNAL(triggered(bool)), this, SLOT(playPause(bool))); actionPlayPause->setShortcut(Qt::Key_Space); textPlay = i18n("Play"); textPause = i18n("Pause"); iconPlay = KIcon("media-playback-start"); iconPause = KIcon("media-playback-pause"); + connect(actionPlayPause, SIGNAL(triggered(bool)), this, SLOT(playPause(bool))); toolBar->addAction(collection->addAction("controls_play_pause", actionPlayPause)); actionStop = new KAction(KIcon("media-playback-stop"), i18n("Stop"), collection); connect(actionStop, SIGNAL(triggered(bool)), this, SLOT(stop())); toolBar->addAction(collection->addAction("controls_stop", actionStop)); - actionForward = new KAction(KIcon("media-skip-forward"), i18n("Next"), collection); - toolBar->addAction(collection->addAction("controls_next", actionForward)); + actionNext = new KAction(KIcon("media-skip-forward"), i18n("Next"), collection); + connect(actionNext, SIGNAL(triggered(bool)), this, SLOT(next())); + toolBar->addAction(collection->addAction("controls_next", actionNext)); + + audioChannelBox = new KComboBox(toolBar); + connect(audioChannelBox, SIGNAL(currentIndexChanged(int)), + this, SLOT(changeAudioChannel(int))); + toolBar->addWidget(audioChannelBox); + + subtitleBox = new KComboBox(toolBar); + textSubtitlesOff = i18n("off"); + connect(subtitleBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSubtitle(int))); + toolBar->addWidget(subtitleBox); - Phonon::VolumeSlider *volumeSlider = new Phonon::VolumeSlider(); + Phonon::VolumeSlider *volumeSlider = new Phonon::VolumeSlider(toolBar); volumeSlider->setAudioOutput(audioOutput); toolBar->addWidget(volumeSlider); - Phonon::SeekSlider *seekSlider = new Phonon::SeekSlider(); + Phonon::SeekSlider *seekSlider = new Phonon::SeekSlider(toolBar); seekSlider->setMediaObject(mediaObject); QSizePolicy sizePolicy = seekSlider->sizePolicy(); sizePolicy.setHorizontalStretch(1); @@ -86,9 +109,8 @@ stateChanged(Phonon::StoppedState); } -bool MediaWidget::isPlaying() const +MediaWidget::~MediaWidget() { - return playing; } void MediaWidget::play(const KUrl &url) @@ -115,24 +137,15 @@ mediaObject->play(); } -void MediaWidget::playDvb(DvbLiveFeed *feed) +void MediaWidget::playDvb(Phonon::AbstractMediaStream *feed) { - if (liveFeed != NULL) { - liveFeed->liveStopped(); - delete liveFeed; - liveFeed = NULL; - } - - liveFeed = feed; - mediaObject->setCurrentSource(Phonon::MediaSource(feed)); + dvbFeed = feed; + Phonon::MediaSource source(feed); + source.setAutoDelete(true); + mediaObject->setCurrentSource(source); mediaObject->play(); } -void MediaWidget::stop() -{ - mediaObject->stop(); -} - void MediaWidget::stateChanged(Phonon::State state) { bool newPlaying = false; @@ -154,17 +167,18 @@ break; } - if (liveFeed && !newPlaying) { - liveFeed->liveStopped(); - delete liveFeed; - liveFeed = NULL; - } - if (playing == newPlaying) { return; } - if (newPlaying) { + playing = newPlaying; + + if (!playing) { + // FIXME is there a more elegant way to do this? + delete dvbFeed; // dvbFeed is a QPointer + } + + if (playing) { actionPlayPause->setText(textPause); actionPlayPause->setIcon(iconPause); actionPlayPause->setCheckable(true); @@ -176,16 +190,19 @@ actionStop->setEnabled(false); } - // FIXME take care of skip forward / backward - actionBackward->setEnabled(false); - actionForward->setEnabled(false); + updatePreviousNext(); + updateAudioChannelBox(); + updateSubtitleBox(); +} - playing = newPlaying; +void MediaWidget::previous() +{ + mediaController->previousTitle(); } void MediaWidget::playPause(bool paused) { - if (isPlaying()) { + if (playing) { if (paused) { mediaObject->pause(); } else { @@ -196,7 +213,113 @@ } } +void MediaWidget::stop() +{ + mediaObject->stop(); +} + +void MediaWidget::next() +{ + mediaController->nextTitle(); +} + +void MediaWidget::changeAudioChannel(int index) +{ + if (audioChannelsReady) { + mediaController->setCurrentAudioChannel(audioChannels.at(index)); + } +} + +void MediaWidget::changeSubtitle(int index) +{ + if (subtitlesReady) { + mediaController->setCurrentSubtitle(subtitles.at(index)); + } +} + +void MediaWidget::titleCountChanged(int count) +{ + titleCount = count; + updatePreviousNext(); +} + +void MediaWidget::chapterCountChanged(int count) +{ + chapterCount = count; + updatePreviousNext(); +} + +void MediaWidget::audioChannelsChanged() +{ + audioChannels = mediaController->availableAudioChannels(); + updateAudioChannelBox(); +} + +void MediaWidget::subtitlesChanged() +{ + subtitles = mediaController->availableSubtitles(); + subtitles.prepend(Phonon::SubtitleDescription()); // helper for switching subtitles off + updateSubtitleBox(); +} + void MediaWidget::mouseDoubleClickEvent(QMouseEvent *) { emit toggleFullscreen(); } + +void MediaWidget::updatePreviousNext() +{ + bool enabled = playing && ((titleCount > 1) || (chapterCount > 1)); + actionPrevious->setEnabled(enabled); + actionNext->setEnabled(enabled); +} + +void MediaWidget::updateAudioChannelBox() +{ + audioChannelsReady = false; + audioChannelBox->clear(); + audioChannelBox->setEnabled(playing && (audioChannels.size() > 1)); + + if (playing) { + Phonon::AudioChannelDescription current = mediaController->currentAudioChannel(); + int index = -1; + + for (int i = 0; i < audioChannels.size(); ++i) { + const Phonon::AudioChannelDescription &description = audioChannels.at(i); + audioChannelBox->addItem(description.name()); + + if (description == current) { + index = i; + } + } + + audioChannelBox->setCurrentIndex(index); + audioChannelsReady = true; + } +} + +void MediaWidget::updateSubtitleBox() +{ + subtitlesReady = false; + subtitleBox->clear(); + subtitleBox->setEnabled(playing && (subtitles.size() > 1)); + + if (playing) { + Phonon::SubtitleDescription current = mediaController->currentSubtitle(); + int index = 0; + + subtitleBox->addItem(textSubtitlesOff); + + for (int i = 1; i < subtitles.size(); ++i) { + const Phonon::SubtitleDescription &description = subtitles.at(i); + subtitleBox->addItem(description.name()); + + if (description == current) { + index = i; + } + } + + subtitleBox->setCurrentIndex(index); + subtitlesReady = true; + } +} diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kaffeine/src/mediawidget.h new/kaffeine/src/mediawidget.h --- old/kaffeine/src/mediawidget.h 2009-02-18 11:07:59.000000000 +0100 +++ new/kaffeine/src/mediawidget.h 2009-02-21 13:24:30.000000000 +0100 @@ -1,7 +1,7 @@ /* * mediawidget.h * - * Copyright (C) 2007-2008 Christoph Pfister <christophpfister@gmail.com> + * Copyright (C) 2007-2009 Christoph Pfister <christophpfister@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,24 +21,30 @@ #ifndef MEDIAWIDGET_H #define MEDIAWIDGET_H +#include <QPointer> #include <QWidget> -#include <Phonon/AbstractMediaStream> +#include <Phonon/Global> +#include <Phonon/ObjectDescription> #include <KIcon> +namespace Phonon +{ +class AbstractMediaStream; +class MediaController; +class MediaObject; +} class KAction; class KActionCollection; +class KComboBox; class KToolBar; class KUrl; -class DvbLiveFeed; class MediaWidget : public QWidget { Q_OBJECT public: - MediaWidget(QWidget *parent, KToolBar *toolBar, KActionCollection *collection); - ~MediaWidget() { } - - bool isPlaying() const; + MediaWidget(KToolBar *toolBar, KActionCollection *collection, QWidget *parent); + ~MediaWidget(); /* * loads the media and starts playback @@ -50,47 +56,58 @@ void playDvd(); /* - * ownership is taken over by the media widget + * you stop dvb playback by deleting the feed + * the feed is deleted by MediaWidget if the user stops playback */ - void playDvb(DvbLiveFeed *feed); + void playDvb(Phonon::AbstractMediaStream *feed); signals: void toggleFullscreen(); -public slots: - void stop(); - private slots: void stateChanged(Phonon::State state); + void previous(); void playPause(bool paused); + void stop(); + void next(); + void changeAudioChannel(int index); + void changeSubtitle(int index); + + void titleCountChanged(int count); + void chapterCountChanged(int count); + void audioChannelsChanged(); + void subtitlesChanged(); private: void mouseDoubleClickEvent(QMouseEvent *); + void updatePreviousNext(); + void updateAudioChannelBox(); + void updateSubtitleBox(); Phonon::MediaObject *mediaObject; - DvbLiveFeed *liveFeed; + Phonon::MediaController *mediaController; + QPointer<Phonon::AbstractMediaStream> dvbFeed; bool playing; - KAction *actionBackward; + KAction *actionPrevious; KAction *actionPlayPause; - KAction *actionStop; - KAction *actionForward; - QString textPlay; QString textPause; KIcon iconPlay; KIcon iconPause; -}; - -class DvbLiveFeed : public Phonon::AbstractMediaStream -{ -public: - DvbLiveFeed() { } - virtual ~DvbLiveFeed() { } - - virtual void livePaused(bool paused) = 0; - virtual void liveStopped() = 0; + KAction *actionStop; + KAction *actionNext; + KComboBox *audioChannelBox; + KComboBox *subtitleBox; + QString textSubtitlesOff; + + int titleCount; + int chapterCount; + bool audioChannelsReady; + bool subtitlesReady; + QList<Phonon::AudioChannelDescription> audioChannels; + QList<Phonon::SubtitleDescription> subtitles; }; #endif /* MEDIAWIDGET_H */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kaffeine/TODO new/kaffeine/TODO --- old/kaffeine/TODO 2009-02-18 11:07:59.000000000 +0100 +++ new/kaffeine/TODO 2009-02-21 13:24:30.000000000 +0100 @@ -8,9 +8,6 @@ == Functionality required before first beta release == -= General = -General Selection of Audio channel and subtitles - = DVB Subsystem = Synthesize PAT/PMT DVB Selection of Audio Channels/Subtitles @@ -22,16 +19,14 @@ Profile the playback subsystem performance == Future functionality == -CD Ripping +CD: track selection, CDDB (or similar), ripping +DVD: menu / title / chapter / angle selection +CD / VCD / DVD: deal nicely with multiple drives Playlist support CICAM support -Recordings (ability to record a show and watch it later) Documentation / Manual (too early for that) * section about updating scan file -== Random stuff == -Deal nicely with multiple dvd/... drives - I know I should add a contribution section here; if you're interested drop a line to kaffeine-user (at) lists.sourceforge.net which is regularly moderated, so you don't ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de