Ejemplo n.º 1
0
        protected virtual void OnProfilerTimeChanged(OscMessage message)
        {
            var channel = message.GetChannel();

            if (channel == null)
            {
                return;
            }

            var currentValue  = (float)(message.ElementAtOrDefault(0));
            var expectedValue = (float)(message.ElementAtOrDefault(1));

            ProfilerTimeChanged?.Invoke(this, new ProfilerTimeEventArgs(currentValue, expectedValue, channel.Value));
        }
Ejemplo n.º 2
0
        protected virtual void OnPlaybackClipTimeChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }

            var elapsed = (float)(message.ElementAtOrDefault(0));
            var total   = (float)(message.ElementAtOrDefault(1));

            PlaybackClipTimeChanged?.Invoke(this, new PlaybackClipTimeEventArgs(elapsed, total, message.IsBackground(), channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 3
0
        protected virtual void OnConsumerFrameCreatedChanged(OscMessage message)
        {
            var channel = message.GetChannel();

            if (channel == null)
            {
                return;
            }

            var usedFrames      = Convert.ToInt32(message.ElementAtOrDefault(0));
            var availableFrames = Convert.ToInt32(message.ElementAtOrDefault(1));
            var port            = message.GetNextAddressPartOf(Port).TryParseNullable();

            ConsumerFrameCreatedChanged?.Invoke(this, new ConsumerFrameCreatedEventArgs(usedFrames, availableFrames, port.GetValueOrDefault(0), channel.Value));
        }
Ejemplo n.º 4
0
        protected virtual void OnLayerProfilerChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }

            var actual   = (float?)message.ElementAtOrDefault(0);
            var expected = (float?)message.ElementAtOrDefault(1);

            if (actual == null || expected == null)
            {
                return;
            }

            LayerProfilerChanged?.Invoke(this, new LayerProfilerEventArgs(actual.Value, expected.Value, channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 5
0
        protected virtual void OnMixerAudioDbfsChanged(OscMessage message)
        {
            var channelId = message.GetChannel();

            if (channelId == null)
            {
                return;
            }
            var dbfs = (float)(message.ElementAtOrDefault(0));

            MixerAudioDbfsChanged?.Invoke(this, new MixerAudioDbfsEventArgs(dbfs, channelId.Value));
        }
Ejemplo n.º 6
0
        protected virtual void OnTemplatePathChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }
            var path = message.ElementAtOrDefault(0)?.ToString();

            TemplatePathChanged?.Invoke(this, new TemplatePathEventArgs(path, channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 7
0
        protected virtual void OnTemplateWidthChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }
            var width = Convert.ToUInt32(message.ElementAtOrDefault(0));

            TemplateWidthChanged?.Invoke(this, new TemplateWidthEventArgs(width, channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 8
0
        protected virtual void OnTemplateFpsChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }
            var fps = (float)message.ElementAtOrDefault(0);

            TemplateFpsChanged?.Invoke(this, new TemplateFpsEventArgs(fps, channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 9
0
        protected virtual void OnFlashBufferChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }
            var buffer = Convert.ToInt32(message.ElementAtOrDefault(0));

            FlashProducerBufferChanged?.Invoke(this, new BufferEventArgs(buffer, channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 10
0
        protected virtual void OnMixerAudioChannelsCountChanged(OscMessage message)
        {
            var channelId = message.GetChannel();

            if (channelId == null)
            {
                return;
            }
            var channelsCount = Convert.ToInt32(message.ElementAtOrDefault(0));

            MixerAudioChannelsCountChanged?.Invoke(this, new MixerAudioChannelsCountEventArgs(channelsCount, channelId.Value));
        }
Ejemplo n.º 11
0
        protected virtual void OnLayerTypeChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }

            var type = message.ElementAtOrDefault(0)?.ToString();

            LayerTypeChanged?.Invoke(this, new LayerTypeEventArgs(type, channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 12
0
        protected virtual void OnLayerActiveFrameChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }

            var frame = Convert.ToUInt32(message.ElementAtOrDefault(0));

            LayerActiveFrameChanged?.Invoke(this, new LayerActiveFrameEventArgs(frame, channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 13
0
        protected virtual void OnPlaybackClipFrameRateChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }

            var fps = (float)(message.ElementAtOrDefault(0));

            PlaybackClipFrameRateChanged?.Invoke(this, new PlaybackClipFrameRateEventArgs(fps, message.IsBackground(), channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 14
0
        protected virtual void OnPlaybackClipWidthChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }

            var width = Convert.ToInt32(message.ElementAtOrDefault(0));

            PlaybackClipWidthChanged?.Invoke(this, new PlaybackClipWidthEventArgs((uint)width, message.IsBackground(), channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 15
0
        protected virtual void OnPlaybackClipAudioFrameRateChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }

            var sampleRate = Convert.ToInt32(message.ElementAtOrDefault(0));

            PlaybackClipAudioSampleRateChanged?.Invoke(this, new PlaybackClipAudioSampleRateEventArg((uint)sampleRate, message.IsBackground(), channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 16
0
        protected virtual void OnOutputFormatChanged(OscMessage message)
        {
            var channel = message.GetChannel();

            if (channel == null)
            {
                return;
            }

            var format = message.ElementAtOrDefault(0)?.ToString();


            OutputFormatChanged?.Invoke(this, new OutputFormatEventArgs(format, channel.Value));
        }
Ejemplo n.º 17
0
        protected virtual void OnStreamFramerateChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }

            var fps      = (float)(message.ElementAtOrDefault(0));
            var streamId = uint.TryParse(message.GetNextAddressPartOf("file"), out uint outValue) ? (uint?)outValue : null;

            StreamFrameRateChanged?.Invoke(this, new StreamFramerateEventArgs(fps, streamId.GetValueOrDefault(0), message.IsBackground(), channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 18
0
        protected virtual void OnOutputTypePortChanged(OscMessage message)
        {
            var channel = message.GetChannel();

            if (channel == null)
            {
                return;
            }

            var type = message.ElementAtOrDefault(0)?.ToString();
            var port = message.GetNextAddressPartOf(Port).TryParseNullable();

            OutputPortChanged?.Invoke(this, new OutputPortTypeEventArgs(type, port.GetValueOrDefault(0), channel.Value));
        }
Ejemplo n.º 19
0
        protected virtual void OnLayerPaused(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }

            var isPause = (bool?)message.ElementAtOrDefault(0);

            if (isPause == null)
            {
                return;
            }
            LayerPausedChanged?.Invoke(this, new LayerPausedEventArgs(isPause.Value, channelLayer.Item1.Value, channelLayer.Item2.Value));
        }
Ejemplo n.º 20
0
        protected virtual void OnLayerActiveTimeChanged(OscMessage message)
        {
            var channelLayer = message.GetChannelAndLayer();

            if (channelLayer.Item1 == null || channelLayer.Item2 == null)
            {
                return;
            }

            var time = (float?)message.ElementAtOrDefault(0);

            if (time == null)
            {
                return;
            }

            LayerActiveTimeChanged?.Invoke(this, new LayerActiveTimeEventArgs(time.Value, channelLayer.Item1.Value, channelLayer.Item2.Value));
        }