Пример #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Visual.LoadContent(Content, GraphicsDevice);

            // Load drum samples
            percussions = new Dictionary <Percussion, SoundEffect>();
            percussions.Add(Percussion.KICK, Content.Load <SoundEffect>("Audio/kick"));
            percussions.Add(Percussion.SNARE, Content.Load <SoundEffect>("Audio/snare"));
            percussions.Add(Percussion.TOM1, Content.Load <SoundEffect>("Audio/tom1"));
            percussions.Add(Percussion.TOM2, Content.Load <SoundEffect>("Audio/tom2"));
            percussions.Add(Percussion.TOM3, Content.Load <SoundEffect>("Audio/tom3"));
            percussions.Add(Percussion.HIHAT_CLOSED, Content.Load <SoundEffect>("Audio/hihat1"));
            percussions.Add(Percussion.HIHAT_OPEN, Content.Load <SoundEffect>("Audio/hihat2"));
            percussions.Add(Percussion.CRASH, Content.Load <SoundEffect>("Audio/crash"));
            percussions.Add(Percussion.CHINA, Content.Load <SoundEffect>("Audio/china"));
            percussions.Add(Percussion.SPLASH, Content.Load <SoundEffect>("Audio/splash"));
            percussions.Add(Percussion.RIDE, Content.Load <SoundEffect>("Audio/ride1"));
            percussions.Add(Percussion.RIDE_BELL, Content.Load <SoundEffect>("Audio/ride2"));
            percussions.Add(Percussion.COWBELL, Content.Load <SoundEffect>("Audio/cowbell"));

            // Create views
            padView       = new PadView(Content, percussions, recorder, displayWidth, displayHeight);
            padView.Exit += new EventHandler(Exit);
            padView.ViewButtonClicked += new EventHandler(padView_ViewButtonClicked);

            drumsetView       = new DrumsetView(Content, percussions, recorder, displayWidth, displayHeight);
            drumsetView.Exit += new EventHandler(Exit);
            drumsetView.ViewButtonClicked += new EventHandler(drumsetView_ViewButtonClicked);

            activeView = padView;
        }
Пример #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Visual.LoadContent(Content, GraphicsDevice);

            // Load drum samples
            percussions = new Dictionary<Percussion, SoundEffect>();
            percussions.Add(Percussion.KICK, Content.Load<SoundEffect>("Audio/kick"));
            percussions.Add(Percussion.SNARE, Content.Load<SoundEffect>("Audio/snare"));
            percussions.Add(Percussion.TOM1, Content.Load<SoundEffect>("Audio/tom1"));
            percussions.Add(Percussion.TOM2, Content.Load<SoundEffect>("Audio/tom2"));
            percussions.Add(Percussion.TOM3, Content.Load<SoundEffect>("Audio/tom3"));
            percussions.Add(Percussion.HIHAT_CLOSED, Content.Load<SoundEffect>("Audio/hihat1"));
            percussions.Add(Percussion.HIHAT_OPEN, Content.Load<SoundEffect>("Audio/hihat2"));
            percussions.Add(Percussion.CRASH, Content.Load<SoundEffect>("Audio/crash"));
            percussions.Add(Percussion.CHINA, Content.Load<SoundEffect>("Audio/china"));
            percussions.Add(Percussion.SPLASH, Content.Load<SoundEffect>("Audio/splash"));
            percussions.Add(Percussion.RIDE, Content.Load<SoundEffect>("Audio/ride1"));
            percussions.Add(Percussion.RIDE_BELL, Content.Load<SoundEffect>("Audio/ride2"));
            percussions.Add(Percussion.COWBELL, Content.Load<SoundEffect>("Audio/cowbell"));

            // Create views
            padView = new PadView(Content, percussions, recorder, displayWidth, displayHeight);
            padView.Exit += new EventHandler(Exit);
            padView.ViewButtonClicked += new EventHandler(padView_ViewButtonClicked);

            drumsetView = new DrumsetView(Content, percussions, recorder, displayWidth, displayHeight);
            drumsetView.Exit += new EventHandler(Exit);
            drumsetView.ViewButtonClicked += new EventHandler(drumsetView_ViewButtonClicked);

            activeView = padView;
        }