Compare commits
No commits in common. "d4fec5c70e09e34cd7404d052ebc3255d8a63d3c" and "9055bc45f35a71951cd793f3a01092dfc14a8bca" have entirely different histories.
d4fec5c70e
...
9055bc45f3
3 changed files with 8 additions and 26 deletions
|
@ -363,7 +363,6 @@ static void * kDSPRubberbandNodeContext = &kDSPRubberbandNodeContext;
|
||||||
|
|
||||||
- (void)setEndOfStream:(BOOL)e {
|
- (void)setEndOfStream:(BOOL)e {
|
||||||
if(endOfStream && !e) {
|
if(endOfStream && !e) {
|
||||||
while(processEntered);
|
|
||||||
[self fullShutdown];
|
[self fullShutdown];
|
||||||
}
|
}
|
||||||
[super setEndOfStream:e];
|
[super setEndOfStream:e];
|
||||||
|
|
|
@ -21,16 +21,6 @@ extern NSMutableDictionary<NSString *, AlbumArtwork *> *kArtworkDictionary;
|
||||||
|
|
||||||
@implementation PlaylistEntry (Extension)
|
@implementation PlaylistEntry (Extension)
|
||||||
|
|
||||||
// The following is needed for handling any tag names with periods in them, as KVE wants to treat these as nested objects
|
|
||||||
// Let's hack in U+2024 and hope nobody notices!
|
|
||||||
+ (NSString *)keyForMetaTag:(NSString *)tagName {
|
|
||||||
return [tagName stringByReplacingOccurrencesOfString:@"." withString:@"․"];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (NSString *)metaTagForKey:(NSString *)key {
|
|
||||||
return [key stringByReplacingOccurrencesOfString:@"․" withString:@"."];
|
|
||||||
}
|
|
||||||
|
|
||||||
// The following read-only keys depend on the values of other properties
|
// The following read-only keys depend on the values of other properties
|
||||||
|
|
||||||
+ (NSSet *)keyPathsForValuesAffectingUrl {
|
+ (NSSet *)keyPathsForValuesAffectingUrl {
|
||||||
|
@ -533,8 +523,7 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
||||||
}
|
}
|
||||||
self.volume = 1;
|
self.volume = 1;
|
||||||
for(NSString *key in metadata) {
|
for(NSString *key in metadata) {
|
||||||
NSString *tagName = [PlaylistEntry metaTagForKey:key];
|
NSString *lowerKey = [key lowercaseString];
|
||||||
NSString *lowerKey = [tagName lowercaseString];
|
|
||||||
id valueObj = [metadata objectForKey:key];
|
id valueObj = [metadata objectForKey:key];
|
||||||
NSArray *values = nil;
|
NSArray *values = nil;
|
||||||
NSString *firstValue = nil;
|
NSString *firstValue = nil;
|
||||||
|
@ -593,7 +582,7 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
||||||
} else if([lowerKey isEqualToString:@"albumart"]) {
|
} else if([lowerKey isEqualToString:@"albumart"]) {
|
||||||
self.albumArt = dataValue;
|
self.albumArt = dataValue;
|
||||||
} else {
|
} else {
|
||||||
[metaDict setObject:values forKey:key];
|
[metaDict setObject:values forKey:lowerKey];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.metadataBlob = [NSDictionary dictionaryWithDictionary:metaDict];
|
self.metadataBlob = [NSDictionary dictionaryWithDictionary:metaDict];
|
||||||
|
@ -873,9 +862,8 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
||||||
|
|
||||||
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
|
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
|
||||||
NSDictionary *metaDict = (NSDictionary *)metaObj;
|
NSDictionary *metaDict = (NSDictionary *)metaObj;
|
||||||
NSString *realKey = [PlaylistEntry keyForMetaTag:tagName];
|
|
||||||
|
|
||||||
NSArray *values = [metaDict objectForKey:realKey];
|
NSArray *values = [metaDict objectForKey:tagName];
|
||||||
|
|
||||||
if(values) {
|
if(values) {
|
||||||
return [values componentsJoinedByString:@", "];
|
return [values componentsJoinedByString:@", "];
|
||||||
|
@ -895,9 +883,8 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
||||||
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
|
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
|
||||||
NSDictionary *metaDict = (NSDictionary *)metaObj;
|
NSDictionary *metaDict = (NSDictionary *)metaObj;
|
||||||
NSMutableDictionary *metaDictCopy = [metaDict mutableCopy];
|
NSMutableDictionary *metaDictCopy = [metaDict mutableCopy];
|
||||||
NSString *realKey = [PlaylistEntry keyForMetaTag:tagName];
|
|
||||||
|
|
||||||
[metaDictCopy removeObjectForKey:realKey];
|
[metaDictCopy removeObjectForKey:tagName];
|
||||||
|
|
||||||
self.metadataBlob = [NSDictionary dictionaryWithDictionary:metaDictCopy];
|
self.metadataBlob = [NSDictionary dictionaryWithDictionary:metaDictCopy];
|
||||||
}
|
}
|
||||||
|
@ -916,9 +903,8 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
||||||
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
|
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
|
||||||
NSDictionary *metaDict = (NSDictionary *)metaObj;
|
NSDictionary *metaDict = (NSDictionary *)metaObj;
|
||||||
NSMutableDictionary *metaDictCopy = [metaDict mutableCopy];
|
NSMutableDictionary *metaDictCopy = [metaDict mutableCopy];
|
||||||
NSString *realKey = [PlaylistEntry keyForMetaTag:tagName];
|
|
||||||
|
|
||||||
[metaDictCopy setObject:values forKey:realKey];
|
[metaDictCopy setObject:values forKey:tagName];
|
||||||
|
|
||||||
self.metadataBlob = [NSDictionary dictionaryWithDictionary:metaDictCopy];
|
self.metadataBlob = [NSDictionary dictionaryWithDictionary:metaDictCopy];
|
||||||
}
|
}
|
||||||
|
@ -930,9 +916,8 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
||||||
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
|
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
|
||||||
NSDictionary *metaDict = (NSDictionary *)metaObj;
|
NSDictionary *metaDict = (NSDictionary *)metaObj;
|
||||||
NSMutableDictionary *metaDictCopy = [metaDict mutableCopy];
|
NSMutableDictionary *metaDictCopy = [metaDict mutableCopy];
|
||||||
NSString *realKey = [PlaylistEntry keyForMetaTag:tagName];
|
|
||||||
|
|
||||||
NSArray *values = [metaDictCopy objectForKey:realKey];
|
NSArray *values = [metaDictCopy objectForKey:tagName];
|
||||||
NSMutableArray *valuesCopy;
|
NSMutableArray *valuesCopy;
|
||||||
if(values) {
|
if(values) {
|
||||||
valuesCopy = [values mutableCopy];
|
valuesCopy = [values mutableCopy];
|
||||||
|
@ -941,7 +926,7 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
||||||
}
|
}
|
||||||
[valuesCopy addObject:value];
|
[valuesCopy addObject:value];
|
||||||
values = [NSArray arrayWithArray:valuesCopy];
|
values = [NSArray arrayWithArray:valuesCopy];
|
||||||
[metaDictCopy setObject:values forKey:realKey];
|
[metaDictCopy setObject:values forKey:tagName];
|
||||||
|
|
||||||
self.metadataBlob = [NSDictionary dictionaryWithDictionary:metaDictCopy];
|
self.metadataBlob = [NSDictionary dictionaryWithDictionary:metaDictCopy];
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,6 @@ static SandboxBroker *kSharedSandboxBroker = nil;
|
||||||
if(![url isFileURL]) return url;
|
if(![url isFileURL]) return url;
|
||||||
|
|
||||||
NSString *s = [url path];
|
NSString *s = [url path];
|
||||||
if(!s) return NULL; // Cool, the resource no longer exists!
|
|
||||||
|
|
||||||
NSRange fragmentRange = [s rangeOfString:@"#"
|
NSRange fragmentRange = [s rangeOfString:@"#"
|
||||||
options:NSBackwardsSearch];
|
options:NSBackwardsSearch];
|
||||||
|
@ -271,7 +270,6 @@ static inline void dispatch_async_reentrant(dispatch_queue_t queue, dispatch_blo
|
||||||
if(![fileUrl isFileURL]) return;
|
if(![fileUrl isFileURL]) return;
|
||||||
|
|
||||||
NSURL *url = [SandboxBroker urlWithoutFragment:fileUrl];
|
NSURL *url = [SandboxBroker urlWithoutFragment:fileUrl];
|
||||||
if(!url) return;
|
|
||||||
|
|
||||||
dispatch_async_reentrant(dispatch_get_main_queue(), ^{
|
dispatch_async_reentrant(dispatch_get_main_queue(), ^{
|
||||||
SandboxEntry *_entry = nil;
|
SandboxEntry *_entry = nil;
|
||||||
|
@ -424,7 +422,7 @@ static inline void dispatch_async_reentrant(dispatch_queue_t queue, dispatch_blo
|
||||||
- (const void *)beginFolderAccess:(NSURL *)fileUrl {
|
- (const void *)beginFolderAccess:(NSURL *)fileUrl {
|
||||||
if(!fileUrl) return NULL;
|
if(!fileUrl) return NULL;
|
||||||
NSURL *folderUrl = [SandboxBroker urlWithoutFragment:fileUrl];
|
NSURL *folderUrl = [SandboxBroker urlWithoutFragment:fileUrl];
|
||||||
if(!folderUrl || ![folderUrl isFileURL]) return NULL;
|
if(![folderUrl isFileURL]) return NULL;
|
||||||
|
|
||||||
__block SandboxEntry *_entry = nil;
|
__block SandboxEntry *_entry = nil;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue