Advertisement
Guest User

mfaudioendpointcontrol_fixed.h

a guest
Feb 11th, 2015
896
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.41 KB | None | 0 0
  1. #ifndef MFAUDIOENDPOINTCONTROL_FIXED_H
  2. #define MFAUDIOENDPOINTCONTROL_FIXED_H
  3.  
  4. #include <mfapi.h>
  5. #include <mfidl.h>
  6. #include <mmdeviceapi.h>
  7.  
  8. #pragma comment(lib, "ole32.lib")
  9. #pragma comment(lib, "oleaut32.lib")
  10. #pragma comment(lib, "Mf.lib")
  11.  
  12. #include <QAudioOutputSelectorControl>
  13.  
  14. class MFAudioEndpointControl_Fixed : public QAudioOutputSelectorControl
  15. {
  16.     Q_OBJECT
  17. public:
  18.     MFAudioEndpointControl_Fixed(QObject *parent = 0);
  19.     ~MFAudioEndpointControl_Fixed() override;
  20.  
  21.     QList<QString> availableOutputs() const override;
  22.  
  23.     QString outputDescription(const QString &name) const override;
  24.  
  25.     QString defaultOutput() const override;
  26.     QString activeOutput() const override;
  27.  
  28.     void setActiveOutput(const QString &name) override;
  29.  
  30.     IMFActivate* createActivate();
  31.  
  32.     // Custom
  33.     static QMap<QString, QString> availableOutputsFriendly();
  34.  
  35. private:
  36.     void clear_active();
  37.     void clear_endpoints();
  38.     void updateEndpoints();
  39.  
  40.     QString m_defaultEndpoint;
  41.     QString m_activeEndpoint;
  42.     QMap<QString, LPWSTR> m_devices;
  43.     IMFActivate *m_currentActivate;
  44. };
  45.  
  46. class MFAudioEndpointControl_Fixed_Helper : public QObject
  47. {
  48.     Q_OBJECT
  49. public:
  50.     MFAudioEndpointControl_Fixed_Helper(QAudioOutputSelectorControl *parent);
  51.     ~MFAudioEndpointControl_Fixed_Helper() override {}
  52.  
  53.     QString m_activeEndpoint;
  54. };
  55.  
  56. #endif // MFAUDIOENDPOINTCONTROL_FIXED_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement