Beispiel #1
0
 public SymmetricSpectrum(IEffectApi api, int width, int height) : base(width, height)
 {
     _api          = api;
     _color        = new SKColor(0, 255, 128);
     _render       = _api.CreateRender();
     _featureCache = _api.CreateAudioFeatureCache();
 }
Beispiel #2
0
        public ValueBar(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            _api    = effectApi;
            _color  = new SKColor(0, 128, 128);
            _render = _api.CreateRender();

            _barValue = 0;
        }
Beispiel #3
0
        public Stroboscope(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            _api    = effectApi;
            _color  = new SKColor(0, 0, 0);
            _render = _api.CreateRender();

            _flashDuration = MaxFlashDuration;
        }
Beispiel #4
0
        public ColorWheel(IEffectApi api, int width, int height) : base(width, height)
        {
            _api    = api;
            _render = _api.CreateRender();

            _speed  = 25;
            _offset = 0;
            _scale  = 1;
        }
Beispiel #5
0
        public Bar(IEffectApi api, int width, int height) : base(width, height)
        {
            _api    = api;
            _color  = new SKColor(0, 255, 128);
            _render = _api.CreateRender();

            _xCenterPos = Width / 2f;
            _xSize      = Width / 2f;
        }
Beispiel #6
0
        public SymmetricBeatBars(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            _api          = effectApi;
            _color        = new SKColor(0, 128, 128);
            _render       = _api.CreateRender();
            _featureCache = _api.CreateAudioFeatureCache();

            _remainingBeatTime = 0;
        }
Beispiel #7
0
        public static void RegisterEffectSystems <TSystem, TRenderer, TComponent1>(this IEffectApi @this, Affects affects)
            where TSystem : IEffectSystem, new()
            where TRenderer : IEffectRenderer, new()
        {
            var system   = new TSystem();
            var renderer = new TRenderer();

            @this.RegisterEffect <TComponent1>(system, renderer, affects);
        }
Beispiel #8
0
        public Blob(IEffectApi api, int width, int height) : base(width, height)
        {
            _api    = api;
            _color  = new SKColor(0, 255, 128);
            _render = _api.CreateRender();

            _x0Pos = Width / 2f;
            _y0Pos = Height / 2f;
            _size  = Width / 2f;
        }
Beispiel #9
0
        public Beams(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            _api            = effectApi;
            _render         = _api.CreateRender();
            _particleSystem = _api.CreateParticleSystem();

            _color         = new SKColor(0, 128, 128);
            _particleSpeed = 5;
            _particleSize  = 4;
        }
Beispiel #10
0
        public ChromaBars(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            _api          = effectApi;
            _color        = new SKColor(0, 128, 128);
            _render       = _api.CreateRender();
            _featureCache = _api.CreateAudioFeatureCache();

            _threshold = 0.0f;
            _barSize   = (int)(width / NumBars);
        }
Beispiel #11
0
        public ColorWheel(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            _api    = effectApi;
            _color  = new SKColor(0, 128, 128);
            _render = _api.CreateRender();

            _speed  = 25;
            _offset = 0;
            _scale  = 1;
        }
Beispiel #12
0
        public ZoomingBlobs(IEffectApi api, int width, int height) : base(width, height)
        {
            _api    = api;
            _render = _api.CreateRender();

            _maxBlobLife = 0.5f;
            _maxBlobSize = width / 8f;
            _rand        = new Random();
            _blobs       = new List <BlobItem>();
        }
Beispiel #13
0
        public FixedChladni(IEffectApi api, int width, int height) : base(width, height)
        {
            _api    = api;
            _color  = new SKColor(0, 255, 128);
            _render = _api.CreateRender();

            _n = 1;
            _m = 1;
            _a = 1;
            _b = 1;
        }
Beispiel #14
0
        public BouncingBlob(IEffectApi api, int width, int height) : base(width, height)
        {
            _api    = api;
            _color  = new SKColor(0, 255, 128);
            _render = _api.CreateRender();

            _xCenterPos = width / 2f;
            _size       = width / 4f;
            _speed      = width / 8f;
            _direction  = 1;
        }
Beispiel #15
0
        /*	This constructor will be called when a layer of your effect is being created. */
        public Color(IEffectApi api, int width, int height) : base(width, height)
        {
            /*	Save the effect helper in your class, you will need it. */
            _api = api;

            /*	Set the default color. */
            _color = new SKColor(0, 255, 128);

            /*	Create a render for your effect using the effect helper. */
            _render = _api.CreateRender();
        }
Beispiel #16
0
        public WalkingBlobs(IEffectApi api, int width, int height) : base(width, height)
        {
            _api    = api;
            _render = _api.CreateRender();

            _blobs = new List <WalkingBlob>();

            _blobSize     = width / 16f;
            _blobSpeed    = width / 2;
            _blobWalkTime = 0.375f;
            _blobColor    = new SKColor(0, 255, 128);
        }
        public CirclingEllipticalPlasma(IEffectApi api, int width, int height) : base(width, height)
        {
            _api    = api;
            _render = _api.CreateRender();

            _cr = 0.0f;
            _cg = 0.5f;
            _cb = 1.0f;

            _xScale = 1.0f;
            _yScale = 1.0f;
        }
Beispiel #18
0
        /*	This constructor will be called when a layer of your effect is being created. */
        public BeatColor(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            /*	Save the effect api in your class, you will need it. */
            _api          = effectApi;
            _featureCache = _api.CreateAudioFeatureCache();

            /*	Set the default color. */
            _color = new SKColor(0, 128, 128);

            /*	Create a render for your effect using the effect api. */
            _render = _api.CreateRender();
        }
        public DirectionalPlasma(IEffectApi api, int width, int height) : base(width, height)
        {
            _api    = api;
            _render = _api.CreateRender();

            _cr = 0.0f;
            _cg = 0.5f;
            _cb = 1.0f;

            _scale = 1.0f;
            _angle = 0.0f;

            UpdateDirection();
        }
