indexing description: "[ Singleton representing the audio subsystem. Use EM_SHARED_SUBSYSTEMS to access this class. ]" date: "$Date$" revision: "$Revision$" class EM_AUDIO_SUBSYSTEM inherit EM_SUBSYSTEM EM_CONSTANTS export {NONE} all end EM_SHARED_ERROR_HANDLER export {NONE} all end SDL_FUNCTIONS_EXTERNAL export {NONE} all end SDL_MIXER_FUNCTIONS_EXTERNAL export {NONE} all end create {EM_SHARED_SUBSYSTEMS} make feature {NONE} -- Initialisation make is -- Create new audio subsystem. do ensure not_enabled: not is_enabled end feature -- Access mixer: EM_MIXER -- Holds main mixer feature -- Status report is_enabled: BOOLEAN is -- Is the audio subsystem enabled? do Result := 0 /= sdl_was_init_external (Em_init_audio) end feature -- Subsystem management enable is -- Enable audio subsystem. local i: INTEGER do i := sdl_init_external (Em_init_audio) if i >= 0 then create mixer.make else error_handler.set_error (error_handler.Em_error_initializing_audio_subsystem) end ensure then enabled: is_enabled no_error_occured: not error_handler.has_error_occured end disable is -- Disable audio subsystem. do mixer.dispose sdl_quit_sub_system_external (Em_init_audio) ensure then disabled: not is_enabled end end