Newer
Older
Import / applications / HighwayDash / ports / Game / GameAudio.h
@John John on 29 Dec 2020 686 bytes bulk import from macbookpro checkouts
//  BlockyFroggy
//  Copyright © 2017 John Ryland.
//  All rights reserved.
#pragma once
#ifndef GAME_AUDIO_H
#define GAME_AUDIO_H


#include "AudioRenderer.h"
#include "Mp3Music.h"


class GameAudioRenderer : public AudioRenderer
{
public:
    GameAudioRenderer();
    void processMelodyChannel(size_t a_frameCount, uint16_t* a_outputBuffer, const char* a_tune, int& a_time, float a_octave=1.0, bool a_lerp=false);
    void renderSamples(void* a_outputBuffer, size_t a_frameCount) override;

    const char* m_tuneCh1;
    const char* m_tuneCh2;
    int m_sample = 0;
    int m_timeCh1 = 0;
    int m_timeCh2 = 0;
    int m_sign = 1;

    Mp3Music m_mp3;
};


#endif // GAME_AUDIO_H