载入中...
搜索中...
未找到
AudioZone.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include "common/Result.h"
5
6#include <cstdint>
7#include <vector>
8
9namespace eve::audio {
10class Source;
11
14 float volume = 1.f, fadeInTime = 5.f, fadeOutTime = 5.f, duration = 0.f;
15};
17enum class AudioZonePhase : std::uint8_t { Active, BecomingInactive, Inactive };
20public:
21 float x = 0.f, y = 0.f, z = 0.f, radius = 30.f, minimumBreakTime = 5.f, maximumBreakTime = 10.f,
22 deactivationTime = 10.f;
23 bool global = false;
25 [[nodiscard]] Result<int> addItem(const AudioZoneItem& item);
26 int itemCount() const noexcept { return static_cast<int>(items_.size()); }
33 const AudioZoneItem* itemAt(int index) const noexcept;
34
35private:
36 std::vector<AudioZoneItem> items_;
37};
50 bool play = false, stop = false;
51 int trackIndex = -1;
52 float volume = 0.f;
53};
66 AudioZoneState& state, float now,
67 float playerX, float playerY,
68 float playerZ, float masterVolume,
69 std::uint32_t seed);
72} // namespace eve::audio
double z
double y
double x
std::string output
#define EVENGINE_API_BACKENDS
Definition Export.h:108
double radius
Definition MeleeHit.cpp:42
Move-only, checked operation results for the common layer.
std::string_view source
Heightmap global
uint32_t seed
Definition TreeMesh.cpp:276
uint32_t index
Move-only operation result carrying either a value or Status.
Definition Result.h:176
Caller-owned Pcg audio-zone configuration and track list.
Definition AudioZone.h:19
int itemCount() const noexcept
Definition AudioZone.h:26
A playable audio source (static buffer or streaming decoder). Not thread-safe for playback control ex...
Definition Source.h:30
Result< AudioZoneOutput > evaluateAudioZone(const AudioZoneProfile &p, AudioZoneState &state, float now, float px, float py, float pz, float master, std::uint32_t seed)
Evaluate PcgAudioManager/PcgAudioZone for one explicit time and player observation.
Definition AudioZone.cpp:42
Result< void > applyAudioZoneOutput(Source *source, const AudioZoneOutput &output)
Apply one evaluated command to the caller-selected track Source without retaining it.
AudioZonePhase
AudioZonePhase public API.
Definition AudioZone.h:17
One Pcg audio-zone track timing and gain profile.
Definition AudioZone.h:13
Commands to apply to a caller-owned audio Source.
Definition AudioZone.h:49
Persistent playback state owned by the caller.
Definition AudioZone.h:39
float exitFadeFrom
Audible volume sampled when entering BecomingInactive (exit fade start).
Definition AudioZone.h:46