Beispiel #1
0
        /// <summary>
        /// Sets up a new OpenAL buffer for this AudioData. This will result in decompressing
        /// the <see cref="Duality.OggVorbis.OV">Ogg Vorbis</see> data and uploading it to OpenAL,
        /// unless the AudioData is streamed.
        /// </summary>
        public void SetupAlBuffer()
        {
            // No AudioData available
            if (this.data.Length == 0 || this.data == null)
            {
                this.DisposeAlBuffer();
                return;
            }

            // Streamed Audio
            if (this.IsStreamed)
            {
                this.DisposeAlBuffer();
                this.alBuffer = AlBuffer_StreamMe;
            }
            // Non-Streamed Audio
            else
            {
                if (this.alBuffer <= AlBuffer_NotAvailable && DualityApp.Sound.IsAvailable)
                {
                    this.alBuffer = AL.GenBuffer();
                    PcmData pcm = OV.LoadFromMemory(this.data);
                    AL.BufferData(
                        this.alBuffer,
                        pcm.channelCount == 1 ? ALFormat.Mono16 : ALFormat.Stereo16,
                        pcm.data.ToArray(),
                        (int)pcm.data.Length,
                        pcm.sampleRate);
                }
                else
                {
                    // Buffer already there? Do nothing.
                }
            }
        }
Beispiel #2
0
        public void opOVI(Ice.AsyncResult result)
        {
            OV i = (OV)result.AsyncState;
            OV o;
            OV r = MyClassPrxHelper.uncheckedCast(result.getProxy()).end_opOV(out o, result);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
            callback.called();
        }
    void Start()
    {
        obj  = GameObject.FindGameObjectWithTag("Elevator");
        obj2 = GameObject.FindGameObjectWithTag("GameModeManager");

        OST_Intro = FMODUnity.RuntimeManager.CreateInstance("event:/OST/OST_Intro");
        OST_Intro.getParameter("MainGame", out MainGame);
        OST_Intro.getParameter("IV", out IV);
        MainGame.setValue(0);
        IV.setValue(0.9f);

        OST_Intro.start();

        OST_2 = FMODUnity.RuntimeManager.CreateInstance("event:/OST/OST_2");
        OST_2.getParameter("MainGame2", out MainGame2);
        OST_2.getParameter("OV", out OV);
        OST_2.getParameter("EndGame", out EndGame);
        OST_2.getParameter("GameOver", out GameOver);
        MainGame2.setValue(0);
        EndGame.setValue(0);
        GameOver.setValue(0);
        OV.setValue(0.9f);

        FluxEffect = FMODUnity.RuntimeManager.CreateInstance("event:/SD/FluxCarrier");
        FluxEffect.getParameter("FV", out FV);
        FV.setValue(0.8f);

        Checkpoint = FMODUnity.RuntimeManager.CreateInstance("event:/SD/Hexagon");
        Checkpoint.getParameter("HV", out HV);
        Checkpoint.getParameter("HP", out HP);
        HV.setValue(0.95f);
        HP.setValue(0);

        Jump = FMODUnity.RuntimeManager.CreateInstance("event:/SD/Jump");
        Jump.getParameter("JV", out JV);
        JV.setValue(0.8f);

        Headroll = FMODUnity.RuntimeManager.CreateInstance("event:/SD/Headroll");
        Headroll.getParameter("HRV", out HRV);
        HRV.setValue(0.75f);

        JumpPad = FMODUnity.RuntimeManager.CreateInstance("event:/SD/JumpPad");
        JumpPad.getParameter("JPV", out JPV);
        JPV.setValue(0.74f);

        Atmosphere = FMODUnity.RuntimeManager.CreateInstance("event:/SD/Atmosphere");
        Atmosphere.getParameter("AV", out AV);
        AV.setValue(0.7f);

        Atmosphere.start();

        Stinger = FMODUnity.RuntimeManager.CreateInstance("event:/SD/Stinger");
        Stinger.getParameter("STV", out STV);
        STV.setValue(0.8f);
    }
Beispiel #4
0
        private void OnDisposed(bool manually)
        {
            if (manually)
            {
                if (this.strWorker != null && this.strWorker.IsAlive)
                {
                    lock (this.strLock)
                    {
                        if (this.strOvStr != IntPtr.Zero)
                        {
                            OV.EndStream(ref this.strOvStr);
                        }
                    }
                }
                this.strWorker = null;

                this.attachedTo  = null;
                this.curPriority = -1;

                lock (this.strLock)
                {
                    if (this.alSource > AlSource_NotAvailable)
                    {
                        this.CleanupAlSource();
                        DualityApp.Sound.FreeAlSource(this.alSource);
                        this.alSource = AlSource_NotAvailable;
                    }
                    if (this.strAlBuffers != null)
                    {
                        for (int i = 0; i < this.strAlBuffers.Length; i++)
                        {
                            if (!AL.IsBuffer(this.strAlBuffers[i]))
                            {
                                continue;
                            }
                            AL.DeleteBuffer(this.strAlBuffers[i]);
                        }
                        this.strAlBuffers = null;
                    }
                }
            }
        }
Beispiel #5
0
        public void SendReply()
        {
            if (!Client.Connected || Handled)
            {
                return;
            }

            Client.SendLine("HTTP/1.1 ", Result.Status);
            Client.SendLine("Date: ", DateTime.UtcNow.HttpTimeString());

            if (this.Data != null && Data.Length > 0)
            {
                if (Result.Headers.Search <string>("content-type") == null)
                {
                    Client.SendLine("Content-Type: ", Result.MIME);
                }
                Client.SendLine("Content-Length: ", Data.Length.ToString());
            }
            else
            {
                Client.SendLine("Content-Length: 0");
            }

            Result.Headers.ForEach((K, V) => {
                Client.SendLine(K, ": ", V.ToString());
            });

            Result.Cookies.ForEach <jsObject>((K, V) => {
                Client.Send("Set-Cookie: ");

                V.ForEach((OK, OV) => {
                    Client.Send(OK, "=", OV.ToString(), ";");
                });

                Client.SendLine();
            });

            Client.SendLine();
        }
