mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
disable all info logs from non game places
This commit is contained in:
@@ -104,6 +104,7 @@ def main():
|
|||||||
|
|
||||||
current_screen = Screens.LOADING
|
current_screen = Screens.LOADING
|
||||||
|
|
||||||
|
audio.set_log_level(1)
|
||||||
audio.init_audio_device()
|
audio.init_audio_device()
|
||||||
|
|
||||||
create_song_db()
|
create_song_db()
|
||||||
@@ -134,8 +135,8 @@ def main():
|
|||||||
Screens.LOADING: load_screen
|
Screens.LOADING: load_screen
|
||||||
}
|
}
|
||||||
target = ray.load_render_texture(screen_width, screen_height)
|
target = ray.load_render_texture(screen_width, screen_height)
|
||||||
ray.set_texture_filter(target.texture, ray.TextureFilter.TEXTURE_FILTER_TRILINEAR)
|
|
||||||
ray.gen_texture_mipmaps(target.texture)
|
ray.gen_texture_mipmaps(target.texture)
|
||||||
|
ray.set_texture_filter(target.texture, ray.TextureFilter.TEXTURE_FILTER_TRILINEAR)
|
||||||
ray.rl_set_blend_factors_separate(RL_SRC_ALPHA, RL_ONE_MINUS_SRC_ALPHA, RL_ONE, RL_ONE_MINUS_SRC_ALPHA, RL_FUNC_ADD, RL_FUNC_ADD)
|
ray.rl_set_blend_factors_separate(RL_SRC_ALPHA, RL_ONE_MINUS_SRC_ALPHA, RL_ONE, RL_ONE_MINUS_SRC_ALPHA, RL_FUNC_ADD, RL_FUNC_ADD)
|
||||||
ray.set_exit_key(ord(global_data.config["keys_1p"]["exit_key"]))
|
ray.set_exit_key(ord(global_data.config["keys_1p"]["exit_key"]))
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ ffi.cdef("""
|
|||||||
void *ctxData;
|
void *ctxData;
|
||||||
} music;
|
} music;
|
||||||
|
|
||||||
|
void set_log_level(int level);
|
||||||
|
|
||||||
// Device management
|
// Device management
|
||||||
void list_host_apis(void);
|
void list_host_apis(void);
|
||||||
void init_audio_device(PaHostApiIndex host_api, double sample_rate, unsigned long buffer_size);
|
void init_audio_device(PaHostApiIndex host_api, double sample_rate, unsigned long buffer_size);
|
||||||
@@ -141,6 +143,9 @@ class AudioEngine:
|
|||||||
|
|
||||||
self.sounds_path = Path("Sounds")
|
self.sounds_path = Path("Sounds")
|
||||||
|
|
||||||
|
def set_log_level(self, level: int):
|
||||||
|
lib.set_log_level(level) # type: ignore
|
||||||
|
|
||||||
def list_host_apis(self):
|
def list_host_apis(self):
|
||||||
"""Prints a list of available host APIs to the console"""
|
"""Prints a list of available host APIs to the console"""
|
||||||
lib.list_host_apis() # type: ignore
|
lib.list_host_apis() # type: ignore
|
||||||
|
|||||||
@@ -24,13 +24,21 @@
|
|||||||
#define LOG_WARNING 1
|
#define LOG_WARNING 1
|
||||||
#define LOG_ERROR 2
|
#define LOG_ERROR 2
|
||||||
|
|
||||||
|
static int CURRENT_LOG_LEVEL = LOG_INFO;
|
||||||
|
|
||||||
|
void set_log_level(int level) {
|
||||||
|
CURRENT_LOG_LEVEL = level;
|
||||||
|
}
|
||||||
|
|
||||||
#define TRACELOG(level, ...) do { \
|
#define TRACELOG(level, ...) do { \
|
||||||
|
if (level >= CURRENT_LOG_LEVEL) { \
|
||||||
const char* level_str = (level == LOG_INFO) ? "INFO" : \
|
const char* level_str = (level == LOG_INFO) ? "INFO" : \
|
||||||
(level == LOG_WARNING) ? "WARNING" : "ERROR"; \
|
(level == LOG_WARNING) ? "WARNING" : "ERROR"; \
|
||||||
printf("[%s] AUDIO: ", level_str); \
|
printf("[%s] AUDIO: ", level_str); \
|
||||||
printf(__VA_ARGS__); \
|
printf(__VA_ARGS__); \
|
||||||
printf("\n"); \
|
printf("\n"); \
|
||||||
fflush(stdout); \
|
fflush(stdout); \
|
||||||
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define FREE(ptr) do { if (ptr) { free(ptr); (ptr) = NULL; } } while(0)
|
#define FREE(ptr) do { if (ptr) { free(ptr); (ptr) = NULL; } } while(0)
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ typedef struct music {
|
|||||||
void *ctxData; // Internal context data (file handle, decoder state, etc.)
|
void *ctxData; // Internal context data (file handle, decoder state, etc.)
|
||||||
} music;
|
} music;
|
||||||
|
|
||||||
|
void set_log_level(int level);
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
// DEVICE MANAGEMENT
|
// DEVICE MANAGEMENT
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class VideoPlayer:
|
|||||||
self.is_finished_list = [False, False]
|
self.is_finished_list = [False, False]
|
||||||
self.video = VideoFileClip(path)
|
self.video = VideoFileClip(path)
|
||||||
if self.video.audio is not None:
|
if self.video.audio is not None:
|
||||||
self.video.audio.write_audiofile("cache/temp_audio.wav")
|
self.video.audio.write_audiofile("cache/temp_audio.wav", logger=None)
|
||||||
self.audio = audio.load_music_stream(Path("cache/temp_audio.wav"), 'video')
|
self.audio = audio.load_music_stream(Path("cache/temp_audio.wav"), 'video')
|
||||||
|
|
||||||
self.buffer_size = 10 # Number of frames to keep in memory
|
self.buffer_size = 10 # Number of frames to keep in memory
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class GameScreen:
|
|||||||
self.end_ms = 0
|
self.end_ms = 0
|
||||||
self.start_delay = 1000
|
self.start_delay = 1000
|
||||||
self.song_started = False
|
self.song_started = False
|
||||||
self.mask_shader = ray.load_shader("", "shader/mask.fs")
|
self.mask_shader = ray.load_shader("shader/outline.vs", "shader/mask.fs")
|
||||||
|
|
||||||
def load_hitsounds(self):
|
def load_hitsounds(self):
|
||||||
"""Load the hit sounds"""
|
"""Load the hit sounds"""
|
||||||
|
|||||||
Reference in New Issue
Block a user