ScreenSource
Defined in: core/source/screen.ts:38
The ScreenSource class represents the sources of the screen device items that has been added to the stage. A single source could have multiple items linked into it and any changes to the source would affect all items linked to it.
Each item is represented by the ScreenItem class. See: #core/ScreenItem Core/ScreenItem
Inherits from: #core/Source Core/Source
Basic Usage
Section titled “Basic Usage”var xjs = require('xjs');
xjs.Scene.getActiveScene().then(function(scene) { scene.getSources().then(function(sources) { for (var i in sources) { if (sources[i] instanceof XJS.ScreenSource) { // Manipulate your screen source here sources[i].setSilenceDetectionEnabled(true); } } })})All methods marked as Chainable resolve with the original ScreenSource
instance.
Extends
Section titled “Extends”Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ScreenSource(
props?):ScreenSource
Defined in: core/source/source.ts:75
Parameters
Section titled “Parameters”props?
Section titled “props?”Returns
Section titled “Returns”ScreenSource
Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”getCaptureArea
Section titled “getCaptureArea”getCaptureArea: () =>
Promise<Rectangle>
Defined in: core/source/screen.ts:92
See: #core/ISourceScreen#getCaptureArea getCaptureArea
Returns
Section titled “Returns”Promise<Rectangle>
Implementation of
Section titled “Implementation of”getCaptureLayered
Section titled “getCaptureLayered”getCaptureLayered: () =>
Promise<boolean>
Defined in: core/source/screen.ts:52
See: #core/ISourceScreen#getCaptureLayered getCaptureLayered
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”ISourceScreen.getCaptureLayered
getCustomName
Section titled “getCustomName”getCustomName: () =>
Promise<string>
Defined in: core/source/source.ts:291
See: #core/ISource#getCustomName getCustomName
Returns
Section titled “Returns”Promise<string>
Inherited from
Section titled “Inherited from”getId: () =>
Promise<string>
Defined in: core/source/source.ts:316
See: #core/ISource#getId getId
Returns
Section titled “Returns”Promise<string>
Inherited from
Section titled “Inherited from”getItemList
Section titled “getItemList”getItemList: () =>
Promise<Item[]>
Defined in: core/source/source.ts:321
See: #core/ISource#getItemList getItemList
Returns
Section titled “Returns”Promise<Item[]>
Inherited from
Section titled “Inherited from”getKeepLoaded
Section titled “getKeepLoaded”getKeepLoaded: () =>
Promise<boolean>
Defined in: core/source/source.ts:306
See: #core/ISource#getKeepLoaded getKeepLoaded
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”getName
Section titled “getName”getName: () =>
Promise<string>
Defined in: core/source/source.ts:281
See: #core/ISource#getName getName
Returns
Section titled “Returns”Promise<string>
Inherited from
Section titled “Inherited from”getOptimizedCapture
Section titled “getOptimizedCapture”getOptimizedCapture: () =>
Promise<boolean>
Defined in: core/source/screen.ts:62
See: #core/ISourceScreen#getOptimizedCapture getOptimizedCapture
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”ISourceScreen.getOptimizedCapture
getShowMouse
Section titled “getShowMouse”getShowMouse: () =>
Promise<boolean>
Defined in: core/source/screen.ts:82
See: #core/ISourceScreen#getShowMouse getShowMouse
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”getShowMouseClicks
Section titled “getShowMouseClicks”getShowMouseClicks: () =>
Promise<boolean>
Defined in: core/source/screen.ts:72
See: #core/ISourceScreen#getShowMouseClicks getShowMouseClicks
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”ISourceScreen.getShowMouseClicks
getType
Section titled “getType”getType: () =>
Promise<ItemTypes>
Defined in: core/source/source.ts:331
See: #core/ISource#getType getType
Returns
Section titled “Returns”Promise<ItemTypes>
Inherited from
Section titled “Inherited from”getValue
Section titled “getValue”getValue: () =>
Promise<string|XML>
Defined in: core/source/source.ts:296
See: #core/ISource#getValue getValue
Returns
Section titled “Returns”Promise<string | XML>
Inherited from
Section titled “Inherited from”isClientArea
Section titled “isClientArea”isClientArea: () =>
Promise<boolean>
Defined in: core/source/screen.ts:102
See: #core/ISourceScreen#isClientArea isClientArea
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”isStickToTitle
Section titled “isStickToTitle”isStickToTitle: () =>
Promise<boolean>
Defined in: core/source/screen.ts:42
See: #core/ISourceScreen#isStickToTitle isStickToTitle
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”refresh
Section titled “refresh”refresh: () =>
Promise<Source>
Defined in: core/source/source.ts:326
See: #core/ISource#refresh refresh
Returns
Section titled “Returns”Promise<Source>
Inherited from
Section titled “Inherited from”setCaptureArea
Section titled “setCaptureArea”setCaptureArea: (
dimension) =>Promise<ScreenSource>
Defined in: core/source/screen.ts:97
See: #core/ISourceScreen#setCaptureArea setCaptureArea
Parameters
Section titled “Parameters”dimension
Section titled “dimension”Returns
Section titled “Returns”Promise<ScreenSource>
Implementation of
Section titled “Implementation of”setCaptureLayered
Section titled “setCaptureLayered”setCaptureLayered: (
value) =>Promise<ScreenSource>
Defined in: core/source/screen.ts:57
See: #core/ISourceScreen#setCaptureLayered setCaptureLayered
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<ScreenSource>
Implementation of
Section titled “Implementation of”ISourceScreen.setCaptureLayered
setClientArea
Section titled “setClientArea”setClientArea: (
value) =>Promise<ScreenSource>
Defined in: core/source/screen.ts:107
See: #core/ISourceScreen#setClientArea setClientArea
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<ScreenSource>
Implementation of
Section titled “Implementation of”setCustomName
Section titled “setCustomName”setCustomName: () =>
Promise<Source>
Defined in: core/source/source.ts:286
See: #core/ISource#setCustomName setCustomName
Returns
Section titled “Returns”Promise<Source>
Inherited from
Section titled “Inherited from”setKeepLoaded
Section titled “setKeepLoaded”setKeepLoaded: (
value) =>Promise<Source>
Defined in: core/source/source.ts:311
See: #core/ISource#setKeepLoaded setKeepLoaded
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<Source>
Inherited from
Section titled “Inherited from”setName
Section titled “setName”setName: (
value) =>Promise<Source>
Defined in: core/source/source.ts:276
See: #core/ISource#setName setName
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<Source>
Inherited from
Section titled “Inherited from”setOptimizedCapture
Section titled “setOptimizedCapture”setOptimizedCapture: (
value) =>Promise<ScreenSource>
Defined in: core/source/screen.ts:67
See: #core/ISourceScreen#setOptimizedCapture setOptimizedCapture
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<ScreenSource>
Implementation of
Section titled “Implementation of”ISourceScreen.setOptimizedCapture
setShowMouse
Section titled “setShowMouse”setShowMouse: (
value) =>Promise<ScreenSource>
Defined in: core/source/screen.ts:87
See: #core/ISourceScreen#setShowMouse setShowMouse
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<ScreenSource>
Implementation of
Section titled “Implementation of”setShowMouseClicks
Section titled “setShowMouseClicks”setShowMouseClicks: (
value) =>Promise<ScreenSource>
Defined in: core/source/screen.ts:77
See: #core/ISourceScreen#setShowMouseClicks setShowMouseClicks
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<ScreenSource>
Implementation of
Section titled “Implementation of”ISourceScreen.setShowMouseClicks
setStickToTitle
Section titled “setStickToTitle”setStickToTitle: (
value) =>Promise<ScreenSource>
Defined in: core/source/screen.ts:47
See: #core/ISourceScreen#setStickToTitle setStickToTitle
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<ScreenSource>
Implementation of
Section titled “Implementation of”setValue
Section titled “setValue”setValue: (
value) =>Promise<Source>
Defined in: core/source/source.ts:301
See: #core/ISource#setValue setValue
Parameters
Section titled “Parameters”string | XML
Returns
Section titled “Returns”Promise<Source>
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”getAllSources()
Section titled “getAllSources()”
staticgetAllSources():Promise<Source[]>
Defined in: core/source/source.ts:220
return: Promise<Source[]>
Get all unique Source from every scene.
Total number of Sources returned may be less than total number of items on
all the scenes due to Linked items only having a single Source.
xjs.Source.getAllSources().then(function(sources) { for(var i = 0 ; i < sources.length ; i++) { if(sources[i] instanceof xjs.HtmlSource) { // Manipulate HTML Source here } }})Returns
Section titled “Returns”Promise<Source[]>
Inherited from
Section titled “Inherited from”getCurrentSource()
Section titled “getCurrentSource()”
staticgetCurrentSource():Promise<Source>
Defined in: core/source/source.ts:108
return: Promise
Get the current source (when function is called by sources), or the source that was right-clicked to open the source properties window (when function is called from the source properties window)
xjs.Source.getCurrentSource().then(function(source) { // This will fetch the current source (the plugin)}).catch(function(err) { // Handle the error here. Errors would only occur // if we try to execute this method on Extension plugins});Returns
Section titled “Returns”Promise<Source>
Inherited from
Section titled “Inherited from”getItemList()
Section titled “getItemList()”
staticgetItemList():Promise<Item[]>
Defined in: core/source/source.ts:167
return: Promise<Item[]>
Get the item List of the current Source. The item list is a list of items linked to a single Source.
xjs.Source.getItemList().then(function(items) { // This will fetch the item list of the current Source for (var i = 0 ; i < items.length ; i++) { // Manipulate each item here }});This is just the shorter way of getting items that are linked to a single source. See the long version below:
xjs.Source.getCurrentSource().then(source.getItemList).then(function(items) {// Manipulate the items here})Returns
Section titled “Returns”Promise<Item[]>