Author Topic: How to get flags true value instead of numeric value?  (Read 106 times)

OldLobster

  • Posts: 1
I hope, everyone is doing good. I am a total newbie to BASS library and I can not manage to find an answer on following question:
After

BASS_GetDeviceInfo(deviceNumber, deviceInfo);
writeln(deviceInfo.flags);

I get a nummeric (DWORD) value, like 7. I guess somewhere can be found a table (like there is in the BASS documentation for error-codes) with an explanation to all this DWORD-values, but I got no idea, where it is.

question: how do you get a string of all flags included in this WORD value? Thx in advance

Chris

  • Posts: 2073
you can take a look to the demo devlist.

Code: [Select]
procedure DisplayDeviceInfo(di : BASS_DEVICEINFO);
var
  St : String;
begin
  Write(di.name, #13#10#9, 'driver: ', di.driver, #13#10#9'type: ');
  case (di.flags and BASS_DEVICE_TYPE_MASK) of
    BASS_DEVICE_TYPE_NETWORK :
      St := 'Remote Network';

    BASS_DEVICE_TYPE_SPEAKERS :
      St := 'Speakers';

    BASS_DEVICE_TYPE_LINE :
      St := 'Line';

    BASS_DEVICE_TYPE_HEADPHONES :
      St := 'Headphones';

    BASS_DEVICE_TYPE_MICROPHONE :
      St := 'Microphone';

    BASS_DEVICE_TYPE_HEADSET :
      St := 'Headset';

    BASS_DEVICE_TYPE_HANDSET :
      St := 'Handset';

    BASS_DEVICE_TYPE_DIGITAL :
      St := 'Digital';

    BASS_DEVICE_TYPE_SPDIF :
      St := 'SPDIF';

    BASS_DEVICE_TYPE_HDMI :
      St := 'HDMI';

    BASS_DEVICE_TYPE_DISPLAYPORT :
      St := 'DisplayPort';
  else
    St := 'Unknown';
  end;

  St := St + #13#10#9'flags:';
  if (di.flags and BASS_DEVICE_LOOPBACK) = BASS_DEVICE_LOOPBACK then
    St := St + ' loopback';
  if (di.flags and BASS_DEVICE_ENABLED) = BASS_DEVICE_ENABLED then
    St := St + ' enabled';
  if (di.flags and BASS_DEVICE_DEFAULT) = BASS_DEVICE_DEFAULT then
    St := St + ' default';
  WriteLn(St, ' (', di.flags, ')');
end;



Ian @ un4seen

  • Administrator
  • Posts: 24494
I get a nummeric (DWORD) value, like 7. I guess somewhere can be found a table (like there is in the BASS documentation for error-codes) with an explanation to all this DWORD-values, but I got no idea, where it is.

The numeric values of the flags aren't currently included in the BASS documentation, but that would be nice to have. I'll look into having them included. In the meantime, you can find all of the values in the BASS headers, eg. the BASS.H or BASS.PAS file.