Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
3.2 KiB

  1. /*******************************************************************************
  2. * AudioDlg.h *
  3. *------------*
  4. * Description:
  5. * This is the header file for the default audio input/output dialog.
  6. *-------------------------------------------------------------------------------
  7. * Created By: BECKYW Date: 10/15/99
  8. * Copyright (C) 1999 Microsoft Corporation
  9. * All Rights Reserved
  10. *
  11. *******************************************************************************/
  12. #ifndef _AUDIODLG_H
  13. #define _AUDIODLG_H
  14. #define MAX_LOADSTRING 1000
  15. #define WM_AUDIOINFO WM_USER + 20
  16. typedef enum IOTYPE
  17. {
  18. eINPUT,
  19. eOUTPUT
  20. };
  21. typedef struct AUDIOINFO
  22. {
  23. ISpObjectToken *pToken;
  24. } AUDIOINFO;
  25. class CAudioDlg
  26. {
  27. private:
  28. BOOL m_bPreferredDevice;
  29. HWND m_hDlg;
  30. const IOTYPE m_iotype;
  31. CSpDynamicString m_dstrDefaultTokenIdBeforeOK;
  32. CSpDynamicString m_dstrCurrentDefaultTokenId;
  33. // Indicates whether a change was made that will have to be committed
  34. bool m_fChangesToCommit;
  35. bool m_fChangesSinceLastTime;
  36. // Indicates if any changes have been made since the last apply
  37. // that need to be reflected in the UI
  38. CSpDynamicString m_dstrLastRequestedDefaultTokenId;
  39. // holds the process information for the volume control
  40. PROCESS_INFORMATION m_pi;
  41. // Will decide between W() and A() versions
  42. CSpUnicodeSupport m_unicode;
  43. public:
  44. CAudioDlg(IOTYPE iotype) :
  45. m_bPreferredDevice(true),
  46. m_hDlg(NULL),
  47. m_iotype(iotype),
  48. m_fChangesToCommit( false ),
  49. m_fChangesSinceLastTime( false ),
  50. m_dstrLastRequestedDefaultTokenId( (WCHAR *) NULL ),
  51. m_dstrCurrentDefaultTokenId( (WCHAR *) NULL )
  52. {
  53. m_pi.hProcess = NULL;
  54. }
  55. HRESULT OnApply(void);
  56. bool IsAudioDeviceChanged()
  57. { return m_fChangesToCommit; }
  58. bool IsAudioDeviceChangedSinceLastTime()
  59. { return m_fChangesSinceLastTime; }
  60. private:
  61. void OnDestroy(void);
  62. void OnInitDialog(HWND hWnd);
  63. HWND GetHDlg(void)
  64. { return m_hDlg; }
  65. BOOL IsPreferredDevice(void)
  66. { return m_bPreferredDevice; }
  67. void SetPreferredDevice( BOOL b )
  68. { m_bPreferredDevice = b; }
  69. UINT GetRequestedDefaultTokenID( WCHAR *pwszNewID, UINT cLength );
  70. HRESULT GetAudioToken(ISpObjectToken **ppToken);
  71. HRESULT UpdateDlgUI(ISpObjectToken *pToken);
  72. BOOL IsInput(void)
  73. { return (m_iotype == eINPUT); };
  74. friend INT_PTR CALLBACK AudioDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  75. };
  76. #endif // _AUDIODLG_H