yum-archive/TaSTT-Whisper

High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model

git clone https://git.yummers.dev/yum-archive/TaSTT-Whisper

KonstantinSource codes8c4603c

master
853 B40 linesraw
1#include "stdafx.h"
2#include "PendingState.h"
3
4void PendingState::initialize( std::initializer_list<HWND> editors, std::initializer_list<HWND> pending )
5{
6	editorsWindows = editors;
7	wasEnabled.resize( editorsWindows.size() );
8	pendingWindows = pending;
9}
10
11void PendingState::setPending( bool nowPending )
12{
13	if( nowPending )
14	{
15		for( size_t i = 0; i < editorsWindows.size(); i++ )
16		{
17			BOOL e = IsWindowEnabled( editorsWindows[ i ] );
18			if( e )
19			{
20				wasEnabled[ i ] = true;
21				EnableWindow( editorsWindows[ i ], FALSE );
22			}
23			else
24				wasEnabled[ i ] = false;
25		}
26	}
27	else
28	{
29		for( size_t i = 0; i < editorsWindows.size(); i++ )
30		{
31			if( !wasEnabled[ i ] )
32				continue;
33			EnableWindow( editorsWindows[ i ], TRUE );
34		}
35	}
36
37	const int show = nowPending ? SW_NORMAL : SW_HIDE;
38	for( HWND w : pendingWindows )
39		::ShowWindow( w, show );
40}