@@ -13,7 +13,7 @@ import { localize } from 'vs/nls';
13
13
import { observableFromEvent , derived } from 'vs/base/common/observable' ;
14
14
15
15
export const enum AudioCueGroupId {
16
- chatResponsePending = 'chatResponsePending '
16
+ chatResponseReceived = 'chatResponseReceived '
17
17
}
18
18
19
19
export const IAudioCueService = createDecorator < IAudioCueService > ( 'audioCue' ) ;
@@ -27,7 +27,7 @@ export interface IAudioCueService {
27
27
28
28
playSound ( cue : Sound , allowManyInParallel ?: boolean ) : Promise < void > ;
29
29
playAudioCueLoop ( cue : AudioCue ) : IDisposable ;
30
- playRandomAudioCue ( groupId : AudioCueGroupId , loop ?: boolean ) : IDisposable | void ;
30
+ playRandomAudioCue ( groupId : AudioCueGroupId , allowManyInParallel ?: boolean ) : IDisposable | void ;
31
31
}
32
32
33
33
export class AudioCueService extends Disposable implements IAudioCueService {
@@ -57,14 +57,10 @@ export class AudioCueService extends Disposable implements IAudioCueService {
57
57
await Promise . all ( Array . from ( sounds ) . map ( sound => this . playSound ( sound , true ) ) ) ;
58
58
}
59
59
60
- public playRandomAudioCue ( groupId : AudioCueGroupId , loop ?: boolean ) : void | IDisposable {
60
+ public playRandomAudioCue ( groupId : AudioCueGroupId , allowManyInParallel ?: boolean ) : void | IDisposable {
61
61
const cues = AudioCue . allAudioCues . filter ( cue => cue . groupId === groupId ) ;
62
62
const index = Math . floor ( Math . random ( ) * cues . length ) ;
63
- if ( loop ) {
64
- return this . playAudioCueLoop ( cues [ index ] ) ;
65
- } else {
66
- this . playAudioCue ( cues [ index ] ) ;
67
- }
63
+ this . playAudioCue ( cues [ index ] , allowManyInParallel ) ;
68
64
}
69
65
70
66
private getVolumeInPercent ( ) : number {
@@ -224,12 +220,12 @@ export class Sound {
224
220
public static readonly diffLineDeleted = Sound . register ( { fileName : 'diffLineDeleted.mp3' } ) ;
225
221
public static readonly diffLineModified = Sound . register ( { fileName : 'diffLineModified.mp3' } ) ;
226
222
public static readonly chatRequestSent = Sound . register ( { fileName : 'chatRequestSent.mp3' } ) ;
227
- public static readonly chatResponsePending1 = Sound . register ( { fileName : 'chatResponsePending1 .mp3' } ) ;
228
- public static readonly chatResponsePending2 = Sound . register ( { fileName : 'chatResponsePending2 .mp3' } ) ;
229
- public static readonly chatResponsePending3 = Sound . register ( { fileName : 'chatResponsePending3 .mp3' } ) ;
230
- public static readonly chatResponsePending4 = Sound . register ( { fileName : 'chatResponsePending4 .mp3' } ) ;
231
- public static readonly chatResponsePending5 = Sound . register ( { fileName : 'chatResponsePending5 .mp3' } ) ;
232
- public static readonly chatResponseReceived = Sound . register ( { fileName : 'chatResponseReceived .mp3' } ) ;
223
+ public static readonly chatResponsePending = Sound . register ( { fileName : 'chatResponsePending .mp3' } ) ;
224
+ public static readonly chatResponseReceived1 = Sound . register ( { fileName : 'chatResponseReceived1 .mp3' } ) ;
225
+ public static readonly chatResponseReceived2 = Sound . register ( { fileName : 'chatResponseReceived2 .mp3' } ) ;
226
+ public static readonly chatResponseReceived3 = Sound . register ( { fileName : 'chatResponseReceived3 .mp3' } ) ;
227
+ public static readonly chatResponseReceived4 = Sound . register ( { fileName : 'chatResponseReceived4 .mp3' } ) ;
228
+ public static readonly chatResponseReceived5 = Sound . register ( { fileName : 'chatResponseReceived5 .mp3' } ) ;
233
229
234
230
private constructor ( public readonly fileName : string ) { }
235
231
}
@@ -355,41 +351,41 @@ export class AudioCue {
355
351
settingsKey : 'audioCues.chatRequestSent'
356
352
} ) ;
357
353
358
- public static readonly chatResponsePending = {
359
- name : localize ( 'audioCues.chatResponsePending ' , 'Chat Response Pending ' ) ,
360
- settingsKey : 'audioCues.chatResponsePending ' ,
361
- groupId : AudioCueGroupId . chatResponsePending
354
+ public static readonly chatResponseReceived = {
355
+ name : localize ( 'audioCues.chatResponseReceived ' , 'Chat Response Received ' ) ,
356
+ settingsKey : 'audioCues.chatResponseReceived ' ,
357
+ groupId : AudioCueGroupId . chatResponseReceived
362
358
} ;
363
359
364
- public static readonly chatResponsePending1 = AudioCue . register ( {
365
- sound : Sound . chatResponsePending1 ,
366
- ...this . chatResponsePending
360
+ public static readonly chatResponseReceived1 = AudioCue . register ( {
361
+ sound : Sound . chatResponseReceived1 ,
362
+ ...this . chatResponseReceived
367
363
} ) ;
368
364
369
- public static readonly chatResponsePending2 = AudioCue . register ( {
370
- sound : Sound . chatResponsePending2 ,
371
- ...this . chatResponsePending
365
+ public static readonly chatResponseReceived2 = AudioCue . register ( {
366
+ sound : Sound . chatResponseReceived2 ,
367
+ ...this . chatResponseReceived
372
368
} ) ;
373
369
374
- public static readonly chatResponsePending3 = AudioCue . register ( {
375
- sound : Sound . chatResponsePending3 ,
376
- ...this . chatResponsePending
370
+ public static readonly chatResponseReceived3 = AudioCue . register ( {
371
+ sound : Sound . chatResponseReceived3 ,
372
+ ...this . chatResponseReceived
377
373
} ) ;
378
374
379
- public static readonly chatResponsePending4 = AudioCue . register ( {
380
- sound : Sound . chatResponsePending4 ,
381
- ...this . chatResponsePending
375
+ public static readonly chatResponseReceived4 = AudioCue . register ( {
376
+ sound : Sound . chatResponseReceived4 ,
377
+ ...this . chatResponseReceived
382
378
} ) ;
383
379
384
- public static readonly chatResponsePending5 = AudioCue . register ( {
385
- sound : Sound . chatResponsePending5 ,
386
- ...this . chatResponsePending
380
+ public static readonly chatResponseReceived5 = AudioCue . register ( {
381
+ sound : Sound . chatResponseReceived5 ,
382
+ ...this . chatResponseReceived
387
383
} ) ;
388
384
389
- public static readonly chatResponseReceived = AudioCue . register ( {
390
- name : localize ( 'audioCues.chatResponseReceived ' , 'Chat Response Received ' ) ,
391
- sound : Sound . chatResponseReceived ,
392
- settingsKey : 'audioCues.chatResponseReceived '
385
+ public static readonly chatResponsePending = AudioCue . register ( {
386
+ name : localize ( 'audioCues.chatResponsePending ' , 'Chat Response Pending ' ) ,
387
+ sound : Sound . chatResponsePending ,
388
+ settingsKey : 'audioCues.chatResponsePending '
393
389
} ) ;
394
390
395
391
private constructor (
0 commit comments