1
0
Fork 0

Use MixerObject's singleton-pattern to manage the channel

This commit is contained in:
krcroft 2020-02-28 18:19:38 -08:00 committed by Patryk Obara
parent 91cd907c4e
commit 1d123367a5
3 changed files with 9 additions and 19 deletions

View file

@ -221,16 +221,17 @@ public:
private:
static struct imagePlayer {
Bit16s buffer[MIXER_BUFSIZE * 2] = {0};
std::unique_ptr<SDL_mutex, SdlMutexDeleter> mutex = nullptr;
std::unique_ptr<MixerChannel, MixerChannelDeleter> channel = nullptr;
std::weak_ptr<TrackFile> trackFile;
MixerObject channelManager;
MixerChannel *channel = nullptr;
CDROM_Interface_Image *cd = nullptr;
void (MixerChannel::*addFrames) (Bitu, const Bit16s*) = nullptr;
uint64_t playedTrackFrames = 0;
uint64_t totalTrackFrames = 0;
uint32_t startSector = 0;
uint32_t totalRedbookFrames = 0;
int16_t buffer[MIXER_BUFSIZE * REDBOOK_CHANNELS] = {0};
bool isPlaying = false;
bool isPaused = false;
} player;