summaryrefslogtreecommitdiffstats
path: root/libhb
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
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')
-rw-r--r--libhb/hb.c25
-rw-r--r--libhb/hb.h3
2 files changed, 25 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 */
diff --git a/libhb/hb.h b/libhb/hb.h
index af9163718..f1a369055 100644
--- a/libhb/hb.h
+++ b/libhb/hb.h
@@ -94,6 +94,9 @@ void hb_stop( hb_handle_t * );
Should be regularly called by the UI (like 5 or 10 times a second).
Look at test/test.c to see how to use it. */
void hb_get_state( hb_handle_t *, hb_state_t * );
+/* hb_get_scancount() is called by the MacGui in UpdateUI to
+ check for a new scan during HB_STATE_WORKING phase */
+int hb_get_scancount( hb_handle_t * );
/* hb_close()
Aborts all current jobs if any, frees memory. */