Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Net;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Documents;
- using System.Windows.Ink;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Animation;
- using System.Windows.Shapes;
- using Microsoft.Xna;
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Audio;
- namespace Drummer_Pro
- {
- public static class DrumSounds
- {
- public class DrumSoundEngine
- {
- private MediaElement _crash = new MediaElement();
- private MediaElement _openHH = new MediaElement();
- private MediaElement _closeHH = new MediaElement();
- private MediaElement _snare = new MediaElement();
- private MediaElement _hiTom = new MediaElement();
- private MediaElement _midTom = new MediaElement();
- private MediaElement _lowTom = new MediaElement();
- private MediaElement _kick = new MediaElement();
- public DrumSoundEngine()
- {
- _crash.Source = new Uri("Sounds/Crash.wav", UriKind.Relative);
- _openHH.Source = new Uri("Sounds/Crash.wav", UriKind.Relative);
- _closeHH.Source = new Uri("Sounds/Crash.wav", UriKind.Relative);
- _snare.Source = new Uri("Sounds/Crash.wav", UriKind.Relative);
- _hiTom.Source = new Uri("Sounds/Crash.wav", UriKind.Relative);
- _midTom.Source = new Uri("Sounds/Crash.wav", UriKind.Relative);
- _lowTom.Source = new Uri("Sounds/Crash.wav", UriKind.Relative);
- _kick.Source = new Uri("Sounds/Crash.wav", UriKind.Relative);
- }
- public void Crash() { _crash.Stop(); _crash.Play(); }
- public void OpenHiHat() { _openHH.Stop(); _openHH.Play(); }
- public void CloseHiHat() { _closeHH.Stop(); _closeHH.Play(); }
- public void Snare() { _snare.Stop(); _snare.Play(); }
- public void HiTom() { _hiTom.Stop(); _hiTom.Play(); }
- public void MidTom() { _midTom.Stop(); _midTom.Play(); }
- public void LowTom() { _lowTom.Stop(); _lowTom.Play(); }
- public void Kick() { _kick.Stop(); _kick.Play(); }
- }
- public static DrumSoundEngine Play = new DrumSoundEngine();
- //public class DrumSoundEngine
- //{
- // private SoundEffect _crash = SoundEffect.FromStream(App.GetResourceStream(new Uri("Sounds/Crash.wav", UriKind.Relative)).Stream);
- // private SoundEffect _openHH = SoundEffect.FromStream(App.GetResourceStream(new Uri("Sounds/OpenHH.wav", UriKind.Relative)).Stream);
- // private SoundEffect _closeHH = SoundEffect.FromStream(App.GetResourceStream(new Uri("Sounds/CloseHH.wav", UriKind.Relative)).Stream);
- // private SoundEffect _snare = SoundEffect.FromStream(App.GetResourceStream(new Uri("Sounds/Snare.wav", UriKind.Relative)).Stream);
- // private SoundEffect _hiTom = SoundEffect.FromStream(App.GetResourceStream(new Uri("Sounds/HiTom.wav", UriKind.Relative)).Stream);
- // private SoundEffect _midTom = SoundEffect.FromStream(App.GetResourceStream(new Uri("Sounds/MidTom.wav", UriKind.Relative)).Stream);
- // private SoundEffect _lowTom = SoundEffect.FromStream(App.GetResourceStream(new Uri("Sounds/LowTom.wav", UriKind.Relative)).Stream);
- // private SoundEffect _kick = SoundEffect.FromStream(App.GetResourceStream(new Uri("Sounds/Kick.wav", UriKind.Relative)).Stream);
- // public void Crash() { _crash.Play(); }
- // public void OpenHiHat() { _openHH.Play(); }
- // public void CloseHiHat() { _closeHH.Play(); }
- // public void Snare() { _snare.Play(); }
- // public void HiTom() { _hiTom.Play(); }
- // public void MidTom() { _midTom.Play(); }
- // public void LowTom() { _lowTom.Play(); }
- // public void Kick() { _kick.Play(); }
- //}
- //private static DrumSoundEngine _play = new DrumSoundEngine();
- //public static void Prepare() { FrameworkDispatcher.Update(); }
- //public static DrumSoundEngine Play
- //{
- // get { return _play; }
- //}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement