speechrecorderng 2.22.0 → 2.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1448,6 +1448,7 @@ class RecordingFile {
1448
1448
  this.date = null;
1449
1449
  this._dateAsDateObj = null;
1450
1450
  this.startedDate = null;
1451
+ this._startedAsDateObj = null;
1451
1452
  this.audioBuffer = null;
1452
1453
  this.session = null;
1453
1454
  this.frames = null;
@@ -10643,15 +10644,44 @@ class RecordingList {
10643
10644
  this.recordingListDataSource = new MatTableDataSource();
10644
10645
  }
10645
10646
  ngAfterViewInit() {
10646
- this.recordingListDataSource.data = this.recordingList.reverse();
10647
+ this.buildDataSource();
10648
+ }
10649
+ buildDataSource() {
10650
+ this.recordingList.sort((a, b) => {
10651
+ let cmp = 0;
10652
+ let aD = null;
10653
+ let bD = null;
10654
+ if (a._startedAsDateObj && b._startedAsDateObj) {
10655
+ aD = a._startedAsDateObj;
10656
+ bD = b._startedAsDateObj;
10657
+ }
10658
+ else if (a.startedDate && b.startedDate) {
10659
+ aD = new Date(a.startedDate);
10660
+ bD = new Date(b.startedDate);
10661
+ }
10662
+ else if (a.date && b.date) {
10663
+ aD = new Date(a.date);
10664
+ bD = new Date(b.date);
10665
+ }
10666
+ if (aD !== null && bD !== null) {
10667
+ cmp = bD.getTime() - aD.getTime();
10668
+ }
10669
+ return cmp;
10670
+ });
10671
+ this.recordingListDataSource.data = this.recordingList;
10647
10672
  }
10648
10673
  push(rf) {
10649
10674
  this.recordingList.push(rf);
10650
- this.recordingListDataSource.data = this.recordingList.reverse();
10675
+ this.buildDataSource();
10651
10676
  }
10652
10677
  selectRecordingFile(rf) {
10653
10678
  this.selectedRecordingFileChanged.emit(rf);
10654
10679
  }
10680
+ selectTop() {
10681
+ if (this.recordingList.length > 0) {
10682
+ this.selectRecordingFile(this.recordingList[0]);
10683
+ }
10684
+ }
10655
10685
  lengthTimeFormatted(rf) {
10656
10686
  let str = '--:--:--';
10657
10687
  if (rf.frames && rf.audioBuffer) {
@@ -10671,15 +10701,15 @@ RecordingList.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version:
10671
10701
  <tr mat-header-row *matHeaderRowDef="cols;sticky:true"></tr>
10672
10702
  <tr mat-row *matRowDef="let element; columns: cols;" [scrollIntoViewToBottom]="element.uuid===selectedRecordingFile?.uuid"></tr>
10673
10703
  <ng-container matColumnDef="index">
10674
- <th mat-header-cell *matHeaderCellDef mat-sort-header>#</th>
10704
+ <th mat-header-cell *matHeaderCellDef mat-header>#</th>
10675
10705
  <td mat-cell class="monospaced" *matCellDef="let element;let i = index">{{recordingListDataSource.data.length-i}}</td>
10676
10706
  </ng-container>
10677
10707
  <ng-container matColumnDef="startedDate">
10678
- <th mat-header-cell *matHeaderCellDef mat-sort-header>Started</th>
10708
+ <th mat-header-cell *matHeaderCellDef mat-header>Started</th>
10679
10709
  <td mat-cell class="monospaced" *matCellDef="let element">{{element.startedDate | date:'YYYY-MM-dd HH:mm:ss'}}</td>
10680
10710
  </ng-container>
10681
10711
  <ng-container matColumnDef="length">
10682
- <th mat-header-cell *matHeaderCellDef mat-sort-header>Length</th>
10712
+ <th mat-header-cell *matHeaderCellDef mat-header>Length</th>
10683
10713
  <td mat-cell class="monospaced" *matCellDef="let element">{{lengthTimeFormatted(element)}}</td>
10684
10714
  </ng-container>
10685
10715
  <ng-container matColumnDef="action">
@@ -10703,15 +10733,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.1", ngImpor
10703
10733
  <tr mat-header-row *matHeaderRowDef="cols;sticky:true"></tr>
10704
10734
  <tr mat-row *matRowDef="let element; columns: cols;" [scrollIntoViewToBottom]="element.uuid===selectedRecordingFile?.uuid"></tr>
10705
10735
  <ng-container matColumnDef="index">
10706
- <th mat-header-cell *matHeaderCellDef mat-sort-header>#</th>
10736
+ <th mat-header-cell *matHeaderCellDef mat-header>#</th>
10707
10737
  <td mat-cell class="monospaced" *matCellDef="let element;let i = index">{{recordingListDataSource.data.length-i}}</td>
10708
10738
  </ng-container>
10709
10739
  <ng-container matColumnDef="startedDate">
10710
- <th mat-header-cell *matHeaderCellDef mat-sort-header>Started</th>
10740
+ <th mat-header-cell *matHeaderCellDef mat-header>Started</th>
10711
10741
  <td mat-cell class="monospaced" *matCellDef="let element">{{element.startedDate | date:'YYYY-MM-dd HH:mm:ss'}}</td>
10712
10742
  </ng-container>
10713
10743
  <ng-container matColumnDef="length">
10714
- <th mat-header-cell *matHeaderCellDef mat-sort-header>Length</th>
10744
+ <th mat-header-cell *matHeaderCellDef mat-header>Length</th>
10715
10745
  <td mat-cell class="monospaced" *matCellDef="let element">{{lengthTimeFormatted(element)}}</td>
10716
10746
  </ng-container>
10717
10747
  <ng-container matColumnDef="action">
@@ -10747,6 +10777,9 @@ class RecorderCombiPane {
10747
10777
  selectRecordingFile(rf) {
10748
10778
  this.selectedRecordingFileChanged.emit(rf);
10749
10779
  }
10780
+ selectTop() {
10781
+ this.recordingListComp.selectTop();
10782
+ }
10750
10783
  }
10751
10784
  RecorderCombiPane.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.1", ngImport: i0, type: RecorderCombiPane, deps: [], target: i0.ɵɵFactoryTarget.Component });
10752
10785
  RecorderCombiPane.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.1", type: RecorderCombiPane, selector: "app-recordercombipane", inputs: { selectDisabled: "selectDisabled", selectedRecordingFile: "selectedRecordingFile", audioSignalCollapsed: "audioSignalCollapsed", displayAudioClip: "displayAudioClip", playStartAction: "playStartAction", playSelectionAction: "playSelectionAction", autoPlayOnSelectToggleAction: "autoPlayOnSelectToggleAction", playStopAction: "playStopAction" }, outputs: { selectedRecordingFileChanged: "selectedRecordingFileChanged" }, viewQueries: [{ propertyName: "recordingListComp", first: true, predicate: RecordingList, descendants: true }, { propertyName: "audioDisplay", first: true, predicate: AudioDisplay, descendants: true, static: true }], ngImport: i0, template: `
@@ -11046,8 +11079,12 @@ class AudioRecorder {
11046
11079
  if (rfs) {
11047
11080
  if (rfs instanceof Array) {
11048
11081
  rfs.forEach((rf) => {
11049
- //console.debug("Already recorded: " + rf+ " "+rf.recording.itemcode);
11050
- //this.addRecordingFileByDescriptor(rf);
11082
+ if (rf.startedDate) {
11083
+ rf._startedAsDateObj = new Date(rf.startedDate);
11084
+ }
11085
+ if (rf.date) {
11086
+ rf._dateAsDateObj = new Date(rf.date);
11087
+ }
11051
11088
  this.recorderCombiPane.push(rf);
11052
11089
  });
11053
11090
  }
@@ -11511,9 +11548,10 @@ class AudioRecorder {
11511
11548
  }
11512
11549
  });
11513
11550
  }
11514
- if (this.recorderCombiPane.recordingListComp.recordingList.length > 0) {
11515
- this.selectRecordingFile(this.recorderCombiPane.recordingListComp.recordingList[0]);
11516
- }
11551
+ // if(this.recorderCombiPane.recordingListComp.recordingList.length>0){
11552
+ // this.selectRecordingFile(this.recorderCombiPane.recordingListComp.recordingList[0]);
11553
+ // }
11554
+ this.recorderCombiPane.selectTop();
11517
11555
  this.enableNavigation();
11518
11556
  }
11519
11557
  isRecording() {
@@ -11617,7 +11655,10 @@ class AudioRecorder {
11617
11655
  // it.recs = new Array<RecordingFile>();
11618
11656
  // }
11619
11657
  let rf = new RecordingFile(UUID.generate(), sessId, ad);
11620
- rf.startedDate = this.startedDate;
11658
+ rf._startedAsDateObj = this.startedDate;
11659
+ if (rf._startedAsDateObj) {
11660
+ rf.startedDate = rf._startedAsDateObj.toString();
11661
+ }
11621
11662
  // it.recs.push(rf);
11622
11663
  //
11623
11664
  // if (this.enableUploadRecordings) {
@@ -11649,7 +11690,7 @@ class AudioRecorder {
11649
11690
  this.displayRecFile = rf;
11650
11691
  //this.recordingListComp.recordingList.push(rf);
11651
11692
  this.recorderCombiPane.push(rf);
11652
- this.postRecordingMultipart(wavFile, rf.uuid, rf.session, rf.startedDate, recUrl);
11693
+ this.postRecordingMultipart(wavFile, rf.uuid, rf.session, rf._startedAsDateObj, recUrl);
11653
11694
  this.processingRecording = false;
11654
11695
  this.changeDetectorRef.detectChanges();
11655
11696
  });
@@ -11948,7 +11989,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.1", ngImpor
11948
11989
  }]
11949
11990
  }] });
11950
11991
 
11951
- const VERSION = '2.22.0';
11992
+ const VERSION = '2.22.1';
11952
11993
 
11953
11994
  /*
11954
11995
  * Public API Surface of speechrecorderng