Difference between revisions of "API"

From Light Forge Wiki
Jump to: navigation, search
(Created page with "Groups Cues Output")
 
(getBPM)
 
(33 intermediate revisions by one user not shown)
Line 1: Line 1:
[[Groups]]
+
=Types=
[[Cues]]
+
 
[[Output]]
+
==api.attributeTypes==
 +
[[api.attributeTypes]]
 +
 
 +
 
 +
=Classes=
 +
 
 +
==api.cues==
 +
Used for working with cues.
 +
 
 +
[[api.cues]]
 +
 
 +
==api.groups==
 +
Used for working with groups.
 +
 
 +
[[api.groups]]
 +
 
 +
==api.output==
 +
Used for getting information about DMX output.
 +
 
 +
[[api.output]]
 +
 
 +
=Methods=
 +
 
 +
==getTime==
 +
'''getTime() As Double'''
 +
 
 +
Gets the current playback position.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
print(api.getTime())
 +
</syntaxhighlight>
 +
 
 +
==setTime==
 +
'''setTime(time As Double)'''
 +
 
 +
Sets the current playback position to the specified time.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
api.setTime(36.5)
 +
print(api.getTime())
 +
</syntaxhighlight>
 +
 
 +
==getBPM==
 +
'''getBPM() As Double'''
 +
 
 +
Gets the BPM of the current cuelist
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
print(api.getBPM())
 +
</syntaxhighlight>
 +
 
 +
==wait==
 +
'''wait(seconds As Double)'''
 +
 
 +
Causes execution to wait for the specified number of seconds.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
api.wait(3.5)
 +
</syntaxhighlight>
 +
 
 +
==isPlaying==
 +
'''isPlaying() As Boolean'''
 +
 
 +
Checks to see if the timeline is currently playing back.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
if(api.isPlaying()):
 +
api.stopPlayback()
 +
</syntaxhighlight>
 +
 
 +
==startPlayback==
 +
'''startPlayback()'''
 +
 
 +
Starts timeline playback.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
if(api.isPlaying() == False):
 +
api.startPlayback()
 +
</syntaxhighlight>
 +
 
 +
==stopPlayback==
 +
'''stopPlayback()'''
 +
 
 +
Stops timeline playback.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
if(api.isPlaying()):
 +
api.stopPlayback()
 +
</syntaxhighlight>
 +
 
 +
==NextCue==
 +
'''nextCue()'''
 +
 
 +
Advances timeline to the next cue.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
api.nextCue()
 +
</syntaxhighlight>
 +
 
 +
==PreviousCue==
 +
'''previousCue()'''
 +
 
 +
Moves timeline to the previous cue.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
api.previousCue()
 +
</syntaxhighlight>
 +
 
 +
=Event Handling=
 +
 
 +
==onInitialize==
 +
Called when the script is loaded.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onInitialize():
 +
print("Script Loaded")
 +
</syntaxhighlight>
 +
 
 +
==onDispose==
 +
Called when the script is being disposed by either it being disabled, or by Lightforge closing.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onDispose():
 +
print("Addon Disposing")
 +
</syntaxhighlight>
 +
 
 +
==onEdit==
 +
Called when the script settings are being edited. Editing a script's settings from the Script Settings Dialog is only possible if this function is implemented in your code.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onEdit():
 +
print("Settings Edit")
 +
</syntaxhighlight>
 +
 
 +
==onExecute==
 +
Called when this script is specifically executed.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onExecute():
 +
print("Script Executed")
 +
</syntaxhighlight>
 +
 
 +
==onExecuteAsync==
 +
Called when this script is specifically executed. Code run from this function is executed asynchronously.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onExecuteAsync():
 +
print("Script Executed Asynchronously")
 +
</syntaxhighlight>
 +
 
 +
==onStartup==
 +
Called when Lightforge starts up.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onStartup():
 +
print("Lightforge Started")
 +
</syntaxhighlight>
 +
 
 +
==onStartupAsync==
 +
Called when Lightforge starts up. Code run from this function is executed asynchronously.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onStartupAsync():
 +
print("Lightforge Started (Async)")
 +
</syntaxhighlight>
 +
 
 +
==onPlaybackStart==
 +
Called when timeline playback has started.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onPlaybackStart():
 +
print("Playback Started")
 +
</syntaxhighlight>
 +
 
 +
==onPlaybackStop==
 +
Called when timeline playback has stopped
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onPlaybackStop():
 +
