Repository: xbmc/xbmc
File: xbmc/cores/AudioEngine/Sinks/windows/AESinkFactoryWin.h (C/C++)

Code before:
  unsigned int validBitsPerSample;
  AEDataFormat subFormatType;
};

//! @todo
//! Sample formats go from float -> 32 bit int -> 24 bit int (packed in 32) -> -> 24 bit int -> 16 bit int */
//! versions of Kodi before 14.0 had a bug which made S24NE4MSB the first format selected
//! this bug worked around some driver bug of some IEC958 devices which report S32 but can't handle it
//! correctly. So far I have never seen and WASAPI device using S32 and don't think probing S24 before
//! S32 has any negative impact.
static const sampleFormat testFormats[] = { {KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 32, 32, AE_FMT_FLOAT},
                                            {KSDATAFORMAT_SUBTYPE_PCM, 32, 24, AE_FMT_S24NE4MSB},
                                            {KSDATAFORMAT_SUBTYPE_PCM, 32, 32, AE_FMT_S32NE},
                                            {KSDATAFORMAT_SUBTYPE_PCM, 24, 24, AE_FMT_S24NE3},
                                            {KSDATAFORMAT_SUBTYPE_PCM, 16, 16, AE_FMT_S16NE} };

struct RendererDetail
{
  std::string strDeviceId;
  std::string strDescription;
  std::string strWinDevType;
  std::string strDeviceEnumerator;
  AEDeviceType eDeviceType;
  unsigned int nChannels;
  unsigned int uiChannelMask;
  bool bDefault;
  unsigned long m_samplesPerSec; //!< Sample rate of the system default format
};

struct IAEWASAPIDevice
{
  std::string deviceId;
  virtual int Release() = 0;
  virtual HRESULT Activate(IAudioClient** ppAudioClient) = 0;
  virtual bool IsUSBDevice() = 0;
};

class CAESinkFactoryWin
{
public:
  /*
    Gets list of available audio renderers - using MMDevice
  */
  static std::vector<RendererDetail> GetRendererDetails();
  /*
    Gets list of available audio renderers - using WinRT
  */
  static std::vector<RendererDetail> GetRendererDetailsWinRT();
  /*
    Gets default device id
  */

Review comment (suggestion):
Maybe keep `bool bDefault;` last member of struct (move one line up)

Code after:
  unsigned int validBitsPerSample;
  AEDataFormat subFormatType;
};

//! @todo
//! Sample formats go from float -> 32 bit int -> 24 bit int (packed in 32) -> -> 24 bit int -> 16 bit int */
//! versions of Kodi before 14.0 had a bug which made S24NE4MSB the first format selected
//! this bug worked around some driver bug of some IEC958 devices which report S32 but can't handle it
//! correctly. So far I have never seen and WASAPI device using S32 and don't think probing S24 before
//! S32 has any negative impact.
static const sampleFormat testFormats[] = { {KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 32, 32, AE_FMT_FLOAT},
                                            {KSDATAFORMAT_SUBTYPE_PCM, 32, 24, AE_FMT_S24NE4MSB},
                                            {KSDATAFORMAT_SUBTYPE_PCM, 32, 32, AE_FMT_S32NE},
                                            {KSDATAFORMAT_SUBTYPE_PCM, 24, 24, AE_FMT_S24NE3},
                                            {KSDATAFORMAT_SUBTYPE_PCM, 16, 16, AE_FMT_S16NE} };

struct RendererDetail
{
  std::string strDeviceId;
  std::string strDescription;
  std::string strWinDevType;
  std::string strDeviceEnumerator;
  AEDeviceType eDeviceType;
  unsigned int nChannels;
  unsigned int uiChannelMask;
  unsigned long m_samplesPerSec; //!< Sample rate of the system default format
  bool bDefault;
};

struct IAEWASAPIDevice
{
  std::string deviceId;
  virtual int Release() = 0;
  virtual HRESULT Activate(IAudioClient** ppAudioClient) = 0;
  virtual bool IsUSBDevice() = 0;
};

class CAESinkFactoryWin
{
public:
  /*
    Gets list of available audio renderers - using MMDevice
  */
  static std::vector<RendererDetail> GetRendererDetails();
  /*
    Gets list of available audio renderers - using WinRT
  */
  static std::vector<RendererDetail> GetRendererDetailsWinRT();
  /*
    Gets default device id
  */