From f0b2ba01e43a831900ff27f9e3a481b177be647f Mon Sep 17 00:00:00 2001 From: enselic Date: Sat, 13 Sep 2008 12:52:30 +0000 Subject: include/rmdtypes.h: Make ProgData::running, paused, aborted and pause_state_changed booleans. src/rmd_jack.c src/rmd_timer.c src/rmd_rescue.c src/encode_cache.c src/capture_sound.c src/initialize_data.c src/register_callbacks.c: Adapt. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@530 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- recordmydesktop/include/rmdtypes.h | 8 ++++---- recordmydesktop/src/capture_sound.c | 4 ++-- recordmydesktop/src/encode_cache.c | 2 +- recordmydesktop/src/initialize_data.c | 8 ++++---- recordmydesktop/src/register_callbacks.c | 6 +++--- recordmydesktop/src/rmd_jack.c | 2 +- recordmydesktop/src/rmd_rescue.c | 4 ++-- recordmydesktop/src/rmd_timer.c | 6 +++--- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/recordmydesktop/include/rmdtypes.h b/recordmydesktop/include/rmdtypes.h index 776f80d..9225e6f 100644 --- a/recordmydesktop/include/rmdtypes.h +++ b/recordmydesktop/include/rmdtypes.h @@ -343,10 +343,10 @@ struct _ProgData { sound_framesize; //size of each sound frame /** Progam state vars */ - int running; //1 while the program is capturing/paused/encoding - int paused; //1 while the program is paused - int aborted; //1 if we should abort - int pause_state_changed;//1 if pause state changed + boolean running; //1 while the program is capturing/paused/encoding + boolean paused; //1 while the program is paused + boolean aborted; //1 if we should abort + boolean pause_state_changed; //1 if pause state changed #ifdef HAVE_LIBASOUND snd_pcm_t *sound_handle; diff --git a/recordmydesktop/src/capture_sound.c b/recordmydesktop/src/capture_sound.c index f9fb295..71424f9 100644 --- a/recordmydesktop/src/capture_sound.c +++ b/recordmydesktop/src/capture_sound.c @@ -65,7 +65,7 @@ void *CaptureSound(ProgData *pdata){ ); if(pdata->sound_handle==NULL){ fprintf(stderr,"Couldn't reopen sound device.Exiting\n"); - pdata->running=0; + pdata->running = FALSE; errno=3; pthread_exit(&errno); } @@ -81,7 +81,7 @@ void *CaptureSound(ProgData *pdata){ pdata->args.frequency); if(pdata->sound_handle<0){ fprintf(stderr,"Couldn't reopen sound device.Exiting\n"); - pdata->running=0; + pdata->running = FALSE; errno=3; pthread_exit(&errno); } diff --git a/recordmydesktop/src/encode_cache.c b/recordmydesktop/src/encode_cache.c index 73b79c6..1907d98 100644 --- a/recordmydesktop/src/encode_cache.c +++ b/recordmydesktop/src/encode_cache.c @@ -37,7 +37,7 @@ void EncodeCache(ProgData *pdata){ " (resuming will not be possible, but\n" "any portion of the video, which is already encoded won't be deleted).\n" "Please wait...\n"); - pdata->running=1; + pdata->running = TRUE; InitEncoder(pdata,pdata->enc_data,1); //load encoding and flushing threads if(!pdata->args.nosound){ diff --git a/recordmydesktop/src/initialize_data.c b/recordmydesktop/src/initialize_data.c index a10205e..2fbece0 100644 --- a/recordmydesktop/src/initialize_data.c +++ b/recordmydesktop/src/initialize_data.c @@ -109,10 +109,10 @@ int InitializeData(ProgData *pdata, pdata->th_encoding_clean=pdata->v_encoding_clean=1; pdata->avd=0; pdata->sound_buffer=NULL; - pdata->running=1; - pdata->paused=0; - pdata->aborted=0; - pdata->pause_state_changed=0; + pdata->running = TRUE; + pdata->paused = FALSE; + pdata->aborted = FALSE; + pdata->pause_state_changed = FALSE; time_cond=&pdata->time_cond; pause_cond=&pdata->pause_cond; diff --git a/recordmydesktop/src/register_callbacks.c b/recordmydesktop/src/register_callbacks.c index 3371673..044fefc 100644 --- a/recordmydesktop/src/register_callbacks.c +++ b/recordmydesktop/src/register_callbacks.c @@ -40,17 +40,17 @@ static int *pdata_pause_state_changed = NULL; static void SetPaused(int signum) { - *pdata_pause_state_changed = 1; + *pdata_pause_state_changed = TRUE; } static void SetRunning(int signum) { if (!*pdata_paused) { - *pdata_running = 0; + *pdata_running = FALSE; if (signum == SIGABRT) { - *pdata_aborted = 1; + *pdata_aborted = TRUE; } } } diff --git a/recordmydesktop/src/rmd_jack.c b/recordmydesktop/src/rmd_jack.c index e15042e..6e5544e 100644 --- a/recordmydesktop/src/rmd_jack.c +++ b/recordmydesktop/src/rmd_jack.c @@ -210,7 +210,7 @@ static int LoadJackLib(void *jack_lib_handle) { static void JackShutdown(void *jdata_t) { JackData *jdata = (JackData *)jdata_t; - jdata->pdata->running = 0; + jdata->pdata->running = FALSE; fprintf (stderr, "JACK shutdown\n"); } diff --git a/recordmydesktop/src/rmd_rescue.c b/recordmydesktop/src/rmd_rescue.c index fbba518..ebd314e 100644 --- a/recordmydesktop/src/rmd_rescue.c +++ b/recordmydesktop/src/rmd_rescue.c @@ -110,8 +110,8 @@ int rmdRescue(const char *path){ pdata.th_encoding_clean=pdata.v_encoding_clean=1; pdata.avd=0; pdata.sound_buffer=NULL; - pdata.running=1; - pdata.aborted=0; + pdata.running = TRUE; + pdata.aborted = FALSE; RegisterCallbacks(&pdata); fprintf(stderr,"Restoring %s!!!\n",path); diff --git a/recordmydesktop/src/rmd_timer.c b/recordmydesktop/src/rmd_timer.c index 2430156..2cd3723 100644 --- a/recordmydesktop/src/rmd_timer.c +++ b/recordmydesktop/src/rmd_timer.c @@ -44,14 +44,14 @@ void *rmdTimer(ProgData *pdata){ while(pdata->timer_alive){ if (pdata->pause_state_changed) { - pdata->pause_state_changed = 0; + pdata->pause_state_changed = FALSE; if (!pdata->paused) { - pdata->paused = 1; + pdata->paused = TRUE; fprintf(stderr,"STATE:PAUSED\n");fflush(stderr); } else{ - pdata->paused = 0; + pdata->paused = FALSE; fprintf(stderr,"STATE:RECORDING\n");fflush(stderr); pthread_mutex_lock(&pause_mutex); pthread_cond_broadcast(pause_cond); -- cgit v1.2.3