Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Commit

Permalink
Merge branch 'pr/255'
Browse files Browse the repository at this point in the history
* pr/255:
  Attend to various warnings
  High CPU Fix
  Various Fixes
  • Loading branch information
kbhomes committed Dec 6, 2014
2 parents 97c5d30 + 427c02d commit a23b0c2
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 30 deletions.
2 changes: 1 addition & 1 deletion radiant-player-mac/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
}

// Determine whether the player is using thumbs or stars.
isStarsRatingSystem = [[webView windowScriptObject] evaluateWebScript:@"MusicAPI.Rating.isStarsRatingSystem()"] == YES;
isStarsRatingSystem = (int)[[webView windowScriptObject] evaluateWebScript:@"MusicAPI.Rating.isStarsRatingSystem()"] == YES;

[self setupRatingMenuItems];
}
Expand Down
1 change: 0 additions & 1 deletion radiant-player-mac/LastFm/LastFmService.m
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ - (void)fetchTrackLovedStatus:(NSString *)track artist:(NSString *)artist sender

- (void)openRecentTracksPage:(id)sender
{
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
NSString *username = [[[LastFm sharedInstance] username] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *page = [NSString stringWithFormat:@"http://www.last.fm/user/%@", username];
NSURL *url = [NSURL URLWithString:page];
Expand Down
4 changes: 2 additions & 2 deletions radiant-player-mac/Popup/PlaybackSliderCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ - (void)drawKnob:(NSRect)knobRect
NSPoint curPoint = NSMakePoint(aRect.origin.x, aRect.origin.y + 3);
NSInteger curMinutes = ((self.integerValue / 1000) / 60);
NSInteger curSeconds = ((self.integerValue / 1000) % 60);
NSAttributedString *curTime = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d:%02d", curMinutes, curSeconds]
NSAttributedString *curTime = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%ld:%02ld", (long)curMinutes, (long)curSeconds]
attributes:attributes];

[[NSColor orangeColor] set];
Expand All @@ -109,7 +109,7 @@ - (void)drawKnob:(NSRect)knobRect
NSPoint totalPoint = NSMakePoint(aRect.size.width, aRect.origin.y + 3);
NSInteger totalMinutes = ((int)(self.maxValue / 1000) / 60);
NSInteger totalSeconds = ((int)(self.maxValue / 1000) % 60);
NSAttributedString *totalTime = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d:%02d", totalMinutes, totalSeconds]
NSAttributedString *totalTime = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%ld:%02ld", (long)totalMinutes, (long)totalSeconds]
attributes:attributes];

[[NSColor grayColor] set];
Expand Down
6 changes: 1 addition & 5 deletions radiant-player-mac/Popup/PopupPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ - (void)closeAndNotify:(BOOL)notify
[[NSAnimationContext currentContext] setDuration:.15];
[[self animator] setAlphaValue:0];
[NSAnimationContext endGrouping];

dispatch_after(dispatch_walltime(NULL, NSEC_PER_SEC * .15 * 2), dispatch_get_main_queue(), ^{

[self orderOut:nil];
});

}

@end
1 change: 0 additions & 1 deletion radiant-player-mac/Popup/PopupStatusView.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

- (void)setupStatusItem;
- (void)update;
- (id)button;
- (NSRect)buttonFrame;
- (NSView *)buttonView;
- (NSImage *)buttonImage;
Expand Down
2 changes: 1 addition & 1 deletion radiant-player-mac/Popup/RatingBadgeButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ -(void)awakeFromNib
*/

NSTrackingArea *boxArea = [[NSTrackingArea alloc]
initWithRect:[self convertRectFromBase:box]
initWithRect:[self convertRectFromBacking:box]
options:NSTrackingMouseEnteredAndExited|NSTrackingActiveAlways
owner:self
userInfo:@{@"badge": [NSNumber numberWithBool:NO]}];
Expand Down
1 change: 1 addition & 0 deletions radiant-player-mac/WebView/CookieStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@interface CookieStorage : NSObject {
NSMutableArray *_storage;
NSString *_storagePath;
NSHTTPCookieAcceptPolicy _policy;
}

+ (CookieStorage *)instance;
Expand Down
11 changes: 11 additions & 0 deletions radiant-player-mac/WebView/CookieStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ - (id)init
if (self) {
_storage = [NSMutableArray array];
_storagePath = [CookieStorage defaultCookieStoragePath];
_policy = NSHTTPCookieAcceptPolicyAlways;

[self unarchive];
}
Expand All @@ -44,6 +45,16 @@ - (void)deleteCookie:(NSHTTPCookie *)cookie
[_storage removeObject:cookie];
}

- (NSHTTPCookieAcceptPolicy)cookieAcceptPolicy
{
return _policy;
}

- (void)setCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)policy
{
_policy = policy;
}

- (void)setCookie:(NSHTTPCookie *)cookie
{
NSString *domain = [[cookie domain] lowercaseString];
Expand Down
2 changes: 0 additions & 2 deletions radiant-player-mac/WebView/CustomWebView.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,4 @@

@property (retain) NSData *invertedSpriteSheet;

- (IBAction)selectAll:(id)sender;

@end
9 changes: 5 additions & 4 deletions radiant-player-mac/WebView/SpriteDownloadURLProtocol.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ + (BOOL) canInitWithRequest:(NSURLRequest*)request
return NO;
}

