Audacity  3.0.3
Public Member Functions | Private Attributes | List of all members
FindFFmpegDialog Class Referencefinal

Allows user to locate libav* libraries. More...

Inheritance diagram for FindFFmpegDialog:
[legend]
Collaboration diagram for FindFFmpegDialog:
[legend]

Public Member Functions

 FindFFmpegDialog (wxWindow *parent, const wxString &path, const wxString &name)
 
void PopulateOrExchange (ShuttleGui &S)
 
void OnBrowse (wxCommandEvent &WXUNUSED(event))
 
void OnDownload (wxCommandEvent &WXUNUSED(event))
 
void UpdatePath ()
 
wxString GetLibPath ()
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
void SetTitle (const TranslatableString &title)
 
void SetLabel (const TranslatableString &title)
 
void SetName (const TranslatableString &title)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Attributes

wxString mName
 
wxFileName mFullPath
 
wxTextCtrl * mPathText
 

Detailed Description

Allows user to locate libav* libraries.

Definition at line 112 of file FFmpeg.cpp.

Constructor & Destructor Documentation

◆ FindFFmpegDialog()

FindFFmpegDialog::FindFFmpegDialog ( wxWindow *  parent,
const wxString &  path,
const wxString &  name 
)
inline

Definition at line 116 of file FFmpeg.cpp.

117  : wxDialogWrapper(parent, wxID_ANY, XO("Locate FFmpeg"))
118  , mName(name)
119  , mFullPath(path, name)
120  {
121  SetName();
122 
123  ShuttleGui S(this, eIsCreating);
125  }

References eIsCreating, PopulateOrExchange(), and wxDialogWrapper::SetName().

Here is the call graph for this function:

Member Function Documentation

◆ GetLibPath()

wxString FindFFmpegDialog::GetLibPath ( )
inline

Definition at line 228 of file FFmpeg.cpp.

229  {
230  UpdatePath();
231  return mFullPath.GetFullPath();
232  }

References mFullPath, and UpdatePath().

Referenced by FindFFmpegLibs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnBrowse()

void FindFFmpegDialog::OnBrowse ( wxCommandEvent &  WXUNUSEDevent)
inline

Definition at line 180 of file FFmpeg.cpp.

181  {
182  static const FileNames::FileTypes types = {
183 # if defined(__WXMSW__)
184  { XO("Only avformat.dll"), { wxT("avformat-*.dll") } },
185 # elif defined(__WXMAC__)
186  { XO("Only ffmpeg.*.dylib"), { wxT("ffmpeg.*.dylib") } },
187 # else
188  { XO("Only libavformat.so"), { wxT("libavformat.so.*") } },
189 # endif
192  };
193 
194  UpdatePath();
195 
196  /* i18n-hint: It's asking for the location of a file, for
197  example, "Where is lame_enc.dll?" - you could translate
198  "Where would I find the file '%s'?" instead if you want. */
199  auto question = XO("Where is '%s'?").Format( mName );
200 
201  wxString path = SelectFile(
202  FileNames::Operation::_None,
203  question,
204  mFullPath.GetPath(),
205  mFullPath.GetFullName(),
206  wxT(""),
207  types,
208  wxFD_OPEN | wxRESIZE_BORDER,
209  this);
210 
211  if (!path.empty())
212  {
213  mFullPath = path;
214  mPathText->SetValue(path);
215  }
216  }

References FileNames::AllFiles, FileNames::DynamicLibraries, mFullPath, mName, mPathText, SelectFile(), UpdatePath(), and XO.

Here is the call graph for this function:

◆ OnDownload()

void FindFFmpegDialog::OnDownload ( wxCommandEvent &  WXUNUSEDevent)
inline

Definition at line 218 of file FFmpeg.cpp.

219  {
220  HelpSystem::ShowHelp(this, L"FAQ:Installing_the_FFmpeg_Import_Export_Library");
221  }

References HelpSystem::ShowHelp().

Here is the call graph for this function:

◆ PopulateOrExchange()

void FindFFmpegDialog::PopulateOrExchange ( ShuttleGui S)
inline

Definition at line 127 of file FFmpeg.cpp.

