MCPcopy Create free account
hub / github.com/TASEmulators/fceux / movie_playback

Function movie_playback

src/lua-engine.cpp:3409–3433  ·  view source on GitHub ↗

bool movie.play(string filename, [bool read_only, [int pauseframe]]) Loads and plays a movie.

Source from the content-addressed store, hash-verified

3407//
3408// Loads and plays a movie.
3409int movie_playback(lua_State *L) {
3410 int arg_count = lua_gettop(L);
3411
3412 if (arg_count == 0) {
3413 luaL_error(L, "no parameters specified");
3414 return 0;
3415 }
3416
3417 const char *filename = luaL_checkstring(L,1);
3418 if (filename == NULL) {
3419 luaL_error(L, "Filename required");
3420 return 0;
3421 }
3422
3423 bool read_only = arg_count >= 2 ? (lua_toboolean(L,2) == 1) : 0;
3424 int pauseframe = arg_count >= 3 ? lua_tointeger(L,3) : 0;
3425
3426 if (pauseframe < 0) pauseframe = 0;
3427
3428 // Load it!
3429 bool loaded = FCEUI_LoadMovie(filename, read_only, pauseframe);
3430
3431 lua_pushboolean(L, loaded);
3432 return 1;
3433}
3434
3435// bool movie.record(string filename, [int save_type, [string author]])
3436//

Callers

nothing calls this directly

Calls 6

lua_gettopFunction · 0.85
luaL_errorFunction · 0.85
lua_tobooleanFunction · 0.85
lua_tointegerFunction · 0.85
FCEUI_LoadMovieFunction · 0.85
lua_pushbooleanFunction · 0.85

Tested by

no test coverage detected