Ejemplo n.º 1
0
Archivo: app.c Proyecto: digideskio/RPD
int start_fmd(fm_playlist_config_t *playlist_conf, fm_player_config_t *player_conf)
{
    fm_player_init();
    if (fm_player_open(&app.player, player_conf) < 0) {
        perror("Open audio output");
        return 1;
    }
    install_player_end_handler(&app.player);

    fm_playlist_init(&app.playlist, playlist_conf, stop_player);

    int ret = fm_playlist_update_mode(&app.playlist, playlist_conf->channel);
    switch (ret) {
        case 0: break;
        case -2: printf("Unable to set local channel because music directory is not set."); return ret;
        default: printf("Unable to set channel."); return ret;
    }

    if (fm_server_setup(&app.server) < 0) {
        perror("Server");
        return 1;
    }
    fm_server_run(&app.server, app_client_handler, &app);

    fm_playlist_cleanup(&app.playlist);
    fm_player_close(&app.player);
    fm_player_exit();

    return 0;
}
Ejemplo n.º 2
0
Archivo: app.c Proyecto: LastRitter/fmd
int start_fmd(fm_playlist_config_t *playlist_conf, fm_player_config_t *player_conf)
{
    fm_player_init();
    if (fm_player_open(&app.player, player_conf) < 0) {
        perror("Open audio output");
        return 1;
    }
    install_player_end_handler(&app.player);

    fm_playlist_init(&app.playlist, playlist_conf);

    if (fm_server_setup(&app.server) < 0) {
        perror("Server");
        return 1;
    }
    fm_server_run(&app.server, app_client_handler, &app);

    fm_playlist_cleanup(&app.playlist);
    fm_player_close(&app.player);
    fm_player_exit();

    return 0;
}