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, FileNames::FileTypes types)
 
void PopulateOrExchange (ShuttleGui &S)
 
void OnBrowse (wxCommandEvent &WXUNUSED(event))
 
void OnDownload (wxCommandEvent &WXUNUSED(event))
 
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

wxFileName mLibPath
 
wxString mPath
 
wxString mName
 
FileNames::FileTypes mTypes
 
wxTextCtrl * mPathText
 

Detailed Description

Allows user to locate libav* libraries.

Definition at line 452 of file FFmpeg.cpp.

Constructor & Destructor Documentation

◆ FindFFmpegDialog()

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

Definition at line 456 of file FFmpeg.cpp.

458  : wxDialogWrapper(parent, wxID_ANY, XO("Locate FFmpeg"))
459  {
460  SetName();
461  ShuttleGui S(this, eIsCreating);
462 
463  mPath = path;
464  mName = name;
465  mTypes = std::move( types );
466 
467  mLibPath.Assign(mPath, mName);
468 
470  }

References eIsCreating, mLibPath, mName, mPath, mTypes, name, PopulateOrExchange(), and wxDialogWrapper::SetName().

Here is the call graph for this function:

Member Function Documentation

◆ GetLibPath()

wxString FindFFmpegDialog::GetLibPath ( )
inline

Definition at line 544 of file FFmpeg.cpp.

545  {
546  return mLibPath.GetFullPath();
547  }

References mLibPath.

Referenced by FFmpegLibs::FindLibs().

Here is the caller graph for this function:

◆ OnBrowse()

void FindFFmpegDialog::OnBrowse ( wxCommandEvent &  WXUNUSEDevent)
inline

Definition at line 518 of file FFmpeg.cpp.

519  {
520  /* i18n-hint: It's asking for the location of a file, for
521  example, "Where is lame_enc.dll?" - you could translate
522  "Where would I find the file '%s'?" instead if you want. */
523  auto question = XO("Where is '%s'?").Format( mName );
524 
525  wxString path = FileNames::SelectFile(FileNames::Operation::_None,
526  question,
527  mLibPath.GetPath(),
528  mLibPath.GetFullName(),
529  wxT(""),
530  mTypes,
531  wxFD_OPEN | wxRESIZE_BORDER,
532  this);
533  if (!path.empty()) {
534  mLibPath = path;
535  mPathText->SetValue(path);
536  }
537  }

References mLibPath, mName, mPathText, mTypes, FileNames::SelectFile(), and XO.

Here is the call graph for this function:

◆ OnDownload()

void FindFFmpegDialog::OnDownload ( wxCommandEvent &  WXUNUSEDevent)
inline

Definition at line 539 of file FFmpeg.cpp.

540  {
541  HelpSystem::ShowHelp(this, wxT("FAQ:Installing_the_FFmpeg_Import_Export_Library"));
542  }

References HelpSystem::ShowHelp().

Here is the call graph for this function:

◆ PopulateOrExchange()

void FindFFmpegDialog::PopulateOrExchange ( ShuttleGui S)
inline

Definition at line 472 of file FFmpeg.cpp.

473  {
474  S.SetBorder(10);
475  S.StartVerticalLay(true);
476  {
477  S.AddTitle(
478  XO(
479 "Audacity needs the file '%s' to import and export audio via FFmpeg.")
480  .Format( mName ) );
481 
482  S.SetBorder(3);
483  S.StartHorizontalLay(wxALIGN_LEFT, true);
484  {
485  S.AddTitle( XO("Location of '%s':").Format( mName ) );
486  }
487  S.EndHorizontalLay();
488 
489  S.StartMultiColumn(2, wxEXPAND);
490  S.SetStretchyCol(0);
491  {
492  if (mLibPath.GetFullPath().empty()) {
493  mPathText = S.AddTextBox( {},
494  wxString::Format(_("To find '%s', click here -->"), mName), 0);
495  }
496  else {
497  mPathText = S.AddTextBox( {}, mLibPath.GetFullPath(), 0);
498  }
499  S.Id(ID_FFMPEG_BROWSE).AddButton(XXO("Browse..."), wxALIGN_RIGHT);
500  S.AddVariableText(
501  XO("To get a free copy of FFmpeg, click here -->"), true);
502  S.Id(ID_FFMPEG_DLOAD).AddButton(XXO("Download"), wxALIGN_RIGHT);
503  }
504  S.EndMultiColumn();
505 
506  S.AddStandardButtons();
507  }
508  S.EndVerticalLay();
509 
510  Layout();
511  Fit();
512  SetMinSize(GetSize());
513  Center();
514 
515  return;
516  }

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, mLibPath, 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:

Member Data Documentation

◆ mLibPath

wxFileName FindFFmpegDialog::mLibPath
private

Definition at line 551 of file FFmpeg.cpp.

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

◆ mName

wxString FindFFmpegDialog::mName
private

Definition at line 554 of file FFmpeg.cpp.

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

◆ mPath

wxString FindFFmpegDialog::mPath
private

Definition at line 553 of file FFmpeg.cpp.

Referenced by FindFFmpegDialog().

◆ mPathText

wxTextCtrl* FindFFmpegDialog::mPathText
private

Definition at line 557 of file FFmpeg.cpp.

Referenced by OnBrowse(), and PopulateOrExchange().

◆ mTypes

FileNames::FileTypes FindFFmpegDialog::mTypes
private

Definition at line 555 of file FFmpeg.cpp.

Referenced by FindFFmpegDialog(), and OnBrowse().


The documentation for this class was generated from the following file:
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:37
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1177
ShuttleGuiBase::AddTitle
void AddTitle(const TranslatableString &Prompt, int wrapWidth=0)
Centred text string.
Definition: ShuttleGui.cpp:274
Format
Abstract base class used in importing a file.
XO
#define XO(s)
Definition: Internat.h:31
FindFFmpegDialog::mTypes
FileNames::FileTypes mTypes
Definition: FFmpeg.cpp:555
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1212
FindFFmpegDialog::mLibPath
wxFileName mLibPath
Definition: FFmpeg.cpp:551
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2248
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1170
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1160
ShuttleGuiBase::AddTextBox
wxTextCtrl * AddTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:631
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1203
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1196
FindFFmpegDialog::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: FFmpeg.cpp:472
FindFFmpegDialog::mPath
wxString mPath
Definition: FFmpeg.cpp:553
name
const TranslatableString name
Definition: Distortion.cpp:98
FindFFmpegDialog::mPathText
wxTextCtrl * mPathText
Definition: FFmpeg.cpp:557
FindFFmpegDialog::mName
wxString mName
Definition: FFmpeg.cpp:554
ShuttleGuiBase::AddButton
wxButton * AddButton(const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
Definition: ShuttleGui.cpp:353
HelpSystem::ShowHelp
static void ShowHelp(wxWindow *parent, const wxString &localFileName, const wxString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:238
FileNames::SelectFile
AUDACITY_DLL_API FilePath SelectFile(Operation op, const TranslatableString &message, const FilePath &default_path, const FilePath &default_filename, const FileExtension &default_extension, const FileTypes &fileTypes, int flags, wxWindow *parent)
ID_FFMPEG_DLOAD
#define ID_FFMPEG_DLOAD
Definition: FFmpeg.cpp:449
_
#define _(s)
Definition: Internat.h:75
ID_FFMPEG_BROWSE
#define ID_FFMPEG_BROWSE
Definition: FFmpeg.cpp:448
wxDialogWrapper::wxDialogWrapper
wxDialogWrapper()
Definition: wxPanelWrapper.h:84
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2406
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:484
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:456
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:195
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:625