forked from uPlayer/uPlayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUPlayer.mm
More file actions
58 lines (41 loc) · 1.04 KB
/
UPlayer.mm
File metadata and controls
58 lines (41 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// UPlayer.m
// uPlayer
//
// Created by liaogang on 15/1/27.
// Copyright (c) 2015年 liaogang. All rights reserved.
//
#import "UPlayer.h"
#include "Last_fm_user.h"
#include "Last_fm_api.h"
#import "ThreadJob.h"
void initLastFm()
{
NSString *usrSessionPath = [ApplicationSupportDirectory() stringByAppendingPathComponent:@"lastFmUser.session"];
setUserProfilePath(usrSessionPath.UTF8String );
setLastFmApiKey("855aed416969f546b9dd6e1a0f6c483d");
setLastFmSecret("f87866e88029b55d2eb06de561553c8d");
// Load Last.fm session locally
authLocal(* lastFmUser() );
}
@interface UPlayer ()
@end
@implementation UPlayer
-(instancetype)init
{
self = [super init];
if (self)
{
self.document = [[PlayerDocument alloc ] init];
self.layout= [[PlayerLayout alloc] init];
self.engine= [[PlayerEngine alloc] init];
initLastFm();
}
return self;
}
@end
static UPlayer *_player ;
UPlayer *player()
{
return _player?_player:(_player=[[UPlayer alloc]init]);
}