fceux/help/taseditor/LuaAPI.html

329 lines
30 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html>
<head>
<title>Lua API</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="HelpNDoc Personal Edition 3.8.0.560">
<link type="text/css" rel="stylesheet" media="all" href="css/reset.css" />
<link type="text/css" rel="stylesheet" media="all" href="css/base.css" />
<link type="text/css" rel="stylesheet" media="all" href="css/hnd.css" />
<!--[if lte IE 8]>
<link type="text/css" rel="stylesheet" media="all" href="css/ielte8.css" />
<![endif]-->
<style type="text/css">
#topic_header
{
background-color: #EFEFEF;
}
</style>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/hnd.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
if (top.frames.length == 0)
{
var sTopicUrl = top.location.href.substring(top.location.href.lastIndexOf("/") + 1, top.location.href.length);
top.location.href = "index.html?" + sTopicUrl;
}
else if (top && top.FrameTOC && top.FrameTOC.SelectTocItem)
{
top.FrameTOC.SelectTocItem("LuaAPI");
}
});
</script>
</head>
<body>
<div id="topic_header">
<div id="topic_header_content">
<h1>Lua API</h1>
<div id="topic_breadcrumb">
<a href="Reference.html">Reference</a> &rsaquo;&rsaquo; </div>
</div>
<div id="topic_header_nav">
<a href="Reference.html"><img src="img/arrow_up.png" alt="Parent"/></a>
<a href="Operations.html"><img src="img/arrow_left.png" alt="Previous"/></a>
<a href="FAQ.html"><img src="img/arrow_right.png" alt="Next"/></a>
</div>
<div class="clear"></div>
</div>
<div id="topic_content">
<p></p>
<p><span class="rvts19">Lua API</span></p>
<p class="rvps2"><span class="rvts6"><br/></span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">TAS Editor v1.0 comes with the library of 24 functions available for Lua scripts running in FCEUX emulator. With Lua scripts you can automate some aspects of TASing and even create your own tools for movie editing.</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">In FCEUX folder there's </span><span class="rvts20">/luaScripts</span><span class="rvts21"> folder with </span><span class="rvts20">/taseditor</span><span class="rvts21"> subfolder in it. There you can find examples of scripts using functions of this library.</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">If you don't know how to make and run Lua scripts in emulators, read </span><a class="rvts27" href="AdvancedFeatures.html#UsingLua">Advanced Features</a><span class="rvts21"> and also refer to </span><a class="rvts27" href="http://www.fceux.com/web/help/fceux.html?Commands.html" target="_blank">FCEUX Help</a><span class="rvts21">.</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<hr style="height: 1px; color : #000000; background-color : #000000; border-width : 0px;"/>
<p class="rvps3"><span class="rvts7">Full list of functions:</span></p>
<p class="rvps2"><span class="rvts21"><br/></span></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#registerauto">taseditor.registerauto(function func)</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#registermanual">taseditor.registermanual(function func, [string name])</a></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#engaged">bool taseditor.engaged()</a></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#markedframe">bool taseditor.markedframe(int frame)</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#getmarker">int taseditor.getmarker(int frame)</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#setmarker">int taseditor.setmarker(int frame)</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#removemarker">taseditor.removemarker(int frame)</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#getnote">string taseditor.getnote(int index)</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#setnote">taseditor.setnote(int index, string newtext)</a></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#getcurrentbranch">int taseditor.getcurrentbranch()</a></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#getrecordermode">string taseditor.getrecordermode()</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#getsuperimpose">int taseditor.getsuperimpose()</a></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#getlostplayback">int taseditor.getlostplayback()</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#getplaybacktarget">int taseditor.getplaybacktarget()</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#setplayback">taseditor.setplayback(int frame)</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#stopseeking">taseditor.stopseeking()</a></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#getselection">table taseditor.getselection()</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#setselection">taseditor.setselection(table new_set)</a></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#getinput">int taseditor.getinput(int frame, int joypad)</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#submitinputchange">taseditor.submitinputchange(int frame, int joypad, int input)</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#submitinsertframes">taseditor.submitinsertframes(int frame, int number)</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#submitdeleteframes">taseditor.submitdeleteframes(int frame, int number)</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#applyinputchanges">int taseditor.applyinputchanges([string name])</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#clearinputchanges">taseditor.clearinputchanges()</a></p>
<p class="rvps10"><a class="rvts27" href="LuaAPI.html#clearinputchanges"><br/></a></p>
<hr style="height: 1px; color : #000000; background-color : #000000; border-width : 0px;"/>
<p class="rvps10"><a name="registerauto"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">taseditor.registerauto(function func)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Registers a callback function ("Auto Function") that runs periodically. The Auto Function can be registered and will be called even when TAS Editor isn't engaged.</span></p>
<p class="rvps10"><span class="rvts21">When FCEUX is unpaused, your function will be called at the end of every frame (running 60 times per second on NTSC and 50 times per second on PAL).</span></p>
<p class="rvps10"><span class="rvts21">When FCEUX is paused, your function will be called 20 times per second.</span></p>
<p class="rvps10"><span class="rvts21">User can switch on/off auto-calling by checking "Auto function" checkbox in TAS Editor GUI.</span></p>
<p class="rvps10"><span class="rvts21">Like other callback-registering functions provided by FCEUX, there is only one registered callback at a time per registering function per script. If you register two callbacks, the second one will replace the first, and the call to </span><span class="rvts20">taseditor.registerauto()</span><span class="rvts21"> will return the old callback. You may register </span><span class="rvts71">nil</span><span class="rvts21"> instead of a function to clear a previously-registered callback.</span></p>
<p class="rvps10"><span class="rvts21">If a script returns while it still has registered callbacks, FCEUX will keep it alive to call those callbacks when appropriate, until either the script is stopped by the user or all of the callbacks are de-registered.</span></p>
<p class="rvps10"><a name="registermanual"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">taseditor.registermanual(function func, [string name])</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Registers a callback function ("Manual Function") that can be called manually by TAS Editor user. The function can be registered even when TAS Editor isn't engaged.</span></p>
<p class="rvps10"><span class="rvts21">The Manual function doesn't depend on paused or unpaused FCEUX status. It will be called once every time user presses </span><span class="rvts29">Run function</span><span class="rvts21"> button in TAS Editor GUI.</span></p>
<p class="rvps10"><span class="rvts21">You can provide a new name for this button.</span></p>
<p class="rvps10"><span class="rvts21">The Manual function cannot be run more often than TAS Editor window updates (60/50 FPS or 20FPS when emulator is paused).</span></p>
<p class="rvps10"><span class="rvts21">In FCEUX code Manual function runs right after Auto Function.</span></p>
<p class="rvps10"><span class="rvts21">You can use this feature to create new tools for TAS Editor. For example, you can write a script that reverses currently selected input, so user will be able to reverse input by selecting a range and clicking </span><span class="rvts29">Run function</span><span class="rvts21"> button.</span></p>
<p class="rvps10"><span class="rvts21">Like other callback-registering functions provided by FCEUX, there is only one registered callback at a time per registering function per script. If you register two callbacks, the second one will replace the first, and the call to </span><span class="rvts20">taseditor.registermanual()</span><span class="rvts21"> will return the old callback. You may call </span><span class="rvts20">taseditor.registermanual(</span><span class="rvts71">nil</span><span class="rvts20">)</span><span class="rvts21"> to clear a previously-registered callback.</span></p>
<p class="rvps10"><span class="rvts21">If a script returns while it still has registered callbacks, FCEUX will keep it alive to call those callbacks when appropriate, until either the script is stopped by the user or all of the callbacks are de-registered.</span></p>
<p class="rvps10"><a name="engaged"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">bool taseditor.engaged()</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Returns </span><span class="rvts71">true</span><span class="rvts21"> if TAS Editor is currently engaged, </span><span class="rvts71">false</span><span class="rvts21"> if otherwise.</span></p>
<p class="rvps10"><span class="rvts21">Also when TAS Editor is engaged, </span><span class="rvts20">movie.mode()</span><span class="rvts21"> returns "taseditor" string.</span></p>
<p class="rvps10"><a name="markedframe"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">bool taseditor.markedframe(int frame)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Returns </span><span class="rvts71">true</span><span class="rvts21"> if given frame is marked in TAS Editor, </span><span class="rvts71">false</span><span class="rvts21"> if not marked.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, returns </span><span class="rvts71">false</span><span class="rvts21">.</span></p>
<p class="rvps10"><a name="getmarker"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">int taseditor.getmarker(int frame)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Returns index number of the Marker under which given frame is located.</span></p>
<p class="rvps10"><span class="rvts21">Returns -1 if TAS Editor is not engaged.</span></p>
<p class="rvps10"><a name="setmarker"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">int taseditor.setmarker(int frame)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Sets Marker on given frame. Returns index number of the Marker created.</span></p>
<p class="rvps10"><span class="rvts21">If that frame is already marked, no changes will be made, and the function will return the index number of existing Marker.</span></p>
<p class="rvps10"><span class="rvts21">You can set markers even outside input range.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, returns -1.</span></p>
<p class="rvps10"><a name="removemarker"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">taseditor.removemarker(int frame)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Removes marker from given frame. If that frame was not marked, no changes will be made.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, no changes will be made.</span></p>
<p class="rvps10"><a name="getnote"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">string taseditor.getnote(int index)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Returns string representing the Note of given Marker.</span></p>
<p class="rvps10"><span class="rvts21">Returns </span><span class="rvts71">nil</span><span class="rvts21"> if TAS Editor is not engaged.</span></p>
<p class="rvps10"><span class="rvts21">If given index is invalid (if Marker with this index number doesn't exist), returns note of the zeroth marker.</span></p>
<p class="rvps10"><a name="setnote"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">taseditor.setnote(int index, string newtext)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Sets text of the Note of given Marker.</span></p>
<p class="rvps10"><span class="rvts21">If given index is invalid (if Marker with this index number doesn't exist), no changes will be made.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, no changes will be made.</span></p>
<p class="rvps10"><a name="getcurrentbranch"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">int taseditor.getcurrentbranch()</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Returns number from 0 to 9 representing current Branch.</span></p>
<p class="rvps10"><span class="rvts21">Returns -1 if there's no Branches or if TAS Editor is not engaged.</span></p>
<p class="rvps10"><a name="getrecordermode"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">string taseditor.getrecordermode()</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Returns string representing current recorder mode.</span></p>
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
<li class="rvps10"><span class="rvts21">"All"</span></li>
<li class="rvps10"><span class="rvts21">"1P"</span></li>
<li class="rvps10"><span class="rvts21">"2P"</span></li>
<li class="rvps10"><span class="rvts21">"3P"</span></li>
<li class="rvps10"><span class="rvts21">"4P"</span></li>
</ul>
<p class="rvps10"><span class="rvts21">Returns </span><span class="rvts71">nil</span><span class="rvts21"> if TAS Editor is not engaged.</span></p>
<p class="rvps10"><span class="rvts21">When you want to check Recorder's read-only state, use </span><span class="rvts20">emu.readonly()</span><span class="rvts21">.</span></p>
<p class="rvps10"><a name="getsuperimpose"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">int taseditor.getsuperimpose()</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Returns number representing current state of Superimpose checkbox in TAS Editor GUI.</span></p>
<p class="rvps10"><span class="rvts21">0 unchecked</span></p>
<p class="rvps10"><span class="rvts21">1 checked</span></p>
<p class="rvps10"><span class="rvts21">2 indeterminate (you can interpret is as half-checked)</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, returns -1.</span></p>
<p class="rvps10"><a name="getlostplayback"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">int taseditor.getlostplayback()</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Returns the number of the frame where Playback cursor was before input was changed.</span></p>
<p class="rvps10"><span class="rvts21">If Playback didn't lose position during Greenzone invalidation, returns -1.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, returns -1.</span></p>
<p class="rvps10"><a name="getplaybacktarget"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">int taseditor.getplaybacktarget()</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor's Playback is currently seeking, returns number of target frame.</span></p>
<p class="rvps10"><span class="rvts21">If Playback is not seeking or if TAS Editor is not engaged, returns -1.</span></p>
<p class="rvps10"><a name="setplayback"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">taseditor.setplayback(int frame)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Sends Playback cursor (current frame counter) to given frame.</span></p>
<p class="rvps10"><span class="rvts21">If given frame wasn't found in TAS Editor Greenzone, starts seeking to the frame.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, nothing will be done.</span></p>
<p class="rvps10"><a name="stopseeking"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">taseditor.stopseeking()</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Stops Playback seeking and pauses emulation.</span></p>
<p class="rvps10"><span class="rvts21">If Playback wasn't seeking, this function only pauses emulation.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, nothing will be done.</span></p>
<p class="rvps10"><a name="getselection"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">table taseditor.getselection()</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Returns a table (array) containing numbers of currently selected frames. These numbers are sorted in ascending order.</span></p>
<p class="rvps10"><span class="rvts21">If no frames are selected at the moment, returns </span><span class="rvts71">nil</span><span class="rvts21">.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, returns </span><span class="rvts71">nil</span><span class="rvts21">.</span></p>
<p class="rvps10"><a name="setselection"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">taseditor.setselection(table new_set)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Changes current selection to the given set of frames. Frame number in your table don't have to be sorted.</span></p>
<p class="rvps10"><span class="rvts21">Call </span><span class="rvts20">taseditor.setselection(</span><span class="rvts71">nil</span><span class="rvts20">)</span><span class="rvts21"> to clear selection.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, nothing will be done.</span></p>
<p class="rvps10"><a name="getinput"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">int taseditor.getinput(int frame, int joypad)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Returns a number representing input of given joypad stored in current movie at given frame.</span></p>
<p class="rvps10"><span class="rvts21">If given frame is negative, returns -1.</span></p>
<p class="rvps10"><span class="rvts21">If given frame is outside current input range, returns 0, which can be interpreted as a blank frame (no buttons pressed at this frame yet).</span></p>
<p class="rvps10"><span class="rvts21">Joypad value must be one of the following:</span></p>
<p class="rvps10"><span class="rvts21">0 </span><span class="rvts21">to get hardware commands (bit 0 = reset, bit 1 = poweron, bit 2 = FDS insert disk, bit 3 = FDS switch side)</span></p>
<p class="rvps10"><span class="rvts21">1 </span><span class="rvts21">to get 1P buttons</span><span class="rvts21"> (</span><span class="rvts21">bit</span><span class="rvts21"> 0 = A, </span><span class="rvts21">bit</span><span class="rvts21"> 1 = B, </span><span class="rvts21">bit</span><span class="rvts21"> 2 = Select, </span><span class="rvts21">bit</span><span class="rvts21"> 3 = Start, </span><span class="rvts21">bit</span><span class="rvts21"> 4 = Up, </span><span class="rvts21">bit</span><span class="rvts21"> 5 = Down, </span><span class="rvts21">bit</span><span class="rvts21"> 6 = Left, </span><span class="rvts21">bit</span><span class="rvts21"> 7 = Right)</span></p>
<p class="rvps10"><span class="rvts21">2 </span><span class="rvts21">to get 2P buttons</span></p>
<p class="rvps10"><span class="rvts21">3 </span><span class="rvts21">to get 3P buttons</span></p>
<p class="rvps10"><span class="rvts21">4 </span><span class="rvts21">to get 4P buttons</span></p>
<p class="rvps10"><span class="rvts21">You should handle returned number (if it's not equal to -1) as a byte, each bit corresponds to one button (e.g. if bit 1 is set that means A button is pressed). Use Bitwise Operations to retrieve the state of specific buttons.</span></p>
<p class="rvps10"><span class="rvts21">If given joypad is outside [0-4] range, returns -1.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, returns -1.</span></p>
<p class="rvps10"><a name="submitinputchange"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">taseditor.submitinputchange(int frame, int joypad, int input)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Sends request to TAS Editor asking to change input of given joypad at given frame.</span></p>
<p class="rvps10"><span class="rvts21">Actual movie input won't be changed until the moment you call </span><span class="rvts20">taseditor.applyinputchanges()</span><span class="rvts21">.</span></p>
<p class="rvps10"><span class="rvts21">Using several consecutive requests and then calling </span><span class="rvts20">applyinputchanges()</span><span class="rvts21"> at the end, you can change several frames of current movie in one moment.</span></p>
<p class="rvps10"><span class="rvts21">When applying the pile of requests, TAS Editor will execute them in consecutive order.</span></p>
<p class="rvps10"><span class="rvts21">If given frame is negative, TAS Editor will ignore such request.</span></p>
<p class="rvps10"><span class="rvts21">If given frame is outside current input range, TAS Editor will expand movie during </span><span class="rvts20">applyinputchanges()</span><span class="rvts21"> to fit the frame.</span></p>
<p class="rvps10"><span class="rvts21">If given joypad is outside [0-4] range, TAS Editor will ignore such request.</span></p>
<p class="rvps10"><span class="rvts21">Given input will be treated by TAS Editor as a sequence of bits representing state of each button of given joypad </span><span class="rvts21">(</span><span class="rvts21">bit</span><span class="rvts21"> 0 = A, </span><span class="rvts21">bit</span><span class="rvts21"> 1 = B, </span><span class="rvts21">bit</span><span class="rvts21"> 2 = Select, </span><span class="rvts21">bit</span><span class="rvts21"> 3 = Start, </span><span class="rvts21">bit</span><span class="rvts21"> 4 = Up, </span><span class="rvts21">bit</span><span class="rvts21"> 5 = Down, </span><span class="rvts21">bit</span><span class="rvts21"> 6 = Left, </span><span class="rvts21">bit</span><span class="rvts21"> 7 = Right)</span><span class="rvts21">.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, nothing will be done.</span></p>
<p class="rvps10"><a name="submitinsertframes"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">taseditor.submitinsertframes(int frame, int number)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Sends request to TAS Editor asking to insert given number of blank frames before given frame.</span></p>
<p class="rvps10"><span class="rvts21">Actual movie won't be changed until the moment you call </span><span class="rvts20">taseditor.applyinputchanges()</span><span class="rvts21">.</span></p>
<p class="rvps10"><span class="rvts21">Insertion can move down some old input and Markers (if "</span><a class="rvts27" href="ProgramCustomization.html#BindMarkerstoInput">Bind Markers to Input</a><span class="rvts21">" option is checked by user).</span></p>
<p class="rvps10"><span class="rvts21">If given number is less or equal to zero, TAS Editor will ignore such request.</span></p>
<p class="rvps10"><span class="rvts21">If given frame is negative, TAS Editor will ignore such request.</span></p>
<p class="rvps10"><span class="rvts21">If given frame is outside current input range, TAS Editor will expand movie during </span><span class="rvts20">applyinputchanges()</span><span class="rvts21"> to fit the frame.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, nothing will be done.</span></p>
<p class="rvps10"><a name="submitdeleteframes"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">taseditor.submitdeleteframes(int frame, int number)</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Sends request to TAS Editor asking to delete given number of frames starting from given frame.</span></p>
<p class="rvps10"><span class="rvts21">Actual movie won't be changed until the moment you call </span><span class="rvts20">taseditor.applyinputchanges()</span><span class="rvts21">.</span></p>
<p class="rvps10"><span class="rvts21">Deletion can move up some old input and Markers (if "</span><a class="rvts27" href="ProgramCustomization.html#BindMarkerstoInput">Bind Markers to Input</a><span class="rvts21">" option is checked by user).</span></p>
<p class="rvps10"><span class="rvts21">If given number is less or equal to zero, TAS Editor will ignore such request.</span></p>
<p class="rvps10"><span class="rvts21">If given frame is negative, TAS Editor will ignore such request.</span></p>
<p class="rvps10"><span class="rvts21">If given frame is outside current input range, TAS Editor will expand movie during </span><span class="rvts20">applyinputchanges()</span><span class="rvts21"> to fit the frame.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, nothing will be done.</span></p>
<p class="rvps10"><a name="applyinputchanges"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">int taseditor.applyinputchanges([string name])</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Instantly applies the list of previously requested changes to current movie. If these requests actually modified movie data, new item will appear in History Log (so user can undo these changes), and Greenzone may become truncated, Playback cursor may lose its position, auto-seeking may be triggered.</span></p>
<p class="rvps10"><span class="rvts21">Returns number of frame where first actual changes occurred.</span></p>
<p class="rvps10"><span class="rvts21">If no actual changes were found (for example, you asked TAS Editor to set buttons that were already pressed), returns -1.</span></p>
<p class="rvps10"><span class="rvts21">If pending list of changes is empty, returns -1.</span></p>
<p class="rvps10"><span class="rvts21">You can provide a name that will be assigned to this change. This name will be shown in History Log. If you don't provide a name, TAS Editor will use default name ("Change").</span></p>
<p class="rvps10"><span class="rvts21">After applying all requests TAS Editor clears the list of requests.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, nothing will be done.</span></p>
<p class="rvps10"><a name="clearinputchanges"></a>
<span class="rvts21"><br/></span></p>
<p class="rvps9"><span class="rvts68">taseditor.clearinputchanges()</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21">Clears the list of previously requested changes, making TAS Editor forget about them before you call </span><span class="rvts20">applyinputchanges()</span><span class="rvts21">. Use this function to discard previously submitted input changes.</span></p>
<p class="rvps10"><span class="rvts21">It's also recommended to call this function before making several requests in a row, so that you'll be sure that only your new changes will apply.</span></p>
<p class="rvps10"><span class="rvts21">If TAS Editor is not engaged, nothing will be done.</span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p class="rvps10"><span class="rvts21"><br/></span></p>
<p></p>
<p class="rvps8"><span class="rvts17">Created with the Personal Edition of HelpNDoc: </span><a class="rvts18" href="http://www.helpndoc.com">Full-featured Documentation generator</a></p>
</div>
<div id="topic_footer">
<div id="topic_footer_content">
&copy; 2011-2013 AnS</div>
</div>
</body>
</html>