summaryrefslogtreecommitdiffstats
path: root/macosx/HBCore.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2015-01-11 12:08:22 +0000
committerritsuka <[email protected]>2015-01-11 12:08:22 +0000
commit3ed0f39d4926cb7ca6b2430c034c1356a52f3a99 (patch)
tree09a3bb92dcb17de42f51c5e3826de6633ede011d /macosx/HBCore.m
parent30a9cd68e49438d691be9a87b829160e2eb0ab85 (diff)
MacGui: use a smaller timer internal while scanning to make the UI more responsive.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6727 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBCore.m')
-rw-r--r--macosx/HBCore.m12
1 files changed, 7 insertions, 5 deletions
diff --git a/macosx/HBCore.m b/macosx/HBCore.m
index 95c5930ee..a7156ab22 100644
--- a/macosx/HBCore.m
+++ b/macosx/HBCore.m
@@ -163,7 +163,7 @@ NSString *HBCoreMuxingNotification = @"HBCoreMuxingNotification";
- (void)scan:(NSURL *)url titleNum:(NSUInteger)titleNum previewsNum:(NSUInteger)previewsNum minTitleDuration:(NSUInteger)minTitleDuration;
{
// Start the timer to handle libhb state changes
- [self startUpdateTimer];
+ [self startUpdateTimerWithInterval:0.2];
NSString *path = url.path;
HBDVDDetector *detector = [HBDVDDetector detectorForPath:path];
@@ -296,7 +296,7 @@ NSString *HBCoreMuxingNotification = @"HBCoreMuxingNotification";
- (void)start
{
// Start the timer to handle libhb state changes
- [self startUpdateTimer];
+ [self startUpdateTimerWithInterval:0.5];
hb_system_sleep_prevent(_hb_handle);
hb_start(_hb_handle);
@@ -345,13 +345,15 @@ NSString *HBCoreMuxingNotification = @"HBCoreMuxingNotification";
#pragma mark - State updates
/**
- * Starts the timer used to polls libhb for state changes.
+ * Starts the timer used to polls libhb for state changes.
+ *
+ * @param seconds The number of seconds between firings of the timer.
*/
-- (void)startUpdateTimer
+- (void)startUpdateTimerWithInterval:(NSTimeInterval)seconds
{
if (!self.updateTimer)
{
- self.updateTimer = [NSTimer scheduledTimerWithTimeInterval:0.5
+ self.updateTimer = [NSTimer scheduledTimerWithTimeInterval:seconds
target:self
selector:@selector(stateUpdateTimer:)
userInfo:NULL