organicomplex 0.7.0

Interactive complex-valued cellular automaton on 2D and 3D grids in search of that stuff - emergence, open-endedness, organicity etc.
use super::System;

use super::audio::{
    Music,
    Sound
};

impl System {
    #[allow(dead_code)]
    pub fn load_music<'a>(&self, filepath: impl ToString) -> Option<Music> {
        let filepath = filepath.to_string();
        self.audio.load_music(filepath)
    }

    #[allow(dead_code)]
    pub fn play_music(&self, music: Option<&Music>) -> Result<(), String> {
        self.audio.play_music(music)
    }

    #[allow(dead_code)]
    pub fn load_sound(&self, filepath: impl ToString) -> Option<Sound> {
        let filepath = filepath.to_string();
        self.audio.load_sound(filepath)
    }

    #[allow(dead_code)]
    pub fn play_sound(&self, sound: Option<&mut Sound>, repeats: i32) -> Result<(), String> {
        self.audio.play_sound(sound, repeats)
    }

    #[allow(dead_code)]
    pub fn play_sound_once(&self, sound: Option<&mut Sound>) -> Result<(), String> {
        self.play_sound(sound, 0)
    }

    #[allow(dead_code)]
    pub fn play_sound_ever(&self, sound: Option<&mut Sound>) -> Result<(), String> {
        self.play_sound(sound, -1)
    }

    #[allow(dead_code)]
    pub fn pause_sound(&self, sound: Option<&Sound>) -> Result<(), String> {
        self.audio.pause_sound(sound)
    }

    #[allow(dead_code)]
    pub fn resume_sound(&self, sound: Option<&Sound>) -> Result<(), String> {
        self.audio.resume_sound(sound)
    }

    #[allow(dead_code)]
    pub fn halt_sound(&self, sound: Option<&mut Sound>) -> Result<(), String> {
        self.audio.halt_sound(sound)
    }

    #[allow(dead_code)]
    pub fn load_speech(&self, filepath: impl ToString) -> Option<Sound> {
        self.audio.load_speech(filepath)
    }

    #[allow(dead_code)]
    pub fn play_speech(&self, speech: Option<&Sound>) -> Result<(), String> {
        self.audio.play_speech(speech)
    }

    pub fn pause_audio(&self) {
        self.audio.pause();
    }

    pub fn resume_audio(&self) {
        self.audio.resume();
    }

    pub fn halt_audio(&self) {
        self.audio.halt();
    }

}