print("Playback Stopped")
 +
</syntaxhighlight>
 +
 
 +
==onFrameChange==
 +
Called on every frame change during playback, scrubbing, and time changes.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onFrameChange(seconds As Double):
 +
print("Frame Changed " + seconds)
 +
</syntaxhighlight>
 +
 
 +
==onShutdown==
 +
Called when Lightforge is shutting down.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onShutdown():
 +
print("Lightforge Shutdown")
 +
</syntaxhighlight>
 +
 
 +
==onCuelistChange==
 +
Called when the current cuelist has been changed.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onCuelistChange():
 +
print("Cue List Changed")
 +
</syntaxhighlight>
 +
 
 +
==onShowLoaded==
 +
Called when a new show has been loaded.
 +
 
 +
Usage:
 +
<syntaxhighlight lang=python>
 +
def onShowLoaded():
 +
print("Show Loaded")
 +
</syntaxhighlight>

Latest revision as of 14:45, 15 June 2013

Contents

[edit] Types

[edit] api.attributeTypes

api.attributeTypes


[edit] Classes

[edit] api.cues

Used for working with cues.

api.cues

[edit] api.groups

Used for working with groups.

api.groups

[edit] api.output

Used for getting information about DMX output.

api.output

[edit] Methods

[edit] getTime

getTime() As Double

Gets the current playback position.

Usage:

print(api.getTime())

[edit] setTime

setTime(time As Double)

Sets the current playback position to the specified time.

Usage:

api.setTime(36.5)
print(api.getTime())

[edit] getBPM

getBPM() As Double

Gets the BPM of the current cuelist

Usage:

print(api.getBPM())

[edit] wait

wait(seconds As Double)

Causes execution to wait for the specified number of seconds.

Usage:

api.wait(3.5)

[edit] isPlaying

isPlaying() As Boolean

Checks to see if the timeline is currently playing back.

Usage:

if(api.isPlaying()):
	api.stopPlayback()

[edit] startPlayback

startPlayback()

Starts timeline playback.

Usage:

if(api.isPlaying() == False):
	api.startPlayback()

[edit] stopPlayback

stopPlayback()

Stops timeline playback.

Usage:

if(api.isPlaying()):
	api.stopPlayback()

[edit] NextCue

nextCue()

Advances timeline to the next cue.

Usage:

api.nextCue()

[edit] PreviousCue

previousCue()

Moves timeline to the previous cue.

Usage:

api.previousCue()

[edit] Event Handling

[edit] onInitialize

Called when the script is loaded.

Usage:

def onInitialize():
	print("Script Loaded")

[edit] onDispose

Called when the script is being disposed by either it being disabled, or by Lightforge closing.

Usage:

def onDispose():
	print("Addon Disposing")

[edit] onEdit

Called when the script settings are being edited. Editing a script's settings from the Script Settings Dialog is only possible if this function is implemented in your code.

Usage:

def onEdit():
	print("Settings Edit")

[edit] onExecute

Called when this script is specifically executed.

Usage:

def onExecute():
	print("Script Executed")

[edit] onExecuteAsync

Called when this script is specifically executed. Code run from this function is executed asynchronously.

Usage:

def onExecuteAsync():
	print("Script Executed Asynchronously")

[edit] onStartup

Called when Lightforge starts up.

Usage:

def onStartup():
	print("Lightforge Started")

[edit] onStartupAsync

Called when Lightforge starts up. Code run from this function is executed asynchronously.

Usage:

def onStartupAsync():
	print("Lightforge Started (Async)")

[edit] onPlaybackStart

Called when timeline playback has started.

Usage:

def onPlaybackStart():
	print("Playback Started")

[edit] onPlaybackStop

Called when timeline playback has stopped

Usage:

def onPlaybackStop():
	print("Playback Stopped")

[edit] onFrameChange

Called on every frame change during playback, scrubbing, and time changes.

Usage:

def onFrameChange(seconds As Double):
	print("Frame Changed " + seconds)

[edit] onShutdown

Called when Lightforge is shutting down.

Usage:

 
def onShutdown():
	print("Lightforge Shutdown")

[edit] onCuelistChange

Called when the current cuelist has been changed.

Usage:

def onCuelistChange():
	print("Cue List Changed")

[edit] onShowLoaded

Called when a new show has been loaded.

Usage:

def onShowLoaded():
	print("Show Loaded")
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox