-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathaudioplayerstub.h
More file actions
41 lines (28 loc) · 914 Bytes
/
audioplayerstub.h
File metadata and controls
41 lines (28 loc) · 914 Bytes
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
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "../iaudioplayer.h"
#include "test_export.h"
namespace libscratchcpp
{
class LIBSCRATCHCPP_TEST_EXPORT AudioPlayerStub : public IAudioPlayer
{
public:
AudioPlayerStub();
bool load(unsigned int size, const void *data, unsigned long sampleRate) override;
bool loadCopy(IAudioPlayer *player) override;
float volume() const override;
void setVolume(float volume) override;
float pitch() const override;
void setPitch(float pitch) override;
float pan() const override;
void setPan(float pan) override;
bool isLoaded() const override;
void start() override;
void stop() override;
bool isPlaying() const override;
private:
float m_volume = 1;
float m_pitch = 1;
float m_pan = 0;
};
} // namespace libscratchcpp