Timeline-style controller for one authored audio source. 更多...
#include <AudioSourceEditor.h>
类 | |
| struct | LiveAudition |
| struct | PreviewSession |
Public 成员函数 | |
| AudioSourceEditor (std::string targetId) | |
| Construct a seeded preview source with a generated tone clip. | |
| AudioSourceEditor (const AudioSourceEditor &)=delete | |
| AudioSourceEditor & | operator= (const AudioSourceEditor &)=delete |
| ~AudioSourceEditor () | |
| Audio source editor. | |
| audio_editing::Result< void > | setPreviewProvider (std::shared_ptr< const IAudioSourcePreviewProvider > provider) |
| Replace the owned immutable preview provider and invalidate all previous work, even for the same instance. @ownership Retains shared ownership; null explicitly disables previews, preserving the last successful payload. @thread Owner thread; providers run on a worker with owning immutable inputs and must cooperate with cancellation. @reentrancy Provider callbacks never run under editor locks or access this editor. | |
| audio_editing::Result< void > | requestPreview () |
| Queue a preview of the current domain inputs; accepted work returns Pending. @cost Copies the PCM/clip input once per request; computation runs on the editing task worker, amortized over polls. | |
| audio_editing::Result< void > | pollPreview () |
| Publish the current completed preview atomically; Pending while work runs, NoOp when idle. Owner thread only. | |
| audio_editing::Result< void > | cancelPreview () |
| Cancel pending publication while keeping the last valid preview; a new explicit request may resume. | |
| void | closePreview () |
| Permanently cancel and close preview publication; idempotent. Destruction joins cooperative work. | |
| editor::PreviewState | previewState () const noexcept |
| Observe request sequence, provider generation and phase without copying preview payloads. | |
| const audio_editing::AudioSourceTarget & | target () const noexcept |
| Borrow the authoritative source document. | |
| audio_editing::Result< void > | configureWorkspace (editor::EditorWorkspace &workspace) const |
| Install Sources / Waveform / Inspector / Transport panels. | |
| audio_editing::Result< void > | setViewportWidth (float width) |
| Rebuild waveform envelopes for the given pixel width. | |
| audio_editing::Result< void > | seekX (float x) |
| Seek from a waveform x coordinate in the current viewport. | |
| audio_editing::Result< void > | seekSeconds (double seconds) |
| Seek preview to an exact time in seconds. | |
| audio_editing::Result< void > | setProperty (const std::string &path, const audio_editing::EditorValue &value) |
| Commit an absolute property assignment through the document transaction path. | |
| audio_editing::Result< editor::TransactionReceipt > | undo () |
| Undo. | |
| audio_editing::Result< editor::TransactionReceipt > | redo () |
| Redo. | |
| audio_editing::Result< void > | play () |
| Play. | |
| audio_editing::Result< void > | pause () |
| Pause. | |
| audio_editing::Result< void > | stop () |
| Stops . | |
| audio_editing::Result< audio_editing::AudioTransportSnapshot > | update (double deltaSeconds) |
| Poll audition and advance the clock backend. | |
| audio_editing::Result< void > | attachLiveAudition () |
| Bind a live OpenAL Source generated from the preview PCM when Audio/Sound exist. | |
| bool | canUndo () const noexcept |
| bool | canRedo () const noexcept |
| Can redo. | |
| bool | isPlaying () const noexcept |
| True when playing. | |
| std::uint64_t | revision () const noexcept |
| Revision. | |
| std::uint64_t | pcmRevision () const noexcept |
| Pcm revision. | |
| double | duration () const noexcept |
| Duration. | |
| double | playhead () const noexcept |
| Playhead. | |
| float | layoutWidth () const noexcept |
| Layout width. | |
| int | bucketCount () const noexcept |
| Bucket count. | |
| float | playheadX () const noexcept |
| Playhead x. | |
| float | loopStartX () const noexcept |
| Loop start x. | |
| float | loopEndX () const noexcept |
| Loop end x. | |
| audio_editing::PropertyReadResult | read (const std::string &path) const |
| Read a property using the source selection. | |
| const audio_editing::AudioWaveformBucket * | bucket (int index) const |
| Envelope bucket for drawing; channel 0. @ownership Borrowed bucket owned by this editor. @lifetime Valid until the next setViewportWidth/rebuild or destruction; null when index is out of range. | |
| const audio_editing::AudioTransportSnapshot & | transport () const noexcept |
| Latest transport observation after a successful update/play. | |
| audio_editing::EditorValue | snapshot () const |
| Canonical snapshot of the source document. | |
详细描述
Timeline-style controller for one authored audio source.
Owns the document, local undo, waveform cache and audition transport. PCM identity is separate from document revision so volume/pitch edits do not stale-unbind playback. Clip PCM changes increment pcmRevision.
@ownership Editor owns the document and clock backend. Live Source is borrowed from the Audio module when attachLiveAudition succeeds. @threadaffinity Owner thread only. @reentrancy No unknown callbacks.
在文件 AudioSourceEditor.h 第 76 行定义.
构造及析构函数说明
◆ AudioSourceEditor() [1/2]
|
explicit |
Construct a seeded preview source with a generated tone clip.
- 参数
-
targetId Stable editor target identity.
在文件 AudioSourceEditor.cpp 第 88 行定义.
引用了 eve::audio_editing::EditorAudioPcm::sampleRate, eve::audio_editing::EditorAudioPcm::samples, eve::audio_editor::AudioClockTransportBackend::setDuration() , 以及 eve::audio_editing::AudioAuditionTransport::snapshot().
◆ AudioSourceEditor() [2/2]
|
delete |
◆ ~AudioSourceEditor()
| eve::audio_editor::AudioSourceEditor::~AudioSourceEditor | ( | ) |
Audio source editor.
在文件 AudioSourceEditor.cpp 第 105 行定义.
引用了 closePreview() , 以及 eve::audio_editing::AudioAuditionTransport::unbind().
成员函数说明
◆ attachLiveAudition()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::attachLiveAudition | ( | ) |
Bind a live OpenAL Source generated from the preview PCM when Audio/Sound exist.
- 返回
- Applied when live audition is bound; Unsupported when modules are absent.
在文件 AudioSourceEditor.cpp 第 361 行定义.
引用了 eve::audio_editing::AudioAuditionTransport::bind(), bytes, isPlaying(), live, play(), playhead(), eve::audio_editing::EditorAudioPcm::sampleRate, eve::audio_editing::EditorAudioPcm::samples, eve::audio_editing::AudioAuditionTransport::seek(), eve::audio_editing::AudioSourceTarget::targetId(), eve::audio_editing::AudioAuditionTransport::unbind() , 以及 eve::Exception::what().
◆ bucket()
| const audio_editing::AudioWaveformBucket * eve::audio_editor::AudioSourceEditor::bucket | ( | int | index | ) | const |
Envelope bucket for drawing; channel 0. @ownership Borrowed bucket owned by this editor. @lifetime Valid until the next setViewportWidth/rebuild or destruction; null when index is out of range.
在文件 AudioSourceEditor.cpp 第 450 行定义.
引用了 eve::audio_editing::AudioWaveformResult::envelopes , 以及 index.
◆ bucketCount()
|
noexcept |
Bucket count.
在文件 AudioSourceEditor.cpp 第 425 行定义.
◆ cancelPreview()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::cancelPreview | ( | ) |
Cancel pending publication while keeping the last valid preview; a new explicit request may resume.
在文件 AudioSourcePreview.cpp 第 48 行定义.
◆ canRedo()
|
inlinenoexcept |
Can redo.
在文件 AudioSourceEditor.h 第 169 行定义.
被这些函数引用 eve::audio_editor::AudioSourcePresentation::state().
◆ canUndo()
|
inlinenoexcept |
在文件 AudioSourceEditor.h 第 167 行定义.
被这些函数引用 eve::audio_editor::AudioSourcePresentation::state().
◆ closePreview()
| void eve::audio_editor::AudioSourceEditor::closePreview | ( | ) |
Permanently cancel and close preview publication; idempotent. Destruction joins cooperative work.
在文件 AudioSourcePreview.cpp 第 49 行定义.
被这些函数引用 ~AudioSourceEditor().
◆ configureWorkspace()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::configureWorkspace | ( | editor::EditorWorkspace & | workspace | ) | const |
Install Sources / Waveform / Inspector / Transport panels.
- 注解
- Does not retain
workspace.
在文件 AudioSourceEditor.cpp 第 203 行定义.
引用了 eve::editor::EditorWorkspace::activatePanel(), context, id, order, region, eve::editor::EditorWorkspace::registerPanel(), eve::editor::EditorWorkspace::setPanelCapability(), eve::editor::EditorWorkspace::setPanelContext() , 以及 title.
◆ duration()
|
noexcept |
在文件 AudioSourceEditor.cpp 第 417 行定义.
引用了 eve::audio_editing::EditorAudioPcm::channels, eve::audio_editing::EditorAudioPcm::sampleRate , 以及 eve::audio_editing::EditorAudioPcm::samples.
被这些函数引用 loopEndX(), loopStartX(), playheadX(), eve::audio_editor::AudioSourcePresentation::schema(), seekX() , 以及 setProperty().
◆ isPlaying()
|
noexcept |
True when playing.
在文件 AudioSourceEditor.cpp 第 413 行定义.
引用了 eve::audio_editing::Playing , 以及 eve::audio_editing::AudioTransportSnapshot::state.
被这些函数引用 eve::audio_editor::AudioSourcePresentation::action(), attachLiveAudition() , 以及 eve::audio_editor::AudioSourcePresentation::state().
◆ layoutWidth()
|
inlinenoexcept |
Layout width.
在文件 AudioSourceEditor.h 第 181 行定义.
◆ loopEndX()
|
noexcept |
Loop end x.
在文件 AudioSourceEditor.cpp 第 440 行定义.
引用了 duration(), end , 以及 eve::audio_editing::AudioTransportSnapshot::loopEnd.
◆ loopStartX()
|
noexcept |
Loop start x.
在文件 AudioSourceEditor.cpp 第 435 行定义.
引用了 duration() , 以及 eve::audio_editing::AudioTransportSnapshot::loopStart.
◆ operator=()
|
delete |
◆ pause()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::pause | ( | ) |
◆ pcmRevision()
|
inlinenoexcept |
Pcm revision.
在文件 AudioSourceEditor.h 第 175 行定义.
◆ play()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::play | ( | ) |
◆ playhead()
|
noexcept |
Playhead.
在文件 AudioSourceEditor.cpp 第 423 行定义.
引用了 eve::audio_editing::AudioTransportSnapshot::position.
被这些函数引用 attachLiveAudition() , 以及 playheadX().
◆ playheadX()
|
noexcept |
◆ pollPreview()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::pollPreview | ( | ) |
Publish the current completed preview atomically; Pending while work runs, NoOp when idle. Owner thread only.
在文件 AudioSourcePreview.cpp 第 87 行定义.
引用了 eve::Result< T >::failure(), eve::editing::noOp(), eve::editing::pending(), eve::editor::Pending, eve::editor::PreviewState::phase, previewState(), result , 以及 revision().
被这些函数引用 update().
◆ previewState()
|
noexcept |
Observe request sequence, provider generation and phase without copying preview payloads.
在文件 AudioSourcePreview.cpp 第 40 行定义.
被这些函数引用 pollPreview().
◆ read()
| audio_editing::PropertyReadResult eve::audio_editor::AudioSourceEditor::read | ( | const std::string & | path | ) | const |
Read a property using the source selection.
在文件 AudioSourceEditor.cpp 第 446 行定义.
引用了 path , 以及 eve::audio_editing::AudioSourceTarget::read().
◆ redo()
| audio_editing::Result< editor::TransactionReceipt > eve::audio_editor::AudioSourceEditor::redo | ( | ) |
Redo.
在文件 AudioSourceEditor.cpp 第 315 行定义.
引用了 eve::Result< T >::failure(), eve::editor::LocalTransactionBackend::redo() , 以及 result.
被这些函数引用 eve::audio_editor::AudioSourcePresentation::action().
◆ requestPreview()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::requestPreview | ( | ) |
Queue a preview of the current domain inputs; accepted work returns Pending. @cost Copies the PCM/clip input once per request; computation runs on the editing task worker, amortized over polls.
在文件 AudioSourcePreview.cpp 第 54 行定义.
引用了 eve::editing::applied(), eve::audio_editing::AudioWaveformRequest::asset, context, end, eve::Result< T >::failure(), path, provider, read, request, result, revision(), eve::editing::EditableTargetState::revision(), start, value , 以及 width.
◆ revision()
|
inlinenoexcept |
Revision.
在文件 AudioSourceEditor.h 第 173 行定义.
被这些函数引用 pollPreview(), requestPreview() , 以及 eve::audio_editor::AudioSourcePresentation::state().
◆ seekSeconds()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::seekSeconds | ( | double | seconds | ) |
Seek preview to an exact time in seconds.
在文件 AudioSourceEditor.cpp 第 248 行定义.
引用了 eve::audio_editing::AudioAuditionTransport::seek() , 以及 eve::audio_editing::AudioAuditionTransport::snapshot().
被这些函数引用 seekX().
◆ seekX()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::seekX | ( | float | x | ) |
Seek from a waveform x coordinate in the current viewport.
- 参数
-
x Pixel x in the waveform view.
在文件 AudioSourceEditor.cpp 第 240 行定义.
引用了 duration(), seekSeconds() , 以及 x.
◆ setPreviewProvider()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::setPreviewProvider | ( | std::shared_ptr< const IAudioSourcePreviewProvider > | provider | ) |
Replace the owned immutable preview provider and invalidate all previous work, even for the same instance. @ownership Retains shared ownership; null explicitly disables previews, preserving the last successful payload. @thread Owner thread; providers run on a worker with owning immutable inputs and must cooperate with cancellation. @reentrancy Provider callbacks never run under editor locks or access this editor.
在文件 AudioSourcePreview.cpp 第 41 行定义.
◆ setProperty()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::setProperty | ( | const std::string & | path, |
| const audio_editing::EditorValue & | value | ||
| ) |
Commit an absolute property assignment through the document transaction path.
在文件 AudioSourceEditor.cpp 第 256 行定义.
引用了 eve::editor::LocalTransactionBackend::append(), eve::editing::TransactionSpec::baseRevision, eve::editor::LocalTransactionBackend::begin(), eve::audio_editing::AudioAuditionTransport::bind(), eve::editor::LocalTransactionBackend::commit(), committed, duration(), eve::Result< T >::failure(), eve::editing::TransactionSpec::id, eve::editing::TransactionSpec::label, loop, eve::audio_editing::AudioSourceTarget::makeSet(), eve::editing::TransactionSpec::mergeKey, number, operation, path, eve::editing::EditableTargetState::revision(), eve::editor::LocalTransactionBackend::rollback(), eve::audio_editor::AudioClockTransportBackend::setDuration(), eve::audio_editing::AudioAuditionTransport::setLoop(), eve::editing::TransactionSpec::target, eve::audio_editing::AudioSourceTarget::targetId() , 以及 value.
被这些函数引用 eve::audio_editor::AudioSourcePresentation::write().
◆ setViewportWidth()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::setViewportWidth | ( | float | width | ) |
Rebuild waveform envelopes for the given pixel width.
- 参数
-
width Viewport width in pixels; finite, at least 8, and within waveform service limits.
- 返回
- Rejected on invalid input; failed rebuilds preserve the last valid waveform and layout.
在文件 AudioSourceEditor.cpp 第 232 行定义.
引用了 eve::audio_editing::AudioWaveformService::maximumPreviewPixels , 以及 width.
◆ snapshot()
|
inline |
Canonical snapshot of the source document.
在文件 AudioSourceEditor.h 第 205 行定义.
◆ stop()
| audio_editing::Result< void > eve::audio_editor::AudioSourceEditor::stop | ( | ) |
◆ target()
|
inlinenoexcept |
Borrow the authoritative source document.
在文件 AudioSourceEditor.h 第 115 行定义.
被这些函数引用 eve::audio_editor::AudioSourcePresentation::schema() , 以及 eve::audio_editor::AudioSourcePresentation::state().
◆ transport()
|
inlinenoexcept |
Latest transport observation after a successful update/play.
在文件 AudioSourceEditor.h 第 202 行定义.
◆ undo()
| audio_editing::Result< editor::TransactionReceipt > eve::audio_editor::AudioSourceEditor::undo | ( | ) |
Undo.
在文件 AudioSourceEditor.cpp 第 303 行定义.
引用了 eve::Result< T >::failure(), result , 以及 eve::editor::LocalTransactionBackend::undo().
被这些函数引用 eve::audio_editor::AudioSourcePresentation::action().
◆ update()
| audio_editing::Result< audio_editing::AudioTransportSnapshot > eve::audio_editor::AudioSourceEditor::update | ( | double | deltaSeconds | ) |
Poll audition and advance the clock backend.
- 参数
-
deltaSeconds Injected frame time.
在文件 AudioSourceEditor.cpp 第 351 行定义.
引用了 eve::audio_editor::AudioClockTransportBackend::advance(), eve::Result< T >::failure(), pollPreview() , 以及 eve::audio_editing::AudioAuditionTransport::update().
该类的文档由以下文件生成:
- src/modules/audio/editor/AudioSourceEditor.h
- src/modules/audio/editor/AudioSourceEditor.cpp
- src/modules/audio/editor/AudioSourcePreview.cpp