Okular

audioplayer.h
1 /*
2  SPDX-FileCopyrightText: 2007 Pino Toscano <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #ifndef _OKULAR_AUDIOPLAYER_H_
8 #define _OKULAR_AUDIOPLAYER_H_
9 
10 #include "okularcore_export.h"
11 
12 #include <QObject>
13 
14 namespace Okular
15 {
16 class AudioPlayerPrivate;
17 class Document;
18 class Sound;
19 class SoundAction;
20 
21 /**
22  * @short An audio player.
23  *
24  * Singleton utility class to play sounds in documents using the KDE sound
25  * system.
26  */
27 class OKULARCORE_EXPORT AudioPlayer : public QObject
28 {
29  Q_OBJECT
30 
31 public:
32  /**
33  * The state of AudioPlayer
34  * @since 0.19 (KDE 4.13)
35  */
36  enum State {
37  /**
38  * The AudioPlayer is playing a audio file.
39  */
41  /**
42  * The AudioPlayer isn't playing a audio file.
43  */
44  StoppedState
45  };
46 
47  ~AudioPlayer() override;
48 
49  /**
50  * Gets the instance of the audio player.
51  */
52  static AudioPlayer *instance();
53 
54  /**
55  * Enqueue the specified @p sound for playing, optionally taking more
56  * information about the playing from the @p soundlink .
57  */
58  void playSound(const Sound *sound, const SoundAction *linksound = nullptr);
59 
60  /**
61  * Tell the AudioPlayer to stop all the playbacks.
62  */
63  void stopPlaybacks();
64 
65  /**
66  * Return state of sound (playing/stopped)
67  * @since 0.19 (KDE 4.13)
68  */
69  State state() const;
70 
71 private:
72  AudioPlayer();
73 
74  friend class AudioPlayerPrivate;
75  AudioPlayerPrivate *const d;
76  friend class Document;
77 
78  Q_DISABLE_COPY(AudioPlayer)
79 };
80 
81 }
82 
83 #endif
State
The state of AudioPlayer.
Definition: audioplayer.h:36
global.h
Definition: action.h:16
An audio player.
Definition: audioplayer.h:27
The Document.
Definition: document.h:190
Contains information about a sound object.
Definition: sound.h:23
The AudioPlayer is playing a audio file.
Definition: audioplayer.h:40
The Sound action plays a sound on activation.
Definition: action.h:335
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Nov 26 2021 22:38:08 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.