]> cloud.milkyroute.net Git - dolphin.git/blob - src/panels/information/phononwidget.h
196b87f879c6274c1d2f8f2002462f8998839343
[dolphin.git] / src / panels / information / phononwidget.h
1 /* This file is part of the KDE project
2 Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18
19 */
20
21 #ifndef PHONONWIDGET_H
22 #define PHONONWIDGET_H
23
24 #include <kurl.h>
25
26 #include <QtCore/QSize>
27 #include <QtGui/QWidget>
28
29 #include <Phonon/Global>
30
31 namespace Phonon
32 {
33 class MediaObject;
34 class SeekSlider;
35 class VideoPlayer;
36 } // namespace Phonon
37
38 class EmbeddedVideoPlayer;
39 class QToolButton;
40 class QVBoxLayout;
41
42 class PhononWidget : public QWidget
43 {
44 Q_OBJECT
45 public:
46 enum Mode
47 {
48 Audio,
49 Video
50 };
51
52 PhononWidget(QWidget *parent = 0);
53
54 void setUrl(const KUrl &url);
55 KUrl url() const;
56
57 void setMode(Mode mode);
58 Mode mode() const;
59
60 void setVideoSize(const QSize& size);
61 QSize videoSize() const;
62
63 signals:
64 void playingStarted();
65 void playingStopped();
66
67 protected:
68 virtual void showEvent(QShowEvent *event);
69 virtual void hideEvent(QHideEvent *event);
70
71 private slots:
72 void stateChanged(Phonon::State);
73 void play();
74 void stop();
75
76 private:
77 void applyVideoSize();
78
79 private:
80 Mode m_mode;
81 KUrl m_url;
82 QSize m_videoSize;
83
84 QToolButton *m_playButton;
85 QToolButton *m_stopButton;
86
87 QVBoxLayout *m_topLayout;
88 Phonon::MediaObject *m_audioMedia;
89 Phonon::MediaObject *m_media;
90 Phonon::SeekSlider *m_seekSlider;
91 EmbeddedVideoPlayer *m_videoPlayer;
92 };
93
94 #endif // PHONONWIDGET_H