Пример #1
0
        unsafe public virtual bool getDeviceOutput(int i)
        {
            bool result;

            CsPortMidiApi.PmDeviceInfo *dev = (CsPortMidiApi.PmDeviceInfo *)CsPortMidiApi.Pm_GetDeviceInfo(i);
            if (dev == null)
            {
                result = false;
            }
            else
            {
                result = dev->output == 1 ? true : false;
            }
            return(result);
        }
Пример #2
0
        unsafe public virtual string getDeviceName(int i)
        {
            string strName;

            CsPortMidiApi.PmDeviceInfo *dev = (CsPortMidiApi.PmDeviceInfo *)CsPortMidiApi.Pm_GetDeviceInfo(i);
            IntPtr pU = dev->name;

            if (pU == IntPtr.Zero)
            {
                strName = null;
            }
            else
            {
                strName = Marshal.PtrToStringAnsi(pU);
            }
            return(strName);
        }