Exemplo n.º 1
0
        void ConnectViewWithAU()
        {
            var au = AudioUnit;

            if (au == null)
            {
                return;
            }

            var paramTree = au.ParameterTree;

            if (paramTree == null)
            {
                return;
            }

            cutoffParameter    = (AUParameter)paramTree.ValueForKey(cutoffKey);
            resonanceParameter = (AUParameter)paramTree.ValueForKey(resonanceKey);

            parameterObserverToken = paramTree.CreateTokenByAddingParameterObserver((address, value) =>
                                                                                    DispatchQueue.MainQueue.DispatchAsync(() => {
                if (address == cutoffParameter.Address)
                {
                    filterView.Frequency = value;
                    frequencyLabel.Text  = cutoffParameter.GetString(null);
                }
                else if (address == resonanceParameter.Address)
                {
                    filterView.Resonance = value;
                    resonanceLabel.Text  = resonanceParameter.GetString(null);
                }

                UpdateFilterViewFrequencyAndMagnitudes();
            })
                                                                                    );

            filterView.Frequency = cutoffParameter.Value;
            filterView.Resonance = resonanceParameter.Value;
        }
Exemplo n.º 2
0
 public void SetValue(float value, AUParameterObserverToken originator, ulong hostTime)
 {
     SetValue(value, originator.ObserverToken, hostTime);
 }
Exemplo n.º 3
0
 public void SetValue(float value, AUParameterObserverToken originator)
 {
     SetValue(value, originator.ObserverToken);
 }
Exemplo n.º 4
0
 public void RemoveParameterObserver(AUParameterObserverToken token)
 {
     RemoveParameterObserver(token.ObserverToken);
 }
Exemplo n.º 5
0
 public void RemoveParameterObserver(AUParameterObserverToken token)
 {
     _RemoveParameterObserver (token.ObserverToken);
 }
Exemplo n.º 6
0
 public void SetValue(float value, AUParameterObserverToken originator, ulong hostTime)
 {
     _SetValue (value, originator.ObserverToken, hostTime);
 }
Exemplo n.º 7
0
 public void SetValue(float value, AUParameterObserverToken originator)
 {
     _SetValue (value, originator.ObserverToken);
 }
		void ConnectViewWithAU ()
		{
			var au = AudioUnit;
			if (au == null)
				return;
			
			var paramTree = au.ParameterTree;
			if (paramTree == null)
				return;

			cutoffParameter = (AUParameter)paramTree.ValueForKey (cutoffKey);
			resonanceParameter = (AUParameter)paramTree.ValueForKey (resonanceKey);
		
			parameterObserverToken = paramTree.CreateTokenByAddingParameterObserver ((address, value) =>
				DispatchQueue.MainQueue.DispatchAsync (() => {
					if (address == cutoffParameter.Address) {
						filterView.Frequency = value;
						frequencyLabel.Text = cutoffParameter.GetString (null);
					} else if (address == resonanceParameter.Address) {
						filterView.Resonance = value;
						resonanceLabel.Text = resonanceParameter.GetString (null);
					}

					UpdateFilterViewFrequencyAndMagnitudes ();
				})
			);

			filterView.Frequency = cutoffParameter.Value;
			filterView.Resonance = resonanceParameter.Value;
		}