session_ready.c

The session_ready.c example shows how you can use the session handling functions.

#include <stdio.h>
#include <spotify/api.h>


/* --- Data --- */
extern int g_exit_code;


void metadata_updated(sp_session *session)
{
}

void session_ready(sp_session *session)
{
    sp_error error = sp_session_logout(session);

    if (SP_ERROR_OK != error) {
        fprintf(stderr, "failed to log out from Spotify: %s\n",
                        sp_error_message(error));
        g_exit_code = 5;
        return;
    }
}

void session_terminated(void)
{
}

Generated on Tue Apr 7 15:21:55 2009.
Copyright © 2006–2009 Spotify Ltd