aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Sound.h
blob: ac4b7f4d180126dab30d2412addbe1e6a4dc21c5 (plain)
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
#pragma once

#include <soloud.h>

#include <memory>

#include "api/Resource.h"

namespace crepe {

class Sound {
public:
	Sound(std::unique_ptr<api::Resource> res);
	virtual ~Sound() = default;

public:
	void pause();
	void play();
	void rewind();
	void set_volume(float volume);
	void set_looping(bool looping);

private:
	std::unique_ptr<api::Resource> _res;
	SoLoud::handle _handle;
	bool _paused;
};

}