~ubuntuone-ios-client-team/ubuntuone-ios-contacts/trunk

« back to all changes in this revision

Viewing changes to musicstreaming/utilities/Globals.m

  • Committer: Jason Foreman
  • Date: 2011-06-16 18:33:42 UTC
  • mfrom: (191.1.60 master)
  • Revision ID: jason.foreman@canonical.com-20110616183342-vl7a4804xsf0s1b5
Merging branches for v 2.0.

lp:~threeve/ubuntuone-ios-client/master
lp:~urbanape/ubuntuone-ios-client/downloader

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
//  Globals.m
 
3
//  iSub
 
4
//
 
5
//  Created by Aaron Brethorst on 5/13/11.
 
6
//  Copyright 2011 Canonical. All rights reserved.
 
7
//
 
8
 
 
9
#import "Globals.h"
 
10
 
 
11
NSURL* ApplicationDocumentsDirectory( void ) 
 
12
{
 
13
        return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
 
14
}
 
15
 
 
16
NSURL* DatabaseFile( void )
 
17
{
 
18
    NSURL* docs = ApplicationDocumentsDirectory();
 
19
    return [docs URLByAppendingPathComponent:@"music.sqlite"];
 
20
}
 
21
 
 
22
BOOL CacheContainsFile(NSString *aFilePath)
 
23
{
 
24
        return [[NSFileManager defaultManager] fileExistsAtPath:aFilePath];
 
25
}
 
26
 
 
27
NSURL* CachedMusicDirectory( void )
 
28
{
 
29
        NSURL* docs = ApplicationDocumentsDirectory();
 
30
        return [docs URLByAppendingPathComponent:@"cached_music"];
 
31
}
 
32
 
 
33
NSString* CachedMusicPathForFilename(NSString *aFileName)
 
34
{
 
35
    return [[CachedMusicDirectory() path] stringByAppendingPathComponent:aFileName];
 
36
}
 
37
 
 
38
NSURL* CachedAlbumArtDirectory( void )
 
39
{
 
40
        NSURL* docs = ApplicationDocumentsDirectory();
 
41
        return [docs URLByAppendingPathComponent:@"cached_album_art"];    
 
42
}
 
43
 
 
44
NSString* CachedAlbumArtPathForArtId(NSString *anArtId)
 
45
{
 
46
    return [[CachedAlbumArtDirectory() path] stringByAppendingPathComponent:anArtId];
 
47
}
 
48
 
 
49
NSString * const NOTIF_downloadComplete = @"DownloadComplete";
 
50
NSString * const NOTIF_removeCachedContent = @"RemoveCachedContent";
 
51
NSString * const NOTIF_reloadAccountCredentials = @"ReloadAccountCredentials";