Esempio n. 1
0
        public void Render(SpriteBatch pSpriteBatch)
        {
            pSpriteBatch.Draw(
                this.Game.EqualizerBackgroundTexture,
                new Rectangle(this.X, this.Y, WIDTH, HEIGHT), Color.White);


            //Don't show the first 12 bars (just hammer)
            int skip = 12;

            for (int i = 0; i < this.Fft.Length - skip; i++)
            {
                int pos       = i + skip;
                int barHeight = (int)((this.Fft[pos] / FFT_MAX_VALUE) * HEIGHT);
                int barWidth  = WIDTH / EQUALIZER_LENGTH;

                int frequence = (int)(pos * (44100.0f / REDUCTION_FACTOR)) / EQUALIZER_LENGTH;

                pSpriteBatch.Draw(
                    this.Game.EqualizerOnePointTexture,
                    new Rectangle(this.X + (i * (barWidth + 0)) + 1,
                                  this.Y + (HEIGHT - barHeight) + 1,
                                  barWidth,
                                  barHeight - 2),
                    GtNotesLegend.CalculateNoteColor(frequence));
            }
        }
Esempio n. 2
0
        public GtPlayingSongScreen(XnaGame pGame, IGtGameRoundController pGameRoundController)
            : base(pGame)
        {
            if (pGameRoundController == null)
                throw new Exception("pGameController can't be null");

            this.fGameRoundController = pGameRoundController;

            this.fEqualizer = new GtEqualizer(pGame, 60, 300);

            this.fGtNotesLegend = new GtNotesLegend(pGame);
        }