コード例 #1
0
        public override System.String ToString()
        {
            IntPtr strptr;
            ossia_preset_result_enum code = BlueYetiAPI.ossia_presets_to_string(preset, &strptr);

            if (code == ossia_preset_result_enum.OSSIA_PRESETS_OK)
            {
                System.String str = Marshal.PtrToStringAuto(strptr);
                BlueYetiAPI.ossia_preset_free_string(strptr);
                return(str);
            }
            else
            {
                throw new Exception("Error code " + code);
            }
        }
コード例 #2
0
        public string WriteJson(string device)
        {
            IntPtr ptr;
            ossia_preset_result_enum code = BlueYetiAPI.ossia_presets_write_json(preset, device, out ptr);

            if (code == ossia_preset_result_enum.OSSIA_PRESETS_OK)
            {
                string str = Marshal.PtrToStringAuto(ptr);
                Debug.Log("Wrote json \"" + str + "\"");
                BlueYetiAPI.ossia_preset_free_string(ptr);
                return(str);
            }
            else
            {
                throw new Exception("Error code " + code);
            }
        }