- (id) initWithRequest:(NSURLRequest*)theRequest cachedResponse:(NSCachedURLResponse*)cachedResponse client:(id<NSURLProtocolClient>)client
- (id) initWithRequest:(NSURLRequest *)theRequest cachedResponse:(NSCachedURLResponse *)cachedResponse client:(id<NSURLProtocolClient>)client
{
// Move the delegate from the request to this instance
NSMutableURLRequest* req = (NSMutableURLRequest*)theRequest;
Expand Down Expand Up @@ -56,17 +56,17 @@ - (void) stopLoading

- (void)connection:(NSURLConnection*)conn didReceiveResponse:(NSURLResponse*)response
{
[[self client] URLProtocol:self didReceiveResponse:response cacheStoragePolicy:[[self request] cachePolicy]];
[[self client] URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed];
[_data setLength:0];
}

- (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
[[self client] URLProtocol:self didLoadData:data];
[_data appendData:data];
}

- (void)connectionDidFinishLoading:(NSURLConnection*)conn
- (void)connectionDidFinishLoading:(NSURLConnection *)conn
{
[[self client] URLProtocolDidFinishLoading:self];

Expand All @@ -83,6 +83,7 @@ - (void)connectionDidFinishLoading:(NSURLConnection*)conn
CGImageDestinationRef dest = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)(data), kUTTypePNG, 1, NULL);
CGImageDestinationAddImage(dest, cgimage, NULL);
CGImageDestinationFinalize(dest);
CGImageRelease(cgimage);
CFRelease(dest);

// Forward the response to your delegate however you like
Expand Down
10 changes: 9 additions & 1 deletion radiant-player-mac/css/cocoa.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@

.song-row .rating-container.stars {
height: 100% !important;
margin-top: 0px !important;
line-height: 50%;
}

.song-row .rating-container.thumbs [data-rating] {
Expand Down Expand Up @@ -242,6 +242,14 @@
margin: 0;
}

#playerSongInfo {
overflow: hidden;
}

#playerSongInfo .text-wrapper #playerSongTitle {
margin-right: 110px;
}

#player .flat-button, #player .flat-button:hover, #player .flat-button:active {
background-color: transparent !important;
}
Expand Down
10 changes: 9 additions & 1 deletion radiant-player-mac/css/dark-flat.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ a, .simple-dialog a {

.song-row .rating-container.stars {
height: 100% !important;
margin-top: 0px !important;
line-height: 50%;
}

.song-row .rating-container.thumbs [data-rating] {
Expand Down Expand Up @@ -269,6 +269,14 @@ a, .simple-dialog a {
margin: 0;
}

#playerSongInfo {
overflow: hidden;
}

#playerSongInfo .text-wrapper #playerSongTitle {
margin-right: 110px;
}

#player .flat-button, #player .flat-button:hover, #player .flat-button:active {
background-color: transparent !important;
}
Expand Down
10 changes: 9 additions & 1 deletion radiant-player-mac/css/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ a, .simple-dialog a {

.song-row .rating-container.stars {
height: 100% !important;
margin-top: 0px !important;
line-height: 50%;
}

.song-row .rating-container.thumbs [data-rating] {
Expand Down Expand Up @@ -280,6 +280,14 @@ a, .simple-dialog a {
margin: 0;
}

#playerSongInfo {
overflow: hidden;
}

#playerSongInfo .text-wrapper #playerSongTitle {
margin-right: 110px;
}

#player .flat-button, #player .flat-button:hover, #player .flat-button:active {
background-color: transparent !important;
}
Expand Down
2 changes: 1 addition & 1 deletion radiant-player-mac/css/navigation.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* css/cocoa.css
* css/navigation.css
*
* Custom stylesheet that handles the back and forward buttons.
*
Expand Down
14 changes: 11 additions & 3 deletions radiant-player-mac/css/spotify-black.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@ a, .simple-dialog a {

.song-row .rating-container.stars {
height: 100% !important;
margin-top: -1px !important;
line-height: 50%;
}

.song-row .rating-container.thumbs [data-rating] {
margin-top: 6px;
margin-top: 0px;
}

.song-row .hover-button[data-id="menu"], .song-row .hover-button[data-id="menu"]:hover {
margin-top: 8px;
margin: 1px 0 0 0;
border: none;
border-radius: 0;
}
Expand Down Expand Up @@ -323,6 +323,14 @@ a, .simple-dialog a {
margin: 0;
}

#playerSongInfo {
overflow: hidden;
}

#playerSongInfo .text-wrapper #playerSongTitle {
margin-right: 110px;
}

#player .flat-button, #player .flat-button:hover, #player .flat-button:active {
background-color: transparent !important;
}
Expand Down
10 changes: 9 additions & 1 deletion radiant-player-mac/css/yosemite.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ body {

.song-row .rating-container.stars {
height: 100% !important;
margin-top: 0px !important;
line-height: 50%;
}

.song-row .rating-container.thumbs [data-rating] {
Expand Down Expand Up @@ -256,6 +256,14 @@ body {
margin: 0;
}

#playerSongInfo {
overflow: hidden;
}

#playerSongInfo .text-wrapper #playerSongTitle {
margin-right: 110px;
}

#player .flat-button, #player .flat-button:hover, #player .flat-button:active {
background-color: transparent !important;
}
Expand Down
5 changes: 0 additions & 5 deletions radiant-player-mac/en.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@
<action selector="delete:" target="-1" id="235"/>
</connections>
</menuItem>
<menuItem title="Select All" keyEquivalent="a" id="hIO-3X-3Jm">
<connections>
<action selector="selectAll:" target="536" id="Wge-u1-feB"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="206">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
Expand Down

0 comments on commit a23b0c2

Please sign in to comment.