-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsound.h
More file actions
57 lines (39 loc) · 1.21 KB
/
Copy pathsound.h
File metadata and controls
57 lines (39 loc) · 1.21 KB
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
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "spimpl.h"
#include "asset.h"
namespace libscratchcpp
{
class Thread;
class SoundPrivate;
/*! \brief The Sound class represents a Scratch sound. */
class LIBSCRATCHCPP_EXPORT Sound : public Asset
{
public:
enum class Effect
{
Pitch,
Pan
};
Sound(const std::string &name, const std::string &id, const std::string &format);
Sound(const Sound &) = delete;
virtual ~Sound() { }
int rate() const;
void setRate(int newRate);
int sampleCount() const;
void setSampleCount(int newSampleCount);
virtual void setVolume(double volume);
virtual void setEffect(Effect effect, double value);
virtual void start(Thread *owner = nullptr);
virtual void stop();
virtual bool isPlaying() const;
std::shared_ptr<Sound> clone() const;
Thread *owner() const;
protected:
void processData(unsigned int size, void *data) override;
virtual bool isClone() const override;
private:
void stopCloneSounds();
spimpl::unique_impl_ptr<SoundPrivate> impl;
};
} // namespace libscratchcpp