-
Notifications
You must be signed in to change notification settings - Fork 0
/
FormMain.h
119 lines (109 loc) · 3.64 KB
/
FormMain.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//---------------------------------------------------------------------------
#ifndef FormMainH
#define FormMainH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <FMX.Controls.hpp>
#include <FMX.Forms.hpp>
#include <FMX.Layouts.hpp>
#include <FMX.Types.hpp>
#include "FrameNum.h"
#include <FMX.Objects.hpp>
#include <FMX.Controls.Presentation.hpp>
#include <FMX.Edit.hpp>
#include <FMX.EditBox.hpp>
#include <FMX.NumberBox.hpp>
#include <FMX.ActnList.hpp>
#include <FMX.StdCtrls.hpp>
#include <System.Actions.hpp>
#include <FMX.Ani.hpp>
#include <array>
#include <memory>
#include <future>
#include <vector>
#include <atomic>
#include <anafestica/PersistFormWinFMX.h>
#include <anafestica/CfgRegistrySingleton.h>
//---------------------------------------------------------------------------
typedef Anafestica::TPersistFormWinFMX<Anafestica::TConfigRegistrySingleton>
TConfigRegistryFormWinFMX;
class TfrmMain : public TConfigRegistryFormWinFMX
{
__published: // IDE-managed Components
TGridLayout *GridLayout1;
TLayout *Layout1;
TStyleBook *StyleBook1;
TEdit *Edit1;
TButton *Button1;
TActionList *ActionList1;
TAction *actTest;
TLabel *Label1;
TAction *actRicomincia;
TButton *Button2;
TRectangle *Rectangle1;
TGradientAnimation *GradientAnimation1;
TSwitch *Switch1;
TLabel *Label2;
TTimer *Timer1;
TProgressBar *ProgressBar1;
TTimer *Timer2;
TLabel *Label3;
void __fastcall actTestExecute(TObject *Sender);
void __fastcall actTestUpdate(TObject *Sender);
void __fastcall actRicominciaExecute(TObject *Sender);
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall Switch1Switch(TObject *Sender);
void __fastcall Timer2Timer(TObject *Sender);
private: // User declarations
using NumFramePtr = std::unique_ptr<TfrmeNum>;
using NumFrames = std::array<NumFramePtr,100>;
using AutoNums = std::vector<NumFrames::size_type>;
using CompletionFnType = std::function<void(void)>;
NumFrames nums_;
int idx_ { -1 };
int punteggio_ {};
int record_ { 100 };
std::future<void> voiceFut_;
AutoNums autoNums_;
std::atomic_bool ready_ { true };
static constexpr int MaxP = 5;
static constexpr int MinP = 1;
void Init();
void ClearGame();
void Destroy();
//static String GetModuleFileName();
//void SetupCaption();
void RestoreProperties();
void SaveProperties() const;
void __fastcall NumClick(TObject *Sender);
void NumClickInt( NumFrames::size_type Idx );
void MostraPunteggio();
void SayAsync( String Text, CompletionFnType OnCompletion = {} );
void Shuffle();
void ResetBar();
void StartBar();
void StopBar();
void HideBar();
bool GetAuto() const;
bool AutoNumsEmpty() const { return autoNums_.empty(); }
bool IsReady() const { return ready_; }
bool VoiceStopped() const;
void StopCountdown();
void ClearAuto();
int GetNumScore() const;
String GetOkSentence( int Val ) const;
void SetRecord( int Val );
void MostraRecord();
__property int Record = { read = record_, write = SetRecord };
public: // User declarations
__fastcall TfrmMain( TComponent* Owner );
__fastcall TfrmMain( TComponent* Owner, StoreOpts StoreOptions,
Anafestica::TConfigNode* const RootNode );
__fastcall ~TfrmMain();
void StartCountdown();
};
//---------------------------------------------------------------------------
extern PACKAGE TfrmMain *frmMain;
//---------------------------------------------------------------------------
#endif