public GtPlayedNotesAnalyserHelper(GtFactory pFactory, IAudioListener pAudioListener)
        {
            if (pAudioListener == null)
            {
                throw new Exception("pAudioListener can't be null!");
            }


            this.Factory       = pFactory;
            this.AudioListener = pAudioListener;

            this.LastQueriedPlayedNotes = new List <MusicalNoteAndTimeStamp>();
            this.SpectrumAnalyzer       = this.Factory.Instantiate <ISpectrumAnalyzer>();
        }
Exemplo n.º 2
0
 /// <inheritdoc/>
 public bool Equals(IAudioListener other)
 {
     if (other is AudioListener)
     {
         var o = (AudioListener)other;
         return(AudioDevice == o.AudioDevice &&
                Gain == other.Gain &&
                Position == other.Position &&
                Velocity == other.Velocity &&
                Up == other.Up &&
                At == other.At);
     }
     return(false);
 }
Exemplo n.º 3
0
        public AudioDevice(string deviceName)
        {
            if (deviceName != null && !AvailableDevices.Contains(deviceName))
            {
                throw new InvalidOperationException(string.Format("AudioDevice \"{0}\" does not exist.", deviceName));
            }

            Context = new OpenTK.Audio.AudioContext(deviceName, 0, 15, true, true, AudioContext.MaxAuxiliarySends.UseDriverDefault);
            CheckAlcError();
            deviceHandle = Alc.GetContextsDevice(Alc.GetCurrentContext());
            CheckAlcError();
            Efx = new EffectsExtension();
            CheckAlcError();

            int[] val = new int[4];
            DeviceName    = Context.CurrentDevice;
            VendorName    = AL.Get(ALGetString.Vendor);
            Renderer      = AL.Get(ALGetString.Renderer);
            DriverVersion = AL.Get(ALGetString.Version);
            int major, minor;

            Alc.GetInteger(deviceHandle, AlcGetInteger.MajorVersion, 1, val);
            major = val[0];
            Alc.GetInteger(deviceHandle, AlcGetInteger.MinorVersion, 1, val);
            minor   = val[0];
            Version = new Version(major, minor);
            Alc.GetInteger(deviceHandle, AlcGetInteger.EfxMajorVersion, 1, val);
            major = val[0];
            Alc.GetInteger(deviceHandle, AlcGetInteger.EfxMinorVersion, 1, val);
            minor      = val[0];
            EfxVersion = new Version(major, minor);
            Alc.GetInteger(deviceHandle, AlcGetInteger.EfxMaxAuxiliarySends, 1, val);
            MaxRoutes  = val[0];
            Extensions = new List <string>(AL.Get(ALGetString.Extensions).Split(' ')).AsReadOnly();

            AL.DistanceModel(ALDistanceModel.ExponentDistance);

            CheckAudioCapabilities(LogLevel.Verbose);
            LogDiagnostics(LogLevel.Verbose);

            Factory  = new AudioFactory(this);
            Listener = new AudioListener(this);
            Listener.Orientation(Vector3.UnitY, Vector3.UnitZ);

            updateTaskCancelation = new CancellationTokenSource();
            updateTask            = Task.Factory.StartNew(Update);
        }
Exemplo n.º 4
0
        public GtPlayedNotesAnalyser(GtFactory pFactory, IAudioListener pAudioListener)
        {
            this.fFactory = pFactory;

            this.AnalyserHelper = this.fFactory.Instantiate <IGtPlayedNotesAnalyserHelper>(pFactory, pAudioListener);
        }
Exemplo n.º 5
0
 void IDisposable.Dispose()
 {
     listener = null;
     NatCorderAudio.Destroy(this);
 }
Exemplo n.º 6
0
        public ALAudioSystem(IAudioBackend backend, IAudioListener listener, IAudioErrors errors)
		{
            _backend = backend;
            Listener = listener;
			_errors = errors;
		}
Exemplo n.º 7
0
 public MockGtPlayedNotesAnalyserHelperAlwaysIsNotPlaying(GtFactory pFactory, IAudioListener pAudioListener)
 {
 }
Exemplo n.º 8
0
 public ALAudioSystem(IAudioBackend backend, IAudioListener listener, IAudioErrors errors)
 {
     _backend = backend;
     Listener = listener;
     _errors  = errors;
 }
 public GtPlayedNotesAnalyserHelperMock(GtFactory pFactory, IAudioListener pAudioListener)
     : base(pFactory, pAudioListener)
 {
 }