Options
All
  • Public
  • Public/Protected
  • All
Menu

A generic scope, that can draw points or lines based on user code

Hierarchy

Index

Constructors

constructor

Properties

Private channel

channel: Channels

Private code

Private colorBuffer

colorBuffer: Buffer

Private colors

colors: Color[]

Private curColorId

curColorId: number

Private curStep

curStep: number

Private drawMode

Private inited

inited: boolean

Protected main

main: IMain

The main instance that manages this component

Private maxStep

maxStep: number

Protected opts

Protected parent

parent: IContainer

The parent component that manages this component

Private pointBuffer

pointBuffer: Buffer

Private program

Private source

source: Source

Private veryThick

veryThick: boolean

Static componentName

componentName: string = "SuperScope"

Static componentTag

componentTag: string = "render"

Static prefixed

prefixed: string | boolean

Methods

Private _makeColor

addListener

  • addListener(event: string | symbol, fn: ListenerFn, context?: any): this
  • Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns this

destroy

  • destroy(): void

draw

  • draw(): void

Private drawScope

emit

  • emit(event: string | symbol, ...args: Array<any>): boolean
  • Calls each of the listeners registered for a given event.

    Parameters

    • event: string | symbol
    • Rest ...args: Array<any>

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Return an array listing the events for which the emitter has registered listeners.

    Returns Array<string | symbol>

get

  • get(name: string): any

getId

  • getId(): string

getLastError

  • getLastError(): any

getPath

  • getPath(): string

Private handleResize

  • handleResize(): void

init

  • init(): void

isEnabled

  • isEnabled(): boolean

Protected listenTo

  • listenTo(emitter: EventEmitter, event: string, callback: function): void
  • Add a listener to another EventEmitter.

    This provides an event subscription list facility. Allowing subclasses to listen to other emitters and remove all or some listeners with a single call to Model.stopListening, later.

    Parameters

    • emitter: EventEmitter

      the event emitter to listen to

    • event: string

      the name of the event to listen to

    • callback: function

      the callback for the event handler

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

listenerCount

  • listenerCount(event: string | symbol): number
  • Return the number of listeners listening to a given event.

    Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Array<ListenerFn>
  • Return the listeners registered for a given event.

    Parameters

    • event: string | symbol

    Returns Array<ListenerFn>

off

  • off(event: string | symbol, fn?: ListenerFn, context?: any, once?: boolean): this
  • Parameters

    • event: string | symbol
    • Optional fn: ListenerFn
    • Optional context: any
    • Optional once: boolean

    Returns this

on

  • on(event: string | symbol, fn: ListenerFn, context?: any): this
  • Add a listener for a given event.

    Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns this

once

  • once(event: string | symbol, fn: ListenerFn, context?: any): this
  • Add a one-time listener for a given event.

    Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns this

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, fn?: ListenerFn, context?: any, once?: boolean): this
  • Remove the listeners of a given event.

    Parameters

    • event: string | symbol
    • Optional fn: ListenerFn
    • Optional context: any
    • Optional once: boolean

    Returns this

set

  • set(key: string | any, value: any, options?: any): boolean
  • Safely set an attribute(s).

    If the attribute set succeeds, a change:[attribute name] event is fired. change:[attribute name] event handler receives this object, the new value and options as arguments.

    Additionally a change event is also fired when all changes succeed. The change event receives this object and the options as arguments.

    Parameters

    • key: string | any

      the name of the attribute or map of values

    • value: any

      the new value of the attribute

    • Optional options: any

      this object is sent down to the event handlers, useful to things down to your handler. if options.silent is true then events are not fired.

    Returns boolean

Protected setAttribute

  • setAttribute(key: string, value: any, options: any): boolean

setParent

Protected stopListening

  • stopListening(emitter?: EventEmitter, event?: string, callback?: function): void
  • Removes to one or more listeners that were set earlier with calls to Model.listenTo.

    Use the arguments to filter subscriptions. eg: model.stopListening(em) will remove all listeners on emitter em. model.stopListening(em, 'change') will remove all listeners for change event on emitter em.

    Parameters

    • Optional emitter: EventEmitter

      the event emitter on which the listener was set

    • Optional event: string

      the event to be removed

    • Optional callback: function

      the callback to be removed

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

toJSON

  • toJSON(): any
  • Returns the JSON representation of the component options.

    This value if passed into constructor will instantiate a component that behaves the same as this component.

    Returns any

Private updateChannel

  • updateChannel(): void

Private updateClones

  • updateClones(): void

Private updateCode

  • updateCode(): void

Private updateColors

  • updateColors(): void

Private updateDrawMode

  • updateDrawMode(): void

Private updateProgram

  • updateProgram(): void

Private updateSource

  • updateSource(): void

Private updateSpeed

  • updateSpeed(): void

Private updateThickness

  • updateThickness(): void

Static getComponentName

  • getComponentName(): string

Static getComponentTag

  • getComponentTag(): string

Object literals

Static Protected defaultOptions

defaultOptions: object

blendMode

blendMode: string = "REPLACE"

channel

channel: string = "CENTER"

clone

clone: number = 1

colors

colors: string[] = ["#ffffff"]

cycleSpeed

cycleSpeed: number = 0.01

drawMode

drawMode: string = "LINES"

source

source: string = "SPECTRUM"

thickness

thickness: number = 1

code

code: object

init

init: string = "n=800"

onBeat

onBeat: string = ""

perFrame

perFrame: string = "t=t-0.05"

perPoint

perPoint: string = "d=i+v*0.2; r=t+i*$PI*4; x=cos(r)*d; y=sin(r)*d"

Static Protected optUpdateHandlers

optUpdateHandlers: object

blendMode

blendMode: string = "updateProgram"

channel

channel: string = "updateChannel"

clone

clone: string = "updateClones"

code

code: string[] = [ "updateCode", "updateClones"]

colors

colors: string = "updateColors"

cycleSpeed

cycleSpeed: string = "updateSpeed"

drawMode

drawMode: string = "updateDrawMode"

source

source: string = "updateSource"

thickness

thickness: string = "updateThickness"