Audacity 3.2.0
TimerRecordDialog.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 TimerRecordDialog.h
6
7 Copyright 2006 by Vaughan Johnson
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14**********************************************************************/
15
16#ifndef __AUDACITY_TIMERRECORD_DIALOG__
17#define __AUDACITY_TIMERRECORD_DIALOG__
18
19#include <wx/textctrl.h> // to inherit
20#include <wx/timer.h> // member variable
21#include "Export.h"
22#include "wxPanelWrapper.h"
23#include "BasicUI.h"
24
25class wxCheckBox;
26class wxChoice;
27class wxDateEvent;
28class wxDatePickerCtrl;
29class wxTimerEvent;
30
31class NumericTextCtrl;
32class ShuttleGui;
34
36 TR_ACTION_NOTHING = 0x00000000,
37 TR_ACTION_SAVED = 0x00000001,
38 TR_ACTION_EXPORTED = 0x00000002
39};
40
41enum {
45
48
49#ifdef __WINDOWS__
50 POST_TIMER_RECORD_RESTART,
51 POST_TIMER_RECORD_SHUTDOWN
52#endif
53};
54
55class AudacityProject;
56
58{
59public:
61
63 wxWindow* parent, AudacityProject &project, bool bAlreadySaved);
65
66 void OnTimer(wxTimerEvent& event);
68 int RunWaitDialog();
69
70private:
71 void OnDatePicker_Start(wxDateEvent& event);
72 void OnTimeText_Start(wxCommandEvent& event);
73
74 void OnDatePicker_End(wxDateEvent& event);
75 void OnTimeText_End(wxCommandEvent& event);
76
77 void OnTimeText_Duration(wxCommandEvent & event);
78
79 void OnOK(wxCommandEvent& event);
80 void OnHelpButtonClick(wxCommandEvent& event);
81
82 TranslatableString GetDisplayDate(wxDateTime & dt);
84
85 bool TransferDataFromWindow() override;
86 // no TransferDataFromWindow() because ??
87
88 void UpdateDuration(); // Update m_TimeSpan_Duration and ctrl based on m_DateTime_Start and m_DateTime_End.
89 void UpdateEnd(); // Update m_DateTime_End and ctrls based on m_DateTime_Start and m_TimeSpan_Duration.
91
92 // Timer Recording Automation Control Events
93 void OnAutoSavePathButton_Click(wxCommandEvent& event);
94 void OnAutoExportPathButton_Click(wxCommandEvent& event);
95 void OnAutoSaveCheckBox_Change(wxCommandEvent& event);
96 void OnAutoExportCheckBox_Change(wxCommandEvent& event);
97 // Timer Recording Automation Routines
98 void EnableDisableAutoControls(bool bEnable, int iControlGoup);
100
101 // Add Path Controls to Form
103 wxWindow *wParent, const int iID,
104 const TranslatableString &sCaption, const TranslatableString &sValue);
105
106 int ExecutePostRecordActions(bool bWasStopped);
107 ProgressResult PreActionDelay(int iActionIndex, TimerRecordCompletedActions eCompletedActions);
108
109private:
111
113 wxDateTime m_DateTime_End;
115
116 // controls
117 wxDatePickerCtrl* m_pDatePickerCtrl_Start;
119
120 wxDatePickerCtrl* m_pDatePickerCtrl_End;
122
124
125 wxTimer m_timer;
126
127 // Controls for Auto Save/Export
134
135 // After Timer Record Options Choice
137
138 // After Timer Record do we need to clean up?
140
141 // Variables for the Auto Save/Export
151
152 DECLARE_EVENT_TABLE()
153};
154
155#endif
Toolkit-neutral facade for basic user interface services.
const auto project
TimerRecordCompletedActions
@ TR_ACTION_NOTHING
@ TR_ACTION_EXPORTED
@ TR_ACTION_SAVED
@ POST_TIMER_RECORD_CLOSE
@ POST_TIMER_RECORD_CANCEL
@ POST_TIMER_RECORD_CANCEL_WAIT
@ POST_TIMER_RECORD_NOTHING
@ POST_TIMER_RECORD_STOPPED
#define S(N)
Definition: ToChars.cpp:64
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
std::vector< std::tuple< ExportOptionID, ExportValue > > Parameters
Definition: ExportPlugin.h:93
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Dialog for Timer Record, i.e., timed or long recording.
void OnAutoSaveCheckBox_Change(wxCommandEvent &event)
wxDatePickerCtrl * m_pDatePickerCtrl_Start
NumericTextCtrl * m_pTimeTextCtrl_Duration
void OnHelpButtonClick(wxCommandEvent &event)
void OnTimeText_Duration(wxCommandEvent &event)
NumericTextCtrl * m_pTimeTextCtrl_End
AudacityProject & mProject
TranslatableString GetDisplayDate(wxDateTime &dt)
wxButton * m_pTimerSavePathButtonCtrl
void EnableDisableAutoControls(bool bEnable, int iControlGoup)
wxCheckBox * m_pTimerAutoSaveCheckBoxCtrl
int ExecutePostRecordActions(bool bWasStopped)
void OnOK(wxCommandEvent &event)
void PopulateOrExchange(ShuttleGui &S)
NumericTextCtrl * m_pTimeTextCtrl_Start
wxTextCtrlWrapper * m_pTimerExportPathTextCtrl
wxDateTime m_DateTime_Start
TimerRecordDialog(wxWindow *parent, AudacityProject &project, bool bAlreadySaved)
void OnAutoExportPathButton_Click(wxCommandEvent &event)
void OnAutoExportCheckBox_Change(wxCommandEvent &event)
bool TransferDataFromWindow() override
wxChoice * m_pTimerAfterCompleteChoiceCtrl
wxFileName m_fnAutoSaveFile
void OnDatePicker_End(wxDateEvent &event)
ProgressResult WaitForStart()
wxTextCtrlWrapper * NewPathControl(wxWindow *wParent, const int iID, const TranslatableString &sCaption, const TranslatableString &sValue)
wxCheckBox * m_pTimerAutoExportCheckBoxCtrl
wxFileName m_fnAutoExportFile
void OnTimeText_Start(wxCommandEvent &event)
wxTimeSpan m_TimeSpan_Duration
wxDatePickerCtrl * m_pDatePickerCtrl_End
void OnAutoSavePathButton_Click(wxCommandEvent &event)
wxTextCtrlWrapper * m_pTimerSavePathTextCtrl
ExportProcessor::Parameters m_AutoExportParameters
void OnTimeText_End(wxCommandEvent &event)
wxButton * m_pTimerExportPathButtonCtrl
void OnTimer(wxTimerEvent &event)
int RunWaitDialog()
Runs the wait for start dialog. Returns false if the user clicks stop.
void OnDatePicker_Start(wxDateEvent &event)
ProgressResult PreActionDelay(int iActionIndex, TimerRecordCompletedActions eCompletedActions)
Holds a msgid for the translation catalog; may also bind format arguments.
ProgressResult
Definition: BasicUI.h:148