From 8c4603c73675958efc960fbd4bb599a2909d106a Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 16 Jan 2023 14:52:43 +0100 Subject: Source codes --- Examples/WhisperDesktop/AppState.h | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Examples/WhisperDesktop/AppState.h (limited to 'Examples/WhisperDesktop/AppState.h') diff --git a/Examples/WhisperDesktop/AppState.h b/Examples/WhisperDesktop/AppState.h new file mode 100644 index 0000000..0a45a21 --- /dev/null +++ b/Examples/WhisperDesktop/AppState.h @@ -0,0 +1,51 @@ +#pragma once +#include "Utils/DebugConsole.h" + +class AppState +{ + bool coInit = false; + CRegKey registryKey; + CIcon appIcon; +public: + + struct ModelSource + { + CString path; + bool found = false; + Whisper::eModelImplementation impl = (Whisper::eModelImplementation)0; + uint64_t sizeInBytes = 0; + }; + ModelSource source; + + DebugConsole console; + CComPtr mediaFoundation; + CComPtr model; + + ~AppState(); + + // Setup the initial things + HRESULT startup(); + + HRESULT findModelSource(); + + HRESULT saveModelSource(); + + uint32_t languageRead(); + void languageWrite( uint32_t key ); + + CString stringLoad( LPCTSTR name ); + void stringStore( LPCTSTR name, LPCTSTR value ); + uint32_t dwordLoad( LPCTSTR name, uint32_t fallback ); + void dwordStore( LPCTSTR name, uint32_t value ); + + bool automaticallyLoadModel = true; + + void lastScreenSave( HRESULT code ); + HRESULT lastScreenLoad(); + + void setupIcon( CWindow* wnd ); +}; + +constexpr HRESULT SCREEN_MODEL = 1; +constexpr HRESULT SCREEN_TRANSCRIBE = 2; +constexpr HRESULT SCREEN_CAPTURE = 3; \ No newline at end of file -- cgit v1.2.3