Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (49 sloc) 1.62 KB
/*
* MPDclient - Music Player Daemon (MPD) remote for Mac OS
* Copyright (C) 2019 Old-Geek
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#import "AlbumBigCover.h"
@implementation AlbumBigCover
NSURL *urlCover;
NSData *ndata;
NSImage *image;
- (id)initWithURL:(NSURL *)url {
if (self = [super initWithWindowNibName:@"AlbumBigCover"]) {
urlCover = url;
}
return self;
}
- (void)awakeFromNib {
[self.windowBigCover makeKeyAndOrderFront:nil];
[self.windowBigCover setLevel:NSFloatingWindowLevel];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
ndata = [[NSData alloc]initWithContentsOfURL:urlCover];
image = [[NSImage alloc] initWithData:ndata];
image = [image squareResize:bigcoversize];
dispatch_sync(dispatch_get_main_queue(), ^{
self->cover.image = image;
});
});
}
- (IBAction)close:(id)sender {
urlCover = nil;
ndata = nil;
image = nil;
cover.image = nil;
[self.windowBigCover close];
}
@end
You can’t perform that action at this time.