SpotifyPlaylist* SpotifyUser::inbox() { if(SpotifySession::instance()->user() != this) { return nullptr; } if(m_inbox == nullptr) { sp_playlist* inbox = sp_session_inbox_create(SpotifySession::instance()->native()); m_inbox = new SpotifyPlaylist(inbox); } return m_inbox; }
QSpotifyPlaylist *QSpotifyUser::inbox() const { if (QSpotifySession::instance()->user() != this) return nullptr; if (!m_inbox) { sp_playlist *in; in = sp_session_inbox_create(QSpotifySession::instance()->m_sp_session); m_inbox = new QSpotifyPlaylist(QSpotifyPlaylist::Inbox, in, false); m_inbox->init(); QQmlEngine::setObjectOwnership(m_inbox, QQmlEngine::CppOwnership); } return m_inbox; }
PHP_METHOD(Spotify, getInboxPlaylist) { 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_inbox_create(obj->session); object_init_ex(return_value, spotifyplaylist_ce); SPOTIFY_METHOD2(SpotifyPlaylist, __construct, &temp, return_value, object, playlist); }