21 May '13 - 21:26 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: name of default device (-1)  (Read 266 times)
dts350z
Posts: 17


« on: 13 Apr '12 - 23:16 »
Reply with quoteQuote

I get the wrong name when I try to get the device name of device -1.

I get the last device instead of the default.


BASS_GetDeviceInfo(dn, &dinfo);
printf("%d: %s\n",dn, dinfo.name);

Is the default device always device 1?

Logged
Ian @ un4seen
Administrator
Posts: 15259


« Reply #1 on: 16 Apr '12 - 14:41 »
Reply with quoteQuote

It isn't possible to use device number -1 in a BASS_GetDeviceInfo call (BASS_ERROR_DEVICE will result). To get the name of the default device, you will first need to locate the default device by looking for the BASS_DEVICE_DEFAULT flag, something like this...

BASS_DEVICEINFO dinfo;
for (int dn=1; BASS_GetDeviceInfo(dn, &dinfo); dn++)
if (dinfo.flags&BASS_DEVICE_DEFAULT) { // found the default device
printf("%d: %s\n", dn, dinfo.name);
break;
}

Device number 1 will usually be the default device, but not always.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines