mixer/src/back/backlasses.h
2024-02-07 16:55:30 +01:00

60 lines
1.3 KiB
C++

#pragma once
#define WIN32_LEAN_AND_MEAN
#include "global.h"
#include <vector>
#include <iostream>
#include <Windows.h>
#include <mmdeviceapi.h>
#include <combaseapi.h>
#include <initguid.h>
#include <functiondiscoverykeys_devpkey.h>
#include <endpointvolume.h>
#include <audiopolicy.h>
#include <audioclient.h>
//#include <comdef.h>
//#include <comip.h>
#include <Winerror.h>
class Endpoint {
public:
Endpoint(IMMDevice* endpoint);
void setVolume(float volume);
float getVolume();
LPWSTR getName();
~Endpoint();
private:
IMMDevice* endpoint;
IAudioEndpointVolume *endpointVolume ;
IPropertyStore *properties;
LPWSTR friendlyName;
// LPWSTR endpointID = NULL;
};
class Overseer {
//TODO singleton?
public:
Overseer();
std::vector<Endpoint*> getPlaybackEndpoints();
void reloadEndpoints();
//~Overseer();
//int getDefaultPlaybackEndpoint(Endpoint** defaultEndpoint);
//int getDefaultCaptureEndpoint(Endpoint** defaultEndpoint);
//int getCaptureEndpoints(std::vector<Endpoint*> *captureEndpoints);
//IMMDeviceEnumerator** setOrigin();
~Overseer();
private:
unsigned int numPlaybackEndpoints;
IMMDeviceEnumerator *deviceEnumerator;
std::vector<Endpoint*> playbackDevices;
void initCOMLibrary();
//IMMDeviceCollection *deviceCollection;
//int numCaptureEndpoints;
//std::vector<Endpoint*> *captureDevices;
};