Пример #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;
        }
Пример #2
0
 public void SetValue(float value, AUParameterObserverToken originator, ulong hostTime)
 {
     SetValue(value, originator.ObserverToken, hostTime);
 }
Пример #3
0
 public void SetValue(float value, AUParameterObserverToken originator)
 {
     SetValue(value, originator.ObserverToken);
 }
Пример #4
0
 public void RemoveParameterObserver(AUParameterObserverToken token)
 {
     RemoveParameterObserver(token.ObserverToken);
 }
Пример #5
0
 public void RemoveParameterObserver(AUParameterObserverToken token)
 {
     _RemoveParameterObserver (token.ObserverToken);
 }
Пример #6
0
 public void SetValue(float value, AUParameterObserverToken originator, ulong hostTime)
 {
     _SetValue (value, originator.ObserverToken, hostTime);
 }
Пример #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;
		}