Permalink
Browse files

Move CocoaSpotbox to projects/cocoa_spotify

  • Loading branch information...
1 parent 0fbe729 commit 5e06718fc51b42ed7aca9690f93830c309efa0b4 @tonywok tonywok committed Mar 12, 2012
Showing with 6,933 additions and 111 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 CocoaLibSpotify.framework/CocoaLibSpotify
  3. +1 −0 CocoaLibSpotify.framework/Headers
  4. +1 −0 CocoaLibSpotify.framework/Resources
  5. BIN CocoaLibSpotify.framework/Versions/A/CocoaLibSpotify
  6. +1 −0 CocoaLibSpotify.framework/Versions/A/Frameworks/libspotify.framework/Headers
  7. +1 −0 CocoaLibSpotify.framework/Versions/A/Frameworks/libspotify.framework/Resources
  8. +3,577 −0 CocoaLibSpotify.framework/Versions/A/Frameworks/libspotify.framework/Versions/10.1.16/Headers/api.h
  9. +24 −0 ...potify.framework/Versions/A/Frameworks/libspotify.framework/Versions/10.1.16/Resources/Info.plist
  10. BIN CocoaLibSpotify.framework/Versions/A/Frameworks/libspotify.framework/Versions/10.1.16/libspotify
  11. +1 −0 CocoaLibSpotify.framework/Versions/A/Frameworks/libspotify.framework/Versions/Current
  12. +1 −0 CocoaLibSpotify.framework/Versions/A/Frameworks/libspotify.framework/libspotify
  13. +78 −0 CocoaLibSpotify.framework/Versions/A/Headers/CocoaLibSpotify.h
  14. +49 −0 CocoaLibSpotify.framework/Versions/A/Headers/CocoaLibSpotifyPlatformImports.h
  15. +158 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPAlbum.h
  16. +131 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPAlbumBrowse.h
  17. +113 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPArtist.h
  18. +167 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPArtistBrowse.h
  19. +54 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPCommon.h
  20. +48 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPErrorExtensions.h
  21. +127 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPImage.h
  22. +294 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPPlaylist.h
  23. +121 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPPlaylistContainer.h
  24. +96 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPPlaylistFolder.h
  25. +99 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPPlaylistItem.h
  26. +141 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPPostTracksToInboxOperation.h
  27. +258 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPSearch.h
  28. +689 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPSession.h
  29. +154 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPToplist.h
  30. +214 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPTrack.h
  31. +73 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPURLExtensions.h
  32. +12 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPUnknownPlaylist.h
  33. +121 −0 CocoaLibSpotify.framework/Versions/A/Headers/SPUser.h
  34. +42 −0 CocoaLibSpotify.framework/Versions/A/Resources/Info.plist
  35. +1 −0 CocoaLibSpotify.framework/Versions/Current
  36. +1 −0 CocoaLibSpotify.framework/Versions/Frameworks
  37. +64 −94 {CoccoaSpotbox.xcodeproj → cocoa_spotify.xcodeproj}/project.pbxproj
  38. +1 −1 {CoccoaSpotbox.xcodeproj → cocoa_spotify.xcodeproj}/project.xcworkspace/contents.xcworkspacedata
  39. 0 ...eproj → cocoa_spotify.xcodeproj}/xcuserdata/tonywok.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  40. +12 −12 ...deproj → cocoa_spotify.xcodeproj}/xcuserdata/tonywok.xcuserdatad/xcschemes/CoccoaSpotbox.xcscheme
  41. 0 ...proj → cocoa_spotify.xcodeproj}/xcuserdata/tonywok.xcuserdatad/xcschemes/xcschememanagement.plist
  42. 0 {CoccoaSpotbox → cocoa_spotify}/SpotboxPlayer.h
  43. 0 {CoccoaSpotbox → cocoa_spotify}/SpotboxPlayer.m
  44. 0 {CoccoaSpotbox → cocoa_spotify}/ZmqDispatch.h
  45. +2 −0 {CoccoaSpotbox → cocoa_spotify}/ZmqDispatch.m
  46. +1 −0 CoccoaSpotbox/CoccoaSpotbox-Prefix.pch → cocoa_spotify/cocoa_spotify-Prefix.pch
  47. +2 −2 CoccoaSpotbox/CoccoaSpotbox.1 → cocoa_spotify/cocoa_spotify.1
  48. +1 −2 {CoccoaSpotbox → cocoa_spotify}/main.m
  49. BIN libzmqobjc.a
