Exemple #1
0
        internal static MusicTrack ParseAsset(BinaryReader reader, Asset asset, AssetImportCollection imports)
        {
            var result = new MusicTrack();

            result.SetNameAndInstanceId(asset);

            ParseAsset(reader, result);

            result.File = imports.GetImportedData <AudioFile>(reader);

            return(result);
        }
Exemple #2
0
        public void PlayMusicTrack(MusicTrack musicTrack, bool fadeIn, bool fadeOut)
        {
            // TODO: fading

            if (_currentTrack != null)
            {
                _currentTrack.Stop();
                _currentTrack.Dispose();
            }

            _currentTrackName    = musicTrack.Name;
            _currentTrack        = GetStream(musicTrack.File.Value.Entry);
            _currentTrack.Volume = (float)musicTrack.Volume;
            _currentTrack.Play();
        }