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>
35 class MediaObject : public QObject, public MediaObjectInterface
38 friend class SeekStack;
42 MediaObject(QObject *p_parent);
43 virtual ~MediaObject();
46 * Widget Id where VLC will show the videos.
48 void setVideoWidgetId(int i_widget_id);
51 void seek(qint64 milliseconds);
53 qint32 tickInterval() const;
54 void setTickInterval(qint32 tickInterval);
56 qint64 currentTime() const;
57 Phonon::State state() const;
58 Phonon::ErrorType errorType() const;
59 MediaSource source() const;
60 void setSource(const MediaSource & source);
61 void setNextSource(const MediaSource & source);
63 qint32 prefinishMark() const;
64 void setPrefinishMark(qint32 msecToEnd);
66 qint32 transitionTime() const;
67 void setTransitionTime(qint32);
72 // void bufferStatus( int i_percent_filled );
73 // void currentSourceChanged( const MediaSource & newSource );
75 void hasVideoChanged(bool b_has_video);
76 void metaDataChanged(const QMultiMap<QString, QString> & metaData);
77 void prefinishMarkReached(qint32 msecToEnd);
78 void seekableChanged(bool b_is_seekable);
79 void stateChanged(Phonon::State newState, Phonon::State oldState);
80 void tick(qint64 time);
81 void totalTimeChanged(qint64 newTotalTime);
83 // Signal from VLCMediaObject
84 void stateChanged(Phonon::State newState);
86 void tickInternal(qint64 time);
90 virtual void loadMediaInternal(const QString & filename) = 0;
91 virtual void playInternal() = 0;
92 virtual void seekInternal(qint64 milliseconds) = 0;
94 virtual qint64 currentTimeInternal() const = 0;
96 int i_video_widget_id;
100 void stateChangedInternal(Phonon::State newState);
102 void tickInternalSlot(qint64 time);
106 void loadMedia(const QString & filename);
110 MediaSource mediaSource;
112 Phonon::State currentState;
114 qint32 i_prefinish_mark;
115 bool b_prefinish_mark_reached_emitted;
117 bool b_about_to_finish_emitted;
119 qint32 i_tick_interval;
120 qint32 i_transition_time;
124 } // Namespace Phonon::VLC
126 #endif // PHONON_VLC_MEDIAOBJECT_H