View
1 .gitignore
@@ -1,5 +1,6 @@
# App
app_key.c
+spotify_appkey.c
config.h
# Xcode
View
1 CocoaLibSpotify.framework/CocoaLibSpotify
View
1 CocoaLibSpotify.framework/Headers
View
1 CocoaLibSpotify.framework/Resources
View
BIN CocoaLibSpotify.framework/Versions/A/CocoaLibSpotify
Binary file not shown.
View
1 CocoaLibSpotify.framework/Versions/A/Frameworks/libspotify.framework/Headers
View
1 CocoaLibSpotify.framework/Versions/A/Frameworks/libspotify.framework/Resources
View
3,577 ...otify.framework/Versions/A/Frameworks/libspotify.framework/Versions/10.1.16/Headers/api.h
3,577 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
24 ...ramework/Versions/A/Frameworks/libspotify.framework/Versions/10.1.16/Resources/Info.plist
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>Spotify</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.spotify.Core</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Spotify</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
View
BIN ...bSpotify.framework/Versions/A/Frameworks/libspotify.framework/Versions/10.1.16/libspotify
Binary file not shown.
View
1 CocoaLibSpotify.framework/Versions/A/Frameworks/libspotify.framework/Versions/Current
View
1 CocoaLibSpotify.framework/Versions/A/Frameworks/libspotify.framework/libspotify
View
78 CocoaLibSpotify.framework/Versions/A/Headers/CocoaLibSpotify.h
@@ -0,0 +1,78 @@
+//
+// CocoaLibSpotify.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 3/7/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+#if TARGET_OS_IPHONE
+
+#import "SPErrorExtensions.h"
+#import "SPURLExtensions.h"
+#import "SPAlbum.h"
+#import "SPArtist.h"
+#import "SPImage.h"
+#import "SPUser.h"
+#import "SPSession.h"
+#import "SPPlaylist.h"
+#import "SPPlaylistFolder.h"
+#import "SPPlaylistItem.h"
+#import "SPTrack.h"
+#import "SPPlaylistContainer.h"
+#import "SPSearch.h"
+#import "SPPostTracksToInboxOperation.h"
+#import "SPArtistBrowse.h"
+#import "SPAlbumBrowse.h"
+#import "SPToplist.h"
+#import "SPUnknownPlaylist.h"
+
+#else
+
+#import <CocoaLibSpotify/SPErrorExtensions.h>
+#import <CocoaLibSpotify/SPURLExtensions.h>
+#import <CocoaLibSpotify/SPAlbum.h>
+#import <CocoaLibSpotify/SPArtist.h>
+#import <CocoaLibSpotify/SPImage.h>
+#import <CocoaLibSpotify/SPUser.h>
+#import <CocoaLibSpotify/SPSession.h>
+#import <CocoaLibSpotify/SPPlaylist.h>
+#import <CocoaLibSpotify/SPPlaylistFolder.h>
+#import <CocoaLibSpotify/SPPlaylistItem.h>
+#import <CocoaLibSpotify/SPTrack.h>
+#import <CocoaLibSpotify/SPPlaylistContainer.h>
+#import <CocoaLibSpotify/SPSearch.h>
+#import <CocoaLibSpotify/SPPostTracksToInboxOperation.h>
+#import <CocoaLibSpotify/SPArtistBrowse.h>
+#import <CocoaLibSpotify/SPAlbumBrowse.h>
+#import <CocoaLibSpotify/SPToplist.h>
+#import <CocoaLibSpotify/SPUnknownPlaylist.h>
+
+#endif
View
49 CocoaLibSpotify.framework/Versions/A/Headers/CocoaLibSpotifyPlatformImports.h
@@ -0,0 +1,49 @@
+//
+// CocoaLibSpotify.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 8/25/11.
+/*
+ Copyright (c) 2011, Spotify AB
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ This file allows us to keep the main CocoaLibSpotify as platform-agnostic as possible.
+*/
+
+#if TARGET_OS_IPHONE
+#import "api.h"
+#import <UIKit/UIKit.h>
+#import <CoreAudio/CoreAudioTypes.h>
+#import "SPCommon.h"
+#define SPPlatformNativeImage UIImage
+#else
+#import <Cocoa/Cocoa.h>
+#import <CoreAudio/CoreAudio.h>
+#import <libspotify/api.h>
+#import <CocoaLibSpotify/SPCommon.h>
+#define SPPlatformNativeImage NSImage
+#endif
View
158 CocoaLibSpotify.framework/Versions/A/Headers/SPAlbum.h
@@ -0,0 +1,158 @@
+//
+// SPAlbum.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 2/20/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/** Represents an album on Spotify.
+
+ SPAlbum is roughly analogous to the sp_album struct in the C LibSpotify API.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+@class SPSession;
+@class SPImage;
+@class SPArtist;
+
+@interface SPAlbum : NSObject <SPPlaylistableItem> {
+ @private
+ sp_album *album;
+ SPSession *session;
+ SPImage *cover;
+ SPArtist *artist;
+ NSURL *spotifyURL;
+ BOOL available;
+ BOOL loaded;
+ NSUInteger year;
+ sp_albumtype type;
+ NSString *name;
+}
+
+///----------------------------
+/// @name Creating and Initializing Albums
+///----------------------------
+
+/** Creates an SPAlbum from the given opaque sp_album struct.
+
+ This convenience method creates an SPAlbum object if one doesn't exist, or
+ returns a cached SPAlbum if one already exists for the given struct.
+
+ @param anAlbum The sp_album struct to create an SPAlbum for.
+ @param aSession The SPSession the album should exist in.
+ @return Returns the created SPAlbum object.
+ */
++(SPAlbum *)albumWithAlbumStruct:(sp_album *)anAlbum inSession:(SPSession *)aSession;
+
+/** Creates an SPAlbum from the given Spotify album URL.
+
+ This convenience method creates an SPAlbum object if one doesn't exist, or
+ returns a cached SPAlbum if one already exists for the given URL.
+
+ @warning *Important:* If you pass in an invalid album URL (i.e., any URL not
+ starting `spotify:album:`, this method will return `nil`.
+
+ @param aURL The album URL to create an SPAlbum for.
+ @param aSession The SPSession the album should exist in.
+ @return Returns the created SPAlbum object, or `nil` if given an invalid album URL.
+ */
++(SPAlbum *)albumWithAlbumURL:(NSURL *)aURL inSession:(SPSession *)aSession;
+
+/** Initializes a new SPAlbum from the given opaque sp_album struct.
+
+ @warning *Important:* For better performance and built-in caching, it is recommended
+ you create SPAlbum objects using +[SPAlbum albumWithAlbumStruct:inSession:],
+ +[SPAlbum albumWithAlbumURL:inSession:] or the instance methods on SPSession.
+
+ @param anAlbum The sp_album struct to create an SPAlbum for.
+ @param aSession The SPSession the album should exist in.
+ @return Returns the created SPAlbum object.
+ */
+-(id)initWithAlbumStruct:(sp_album *)anAlbum inSession:(SPSession *)aSession;
+
+///----------------------------
+/// @name Properties
+///----------------------------
+
+/** Returns the opaque structure used by the C LibSpotify API.
+
+ @warning *Important:* This should only be used if you plan to directly use the
+ C LibSpotify API. The behaviour of CocoaLibSpotify is undefined if you use the C
+ API directly on items that have CocoaLibSpotify objects associated with them.
+ */
+@property (nonatomic, readonly) sp_album *album;
+
+/** Returns `YES` if the album metadata has finished loading. */
+@property (nonatomic, readonly, getter=isLoaded) BOOL loaded;
+
+/** Returns the session the album's metadata is loaded in. */
+@property (nonatomic, readonly, retain) SPSession *session;
+
+///----------------------------
+/// @name Metadata
+///----------------------------
+
+/** Returns the album's artist, or `nil` if the metadata isn't loaded yet. */
+@property (nonatomic, readonly, retain) SPArtist *artist;
+
+/** Returns the album's cover image. Returns `nil` if the metadata isn't loaded yet, or if the album doesn't have a cover image. */
+@property (nonatomic, readonly, retain) SPImage *cover;
+
+/** Returns `YES` if the album is available in the logged-in user's region. */
+@property (nonatomic, readonly, getter=isAvailable) BOOL available;
+
+/** Returns the name of the album. */
+@property (nonatomic, readonly, copy) NSString *name;
+
+/** Returns the Spotify URI of the track, for example: `spotify:album:43p5dnBeVx4H2bzy0W1cGL` */
+@property (nonatomic, readonly, copy) NSURL *spotifyURL;
+
+/** Returns the album type.
+
+ Possible values:
+
+ SP_ALBUMTYPE_ALBUM
+ Normal album.
+
+ SP_ALBUMTYPE_SINGLE
+ Single.
+
+ SP_ALBUMTYPE_COMPILATION
+ Compilation.
+
+ SP_ALBUMTYPE_UNKNOWN
+ Unknown type.
+ */
+@property (nonatomic, readonly) sp_albumtype type;
+
+/** Returns the release year of the album. */
+@property (nonatomic, readonly) NSUInteger year;
+
+@end
View
131 CocoaLibSpotify.framework/Versions/A/Headers/SPAlbumBrowse.h
@@ -0,0 +1,131 @@
+//
+// SPAlbumBrowse.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 4/24/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/** Represents an "album browse" of an album on the Spotify service.
+
+ An "album browse" fetches detailed information about an album from the Spotify
+ service, including a review, copyright information and a list of the album's tracks.
+
+ Artist or album browses are required for certain SPTrack metadata to be available -
+ see the SPTrack documentation for details.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+@class SPAlbum;
+@class SPSession;
+@class SPArtist;
+
+@interface SPAlbumBrowse : NSObject {
+@private
+ BOOL loaded;
+ NSError *loadError;
+ SPSession *session;
+ SPAlbum *album;
+ SPArtist *artist;
+ NSArray *tracks;
+ NSArray *copyrights;
+ NSString *review;
+ sp_albumbrowse *browseOperation;
+}
+
+///----------------------------
+/// @name Creating and Initializing Album Browses
+///----------------------------
+
+/** Creates an SPAlbumBrowse from the given SPAlbum.
+
+ This convenience method is simply returns a new, autoreleased SPAlbumBrowse
+ object. No caching is performed.
+
+ @param anAlbum The SPAlbum to make an SPAlbumBrowse for.
+ @param aSession The SPSession the browse should exist in.
+ @return Returns the created SPAlbumBrowse object.
+ */
++(SPAlbumBrowse *)browseAlbum:(SPAlbum *)anAlbum inSession:(SPSession *)aSession;
+
+/** Creates an SPAlbumBrowse from the given album URL.
+
+ This convenience method is simply returns a new, autoreleased SPAlbumBrowse
+ object. No caching is performed.
+
+ @warning *Important:* If you pass in an invalid album URL (i.e., any URL not
+ starting `spotify:album:`, this method will return `nil`.
+
+ @param albumURL The album URL to make an SPAlbumBrowse for.
+ @param aSession The SPSession the browse should exist in.
+ @return Returns the created SPAlbumBrowse object.
+ */
++(SPAlbumBrowse *)browseAlbumAtURL:(NSURL *)albumURL inSession:(SPSession *)aSession;
+
+/** Initializes a new SPAlbumBrowse from the given SPAlbum.
+
+ @param anAlbum The SPAlbum to make an SPAlbumBrowse for.
+ @param aSession The SPSession the browse should exist in.
+ @return Returns the created SPAlbumBrowse object.
+ */
+-(id)initWithAlbum:(SPAlbum *)anAlbum inSession:(SPSession *)aSession;
+
+///----------------------------
+/// @name Properties
+///----------------------------
+
+/** Returns `YES` if the album metadata has finished loading. */
+@property (nonatomic, readonly, getter=isLoaded) BOOL loaded;
+
+/** Returns the error that occurred during loading, or `nil` if no error occurred. */
+@property (nonatomic, readonly, copy) NSError *loadError;
+
+/** Returns the session the album's metadata is loaded in. */
+@property (nonatomic, readonly, retain) SPSession *session;
+
+///----------------------------
+/// @name Metadata
+///----------------------------
+
+/** Returns the browse operation's album. */
+@property (nonatomic, readonly, retain) SPAlbum *album;
+
+/** Returns the album's artist, or `nil` if the metadata isn't loaded yet. */
+@property (nonatomic, readonly, retain) SPArtist *artist;
+
+/** Returns the album's copyrights as an array of NSString, or `nil` if the metadata isn't loaded yet. */
+@property (nonatomic, readonly, retain) NSArray *copyrights;
+
+/** Returns the album's review, or `nil` if the metadata isn't loaded yet. */
+@property (nonatomic, readonly, copy) NSString *review;
+
+/** Returns the album's tracks, or `nil` if the metadata isn't loaded yet. */
+@property (nonatomic, readonly, retain) NSArray *tracks;
+
+@end
View
113 CocoaLibSpotify.framework/Versions/A/Headers/SPArtist.h
@@ -0,0 +1,113 @@
+//
+// SPArtist.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 2/20/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/** Represents an artist on Spotify.
+
+ SPArtist is roughly analogous to the sp_artist struct in the C LibSpotify API.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+@class SPSession;
+
+@interface SPArtist : NSObject <SPPlaylistableItem> {
+ @private
+ sp_artist *artist;
+ NSURL *spotifyURL;
+ NSString *name;
+}
+
+///----------------------------
+/// @name Creating and Initializing Artists
+///----------------------------
+
+/** Creates an SPArtist from the given opaque sp_artist struct.
+
+ This convenience method creates an SPArtist object if one doesn't exist, or
+ returns a cached SPArtist if one already exists for the given struct.
+
+ @param anArtist The sp_artist struct to create an SPArtist for.
+ @param aSession The session to create the artist in.
+ @return Returns the created SPArtist object.
+ */
++(SPArtist *)artistWithArtistStruct:(sp_artist *)anArtist inSession:(SPSession *)aSession;
+
+/** Creates an SPArtist from the given Spotify artist URL.
+
+ This convenience method creates an SPArtist object if one doesn't exist, or
+ returns a cached SPArtist if one already exists for the given URL.
+
+ @warning *Important:* If you pass in an invalid artist URL (i.e., any URL not
+ starting `spotify:artist:`, this method will return `nil`.
+
+ @param aURL The artist URL to create an SPArtist for.
+ @param aSession The session to create the artist in.
+ @return Returns the created SPArtist object, or `nil` if given an invalid artist URL.
+ */
++(SPArtist *)artistWithArtistURL:(NSURL *)aURL inSession:(SPSession *)aSession;
+
+/** Initializes a new SPArtist from the given opaque sp_artist struct.
+
+ @warning *Important:* For better performance and built-in caching, it is recommended
+ you create SPArtist objects using +[SPArtist artistWithArtistStruct:],
+ +[SPArtist artistWithArtistURL:] or the instance methods on SPSession.
+
+ @param anArtist The sp_artist struct to create an SPArtist for.
+ @param aSession The session to create the artist in.
+ @return Returns the created SPArtist object.
+ */
+-(id)initWithArtistStruct:(sp_artist *)anArtist inSession:(SPSession *)aSession;
+
+///----------------------------
+/// @name Properties
+///----------------------------
+
+/** Returns the opaque structure used by the C LibSpotify API.
+
+ @warning *Important:* This should only be used if you plan to directly use the
+ C LibSpotify API. The behaviour of CocoaLibSpotify is undefined if you use the C
+ API directly on items that have CocoaLibSpotify objects associated with them.
+ */
+@property (nonatomic, readonly) sp_artist *artist;
+
+///----------------------------
+/// @name Metadata
+///----------------------------
+
+/** Returns the artist's name. */
+@property (nonatomic, readonly, copy) NSString *name;
+
+/** Returns the Spotify URI of the track, for example: `spotify:artist:12EtLdLfJ41vUOoVzPZIUy` */
+@property (nonatomic, readonly, copy) NSURL *spotifyURL;
+
+@end
View
167 CocoaLibSpotify.framework/Versions/A/Headers/SPArtistBrowse.h
@@ -0,0 +1,167 @@
+//
+// SPArtistBrowse.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 4/24/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/** Represents an "artist browse" of an artist on the Spotify service.
+
+ An "artist browse" fetches detailed information about an artist from the Spotify
+ service, including a biography, portrait images, related artists and a list of
+ their tracks and albums.
+
+ Artist or album browses are required for certain SPTrack metadata to be available -
+ see the SPTrack documentation for details.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+@class SPArtist;
+@class SPSession;
+@class SPImage;
+
+@interface SPArtistBrowse : NSObject {
+@private
+ BOOL loaded;
+ NSError *loadError;
+ SPArtist *artist;
+ SPSession *session;
+ NSArray *portraits;
+ SPPlatformNativeImage *firstPortrait;
+ NSArray *tracks;
+ NSArray *albums;
+ NSArray *relatedArtists;
+ NSString *biography;
+ sp_artistbrowse *browseOperation;
+}
+
+///----------------------------
+/// @name Creating and Initializing Artist Browses
+///----------------------------
+
+/** Creates an SPArtistBrowse from the given SPArtist.
+
+ This convenience method is simply returns a new, autoreleased SPArtistBrowse
+ object. No caching is performed.
+
+ @warning *Important:* It is strongly recommended that you don't use `SP_ARTISTBROWSE_FULL`
+ as the browse type, as this will download metadata for every single album and track from the given
+ artist, which is both a lengthy and memory-intensive operation. Please use
+ `SP_ARTISTBROWSE_NO_TRACKS` (which only downloads artist information and their albums) or
+ `SP_ARTISTBROWSE_NO_ALBUMS` (which only downloads artist information) instead.
+
+ @warning *Important:* If you pass in an invalid artist URL (i.e., any URL not
+ starting `spotify:artist:`, this method will return `nil`.
+
+ @param anArtist The SPArtist to make an SPArtistBrowse for.
+ @param aSession The SPSession the browse should exist in.
+ @param browseMode The type of artist browse to perform.
+ @return Returns the created SPArtistBrowse object.
+ */
++(SPArtistBrowse *)browseArtist:(SPArtist *)anArtist inSession:(SPSession *)aSession type:(sp_artistbrowse_type)browseMode;
+
+/** Creates an SPArtistBrowse from the given artist URL.
+
+ This convenience method is simply returns a new, autoreleased SPArtistBrowse
+ object. No caching is performed.
+
+ @warning *Important:* It is strongly recommended that you don't use `SP_ARTISTBROWSE_FULL`
+ as the browse type, as this will download metadata for every single album and track from the given
+ artist, which is both a lengthy and memory-intensive operation. Please use
+ `SP_ARTISTBROWSE_NO_TRACKS` (which only downloads artist information and their albums) or
+ `SP_ARTISTBROWSE_NO_ALBUMS` (which only downloads artist information) instead.
+
+ @warning *Important:* If you pass in an invalid artist URL (i.e., any URL not
+ starting `spotify:artist:`, this method will return `nil`.
+
+ @param artistURL The artist URL to make an SPArtistBrowse for.
+ @param aSession The SPSession the browse should exist in.
+ @param browseMode The type of artist browse to perform.
+ @return Returns the created SPArtistBrowse object.
+ */
++(SPArtistBrowse *)browseArtistAtURL:(NSURL *)artistURL inSession:(SPSession *)aSession type:(sp_artistbrowse_type)browseMode;
+
+/** Initializes a new SPArtistBrowse from the given SPArtist.
+
+ @warning *Important:* It is strongly recommended that you don't use `SP_ARTISTBROWSE_FULL`
+ as the browse type, as this will download metadata for every single album and track from the given
+ artist, which is both a lengthy and memory-intensive operation. Please use
+ `SP_ARTISTBROWSE_NO_TRACKS` (which only downloads artist information and their albums) or
+ `SP_ARTISTBROWSE_NO_ALBUMS` (which only downloads artist information) instead.
+
+ @warning *Important:* If you pass in an invalid artist URL (i.e., any URL not
+ starting `spotify:artist:`, this method will return `nil`.
+
+ @param anArtist The SPArtist to make an SPArtistBrowse for.
+ @param aSession The SPSession the browse should exist in.
+ @param browseMode The type of artist browse to perform.
+ @return Returns the created SPArtistBrowse object.
+ */
+-(id)initWithArtist:(SPArtist *)anArtist inSession:(SPSession *)aSession type:(sp_artistbrowse_type)browseMode;
+
+///----------------------------
+/// @name Properties
+///----------------------------
+
+/** Returns `YES` if the artist metadata has finished loading. */
+@property (nonatomic, readonly, getter=isLoaded) BOOL loaded;
+
+/** Returns the error that occurred during loading, or `nil` if no error occurred. */
+@property (nonatomic, readonly, copy) NSError *loadError;
+
+/** Returns the session the artist's metadata is loaded in. */
+@property (nonatomic, readonly, retain) SPSession *session;
+
+///----------------------------
+/// @name Metadata
+///----------------------------
+
+/** Returns a list of albums by this artist, or `nil` if the metadata isn't loaded yet. */
+@property (nonatomic, readonly, retain) NSArray *albums;
+
+/** Returns the browse operation's artist. */
+@property (nonatomic, readonly, retain) SPArtist *artist;
+
+/** Returns the artist's biography, or `nil` if the metadata isn't loaded yet. */
+@property (nonatomic, readonly, copy) NSString *biography;
+
+/** Returns the first artist portrait image, or `nil` if the metadata isn't loaded yet or there are no images. */
+@property (nonatomic, readonly, retain) SPImage *firstPortrait;
+
+/** Returns the artist's portrait images, or `nil` if the metadata isn't loaded yet. */
+@property (nonatomic, readonly, retain) NSArray *portraits;
+
+/** Returns a list of related artists for this artist, or `nil` if the metadata isn't loaded yet. */
+@property (nonatomic, readonly, retain) NSArray *relatedArtists;
+
+/** Returns a list of tracks by this artist, or `nil` if the metadata isn't loaded yet. */
+@property (nonatomic, readonly, retain) NSArray *tracks;
+
+@end
View
54 CocoaLibSpotify.framework/Versions/A/Headers/SPCommon.h
@@ -0,0 +1,54 @@
+/*
+ Copyright (c) 2011, Spotify AB
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ This file contains protocols and other things needed throughout the library.
+ */
+
+@class SPTrack;
+@protocol SPSessionPlaybackDelegate;
+@protocol SPSessionAudioDeliveryDelegate;
+
+@protocol SPPlaylistableItem <NSObject>
+
+-(NSString *)name;
+-(NSURL *)spotifyURL;
+
+@end
+
+@protocol SPSessionPlaybackProvider <NSObject>
+
+@property (nonatomic, readwrite, getter=isPlaying) BOOL playing;
+@property (nonatomic) __weak id <SPSessionPlaybackDelegate> playbackDelegate;
+@property (nonatomic) __weak id <SPSessionAudioDeliveryDelegate> audioDeliveryDelegate;
+
+-(BOOL)preloadTrackForPlayback:(SPTrack *)aTrack error:(NSError **)error;
+-(BOOL)playTrack:(SPTrack *)aTrack error:(NSError **)error;
+-(void)seekPlaybackToOffset:(NSTimeInterval)offset;
+-(void)unloadPlayback;
+
+@end
View
48 CocoaLibSpotify.framework/Versions/A/Headers/SPErrorExtensions.h
@@ -0,0 +1,48 @@
+//
+// SPErrorExtensions.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 2/14/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/** Contains convenience methods for working with Spotify error codes (`sp_error`). */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+static NSString * const kCocoaLibSpotifyErrorDomain = @"com.spotify.CocoaLibSpotify.error";
+
+@interface NSError (SPErrorExtensions)
+
++ (NSError *)spotifyErrorWithDescription:(NSString *)msg code:(NSInteger)code;
++ (NSError *)spotifyErrorWithCode:(sp_error)code;
++ (NSError *)spotifyErrorWithDescription:(NSString *)msg;
++ (NSError *)spotifyErrorWithCode:(NSInteger)code format:(NSString *)format, ...;
++ (NSError *)spotifyErrorWithFormat:(NSString *)format, ...;
+
+@end
View
127 CocoaLibSpotify.framework/Versions/A/Headers/SPImage.h
@@ -0,0 +1,127 @@
+//
+// SPImage.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 2/20/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/** Represents an image from the Spotify service. */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+@class SPSession;
+
+static NSUInteger const SPImageIdLength = 20;
+
+@interface SPImage : NSObject {
+ @private
+ SPPlatformNativeImage *image;
+ sp_image *spImage;
+ const byte *imageId;
+ BOOL loaded;
+ BOOL hasRequestedImage;
+ __weak SPSession *session;
+ NSURL *spotifyURL;
+}
+
+///----------------------------
+/// @name Creating and Initializing Images
+///----------------------------
+
+/** Creates an SPImage from the given ID.
+
+ This convenience method creates an SPImage object if one doesn't exist, or
+ returns a cached SPImage if one already exists for the given ID.
+
+ @param imageId The image ID to create an SPImage for.
+ @param aSession The SPSession the image should exist in.
+ @return Returns the created SPImage object.
+ */
++(SPImage *)imageWithImageId:(const byte *)imageId inSession:(SPSession *)aSession;
+
+/** Creates an SPImage from the given URL.
+
+ This convenience method creates an SPImage object if one doesn't exist, or
+ returns a cached SPImage if one already exists for the given URL.
+
+ @param imageURL The image URL to create an SPImage for.
+ @param aSession The SPSession the image should exist in.
+ @return Returns the created SPImage object.
+ */
++(SPImage *)imageWithImageURL:(NSURL *)imageURL inSession:(SPSession *)aSession;
+
+/** Initializes a new SPImage from the given struct and ID.
+
+ @warning *Important:* For better performance and built-in caching, it is recommended
+ you create SPImage objects using +[SPImage imageWithImageId:inSession:].
+
+ @param anImage The sp_image struct to create an SPImage for, or NULL if the image hasn't been loaded yet.
+ @param anId The ID of the image.
+ @param aSession The SPSession the image should exist in.
+ @return Returns the created SPImage object.
+ */
+-(id)initWithImageStruct:(sp_image *)anImage imageId:(const byte *)anId inSession:(SPSession *)aSession;
+
+///----------------------------
+/// @name Loading Images
+///----------------------------
+
+/** Begins loading the image if it hasn't already been loaded.
+
+ This is called automatically if you request the image property. */
+-(void)beginLoading;
+
+///----------------------------
+/// @name Properties
+///----------------------------
+
+/** Returns an NSImage or UIImage representation of the image, or `nil` if the image has yet to be loaded. */
+@property (nonatomic, readonly, retain) SPPlatformNativeImage *image;
+
+/** Returns the ID of the image. */
+@property (nonatomic, readonly) const byte *imageId;
+
+/** Returns `YES` if the image has finished loading and all data is available. */
+@property (nonatomic, readonly, getter=isLoaded) BOOL loaded;
+
+/** Returns the session the image was loaded in. */
+@property (nonatomic, readonly) __weak SPSession *session;
+
+/** Returns the opaque structure used by the C LibSpotify API, or NULL if the image has yet to be loaded.
+
+ @warning *Important:* This should only be used if you plan to directly use the
+ C LibSpotify API. The behaviour of CocoaLibSpotify is undefined if you use the C
+ API directly on items that have CocoaLibSpotify objects associated with them.
+ */
+@property (nonatomic, readonly) sp_image *spImage;
+
+/** Returns the Spotify URL of the image. */
+@property (nonatomic, readonly, copy) NSURL *spotifyURL;
+
+@end
View
294 CocoaLibSpotify.framework/Versions/A/Headers/SPPlaylist.h
@@ -0,0 +1,294 @@
+//
+// SPPlaylist.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 2/14/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/** This class represents a list of items, be it a user's starred list, inbox, or a traditional "playlist". */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+@class SPUser;
+@class SPImage;
+@class SPSession;
+@protocol SPPlaylistDelegate;
+
+@interface SPPlaylist : NSObject <SPPlaylistableItem> {
+@private
+ sp_playlist *playlist;
+ BOOL updating;
+ BOOL loaded;
+ BOOL collaborative;
+ BOOL hasPendingChanges;
+ __weak id <SPPlaylistDelegate> delegate;
+ __weak SPSession *session;
+ NSString *playlistDescription;
+ NSString *name;
+ SPImage *image;
+ SPUser *owner;
+ NSURL *spotifyURL;
+ BOOL trackChangesAreFromLibSpotifyCallback;
+ NSMutableArray *itemWrapper;
+ NSArray *subscribers;
+ float offlineDownloadProgress;
+ sp_playlist_offline_status offlineStatus;
+}
+
+///----------------------------
+/// @name Creating and Initializing Playlists
+///----------------------------
+
+/** Creates an SPPlaylist from the given opaque sp_playlist struct.
+
+ This convenience method creates an SPPlaylist object if one doesn't exist, or
+ returns a cached SPPlaylist if one already exists for the given struct.
+
+ @param pl The sp_playlist struct to create an SPPlaylist for.
+ @param aSession The SPSession the playlist should exist in.
+ @return Returns the created SPPlaylist object.
+ */
++(SPPlaylist *)playlistWithPlaylistStruct:(sp_playlist *)pl inSession:(SPSession *)aSession;
+
+/** Creates an SPPlaylist from the given Spotify playlist URL.
+
+ This convenience method creates an SPPlaylist object if one doesn't exist, or
+ returns a cached SPPlaylist if one already exists for the given URL.
+
+ @warning *Important:* If you pass in an invalid playlist URL (i.e., any URL not
+ starting `spotify:user:XXXX:playlist:`, this method will return `nil`.
+
+ @param playlistURL The playlist URL to create an SPPlaylist for.
+ @param aSession The SPSession the playlist should exist in.
+ @return Returns the created SPPlaylist object.
+ */
++(SPPlaylist *)playlistWithPlaylistURL:(NSURL *)playlistURL inSession:(SPSession *)aSession;
+
+/** Initializes an SPPlaylist from the given opaque sp_playlist struct.
+
+ @warning *Important:* For better performance and built-in caching, it is recommended
+ you create SPPlaylist objects using +[SPPlaylist playlistWithPlaylistStruct:inSession:],
+ +[SPPlaylist playlistWithPlaylistURL:inSession:] or the instance methods on SPSession.
+
+ @param pl The sp_playlist struct to create an SPPlaylist for.
+ @param aSession The SPSession the playlist should exist in.
+ @return Returns the created SPPlaylist object.
+ */
+-(id)initWithPlaylistStruct:(sp_playlist *)pl inSession:(SPSession *)aSession;
+
+///----------------------------
+/// @name Properties
+///----------------------------
+
+/** Returns the playlist's delegate object. */
+@property (nonatomic, readwrite) __weak id <SPPlaylistDelegate> delegate;
+
+/** Returns `YES` if the playlist has changes not yet recognised by the Spotify servers, otherwise `NO`. */
+@property (nonatomic, readonly) BOOL hasPendingChanges;
+
+/** Returns `YES` if the playlist is collaborative (can be edited by users other than the owner), otherwise `NO`. */
+@property (nonatomic, readwrite, getter=isCollaborative) BOOL collaborative;
+
+/** Returns `YES` if the playlist has finished loading and all data is available. */
+@property (nonatomic, readonly, getter=isLoaded) BOOL loaded;
+
+/** Returns `YES` if the playlist is marked for offline playback. */
+@property (nonatomic, readwrite, getter=isMarkedForOfflinePlayback) BOOL markedForOfflinePlayback;
+
+/** Returns `YES` if the playlist is being updated, otherwise `NO`.
+
+ Typically, you should delay UI updates while this property is set to `YES`.
+ */
+@property (nonatomic, readonly, getter=isUpdating) BOOL updating;
+
+/** Returns the download progress of the playlist (between 0 and 1) is it is marked for offline sync. */
+@property (nonatomic, readonly) float offlineDownloadProgress;
+
+/** Returns the offline status of the playlist. Possible values:
+
+ SP_PLAYLIST_OFFLINE_STATUS_NO
+ Playlist is not offline enabled.
+
+ SP_PLAYLIST_OFFLINE_STATUS_YES
+ Playlist is synchronized to local storage.
+
+ SP_PLAYLIST_OFFLINE_STATUS_DOWNLOADING
+ This playlist is currently downloading. Only one playlist can be in this state any given time.
+
+ SP_PLAYLIST_OFFLINE_STATUS_WAITING
+ Playlist is queued for download.
+ */
+@property (nonatomic, readonly) sp_playlist_offline_status offlineStatus;
+
+/** Returns the owner of the playlist, or `nil` if the playlist hasn't loaded yet. */
+@property (nonatomic, readonly, retain) SPUser *owner;
+
+/** Returns the opaque structure used by the C LibSpotify API.
+
+ @warning *Important:* This should only be used if you plan to directly use the
+ C LibSpotify API. The behaviour of CocoaLibSpotify is undefined if you use the C
+ API directly on items that have CocoaLibSpotify objects associated with them.
+ */
+@property (nonatomic, readonly) sp_playlist *playlist;
+
+/** Returns the session object the playlist is loaded in. */
+@property (nonatomic, readonly) __weak SPSession *session;
+
+/** Returns the Spotify URI of the playlist profile, for example: `spotify:user:sarnesjo:playlist:3p2c7mmML3fIUh5fcZ8Hcq` */
+@property (nonatomic, readonly, copy) NSURL *spotifyURL;
+
+/** Returns the subscribers to the playlist as an array of Spotify usernames. */
+@property (nonatomic, readonly, retain) NSArray *subscribers;
+
+///----------------------------
+/// @name Metadata
+///----------------------------
+
+/** Returns the custom image for the playlist, or `nil` if the playlist hasn't loaded yet or it doesn't have a custom image. */
+@property (nonatomic, readonly, retain) SPImage *image;
+
+/** Returns the name of the playlist, or `nil` if the playlist hasn't loaded yet. */
+@property (nonatomic, readwrite, copy) NSString *name;
+
+/** Returns the custom description for the playlist, or `nil` if the playlist hasn't loaded yet or it doesn't have a custom description. */
+@property (nonatomic, readonly, copy) NSString *playlistDescription;
+
+///----------------------------
+/// @name Working with Items
+///----------------------------
+
+/** Returns an array of SPPlaylistItem objects representing playlist's item order.
+
+ This array is KVO compliant, and any changes made will be reflected in the user's account.
+
+ @warning *Important:* You can add both `SPTrack` and `SPPlaylistItem` objects to this array.
+ `SPTrack` objects will automatically be wrapped inside an `SPPlaylistItem`.
+
+ @warning *Important:* If you need to move an item from one location in this list to another, please
+ use `-moveItemsAtIndexes:toIndex:error:` for performance reasons.
+
+ @see -moveItemsAtIndexes:toIndex:error:
+ */
+@property (nonatomic, readonly) NSMutableArray *items;
+
+/** Move item(s) to another location in the list.
+
+ All indexes are given relative to the state of the item order before the move is executed. Therefore, you
+ *don't* need to adjust the destination index to take into account items that will be moved from above it.
+
+ @warning *Important:* This operation can fail, for example if you give invalid indexes. Please make sure
+ you check the result of this method.
+
+ @param indexes The indexes of the items to move.
+ @param newLocation The index the items should be moved to.
+ @param error An NSError pointer to be filled if the operation fails.
+ @return Returns `YES` if the operation succeeded, otherwise `NO`.
+ */
+-(BOOL)moveItemsAtIndexes:(NSIndexSet *)indexes toIndex:(NSUInteger)newLocation error:(NSError **)error;
+
+@end
+
+/** Delegate callbacks from SPPlaylist to help with item reordering. */
+
+@protocol SPPlaylistDelegate <NSObject>
+@optional
+
+/** Called when one or more items in the playlist updated their metadata.
+
+ @param aPlaylist The playlist in which items updated their metadata.
+ */
+-(void)itemsInPlaylistDidUpdateMetadata:(SPPlaylist *)aPlaylist;
+
+///----------------------------
+/// @name Item Removal
+///----------------------------
+
+/** Called before one or more items in the playlist will be removed from the playlist.
+
+ @param aPlaylist The playlist in which items will be removed.
+ @param items The items that will be removed.
+ @param outgoingIndexes The indexes of the itemss.
+ */
+-(void)playlist:(SPPlaylist *)aPlaylist willRemoveItems:(NSArray *)items atIndexes:(NSIndexSet *)outgoingIndexes;
+
+/** Called after one or more items in the playlist were removed from the playlist.
+
+ @warning *Important:* The index set passed to this method is not valid for the given items.
+
+ @param aPlaylist The playlist in which items were removed.
+ @param items The items that were be removed.
+ @param theseIndexesArentValidAnymore The (now invalid) indexes of the items.
+ */
+-(void)playlist:(SPPlaylist *)aPlaylist didRemoveItems:(NSArray *)items atIndexes:(NSIndexSet *)theseIndexesArentValidAnymore;
+
+///----------------------------
+/// @name Item Addition
+///----------------------------
+
+/** Called before one or more items are added to the playlist.
+
+ @warning *Important:* The index set passed to this method is not valid for the given items.
+
+ @param aPlaylist The playlist to which items will be added.
+ @param items The items that will be added.
+ @param theseIndexesArentYetValid The (invalid, for now) destination indexes of the items.
+ */
+-(void)playlist:(SPPlaylist *)aPlaylist willAddItems:(NSArray *)items atIndexes:(NSIndexSet *)theseIndexesArentYetValid;
+
+/** Called after one or more items are added to the playlist.
+
+ @param aPlaylist The playlist in which items were added.
+ @param items The items that were added.
+ @param newIndexes The destination indexes of the items.
+ */
+-(void)playlist:(SPPlaylist *)aPlaylist didAddItems:(NSArray *)items atIndexes:(NSIndexSet *)newIndexes;
+
+///----------------------------
+/// @name Item Reordering
+///----------------------------
+
+/** Called before one or more items are moved within the playlist.
+
+ @param aPlaylist The playlist in which items will be moved.
+ @param items The items that will be moved.
+ @param oldIndexes The current indexes of the items.
+ @param newIndexes The (invalid, for now) indexes that the items will end up at.
+ */
+-(void)playlist:(SPPlaylist *)aPlaylist willMoveItems:(NSArray *)items atIndexes:(NSIndexSet *)oldIndexes toIndexes:(NSIndexSet *)newIndexes;
+
+/** Called after one or more items are moved within the playlist.
+
+ @param aPlaylist The playlist in which items will be moved.
+ @param items The items that will be moved.
+ @param oldIndexes The (invalid) old indexes of the items.
+ @param newIndexes The now current indexes of the items.
+ */
+-(void)playlist:(SPPlaylist *)aPlaylist didMoveItems:(NSArray *)items atIndexes:(NSIndexSet *)oldIndexes toIndexes:(NSIndexSet *)newIndexes;
+
+@end
View
121 CocoaLibSpotify.framework/Versions/A/Headers/SPPlaylistContainer.h
@@ -0,0 +1,121 @@
+//
+// SPPlaylistContainer.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 2/19/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/** This class represents a list of playlists. In practice, it is only found when dealing with a user's playlist
+ list and can't be created manually. */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+@class SPUser;
+@class SPSession;
+@class SPPlaylist;
+@class SPPlaylistFolder;
+
+@interface SPPlaylistContainer : NSObject {
+ @private
+ sp_playlistcontainer *container;
+ __weak SPSession *session;
+ SPPlaylistFolder *rootFolder;
+ SPUser *owner;
+ BOOL loaded;
+}
+
+///----------------------------
+/// @name Properties
+///----------------------------
+
+/** Returns the opaque structure used by the C LibSpotify API.
+
+ @warning *Important:* This should only be used if you plan to directly use the
+ C LibSpotify API. The behaviour of CocoaLibSpotify is undefined if you use the C
+ API directly on items that have CocoaLibSpotify objects associated with them.
+ */
+@property (nonatomic, readonly) sp_playlistcontainer *container;
+
+/* Returns `YES` if the playlist container has loaded all playlist and folder data, otherwise `NO`. */
+@property (nonatomic, readonly, getter=isLoaded) BOOL loaded;
+
+/** Returns the owner of the playlist list. */
+@property (nonatomic, readonly, retain) SPUser *owner;
+
+/** Returns an array of SPPlaylist and/or SPPlaylistFolders representing the owner's playlists.
+
+ This array is KVO compliant, and any changes made will be reflected in the user's account.
+
+ @warning *Important:* If you need to move a playlist from one location in this list to another, please
+ use `-movePlaylistOrFolderAtIndex:ofParent:toIndex:ofNewParent:error:` for performance reasons.
+
+ @see movePlaylistOrFolderAtIndex:ofParent:toIndex:ofNewParent:error:
+*/
+@property (nonatomic, readonly) NSMutableArray *playlists;
+
+/** Returns the session the list is loaded in. */
+@property (nonatomic, readonly) __weak SPSession *session;
+
+///----------------------------
+/// @name Working with Playlists and Folders
+///----------------------------
+
+/** Create a new, empty folder.
+
+ @param name The name of the new folder.
+ @param error An error pointer that will be filled with an NSError if the operation fails.
+ @return Returns the created folder (which will also be added to the start of the playlists property), or `nil` if the operation failed.
+ */
+-(SPPlaylistFolder *)createFolderWithName:(NSString *)name error:(NSError **)error;
+
+/** Create a new, empty playlist.
+
+ @param name The name of the new playlist. Must be shorter than 256 characters and not consist of only whitespace.
+ @return Returns the created playlist (which will also be added to the end of the playlists property), or `nil` if the operation failed.
+ */
+-(SPPlaylist *)createPlaylistWithName:(NSString *)name;
+
+/** Move a playlist or folder to another location in the list.
+
+ @warning *Important:* This operation can fail, for example if you give invalid indexes or try to move
+ a folder into itself. Please make sure you check the result of this method.
+
+ @param aPlaylistOrFolder The index of the playlist or folder in its parent (or the root list if it has no parent).
+ @param existingParentFolderOrNil The parent folder the previous index refers to, or `nil` if there is no parent.
+ @param newIndex The desired destination index in the destination parent folder (or root list if there's no parent).
+ @param aParentFolderOrNil The new parent folder, or nil if there is no parent.
+ @param err An NSError pointer to be filled if the operation fails.
+ @return Returns `YES` if the operation succeeded, otherwise `NO`.
+ */
+-(BOOL)movePlaylistOrFolderAtIndex:(NSUInteger)aPlaylistOrFolder
+ ofParent:(SPPlaylistFolder *)existingParentFolderOrNil
+ toIndex:(NSUInteger)newIndex
+ ofNewParent:(SPPlaylistFolder *)aParentFolderOrNil
+ error:(NSError **)err;
+@end
View
96 CocoaLibSpotify.framework/Versions/A/Headers/SPPlaylistFolder.h
@@ -0,0 +1,96 @@
+//
+// SPPlaylistFolder.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 2/20/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/** This class represents a playlist folder in the user's playlist list.
+
+ @see SPPlaylistContainer
+ */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+@class SPPlaylistContainer;
+@class SPSession;
+
+@interface SPPlaylistFolder : NSObject {
+ @private
+
+ __weak SPPlaylistContainer *parentContainer;
+ NSRange containerPlaylistRange;
+ // ^ For performance and integrity checking - the first item should be the folder marker,
+ // the last the end folder marker.
+
+ NSString *name;
+ sp_playlist *playlist;
+ __weak SPSession *session;
+ sp_uint64 folderId;
+}
+
+///----------------------------
+/// @name Properties
+///----------------------------
+
+/** Returns the folder's ID, as used in the C LibSpotify API.
+
+ @warning *Important:* This should only be used if you plan to directly use the
+ C LibSpotify API. The behaviour of CocoaLibSpotify is undefined if you use the C
+ API directly on items that have CocoaLibSpotify objects associated with them.
+ */
+@property (nonatomic, readonly) sp_uint64 folderId;
+
+/** Returns the name of the folder. */
+@property (nonatomic, readonly, copy) NSString *name;
+
+/** Returns the folder's containing SPPlaylistContainer. */
+@property (nonatomic, readonly) __weak SPPlaylistContainer *parentContainer;
+
+/* Returns the folder's parent folder, or `nil` if the folder is at the top level of its container. */
+-(SPPlaylistFolder *)parentFolder;
+
+/* Returns the folder's parent folder stack, or `nil` if the folder is at the top level of its container. */
+-(NSArray *)parentFolders;
+
+/** Returns an array of SPPlaylist and/or SPPlaylistFolders representing the folder's child playlists.
+
+ This array is KVO compliant, and any changes made will be reflected in the user's account.
+
+ @warning *Important:* If you need to move a playlist from one location in this list to another, please
+ use `-[SPPlaylistContainer movePlaylistOrFolderAtIndex:ofParent:toIndex:ofNewParent:error:]` for performance reasons.
+
+ @see [SPPlaylistContainer movePlaylistOrFolderAtIndex:ofParent:toIndex:ofNewParent:error:]
+ */
+@property (nonatomic, readonly) NSMutableArray *playlists;
+
+/** Returns the session the folder is loaded in. */
+@property (nonatomic, readonly) __weak SPSession *session;
+
+@end
View
99 CocoaLibSpotify.framework/Versions/A/Headers/SPPlaylistItem.h
@@ -0,0 +1,99 @@
+/*
+ Copyright (c) 2011, Spotify AB
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** This class represents an item in a playlist, be it a track, artist, album or something else. */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+@class SPPlaylist;
+@class SPUser;
+
+@interface SPPlaylistItem : NSObject {
+ id item;
+ __weak SPPlaylist *playlist;
+ int itemIndex;
+ NSDate *dateAdded;
+ SPUser *creator;
+ NSString *message;
+ BOOL _unread;
+}
+
+///----------------------------
+/// @name Querying The Item
+///----------------------------
+
+/** Returns the `Class` of the item this object represents. */
+@property (nonatomic, readonly) Class itemClass;
+
+/** Returns the Spotify URI of the item this object represents. */
+@property (nonatomic, readonly) NSURL *itemURL;
+
+/** Returns the `sp_linktype` of the item this object represents. */
+@property (nonatomic, readonly) sp_linktype itemURLType;
+
+/** Returns the item this object represents.
+
+ The item is typically a track, artist, album or playlist.
+ */
+@property (nonatomic, readonly, retain) id <SPPlaylistableItem> item;
+
+///----------------------------
+/// @name Metadata
+///----------------------------
+
+/** Returns the creator of the item this object represents.
+
+ This value is used in the user's inbox playlist and playlists that are or
+ were collaborative, and represents the user that added the track to the
+ playlist.
+ */
+@property (nonatomic, readonly, retain) SPUser *creator;
+
+/** Returns the date that the item this object represents was added to the playlist.
+
+ This value is used in the user's inbox playlist and playlists that are or
+ were collaborative, and represents the date and time the track was
+ added to the playlist.
+ */
+@property (nonatomic, readonly, copy) NSDate *dateAdded;
+
+/** Returns the message attached to the item this object represents.
+
+ This value is used in the user's inbox playlist and reflects the message
+ the sender attached to the item when sending it.
+ */
+@property (nonatomic, readonly, copy) NSString *message;
+
+/** Returns the "unread" status of the item this object represents.
+
+ This value is only normally used in the user's inbox playlist. In the
+ Spotify client, unread tracks have a blue dot by them in the inbox.
+ */
+@property (nonatomic, readwrite, getter = isUnread) BOOL unread;
+
+@end
View
141 CocoaLibSpotify.framework/Versions/A/Headers/SPPostTracksToInboxOperation.h
@@ -0,0 +1,141 @@
+//
+// SPPostTracksToInboxOperation.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 4/24/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/** This class provides functionality for sending tracks to another Spotify user. */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+@class SPSession;
+@protocol SPPostTracksToInboxOperationDelegate;
+
+@interface SPPostTracksToInboxOperation : NSObject {
+@private
+ SPSession *session;
+ NSString *destinationUser;
+ NSArray *tracks;
+ NSString *message;
+ sp_inbox *inboxOperation;
+ __weak id <SPPostTracksToInboxOperationDelegate> delegate;
+}
+
+///----------------------------
+/// @name Creating and Initializing Track Post Operations
+///----------------------------
+
+/** Creates an SPPostTracksToInboxOperation for the given details.
+
+ This convenience method is simply returns a new, autoreleased SPPostTracksToInboxOperation
+ object. No caching is performed.
+
+ @warning *Important:* Tracks will be posted to the given user as soon as a SPPostTracksToInboxOperation
+ object is created. Be sure you want to post the tracks before creating the object!
+
+ @param tracksToSend An array of SPTrack objects to send.
+ @param user The username of the user to send the tracks to.
+ @param aFriendlyGreeting The message to send with the tracks, if any.
+ @param aSession The session to send the tracks with.
+ @param completionDelegate The delegate to send success/failure messages to.
+ @return Returns the created SPPostTracksToInboxOperation object.
+ */
++(SPPostTracksToInboxOperation *)sendTracks:(NSArray *)tracksToSend
+ toUser:(NSString *)user
+ message:(NSString *)aFriendlyGreeting
+ inSession:(SPSession *)aSession
+ delegate:(id <SPPostTracksToInboxOperationDelegate>)completionDelegate;
+
+/** Initializes an SPPostTracksToInboxOperation for the given details.
+
+ @warning *Important:* Tracks will be posted to the given user as soon as a SPPostTracksToInboxOperation
+ object is created. Be sure you want to post the tracks before creating the object!
+
+ @param tracksToSend An array of SPTrack objects to send.
+ @param user The username of the user to send the tracks to.
+ @param aFriendlyGreeting The message to send with the tracks, if any.
+ @param aSession The session to send the tracks with.
+ @param completionDelegate The delegate to send success/failure messages to.
+ @return Returns the created SPPostTracksToInboxOperation object.
+ */
+-(id)initBySendingTracks:(NSArray *)tracksToSend
+ toUser:(NSString *)user
+ message:(NSString *)aFriendlyGreeting
+ inSession:(SPSession *)aSession
+ delegate:(id <SPPostTracksToInboxOperationDelegate>)completionDelegate;
+
+///----------------------------
+/// @name Properties
+///----------------------------
+
+/** Returns the operation's delegate. */
+@property (nonatomic, readonly) __weak id <SPPostTracksToInboxOperationDelegate> delegate;
+
+/** Returns the username of the user the tracks the operation is sending tracks to. */
+@property (nonatomic, readonly, copy) NSString *destinationUser;
+
+/** Returns the opaque structure used by the C LibSpotify API.
+
+ @warning *Important:* This should only be used if you plan to directly use the
+ C LibSpotify API. The behaviour of CocoaLibSpotify is undefined if you use the C
+ API directly on items that have CocoaLibSpotify objects associated with them.
+ */
+@property (nonatomic, readonly, assign) sp_inbox *inboxOperation;
+
+/** Returns the message being sent. */
+@property (nonatomic, readonly, copy) NSString *message;
+
+/** Returns the session the tracks are being sent in. */
+@property (nonatomic, readonly, retain) SPSession *session;
+
+/** Returns the tracks being sent. */
+@property (nonatomic, readonly, copy) NSArray *tracks;
+
+@end
+
+/** Delegate callbacks from SPPostTracksToInboxOperation on success or failure. */
+
+@protocol SPPostTracksToInboxOperationDelegate <NSObject>
+@optional
+
+/** Called when the given post operation succeeded.
+
+ @param operation The operation that succeeded.
+ */
+-(void)postTracksToInboxOperationDidSucceed:(SPPostTracksToInboxOperation *)operation;
+
+/** Called when the given post operation failed.
+
+ @param operation The operation that failed.
+ @param error The error that caused the failure.
+ */
+-(void)postTracksToInboxOperation:(SPPostTracksToInboxOperation *)operation didFailWithError:(NSError *)error;
+
+@end
View
258 CocoaLibSpotify.framework/Versions/A/Headers/SPSearch.h
@@ -0,0 +1,258 @@
+//
+// SPSearch.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 4/21/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/** This class performs a search on the Spotify catalogue available to the given session, returning tracks, albums and artists. */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+@class SPSession;
+
+/** The default search page size. Used if no page size is specified. */
+static SInt32 const kSPSearchDefaultSearchPageSize = 75;
+/** The "do not search" page size. Used if you don't want to search for a particular kind of result. */
+static SInt32 const kSPSearchDoNotSearchPageSize = 0;
+
+@interface SPSearch : NSObject {
+@private
+ SPSession *session;
+ sp_search *activeSearch;
+
+ NSArray *tracks;
+ NSArray *artists;
+ NSArray *albums;
+ BOOL loaded;
+ NSString *searchQuery;
+ NSString *suggestedSearchQuery;
+ NSURL *spotifyURL;
+
+ NSError *searchError;
+
+ BOOL hasExhaustedTrackResults;
+ BOOL hasExhaustedArtistResults;
+ BOOL hasExhaustedAlbumResults;
+ NSInteger requestedTrackResults;
+ NSInteger requestedArtistResults;
+ NSInteger requestedAlbumResults;
+ NSInteger pageSize;
+}
+
+///----------------------------
+/// @name Creating and Initializing Searches
+///----------------------------
+
+/** Creates a new SPSearch with the default page size from the given Spotify search URL.
+
+ This convenience method is simply returns a new, autoreleased SPSearch
+ object. No caching is performed.
+
+ @warning *Important:* If you pass in an invalid search URL (i.e., any URL not
+ starting `spotify:search:`, this method will return `nil`.
+
+ @warning *Important:* The search query will be sent to the Spotify search service
+ immediately. Be sure you want to perform the search before creating the object!
+
+ @param searchURL The search URL to create an SPSearch for.
+ @param aSession The SPSession the track should exist in.
+ @return Returns the created SPSearch object.
+ */
++(SPSearch *)searchWithURL:(NSURL *)searchURL inSession:(SPSession *)aSession;
+
+/** Creates a new SPSearch with the default page size for the given query.
+
+ This convenience method is simply returns a new, autoreleased SPSearch
+ object. No caching is performed.
+
+ @warning *Important:* The search query will be sent to the Spotify search service
+ immediately. Be sure you want to perform the search before creating the object!
+
+ @param searchQuery The search query to create an SPSearch for.
+ @param aSession The SPSession the track should exist in.
+ @return Returns the created SPSearch object.
+ */
++(SPSearch *)searchWithSearchQuery:(NSString *)searchQuery inSession:(SPSession *)aSession;
+
+/** Initializes a new SPSearch with the default page size from the given Spotify search URL.
+
+ @warning *Important:* If you pass in an invalid search URL (i.e., any URL not
+ starting `spotify:search:`, this method will return `nil`.
+
+ @param searchURL The search URL to create an SPSearch for.
+ @param aSession The SPSession the track should exist in.
+ @return Returns the created SPSearch object.
+ */
+-(id)initWithURL:(NSURL *)searchURL
+ inSession:(SPSession *)aSession;
+
+/** Initializes a new SPSearch from the given Spotify search URL.
+
+ @warning *Important:* If you pass in an invalid search URL (i.e., any URL not
+ starting `spotify:search:`, this method will return `nil`.
+
+ @warning *Important:* The search query will be sent to the Spotify search service
+ immediately. Be sure you want to perform the search before creating the object!
+
+ @param searchURL The search URL to create an SPSearch for.
+ @param size The number of results to request per page of results.
+ @param aSession The SPSession the track should exist in.
+ @return Returns the created SPSearch object.
+ */
+-(id)initWithURL:(NSURL *)searchURL
+ pageSize:(NSInteger)size
+ inSession:(SPSession *)aSession;
+
+/** Initializes a new SPSearch with the default page size for the given query.
+
+ @warning *Important:* The search query will be sent to the Spotify search service
+ immediately. Be sure you want to perform the search before creating the object!
+
+ @param searchString The search query to create an SPSearch for.
+ @param aSession The SPSession the track should exist in.
+ @return Returns the created SPSearch object.
+ */
+-(id)initWithSearchQuery:(NSString *)searchString
+ inSession:(SPSession *)aSession;
+
+/** Initializes a new SPSearch for the given query.
+
+ @warning *Important:* The search query will be sent to the Spotify search service
+ immediately. Be sure you want to perform the search before creating the object!
+
+ @param searchString The search query to create an SPSearch for.
+ @param size The number of results to request per page of results.
+ @param aSession The SPSession the track should exist in.
+ @return Returns the created SPSearch object.
+ */
+-(id)initWithSearchQuery:(NSString *)searchString
+ pageSize:(NSInteger)size
+ inSession:(SPSession *)aSession;
+
+///----------------------------
+/// @name Requesting More Results
+///----------------------------
+
+/** Request an extra page of albums from the Spotify search service.
+
+ The albums property will be updated when new results are returned.
+
+ @warning *Important:* If you want to request more than just albums, use
+ `-addPageForArtists:albums:tracks:` for better performance.
+
+ @return Returns `YES` if a search request was created, `NO` if there are no more results to fetch
+ or if a search is already in progress.
+ */
+-(BOOL)addAlbumPage;
+
+/** Request an extra page of artists from the Spotify search service.
+
+ The artists property will be updated when new results are returned.
+
+ @warning *Important:* If you want to request more than just artists, use
+ `-addPageForArtists:albums:tracks:` for better performance.
+
+ @return Returns `YES` if a search request was created, `NO` if there are no more results to fetch
+ or if a search is already in progress.
+ */
+-(BOOL)addArtistPage;
+
+/** Request an extra page of tracks from the Spotify search service.
+
+ The tracks property will be updated when new results are returned.
+
+ @warning *Important:* If you want to request more than just tracks, use
+ `-addPageForArtists:albums:tracks:` for better performance.
+
+ @return Returns `YES` if a search request was created, `NO` if there are no more results to fetch
+ or if a search is already in progress.
+ */
+-(BOOL)addTrackPage;
+
+/** Request an extra page of tracks, albums and tracks from the Spotify search service.
+
+ The albums, artists and tracks properties will be updated as appropriate when new results are returned.
+
+ @param searchArtist Set to `YES` to request more artist results.
+ @param searchAlbum Set to `YES` to request more album results.
+ @param searchTrack Set to `YES` to request more track results.
+ @return Returns `YES` if a search request was created, `NO` if there are no more results to fetch
+ or if a search is already in progress.
+ */
+-(BOOL)addPageForArtists:(BOOL)searchArtist albums:(BOOL)searchAlbum tracks:(BOOL)searchTrack;
+
+///----------------------------
+/// @name Results
+///----------------------------
+
+/** Returns a "suggested" search query provided by the search service, or `nil` if the search has not loaded or there is no suggested query.
+
+ This can be presented to the user as a "did you mean?" suggestion.
+ */
+@property (nonatomic, readonly, copy) NSString *suggestedSearchQuery;
+
+/** Returns `YES` if the search service has indicated there are no more album results to find. */
+@property (nonatomic, readonly) BOOL hasExhaustedAlbumResults;
+
+/** Returns `YES` if the search service has indicated there are no more artist results to find. */
+@property (nonatomic, readonly) BOOL hasExhaustedArtistResults;
+
+/** Returns `YES` if the search service has indicated there are no more track results to find. */
+@property (nonatomic, readonly) BOOL hasExhaustedTrackResults;
+
+/** Returns the album results of the search, or `nil` if the search has not loaded or there are no album results. */
+@property (nonatomic, readonly, retain) NSArray *albums;
+
+/** Returns the artist results of the search, or `nil` if the search has not loaded or there are no artist results. */
+@property (nonatomic, readonly, retain) NSArray *artists;
+
+/** Returns the track results of the search, or `nil` if the search has not loaded or there are no track results. */
+@property (nonatomic, readonly, retain) NSArray *tracks;
+
+///----------------------------
+/// @name Properties
+///----------------------------
+
+/** Returns an NSError indicating the search failure reason, or `nil` if there was no error. */
+@property (nonatomic, readonly, copy) NSError *searchError;
+
+/** Returns `YES` if a search is currently in progress, or `NO` if the search is complete (or has failed). */
+@property (nonatomic, readonly) BOOL searchInProgress;
+
+/** Returns the search query for this search. */
+@property (nonatomic, readonly, copy) NSString *searchQuery;
+
+/** Returns the session the search is being performed in. */
+@property (nonatomic, readonly, retain) SPSession *session;
+
+/** Returns the Spotify URI of the search, for example: `spotify:search:rick+astley` */
+@property (nonatomic, readonly, copy) NSURL *spotifyURL;
+
+@end
View
689 CocoaLibSpotify.framework/Versions/A/Headers/SPSession.h
@@ -0,0 +1,689 @@
+//
+// SPSession.h
+// CocoaLibSpotify
+//
+// Created by Daniel Kennett on 2/14/11.
+/*
+Copyright (c) 2011, Spotify AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Spotify AB nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL SPOTIFY AB BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/** This class provides core functionality for interacting with Spotify. You must have a valid, logged-in
+ SPSession object before using any other part of the API.
+
+ To log in and use CocoaLibSpotify, you need two things:
+
+ - An application key, available at the [Spotify Developers Site](http://developer.spotify.com/).
+ - A user account with the Premium subscription level.
+
+Playback
+
+ Please note that CocoaLibSpotify does _not_ push audio data to the system's audio
+ output. To hear tracks, you need to push the raw audio data provided to your application
+ as you see fit. See the SimplePlayback sample project for an example of how to do this.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CocoaLibSpotifyPlatformImports.h"
+
+@class SPPlaylist;
+@class SPPlaylistFolder;
+@class SPPlaylistContainer;
+@class SPTrack;
+@class SPUser;
+@class SPSearch;
+@class SPAlbum;
+@class SPArtist;
+@class SPImage;
+@class SPPostTracksToInboxOperation;
+@class SPUnknownPlaylist;
+@protocol SPSessionDelegate;
+@protocol SPSessionPlaybackDelegate;
+@protocol SPSessionAudioDeliveryDelegate;
+@protocol SPPostTracksToInboxOperationDelegate;
+@protocol SPSessionPlaybackProvider;
+
+@interface SPSession : NSObject <SPSessionPlaybackProvider> {
+ @private
+ sp_session *session;
+ BOOL playing;
+ SPPlaylist *inboxPlaylist;
+ SPPlaylist *starredPlaylist;
+ SPPlaylistContainer *userPlaylists;
+ NSMutableDictionary *trackCache;
+ NSMutableDictionary *userCache;
+ NSMutableDictionary *playlistCache;
+ __weak id <SPSessionDelegate> delegate;
+ __weak id <SPSessionPlaybackDelegate> playbackDelegate;
+ __weak id <SPSessionAudioDeliveryDelegate> audioDeliveryDelegate;
+ SPUser *user;
+ NSLocale *locale;
+ NSError *offlineSyncError;
+ NSString *userAgent;
+ sp_connectionstate _connectionState;
+ NSDictionary *offlineStatistics;
+ NSUInteger offlinePlaylistsRemaining;
+ NSUInteger offlineTracksRemaining;
+ BOOL offlineSyncing;
+ NSSet *loadingObjects;
+}
+
+/** Returns a shared SPSession object.
+
+ This is a convenience method for creating and storing a single SPSession instance.
+
+ @warning *Important:* The C API that CocoaLibSpotify uses (LibSpotify) doesn't
+ support using multiple sessions in the same process. While you can either create and
+ store your SPSession object using this convenience method or yourself using -[SPSession init],
+ make sure you only have _one_ instance of SPSession active in your process at a time.
+
+ @warning *Important:* This will return `nil` until +[SPSession initializeSharedSessionWithApplicationKey:userAgent:error:] is
+ successfully called.
+
+
+ */
++(SPSession *)sharedSession;
+
+/** Initializes the shared SPSession object.
+
+ Your application key and user agent must be valid to create an SPSession object.
+
+ @warning *Important:* The C API that CocoaLibSpotify uses (LibSpotify) doesn't
+ support using multiple sessions in the same process. While you can either create and
+ store your SPSession object using this convenience method or yourself using -[SPSession initWithApplicationKey:userAgent:error:],
+ make sure you only have _one_ instance of SPSession active in your process at a time.
+
+ @param appKey Your application key as an NSData.
+ @param userAgent Your application's user agent (for example, com.yourcompany.MyGreatApp).
+ @param error An error pointer to be filled with an NSError should a login problem occur.
+ */
++(void)initializeSharedSessionWithApplicationKey:(NSData *)appKey
+ userAgent:(NSString *)userAgent
+ error:(NSError **)error;
+
+/** The "debug" build ID of libspotify.
+
+ This could be useful to display somewhere deep down in the user interface in
+ case you (or Spotify) would like to know the exact version running.
+
+ @return Returns an NSString representing the build ID of the currently running version of libspotify.
+ */
++(NSString *)libSpotifyBuildId;
+
+///----------------------------
+/// @name Logging In and Setup
+///----------------------------
+
+/** Initialize a new SPSession object.
+
+ Your application key and user agent must be valid to create an SPSession object. This is SPSession's designated initializer.
+
+@param appKey Your application key as an NSData.
+@param userAgent Your application's user agent (for example, com.yourcompany.MyGreatApp).
+@param error An error pointer to be filled with an NSError should a login problem occur.
+@return Returns a newly initialised SPSession object.
+ */
+-(id)initWithApplicationKey:(NSData *)appKey
+ userAgent:(NSString *)userAgent
+ error:(NSError **)error;
+
+/** Attempt to login to the Spotify service.
+
+ Login success or fail methods will be called on the session's delegate.
+
+@warning *Important:* You must have successfully logged in to the Spotify service before using
+ most other API methods.
+
+ @param userName The username of the user who wishes to log in.
+ @param password The password for the user who wishes to log in.
+ @param rememberMe `YES` if the user's credentials should be saved in libspotify's encrypted store, otherwise `NO`.
+ */
+-(void)attemptLoginWithUserName:(NSString *)userName
+ password:(NSString *)password
+ rememberCredentials:(BOOL)rememberMe;
+
+/** Attempt to login to the Spotify service using previously stored credentials.
+
+ Login success or fail methods will be called on the session's delegate.
+
+ @param error An error pointer to be filled with an NSError should a login problem occur.
+ @return Returns `YES` if user credentials had been stored and the login attempt began successfully.
+ */
+-(BOOL)attemptLoginWithStoredCredentials:(NSError **)error;
+
+/** The username saved in the stored credentials.
+
+ @return Returns the username that will be logged in with -[SPSession attemptLoginWithStoredCredentials:], or
+ `nil` if there are no stored credentials.
+ */
+-(NSString *)storedCredentialsUserName;
+
+/** Remove stored credentials from the encrypted store.
+
+ This method will cleanly log out from the Spotify service and clear any in-memory caches.
+ Called automatically when the instance is deallocated.
+ */
+-(void)forgetStoredCredentials;
+
+/** Log out from the Spotify service.
+
+ This method will cleanly log out from the Spotify service and clear any in-memory caches.
+ Called automatically when the instance is deallocated.
+ */
+-(void)logout;
+
+/** Returns the current connection state.
+
+ Possible values:
+
+ SP_CONNECTION_STATE_LOGGED_OUT
+ User not yet logged in.
+
+ SP_CONNECTION_STATE_OFFLINE
+ User is logged in but in offline mode.
+
+ SP_CONNECTION_STATE_LOGGED_IN
+ Logged in against a Spotify access point.
+
+ SP_CONNECTION_STATE_DISCONNECTED
+ Was logged in, but has now been disconnected.
+
+ SP_CONNECTION_STATE_UNDEFINED
+ The connection state is undefined.
+ */
+@property (nonatomic, readonly) sp_connectionstate connectionState;
+
+/** Set the maximum cache size, in megabytes.
+
+ Set to 0 (the default) to automatically manage the cache, using at most 10% of the free disk space.
+
+ @param maximumCacheSizeMB The maxiumum cache size, in MB, or 0 to automatically manage disk space.
+ */
+-(void)setMaximumCacheSizeMB:(size_t)maximumCacheSizeMB;
+
+/** Set the preferred audio bitrate for playback.
+
+ The default is to play the highest quality stream available.
+
+ @param bitrate The preferred bitrate for streaming.
+ */
+-(void)setPreferredBitrate:(sp_bitrate)bitrate;
+
+///----------------------------
+/// @name Properties
+///----------------------------
+
+/** Returns the current delegate object. */
+@property (nonatomic) __weak id <SPSessionDelegate> delegate;
+
+/** Returns the opaque structure used by the C LibSpotify API.
+
+ @warning *Important:* This should only be used if you plan to directly use the
+ C LibSpotify API. The behaviour of CocoaLibSpotify is undefined if you use the C
+ API directly on items that have CocoaLibSpotify objects associated with them.
+ */
+@property (nonatomic, readonly) sp_session *session;
+
+/** Returns the user agent value the session was initialized with. */
+@property (nonatomic, copy, readonly) NSString *userAgent;
+
+///----------------------------
+/// @name Offline Syncing
+///----------------------------
+
+/** Returns `YES` if tracks are currently being downloaded for offline playback, otherwise `NO`. */
+@property (nonatomic, readonly, getter=isOfflineSyncing) BOOL offlineSyncing;
+
+/** Returns the number of tracks still waiting to be downloaded for offline playback. */
+@property (nonatomic, readonly) NSUInteger offlineTracksRemaining;
+
+/** Returns the number of playlists still waiting to be downloaded for offline playback. */
+@property (nonatomic, readonly) NSUInteger offlinePlaylistsRemaining;
+
+/** Returns a dictionary containing information about any offline sync activity. See Contants for keys. */
+@property (nonatomic, readonly, copy) NSDictionary *offlineStatistics;
+
+/** Returns the time until the user needs to reconnect to Spotify to renew offline syncing keys. */
+@property (nonatomic, readonly) NSTimeInterval offlineKeyTimeRemaining;
+
+/** Returns the last error encountered during offline syncing, or `nil` if there is no problem. */
+@property (nonatomic, readonly, retain) NSError *offlineSyncError;
+
+///----------------------------
+/// @name User Content
+///----------------------------
+
+/** Returns the logged in user's inbox playlist.
+
+ The inbox playlist contains tracks sent to the user by other Spotify users, and is
+ updated as new tracks are sent to the user.
+ */
+@property (nonatomic, readonly, retain) SPPlaylist *inboxPlaylist;
+
+/** Returns the locale of the logged-in user. */
+@property (nonatomic, readonly, retain) NSLocale *locale;
+
+/** Returns the logged in user's starred playlist.
+
+ The starred playlist contains tracks starred by the user, and is updated as new tracks are
+ starred or unstarred.
+ */
+@property (nonatomic, readonly, retain) SPPlaylist *starredPlaylist;
+
+/** Returns the current logged in user. */
+@property (nonatomic, readonly, retain) SPUser *user;
+
+/** Returns an SPPlaylistContainer object that contains the user's playlists.
+
+ @see SPPlaylistContainer
+ */
+@property (nonatomic, readonly, retain) SPPlaylistContainer *userPlaylists;
+
+/** Send tracks to another Spotify user.
+
+ @warning *Important:* Tracks will be posted to the given user as soon as this
+ method is called. Be sure you want to post the tracks before doing so!
+
+ @param tracks An array of SPTrack objects to send.
+ @param targetUserName The username of the user to send the tracks to.
+ @param aFriendlyMessage The message to send with the tracks, if any.
+ @param operationDelegate The delegate to send success/failure messages to.
+ @return Returns an SPPostTracksToInboxOperation object representing the operation.
+ @see SPPostTracksToInboxOperation
+ @see SPPostTracksToInboxOperationDelegate
+ */
+-(SPPostTracksToInboxOperation *)postTracks:(NSArray *)tracks
+ toInboxOfUser:(NSString *)targetUserName
+ withMessage:(NSString *)aFriendlyMessage
+ delegate:(id <SPPostTracksToInboxOperationDelegate>)operationDelegate;
+
+///----------------------------
+/// @name Accessing Content by URL
+///----------------------------
+
+/** Returns an SPAlbum object representing the given URL, or `nil` if the URL is not a valid album URL.