Pencil2D Animation
Download
Community
News
Docs
Contribute
API Documentation
5eeebd3c7472c3c2e6618ff9a94eca7af8af593e
Main Page
Related Pages
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Enumerations
Properties
Pages
core_lib
src
soundplayer.h
1
/*
2
3
Pencil2D - Traditional Animation Software
4
Copyright (C) 2012-2020 Matthew Chiawen Chang
5
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of the GNU General Public License
8
as published by the Free Software Foundation; version 2 of the License.
9
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
*/
16
17
#ifndef SOUNDPLAYER_H
18
#define SOUNDPLAYER_H
19
20
#include <memory>
21
#include <QObject>
22
#include "pencilerror.h"
23
#include "keyframe.h"
24
25
class
SoundClip
;
26
class
QMediaPlayer;
27
28
class
SoundPlayer
:
public
QObject
,
public
KeyFrameEventListener
29
{
30
Q_OBJECT
31
public
:
32
SoundPlayer
();
33
~
SoundPlayer
()
override
;
34
35
void
init(
SoundClip
* );
36
void
onKeyFrameDestroy(
KeyFrame
* )
override
;
37
bool
isValid();
38
39
void
play();
40
void
pause();
41
void
stop();
42
43
int64_t duration();
44
SoundClip
* clip() {
return
mSoundClip; }
45
46
void
setMediaPlayerPosition( qint64 pos );
47
48
signals:
49
void
corruptedSoundFile(
SoundClip
* );
50
void
durationChanged(
SoundPlayer
*, int64_t duration );
51
52
private
:
53
void
makeConnections();
54
55
SoundClip
* mSoundClip =
nullptr
;
56
QMediaPlayer* mMediaPlayer =
nullptr
;
57
};
58
59
#endif // SOUNDPLAYER_H
SoundClip
Definition:
soundclip.h:26
KeyFrameEventListener
Definition:
keyframe.h:72
KeyFrame
Definition:
keyframe.h:29
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject
SoundPlayer
Definition:
soundplayer.h:28
Generated on Sun Dec 20 2020 16:19:58 for Pencil2D by
1.8.6