protected override void OnInitNewState(Context context)
        {
            base.OnInitNewState(context);

            m_audio = m_sequence.ToAudio();
            m_audio.InitNewState(context);
        }
Exemplo n.º 2
0
        //could expose the list but I want the interfaces for mix and split to be consistent
        public void AddInput(IAudioNode input)
        {
            MixerChannel mixerIn = new MixerChannel();

            mixerIn.inputNode = input;
            mixerIn.pan = 0.5;
            mixerIn.outputLevel = 1.0;

            m_inputs.Add(mixerIn);
        }
Exemplo n.º 3
0
        public static void SwitchEffect(this IAudioNode node, bool on, IAudioEffectDefinition effect)
        {
            if (effect == null)
            {
                return;
            }

            if (on)
            {
                node.EnableEffectsByDefinition(effect);
            }
            else
            {
                node.DisableEffectsByDefinition(effect);
            }
        }
Exemplo n.º 4
0
        public IAudioNode DecorateAudioNode(IAudioNode node, XmlElement element, Context context)
        {
            HashSet<string> existingAttrs = new HashSet<string>();

            for (int i = 0; i < element.Attributes.Count; i++)
            {
                existingAttrs.Add(element.Attributes[i].LocalName);
            }

            foreach (XmlNode child in element.ChildNodes)
            {
                int attrIndex = child.LocalName.IndexOf('.');

                if (attrIndex != -1)
                {
                    existingAttrs.Add(child.LocalName.Substring(attrIndex + 1));
                }
            }

            foreach (DecoratorInfo decorator in m_audioDecorators)
            {
                if (decorator.triggeredProperties.Overlaps(existingAttrs))
                {
                    IAudioDecoratorNode decoratorNode = decorator.ctor();
                    decoratorNode.XmlData = element;
                    decoratorNode.DecoratedNode = node;
                    node = decoratorNode;
                }
            }

            return node;
        }
Exemplo n.º 5
0
 //could expose the list but I want the interfaces for mix and split to be consistent
 public void AddInput(IAudioNode input)
 {
     m_inputs.Add(input);
 }