Og & wip: names

This commit is contained in:
Hane 2024-08-06 09:45:25 +02:00
commit 42b30b1bf8
5 changed files with 227 additions and 28 deletions

View file

@ -4,6 +4,7 @@
#include "global.h"
#include "contclasses.h"
#include <thread>
class Endpoint;
class SessionStateCallback : public IAudioSessionEvents {
@ -47,13 +48,18 @@ class Session {
//uint32_t getChannelCount();
private:
std::wstring fetchProcessName(DWORD pid);
bool getExePath(DWORD pid, /*out*/ std::wstring *exePath);
void fetchName(std::wstring exePath, DWORD pid);
bool fetchNameViaFD(std::wstring exePath, DWORD pid, /*out*/ std::wstring *sessionName);
bool fetchNameViaMSIX(std::wstring exePath, DWORD pid, /*out*/ std::wstring *sessionName);
bool fetchNameViaWindowName(std::wstring exePath, DWORD pid, /*out*/ std::wstring *sessionName);
/* std::wstring fetchProcessName(DWORD pid); */
std::wstring sessionName;
SessionState sessionState;
Endpoint* ep;
IAudioSessionControl2* sessionControl = nullptr;
IAudioMeterInformation* meterInformation = nullptr;
ISimpleAudioVolume* sessionVolume = nullptr;
size_t idx;
size_t idx;
};