Made the SBQueueActions NSCoding compliant.
This commit is contained in:
1 parent
6f71dd9e67
commit
e71c5a93cd
2 files changed
+59
-1
No files matched your search
@@ -11,7 +11,7 @@
|
||||
@class SBQueueItem;
|
||||
@class MP42Metadata;
|
||||
|
||||
@protocol SBQueueActionProtocol <NSObject>
|
||||
@protocol SBQueueActionProtocol <NSObject, NSCoding>
|
||||
- (void)runAction:(SBQueueItem *)item;
|
||||
@end
|
||||
|
||||
|
||||
@@ -61,6 +61,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
return @"Load Subtitles";
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)coder {
|
||||
self = [super init];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)coder {
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation SBQueueMetadataAction
|
||||
@@ -144,6 +156,18 @@
|
||||
[[item.mp4File metadata] mergeMetadata:metadata];
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
return @"Search Metadata";
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)coder {
|
||||
self = [super init];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)coder {
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation SBQueueSetAction
|
||||
@@ -160,6 +184,27 @@
|
||||
[item.mp4File.metadata mergeMetadata:_set];
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:@"Apply %@ Set", _set.presetName];
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)coder {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_set = [[coder decodeObjectForKey:@"SBQueueActionSet"] retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)coder {
|
||||
[coder encodeObject:_set forKey:@"SBQueueActionSet"];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_set release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation SBQueueOrganizeGroupsAction
|
||||
@@ -168,4 +213,17 @@
|
||||
[item.mp4File organizeAlternateGroups];
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
return @"Organize Groups";
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)coder {
|
||||
self = [super init];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)coder {
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user