/*


    Evolute version 0.7
    Copyright (C) 2010 Antti Vainio

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.


*/

//          aanifunktiot.cpp

#include "global.hpp"

//soittaa musiikkia loopilla tai yhden kerran
void soitamusiikki(Mix_Music *musiikki, const short int loopit) {
     if(Mix_PlayMusic(musiikki, loopit)==-1) {
                       sprintf(viesti, "Mix_PlayMusic: %s", Mix_GetError());
                       naytavirhe(viesti);
     }
     //asetetaan musiikinvoimakkuus
     Mix_VolumeMusic(musiikinvoimakkuus);
}

//soitetaan ääni yhden kerran automaattisesti valitulla kanavalla
void soitaaani(Mix_Chunk *aani) {
     if(Mix_PlayChannel(-1, aani, 0)==-1) {
                       sprintf(viesti, " ERROR: Mix_PlayChannel: %s", Mix_GetError());
                       log(viesti);
     }
     //asetetaan äänenvoimakkuus
     Mix_Volume(-1,aanenvoimakkuus);
}
