예제 #1
0
        public static BASS_WASAPI_DEVICEINFO BASS_WASAPI_GetDeviceInfo(int device)
        {
            BASS_WASAPI_DEVICEINFO bass_WASAPI_DEVICEINFO = new BASS_WASAPI_DEVICEINFO();

            if (BassWasapi.BASS_WASAPI_GetDeviceInfo(device, bass_WASAPI_DEVICEINFO))
            {
                return(bass_WASAPI_DEVICEINFO);
            }
            return(null);
        }
예제 #2
0
        public static bool BASS_WASAPI_GetDeviceInfo(int device, BASS_WASAPI_DEVICEINFO info)
        {
            bool result;

            try
            {
                bool flag = BassWasapi.BASS_WASAPI_GetDeviceInfoInternal(device, ref info._internal);
                if (flag)
                {
                    if (info._internal.name != IntPtr.Zero)
                    {
                        if (Bass.Bass._configUTF8)
                        {
                            info.name = Utils.IntPtrAsStringUtf8(info._internal.name);
                        }
                        else
                        {
                            info.name = Utils.IntPtrAsStringAnsi(info._internal.name);
                        }
                    }
                    else
                    {
                        info.name = string.Empty;
                    }
                    if (info._internal.id != IntPtr.Zero)
                    {
                        if (Bass.Bass._configUTF8)
                        {
                            info.id = Utils.IntPtrAsStringUtf8(info._internal.id);
                        }
                        else
                        {
                            info.id = Utils.IntPtrAsStringAnsi(info._internal.id);
                        }
                    }
                    else
                    {
                        info.id = string.Empty;
                    }
                    info.type      = info._internal.type;
                    info.flags     = info._internal.flags;
                    info.minperiod = info._internal.minperiod;
                    info.defperiod = info._internal.defperiod;
                    info.mixfreq   = info._internal.mixfreq;
                    info.mixchans  = info._internal.mixchans;
                }
                result = flag;
            }
            catch
            {
                result = false;
            }
            return(result);
        }
예제 #3
0
        public static int BASS_WASAPI_GetDeviceCount()
        {
            BASS_WASAPI_DEVICEINFO info = new BASS_WASAPI_DEVICEINFO();
            int num = 0;

            while (BassWasapi.BASS_WASAPI_GetDeviceInfo(num, info))
            {
                num++;
            }
            BassWasapi.BASS_WASAPI_GetCPU();
            return(num);
        }