Skip to content

Commit

Permalink
refactor(octra): fix asr-options actions not changing in favour of qu…
Browse files Browse the repository at this point in the history
…eue state
  • Loading branch information
julianpoemp committed Oct 26, 2023
1 parent f4b45b5 commit 5e6543d
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ngbDropdownToggle
>
<ng-container
*ngIf="(asrStoreService.asrOptions$|async)?.selectedLanguage === undefined; else asrAllSet"
*ngIf="(asrStoreService.asrOptions$|async)?.selectedLanguage === null || (asrStoreService.asrOptions$|async)?.selectedLanguage === undefined || (asrStoreService.asrOptions$|async)?.selectedLanguage === ''; else asrAllSet"
>
{{ 'asr.without asr' | transloco }}
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
role="menu"
(click)="$event.stopPropagation()"
>
<table class="table">
<table class="table w-100">
<tr>
<td>
<label class="form-check-label" for="easymode"
Expand Down Expand Up @@ -564,7 +564,8 @@
>
<br />
<div
class="btn-group w-100"
style="min-width: 300px;"
class="btn-group"
role="group"
aria-label="Basic example"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
.info-menu {
padding: 20px;
font-size: 0.7em;
min-width: 300px;
}

.dropdown-menu.options-menu.show label,
Expand Down Expand Up @@ -110,3 +109,7 @@
.dropdown-toggle::after {
content: unset;
}

.form-switch.form-check-reverse {
display: block;
}
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,6 @@ export class TranscrEditorComponent
this.shortcutService.unregisterShortcutGroup('texteditor');
this.shortcutService.registerShortcutGroup(this.shortcuts);

this.asrStoreService.stopItemProcessing({
sampleStart: this.audiochunk.time.start.samples,
sampleLength: this.audiochunk.time.duration.samples,
});

this.joditOptions = {
...this.joditDefaultOptions,
showCharsCounter: false,
Expand Down
26 changes: 15 additions & 11 deletions apps/octra/src/app/core/store/asr/asr.effects.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,21 @@ export class AsrEffects {
item,
})
);
} else if (
![
ASRActions.processQueueItem.do.type,
ASRActions.startProcessing.do.type,
].includes(action.type as any)
) {
if (queue.statistics.running === 0) {
// no free item after continuation and nothing running
return of(
ASRActions.setQueueStatus.do({
status: ASRProcessStatus.IDLE,
})
);
}
}
// no free item
return of(
ASRActions.setQueueStatus.do({
status: ASRProcessStatus.IDLE,
})
);
}

// max parallel reached
Expand All @@ -190,11 +198,7 @@ export class AsrEffects {
})
);
}
return of(
ASRActions.setQueueStatus.do({
status: ASRProcessStatus.IDLE,
})
);
return of();
})
)
);
Expand Down
3 changes: 1 addition & 2 deletions apps/octra/src/app/core/store/asr/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ASRLanguage, ASRService, ASRSettings } from '../../obj';

export interface ASRStateSettings {
selectedLanguage?: string;
selectedLanguage?: string | null;
selectedService?: string;
selectedMausLanguage?: string;
accessCode?: string;
Expand All @@ -16,7 +16,6 @@ export enum ASRQueueItemType {
export enum ASRProcessStatus {
IDLE = 'IDLE',
STARTED = 'STARTED',
RUNNING = 'RUNNING',
STOPPED = 'STOPPED',
NOQUOTA = 'NOQUOTA',
NOAUTH = 'NOAUTH',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export class TranscrWindowComponent
this.segmentIndex
] as OctraAnnotationSegment;

if (segment?.context?.asr?.isBlockedBy === undefined) {
if (!segment?.context?.asr?.isBlockedBy) {
this.audiochunk.startPlayback().catch((error) => {
console.error(error);
});
Expand Down Expand Up @@ -539,7 +539,7 @@ export class TranscrWindowComponent
this.segmentIndex
] as OctraAnnotationSegment;

if (segment!.context?.asr?.isBlockedBy === undefined) {
if (!segment!.context?.asr?.isBlockedBy) {
this.audiochunk.startPlayback().catch((error) => {
console.error(error);
});
Expand Down Expand Up @@ -1111,6 +1111,7 @@ export class TranscrWindowComponent
: this.audioManager.createSampleUnit(0);
this.audiochunk.selection.end = this.tempSegments[i]!.time.clone();
this.loupe.av.drawnSelection = this.audiochunk.selection;

this.audiochunk.startPlayback().catch((error) => {
console.error(error);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ export class AudioViewerService {
if (value > -1 && this._dragableBoundaryID === -1) {
// started
this.tempAnnotation = this.annotation;
console.log(`boundary ${value} started dragging`);
this._boundaryDragging.next({
shiftPressed: this.shiftPressed,
status: 'started',
Expand Down

0 comments on commit 5e6543d

Please sign in to comment.