Beispiel #20
0
        /*	This constructor will be called when a layer of your effect is being created. */
        public Wave1D(IEffectApi api, int width, int height) : base(width, height)
        {
            /*	Save the effect helper in your class, you will need it. */
            _api = api;

            /*	Create a render for your effect using the effect helper. */
            _render = _api.CreateRender();

            /*	Create a wave simulation using the effect helper. */
            _waveSimulation = _api.CreateWaveSimulation1D();

            /*	Lets double the wave speeds */
            _waveSimulation.Speed = 2.0;
        }
Beispiel #21
0
        public Sparkles(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            _api = effectApi;

            // Create a render for this effect instance once.
            _render = _api.CreateRender();

            // Create a particle system
            _particleSystem = _api.CreateParticleSystem();

            _color        = new SKColor(0, 128, 128);
            _numParticles = 3 * Width / 4;
            _particleSize = 1;
        }
Beispiel #22
0
        /*	This constructor will be called when a layer of your effect is being created. */
        public BeatWave1D(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            /*	Save the effect api in your class, you will need it. */
            _api          = effectApi;
            _featureCache = _api.CreateAudioFeatureCache();

            /*	Create a render for your effect using the effect api. */
            _render = _api.CreateRender();

            /*	Create a wave simulation using the effect api. */
            _waveSimulation = _api.CreateWaveSimulation1D();

            /*	Lets double the wave speeds */
            _waveSimulation.Speed = 2.0;
        }
Beispiel #23
0
        public SparkleExplosion(IEffectApi api, int width, int height) : base(width, height)
        {
            _api = api;

            // Create a render for this effect instance once.
            _render = _api.CreateRender();

            // Create a particle system
            _particleSystem = _api.CreateParticleSystem();

            _random       = new Random();
            _color        = new SKColor(0, 255, 128);
            _numParticles = Width * Height * 0.25f;
            _particleSize = 2;
        }
Beispiel #24
0
        public FadingBars(IEffectApi api, int width, int height) : base(width, height)
        {
            _api    = api;
            _color  = new SKColor(0, 255, 128);
            _render = _api.CreateRender();

            _maxNumBars = Math.Min((int)(width / 2), 12);
            _numBars    = 4;
            _maxBarLife = 1.0f;
            _barSize    = (int)(width / _numBars);
            _lastBar    = -1;
            _rand       = new Random();

            InitBars();
        }
Beispiel #25
0
        /*	This constructor will be called when a layer of your effect is being created. */
        public Wave1D(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            /*	Save the effect api in your class, you will need it. */
            _api = effectApi;

            /*	Set the default color. */
            _color = new SKColor(0, 128, 128);

            /*	Create a render for your effect using the effect api. */
            _render = _api.CreateRender();

            /*	Create a wave simulation using the effect api. */
            _waveSimulation = _api.CreateWaveSimulation1D();

            /*	Lets double the wave speeds */
            _waveSimulation.Speed = 2.0;
        }
Beispiel #26
0
        public Blob(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            _api    = effectApi;
            _color  = new SKColor(0, 128, 128);
            _render = _api.CreateRender();

            _x0Pos = Width / 2;
            _y0Pos = Height / 2;

            if (Width >= Height && Height > 1)
            {
                _ySize = Height / 2;
                _xSize = _ySize;
            }
            else
            {
                _xSize = Width / 2;
                _ySize = _xSize;
            }
        }
Beispiel #27
0
        public Fire(IEffectApi effectApi, int width, int height) : base(width, height)
        {
            _api            = effectApi;
            _render         = _api.CreateRender();
            _particleSystem = _api.CreateParticleSystem();

            _beginColor = new SKColor(128, 64, 16);
            var endColor = new SKColor(64, 64, 64);

            _particleEmitters = new List <IParticleEmitter>();

            int numEmbers = Math.Max((int)(Width / EmberDistance), 1);

            for (int i = 0; i < numEmbers; i++)
            {
                var xPos = Width / (numEmbers - 1f) * i;
                var yPos = Height;

                var emitterConfig = new ParticleEmitterConfig
                {
                    Position               = new Vector2(xPos, yPos),
                    AxisPosition           = new Vector2(xPos, yPos),
                    EmissionRate           = 8,
                    Angle                  = new Range <float>(45, 135),
                    Life                   = 4,
                    Speed                  = 4,
                    RadialAcceleration     = 0,
                    TangentialAcceleration = 0,
                    BeginColor             = _beginColor,
                    EndColor               = endColor,
                    BeginSize              = 4,
                    EndSize                = 4,
                    EnableSizeTransition   = true,
                    EnableColorTransition  = true,
                };

                var emitter = _particleSystem.AddEmitter(emitterConfig);
                _particleEmitters.Add(emitter);
            }
        }
Beispiel #28
0
 public FluidApi(IEffectApi effectApi)
 {
     this.effectApi = effectApi;
 }
Beispiel #29
0
 public static void RegisterEffect <TComponent1, TComponent2, TComponent3>(this IEffectApi @this, Affects affects)
 {
     @this.RegisterEffect <TComponent1>(affects);
     @this.RegisterEffect <TComponent2>(affects);
     @this.RegisterEffect <TComponent3>(affects);
 }
Beispiel #30
0
 public static void RegisterEffect <TComponent1, TComponent2>(this IEffectApi @this, IEffectSystem system, IEffectRenderer renderer, Affects affects)
 {
     @this.RegisterEffect <TComponent1>(system, renderer, affects);
     @this.RegisterEffect <TComponent2>(affects);
 }