Example #1
0
        /// <summary>
        /// Changes the type of an in-progress call
        /// </summary>
        /// <param name="callIndex"></param>
        /// <param name="settings"></param>
        /// <returns></returns>
        public ToxAvError ChangeSettings(int callIndex, ToxAvCodecSettings settings)
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(GetType().FullName);
            }

            return(ToxAvFunctions.ChangeSettings(_toxAv, callIndex, ref settings));
        }
Example #2
0
        /// <summary>
        /// Answers a call.
        /// </summary>
        /// <param name="call_index"></param>
        /// <param name="settings"></param>
        /// <returns></returns>
        public ToxAvError Answer(int call_index, ToxAvCodecSettings settings)
        {
            if (disposed)
            {
                throw new ObjectDisposedException(GetType().FullName);
            }

            return(ToxAvFunctions.Answer(toxav, call_index, ref settings));
        }
Example #3
0
        /// <summary>
        /// Retrieves a peer's codec settings.
        /// </summary>
        /// <param name="callIndex"></param>
        /// <param name="peer"></param>
        /// <returns></returns>
        public ToxAvCodecSettings GetPeerCodecSettings(int callIndex, int peer)
        {
            ThrowIfDisposed();

            ToxAvCodecSettings settings = new ToxAvCodecSettings();

            ToxAvFunctions.GetPeerCodecSettings(_toxAv, callIndex, peer, ref settings);

            return(settings);
        }
Example #4
0
        /// <summary>
        /// Creates a new call.
        /// </summary>
        /// <param name="callIndex"></param>
        /// <param name="friendNumber"></param>
        /// <param name="settings"></param>
        /// <param name="ringingSeconds"></param>
        /// <returns></returns>
        public ToxAvError Call(int friendNumber, ToxAvCodecSettings settings, int ringingSeconds, out int callIndex)
        {
            ThrowIfDisposed();

            int        index  = new int();
            ToxAvError result = ToxAvFunctions.Call(_toxAv, ref index, friendNumber, ref settings, ringingSeconds);

            callIndex = index;
            return(result);
        }
Example #5
0
        /// <summary>
        /// Retrieves a peer's codec settings.
        /// </summary>
        /// <param name="callIndex"></param>
        /// <param name="peer"></param>
        /// <returns></returns>
        public ToxAvCodecSettings GetPeerCodecSettings(int callIndex, int peer)
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(GetType().FullName);
            }

            ToxAvCodecSettings settings = new ToxAvCodecSettings();

            ToxAvFunctions.GetPeerCodecSettings(_toxAv, callIndex, peer, ref settings);

            return(settings);
        }
Example #6
0
        /// <summary>
        /// Creates a new call.
        /// </summary>
        /// <param name="callIndex"></param>
        /// <param name="friendNumber"></param>
        /// <param name="settings"></param>
        /// <param name="ringingSeconds"></param>
        /// <returns></returns>
        public ToxAvError Call(int friendNumber, ToxAvCodecSettings settings, int ringingSeconds, out int callIndex)
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(GetType().FullName);
            }

            int        index  = new int();
            ToxAvError result = ToxAvFunctions.Call(_toxAv, ref index, friendNumber, ref settings, ringingSeconds);

            callIndex = index;
            return(result);
        }
Example #7
0
        /// <summary>
        /// Initialises a new instance of toxav.
        /// </summary>
        /// <param name="tox"></param>
        /// <param name="settings"></param>
        /// <param name="max_calls"></param>
        public ToxAv(ToxHandle tox, ToxAvCodecSettings settings, int max_calls)
        {
            toxav = ToxAvFunctions.New(tox, max_calls);

            if (toxav == null || toxav.IsInvalid)
            {
                throw new Exception("Could not create a new instance of toxav.");
            }

            MaxCalls      = max_calls;
            CodecSettings = settings;

            Invoker = new InvokeDelegate(dummyinvoker);

            callbacks();
        }
