add more spacing
[personal-kdebase.git] / runtime / phonon / tests / mediacontrols.h
blobafec5a30f7a29357f278a16cc6620cf84e4f3758
1 /* This file is part of the KDE project
2 Copyright (C) 2006 Matthias Kretz <kretz@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
20 #ifndef PHONON_UI_MEDIACONTROLS_H
21 #define PHONON_UI_MEDIACONTROLS_H
23 #include <QtGui/QWidget>
24 #include <Phonon/Global>
26 namespace Phonon
28 class MediaObject;
29 class AudioOutput;
30 class MediaControlsPrivate;
32 /**
33 * \short Simple widget showing buttons to control an MediaProducer
34 * object.
36 * This widget shows the standard player controls. There's at least the
37 * play/pause and stop buttons. If the media is seekable it shows a seek-slider.
38 * Optional controls include a volume control and a loop control button.
40 * \author Matthias Kretz <kretz@kde.org>
42 class MediaControls : public QWidget
44 Q_OBJECT
45 Q_DECLARE_PRIVATE(MediaControls)
46 /**
47 * This property holds whether the slider showing the progress of the
48 * playback is visible.
50 * By default the slider is visible. It is enabled/disabled automatically
51 * depending on whether the media can be seeked or not.
53 Q_PROPERTY(bool seekSliderVisible READ isSeekSliderVisible WRITE setSeekSliderVisible)
55 /**
56 * This property holds whether the slider controlling the volume is visible.
58 * By default the slider is visible if an AudioOutput has been set with
59 * setAudioOutput.
61 * \see setAudioOutput
63 Q_PROPERTY(bool volumeControlVisible READ isVolumeControlVisible WRITE setVolumeControlVisible)
65 /**
66 * This property holds whether the button controlling loop behaviour is
67 * visible.
69 * By default the loop button is hidden.
71 Q_PROPERTY(bool loopControlVisible READ isLoopControlVisible WRITE setLoopControlVisible)
72 public:
73 /**
74 * Constructs a media control widget with a \p parent.
76 MediaControls(QWidget *parent = 0);
77 ~MediaControls();
79 bool isSeekSliderVisible() const;
80 bool isVolumeControlVisible() const;
81 bool isLoopControlVisible() const;
83 public Q_SLOTS:
84 void setSeekSliderVisible(bool);
85 void setVolumeControlVisible(bool);
86 void setLoopControlVisible(bool);
88 /**
89 * Sets the media producer object to be controlled by this widget.
91 void setMediaObject(MediaObject *);
93 /**
94 * Sets the audio output object to be controlled by this widget.
96 void setAudioOutput(AudioOutput *audioOutput);
99 private:
100 Q_PRIVATE_SLOT(d_func(), void _k_stateChanged(Phonon::State, Phonon::State))
101 Q_PRIVATE_SLOT(d_func(), void _k_mediaDestroyed())
102 Q_PRIVATE_SLOT(d_func(), void _k_finished())
104 MediaControlsPrivate *const d_ptr;
107 } // namespace Phonon
109 // vim: sw=4 ts=4 tw=80
110 #endif // PHONON_UI_MEDIACONTROLS_H