コード例 #1
0
ファイル: ex2.c プロジェクト: haakoneh/TDT4258
int main() {
    sleep_setup(0b110);
    gpio_setup();
    NVIC_setup();
     music_play_song(&ONEUP, 0x71f);
    while(1) {
		__asm__("wfi");
	}
    return 0;
}
コード例 #2
0
ファイル: interrupt_handlers.c プロジェクト: haakoneh/TDT4258
void GPIO_Handler() {
    //resets appropriate counters and io
	music_cleanup();
    gpio_clear();
    gpio_button_to_led();  
    
	//checks which song have been chosen
    int button_case = gpio_map_input();
    switch(button_case){
        case 1:
            music_play_song(&JUMP, 0x027F);
            break;
        case 2:
            music_play_song(&PEWPEW, 0x3FF);
            break;
        case 3:
             music_play_song(&ONEUP, 0x71f);
            break;
        default:
             music_play_song(&ONEUP, 0x71f);
            break;
    }
}
コード例 #3
0
//extern GMainLoop *music_mloop;
tcStreamWrapper::tcStreamWrapper(QString song, QObject *parent)
	: QObject(parent)
{
	/* The pipeline to hold everything */
	mpPLine = MUSIC_ALLOC_PIPELINE();
    int err = music_make_pipeline(mpPLine, "test-pipe");
    if ( err ){
        fprintf(stderr, "Could not make pipeline. :(\n");
    }
    else
    {
        // start the song
        err = music_play_song(mpPLine, (char*)song.toAscii().data());
        if(err)
        {
            qDebug() << QString("ERROR: Failed to play song %1").arg(song);
        }
    }
}