forked from Sneeds-Feed-and-Seed/sneedacity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimerRecordDialog.h
150 lines (112 loc) · 4.26 KB
/
TimerRecordDialog.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/**********************************************************************
Sneedacity: A Digital Audio Editor
TimerRecordDialog.h
Copyright 2006 by Vaughan Johnson
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
**********************************************************************/
#ifndef __SNEEDACITY_TIMERRECORD_DIALOG__
#define __SNEEDACITY_TIMERRECORD_DIALOG__
#include <wx/textctrl.h> // to inherit
#include <wx/timer.h> // member variable
#include "export/Export.h"
class wxCheckBox;
class wxChoice;
class wxDateEvent;
class wxDatePickerCtrl;
class wxTimerEvent;
class NumericTextCtrl;
class ShuttleGui;
class wxTextCtrlWrapper;
enum TimerRecordCompletedActions {
TR_ACTION_NOTHING = 0x00000000,
TR_ACTION_SAVED = 0x00000001,
TR_ACTION_EXPORTED = 0x00000002
};
enum {
POST_TIMER_RECORD_STOPPED = -3,
POST_TIMER_RECORD_CANCEL_WAIT,
POST_TIMER_RECORD_CANCEL,
POST_TIMER_RECORD_NOTHING = 0,
POST_TIMER_RECORD_CLOSE,
#ifdef __WINDOWS__
POST_TIMER_RECORD_RESTART,
POST_TIMER_RECORD_SHUTDOWN
#endif
};
class SneedacityProject;
class TimerRecordDialog final : public wxDialogWrapper
{
public:
TimerRecordDialog(
wxWindow* parent, SneedacityProject &project, bool bAlreadySaved);
~TimerRecordDialog();
void OnTimer(wxTimerEvent& event);
///Runs the wait for start dialog. Returns false if the user clicks stop.
int RunWaitDialog();
private:
void OnDatePicker_Start(wxDateEvent& event);
void OnTimeText_Start(wxCommandEvent& event);
void OnDatePicker_End(wxDateEvent& event);
void OnTimeText_End(wxCommandEvent& event);
void OnTimeText_Duration(wxCommandEvent & event);
void OnOK(wxCommandEvent& event);
void OnHelpButtonClick(wxCommandEvent& event);
TranslatableString GetDisplayDate(wxDateTime & dt);
void PopulateOrExchange(ShuttleGui& S);
bool TransferDataFromWindow() override;
// no TransferDataFromWindow() because ??
void UpdateDuration(); // Update m_TimeSpan_Duration and ctrl based on m_DateTime_Start and m_DateTime_End.
void UpdateEnd(); // Update m_DateTime_End and ctrls based on m_DateTime_Start and m_TimeSpan_Duration.
ProgressResult WaitForStart();
// Timer Recording Automation Control Events
void OnAutoSavePathButton_Click(wxCommandEvent& event);
void OnAutoExportPathButton_Click(wxCommandEvent& event);
void OnAutoSaveCheckBox_Change(wxCommandEvent& event);
void OnAutoExportCheckBox_Change(wxCommandEvent& event);
// Timer Recording Automation Routines
void EnableDisableAutoControls(bool bEnable, int iControlGoup);
void UpdateTextBoxControls();
// Add Path Controls to Form
wxTextCtrlWrapper *NewPathControl(
wxWindow *wParent, const int iID,
const TranslatableString &sCaption, const TranslatableString &sValue);
int ExecutePostRecordActions(bool bWasStopped);
ProgressResult PreActionDelay(int iActionIndex, TimerRecordCompletedActions eCompletedActions);
private:
SneedacityProject &mProject;
wxDateTime m_DateTime_Start;
wxDateTime m_DateTime_End;
wxTimeSpan m_TimeSpan_Duration;
// controls
wxDatePickerCtrl* m_pDatePickerCtrl_Start;
NumericTextCtrl* m_pTimeTextCtrl_Start;
wxDatePickerCtrl* m_pDatePickerCtrl_End;
NumericTextCtrl* m_pTimeTextCtrl_End;
NumericTextCtrl* m_pTimeTextCtrl_Duration;
wxTimer m_timer;
// Controls for Auto Save/Export
wxCheckBox *m_pTimerAutoSaveCheckBoxCtrl;
wxTextCtrlWrapper *m_pTimerSavePathTextCtrl;
wxButton *m_pTimerSavePathButtonCtrl;
wxCheckBox *m_pTimerAutoExportCheckBoxCtrl;
wxTextCtrlWrapper *m_pTimerExportPathTextCtrl;
wxButton *m_pTimerExportPathButtonCtrl;
// After Timer Record Options Choice
wxChoice *m_pTimerAfterCompleteChoiceCtrl;
// After Timer Record do we need to clean up?
bool m_bProjectCleanupRequired;
// Variables for the Auto Save/Export
bool m_bAutoSaveEnabled;
wxFileName m_fnAutoSaveFile;
bool m_bAutoExportEnabled;
wxFileName m_fnAutoExportFile;
int m_iAutoExportFormat;
int m_iAutoExportSubFormat;
int m_iAutoExportFilterIndex;
bool m_bProjectAlreadySaved;
DECLARE_EVENT_TABLE()
};
#endif