aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/AudioBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/AudioBox.tsx')
-rw-r--r--src/client/views/nodes/AudioBox.tsx10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/client/views/nodes/AudioBox.tsx b/src/client/views/nodes/AudioBox.tsx
index bde1a3d72..918933194 100644
--- a/src/client/views/nodes/AudioBox.tsx
+++ b/src/client/views/nodes/AudioBox.tsx
@@ -77,6 +77,8 @@ export class AudioBox extends ViewBoxAnnotatableComponent<
@observable _trimming: boolean = false;
@observable _trimStart: number = NumCast(this.layoutDoc.clipStart);
@observable _trimEnd: number | undefined = Cast(this.layoutDoc.clipEnd, "number");
+ @computed get clipStart() { return NumCast(this.layoutDoc.clipStart); }
+ @computed get clipEnd() { return NumCast(this.layoutDoc.clipEnd, this.duration); }
@computed get trimStart() { return this._trimming ? this._trimStart : NumCast(this.layoutDoc.clipStart); }
@computed get trimEnd() {
return this._trimming && this._trimEnd !== undefined ? this._trimEnd : NumCast(this.layoutDoc.clipEnd, this.duration);
@@ -181,9 +183,6 @@ export class AudioBox extends ViewBoxAnnotatableComponent<
this.mediaState = this.path ? "paused" : undefined;
- this.layoutDoc.clipStart = this.layoutDoc.clipStart ? this.layoutDoc.clipStart : 0;
- this.layoutDoc.clipEnd = this.layoutDoc.clipEnd ? this.layoutDoc.clipEnd : this.duration ? this.duration : undefined;
-
this.path && this.setAnchorTime(NumCast(this.layoutDoc.clipStart));
this.path && this.timecodeChanged();
@@ -496,9 +495,6 @@ export class AudioBox extends ViewBoxAnnotatableComponent<
// shows trim controls
@action
startTrim = () => {
- if (!this.duration) {
- this.timecodeChanged();
- }
if (this.mediaState === "playing") {
this.Pause();
}
@@ -581,6 +577,8 @@ export class AudioBox extends ViewBoxAnnotatableComponent<
playLink={this.playLink}
PanelWidth={this.timelineWidth}
PanelHeight={this.timelineHeight}
+ clipStart={this.clipStart}
+ clipEnd={this.clipEnd}
trimming={this._trimming}
trimStart={this.trimStartFunc}
trimEnd={this.trimEndFunc}