diff options
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/hb.c | 25 | ||||
-rw-r--r-- | libhb/hb.h | 3 |
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. */ |