music controller now has constructor that creates music list for simplicity. Also now has listener for music list search event.
This commit is contained in:
		@@ -11,7 +11,7 @@ namespace RhythmBullet.Zer01HD.Audio
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    internal class MusicController : IDisposable
 | 
					    internal class MusicController : IDisposable
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        MusicList musicList;
 | 
					        public readonly MusicList musicList;
 | 
				
			||||||
        WaveOutEvent outputDevice;
 | 
					        WaveOutEvent outputDevice;
 | 
				
			||||||
        TransparentSampleProvider transparentSampleProvider;
 | 
					        TransparentSampleProvider transparentSampleProvider;
 | 
				
			||||||
        AudioFileReader audioInput;
 | 
					        AudioFileReader audioInput;
 | 
				
			||||||
@@ -50,10 +50,18 @@ namespace RhythmBullet.Zer01HD.Audio
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public MusicController()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            musicList = new MusicList();
 | 
				
			||||||
 | 
					            musicList.SearchCompleteEvent += MusicListRefreshListener;
 | 
				
			||||||
 | 
					            random = new Random();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public MusicController(MusicList musicList)
 | 
					        public MusicController(MusicList musicList)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            this.musicList = musicList;
 | 
					 | 
				
			||||||
            random = new Random();
 | 
					            random = new Random();
 | 
				
			||||||
 | 
					            this.musicList = musicList;
 | 
				
			||||||
 | 
					            this.musicList.SearchCompleteEvent += MusicListRefreshListener;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void LoadMusic(string path)
 | 
					        private void LoadMusic(string path)
 | 
				
			||||||
@@ -109,6 +117,11 @@ namespace RhythmBullet.Zer01HD.Audio
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            audioInput?.Dispose();
 | 
					            audioInput?.Dispose();
 | 
				
			||||||
            outputDevice?.Dispose();
 | 
					            outputDevice?.Dispose();
 | 
				
			||||||
 | 
					            musicList.SearchCompleteEvent -= MusicListRefreshListener;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void MusicListRefreshListener(MusicList musicList)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user