summaryrefslogtreecommitdiffstats
path: root/Examples/WhisperDesktop/AppState.h
diff options
context:
space:
mode:
authorKonstantin <const@const.me>2023-01-16 14:52:43 +0100
committerKonstantin <const@const.me>2023-01-16 14:52:43 +0100
commit8c4603c73675958efc960fbd4bb599a2909d106a (patch)
tree714dc6fc9a1672d5fd7f89676b97e10959662abc /Examples/WhisperDesktop/AppState.h
parent990a8d0dbaefc996244097397259e92758b15cce (diff)
Source codes
Diffstat (limited to 'Examples/WhisperDesktop/AppState.h')
-rw-r--r--Examples/WhisperDesktop/AppState.h51
1 files changed, 51 insertions, 0 deletions
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<Whisper::iMediaFoundation> mediaFoundation;
+ CComPtr<Whisper::iModel> 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