make clean now removes editor binary.
[cantaveria.git] / soundtest.c
blobd5a63b354be1d86500eb950a238e1689c5f92ff1
1 #include <stdio.h>
3 #include <input.h>
4 #include <graphics.h>
5 #include <console.h>
6 #include <transfer.h>
7 #include <list.h>
9 #include <music.h>
10 #include <audio.h>
13 int x = 0;
15 static void press(input in){
16 if(in.button == ESCAPE_KEY){
17 game_is_over();
20 if(in.button == FIRE_BUTTON){
21 console_printf("peak %d dB, rms %d dB", audio_peak_level(), audio_rms_level());
24 if(in.button == UP_BUTTON){
25 //increase volume
28 if(in.button == DOWN_BUTTON){
29 //decrease volume
33 if(x){
34 console_printf("pausing music");
35 music_pause();
36 x = 0;
38 else{
39 console_printf("playing music");
40 music_play(MUS_TEST1);
41 x = 1;
46 static void release(input in){
49 static void update(){
50 console_update();
53 static void draw(){
57 void setup_inner(){
58 set_handler(update, draw, press, release);
59 console_clear();
61 if(music_load("last_battle.mid", MUS_TEST1) < 0){
62 error_msg("open music failed\n");
64 else{
65 music_play(MUS_TEST1);