Get rid of more global->bsv.movie references

This commit is contained in:
twinaphex 2015-12-01 01:25:36 +01:00
parent d05ed635c6
commit 09a3537d44
3 changed files with 26 additions and 2 deletions

12
movie.c
View File

@ -322,8 +322,20 @@ bool bsv_movie_ctl(enum bsv_ctl_state state, void *data)
return global->bsv.movie && !global->bsv.movie_playback;
case BSV_MOVIE_CTL_START_RECORDING:
return global->bsv.movie_start_recording;
case BSV_MOVIE_CTL_SET_START_RECORDING:
global->bsv.movie_start_recording = true;
break;
case BSV_MOVIE_CTL_UNSET_START_RECORDING:
global->bsv.movie_start_recording = false;
break;
case BSV_MOVIE_CTL_START_PLAYBACK:
return global->bsv.movie_start_playback;
case BSV_MOVIE_CTL_SET_START_PLAYBACK:
global->bsv.movie_start_playback = true;
break;
case BSV_MOVIE_CTL_UNSET_START_PLAYBACK:
global->bsv.movie_start_playback = false;
break;
case BSV_MOVIE_CTL_END:
return global->bsv.movie_end && global->bsv.eof_exit;
case BSV_MOVIE_CTL_SET_END:

View File

@ -45,7 +45,11 @@ enum bsv_ctl_state
BSV_MOVIE_CTL_IS_INITED = 0,
BSV_MOVIE_CTL_PLAYBACK_ON,
BSV_MOVIE_CTL_PLAYBACK_OFF,
BSV_MOVIE_CTL_SET_START_RECORDING,
BSV_MOVIE_CTL_UNSET_START_RECORDING,
BSV_MOVIE_CTL_START_RECORDING,
BSV_MOVIE_CTL_SET_START_PLAYBACK,
BSV_MOVIE_CTL_UNSET_START_PLAYBACK,
BSV_MOVIE_CTL_START_PLAYBACK,
BSV_MOVIE_CTL_UNSET_PLAYBACK,
BSV_MOVIE_CTL_SET_FRAME_START,

View File

@ -760,8 +760,16 @@ static void parse_input(int argc, char *argv[])
case 'R':
strlcpy(global->bsv.movie_start_path, optarg,
sizeof(global->bsv.movie_start_path));
global->bsv.movie_start_playback = (c == 'P');
global->bsv.movie_start_recording = (c == 'R');
if (c == 'P')
bsv_movie_ctl(BSV_MOVIE_CTL_SET_START_PLAYBACK, NULL);
else
bsv_movie_ctl(BSV_MOVIE_CTL_UNSET_START_PLAYBACK, NULL);
if (c == 'R')
bsv_movie_ctl(BSV_MOVIE_CTL_SET_START_RECORDING, NULL);
else
bsv_movie_ctl(BSV_MOVIE_CTL_UNSET_START_RECORDING, NULL);
break;
case 'M':