Module: Vizcore

Defined in:
lib/vizcore.rb,
lib/vizcore/cli.rb,
lib/vizcore/dsl.rb,
lib/vizcore/audio.rb,
lib/vizcore/shape.rb,
lib/vizcore/config.rb,
lib/vizcore/errors.rb,
lib/vizcore/server.rb,
lib/vizcore/version.rb,
lib/vizcore/analysis.rb,
lib/vizcore/renderer.rb,
lib/vizcore/cli/doctor.rb,
lib/vizcore/dsl/engine.rb,
lib/vizcore/layer_catalog.rb,
lib/vizcore/server/runner.rb,
lib/vizcore/cli/layer_docs.rb,
lib/vizcore/control_preset.rb,
lib/vizcore/audio/mic_input.rb,
lib/vizcore/server/rack_app.rb,
lib/vizcore/audio/base_input.rb,
lib/vizcore/audio/file_input.rb,
lib/vizcore/audio/midi_input.rb,
lib/vizcore/dsl/file_watcher.rb,
lib/vizcore/project_manifest.rb,
lib/vizcore/sync/osc_message.rb,
lib/vizcore/analysis/fftw_ffi.rb,
lib/vizcore/analysis/pipeline.rb,
lib/vizcore/analysis/smoother.rb,
lib/vizcore/audio/ring_buffer.rb,
lib/vizcore/cli/dsl_reference.rb,
lib/vizcore/dsl/layer_builder.rb,
lib/vizcore/dsl/scene_builder.rb,
lib/vizcore/dsl/style_builder.rb,
lib/vizcore/renderer/snapshot.rb,
lib/vizcore/sync/osc_receiver.rb,
lib/vizcore/analysis/tap_tempo.rb,
lib/vizcore/server/gallery_app.rb,
lib/vizcore/audio/fixture_input.rb,
lib/vizcore/audio/input_manager.rb,
lib/vizcore/audio/portaudio_ffi.rb,
lib/vizcore/cli/scene_inspector.rb,
lib/vizcore/cli/scene_validator.rb,
lib/vizcore/cli/shader_template.rb,
lib/vizcore/renderer/png_writer.rb,
lib/vizcore/server/gallery_page.rb,
lib/vizcore/dsl/mapping_resolver.rb,
lib/vizcore/dsl/reaction_builder.rb,
lib/vizcore/dsl/timeline_builder.rb,
lib/vizcore/cli/scene_diagnostics.rb,
lib/vizcore/dsl/midi_map_executor.rb,
lib/vizcore/server/gallery_runner.rb,
lib/vizcore/analysis/band_splitter.rb,
lib/vizcore/analysis/beat_detector.rb,
lib/vizcore/analysis/bpm_estimator.rb,
lib/vizcore/analysis/fft_processor.rb,
lib/vizcore/audio/dummy_sine_input.rb,
lib/vizcore/analysis/feature_replay.rb,
lib/vizcore/cli/shader_uniform_docs.rb,
lib/vizcore/dsl/layer_group_builder.rb,
lib/vizcore/renderer/frame_scheduler.rb,
lib/vizcore/renderer/render_sequence.rb,
lib/vizcore/server/frame_broadcaster.rb,
lib/vizcore/server/websocket_handler.rb,
lib/vizcore/analysis/feature_recorder.rb,
lib/vizcore/dsl/transition_controller.rb,
lib/vizcore/renderer/scene_serializer.rb,
lib/vizcore/dsl/shader_source_resolver.rb,
lib/vizcore/renderer/snapshot_renderer.rb,
lib/vizcore/renderer/scene_frame_source.rb,
lib/vizcore/analysis/adaptive_normalizer.rb,
lib/vizcore/dsl/mapping_transform_builder.rb,
lib/vizcore/server/scene_dependency_watcher.rb

Overview

Main namespace for the Vizcore runtime and DSL entrypoints.

Defined Under Namespace

Modules: Analysis, Audio, CLISupport, DSL, ErrorFormatting, LayerCatalog, Renderer, Server, Shape, Sync Classes: AudioSourceError, CLI, Config, ConfigurationError, ControlPreset, Error, FrameBuildError, MissingDependencyError, ProjectManifest, SceneLoadError

Constant Summary collapse

VERSION =

Current gem version.

"1.1.0"

Class Method Summary collapse

Class Method Details

.define { ... } ⇒ Hash

Evaluate a Vizcore DSL definition block.

Yields:

  • DSL configuration block (‘audio`, `scene`, `midi_map`, etc.)

Returns:

  • (Hash)

    serialized DSL definition



36
37
38
# File 'lib/vizcore.rb', line 36

def self.define(&block)
  DSL::Engine.define(&block)
end

.frontend_rootPathname

Returns absolute path to bundled frontend assets.

Returns:

  • (Pathname)

    absolute path to bundled frontend assets.



23
24
25
# File 'lib/vizcore.rb', line 23

def self.frontend_root
  root.join("frontend")
end

.plugin(name) ⇒ true

Load a Vizcore plugin by Ruby require path.

Parameters:

  • name (String, Symbol)

    require path for the plugin

Returns:

  • (true)


44
45
46
# File 'lib/vizcore.rb', line 44

def self.plugin(name)
  require name.to_s
end

.register_layer_capability(type:, aliases: [], params: {}, mappable_params: [], description: nil) ⇒ Vizcore::LayerCatalog::Capability

Register a plugin-provided layer capability for validation and docs.

Parameters:

  • type (Symbol, String)

    primary layer type

  • aliases (Array<Symbol, String>) (defaults to: [])

    supported aliases

  • params (Hash) (defaults to: {})

    layer parameter metadata

  • mappable_params (Array<Symbol, String>) (defaults to: [])

    params that can be mapped

  • description (String, nil) (defaults to: nil)

    human-readable docs text

Returns:



56
57
58
59
60
61
62
63
64
# File 'lib/vizcore.rb', line 56

def self.register_layer_capability(type:, aliases: [], params: {}, mappable_params: [], description: nil)
  LayerCatalog.register_layer_capability(
    type: type,
    aliases: aliases,
    params: params,
    mappable_params: mappable_params,
    description: description
  )
end

.register_shape(name, klass = nil, &block) ⇒ Object

Raises:

  • (ArgumentError)


707
708
709
710
711
712
713
# File 'lib/vizcore/shape.rb', line 707

def register_shape(name, klass = nil, &block)
  raise ArgumentError, "register_shape requires a class/module or block" if klass.nil? && block.nil?
  raise ArgumentError, "register_shape accepts either a class/module or block" if klass && block

  key = name.to_sym
  @shape_registry[key] = Shape::Definition.new(name: key, renderer: klass || block)
end

.resolve_shape(name) ⇒ Object



715
716
717
# File 'lib/vizcore/shape.rb', line 715

def resolve_shape(name)
  @shape_registry[name.to_sym]
end

.rootPathname

Returns absolute root path for this gem source tree.

Returns:

  • (Pathname)

    absolute root path for this gem source tree.



18
19
20
# File 'lib/vizcore.rb', line 18

def self.root
  Pathname.new(__dir__).join("..").expand_path
end

.templates_rootPathname

Returns absolute path to scaffold template files.

Returns:

  • (Pathname)

    absolute path to scaffold template files.



28
29
30
# File 'lib/vizcore.rb', line 28

def self.templates_root
  root.join("lib", "vizcore", "templates")
end