18#define DEFINE_FFMPEG_POINTERS
28#include <wx/checkbox.h>
32#include <wx/textctrl.h>
34#if !defined(USE_FFMPEG)
39 return XO(
"FFmpeg support not compiled in");
74"FFmpeg was configured in Preferences and successfully loaded before, \
75\nbut this time Audacity failed to load it at startup. \
76\n\nYou may want to go back to Preferences > Libraries and re-configure it."),
77 XO(
"FFmpeg startup failed"));
90 wxT(
"F(%d.%d.%d),C(%d.%d.%d),U(%d.%d.%d)"),
91 ffmpeg->AVFormatVersion.Major, ffmpeg->AVFormatVersion.Minor, ffmpeg->AVFormatVersion.Micro,
92 ffmpeg->AVCodecVersion.Major, ffmpeg->AVCodecVersion.Minor, ffmpeg->AVCodecVersion.Micro,
93 ffmpeg->AVUtilVersion.Major, ffmpeg->AVUtilVersion.Minor, ffmpeg->AVUtilVersion.Micro
97 return XO(
"FFmpeg library not found");
108#define ID_FFMPEG_BROWSE 5000
109#define ID_FFMPEG_DLOAD 5001
130 S.StartVerticalLay(
true);
134"Audacity needs the file '%s' to import and export audio via FFmpeg.")
138 S.StartHorizontalLay(wxALIGN_LEFT,
true);
142 S.EndHorizontalLay();
144 S.StartMultiColumn(2, wxEXPAND);
151 XO(
"To find '%s', click here -->")
163 XO(
"To get a free copy of FFmpeg, click here -->"),
true);
168 S.AddStandardButtons();
174 SetMinSize(GetSize());
183# if defined(__WXMSW__)
184 {
XO(
"Only avformat.dll"), {
wxT(
"avformat-*.dll") } },
185# elif defined(__WXMAC__)
186 {
XO(
"Only libavformat.dylib"), {
wxT(
"ffmpeg.*.dylib"),
wxT(
"libavformat.*.dylib") } },
188 {
XO(
"Only libavformat.so"), {
wxT(
"libavformat.so.*") } },
199 auto question =
XO(
"Where is '%s'?").Format(
mName );
202 FileNames::Operation::_None,
208 wxFD_OPEN | wxRESIZE_BORDER,
225 const wxString path =
mPathText->GetValue();
227 if (wxDirExists(path))
228 mFullPath = wxFileName(path, {}, wxPATH_NATIVE);
245 DECLARE_EVENT_TABLE()
263 PopulateOrExchange(
S);
271 S.StartVerticalLay(
true);
274"Audacity attempted to use FFmpeg to import an audio file,\n\
275but the libraries were not found.\n\n\
276To use FFmpeg import, go to Edit > Preferences > Libraries\n\
277to download or locate the FFmpeg libraries."
281 .AddCheckBox(
XXO(
"Do not show this warning again"),
290 SetMinSize(GetSize());
314#if defined(__WXMSW__)
315 const wxString
name =
wxT(
"avformat.dll");
316#elif defined(__WXMAC__)
317 const wxString
name =
wxT(
"libavformat.dylib");
319 const wxString
name =
wxT(
"libavformat.so");
322 wxLogMessage(
wxT(
"Looking for FFmpeg libraries..."));
326 if (!searchPaths.empty())
327 path = searchPaths.front();
331 if (fd.ShowModal() == wxID_CANCEL) {
332 wxLogMessage(
wxT(
"User canceled the dialog. Failed to find FFmpeg libraries."));
338 const wxFileName fileName(path);
340 if (fileName.FileExists())
341 path = fileName.GetPath();
343 wxLogMessage(
wxT(
"User-specified path = '%s'"), path);
351 wxLogError(
wxT(
"User-specified path does not contain FFmpeg libraries."));
357 wxLogMessage(
wxT(
"User-specified FFmpeg file exists. Success."));
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
const TranslatableString name
TranslatableString GetFFmpegVersion()
static BoolSetting FFmpegEnabled
bool FindFFmpegLibs(wxWindow *parent)
BoolSetting FFmpegNotFoundDontShow
bool LoadFFmpeg(bool showerror)
StringSetting AVFormatPath
XXO("&Cut/Copy/Paste Toolbar")
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)
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
This specialization of Setting for bool adds a Toggle method to negate the saved value.
void PopulateOrExchange(ShuttleGui &S)
void OnOk(wxCommandEvent &WXUNUSED(event))
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
std::vector< FileType > FileTypes
FILES_API const FileType AllFiles
FILES_API const FileType DynamicLibraries
Allows user to locate libav* libraries.
void OnDownload(wxCommandEvent &WXUNUSED(event))
FindFFmpegDialog(wxWindow *parent, const wxString &path, const wxString &name)
void PopulateOrExchange(ShuttleGui &S)
void OnBrowse(wxCommandEvent &WXUNUSED(event))
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
bool Write(const T &value)
Write value to config and return true if successful.
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined */
Extend SettingScope with Commit() which flushes updates in a batch.
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Holds a msgid for the translation catalog; may also bind format arguments.
static std::vector< wxString > GetSearchPaths(bool fromUserPathOnly)
static std::shared_ptr< FFmpegFunctions > Load(bool fromUserPathOnly=false)