128  {
129  S.SetBorder(10);
130  S.StartVerticalLay(true);
131  {
132  S.AddTitle(
133  XO(
134 "Audacity needs the file '%s' to import and export audio via FFmpeg.")
135  .Format( mName ) );
136 
137  S.SetBorder(3);
138  S.StartHorizontalLay(wxALIGN_LEFT, true);
139  {
140  S.AddTitle( XO("Location of '%s':").Format( mName ) );
141  }
142  S.EndHorizontalLay();
143 
144  S.StartMultiColumn(2, wxEXPAND);
145  S.SetStretchyCol(0);
146  {
147  if (mFullPath.GetFullPath().empty())
148  {
149  mPathText = S.AddTextBox(
150  {},
151  XO("To find '%s', click here -->")
152  .Format(mName)
153  .Translation(),
154  0);
155  }
156  else
157  {
158  mPathText = S.AddTextBox({}, mFullPath.GetFullPath(), 0);
159  }
160 
161  S.Id(ID_FFMPEG_BROWSE).AddButton(XXO("Browse..."), wxALIGN_RIGHT);
162  S.AddVariableText(
163  XO("To get a free copy of FFmpeg, click here -->"), true);
164  S.Id(ID_FFMPEG_DLOAD).AddButton(XXO("Download"), wxALIGN_RIGHT);
165  }
166  S.EndMultiColumn();
167 
168  S.AddStandardButtons();
169  }
170  S.EndVerticalLay();
171 
172  Layout();
173  Fit();
174  SetMinSize(GetSize());
175  Center();
176 
177  return;
178  }

References ShuttleGuiBase::AddButton(), ShuttleGui::AddStandardButtons(), ShuttleGuiBase::AddTextBox(), ShuttleGuiBase::AddTitle(), ShuttleGuiBase::AddVariableText(), ShuttleGuiBase::EndHorizontalLay(), ShuttleGuiBase::EndMultiColumn(), ShuttleGuiBase::EndVerticalLay(), ShuttleGui::Id(), ID_FFMPEG_BROWSE, ID_FFMPEG_DLOAD, mFullPath, mName, mPathText, ShuttleGuiBase::SetBorder(), ShuttleGuiBase::SetStretchyCol(), ShuttleGuiBase::StartHorizontalLay(), ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::StartVerticalLay(), XO, and XXO.

Referenced by FindFFmpegDialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdatePath()

void FindFFmpegDialog::UpdatePath ( )
inline

Definition at line 223 of file FFmpeg.cpp.

224  {
225  mFullPath = mPathText->GetValue();
226  }

References mFullPath, and mPathText.

Referenced by GetLibPath(), and OnBrowse().

Here is the caller graph for this function:

Member Data Documentation

◆ mFullPath

wxFileName FindFFmpegDialog::mFullPath
private

Definition at line 236 of file FFmpeg.cpp.

Referenced by GetLibPath(), OnBrowse(), PopulateOrExchange(), and UpdatePath().

◆ mName

wxString FindFFmpegDialog::mName
private

Definition at line 235 of file FFmpeg.cpp.

Referenced by OnBrowse(), and PopulateOrExchange().

◆ mPathText

wxTextCtrl* FindFFmpegDialog::mPathText
private

Definition at line 238 of file FFmpeg.cpp.

Referenced by OnBrowse(), PopulateOrExchange(), and UpdatePath().


The documentation for this class was generated from the following file:
FindFFmpegDialog::UpdatePath
void UpdatePath()
Definition: FFmpeg.cpp:223
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
ShuttleGuiBase::AddTitle
void AddTitle(const TranslatableString &Prompt, int wrapWidth=0)
Centred text string.
Definition: ShuttleGui.cpp:281
SelectFile
FilePath SelectFile(FileNames::Operation op, const TranslatableString &message, const FilePath &default_path, const FilePath &default_filename, const FileExtension &default_extension, const FileTypes &fileTypes, int flags, wxWindow *parent)
Definition: SelectFile.cpp:17
Format
Abstract base class used in importing a file.
XO
#define XO(s)
Definition: Internat.h:31
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
FileNames::AllFiles
FILES_API const FileType AllFiles
Definition: FileNames.h:71
HelpSystem::ShowHelp
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:237
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2274
FindFFmpegDialog::mFullPath
wxFileName mFullPath
Definition: FFmpeg.cpp:236
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1177
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1167
ShuttleGuiBase::AddTextBox
wxTextCtrl * AddTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:638
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
FindFFmpegDialog::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: FFmpeg.cpp:127
name
const TranslatableString name
Definition: Distortion.cpp:98
FindFFmpegDialog::mPathText
wxTextCtrl * mPathText
Definition: FFmpeg.cpp:238
FindFFmpegDialog::mName
wxString mName
Definition: FFmpeg.cpp:235
ShuttleGuiBase::AddButton
wxButton * AddButton(const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
Definition: ShuttleGui.cpp:360
ID_FFMPEG_DLOAD
#define ID_FFMPEG_DLOAD
Definition: FFmpeg.cpp:109
FileNames::DynamicLibraries
FILES_API const FileType DynamicLibraries
Definition: FileNames.h:73
ID_FFMPEG_BROWSE
#define ID_FFMPEG_BROWSE
Definition: FFmpeg.cpp:108
wxDialogWrapper::wxDialogWrapper
wxDialogWrapper()
Definition: wxPanelWrapper.h:84
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2444
FileNames::FileTypes
std::vector< FileType > FileTypes
Definition: FileNames.h:76
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
wxDialogWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:81
ShuttleGuiBase::AddVariableText
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
Definition: ShuttleGui.cpp:463
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:202
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631