mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-08 14:58:14 +03:00
Implement KiwiSoundEngine.Sound_GetDataLength
Used in Pastel Chime 3.
This commit is contained in:
@@ -78,6 +78,8 @@ int wav_get_volume(int id);
|
||||
int bgm_get_volume(int id);
|
||||
int wav_get_time_length(int id);
|
||||
int bgm_get_time_length(int id);
|
||||
int wav_get_data_length(int no);
|
||||
int bgm_get_data_length(int no);
|
||||
int wav_get_group_num(int id);
|
||||
//int bgm_get_group_num(int id);
|
||||
int wav_prepare_from_file(int id, char *filename);
|
||||
|
||||
+12
@@ -361,6 +361,18 @@ static int audio_get_time_length(struct id_pool *pool, int id)
|
||||
int wav_get_time_length(int id) { return audio_get_time_length(&wav, id); }
|
||||
int bgm_get_time_length(int id) { return audio_get_time_length(&bgm, id); }
|
||||
|
||||
static int audio_get_data_length(enum asset_type type, int no) {
|
||||
struct channel *ch = channel_open(type, no);
|
||||
if (!ch)
|
||||
return 0;
|
||||
int len = channel_get_time_length(ch);
|
||||
channel_close(ch);
|
||||
return len;
|
||||
}
|
||||
|
||||
int wav_get_data_length(int no) { return audio_get_data_length(ASSET_SOUND, no); }
|
||||
int bgm_get_data_length(int no) { return audio_get_data_length(ASSET_BGM, no); }
|
||||
|
||||
static int audio_get_data_no(struct id_pool *pool, int id)
|
||||
{
|
||||
struct channel *ch = id_pool_get(pool, id);
|
||||
|
||||
@@ -23,7 +23,6 @@ HLL_WARN_UNIMPLEMENTED( , void, KiwiSoundEngine, SetGlobalFocus, possibly_unused
|
||||
|
||||
//int KiwiSoundEngine_Sound_GetGroupNum(int nCh);
|
||||
//static bool KiwiSoundEngine_Sound_PrepareFromFile(int ch, struct string *filename);
|
||||
//static int KiwiSoundEngine_Sound_GetDataLength(int data_number);
|
||||
|
||||
static int KiwiSoundEngine_GetMasterGroup(void)
|
||||
{
|
||||
@@ -93,7 +92,7 @@ HLL_LIBRARY(KiwiSoundEngine,
|
||||
HLL_TODO_EXPORT(Sound_GetGroupNum, KiwiSoundEngine_Sound_GetGroupNum),
|
||||
HLL_EXPORT(Sound_GetGroupNumFromDataNum, wav_get_group_num_from_data_num),
|
||||
HLL_TODO_EXPORT(Sound_PrepareFromFile, KiwiSoundEngine_Sound_PrepareFromFile),
|
||||
HLL_TODO_EXPORT(Sound_GetDataLength, KiwiSoundEngine_Sound_GetDataLength),
|
||||
HLL_EXPORT(Sound_GetDataLength, wav_get_data_length),
|
||||
HLL_EXPORT(GetMasterGroup, KiwiSoundEngine_GetMasterGroup),
|
||||
HLL_EXPORT(GetBGMGroup, KiwiSoundEngine_GetBGMGroup),
|
||||
HLL_EXPORT(GetSEGroup, KiwiSoundEngine_GetSEGroup),
|
||||
|
||||
Reference in New Issue
Block a user