コード例 #1
0
ファイル: MusicTest.cs プロジェクト: jlyonsmith/ExEnCopy
 public override void LoadContent()
 {
     song = Content.Load<Song>("Short Disco");
     song.HintBeginPreload();
     soundEffect = Content.Load<SoundEffect>("ding");
     loop = Content.Load<SoundEffect>("motor").CreateInstance();
     loop.IsLooped = true;
 }
コード例 #2
0
ファイル: MediaPlayer.cs プロジェクト: jlyonsmith/ExEnCopy
        public static void Play(Song song)
        {
            Stop();

            currentSong = song;
            currentSong.HintBeginPreload(); // creates currentSong.sound
            // If the download hasn't fully connected, Play will do nothing. AutoPlay will cause the song to start when it is ready:
            currentSong.sound.mediaElement.AutoPlay = true;
            SetSongVolume();
            if(isRepeating)
                SetSongRepeatHandler();
            currentSong.sound.Play();
        }
コード例 #3
0
ファイル: MediaPlayer.cs プロジェクト: meds/ChicksnVixens
        public static void Play(Song song)
        {
            Stop();

            currentSong = song;
            currentSong.HintBeginPreload();             // creates currentSong.sound
            // If the download hasn't fully connected, Play will do nothing. AutoPlay will cause the song to start when it is ready:
            currentSong.sound.mediaElement.AutoPlay = true;
            SetSongVolume();
            if (isRepeating)
            {
                SetSongRepeatHandler();
            }
            currentSong.sound.Play();
        }