mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-10 00:08:26 +03:00
- MP3/OGG files are now decoded with dr_mp3 and stb_vorbis via the new MakoMusic backend. - Merge src/win/mako.cpp into src/generic/mako.cpp: Windows now uses the same SDL audio path. - A single SDL2 audio device mixes FM, BGM and PCM in its callback with SDL_MixAudioFormat. - PCM plays through SDL_AudioStream. - dr_mp3 and stb_vorbis are vendored under deps/ and included from mako_music.cpp. Warnings for that translation unit are silenced.
71 lines
1003 B
C++
71 lines
1003 B
C++
/*
|
|
ALICE SOFT SYSTEM 3 for Win32
|
|
|
|
[ MAKO ]
|
|
*/
|
|
|
|
#ifndef _MAKO_H_
|
|
#define _MAKO_H_
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
#include <stdio.h>
|
|
#include <limits.h>
|
|
#include <math.h>
|
|
#include "common.h"
|
|
#include "game_id.h"
|
|
#include "dri.h"
|
|
|
|
enum BGMDevice {
|
|
BGM_FM,
|
|
BGM_MIDI,
|
|
BGM_CD
|
|
};
|
|
|
|
struct Config;
|
|
|
|
class MAKO
|
|
{
|
|
public:
|
|
MAKO(const Config& config, const GameId& game_id);
|
|
~MAKO();
|
|
|
|
void play_music(int page);
|
|
void stop_music();
|
|
bool check_music();
|
|
void get_mark(int* mark, int* loop);
|
|
|
|
void play_pcm(int page, int loops);
|
|
void stop_pcm();
|
|
bool check_pcm();
|
|
|
|
void set_cd_track(int num, int track) { cd_track[num] = track; }
|
|
bool is_cd_available() const;
|
|
|
|
#ifdef _WIN32
|
|
void select_sound(BGMDevice dev);
|
|
#endif
|
|
|
|
bool use_fm;
|
|
|
|
Dri amus;
|
|
Dri awav;
|
|
Dri amse;
|
|
Dri mda;
|
|
|
|
int current_music;
|
|
int next_loop; // Y19
|
|
|
|
private:
|
|
const GameId& game_id;
|
|
int cd_track[100]; // Z
|
|
|
|
#ifndef __EMSCRIPTEN__
|
|
bool load_playlist(const char* path);
|
|
|
|
std::vector<const char*> playlist;
|
|
#endif
|
|
};
|
|
|
|
#endif
|