File tree 3 files changed +13
-9
lines changed
3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -44,22 +44,26 @@ export class AppComponent implements OnInit {
44
44
. subscribe ( result => {
45
45
this . isMobileDisplay = ! result . matches ;
46
46
} ) ;
47
+ this . navigate ( ) ;
47
48
}
48
49
49
50
selectGenre ( i : number ) {
50
51
this . selectedGenreIndex = i ;
51
52
this . selectedSubGenreIndex = 0 ;
53
+ this . navigate ( ) ;
54
+ }
55
+
56
+ private navigate ( ) {
52
57
this . router . navigate ( [ this . musicGenres [ this . selectedGenreIndex ] . subGenres [ this . selectedSubGenreIndex ] . link ] ) . then (
53
- ( ) => { } ,
54
- ( ) => { } ,
58
+ ( ) => {
59
+ } ,
60
+ ( ) => {
61
+ } ,
55
62
) ;
56
63
}
57
64
58
65
selectSubGenre ( i : number ) {
59
66
this . selectedSubGenreIndex = i ;
60
- this . router . navigate ( [ this . musicGenres [ this . selectedGenreIndex ] . subGenres [ this . selectedSubGenreIndex ] . link ] ) . then (
61
- ( ) => { } ,
62
- ( ) => { } ,
63
- ) ;
67
+ this . navigate ( ) ;
64
68
}
65
69
}
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ export class SequencerComponent implements OnInit {
20
20
ngOnInit ( ) : void {
21
21
this . dataService . getData ( this . fileName ) . subscribe ( ( result : JsonBeat ) => {
22
22
this . beat = Convert . toBeat ( result ) ;
23
- this . soundService . pause ( ) ;
23
+ if ( this . soundService . isPlaying )
24
+ this . soundService . pause ( ) ;
24
25
this . soundService . reset ( ) ;
25
26
this . soundService . setBpm ( this . beat . bpm ) ;
26
27
this . soundService . setTracks ( this . beat . tracks ) ;
Original file line number Diff line number Diff line change @@ -30,9 +30,8 @@ export class SoundService {
30
30
}
31
31
32
32
pause ( ) {
33
- if ( ! this . isPlaying )
34
- return ;
35
33
this . playbackSource . stop ( this . context . currentTime ) ;
34
+ this . reset ( ) ;
36
35
}
37
36
38
37
private playSound ( loopBuffer : AudioBuffer ) {
You can’t perform that action at this time.
0 commit comments