Example #8
0
        /// <summary>
        /// Changes the type of an in-progress call
        /// </summary>
        /// <param name="call_index"></param>
        /// <param name="settings"></param>
        /// <returns></returns>
        public ToxAvError ChangeSettings(int call_index, ToxAvCodecSettings settings)
        {
            if (disposed)
                throw new ObjectDisposedException(GetType().FullName);

            return ToxAvFunctions.ChangeSettings(toxav, call_index, ref settings);
        }
Example #9
0
        /// <summary>
        /// Initialises a new instance of toxav.
        /// </summary>
        /// <param name="tox"></param>
        /// <param name="settings"></param>
        /// <param name="max_calls"></param>
        public ToxAv(ToxHandle tox, ToxAvCodecSettings settings, int max_calls)
        {
            toxav = ToxAvFunctions.New(tox, max_calls);

            if (toxav == null || toxav.IsInvalid)
                throw new Exception("Could not create a new instance of toxav.");

            MaxCalls = max_calls;
            CodecSettings = settings;

            Invoker = new InvokeDelegate(dummyinvoker);

            callbacks();
        }
Example #10
0
        /// <summary>
        /// Creates a new call.
        /// </summary>
        /// <param name="call_index"></param>
        /// <param name="friend_number"></param>
        /// <param name="settings"></param>
        /// <param name="ringing_seconds"></param>
        /// <returns></returns>
        public ToxAvError Call(int friend_number, ToxAvCodecSettings settings, int ringing_seconds, out int call_index)
        {
            if (disposed)
                throw new ObjectDisposedException(GetType().FullName);

            int index = new int();
            ToxAvError result = ToxAvFunctions.Call(toxav, ref index, friend_number, ref settings, ringing_seconds);

            call_index = index;
            return result;
        }
Example #11
0
        /// <summary>
        /// Changes the type of an in-progress call
        /// </summary>
        /// <param name="callIndex"></param>
        /// <param name="settings"></param>
        /// <returns></returns>
        public ToxAvError ChangeSettings(int callIndex, ToxAvCodecSettings settings)
        {
            ThrowIfDisposed();

            return ToxAvFunctions.ChangeSettings(_toxAv, callIndex, ref settings);
        }
Example #12
0
        /// <summary>
        /// Retrieves a peer's codec settings.
        /// </summary>
        /// <param name="callIndex"></param>
        /// <param name="peer"></param>
        /// <returns></returns>
        public ToxAvCodecSettings GetPeerCodecSettings(int callIndex, int peer)
        {
            ThrowIfDisposed();

            ToxAvCodecSettings settings = new ToxAvCodecSettings();
            ToxAvFunctions.GetPeerCodecSettings(_toxAv, callIndex, peer, ref settings);

            return settings;
        }
Example #13
0
        public override void Start(int input, int output, ToxAvCodecSettings settings, string videoDevice = "")
        {
            WaveFormat outFormat = new WaveFormat((int)settings.AudioSampleRate, 2);
            WaveFormat outFormatSingle = new WaveFormat((int)settings.AudioSampleRate, 1);

            filterAudio = new FilterAudio((int)settings.AudioSampleRate);
            filterAudio.EchoFilterEnabled = false;

            wave_provider = new BufferedWaveProvider(outFormat);
            wave_provider.DiscardOnBufferOverflow = true;
            wave_provider_single = new BufferedWaveProvider(outFormatSingle);
            wave_provider_single.DiscardOnBufferOverflow = true;

            if (WaveIn.DeviceCount > 0)
            {
                wave_source = new WaveInEvent();

                if (input != -1)
                    wave_source.DeviceNumber = input;

                WaveFormat inFormat = new WaveFormat((int)ToxAv.DefaultCodecSettings.AudioSampleRate, 1);

                wave_source.WaveFormat = inFormat;
                wave_source.DataAvailable += wave_source_DataAvailable;
                wave_source.RecordingStopped += wave_source_RecordingStopped;
                wave_source.BufferMilliseconds = ToxAv.DefaultCodecSettings.AudioFrameDuration;
            }

            if (WaveOut.DeviceCount > 0)
            {
                wave_out = new WaveOut();

                if (output != -1)
                    wave_out.DeviceNumber = output;

                wave_out.Init(wave_provider);
                wave_out.Play();

                wave_out_single = new WaveOut();

                if (output != -1)
                    wave_out.DeviceNumber = output;

                wave_out.Init(wave_provider_single);
                wave_out.Play();
            }
        }
