18#define DEFINE_FFMPEG_POINTERS
30#include <wx/checkbox.h>
34#include <wx/textctrl.h>
67"FFmpeg was configured in Preferences and successfully loaded before, \
68\nbut this time Audacity failed to load it at startup. \
69\n\nYou may want to go back to Preferences > Libraries and re-configure it."),
70 XO(
"FFmpeg startup failed"));
83 wxT(
"F(%d.%d.%d),C(%d.%d.%d),U(%d.%d.%d)"),
84 ffmpeg->AVFormatVersion.Major, ffmpeg->AVFormatVersion.Minor, ffmpeg->AVFormatVersion.Micro,
85 ffmpeg->AVCodecVersion.Major, ffmpeg->AVCodecVersion.Minor, ffmpeg->AVCodecVersion.Micro,
86 ffmpeg->AVUtilVersion.Major, ffmpeg->AVUtilVersion.Minor, ffmpeg->AVUtilVersion.Micro
90 return XO(
"FFmpeg library not found");
101#define ID_FFMPEG_BROWSE 5000
102#define ID_FFMPEG_DLOAD 5001
123 S.StartVerticalLay(
true);
127"Audacity needs the file '%s' to import and export audio via FFmpeg.")
131 S.StartHorizontalLay(wxALIGN_LEFT,
true);
135 S.EndHorizontalLay();
137 S.StartMultiColumn(2, wxEXPAND);
144 XO(
"To find '%s', click here -->")
156 XO(
"To get a free copy of FFmpeg, click here -->"),
true);
161 S.AddStandardButtons();
167 SetMinSize(GetSize());
176# if defined(__WXMSW__)
177 {
XO(
"Only avformat.dll"), {
wxT(
"avformat-*.dll") } },
178# elif defined(__WXMAC__)
179 {
XO(
"Only libavformat.dylib"), {
wxT(
"ffmpeg.*.dylib"),
wxT(
"libavformat.*.dylib") } },
181 {
XO(
"Only libavformat.so"), {
wxT(
"libavformat.so.*") } },
192 auto question =
XO(
"Where is '%s'?").Format(
mName );
195 FileNames::Operation::_None,
201 wxFD_OPEN | wxRESIZE_BORDER,
218 const wxString path =
mPathText->GetValue();
220 if (wxDirExists(path))
221 mFullPath = wxFileName(path, {}, wxPATH_NATIVE);
238 DECLARE_EVENT_TABLE()
256 PopulateOrExchange(
S);
264 S.StartVerticalLay(
true);
267"Audacity attempted to use FFmpeg to import an audio file,\n\
268but the libraries were not found.\n\n\
269To use FFmpeg import, go to Edit > Preferences > Libraries\n\
270to download or locate the FFmpeg libraries."
274 .AddCheckBox(
XXO(
"Do not show this warning again"),
283 SetMinSize(GetSize());
307#if defined(__WXMSW__)
308 const wxString
name =
wxT(
"avformat.dll");
309#elif defined(__WXMAC__)
310 const wxString
name =
wxT(
"libavformat.dylib");
312 const wxString
name =
wxT(
"libavformat.so");
315 wxLogMessage(
wxT(
"Looking for FFmpeg libraries..."));
319 if (!searchPaths.empty())
320 path = searchPaths.front();
324 if (fd.ShowModal() == wxID_CANCEL) {
325 wxLogMessage(
wxT(
"User canceled the dialog. Failed to find FFmpeg libraries."));
331 const wxFileName fileName(path);
333 if (fileName.FileExists())
334 path = fileName.GetPath();
336 wxLogMessage(
wxT(
"User-specified path = '%s'"), path);
344 wxLogError(
wxT(
"User-specified path does not contain FFmpeg libraries."));
350 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
TranslatableString GetFFmpegVersion()
static BoolSetting FFmpegEnabled
DEFINE_VERSION_CHECK DLL_API int ModuleDispatch(ModuleDispatchTypes type)
bool FindFFmpegLibs(wxWindow *parent)
BoolSetting FFmpegNotFoundDontShow
bool LoadFFmpeg(bool showerror)
StringSetting AVFormatPath
XXO("&Cut/Copy/Paste Toolbar")
audacity::BasicSettings * gPrefs
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))
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.
virtual bool Flush() noexcept=0
static std::vector< wxString > GetSearchPaths(bool fromUserPathOnly)
static std::shared_ptr< FFmpegFunctions > Load(bool fromUserPathOnly=false)