mirror of
https://github.com/enduro2d/enduro2d.git
synced 2026-01-06 11:51:00 +07:00
Fixed code style
This commit is contained in:
@@ -6,23 +6,23 @@ namespace e2d
|
||||
{
|
||||
using sound_stream_ptr = std::shared_ptr<class sound_stream>;
|
||||
using sound_source_ptr = std::shared_ptr<class sound_source>;
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// bad_audio_operation
|
||||
//
|
||||
|
||||
|
||||
class bad_audio_operation final : public exception {
|
||||
public:
|
||||
const char* what() const noexcept final {
|
||||
return "bad audio operation";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// sound_stream
|
||||
//
|
||||
|
||||
|
||||
class sound_stream final : noncopyable {
|
||||
public:
|
||||
class internal_state;
|
||||
@@ -33,11 +33,11 @@ namespace e2d
|
||||
private:
|
||||
internal_state_uptr state_;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// sound_source
|
||||
//
|
||||
|
||||
|
||||
class sound_source final : noncopyable {
|
||||
public:
|
||||
class internal_state;
|
||||
@@ -45,67 +45,67 @@ namespace e2d
|
||||
const internal_state& state() const noexcept;
|
||||
public:
|
||||
explicit sound_source(internal_state_uptr);
|
||||
|
||||
|
||||
void play() noexcept;
|
||||
void stop() noexcept;
|
||||
void pause() noexcept;
|
||||
|
||||
|
||||
void looping(bool value) noexcept;
|
||||
[[nodiscard]] bool looping() noexcept;
|
||||
|
||||
void volume(float value) noexcept;
|
||||
[[nodiscard]] float volume() const noexcept;
|
||||
|
||||
void position(seconds<float> value) noexcept;
|
||||
[[nodiscard]] seconds<float> position() const noexcept;
|
||||
[[nodiscard]] seconds<float> duration() const noexcept;
|
||||
|
||||
void position3d(const v3f &value) noexcept;
|
||||
|
||||
void volume(f32 value) noexcept;
|
||||
[[nodiscard]] f32 volume() const noexcept;
|
||||
|
||||
void position(secf value) noexcept;
|
||||
[[nodiscard]] secf position() const noexcept;
|
||||
[[nodiscard]] secf duration() const noexcept;
|
||||
|
||||
void position3d(const v3f& value) noexcept;
|
||||
[[nodiscard]] v3f position3d() const noexcept;
|
||||
|
||||
void velocity(const v3f &value) noexcept;
|
||||
|
||||
void velocity(const v3f& value) noexcept;
|
||||
[[nodiscard]] v3f velocity() const noexcept;
|
||||
|
||||
|
||||
private:
|
||||
internal_state_uptr state_;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// audio
|
||||
//
|
||||
|
||||
|
||||
class audio final : public module<audio> {
|
||||
public:
|
||||
audio(debug& d);
|
||||
~audio() noexcept;
|
||||
|
||||
void volume(float value) noexcept;
|
||||
[[nodiscard]] float volume() const noexcept;
|
||||
|
||||
|
||||
void volume(f32 value) noexcept;
|
||||
[[nodiscard]] f32 volume() const noexcept;
|
||||
|
||||
sound_stream_ptr create_stream(
|
||||
buffer_view sound_data);
|
||||
|
||||
|
||||
sound_stream_ptr create_stream(
|
||||
const input_stream_uptr& file_stream);
|
||||
|
||||
|
||||
sound_source_ptr create_source(
|
||||
const sound_stream_ptr &stream);
|
||||
|
||||
|
||||
void resume() noexcept;
|
||||
void pause() noexcept;
|
||||
|
||||
|
||||
// Applies changes made to the 3D system.
|
||||
void apply3d() noexcept;
|
||||
|
||||
void listener_position(const v3f &value) noexcept;
|
||||
|
||||
void listener_position(const v3f& value) noexcept;
|
||||
[[nodiscard]] v3f listener_position() const noexcept;
|
||||
|
||||
void listener_velocity(const v3f &value) noexcept;
|
||||
|
||||
void listener_velocity(const v3f& value) noexcept;
|
||||
[[nodiscard]] v3f listener_velocity() const noexcept;
|
||||
|
||||
|
||||
private:
|
||||
class internal_state;
|
||||
std::unique_ptr<internal_state> state_;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -66,6 +66,8 @@ namespace e2d
|
||||
using milliseconds = unit<T, milliseconds_tag>;
|
||||
template < typename T >
|
||||
using microseconds = unit<T, microseconds_tag>;
|
||||
|
||||
using secf = seconds<f32>;
|
||||
}
|
||||
|
||||
namespace e2d
|
||||
|
||||
Reference in New Issue
Block a user