Example #14
0
        /// <summary>
        /// Creates a new call.
        /// </summary>
        /// <param name="callIndex"></param>
        /// <param name="friendNumber"></param>
        /// <param name="settings"></param>
        /// <param name="ringingSeconds"></param>
        /// <returns></returns>
        public ToxAvError Call(int friendNumber, ToxAvCodecSettings settings, int ringingSeconds, out int callIndex)
        {
            ThrowIfDisposed();

            int index = new int();
            ToxAvError result = ToxAvFunctions.Call(_toxAv, ref index, friendNumber, ref settings, ringingSeconds);

            callIndex = index;
            return result;
        }
Example #15
0
 internal static extern ToxAvError Answer(ToxAvHandle toxAv, int callIndex, ref ToxAvCodecSettings settings);
Example #16
0
 public void Call(int current_number, ToxAvCodecSettings settings, int ringing_seconds)
 {
     toxav.Call(current_number, settings, ringing_seconds, out CallIndex);
 }
Example #17
0
 public static extern ToxAvError ChangeSettings(ToxAvHandle toxAv, int callIndex, ref ToxAvCodecSettings settings);
Example #18
0
 public static extern ToxAvError Call(ToxAvHandle toxav, ref int call_index, int friend_number, ref ToxAvCodecSettings settings, int ringing_seconds);
Example #19
0
 public static extern ToxAvError Answer(ToxAvHandle toxav, int call_index, ref ToxAvCodecSettings settings);
Example #20
0
 public static extern ToxAvError ChangeSettings(ToxAvHandle toxav, int call_index, ref ToxAvCodecSettings settings);
Example #21
0
 public static extern int GetPeerCodecSettings(ToxAvHandle toxav, int call_index, int peer, ref ToxAvCodecSettings settings);
Example #22
0
        /// <summary>
        /// Retrieves a peer's codec settings.
        /// </summary>
        /// <param name="call_index"></param>
        /// <param name="peer"></param>
        /// <returns></returns>
        public ToxAvCodecSettings GetPeerCodecSettings(int call_index, int peer)
        {
            if (disposed)
                throw new ObjectDisposedException(GetType().FullName);

            ToxAvCodecSettings settings = new ToxAvCodecSettings();
            ToxAvFunctions.GetPeerCodecSettings(toxav, call_index, peer, ref settings);

            return settings;
        }
Example #23
0
        /// <summary>
        /// Answers a call.
        /// </summary>
        /// <param name="callIndex"></param>
        /// <param name="settings"></param>
        /// <returns></returns>
        public ToxAvError Answer(int callIndex, ToxAvCodecSettings settings)
        {
            ThrowIfDisposed();

            return ToxAvFunctions.Answer(_toxAv, callIndex, ref settings);
        }
Example #24
0
 public static extern ToxAvError Call(ToxAvHandle toxAv, ref int callIndex, int friend_number, ref ToxAvCodecSettings settings, int ringingSeconds);
Example #25
0
 /// <summary>
 /// Not implemented.
 /// </summary>
 public override void Call(int current_number, ToxAvCodecSettings settings, int ringing_seconds)
 {
     throw new NotImplementedException();
 }
Example #26
0
 public static extern int GetPeerCodecSettings(ToxAvHandle toxAv, int callIndex, int peer, ref ToxAvCodecSettings settings);
Example #27
0
        /// <summary>
        /// Changes the type of an in-progress call
        /// </summary>
        /// <param name="callIndex"></param>
        /// <param name="settings"></param>
        /// <returns></returns>
        public ToxAvError ChangeSettings(int callIndex, ToxAvCodecSettings settings)
        {
            ThrowIfDisposed();

            return(ToxAvFunctions.ChangeSettings(_toxAv, callIndex, ref settings));
        }