コード例 #1
0
ファイル: artistbrowse.cpp プロジェクト: Andlon/spotinetta
AlbumList ArtistBrowse::albums() const
{
    int count = albumCount();
    AlbumList list;
    for (int i = 0; i < count; ++i)
        list << Album(sp_artistbrowse_album(handle(), i));

    return list;
}
コード例 #2
0
ファイル: artistbrowser.c プロジェクト: jkp/pyspotify
PyObject *
ArtistBrowser_sq_item(ArtistBrowser * self, Py_ssize_t index)
{
    if (index >= sp_artistbrowse_num_albums(self->_browser)) {
        PyErr_SetString(PyExc_IndexError, "");
        return NULL;
    }
    sp_album *album = sp_artistbrowse_album(self->_browser, (int)index);
    PyObject *wrapper = Album_FromSpotify(album);

    return wrapper;
}
コード例 #3
0
ファイル: albumiterator.c プロジェクト: maxubd/libspotify-php
PHP_METHOD(SpotifyAlbumIterator, offsetGet)
{
	zval *index, temp, *spotifyobject;
	sp_album *album;
	spotifyalbumiterator_object *p;

	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) {
		return;
	}

	p = (spotifyalbumiterator_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
	album = sp_artistbrowse_album(p->artistbrowse, Z_LVAL_P(index));

	spotifyobject = GET_THIS_PROPERTY(spotifyalbumiterator_ce, "spotify");

	object_init_ex(return_value, spotifyalbum_ce);
	SPOTIFY_METHOD2(SpotifyAlbum, __construct, &temp, return_value, spotifyobject, album);
}
コード例 #4
0
ファイル: albumiterator.c プロジェクト: maxubd/libspotify-php
PHP_METHOD(SpotifyAlbumIterator, current)
{
	spotifyalbumiterator_object *p;
	sp_album *album;
	zval temp, *spotifyobject;
	int timeout;
	
	p = (spotifyalbumiterator_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
	album = sp_artistbrowse_album(p->artistbrowse, p->position);

	while (!sp_album_is_loaded(album)) {
		sp_session_process_events(p->session, &timeout);
	}

	spotifyobject = GET_THIS_PROPERTY(spotifyalbumiterator_ce, "spotify");

	object_init_ex(return_value, spotifyalbum_ce);
	SPOTIFY_METHOD2(SpotifyAlbum, __construct, &temp, return_value, spotifyobject, album);
}
コード例 #5
0
ファイル: artistbrowse.cpp プロジェクト: Andlon/spotinetta
Album ArtistBrowse::albumAt(int index) const
{
    return isValid() ? Album(sp_artistbrowse_album(handle(), index)) : Album();
}