summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
diff options
context:
space:
mode:
authordynaflash <[email protected]>2007-07-16 16:47:45 +0000
committerdynaflash <[email protected]>2007-07-16 16:47:45 +0000
commit5e8776b2f2e87120efaae2ed509bce845c5de94c (patch)
tree4195bc8359ea8737f13201d7be1982dabb4261e4 /libhb/hb.c
parentec47c624557962fe6cb38499644b40b681f324fb (diff)
MacGui: Active Queue Initial Implementation
- Warning: currently, when adding jobs during encoding, the main window progress bar and task info gets hosed, if a workaround via libhb cannot be easily obtained, a cocoa workaround is available for checkin. - Can now add jobs during encoding - Scan progress bar is a barber pole until scanning progress during encoding is fine tuned. - Needs further testing if DVD Auto Detect is turned on. If conflicts with drive arise, automatically turning off dvd auto detect when adding jobs during encoding is ready for checkin. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@695 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r--libhb/hb.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/libhb/hb.c b/libhb/hb.c
index 0b0c515af..f78700941 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -31,9 +31,13 @@ struct hb_handle_s
hb_lock_t * state_lock;
hb_state_t state;
-
+
int paused;
hb_lock_t * pause_lock;
+ /* For MacGui active queue
+ increments each time the scan thread completes*/
+ int scanCount;
+
};
hb_work_object_t * hb_objects = NULL;
@@ -123,6 +127,9 @@ hb_handle_t * hb_init_real( int verbose, int update_check )
HB_NORMAL_PRIORITY );
return h;
+
+ /* Set the scan count to start at 0 */
+ //scan_count = 0;
}
/**
@@ -751,6 +758,15 @@ void hb_get_state( hb_handle_t * h, hb_state_t * s )
}
/**
+ * Called in MacGui in UpdateUI to check
+ * for a new scan being completed to set a new source
+ */
+int hb_get_scancount( hb_handle_t * h)
+ {
+ return h->scanCount;
+ }
+
+/**
* Closes access to libhb by freeing the hb_handle_t handle ontained in hb_init_real.
* @param _h Pointer to handle to hb_handle_t.
*/
@@ -817,8 +833,11 @@ static void thread_func( void * _h )
hb_log( "libhb: scan thread found %d valid title(s)",
hb_list_count( h->list_title ) );
hb_lock( h->state_lock );
- h->state.state = HB_STATE_SCANDONE;
- hb_unlock( h->state_lock );
+ h->state.state = HB_STATE_SCANDONE; //originally state.state
+ hb_unlock( h->state_lock );
+ /*we increment this sessions scan count by one for the MacGui
+ to trigger a new source being set */
+ h->scanCount++;
}
/* Check if the work thread is done */