Example #1
0
        protected override void _PreRender(CancellationTokenSource tokenSource = null)
        {
            ElementData = new EffectIntents();

            if (Media == null || Media.Count == 0)
            {
                Logging.Warn("No audio available to render effect!");
                return;
            }

            foreach (IMediaModuleInstance module in Media)
            {
                var audio = module as Audio;
                if (audio != null)
                {
                    if (audio.Channels == 0)
                    {
                        continue;
                    }

                    _audioUtilities.TimeSpan  = TimeSpan;
                    _audioUtilities.StartTime = StartTime;
                    _audioUtilities.ReloadAudio(audio);
                }
            }

            if (!_audioUtilities.AudioLoaded)
            {
                Logging.Warn("Unable to load audio to render audio effect!");
                return;
            }

            var nodes = GetNodesToRenderOn();

            foreach (ElementNode node in nodes)
            {
                if (tokenSource != null && tokenSource.IsCancellationRequested)
                {
                    return;
                }

                if (node != null)
                {
                    RenderNode(node);
                }
            }

            _audioUtilities.FreeMem();
        }
Example #2
0
 protected override void CleanUpRender()
 {
     _fireworkBursts = null;
     _audioUtilities.FreeMem();
 }