forked from KDE/okular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaudioplayer.h
86 lines (70 loc) · 2.03 KB
/
audioplayer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/***************************************************************************
* Copyright (C) 2007 by Pino Toscano <[email protected]> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef _OKULAR_AUDIOPLAYER_H_
#define _OKULAR_AUDIOPLAYER_H_
#include "okularcore_export.h"
#include <QObject>
namespace Okular
{
class AudioPlayerPrivate;
class Document;
class Sound;
class SoundAction;
/**
* @short An audio player.
*
* Singleton utility class to play sounds in documents using the KDE sound
* system.
*/
class OKULARCORE_EXPORT AudioPlayer : public QObject
{
Q_OBJECT
public:
/**
* The state of AudioPlayer
* @since 0.19 (KDE 4.13)
*/
enum State {
/**
* The AudioPlayer is playing a audio file.
*/
PlayingState,
/**
* The AudioPlayer isn't playing a audio file.
*/
StoppedState
};
~AudioPlayer() override;
/**
* Gets the instance of the audio player.
*/
static AudioPlayer *instance();
/**
* Enqueue the specified @p sound for playing, optionally taking more
* information about the playing from the @p soundlink .
*/
void playSound(const Sound *sound, const SoundAction *linksound = nullptr);
/**
* Tell the AudioPlayer to stop all the playbacks.
*/
void stopPlaybacks();
/**
* Return state of sound (playing/stopped)
* @since 0.19 (KDE 4.13)
*/
State state() const;
private:
AudioPlayer();
friend class AudioPlayerPrivate;
AudioPlayerPrivate *const d;
friend class Document;
Q_DISABLE_COPY(AudioPlayer)
};
}
#endif