Beispiel #6
0
        public ObjectValidation(string aiName, List <KeyValuePair <string, string> > aiData, TreeNode tn, SlaveTypes sType, int sNo)
        {
            string strRoutineName = "UnsolResponse";

            try
            {
                slaveType = sType;
                slaveNo   = sNo;
                try
                {
                    ainType = (OV)Enum.Parse(typeof(OV), aiName);
                }
                catch (System.ArgumentException)
                {
                }
                if (aiData != null && aiData.Count > 0) //Parse n store values...
                {
                    foreach (KeyValuePair <string, string> aikp in aiData)
                    {
                        try
                        {
                            if (this.GetType().GetProperty(aikp.Key) != null) //Ajay: 03/07/2018
                            {
                                this.GetType().GetProperty(aikp.Key).SetValue(this, aikp.Value);
                            }
                        }
                        catch (System.NullReferenceException)
                        {
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #7
0
        public ObjectValidation(XmlNode aiNode, SlaveTypes sType, int sNo, bool imported)
        {
            string strRoutineName = "UnsolResponse";

            try
            {
                slaveType = sType;
                slaveNo   = sNo;
                if (aiNode.Attributes != null)
                {
                    try
                    {
                        ainType = (OV)Enum.Parse(typeof(OV), aiNode.Name);
                    }
                    catch (System.ArgumentException)
                    {
                    }
                    foreach (XmlAttribute item in aiNode.Attributes)
                    {
                        try
                        {
                            if (this.GetType().GetProperty(item.Name) != null) //Ajay: 03/07/2018
                            {
                                this.GetType().GetProperty(item.Name).SetValue(this, item.Value);
                            }
                        }
                        catch (System.NullReferenceException)
                        {
                        }
                    }
                }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + Ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #8
0
 public override OV opOV(OV i, out OV o, Ice.Current current)
 {
     o = i;
     return(i);
 }
Beispiel #9
0
    internal static void twowaysAMI(Ice.Communicator communicator, Test.MyClassPrx p)
    {
        {
            Dictionary <int, int> i = new Dictionary <int, int>();
            i[0] = 1;
            i[1] = 0;

            AMI_MyClass_opNVI cb = new AMI_MyClass_opNVI(i);
            p.opNV_async(cb, i);
            cb.check();
        }

        {
            Dictionary <string, string> i = new Dictionary <string, string>();
            i["a"] = "b";
            i["b"] = "a";

            AMI_MyClass_opNRI cb = new AMI_MyClass_opNRI(i);
            p.opNR_async(cb, i);
            cb.check();
        }

        {
            Dictionary <string, Dictionary <int, int> > i = new Dictionary <string, Dictionary <int, int> >();
            Dictionary <int, int> id = new Dictionary <int, int>();
            id[0]  = 1;
            id[1]  = 0;
            i["a"] = id;
            i["b"] = id;

            AMI_MyClass_opNDVI cb = new AMI_MyClass_opNDVI(i);
            p.opNDV_async(cb, i);
            cb.check();
        }

        {
            Dictionary <string, Dictionary <string, string> > i = new Dictionary <string, Dictionary <string, string> >();
            Dictionary <string, string> id = new Dictionary <string, string>();
            id["a"] = "b";
            id["b"] = "a";
            i["a"]  = id;
            i["b"]  = id;

            AMI_MyClass_opNDRI cb = new AMI_MyClass_opNDRI(i);
            p.opNDR_async(cb, i);
            cb.check();
        }

        {
            OV i = new OV();
            i[0] = 1;
            i[1] = 0;

            AMI_MyClass_opOVI cb = new AMI_MyClass_opOVI(i);
            p.opOV_async(cb, i);
            cb.check();
        }

        {
            OR i = new OR();
            i["a"] = "b";
            i["b"] = "a";

            AMI_MyClass_opORI cb = new AMI_MyClass_opORI(i);
            p.opOR_async(cb, i);
            cb.check();
        }

        {
            ODV i  = new ODV();
            OV  id = new OV();
            id[0]  = 1;
            id[1]  = 0;
            i["a"] = id;
            i["b"] = id;

            AMI_MyClass_opODVI cb = new AMI_MyClass_opODVI(i);
            p.opODV_async(cb, i);
            cb.check();
        }

        {
            ODR i  = new ODR();
            OR  id = new OR();
            id["a"] = "b";
            id["b"] = "a";
            i["a"]  = id;
            i["b"]  = id;

            AMI_MyClass_opODRI cb = new AMI_MyClass_opODRI(i);
            p.opODR_async(cb, i);
            cb.check();
        }

        {
            Dictionary <string, ODV> i = new Dictionary <string, ODV>();
            OV iid = new OV();
            iid[0] = 1;
            iid[1] = 0;
            ODV id = new ODV();
            id["a"] = iid;
            id["b"] = iid;
            i["a"]  = id;
            i["b"]  = id;

            AMI_MyClass_opNODVI cb = new AMI_MyClass_opNODVI(i);
            p.opNODV_async(cb, i);
            cb.check();
        }

        {
            Dictionary <string, ODR> i = new Dictionary <string, ODR>();
            OR iid = new OR();
            iid["a"] = "b";
            iid["b"] = "a";
            ODR id = new ODR();
            id["a"] = iid;
            id["b"] = iid;
            i["a"]  = id;
            i["b"]  = id;

            AMI_MyClass_opNODRI cb = new AMI_MyClass_opNODRI(i);
            p.opNODR_async(cb, i);
            cb.check();
        }

        {
            ONDV i = new ONDV();
            Dictionary <int, int> iid = new Dictionary <int, int>();
            iid[0] = 1;
            iid[1] = 0;
            Dictionary <string, Dictionary <int, int> > id
                    = new Dictionary <string, Dictionary <int, int> >();
            id["a"] = iid;
            id["b"] = iid;
            i["a"]  = id;
            i["b"]  = id;

            AMI_MyClass_opONDVI cb = new AMI_MyClass_opONDVI(i);
            p.opONDV_async(cb, i);
            cb.check();
        }

        {
            ONDR i = new ONDR();
            Dictionary <string, string> iid = new Dictionary <string, string>();
            iid["a"] = "b";
            iid["b"] = "a";
            Dictionary <string, Dictionary <string, string> > id
                    = new Dictionary <string, Dictionary <string, string> >();
            id["a"] = iid;
            id["b"] = iid;
            i["a"]  = id;
            i["b"]  = id;

            AMI_MyClass_opONDRI cb = new AMI_MyClass_opONDRI(i);
            p.opONDR_async(cb, i);
            cb.check();
        }

        {
            int[] ii = new int[] { 1, 2 };
            Dictionary <string, int[]> i = new Dictionary <string, int[]>();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opNDAISI cb = new AMI_MyClass_opNDAISI(i);
            p.opNDAIS_async(cb, i);
            cb.check();
        }

        {
            CIS ii = new CIS();
            ii.Add(1);
            ii.Add(2);
            Dictionary <string, CIS> i = new Dictionary <string, CIS>();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opNDCISI cb = new AMI_MyClass_opNDCISI(i);
            p.opNDCIS_async(cb, i);
            cb.check();
        }

        {
            List <int> ii = new List <int>();
            ii.Add(1);
            ii.Add(2);
            Dictionary <string, List <int> > i = new Dictionary <string, List <int> >();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opNDGISI cb = new AMI_MyClass_opNDGISI(i);
            p.opNDGIS_async(cb, i);
            cb.check();
        }

        {
            string[] ii = new string[] { "a", "b" };
            Dictionary <string, string[]> i = new Dictionary <string, string[]>();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opNDASSI cb = new AMI_MyClass_opNDASSI(i);
            p.opNDASS_async(cb, i);
            cb.check();
        }

        {
            CSS ii = new CSS();
            ii.Add("a");
            ii.Add("b");
            Dictionary <string, CSS> i = new Dictionary <string, CSS>();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opNDCSSI cb = new AMI_MyClass_opNDCSSI(i);
            p.opNDCSS_async(cb, i);
            cb.check();
        }

        {
            List <string> ii = new List <string>();
            ii.Add("a");
            ii.Add("b");
            Dictionary <string, List <string> > i = new Dictionary <string, List <string> >();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opNDGSSI cb = new AMI_MyClass_opNDGSSI(i);
            p.opNDGSS_async(cb, i);
            cb.check();
        }

        {
            int[] ii = new int[] { 1, 2 };
            ODAIS i  = new ODAIS();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opODAISI cb = new AMI_MyClass_opODAISI(i);
            p.opODAIS_async(cb, i);
            cb.check();
        }

        {
            CIS ii = new CIS();
            ii.Add(1);
            ii.Add(2);
            ODCIS i = new ODCIS();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opODCISI cb = new AMI_MyClass_opODCISI(i);
            p.opODCIS_async(cb, i);
            cb.check();
        }

        {
            List <int> ii = new List <int>();
            ii.Add(1);
            ii.Add(2);
            ODGIS i = new ODGIS();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opODGISI cb = new AMI_MyClass_opODGISI(i);
            p.opODGIS_async(cb, i);
            cb.check();
        }

        {
            string[] ii = new string[] { "a", "b" };
            ODASS    i  = new ODASS();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opODASSI cb = new AMI_MyClass_opODASSI(i);
            p.opODASS_async(cb, i);
            cb.check();
        }

        {
            CSS ii = new CSS();
            ii.Add("a");
            ii.Add("b");
            ODCSS i = new ODCSS();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opODCSSI cb = new AMI_MyClass_opODCSSI(i);
            p.opODCSS_async(cb, i);
            cb.check();
        }

        {
            List <string> ii = new List <string>();
            ii.Add("a");
            ii.Add("b");
            ODGSS i = new ODGSS();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opODGSSI cb = new AMI_MyClass_opODGSSI(i);
            p.opODGSS_async(cb, i);
            cb.check();
        }
    }
Beispiel #10
0
 public override void ice_response(OV r, OV o)
 {
     test(Ice.CollectionComparer.Equals(_i, o));
     test(Ice.CollectionComparer.Equals(_i, r));
     callback.called();
 }
Beispiel #11
0
 public AMI_MyClass_opOVI(OV i)
 {
     _i = i;
 }
Beispiel #12
0
    internal static void twowaysAMI(Ice.Communicator communicator, Test.MyClassPrx p)
    {
        {
            Dictionary<int, int> i = new Dictionary<int, int>();
            i[0] = 1;
            i[1] = 0;

            AMI_MyClass_opNVI cb = new AMI_MyClass_opNVI(i);
            p.opNV_async(cb, i);
            cb.check();
        }

        {
            Dictionary<string, string> i = new Dictionary<string, string>();
            i["a"] = "b";
            i["b"] = "a";

            AMI_MyClass_opNRI cb = new AMI_MyClass_opNRI(i);
            p.opNR_async(cb, i);
            cb.check();
        }

        {
            Dictionary<string, Dictionary<int, int>> i = new Dictionary<string, Dictionary<int, int>>();
            Dictionary<int, int> id = new Dictionary<int, int>();
            id[0] = 1;
            id[1] = 0;
            i["a"] = id;
            i["b"] = id;

            AMI_MyClass_opNDVI cb = new AMI_MyClass_opNDVI(i);
            p.opNDV_async(cb, i);
            cb.check();
        }

        {
            Dictionary<string, Dictionary<string, string>> i = new Dictionary<string, Dictionary<string, string>>();
            Dictionary<string, string> id = new Dictionary<string, string>();
            id["a"] = "b";
            id["b"] = "a";
            i["a"] = id;
            i["b"] = id;

            AMI_MyClass_opNDRI cb = new AMI_MyClass_opNDRI(i);
            p.opNDR_async(cb, i);
            cb.check();
        }

        {
            OV i = new OV();
            i[0] = 1;
            i[1] = 0;

            AMI_MyClass_opOVI cb = new AMI_MyClass_opOVI(i);
            p.opOV_async(cb, i);
            cb.check();
        }

        {
            OR i = new OR();
            i["a"] = "b";
            i["b"] = "a";

            AMI_MyClass_opORI cb = new AMI_MyClass_opORI(i);
            p.opOR_async(cb, i);
            cb.check();
        }

        {
            ODV i = new ODV();
            OV id = new OV();
            id[0] = 1;
            id[1] = 0;
            i["a"] = id;
            i["b"] = id;

            AMI_MyClass_opODVI cb = new AMI_MyClass_opODVI(i);
            p.opODV_async(cb, i);
            cb.check();
        }

        {
            ODR i = new ODR();
            OR id = new OR();
            id["a"] = "b";
            id["b"] = "a";
            i["a"] = id;
            i["b"] = id;

            AMI_MyClass_opODRI cb = new AMI_MyClass_opODRI(i);
            p.opODR_async(cb, i);
            cb.check();
        }

        {
            Dictionary<string, ODV> i = new Dictionary<string, ODV>();
            OV iid = new OV();
            iid[0] = 1;
            iid[1] = 0;
            ODV id = new ODV();
            id["a"] = iid;
            id["b"] = iid;
            i["a"] = id;
            i["b"] = id;

            AMI_MyClass_opNODVI cb = new AMI_MyClass_opNODVI(i);
            p.opNODV_async(cb, i);
            cb.check();
        }

        {
            Dictionary<string, ODR> i = new Dictionary<string, ODR>();
            OR iid = new OR();
            iid["a"] = "b";
            iid["b"] = "a";
            ODR id = new ODR();
            id["a"] = iid;
            id["b"] = iid;
            i["a"] = id;
            i["b"] = id;

            AMI_MyClass_opNODRI cb = new AMI_MyClass_opNODRI(i);
            p.opNODR_async(cb, i);
            cb.check();
        }

        {
            ONDV i = new ONDV();
            Dictionary<int, int> iid = new Dictionary<int, int>();
            iid[0] = 1;
            iid[1] = 0;
            Dictionary<string, Dictionary<int, int>> id
                = new Dictionary<string, Dictionary<int, int>>();
            id["a"] = iid;
            id["b"] = iid;
            i["a"] = id;
            i["b"] = id;

            AMI_MyClass_opONDVI cb = new AMI_MyClass_opONDVI(i);
            p.opONDV_async(cb, i);
            cb.check();
        }

        {
            ONDR i = new ONDR();
            Dictionary<string, string> iid = new Dictionary<string, string>();
            iid["a"] = "b";
            iid["b"] = "a";
            Dictionary<string, Dictionary<string, string>> id
                = new Dictionary<string, Dictionary<string, string>>();
            id["a"] = iid;
            id["b"] = iid;
            i["a"] = id;
            i["b"] = id;

            AMI_MyClass_opONDRI cb = new AMI_MyClass_opONDRI(i);
            p.opONDR_async(cb, i);
            cb.check();
        }

        {
            int[] ii = new int[] { 1, 2 };
            Dictionary<string, int[]> i = new Dictionary<string, int[]>();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opNDAISI cb = new AMI_MyClass_opNDAISI(i);
            p.opNDAIS_async(cb, i);
            cb.check();
        }

        {
            CIS ii = new CIS();
            ii.Add(1);
            ii.Add(2);
            Dictionary<string, CIS> i = new Dictionary<string, CIS>();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opNDCISI cb = new AMI_MyClass_opNDCISI(i);
            p.opNDCIS_async(cb, i);
            cb.check();
        }

        {
            List<int> ii = new List<int>();
            ii.Add(1);
            ii.Add(2);
            Dictionary<string, List<int>> i = new Dictionary<string, List<int>>();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opNDGISI cb = new AMI_MyClass_opNDGISI(i);
            p.opNDGIS_async(cb, i);
            cb.check();
        }

        {
            string[] ii = new string[] { "a", "b" };
            Dictionary<string, string[]> i = new Dictionary<string, string[]>();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opNDASSI cb = new AMI_MyClass_opNDASSI(i);
            p.opNDASS_async(cb, i);
            cb.check();
        }

        {
            CSS ii = new CSS();
            ii.Add("a");
            ii.Add("b");
            Dictionary<string, CSS> i = new Dictionary<string, CSS>();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opNDCSSI cb = new AMI_MyClass_opNDCSSI(i);
            p.opNDCSS_async(cb, i);
            cb.check();
        }

        {
            List<string> ii = new List<string>();
            ii.Add("a");
            ii.Add("b");
            Dictionary<string, List<string>> i = new Dictionary<string, List<string>>();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opNDGSSI cb = new AMI_MyClass_opNDGSSI(i);
            p.opNDGSS_async(cb, i);
            cb.check();
        }

        {
            int[] ii = new int[] { 1, 2 };
            ODAIS i = new ODAIS();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opODAISI cb = new AMI_MyClass_opODAISI(i);
            p.opODAIS_async(cb, i);
            cb.check();
        }

        {
            CIS ii = new CIS();
            ii.Add(1);
            ii.Add(2);
            ODCIS i = new ODCIS();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opODCISI cb = new AMI_MyClass_opODCISI(i);
            p.opODCIS_async(cb, i);
            cb.check();
        }

        {
            List<int> ii = new List<int>();
            ii.Add(1);
            ii.Add(2);
            ODGIS i = new ODGIS();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opODGISI cb = new AMI_MyClass_opODGISI(i);
            p.opODGIS_async(cb, i);
            cb.check();
        }

        {
            string[] ii = new string[] { "a", "b" };
            ODASS i = new ODASS();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opODASSI cb = new AMI_MyClass_opODASSI(i);
            p.opODASS_async(cb, i);
            cb.check();
        }

        {
            CSS ii = new CSS();
            ii.Add("a");
            ii.Add("b");
            ODCSS i = new ODCSS();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opODCSSI cb = new AMI_MyClass_opODCSSI(i);
            p.opODCSS_async(cb, i);
            cb.check();
        }

        {
            List<string> ii = new List<string>();
            ii.Add("a");
            ii.Add("b");
            ODGSS i = new ODGSS();
            i["a"] = ii;
            i["b"] = ii;

            AMI_MyClass_opODGSSI cb = new AMI_MyClass_opODGSSI(i);
            p.opODGSS_async(cb, i);
            cb.check();
        }
    }
Beispiel #13
0
 public override void ice_response(OV r, OV o)
 {
     test(Ice.CollectionComparer.Equals(_i, o));
     test(Ice.CollectionComparer.Equals(_i, r));
     callback.called();
 }
Beispiel #14
0
 public AMI_MyClass_opOVI(OV i)
 {
     _i = i;
 }
Beispiel #15
0
 public override OV opOV(OV i, out OV o, Ice.Current current)
 {
     o = i;
     return i;
 }
Beispiel #16
0
    internal static void twoways(Ice.Communicator communicator, Test.MyClassPrx p)
    {
        {
            Dictionary<int, int> i = new Dictionary<int, int>();
            i[0] = 1;
            i[1] = 0;

            Dictionary<int, int> o;
            Dictionary<int, int> r;
            r = p.opNV(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Dictionary<string, string> i = new Dictionary<string, string>();
            i["a"] = "b";
            i["b"] = "a";

            Dictionary<string, string> o;
            Dictionary<string, string> r;
            r = p.opNR(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Dictionary<string, Dictionary<int, int>> i = new Dictionary<string, Dictionary<int, int>>();
            Dictionary<int, int> id = new Dictionary<int, int>();
            id[0] = 1;
            id[1] = 0;
            i["a"] = id;
            i["b"] = id;

            Dictionary<string, Dictionary<int, int>> o;
            Dictionary<string, Dictionary<int, int>> r;
            r = p.opNDV(i, out o);

            foreach(string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            Dictionary<string, Dictionary<string, string>> i = new Dictionary<string, Dictionary<string, string>>();
            Dictionary<string, string> id = new Dictionary<string, string>();
            id["a"] = "b";
            id["b"] = "a";
            i["a"] = id;
            i["b"] = id;

            Dictionary<string, Dictionary<string, string>> o;
            Dictionary<string, Dictionary<string, string>> r;
            r = p.opNDR(i, out o);

            foreach(string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            OV i = new OV();
            i[0] = 1;
            i[1] = 0;

            OV o;
            OV r;
            r = p.opOV(i, out o);

            test(OV.Equals(i, o));
            test(OV.Equals(i, r));
        }

        {
            OR i = new OR();
            i["a"] = "b";
            i["b"] = "a";

            OR o;
            OR r;
            r = p.opOR(i, out o);

            test(OR.Equals(i, o));
            test(OR.Equals(i, r));
        }

        {
            ODV i = new ODV();
            OV id = new OV();
            id[0] = 1;
            id[1] = 0;
            i["a"] = id;
            i["b"] = id;

            ODV o;
            ODV r;
            r = p.opODV(i, out o);

            test(ODV.Equals(i, o));
            test(ODV.Equals(i, r));
        }

        {
            ODR i = new ODR();
            OR id = new OR();
            id["a"] = "b";
            id["b"] = "a";
            i["a"] = id;
            i["b"] = id;

            ODR o;
            ODR r;
            r = p.opODR(i, out o);

            test(ODR.Equals(i, o));
            test(ODR.Equals(i, r));
        }

        {
            Dictionary<string, ODV> i = new Dictionary<string, ODV>();
            OV iid = new OV();
            iid[0] = 1;
            iid[1] = 0;
            ODV id = new ODV();
            id["a"] = iid;
            id["b"] = iid;
            i["a"] = id;
            i["b"] = id;

            Dictionary<string, ODV> o;
            Dictionary<string, ODV> r;
            r = p.opNODV(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Dictionary<string, ODR> i = new Dictionary<string, ODR>();
            OR iid = new OR();
            iid["a"] = "b";
            iid["a"] = "b";
            ODR id = new ODR();
            id["a"] = iid;
            id["b"] = iid;
            i["a"] = id;
            i["b"] = id;

            Dictionary<string, ODR> o;
            Dictionary<string, ODR> r;
            r = p.opNODR(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            ONDV i = new ONDV();
            Dictionary<int, int> iid = new Dictionary<int, int>();
            iid[0] = 1;
            iid[1] = 0;
            Dictionary<string, Dictionary<int, int>> id
                = new Dictionary<string, Dictionary<int, int>>();
            id["a"] = iid;
            id["b"] = iid;
            i["a"] = id;
            i["b"] = id;

            ONDV o;
            ONDV r;
            r = p.opONDV(i, out o);

            foreach(string key in i.Keys)
            {
                foreach(string s in i[key].Keys)
                {
                    test(Ice.CollectionComparer.Equals(i[key][s], o[key][s]));
                    test(Ice.CollectionComparer.Equals(i[key][s], r[key][s]));
                }
            }
        }

        {
            ONDR i = new ONDR();
            Dictionary<string, string> iid = new Dictionary<string, string>();
            iid["a"] = "b";
            iid["b"] = "a";
            Dictionary<string, Dictionary<string, string>> id
                = new Dictionary<string, Dictionary<string, string>>();
            id["a"] = iid;
            id["b"] = iid;
            i["a"] = id;
            i["b"] = id;

            ONDR o;
            ONDR r;
            r = p.opONDR(i, out o);

            foreach(string key in i.Keys)
            {
                foreach(string s in i[key].Keys)
                {
                    test(Ice.CollectionComparer.Equals(i[key][s], o[key][s]));
                    test(Ice.CollectionComparer.Equals(i[key][s], r[key][s]));
                }
            }
        }

        {
            int[] ii = new int[] { 1, 2 };
            Dictionary<string, int[]> i = new Dictionary<string, int[]>();
            i["a"] = ii;
            i["b"] = ii;

            Dictionary<string, int[]> o;
            Dictionary<string, int[]> r;
            r = p.opNDAIS(i, out o);

            foreach(string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            CIS ii = new CIS();
            ii.Add(1);
            ii.Add(2);
            Dictionary<string, CIS> i = new Dictionary<string, CIS>();
            i["a"] = ii;
            i["b"] = ii;

            Dictionary<string, CIS> o;
            Dictionary<string, CIS> r;
            r = p.opNDCIS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<int> ii = new List<int>();
            ii.Add(1);
            ii.Add(2);
            Dictionary<string, List<int>> i = new Dictionary<string, List<int>>();
            i["a"] = ii;
            i["b"] = ii;

            Dictionary<string, List<int>> o;
            Dictionary<string, List<int>> r;
            r = p.opNDGIS(i, out o);

            foreach(string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            string[] ii = new string[] { "a", "b" };
            Dictionary<string, string[]> i = new Dictionary<string, string[]>();
            i["a"] = ii;
            i["b"] = ii;

            Dictionary<string, string[]> o;
            Dictionary<string, string[]> r;
            r = p.opNDASS(i, out o);

            foreach(string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            CSS ii = new CSS();
            ii.Add("a");
            ii.Add("b");
            Dictionary<string, CSS> i = new Dictionary<string, CSS>();
            i["a"] = ii;
            i["b"] = ii;

            Dictionary<string, CSS> o;
            Dictionary<string, CSS> r;
            r = p.opNDCSS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List<string> ii = new List<string>();
            ii.Add("a");
            ii.Add("b");
            Dictionary<string, List<string>> i = new Dictionary<string, List<string>>();
            i["a"] = ii;
            i["b"] = ii;

            Dictionary<string, List<string>> o;
            Dictionary<string, List<string>> r;
            r = p.opNDGSS(i, out o);

            foreach(string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            int[] ii = new int[] { 1, 2 };
            ODAIS i = new ODAIS();
            i["a"] = ii;
            i["b"] = ii;

            ODAIS o;
            ODAIS r;
            r = p.opODAIS(i, out o);

            foreach(string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            CIS ii = new CIS();
            ii.Add(1);
            ii.Add(2);
            ODCIS i = new ODCIS();
            i["a"] = ii;
            i["b"] = ii;

            ODCIS o;
            ODCIS r;
            r = p.opODCIS(i, out o);

            foreach(string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            List<int> ii = new List<int>();
            ii.Add(1);
            ii.Add(2);
            ODGIS i = new ODGIS();
            i["a"] = ii;
            i["b"] = ii;

            ODGIS o;
            ODGIS r;
            r = p.opODGIS(i, out o);

            foreach(string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            string[] ii = new string[] { "a", "b" };
            ODASS i = new ODASS();
            i["a"] = ii;
            i["b"] = ii;

            ODASS o;
            ODASS r;
            r = p.opODASS(i, out o);

            foreach(string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            CSS ii = new CSS();
            ii.Add("a");
            ii.Add("b");
            ODCSS i = new ODCSS();
            i["a"] = ii;
            i["b"] = ii;

            ODCSS o;
            ODCSS r;
            r = p.opODCSS(i, out o);

            foreach(string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            List<string> ii = new List<string>();
            ii.Add("a");
            ii.Add("b");
            ODGSS i = new ODGSS();
            i["a"] = ii;
            i["b"] = ii;

            ODGSS o;
            ODGSS r;
            r = p.opODGSS(i, out o);

            foreach(string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }
    }
Beispiel #17
0
    internal static void twoways(Ice.Communicator communicator, Test.MyClassPrx p)
    {
        {
            Dictionary <int, int> i = new Dictionary <int, int>();
            i[0] = 1;
            i[1] = 0;

            Dictionary <int, int> o;
            Dictionary <int, int> r;
            r = p.opNV(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Dictionary <string, string> i = new Dictionary <string, string>();
            i["a"] = "b";
            i["b"] = "a";

            Dictionary <string, string> o;
            Dictionary <string, string> r;
            r = p.opNR(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Dictionary <string, Dictionary <int, int> > i = new Dictionary <string, Dictionary <int, int> >();
            Dictionary <int, int> id = new Dictionary <int, int>();
            id[0]  = 1;
            id[1]  = 0;
            i["a"] = id;
            i["b"] = id;

            Dictionary <string, Dictionary <int, int> > o;
            Dictionary <string, Dictionary <int, int> > r;
            r = p.opNDV(i, out o);

            foreach (string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            Dictionary <string, Dictionary <string, string> > i = new Dictionary <string, Dictionary <string, string> >();
            Dictionary <string, string> id = new Dictionary <string, string>();
            id["a"] = "b";
            id["b"] = "a";
            i["a"]  = id;
            i["b"]  = id;

            Dictionary <string, Dictionary <string, string> > o;
            Dictionary <string, Dictionary <string, string> > r;
            r = p.opNDR(i, out o);

            foreach (string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            OV i = new OV();
            i[0] = 1;
            i[1] = 0;

            OV o;
            OV r;
            r = p.opOV(i, out o);

            test(OV.Equals(i, o));
            test(OV.Equals(i, r));
        }

        {
            OR i = new OR();
            i["a"] = "b";
            i["b"] = "a";

            OR o;
            OR r;
            r = p.opOR(i, out o);

            test(OR.Equals(i, o));
            test(OR.Equals(i, r));
        }

        {
            ODV i  = new ODV();
            OV  id = new OV();
            id[0]  = 1;
            id[1]  = 0;
            i["a"] = id;
            i["b"] = id;

            ODV o;
            ODV r;
            r = p.opODV(i, out o);

            test(ODV.Equals(i, o));
            test(ODV.Equals(i, r));
        }

        {
            ODR i  = new ODR();
            OR  id = new OR();
            id["a"] = "b";
            id["b"] = "a";
            i["a"]  = id;
            i["b"]  = id;

            ODR o;
            ODR r;
            r = p.opODR(i, out o);

            test(ODR.Equals(i, o));
            test(ODR.Equals(i, r));
        }

        {
            Dictionary <string, ODV> i = new Dictionary <string, ODV>();
            OV iid = new OV();
            iid[0] = 1;
            iid[1] = 0;
            ODV id = new ODV();
            id["a"] = iid;
            id["b"] = iid;
            i["a"]  = id;
            i["b"]  = id;

            Dictionary <string, ODV> o;
            Dictionary <string, ODV> r;
            r = p.opNODV(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Dictionary <string, ODR> i = new Dictionary <string, ODR>();
            OR iid = new OR();
            iid["a"] = "b";
            iid["a"] = "b";
            ODR id = new ODR();
            id["a"] = iid;
            id["b"] = iid;
            i["a"]  = id;
            i["b"]  = id;

            Dictionary <string, ODR> o;
            Dictionary <string, ODR> r;
            r = p.opNODR(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            ONDV i = new ONDV();
            Dictionary <int, int> iid = new Dictionary <int, int>();
            iid[0] = 1;
            iid[1] = 0;
            Dictionary <string, Dictionary <int, int> > id
                    = new Dictionary <string, Dictionary <int, int> >();
            id["a"] = iid;
            id["b"] = iid;
            i["a"]  = id;
            i["b"]  = id;

            ONDV o;
            ONDV r;
            r = p.opONDV(i, out o);

            foreach (string key in i.Keys)
            {
                foreach (string s in i[key].Keys)
                {
                    test(Ice.CollectionComparer.Equals(i[key][s], o[key][s]));
                    test(Ice.CollectionComparer.Equals(i[key][s], r[key][s]));
                }
            }
        }

        {
            ONDR i = new ONDR();
            Dictionary <string, string> iid = new Dictionary <string, string>();
            iid["a"] = "b";
            iid["b"] = "a";
            Dictionary <string, Dictionary <string, string> > id
                    = new Dictionary <string, Dictionary <string, string> >();
            id["a"] = iid;
            id["b"] = iid;
            i["a"]  = id;
            i["b"]  = id;

            ONDR o;
            ONDR r;
            r = p.opONDR(i, out o);

            foreach (string key in i.Keys)
            {
                foreach (string s in i[key].Keys)
                {
                    test(Ice.CollectionComparer.Equals(i[key][s], o[key][s]));
                    test(Ice.CollectionComparer.Equals(i[key][s], r[key][s]));
                }
            }
        }

        {
            int[] ii = new int[] { 1, 2 };
            Dictionary <string, int[]> i = new Dictionary <string, int[]>();
            i["a"] = ii;
            i["b"] = ii;

            Dictionary <string, int[]> o;
            Dictionary <string, int[]> r;
            r = p.opNDAIS(i, out o);

            foreach (string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            CIS ii = new CIS();
            ii.Add(1);
            ii.Add(2);
            Dictionary <string, CIS> i = new Dictionary <string, CIS>();
            i["a"] = ii;
            i["b"] = ii;

            Dictionary <string, CIS> o;
            Dictionary <string, CIS> r;
            r = p.opNDCIS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List <int> ii = new List <int>();
            ii.Add(1);
            ii.Add(2);
            Dictionary <string, List <int> > i = new Dictionary <string, List <int> >();
            i["a"] = ii;
            i["b"] = ii;

            Dictionary <string, List <int> > o;
            Dictionary <string, List <int> > r;
            r = p.opNDGIS(i, out o);

            foreach (string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            string[] ii = new string[] { "a", "b" };
            Dictionary <string, string[]> i = new Dictionary <string, string[]>();
            i["a"] = ii;
            i["b"] = ii;

            Dictionary <string, string[]> o;
            Dictionary <string, string[]> r;
            r = p.opNDASS(i, out o);

            foreach (string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            CSS ii = new CSS();
            ii.Add("a");
            ii.Add("b");
            Dictionary <string, CSS> i = new Dictionary <string, CSS>();
            i["a"] = ii;
            i["b"] = ii;

            Dictionary <string, CSS> o;
            Dictionary <string, CSS> r;
            r = p.opNDCSS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            List <string> ii = new List <string>();
            ii.Add("a");
            ii.Add("b");
            Dictionary <string, List <string> > i = new Dictionary <string, List <string> >();
            i["a"] = ii;
            i["b"] = ii;

            Dictionary <string, List <string> > o;
            Dictionary <string, List <string> > r;
            r = p.opNDGSS(i, out o);

            foreach (string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            int[] ii = new int[] { 1, 2 };
            ODAIS i  = new ODAIS();
            i["a"] = ii;
            i["b"] = ii;

            ODAIS o;
            ODAIS r;
            r = p.opODAIS(i, out o);

            foreach (string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            CIS ii = new CIS();
            ii.Add(1);
            ii.Add(2);
            ODCIS i = new ODCIS();
            i["a"] = ii;
            i["b"] = ii;

            ODCIS o;
            ODCIS r;
            r = p.opODCIS(i, out o);

            foreach (string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            List <int> ii = new List <int>();
            ii.Add(1);
            ii.Add(2);
            ODGIS i = new ODGIS();
            i["a"] = ii;
            i["b"] = ii;

            ODGIS o;
            ODGIS r;
            r = p.opODGIS(i, out o);

            foreach (string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            string[] ii = new string[] { "a", "b" };
            ODASS    i  = new ODASS();
            i["a"] = ii;
            i["b"] = ii;

            ODASS o;
            ODASS r;
            r = p.opODASS(i, out o);

            foreach (string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            CSS ii = new CSS();
            ii.Add("a");
            ii.Add("b");
            ODCSS i = new ODCSS();
            i["a"] = ii;
            i["b"] = ii;

            ODCSS o;
            ODCSS r;
            r = p.opODCSS(i, out o);

            foreach (string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }

        {
            List <string> ii = new List <string>();
            ii.Add("a");
            ii.Add("b");
            ODGSS i = new ODGSS();
            i["a"] = ii;
            i["b"] = ii;

            ODGSS o;
            ODGSS r;
            r = p.opODGSS(i, out o);

            foreach (string key in i.Keys)
            {
                test(Ice.CollectionComparer.Equals(i[key], o[key]));
                test(Ice.CollectionComparer.Equals(i[key], r[key]));
            }
        }
    }
Beispiel #18
0
 public override void opOV_async(AMD_MyClass_opOV cb, OV i, Ice.Current current)
 {
     cb.ice_response(i, i);
 }
Beispiel #19
0
 public override void opOV_async(AMD_MyClass_opOV cb, OV i, Ice.Current current)
 {
     cb.ice_response(i, i);
 }
Beispiel #20
0
        private static void ThreadStreamFunc(object param)
        {
            SoundInstance sndInst = (SoundInstance)param;

            while (true)
            {
                lock (sndInst.strLock)
                {
                    if (sndInst.Disposed)
                    {
                        return;
                    }
                    if (!DualityApp.Sound.IsAvailable)
                    {
                        return;
                    }

                    ALSourceState stateTemp = ALSourceState.Stopped;
                    if (sndInst.alSource > AlSource_NotAvailable)
                    {
                        stateTemp = AL.GetSourceState(sndInst.alSource);
                    }

                    if (sndInst.strStopReq)
                    {
                        // Stopped intentionally due to Stop() or eof. If strStopReq is NOT set,
                        // the source stopped playing because it reached the end of the buffer
                        // but in fact only because we were too slow inserting new data.
                        if (stateTemp != ALSourceState.Stopped)
                        {
                            sndInst.Stop();
                        }
                        return;
                    }

                    Sound res = sndInst.snd.Res;
                    if (res == null)
                    {
                        sndInst.Dispose();
                        return;
                    }
                    if (stateTemp == ALSourceState.Initial)
                    {
                        // Generate streaming buffers
                        sndInst.strAlBuffers = new int[3];
                        for (int i = 0; i < sndInst.strAlBuffers.Length; ++i)
                        {
                            AL.GenBuffers(1, out sndInst.strAlBuffers[i]);
                        }

                        // Begin streaming
                        OV.BeginStreamFromMemory(res.Data.Res.OggVorbisData, out sndInst.strOvStr);

                        // Initially, completely fill all buffers
                        for (int i = 0; i < sndInst.strAlBuffers.Length; ++i)
                        {
                            PcmData pcm;
                            bool    eof = !OV.StreamChunk(sndInst.strOvStr, out pcm);
                            if (pcm.data.Length > 0)
                            {
                                AL.BufferData(
                                    sndInst.strAlBuffers[i],
                                    pcm.channelCount == 1 ? ALFormat.Mono16 : ALFormat.Stereo16,
                                    pcm.data,
                                    pcm.data.Length,
                                    pcm.sampleRate);
                                AL.SourceQueueBuffer(sndInst.alSource, sndInst.strAlBuffers[i]);
                                if (eof)
                                {
                                    break;
                                }
                            }
                            else
                            {
                                break;
                            }
                        }

                        // Initially play source
                        AL.SourcePlay(sndInst.alSource);
                        stateTemp = AL.GetSourceState(sndInst.alSource);
                    }
                    else
                    {
                        int num;
                        AL.GetSource(sndInst.alSource, ALGetSourcei.BuffersProcessed, out num);
                        while (num > 0)
                        {
                            num--;

                            int unqueued;
                            unqueued = AL.SourceUnqueueBuffer(sndInst.alSource);

                            if (sndInst.strOvStr != IntPtr.Zero)
                            {
                                PcmData pcm;
                                bool    eof = !OV.StreamChunk(sndInst.strOvStr, out pcm);
                                if (pcm.data.Length > 0)
                                {
                                    AL.BufferData(
                                        unqueued,
                                        pcm.channelCount == 1 ? ALFormat.Mono16 : ALFormat.Stereo16,
                                        pcm.data,
                                        pcm.data.Length,
                                        pcm.sampleRate);
                                }
                                AL.SourceQueueBuffer(sndInst.alSource, unqueued);
                                if (eof && pcm.data.Length == 0)
                                {
                                    OV.EndStream(ref sndInst.strOvStr);
                                    if (sndInst.looped)
                                    {
                                        OV.BeginStreamFromMemory(res.Data.Res.OggVorbisData, out sndInst.strOvStr);
                                    }
                                    else
                                    {
                                        sndInst.strStopReq = true;
                                        break;
                                    }
                                }
                            }
                        }
                    }

                    if (stateTemp == ALSourceState.Stopped && !sndInst.strStopReq)
                    {
                        // If the source stopped unintentionally, restart it. (See above)
                        AL.SourcePlay(sndInst.alSource);
                    }
                }
                Thread.Sleep(8);
            }
        }