#include <allegro5/allegro5.h>
#include <allegro5/allegro_image.h>
#include <allegro5/allegro_acodec.h>
#include <allegro5/allegro_audio.h>
int main() {
al_init();
ALLEGRO_DISPLAY* display = al_create_display(400,300);
al_install_mouse();
al_init_image_addon();
al_init_acodec_addon();
al_install_audio();
al_reserve_samples(32);
ALLEGRO_MOUSE_STATE mysz;
ALLEGRO_BITMAP* pianino = al_load_bitmap("pianino.png");
ALLEGRO_SAMPLE* dzwieki[8] = {al_load_sample("C.wav"), al_load_sample("D.wav"), al_load_sample("E.wav")
, al_load_sample("F.wav"), al_load_sample("G.wav"), al_load_sample("A.wav"), al_load_sample("H.wav")
, al_load_sample("C(oktawa).wav")};
while(1) {
al_get_mouse_state(&mysz);
al_draw_bitmap(pianino, 0, 0, 0);
al_flip_display();
al_rest(0.1);
if (mysz.buttons == 1 && mysz.x/50 < 8 && mysz.x/50 > -1)
al_play_sample(dzwieki[(mysz.x)/50], 1.0, 0.0, 1.0, ALLEGRO_PLAYMODE_ONCE, NULL);
}
return 0;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}