예제 #1
0
파일: spotify.c 프로젝트: theodoor/spop
sp_playlist* playlist_get(int nb) {
    if (nb == 0) {
        if (g_starred_playlist == NULL)
            g_starred_playlist = sp_session_starred_create(g_session);
        return g_starred_playlist;
    }
    else
        return sp_playlistcontainer_playlist(g_container, nb-1);
}
예제 #2
0
static PyObject *
Session_starred(PyObject *self)
{
    sp_playlist *playlist;

    Py_BEGIN_ALLOW_THREADS;
    playlist  = sp_session_starred_create(Session_SP_SESSION(self));
    Py_END_ALLOW_THREADS;

    return Playlist_FromSpotify(playlist, 0 /* add_ref */);
}
예제 #3
0
static PyObject *
Session_starred(Session * self)
{
    sp_playlist *spl;

    Py_BEGIN_ALLOW_THREADS;
    spl = sp_session_starred_create(self->_session);
    Py_END_ALLOW_THREADS;
    PyObject *pl = Playlist_FromSpotify(spl);

    return pl;
}
예제 #4
0
QSpotifyPlaylist *QSpotifyUser::starredList() const
{
    if (!m_starredList) {
        sp_playlist *sl;
        if (QSpotifySession::instance()->user() == this) {
            sl = sp_session_starred_create(QSpotifySession::instance()->m_sp_session);
        } else {
            sl = sp_session_starred_for_user_create(QSpotifySession::instance()->m_sp_session, m_canonicalName.toUtf8().constData());
        }
        m_starredList = new QSpotifyPlaylist(QSpotifyPlaylist::Starred, sl, false);
        m_starredList->init();
        QQmlEngine::setObjectOwnership(m_starredList, QQmlEngine::CppOwnership);
    }
    return m_starredList;
}
예제 #5
0
SpotifyPlaylist* SpotifyUser::starredList()
{
    if(m_starredList == nullptr) {
        sp_playlist* playlist;
        if(SpotifySession::instance()->user() == this) {
            playlist = sp_session_starred_create(SpotifySession::instance()->native());
        }
        else {
            playlist = sp_session_starred_for_user_create(SpotifySession::instance()->native(), m_canonicalName.toUtf8().constData());
        }

        m_starredList = new SpotifyPlaylist(playlist);
    }

    return m_starredList;
}
예제 #6
0
PHP_METHOD(Spotify, getStarredPlaylist)
{
	zval *object = getThis();
	zval temp;

	spotify_object *obj = (spotify_object*)zend_object_store_get_object(object TSRMLS_CC);

	do {
		sp_session_process_events(obj->session, &obj->timeout);
	} while (obj->timeout == 0);

	sp_playlist *playlist = sp_session_starred_create(obj->session);

	object_init_ex(return_value, spotifyplaylist_ce);
	SPOTIFY_METHOD2(SpotifyPlaylist, __construct, &temp, return_value, object, playlist);
}