From 3535df38ed02aebcc86b1279a6738eb7bdb05b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20P=C3=B6mp?= Date: Mon, 18 Sep 2023 22:56:51 +0200 Subject: [PATCH] refactor(octra): build system works again --- .../octra-dropzone.component.ts | 3 ++- .../src/lib/converters/AnnotJSONConverter.ts | 2 +- .../src/lib/converters/BundleJSONConverter.ts | 2 +- .../src/lib/converters/CTMConverter.ts | 2 +- .../src/lib/converters/Converter.ts | 2 +- .../src/lib/converters/ELANConverter.ts | 2 +- .../src/lib/converters/PartiturConverter.ts | 2 +- .../src/lib/converters/PraatTableConverter.ts | 2 +- .../lib/converters/PraatTextgridConverter.ts | 2 +- .../src/lib/converters/SRTConverter.ts | 2 +- .../src/lib/converters/TextConverter.ts | 2 +- .../src/lib/converters/WebVTTConverter.ts | 2 +- libs/annotation/src/lib/functions.ts | 3 +-- libs/media/src/index.ts | 1 + libs/media/src/lib/audio/audio-file.ts | 20 ++++++++++++++++++ libs/web-media/src/lib/audio/audio-info.ts | 21 ------------------- .../web-media/src/lib/audio/audio-resource.ts | 3 ++- 17 files changed, 37 insertions(+), 36 deletions(-) create mode 100644 libs/media/src/lib/audio/audio-file.ts diff --git a/apps/octra/src/app/core/component/octra-dropzone/octra-dropzone.component.ts b/apps/octra/src/app/core/component/octra-dropzone/octra-dropzone.component.ts index e19f7c26f..75fd34f21 100644 --- a/apps/octra/src/app/core/component/octra-dropzone/octra-dropzone.component.ts +++ b/apps/octra/src/app/core/component/octra-dropzone/octra-dropzone.component.ts @@ -18,7 +18,8 @@ import { import { timer } from 'rxjs'; import { SupportedFilesModalComponent } from '../../modals/supportedfiles-modal/supportedfiles-modal.component'; import { DefaultComponent } from '../default.component'; -import { AudioManager, fileListToArray, OAudiofile } from '@octra/web-media'; +import { AudioManager, fileListToArray } from '@octra/web-media'; +import { OAudiofile } from '@octra/media'; @Component({ selector: 'octra-dropzone', diff --git a/libs/annotation/src/lib/converters/AnnotJSONConverter.ts b/libs/annotation/src/lib/converters/AnnotJSONConverter.ts index deb57ff51..103816972 100644 --- a/libs/annotation/src/lib/converters/AnnotJSONConverter.ts +++ b/libs/annotation/src/lib/converters/AnnotJSONConverter.ts @@ -6,7 +6,7 @@ import { OctraAnnotationFormatType, } from './Converter'; import { OAnnotJSON } from '../annotjson'; -import { OAudiofile } from '@octra/web-media'; +import { OAudiofile } from '@octra/media'; export class AnnotJSONConverter extends Converter { override _name: OctraAnnotationFormatType = 'AnnotJSON'; diff --git a/libs/annotation/src/lib/converters/BundleJSONConverter.ts b/libs/annotation/src/lib/converters/BundleJSONConverter.ts index a8de42cdb..b69d552c2 100644 --- a/libs/annotation/src/lib/converters/BundleJSONConverter.ts +++ b/libs/annotation/src/lib/converters/BundleJSONConverter.ts @@ -6,7 +6,7 @@ import { OctraAnnotationFormatType, } from './Converter'; import { IAnnotJSON, OAnnotJSON } from '../annotjson'; -import { OAudiofile } from '@octra/web-media'; +import { OAudiofile } from '@octra/media'; export interface Bundle { ssffFiles: { diff --git a/libs/annotation/src/lib/converters/CTMConverter.ts b/libs/annotation/src/lib/converters/CTMConverter.ts index 9a179de3e..8decc4737 100644 --- a/libs/annotation/src/lib/converters/CTMConverter.ts +++ b/libs/annotation/src/lib/converters/CTMConverter.ts @@ -7,7 +7,7 @@ import { } from './Converter'; import { contains } from '@octra/utilities'; import { OAnnotJSON, OLabel, OSegment, OSegmentLevel } from '../annotjson'; -import { OAudiofile } from '@octra/web-media'; +import { OAudiofile } from '@octra/media'; export class CTMConverter extends Converter { override _name: OctraAnnotationFormatType = 'CTM'; diff --git a/libs/annotation/src/lib/converters/Converter.ts b/libs/annotation/src/lib/converters/Converter.ts index 1e278d7c6..af27d168a 100644 --- a/libs/annotation/src/lib/converters/Converter.ts +++ b/libs/annotation/src/lib/converters/Converter.ts @@ -1,5 +1,5 @@ import { OAnnotJSON } from '../annotjson'; -import { OAudiofile } from '@octra/web-media'; +import { OAudiofile } from '@octra/media'; export type OctraAnnotationFormatType = | 'AnnotJSON' diff --git a/libs/annotation/src/lib/converters/ELANConverter.ts b/libs/annotation/src/lib/converters/ELANConverter.ts index d38916bb6..21dc1ddfc 100644 --- a/libs/annotation/src/lib/converters/ELANConverter.ts +++ b/libs/annotation/src/lib/converters/ELANConverter.ts @@ -8,7 +8,7 @@ import { } from './Converter'; import { OAnnotJSON, OLabel, OSegment, OSegmentLevel } from '../annotjson'; import { DateTime } from 'luxon'; -import { OAudiofile } from '@octra/web-media'; +import { OAudiofile } from '@octra/media'; export class ELANConverter extends Converter { override _name: OctraAnnotationFormatType = 'ELAN'; diff --git a/libs/annotation/src/lib/converters/PartiturConverter.ts b/libs/annotation/src/lib/converters/PartiturConverter.ts index 16db376e5..dda606a55 100644 --- a/libs/annotation/src/lib/converters/PartiturConverter.ts +++ b/libs/annotation/src/lib/converters/PartiturConverter.ts @@ -13,7 +13,7 @@ import { OSegment, OSegmentLevel, } from '../annotjson'; -import { OAudiofile } from '@octra/web-media'; +import { OAudiofile } from '@octra/media'; export class PartiturConverter extends Converter { override _name: OctraAnnotationFormatType = 'BASPartitur'; diff --git a/libs/annotation/src/lib/converters/PraatTableConverter.ts b/libs/annotation/src/lib/converters/PraatTableConverter.ts index 1a9cfbed1..47e575aa2 100644 --- a/libs/annotation/src/lib/converters/PraatTableConverter.ts +++ b/libs/annotation/src/lib/converters/PraatTableConverter.ts @@ -14,7 +14,7 @@ import { OSegmentLevel, } from '../annotjson'; import { contains } from '../functions'; -import { OAudiofile } from '@octra/web-media'; +import { OAudiofile } from '@octra/media'; export class PraatTableConverter extends Converter { override _name: OctraAnnotationFormatType = 'PraatTextTable'; diff --git a/libs/annotation/src/lib/converters/PraatTextgridConverter.ts b/libs/annotation/src/lib/converters/PraatTextgridConverter.ts index 0ac741313..c56d763a1 100644 --- a/libs/annotation/src/lib/converters/PraatTextgridConverter.ts +++ b/libs/annotation/src/lib/converters/PraatTextgridConverter.ts @@ -14,7 +14,7 @@ import { OSegmentLevel, } from '../annotjson'; import { contains } from '../functions'; -import { OAudiofile } from '@octra/web-media'; +import { OAudiofile } from '@octra/media'; export class PraatTextgridConverter extends Converter { override _name: OctraAnnotationFormatType = 'TextGrid'; diff --git a/libs/annotation/src/lib/converters/SRTConverter.ts b/libs/annotation/src/lib/converters/SRTConverter.ts index 66adce262..60ecaae24 100644 --- a/libs/annotation/src/lib/converters/SRTConverter.ts +++ b/libs/annotation/src/lib/converters/SRTConverter.ts @@ -6,7 +6,7 @@ import { OctraAnnotationFormatType, } from './Converter'; import { OAnnotJSON, OLabel, OSegment, OSegmentLevel } from '../annotjson'; -import { OAudiofile } from '@octra/web-media'; +import { OAudiofile } from '@octra/media'; export class SRTConverter extends Converter { override _name: OctraAnnotationFormatType = 'SRT'; diff --git a/libs/annotation/src/lib/converters/TextConverter.ts b/libs/annotation/src/lib/converters/TextConverter.ts index a78c2bbd9..0981d58ce 100644 --- a/libs/annotation/src/lib/converters/TextConverter.ts +++ b/libs/annotation/src/lib/converters/TextConverter.ts @@ -6,7 +6,7 @@ import { OctraAnnotationFormatType, } from './Converter'; import { OAnnotJSON, OLabel, OSegment, OSegmentLevel } from '../annotjson'; -import { OAudiofile } from '@octra/web-media'; +import { OAudiofile } from '@octra/media'; export class TextConverter extends Converter { override _name: OctraAnnotationFormatType = 'PlainText'; diff --git a/libs/annotation/src/lib/converters/WebVTTConverter.ts b/libs/annotation/src/lib/converters/WebVTTConverter.ts index 25f70a7fd..85fa862b4 100644 --- a/libs/annotation/src/lib/converters/WebVTTConverter.ts +++ b/libs/annotation/src/lib/converters/WebVTTConverter.ts @@ -12,7 +12,7 @@ import { OSegment, OSegmentLevel, } from '../annotjson'; -import { OAudiofile } from '@octra/web-media'; +import { OAudiofile } from '@octra/media'; export class WebVTTConverter extends Converter { override _name: OctraAnnotationFormatType = 'WebVTT'; diff --git a/libs/annotation/src/lib/functions.ts b/libs/annotation/src/lib/functions.ts index f1d90b2a1..d3f8290e6 100644 --- a/libs/annotation/src/lib/functions.ts +++ b/libs/annotation/src/lib/functions.ts @@ -1,8 +1,7 @@ import { OLabel, OSegment } from './annotjson'; import { Converter, IFile } from './converters'; -import { SampleUnit } from '@octra/media'; +import { OAudiofile, SampleUnit } from '@octra/media'; import { OctraAnnotationSegment } from './octraAnnotationSegment'; -import { OAudiofile } from '@octra/web-media'; export function convertFromSupportedConverters( converters: Converter[], diff --git a/libs/media/src/index.ts b/libs/media/src/index.ts index a224be645..819ad4486 100644 --- a/libs/media/src/index.ts +++ b/libs/media/src/index.ts @@ -1,2 +1,3 @@ export * from './lib/audio'; export * from './lib/types'; +export * from './lib/audio/audio-file'; diff --git a/libs/media/src/lib/audio/audio-file.ts b/libs/media/src/lib/audio/audio-file.ts new file mode 100644 index 000000000..f5d0a21b9 --- /dev/null +++ b/libs/media/src/lib/audio/audio-file.ts @@ -0,0 +1,20 @@ +export interface IAudioFile { + name: string; + size: number; + duration: number; + sampleRate: number; + url?: string; + type: string; +} + +// TODO add extension and use name without it +export class OAudiofile implements IAudioFile { + name!: string; + // need type attribute + arraybuffer?: ArrayBuffer; + size!: number; + duration!: number; + sampleRate!: number; + url?: string; + type!: string; +} diff --git a/libs/web-media/src/lib/audio/audio-info.ts b/libs/web-media/src/lib/audio/audio-info.ts index 0b988b40b..42449e965 100644 --- a/libs/web-media/src/lib/audio/audio-info.ts +++ b/libs/web-media/src/lib/audio/audio-info.ts @@ -1,27 +1,6 @@ import { SampleUnit } from '@octra/media'; import { FileInfo } from '../data-info'; -export interface IAudioFile { - name: string; - size: number; - duration: number; - sampleRate: number; - url?: string; - type: string; -} - -// TODO add extension and use name without it -export class OAudiofile implements IAudioFile { - name!: string; - // need type attribute - arraybuffer?: ArrayBuffer; - size!: number; - duration!: number; - sampleRate!: number; - url?: string; - type!: string; -} - export class AudioInfo extends FileInfo { private readonly _bitrate: number = -1; diff --git a/libs/web-media/src/lib/audio/audio-resource.ts b/libs/web-media/src/lib/audio/audio-resource.ts index 7e22159b9..ec1f251b0 100644 --- a/libs/web-media/src/lib/audio/audio-resource.ts +++ b/libs/web-media/src/lib/audio/audio-resource.ts @@ -1,6 +1,7 @@ -import { AudioInfo, OAudiofile } from './audio-info'; +import { AudioInfo } from './audio-info'; import { MediaResource } from '../media-resource'; import { SourceType } from '../types'; +import { OAudiofile } from '@octra/media'; export class AudioResource extends MediaResource { private _info: AudioInfo;