示例#1
0
		public SDL2MusicChannel () {
			_readBuffer = new float[5292 * 2];
			_music = null;

			_source = AL.GenSource();
			_buffers = AL.GenBuffers(4);

			_thread = new Thread(ThreadProc);
			_thread.Start();
		}
示例#2
0
		public bool Play (IMusicTrack music, bool loop) {
			var sdlMusic = music as SDL2MusicTrack;
			if (sdlMusic == null)
				throw new ArgumentException("Music must be an SDL2 music track.", "music");

			Stop();
			_music = sdlMusic;
			_isLooping = loop;
			Play();

			return false;
		}