Class: Vizcore::CLISupport::SceneValidator
- Inherits:
-
Object
- Object
- Vizcore::CLISupport::SceneValidator
- Defined in:
- lib/vizcore/cli/scene_validator.rb
Overview
Validates scene DSL files without starting the realtime server.
Defined Under Namespace
Constant Summary collapse
- BUILTIN_SHADERS =
Vizcore::LayerCatalog::BUILTIN_SHADERS
- MAPPING_SOURCE_KINDS =
%i[ amplitude frequency_band fft_spectrum onset kick snare hihat beat beat_confidence beat_pulse beat_count bpm ].freeze
- FREQUENCY_BANDS =
%i[sub low mid high].freeze
- SUPPORTED_BLEND_MODES =
Vizcore::LayerCatalog::BLEND_MODES
- SUPPORTED_POST_EFFECTS =
Vizcore::LayerCatalog::POST_EFFECTS
- SUPPORTED_VJ_EFFECTS =
Vizcore::LayerCatalog::VJ_EFFECTS
- SUPPORTED_SHAPE_KINDS =
%i[circle line rect polygon polyline path star].freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(scene_file:, loader: Vizcore::DSL::Engine.method(:load_file), shader_resolver: Vizcore::DSL::ShaderSourceResolver.new) ⇒ SceneValidator
constructor
A new instance of SceneValidator.
Constructor Details
#initialize(scene_file:, loader: Vizcore::DSL::Engine.method(:load_file), shader_resolver: Vizcore::DSL::ShaderSourceResolver.new) ⇒ SceneValidator
Returns a new instance of SceneValidator.
44 45 46 47 48 |
# File 'lib/vizcore/cli/scene_validator.rb', line 44 def initialize(scene_file:, loader: Vizcore::DSL::Engine.method(:load_file), shader_resolver: Vizcore::DSL::ShaderSourceResolver.new) @scene_file = scene_file @loader = loader @shader_resolver = shader_resolver end |
Instance Method Details
#call ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/vizcore/cli/scene_validator.rb', line 50 def call definition = load_definition Result.new(definition: definition, issues: validate_definition(definition)) rescue StandardError => e Result.new( definition: nil, issues: [Issue.new(severity: :error, message: "failed to load scene: #{e.}")] ) end |