summaryrefslogtreecommitdiffstats
path: root/macosx/HBCore.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2014-12-20 09:18:22 +0000
committerritsuka <[email protected]>2014-12-20 09:18:22 +0000
commit076d14467707754ec99adcdcecab3da738b81402 (patch)
treecaceecf57ecd7ef68b965082d126e7c8a9b34f68 /macosx/HBCore.m
parentcddf20e07af6fa76c9f1a44af76d39455ddf35cc (diff)
MacGui: add a "name" property to HBCore to easy debugging multiple instances. Add a missing retain to the titles property.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6616 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBCore.m')
-rw-r--r--macosx/HBCore.m18
1 files changed, 11 insertions, 7 deletions
diff --git a/macosx/HBCore.m b/macosx/HBCore.m
index d506fcb81..33edef41d 100644
--- a/macosx/HBCore.m
+++ b/macosx/HBCore.m
@@ -45,7 +45,8 @@ NSString *HBCoreMuxingNotification = @"HBCoreMuxingNotification";
/// Timer used to poll libhb for state changes.
@property (nonatomic, readwrite, retain) NSTimer *updateTimer;
-@property (nonatomic, readwrite) NSArray *titles;
+/// Current scanned titles.
+@property (nonatomic, readwrite, retain) NSArray *titles;
- (void)stateUpdateTimer:(NSTimer *)timer;
@@ -84,6 +85,7 @@ NSString *HBCoreMuxingNotification = @"HBCoreMuxingNotification";
self = [super init];
if (self)
{
+ _name = @"HBCore";
_state = HBStateIdle;
_hb_state = malloc(sizeof(struct hb_state_s));
@@ -132,23 +134,25 @@ NSString *HBCoreMuxingNotification = @"HBCoreMuxingNotification";
// The chosen path was actually on a DVD, so use the raw block
// device path instead.
- [HBUtilities writeToActivityLog: "trying to open a physical dvd at: %s", [url.path UTF8String]];
+ [HBUtilities writeToActivityLog:"%@ trying to open a physical dvd at: %s", self.name.UTF8String, url.path.UTF8String];
// Notify the user that we don't support removal of copy protection.
void *dvdcss = dlopen("libdvdcss.2.dylib", RTLD_LAZY);
if (dvdcss)
{
// libdvdcss was found so all is well
- [HBUtilities writeToActivityLog: "libdvdcss.2.dylib found for decrypting physical dvd"];
+ [HBUtilities writeToActivityLog:"%@ libdvdcss.2.dylib found for decrypting physical dvd", self.name.UTF8String];
dlclose(dvdcss);
}
else
{
// compatible libdvdcss not found
- [HBUtilities writeToActivityLog: "libdvdcss.2.dylib not found for decrypting physical dvd"];
+ [HBUtilities writeToActivityLog:"%@, libdvdcss.2.dylib not found for decrypting physical dvd", self.name.UTF8String];
if (error) {
- *error = [NSError errorWithDomain:@"HBErrorDomain" code:101 userInfo:@{ NSLocalizedDescriptionKey: @"libdvdcss.2.dylib not found for decrypting physical dvd" }];
+ *error = [NSError errorWithDomain:@"HBErrorDomain"
+ code:101
+ userInfo:@{ NSLocalizedDescriptionKey: @"libdvdcss.2.dylib not found for decrypting physical dvd" }];
}
}
}
@@ -178,13 +182,13 @@ NSString *HBCoreMuxingNotification = @"HBCoreMuxingNotification";
// which causes the default behavior of a full source scan
if (titleNum > 0)
{
- [HBUtilities writeToActivityLog: "scanning specifically for title: %d", titleNum];
+ [HBUtilities writeToActivityLog:"%s scanning specifically for title: %d", self.name.UTF8String, titleNum];
}
else
{
// minimum title duration doesn't apply to title-specific scan
// it doesn't apply to batch scan either, but we can't tell it apart from DVD & BD folders here
- [HBUtilities writeToActivityLog: "scanning titles with a duration of %d seconds or more", minTitleDuration];
+ [HBUtilities writeToActivityLog:"%s scanning titles with a duration of %d seconds or more", self.name.UTF8String, minTitleDuration];
}
hb_system_sleep_prevent(_hb_handle);