audacia/src/TimeDialog.h

60 lines
1.1 KiB
C++

/**********************************************************************
Audacity: A Digital Audio Editor
TimeDialog.h
Dominic Mazzoni
**********************************************************************/
#ifndef __AUDACITY_TimeDialog__
#define __AUDACITY_TimeDialog__
#include <wx/defs.h>
#include <wx/dialog.h>
#include <wx/event.h>
#include <wx/string.h>
#include "widgets/TimeTextCtrl.h"
class ShuttleGui;
class TimeDialog:public wxDialog
{
public:
TimeDialog(wxWindow *parent,
const wxString &title,
const wxString &format,
double rate,
double time,
const wxString &prompt = _("Duration"));
void SetFormatString(wxString formatString);
void SetSampleRate(double sampleRate);
void SetTimeValue(double newTime);
const double GetTimeValue();
private:
void PopulateOrExchange(ShuttleGui & S);
bool TransferDataToWindow();
bool TransferDataFromWindow();
void OnUpdate(wxCommandEvent &event);
private:
wxString mPrompt;
wxString mFormat;
double mRate;
double mTime;
TimeTextCtrl *mTimeCtrl;
DECLARE_EVENT_TABLE();
};
#endif