1 /*****************************************************************************
2 * VLC backend for the Phonon library *
3 * Copyright (C) 2007-2008 Tanguy Krotoff <tkrotoff@gmail.com> *
4 * Copyright (C) 2008 Lukas Durfina <lukas.durfina@gmail.com> *
5 * Copyright (C) 2009 Fathi Boudra <fabo@kde.org> *
7 * This program is free software; you can redistribute it and/or *
8 * modify it under the terms of the GNU Lesser General Public *
9 * License as published by the Free Software Foundation; either *
10 * version 3 of the License, or (at your option) any later version. *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15 * Lesser General Public License for more details. *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License along with this package; if not, write to the Free Software *
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
20 *****************************************************************************/
22 #ifndef PHONON_VLC_MEDIAOBJECT_H
23 #define PHONON_VLC_MEDIAOBJECT_H
25 #include <phonon/mediaobjectinterface.h>
27 #include <QtCore/QObject>
28 #include <QtGui/QWidget>
36 class MediaObject : public QObject, public MediaObjectInterface
39 friend class SeekStack;
43 MediaObject(QObject *p_parent);
44 virtual ~MediaObject();
47 * Widget Id where VLC will show the videos.
49 void setVideoWidgetId(WId i_widget_id);
52 void seek(qint64 milliseconds);
54 qint32 tickInterval() const;
55 void setTickInterval(qint32 tickInterval);
57 qint64 currentTime() const;
58 Phonon::State state() const;
59 Phonon::ErrorType errorType() const;
60 MediaSource source() const;
61 void setSource(const MediaSource & source);
62 void setNextSource(const MediaSource & source);
64 qint32 prefinishMark() const;
65 void setPrefinishMark(qint32 msecToEnd);
67 qint32 transitionTime() const;
68 void setTransitionTime(qint32);
73 void bufferStatus( int i_percent_filled );
74 void currentSourceChanged( const MediaSource & newSource );
76 void hasVideoChanged(bool b_has_video);
77 void metaDataChanged(const QMultiMap<QString, QString> & metaData);
78 void prefinishMarkReached(qint32 msecToEnd);
79 void seekableChanged(bool b_is_seekable);
80 void stateChanged(Phonon::State newState, Phonon::State oldState);
81 void tick(qint64 time);
82 void totalTimeChanged(qint64 newTotalTime);
84 // Signal from VLCMediaObject
85 void stateChanged(Phonon::State newState);
87 void tickInternal(qint64 time);
91 virtual void loadMediaInternal(const QString & filename) = 0;
92 virtual void playInternal() = 0;
93 virtual void seekInternal(qint64 milliseconds) = 0;
95 virtual qint64 currentTimeInternal() const = 0;
97 WId i_video_widget_id;
101 void stateChangedInternal(Phonon::State newState);
103 void tickInternalSlot(qint64 time);
107 void loadMedia(const QString & filename);
111 MediaSource mediaSource;
113 Phonon::State currentState;
115 qint32 i_prefinish_mark;
116 bool b_prefinish_mark_reached_emitted;
118 bool b_about_to_finish_emitted;
120 qint32 i_tick_interval;
121 qint32 i_transition_time;
125 } // Namespace Phonon::VLC
127 #endif // PHONON_VLC_MEDIAOBJECT_H