2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
TimerRecordDialog.h
|
|
|
|
|
|
|
|
Copyright 2006 by Vaughan Johnson
|
2014-06-03 20:30:19 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
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 __AUDACITY_TIMERRECORD_DIALOG__
|
|
|
|
#define __AUDACITY_TIMERRECORD_DIALOG__
|
|
|
|
|
2018-11-11 21:11:18 +00:00
|
|
|
#include <wx/textctrl.h> // to inherit
|
2018-11-14 16:48:46 +00:00
|
|
|
#include <wx/timer.h> // member variable
|
2016-02-25 13:47:48 +00:00
|
|
|
#include "export/Export.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2018-11-11 22:30:55 +00:00
|
|
|
class wxCheckBox;
|
2019-03-31 20:31:30 +00:00
|
|
|
class wxChoice;
|
2018-11-16 16:02:39 +00:00
|
|
|
class wxDateEvent;
|
2018-11-16 15:26:39 +00:00
|
|
|
class wxDatePickerCtrl;
|
2015-06-18 14:24:36 +00:00
|
|
|
class wxTimerEvent;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2014-11-08 15:18:43 +00:00
|
|
|
class NumericTextCtrl;
|
2015-06-18 14:24:36 +00:00
|
|
|
class ShuttleGui;
|
2020-07-29 05:08:48 +00:00
|
|
|
class wxTextCtrlWrapper;
|
2016-02-25 13:47:48 +00:00
|
|
|
|
2016-03-30 22:46:15 +00:00
|
|
|
enum TimerRecordCompletedActions {
|
|
|
|
TR_ACTION_NOTHING = 0x00000000,
|
|
|
|
TR_ACTION_SAVED = 0x00000001,
|
|
|
|
TR_ACTION_EXPORTED = 0x00000002
|
|
|
|
};
|
|
|
|
|
2020-04-23 14:04:02 +00:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2020-01-02 04:41:04 +00:00
|
|
|
class AudacityProject;
|
|
|
|
|
2016-07-10 21:10:50 +00:00
|
|
|
class TimerRecordDialog final : public wxDialogWrapper
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-01-02 04:41:04 +00:00
|
|
|
TimerRecordDialog(
|
|
|
|
wxWindow* parent, AudacityProject &project, bool bAlreadySaved);
|
2010-01-23 19:44:49 +00:00
|
|
|
~TimerRecordDialog();
|
|
|
|
|
|
|
|
void OnTimer(wxTimerEvent& event);
|
|
|
|
///Runs the wait for start dialog. Returns false if the user clicks stop.
|
2016-02-25 13:47:48 +00:00
|
|
|
int RunWaitDialog();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
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);
|
2016-04-06 12:20:36 +00:00
|
|
|
void OnHelpButtonClick(wxCommandEvent& event);
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-12-08 03:37:02 +00:00
|
|
|
TranslatableString GetDisplayDate(wxDateTime & dt);
|
2010-01-23 19:44:49 +00:00
|
|
|
void PopulateOrExchange(ShuttleGui& S);
|
2017-10-01 17:28:04 +00:00
|
|
|
|
|
|
|
bool TransferDataFromWindow() override;
|
|
|
|
// no TransferDataFromWindow() because ??
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
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.
|
2016-12-24 15:43:25 +00:00
|
|
|
ProgressResult WaitForStart();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-02-25 13:47:48 +00:00
|
|
|
// 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
|
2020-07-29 05:08:48 +00:00
|
|
|
wxTextCtrlWrapper *NewPathControl(
|
2019-12-28 03:44:44 +00:00
|
|
|
wxWindow *wParent, const int iID,
|
|
|
|
const TranslatableString &sCaption, const TranslatableString &sValue);
|
2016-02-25 13:47:48 +00:00
|
|
|
|
|
|
|
int ExecutePostRecordActions(bool bWasStopped);
|
2016-12-24 15:43:25 +00:00
|
|
|
ProgressResult PreActionDelay(int iActionIndex, TimerRecordCompletedActions eCompletedActions);
|
2016-02-25 13:47:48 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
private:
|
2020-01-02 04:41:04 +00:00
|
|
|
AudacityProject &mProject;
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
wxDateTime m_DateTime_Start;
|
|
|
|
wxDateTime m_DateTime_End;
|
|
|
|
wxTimeSpan m_TimeSpan_Duration;
|
|
|
|
|
|
|
|
// controls
|
|
|
|
wxDatePickerCtrl* m_pDatePickerCtrl_Start;
|
2014-11-08 15:18:43 +00:00
|
|
|
NumericTextCtrl* m_pTimeTextCtrl_Start;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
wxDatePickerCtrl* m_pDatePickerCtrl_End;
|
2014-11-08 15:18:43 +00:00
|
|
|
NumericTextCtrl* m_pTimeTextCtrl_End;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2014-11-08 15:18:43 +00:00
|
|
|
NumericTextCtrl* m_pTimeTextCtrl_Duration;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
wxTimer m_timer;
|
|
|
|
|
2016-02-25 13:47:48 +00:00
|
|
|
// Controls for Auto Save/Export
|
|
|
|
wxCheckBox *m_pTimerAutoSaveCheckBoxCtrl;
|
2020-07-29 05:08:48 +00:00
|
|
|
wxTextCtrlWrapper *m_pTimerSavePathTextCtrl;
|
2016-02-25 13:47:48 +00:00
|
|
|
wxButton *m_pTimerSavePathButtonCtrl;
|
|
|
|
wxCheckBox *m_pTimerAutoExportCheckBoxCtrl;
|
2020-07-29 05:08:48 +00:00
|
|
|
wxTextCtrlWrapper *m_pTimerExportPathTextCtrl;
|
2016-02-25 13:47:48 +00:00
|
|
|
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;
|
|
|
|
|
2016-09-18 14:26:29 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2010-01-23 19:44:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|