speechrecorderng 3.6.0 → 3.6.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.
@@ -10821,6 +10821,7 @@ class TransportActions {
10821
10821
  this.fwdNextAction = new Action('Next recording');
10822
10822
  this.fwdAction = new Action('Forward');
10823
10823
  this.bwdAction = new Action('Backward');
10824
+ this.stopNonrecordingAction = new Action('Next');
10824
10825
  }
10825
10826
  }
10826
10827
  class TransportPanel extends ResponsiveComponent {
@@ -10838,6 +10839,9 @@ class TransportPanel extends ResponsiveComponent {
10838
10839
  nextDisabled() {
10839
10840
  return !this.actions || this.actions.nextAction.disabled || !this.navigationEnabled;
10840
10841
  }
10842
+ stopNonrecordingDisabled() {
10843
+ return !this.actions || this.actions.stopNonrecordingAction.disabled || !this.navigationEnabled;
10844
+ }
10841
10845
  pauseDisabled() {
10842
10846
  return !this.actions || this.actions.pauseAction.disabled || !this.pausingEnabled;
10843
10847
  }
@@ -10851,7 +10855,7 @@ class TransportPanel extends ResponsiveComponent {
10851
10855
  return !this.actions || this.actions.bwdAction.disabled || !this.navigationEnabled;
10852
10856
  }
10853
10857
  startStopNextName() {
10854
- if (!this.nextDisabled()) {
10858
+ if (!this.nextDisabled() || !this.stopNonrecordingDisabled()) {
10855
10859
  this.startStopNextButtonName = "Next";
10856
10860
  }
10857
10861
  else if (!this.startDisabled()) {
@@ -10866,7 +10870,7 @@ class TransportPanel extends ResponsiveComponent {
10866
10870
  if (!this.startDisabled()) {
10867
10871
  this.startStopNextButtonIconName = "fiber_manual_record";
10868
10872
  }
10869
- else if (!this.stopDisabled()) {
10873
+ else if (!this.stopDisabled() || !this.stopNonrecordingDisabled()) {
10870
10874
  this.startStopNextButtonIconName = "stop";
10871
10875
  }
10872
10876
  else if (!this.nextDisabled()) {
@@ -10895,6 +10899,9 @@ class TransportPanel extends ResponsiveComponent {
10895
10899
  else if (!this.nextDisabled()) {
10896
10900
  this.actions.nextAction.perform();
10897
10901
  }
10902
+ else if (!this.stopNonrecordingDisabled()) {
10903
+ this.actions.stopNonrecordingAction.perform();
10904
+ }
10898
10905
  }
10899
10906
  }
10900
10907
  TransportPanel.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TransportPanel, deps: [{ token: i1$2.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component });
@@ -10903,8 +10910,8 @@ TransportPanel.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version
10903
10910
  mat-raised-button>
10904
10911
  <mat-icon>chevron_left</mat-icon>
10905
10912
  </button>
10906
- <button (click)="startStopNextPerform()" [disabled]="startDisabled() && stopDisabled() && nextDisabled()" mat-raised-button>
10907
- <mat-icon [style.color]="startStopNextIconColor()">{{startStopNextIconName()}}</mat-icon><mat-icon *ngIf="!nextDisabled()" [style.color]="nextDisabled() ? 'grey' : 'black'">chevron_right</mat-icon>
10913
+ <button (click)="startStopNextPerform()" [disabled]="startDisabled() && stopDisabled() && nextDisabled() && stopNonrecordingDisabled()" mat-raised-button>
10914
+ <mat-icon [style.color]="startStopNextIconColor()">{{startStopNextIconName()}}</mat-icon><mat-icon *ngIf="!nextDisabled() || !stopNonrecordingDisabled()" [style.color]="nextDisabled() ? 'grey' : 'black'">chevron_right</mat-icon>
10908
10915
  <span *ngIf="!screenXs">{{startStopNextName()}}</span>
10909
10916
  </button>
10910
10917
  <button *ngIf="pausingEnabled" (click)="actions.pauseAction.perform()" [disabled]="pauseDisabled()" mat-raised-button>
@@ -10926,8 +10933,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
10926
10933
  mat-raised-button>
10927
10934
  <mat-icon>chevron_left</mat-icon>
10928
10935
  </button>
10929
- <button (click)="startStopNextPerform()" [disabled]="startDisabled() && stopDisabled() && nextDisabled()" mat-raised-button>
10930
- <mat-icon [style.color]="startStopNextIconColor()">{{startStopNextIconName()}}</mat-icon><mat-icon *ngIf="!nextDisabled()" [style.color]="nextDisabled() ? 'grey' : 'black'">chevron_right</mat-icon>
10936
+ <button (click)="startStopNextPerform()" [disabled]="startDisabled() && stopDisabled() && nextDisabled() && stopNonrecordingDisabled()" mat-raised-button>
10937
+ <mat-icon [style.color]="startStopNextIconColor()">{{startStopNextIconName()}}</mat-icon><mat-icon *ngIf="!nextDisabled() || !stopNonrecordingDisabled()" [style.color]="nextDisabled() ? 'grey' : 'black'">chevron_right</mat-icon>
10931
10938
  <span *ngIf="!screenXs">{{startStopNextName()}}</span>
10932
10939
  </button>
10933
10940
  <button *ngIf="pausingEnabled" (click)="actions.pauseAction.perform()" [disabled]="pauseDisabled()" mat-raised-button>
@@ -12972,6 +12979,9 @@ class SessionManager extends BasicRecorder {
12972
12979
  this.postDelay = DEFAULT_POST_REC_DELAY;
12973
12980
  this.postRecTimerId = null;
12974
12981
  this.postRecTimerRunning = null;
12982
+ //private maxRecTimerRunning: boolean|null=null;
12983
+ this.nonRecordingDurationTimerId = null;
12984
+ this.nonRecordingDurationTimerRunning = false;
12975
12985
  this._promptIndex = 0;
12976
12986
  this.items = null;
12977
12987
  //selectedItemIdx: number;
@@ -13017,6 +13027,7 @@ class SessionManager extends BasicRecorder {
13017
13027
  this.transportActions.startAction.disabled = true;
13018
13028
  this.transportActions.stopAction.disabled = true;
13019
13029
  this.transportActions.nextAction.disabled = true;
13030
+ this.transportActions.stopNonrecordingAction.disabled = true;
13020
13031
  this.transportActions.pauseAction.disabled = true;
13021
13032
  this.playStartAction.disabled = true;
13022
13033
  // let context:AudioContext|null=null;
@@ -13087,6 +13098,7 @@ class SessionManager extends BasicRecorder {
13087
13098
  this.transportActions.nextAction.onAction = () => this.stopItem();
13088
13099
  this.transportActions.pauseAction.onAction = () => this.pauseItem();
13089
13100
  this.transportActions.fwdAction.onAction = () => this.nextItem();
13101
+ this.transportActions.stopNonrecordingAction.onAction = () => this.stopNonrecording();
13090
13102
  this.transportActions.fwdNextAction.onAction = () => this.nextUnrecordedItem();
13091
13103
  this.transportActions.bwdAction.onAction = () => this.prevItem();
13092
13104
  this.playStartAction.onAction = () => this.controlAudioPlayer?.start();
@@ -13096,6 +13108,7 @@ class SessionManager extends BasicRecorder {
13096
13108
  if (ke.key == ' ') {
13097
13109
  this.transportActions.startAction.perform();
13098
13110
  this.transportActions.nextAction.perform();
13111
+ this.transportActions.stopNonrecordingAction.perform();
13099
13112
  }
13100
13113
  }
13101
13114
  onKeyDown(ke) {
@@ -13236,27 +13249,63 @@ class SessionManager extends BasicRecorder {
13236
13249
  this.maxRecTimerRunning = false;
13237
13250
  }
13238
13251
  }
13239
- startItem() {
13240
- this.status = 2 /* STARTING */;
13241
- super.startItem();
13242
- if (this.readonly) {
13243
- this.status = 1 /* IDLE */;
13244
- return;
13252
+ clearNonRecordingDurationTimer() {
13253
+ if (this.nonRecordingDurationTimerRunning) {
13254
+ if (this.nonRecordingDurationTimerId) {
13255
+ window.clearTimeout(this.nonRecordingDurationTimerId);
13256
+ }
13257
+ this.nonRecordingDurationTimerRunning = false;
13245
13258
  }
13259
+ }
13260
+ startItem() {
13246
13261
  this.transportActions.fwdAction.disabled = true;
13247
13262
  this.transportActions.fwdNextAction.disabled = true;
13248
13263
  this.transportActions.bwdAction.disabled = true;
13249
- this.updateDisplayRecFile(null);
13250
- this.displayRecFileVersion = 0;
13251
- this.displayAudioClip = null;
13252
- this.liveLevelDisplay.reset(true);
13253
- // Hide loading hint on livelevel display
13254
- this.liveLevelDisplayState = State.READY;
13255
- this.showRecording();
13256
- if (this.section.mode === 'AUTORECORDING') {
13257
- this.autorecording = true;
13264
+ const isNonrecording = (this.promptItem.type === 'nonrecording');
13265
+ if (isNonrecording) {
13266
+ this.status = 1 /* IDLE */;
13267
+ this.updateDisplayRecFile(null);
13268
+ this.displayRecFileVersion = 0;
13269
+ this.displayAudioClip = null;
13270
+ this.liveLevelDisplay.reset(true);
13271
+ // Hide loading hint on livelevel display
13272
+ this.liveLevelDisplayState = State.READY;
13273
+ this.showRecording();
13274
+ if (this.section.mode === 'AUTORECORDING') {
13275
+ this.autorecording = true;
13276
+ }
13277
+ const nrDuration = this.promptItem.duration;
13278
+ if (this.autorecording && nrDuration !== undefined) {
13279
+ this.nonRecordingDurationTimerId = window.setTimeout(() => {
13280
+ this.nonRecordingDurationTimerRunning = false;
13281
+ this.transportActions.stopNonrecordingAction.disabled = true;
13282
+ this.status = 7 /* STOPPING_STOP */;
13283
+ this.continueSession();
13284
+ }, nrDuration);
13285
+ this.nonRecordingDurationTimerRunning = true;
13286
+ }
13287
+ this.status = 9 /* NON_RECORDING_WAIT */;
13288
+ this.transportActions.stopNonrecordingAction.disabled = false;
13289
+ }
13290
+ else {
13291
+ this.status = 2 /* STARTING */;
13292
+ super.startItem();
13293
+ if (this.readonly) {
13294
+ this.status = 1 /* IDLE */;
13295
+ return;
13296
+ }
13297
+ this.updateDisplayRecFile(null);
13298
+ this.displayRecFileVersion = 0;
13299
+ this.displayAudioClip = null;
13300
+ this.liveLevelDisplay.reset(true);
13301
+ // Hide loading hint on livelevel display
13302
+ this.liveLevelDisplayState = State.READY;
13303
+ this.showRecording();
13304
+ if (this.section.mode === 'AUTORECORDING') {
13305
+ this.autorecording = true;
13306
+ }
13307
+ this.startCapture();
13258
13308
  }
13259
- this.startCapture();
13260
13309
  }
13261
13310
  loadScript() {
13262
13311
  this.promptItemCount = 0;
@@ -13645,7 +13694,7 @@ class SessionManager extends BasicRecorder {
13645
13694
  return (this.status === 3 /* PRE_RECORDING */ || this.status === 4 /* RECORDING */ || this.status === 5 /* POST_REC_STOP */ || this.status === 6 /* POST_REC_PAUSE */ || this.status === 7 /* STOPPING_STOP */);
13646
13695
  }
13647
13696
  isActive() {
13648
- return (!(this.status === 0 /* BLOCKED */ || this.status === 1 /* IDLE */ || this.status === 9 /* ERROR */) || this.processingRecording || this.sessionService.uploadCount > 0);
13697
+ return (!(this.status === 0 /* BLOCKED */ || this.status === 1 /* IDLE */ || this.status === 10 /* ERROR */) || this.processingRecording || this.sessionService.uploadCount > 0);
13649
13698
  }
13650
13699
  prevItem() {
13651
13700
  let newPrIdx = this._promptIndex;
@@ -13796,6 +13845,7 @@ class SessionManager extends BasicRecorder {
13796
13845
  this.startStopSignalState = 2 /* POSTRECORDING */;
13797
13846
  this.transportActions.stopAction.disabled = true;
13798
13847
  this.transportActions.nextAction.disabled = true;
13848
+ //this.transportActions.stopNonrecordingAction.disabled=true;
13799
13849
  this.clearPreRecTimer();
13800
13850
  this.postRecTimerId = window.setTimeout(() => {
13801
13851
  this.postRecTimerRunning = false;
@@ -13804,12 +13854,19 @@ class SessionManager extends BasicRecorder {
13804
13854
  }, this.postDelay);
13805
13855
  this.postRecTimerRunning = true;
13806
13856
  }
13857
+ stopNonrecording() {
13858
+ this.transportActions.stopNonrecordingAction.disabled = true;
13859
+ this.clearNonRecordingDurationTimer();
13860
+ this.status = 7 /* STOPPING_STOP */;
13861
+ this.continueSession();
13862
+ }
13807
13863
  pauseItem() {
13808
13864
  this.status = 6 /* POST_REC_PAUSE */;
13809
13865
  this.transportActions.pauseAction.disabled = true;
13810
13866
  this.startStopSignalState = 2 /* POSTRECORDING */;
13811
13867
  this.transportActions.stopAction.disabled = true;
13812
13868
  this.transportActions.nextAction.disabled = true;
13869
+ this.transportActions.stopNonrecordingAction.disabled = true;
13813
13870
  this.transportActions.pauseAction.disabled = true;
13814
13871
  this.clearPreRecTimer();
13815
13872
  this.postRecTimerId = window.setTimeout(() => {
@@ -14011,6 +14068,9 @@ class SessionManager extends BasicRecorder {
14011
14068
  }
14012
14069
  }
14013
14070
  }
14071
+ this.continueSession();
14072
+ }
14073
+ continueSession() {
14014
14074
  // check complete session
14015
14075
  let complete = true;
14016
14076
  if (this.items) {
@@ -14069,7 +14129,7 @@ class SessionManager extends BasicRecorder {
14069
14129
  this.changeDetectorRef.detectChanges();
14070
14130
  }
14071
14131
  error(msg = 'An unknown error occured during recording.', advice = 'Please retry.') {
14072
- this.status = 9 /* ERROR */;
14132
+ this.status = 10 /* ERROR */;
14073
14133
  super.error(msg, advice);
14074
14134
  this.updateNavigationActions();
14075
14135
  this.updateStartActionDisableState();
@@ -14507,7 +14567,7 @@ class SpeechrecorderngComponent extends RecorderComponent {
14507
14567
  ngAfterViewInit() {
14508
14568
  // let wakeLockSupp=('wakeLock' in navigator);
14509
14569
  // alert('Wake lock API supported: '+wakeLockSupp);
14510
- if (this.sm.status !== 9 /* ERROR */) {
14570
+ if (this.sm.status !== 10 /* ERROR */) {
14511
14571
  let initSuccess = this.init();
14512
14572
  if (initSuccess) {
14513
14573
  this.route.queryParams.subscribe((params) => {
@@ -17636,7 +17696,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
17636
17696
  }]
17637
17697
  }] });
17638
17698
 
17639
- const VERSION = '3.6.0';
17699
+ const VERSION = '3.6.1';
17640
17700
 
17641
17701
  /*
17642
17702
  * Public API Surface of speechrecorderng