Rewrite FileNames::SelectFile using FileTypes...
... And more uniformity in the descriptions of file types used in more than one place Also fixes missing translations in VSTEffect.cpp
This commit is contained in:
parent
9204319b86
commit
aa39f9ade2
|
@ -251,13 +251,13 @@ void AudacityLogger::OnSave(wxCommandEvent & WXUNUSED(e))
|
|||
wxString fName = _("log.txt");
|
||||
|
||||
fName = FileNames::SelectFile(FileNames::Operation::Export,
|
||||
XO("Save log to:"),
|
||||
wxEmptyString,
|
||||
fName,
|
||||
wxT("txt"),
|
||||
wxT("*.txt"),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
mFrame.get());
|
||||
XO("Save log to:"),
|
||||
wxEmptyString,
|
||||
fName,
|
||||
wxT("txt"),
|
||||
{ FileNames::TextFiles },
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
mFrame.get());
|
||||
|
||||
if (fName.empty()) {
|
||||
return;
|
||||
|
|
|
@ -261,13 +261,13 @@ void BenchmarkDialog::OnSave( wxCommandEvent & WXUNUSED(event))
|
|||
auto fName = XO("benchmark.txt").Translation();
|
||||
|
||||
fName = FileNames::SelectFile(FileNames::Operation::Export,
|
||||
XO("Export Benchmark Data as:"),
|
||||
wxEmptyString,
|
||||
fName,
|
||||
wxT("txt"),
|
||||
wxT("*.txt"),
|
||||
wxFD_SAVE | wxRESIZE_BORDER,
|
||||
this);
|
||||
XO("Export Benchmark Data as:"),
|
||||
wxEmptyString,
|
||||
fName,
|
||||
wxT("txt"),
|
||||
{ FileNames::TextFiles },
|
||||
wxFD_SAVE | wxRESIZE_BORDER,
|
||||
this);
|
||||
|
||||
if (fName.empty())
|
||||
return;
|
||||
|
|
|
@ -449,7 +449,8 @@ class FindFFmpegDialog final : public wxDialogWrapper
|
|||
{
|
||||
public:
|
||||
|
||||
FindFFmpegDialog(wxWindow *parent, const wxString &path, const wxString &name, const wxString &type)
|
||||
FindFFmpegDialog(wxWindow *parent, const wxString &path, const wxString &name,
|
||||
FileNames::FileTypes types)
|
||||
: wxDialogWrapper(parent, wxID_ANY, XO("Locate FFmpeg"))
|
||||
{
|
||||
SetName();
|
||||
|
@ -457,7 +458,7 @@ public:
|
|||
|
||||
mPath = path;
|
||||
mName = name;
|
||||
mType = type;
|
||||
mTypes = std::move( types );
|
||||
|
||||
mLibPath.Assign(mPath, mName);
|
||||
|
||||
|
@ -522,7 +523,7 @@ public:
|
|||
mLibPath.GetPath(),
|
||||
mLibPath.GetName(),
|
||||
wxT(""),
|
||||
mType,
|
||||
mTypes,
|
||||
wxFD_OPEN | wxRESIZE_BORDER,
|
||||
this);
|
||||
if (!path.empty()) {
|
||||
|
@ -547,7 +548,7 @@ private:
|
|||
|
||||
wxString mPath;
|
||||
wxString mName;
|
||||
wxString mType;
|
||||
FileNames::FileTypes mTypes;
|
||||
|
||||
wxTextCtrl *mPathText;
|
||||
|
||||
|
@ -659,7 +660,7 @@ bool FFmpegLibs::FindLibs(wxWindow *parent)
|
|||
FindFFmpegDialog fd(parent,
|
||||
path,
|
||||
name,
|
||||
GetLibraryTypeString());
|
||||
GetLibraryTypes());
|
||||
|
||||
if (fd.ShowModal() == wxID_CANCEL) {
|
||||
wxLogMessage(wxT("User canceled the dialog. Failed to find FFmpeg libraries."));
|
||||
|
|
25
src/FFmpeg.h
25
src/FFmpeg.h
|
@ -242,10 +242,14 @@ public:
|
|||
#if defined(__WXMSW__)
|
||||
/* Library names and file filters for Windows only */
|
||||
|
||||
wxString GetLibraryTypeString()
|
||||
FileNames::FileTypes GetLibraryTypes()
|
||||
{
|
||||
/* i18n-hint: do not translate avformat. Preserve the computer gibberish.*/
|
||||
return _("Only avformat.dll|*avformat*.dll|Dynamically Linked Libraries (*.dll)|*.dll|All Files|*");
|
||||
return {
|
||||
/* i18n-hint: do not translate avformat. Preserve the computer gibberish.*/
|
||||
{ XO("Only avformat.dll"), { wxT("avformat.dll") } },
|
||||
FileNames::DynamicLibraries,
|
||||
FileNames::AllFiles
|
||||
};
|
||||
}
|
||||
|
||||
wxString GetLibAVFormatPath()
|
||||
|
@ -276,9 +280,12 @@ public:
|
|||
}
|
||||
#elif defined(__WXMAC__)
|
||||
/* Library names and file filters for Mac OS only */
|
||||
wxString GetLibraryTypeString()
|
||||
FileNames::FileTypes GetLibraryTypes()
|
||||
{
|
||||
return _("Dynamic Libraries (*.dylib)|*.dylib|All Files (*)|*");
|
||||
return {
|
||||
FileNames::DynamicLibraries,
|
||||
FileNames::AllFiles
|
||||
};
|
||||
}
|
||||
|
||||
wxString GetLibAVFormatPath()
|
||||
|
@ -309,9 +316,13 @@ public:
|
|||
#else
|
||||
/* Library names and file filters for other platforms, basically Linux and
|
||||
* other *nix platforms */
|
||||
wxString GetLibraryTypeString()
|
||||
FileNames::FileTypes GetLibraryTypes()
|
||||
{
|
||||
return _("Only libavformat.so|libavformat*.so*|Dynamically Linked Libraries (*.so*)|*.so*|All Files (*)|*");
|
||||
return {
|
||||
{ XO("Only libavformat.so"), { wxT("libavformat*.so*") } },
|
||||
FileNames::DynamicLibraries,
|
||||
FileNames::AllFiles
|
||||
};
|
||||
}
|
||||
|
||||
wxString GetLibAVFormatPath()
|
||||
|
|
|
@ -558,13 +558,13 @@ void FileNames::UpdateDefaultPath(Operation op, const FilePath &path)
|
|||
|
||||
wxString
|
||||
FileNames::SelectFile(Operation op,
|
||||
const TranslatableString& message,
|
||||
const FilePath& default_path,
|
||||
const FilePath& default_filename,
|
||||
const FileExtension& default_extension,
|
||||
const wxString& wildcard,
|
||||
int flags,
|
||||
wxWindow *parent)
|
||||
const TranslatableString& message,
|
||||
const FilePath& default_path,
|
||||
const FilePath& default_filename,
|
||||
const FileExtension& default_extension,
|
||||
const FileTypes& fileTypes,
|
||||
int flags,
|
||||
wxWindow *parent)
|
||||
{
|
||||
return WithDefaultPath(op, default_path, [&](const FilePath &path) {
|
||||
wxString filter;
|
||||
|
@ -572,7 +572,8 @@ FileNames::SelectFile(Operation op,
|
|||
filter = wxT("*.") + default_extension;
|
||||
return FileSelector(
|
||||
message.Translation(), path, default_filename, filter,
|
||||
wildcard, flags, parent, wxDefaultCoord, wxDefaultCoord);
|
||||
FormatWildcard( fileTypes ),
|
||||
flags, parent, wxDefaultCoord, wxDefaultCoord);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -711,7 +712,7 @@ char *FileNames::VerifyFilename(const wxString &s, bool input)
|
|||
}
|
||||
else {
|
||||
wxFileName ff(name);
|
||||
wxString ext;
|
||||
FileExtension ext;
|
||||
while ((char *) (const char *)name.mb_str() == NULL) {
|
||||
AudacityMessageBox(
|
||||
XO(
|
||||
|
@ -719,13 +720,16 @@ char *FileNames::VerifyFilename(const wxString &s, bool input)
|
|||
|
||||
ext = ff.GetExt();
|
||||
name = FileNames::SelectFile(FileNames::Operation::_None,
|
||||
XO("Specify New Filename:"),
|
||||
wxEmptyString,
|
||||
name,
|
||||
ext,
|
||||
ext.empty() ? wxT("*") : (wxT("*.") + ext),
|
||||
wxFD_SAVE | wxRESIZE_BORDER,
|
||||
wxGetTopLevelParent(NULL));
|
||||
XO("Specify New Filename:"),
|
||||
wxEmptyString,
|
||||
name,
|
||||
ext,
|
||||
{ ext.empty()
|
||||
? FileNames::AllFiles
|
||||
: FileType{ {}, { ext } }
|
||||
},
|
||||
wxFD_SAVE | wxRESIZE_BORDER,
|
||||
wxGetTopLevelParent(NULL));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -159,13 +159,13 @@ public:
|
|||
|
||||
static wxString
|
||||
SelectFile(Operation op, // op matters only when default_path is empty
|
||||
const TranslatableString& message,
|
||||
const FilePath& default_path,
|
||||
const FilePath& default_filename,
|
||||
const FileExtension& default_extension,
|
||||
const wxString& wildcard,
|
||||
int flags,
|
||||
wxWindow *parent);
|
||||
const TranslatableString& message,
|
||||
const FilePath& default_path,
|
||||
const FilePath& default_filename,
|
||||
const FileExtension& default_extension,
|
||||
const FileTypes& fileTypes,
|
||||
int flags,
|
||||
wxWindow *parent);
|
||||
|
||||
// Useful functions for working with search paths
|
||||
static void AddUniquePathToPathList(const FilePath &path,
|
||||
|
|
|
@ -1066,13 +1066,13 @@ void FrequencyPlotDialog::OnExport(wxCommandEvent & WXUNUSED(event))
|
|||
wxString fName = _("spectrum.txt");
|
||||
|
||||
fName = FileNames::SelectFile(FileNames::Operation::Export,
|
||||
XO("Export Spectral Data As:"),
|
||||
wxEmptyString,
|
||||
fName,
|
||||
wxT("txt"),
|
||||
_("Text files (*.txt)|*.txt|All files|*"),
|
||||
wxFD_SAVE | wxRESIZE_BORDER,
|
||||
this);
|
||||
XO("Export Spectral Data As:"),
|
||||
wxEmptyString,
|
||||
fName,
|
||||
wxT("txt"),
|
||||
{ FileNames::TextFiles, FileNames::AllFiles },
|
||||
wxFD_SAVE | wxRESIZE_BORDER,
|
||||
this);
|
||||
|
||||
if (fName.empty())
|
||||
return;
|
||||
|
|
|
@ -628,13 +628,13 @@ void LabelDialog::OnImport(wxCommandEvent & WXUNUSED(event))
|
|||
// Ask user for a filename
|
||||
wxString fileName =
|
||||
FileNames::SelectFile(FileNames::Operation::Open,
|
||||
XO("Select a text file containing labels"),
|
||||
wxEmptyString, // Path
|
||||
wxT(""), // Name
|
||||
wxT("txt"), // Extension
|
||||
_("Text files (*.txt)|*.txt|All files|*"),
|
||||
wxRESIZE_BORDER, // Flags
|
||||
this); // Parent
|
||||
XO("Select a text file containing labels"),
|
||||
wxEmptyString, // Path
|
||||
wxT(""), // Name
|
||||
wxT("txt"), // Extension
|
||||
{ FileNames::TextFiles, FileNames::AllFiles },
|
||||
wxRESIZE_BORDER, // Flags
|
||||
this); // Parent
|
||||
|
||||
// They gave us one...
|
||||
if (!fileName.empty()) {
|
||||
|
@ -681,7 +681,7 @@ void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event))
|
|||
wxEmptyString,
|
||||
fName,
|
||||
wxT("txt"),
|
||||
wxT("*.txt"),
|
||||
{ FileNames::TextFiles },
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
this);
|
||||
|
||||
|
|
|
@ -849,7 +849,7 @@ For an audio file that will open in other apps, use 'Export'.\n");
|
|||
filename.GetPath(),
|
||||
filename.GetFullName(),
|
||||
wxT("aup"),
|
||||
_("Audacity projects") + wxT(" (*.aup)|*.aup"),
|
||||
{ FileNames::AudacityProjects },
|
||||
wxFD_SAVE | wxRESIZE_BORDER,
|
||||
&window);
|
||||
|
||||
|
|
28
src/Tags.cpp
28
src/Tags.cpp
|
@ -1234,13 +1234,13 @@ void TagsEditorDialog::OnLoad(wxCommandEvent & WXUNUSED(event))
|
|||
|
||||
// Ask the user for the real name
|
||||
fn = FileNames::SelectFile(FileNames::Operation::_None,
|
||||
XO("Load Metadata As:"),
|
||||
FileNames::DataDir(),
|
||||
wxT("Tags.xml"),
|
||||
wxT("xml"),
|
||||
wxT("*.xml"),
|
||||
wxFD_OPEN | wxRESIZE_BORDER,
|
||||
this);
|
||||
XO("Load Metadata As:"),
|
||||
FileNames::DataDir(),
|
||||
wxT("Tags.xml"),
|
||||
wxT("xml"),
|
||||
{ FileNames::XMLFiles },
|
||||
wxFD_OPEN | wxRESIZE_BORDER,
|
||||
this);
|
||||
|
||||
// User canceled...
|
||||
if (fn.empty()) {
|
||||
|
@ -1290,13 +1290,13 @@ void TagsEditorDialog::OnSave(wxCommandEvent & WXUNUSED(event))
|
|||
|
||||
// Ask the user for the real name
|
||||
fn = FileNames::SelectFile(FileNames::Operation::_None,
|
||||
XO("Save Metadata As:"),
|
||||
FileNames::DataDir(),
|
||||
wxT("Tags.xml"),
|
||||
wxT("xml"),
|
||||
wxT("*.xml"),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
this);
|
||||
XO("Save Metadata As:"),
|
||||
FileNames::DataDir(),
|
||||
wxT("Tags.xml"),
|
||||
wxT("xml"),
|
||||
{ FileNames::XMLFiles },
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
this);
|
||||
|
||||
// User canceled...
|
||||
if (fn.empty()) {
|
||||
|
|
|
@ -322,7 +322,7 @@ void TimerRecordDialog::OnAutoSavePathButton_Click(wxCommandEvent& WXUNUSED(even
|
|||
m_fnAutoSaveFile.GetPath(),
|
||||
m_fnAutoSaveFile.GetFullName(),
|
||||
wxT("aup"),
|
||||
_("Audacity projects") + wxT(" (*.aup)|*.aup"),
|
||||
{ FileNames::AudacityProjects },
|
||||
wxFD_SAVE | wxRESIZE_BORDER,
|
||||
this);
|
||||
|
||||
|
|
|
@ -532,13 +532,13 @@ void ContrastDialog::OnExport(wxCommandEvent & WXUNUSED(event))
|
|||
wxString fName = wxT("contrast.txt");
|
||||
|
||||
fName = FileNames::SelectFile(FileNames::Operation::Export,
|
||||
XO("Export Contrast Result As:"),
|
||||
wxEmptyString,
|
||||
fName,
|
||||
wxT("txt"),
|
||||
_("Text files (*.txt)|*.txt|All files|*"),
|
||||
wxFD_SAVE | wxRESIZE_BORDER,
|
||||
this);
|
||||
XO("Export Contrast Result As:"),
|
||||
wxEmptyString,
|
||||
fName,
|
||||
wxT("txt"),
|
||||
{ FileNames::TextFiles, FileNames::AllFiles },
|
||||
wxFD_SAVE | wxRESIZE_BORDER,
|
||||
this);
|
||||
|
||||
if (fName.empty())
|
||||
return;
|
||||
|
|
|
@ -1861,13 +1861,17 @@ void VSTEffect::ExportPresets()
|
|||
// Passing a valid parent will cause some effects dialogs to malfunction
|
||||
// upon returning from the FileNames::SelectFile().
|
||||
path = FileNames::SelectFile(FileNames::Operation::_None,
|
||||
XO("Save VST Preset As:"),
|
||||
FileNames::DataDir(),
|
||||
wxEmptyString,
|
||||
wxT("xml"),
|
||||
wxT("Standard VST bank file (*.fxb)|*.fxb|Standard VST program file (*.fxp)|*.fxp|Audacity VST preset file (*.xml)|*.xml"),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
NULL);
|
||||
XO("Save VST Preset As:"),
|
||||
FileNames::DataDir(),
|
||||
wxEmptyString,
|
||||
wxT("xml"),
|
||||
{
|
||||
{ XO("Standard VST bank file"), { wxT("fxb") }, true },
|
||||
{ XO("Standard VST program file"), { wxT("fxp") }, true },
|
||||
{ XO("Audacity VST preset file"), { wxT("xml") }, true },
|
||||
},
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
NULL);
|
||||
|
||||
// User canceled...
|
||||
if (path.empty())
|
||||
|
@ -1914,13 +1918,17 @@ void VSTEffect::ImportPresets()
|
|||
|
||||
// Ask the user for the real name
|
||||
path = FileNames::SelectFile(FileNames::Operation::_None,
|
||||
XO("Load VST Preset:"),
|
||||
FileNames::DataDir(),
|
||||
wxEmptyString,
|
||||
wxT("xml"),
|
||||
wxT("VST preset files (*.fxb; *.fxp; *.xml)|*.fxb;*.fxp;*.xml"),
|
||||
wxFD_OPEN | wxRESIZE_BORDER,
|
||||
mParent);
|
||||
XO("Load VST Preset:"),
|
||||
FileNames::DataDir(),
|
||||
wxEmptyString,
|
||||
wxT("xml"),
|
||||
{ {
|
||||
XO("VST preset files"),
|
||||
{ wxT("fxb"), wxT("fxp"), wxT("xml") },
|
||||
true
|
||||
} },
|
||||
wxFD_OPEN | wxRESIZE_BORDER,
|
||||
mParent);
|
||||
|
||||
// User canceled...
|
||||
if (path.empty())
|
||||
|
|
|
@ -175,20 +175,23 @@ bool ExportCLOptions::TransferDataFromWindow()
|
|||
void ExportCLOptions::OnBrowse(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString path;
|
||||
wxString ext;
|
||||
FileExtension ext;
|
||||
FileNames::FileType type = FileNames::AllFiles;
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
ext = wxT("exe");
|
||||
/* i18n-hint files that can be run as programs */
|
||||
type = { XO("Executables"), { ext } };
|
||||
#endif
|
||||
|
||||
path = FileNames::SelectFile(FileNames::Operation::Open,
|
||||
XO("Find path to command"),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
ext,
|
||||
ext.empty() ? wxT("*") : (wxT("*.") + ext),
|
||||
wxFD_OPEN | wxRESIZE_BORDER,
|
||||
this);
|
||||
XO("Find path to command"),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
ext,
|
||||
{ type },
|
||||
wxFD_OPEN | wxRESIZE_BORDER,
|
||||
this);
|
||||
if (path.empty()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -553,7 +553,8 @@ public:
|
|||
|
||||
#ifndef DISABLE_DYNAMIC_LOADING_LAME
|
||||
|
||||
FindDialog(wxWindow *parent, wxString path, wxString name, wxString type)
|
||||
FindDialog(wxWindow *parent, wxString path, wxString name,
|
||||
FileNames::FileTypes types)
|
||||
: wxDialogWrapper(parent, wxID_ANY,
|
||||
/* i18n-hint: LAME is the name of an MP3 converter and should not be translated*/
|
||||
XO("Locate LAME"))
|
||||
|
@ -563,7 +564,7 @@ public:
|
|||
|
||||
mPath = path;
|
||||
mName = name;
|
||||
mType = type;
|
||||
mTypes = std::move( types );
|
||||
|
||||
mLibPath.Assign(mPath, mName);
|
||||
|
||||
|
@ -626,13 +627,13 @@ public:
|
|||
auto question = XO("Where is %s?").Format( mName );
|
||||
|
||||
wxString path = FileNames::SelectFile(FileNames::Operation::_None,
|
||||
question,
|
||||
mLibPath.GetPath(),
|
||||
mLibPath.GetName(),
|
||||
wxT(""),
|
||||
mType,
|
||||
wxFD_OPEN | wxRESIZE_BORDER,
|
||||
this);
|
||||
question,
|
||||
mLibPath.GetPath(),
|
||||
mLibPath.GetName(),
|
||||
wxT(""),
|
||||
mTypes,
|
||||
wxFD_OPEN | wxRESIZE_BORDER,
|
||||
this);
|
||||
if (!path.empty()) {
|
||||
mLibPath = path;
|
||||
mPathText->SetValue(path);
|
||||
|
@ -658,7 +659,7 @@ private:
|
|||
|
||||
wxString mPath;
|
||||
wxString mName;
|
||||
wxString mType;
|
||||
FileNames::FileTypes mTypes;
|
||||
#endif // DISABLE_DYNAMIC_LOADING_LAME
|
||||
|
||||
wxTextCtrl *mPathText;
|
||||
|
@ -800,7 +801,7 @@ public:
|
|||
wxString GetLibraryVersion();
|
||||
wxString GetLibraryName();
|
||||
wxString GetLibraryPath();
|
||||
wxString GetLibraryTypeString();
|
||||
FileNames::FileTypes GetLibraryTypes();
|
||||
|
||||
/* returns the number of samples PER CHANNEL to send for each call to EncodeBuffer */
|
||||
int InitializeStream(unsigned channels, int sampleRate);
|
||||
|
@ -942,9 +943,9 @@ bool MP3Exporter::FindLibrary(wxWindow *parent)
|
|||
}
|
||||
|
||||
FindDialog fd(parent,
|
||||
path,
|
||||
name,
|
||||
GetLibraryTypeString());
|
||||
path,
|
||||
name,
|
||||
GetLibraryTypes());
|
||||
|
||||
if (fd.ShowModal() == wxID_CANCEL) {
|
||||
return false;
|
||||
|
@ -1493,9 +1494,13 @@ wxString MP3Exporter::GetLibraryName()
|
|||
return wxT("lame_enc.dll");
|
||||
}
|
||||
|
||||
wxString MP3Exporter::GetLibraryTypeString()
|
||||
FileNames::FileTypes MP3Exporter::GetLibraryTypes()
|
||||
{
|
||||
return _("Only lame_enc.dll|lame_enc.dll|Dynamically Linked Libraries (*.dll)|*.dll|All Files|*");
|
||||
return {
|
||||
{ XO("Only lame_enc.dll"), { wxT("lame_enc.dll") } },
|
||||
FileNames::DynamicLibraries,
|
||||
FileNames::AllFiles
|
||||
};
|
||||
}
|
||||
|
||||
#elif defined(__WXMAC__)
|
||||
|
@ -1527,11 +1532,20 @@ wxString MP3Exporter::GetLibraryName()
|
|||
return wxT("libmp3lame.dylib");
|
||||
}
|
||||
|
||||
wxString MP3Exporter::GetLibraryTypeString()
|
||||
FileNames::FileTypes MP3Exporter::GetLibraryTypes()
|
||||
{
|
||||
if (sizeof(void*) == 8)
|
||||
return wxString(_("Only libmp3lame64bit.dylib|libmp3lame64bit.dylib|Dynamic Libraries (*.dylib)|*.dylib|All Files (*)|*"));
|
||||
return wxString(_("Only libmp3lame.dylib|libmp3lame.dylib|Dynamic Libraries (*.dylib)|*.dylib|All Files (*)|*"));
|
||||
return {
|
||||
(sizeof(void*) == 8)
|
||||
? FileNames::FileType{
|
||||
XO("Only libmp3lame64bit.dylib"), { wxT("libmp3lame64bit.dylib") }
|
||||
}
|
||||
: FileNames::FileType{
|
||||
XO("Only libmp3lame.dylib"), { wxT("libmp3lame.dylib") }
|
||||
}
|
||||
,
|
||||
FileNames::DynamicLibraries,
|
||||
FileNames::AllFiles
|
||||
};
|
||||
}
|
||||
|
||||
#else //!__WXMAC__
|
||||
|
@ -1547,9 +1561,14 @@ wxString MP3Exporter::GetLibraryName()
|
|||
return wxT("libmp3lame.so.0");
|
||||
}
|
||||
|
||||
wxString MP3Exporter::GetLibraryTypeString()
|
||||
FileNames::FileTypes MP3Exporter::GetLibraryTypes()
|
||||
{
|
||||
return wxString(_("Only libmp3lame.so.0|libmp3lame.so.0|Primary Shared Object files (*.so)|*.so|Extended Libraries (*.so*)|*.so*|All Files (*)|*"));
|
||||
return {
|
||||
{ XO("Only libmp3lame.so.0"), { wxT("libmp3lame.so.0") } },
|
||||
{ XO("Primary shared object files"), { wxT("so") }, true },
|
||||
{ XO("Extended libraries"), { wxT("so*") }, true },
|
||||
FileNames::AllFiles
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -228,13 +228,13 @@ void OnExportLabels(const CommandContext &context)
|
|||
fName = (*trackRange.rbegin())->GetName();
|
||||
|
||||
fName = FileNames::SelectFile(FileNames::Operation::Export,
|
||||
XO("Export Labels As:"),
|
||||
wxEmptyString,
|
||||
fName,
|
||||
wxT("txt"),
|
||||
wxT("*.txt"),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
&window);
|
||||
XO("Export Labels As:"),
|
||||
wxEmptyString,
|
||||
fName,
|
||||
wxT("txt"),
|
||||
{ FileNames::TextFiles },
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
&window);
|
||||
|
||||
if (fName.empty())
|
||||
return;
|
||||
|
@ -318,7 +318,10 @@ void OnExportMIDI(const CommandContext &context)
|
|||
wxEmptyString,
|
||||
fName,
|
||||
wxT("mid"),
|
||||
_("MIDI file (*.mid)|*.mid|Allegro file (*.gro)|*.gro"),
|
||||
{
|
||||
{ XO("MIDI file"), { wxT("mid") }, true },
|
||||
{ XO("Allegro file"), { wxT("gro") }, true },
|
||||
},
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
&window);
|
||||
|
||||
|
@ -415,13 +418,13 @@ void OnImportLabels(const CommandContext &context)
|
|||
|
||||
wxString fileName =
|
||||
FileNames::SelectFile(FileNames::Operation::Open,
|
||||
XO("Select a text file containing labels"),
|
||||
wxEmptyString, // Path
|
||||
wxT(""), // Name
|
||||
wxT("txt"), // Extension
|
||||
_("Text files (*.txt)|*.txt|All files|*"),
|
||||
wxRESIZE_BORDER, // Flags
|
||||
&window); // Parent
|
||||
XO("Select a text file containing labels"),
|
||||
wxEmptyString, // Path
|
||||
wxT(""), // Name
|
||||
wxT("txt"), // Extension
|
||||
{ FileNames::TextFiles, FileNames::AllFiles },
|
||||
wxRESIZE_BORDER, // Flags
|
||||
&window); // Parent
|
||||
|
||||
if (!fileName.empty()) {
|
||||
wxTextFile f;
|
||||
|
@ -463,7 +466,15 @@ void OnImportMIDI(const CommandContext &context)
|
|||
wxEmptyString, // Path
|
||||
wxT(""), // Name
|
||||
wxT(""), // Extension
|
||||
_("MIDI and Allegro files (*.mid;*.midi;*.gro)|*.mid;*.midi;*.gro|MIDI files (*.mid;*.midi)|*.mid;*.midi|Allegro files (*.gro)|*.gro|All files|*"),
|
||||
{
|
||||
{ XO("MIDI and Allegro files"),
|
||||
{ wxT("mid"), wxT("midi"), wxT("gro"), }, true },
|
||||
{ XO("MIDI files"),
|
||||
{ wxT("mid"), wxT("midi"), }, true },
|
||||
{ XO("Allegro files"),
|
||||
{ wxT("gro"), }, true },
|
||||
FileNames::AllFiles
|
||||
},
|
||||
wxRESIZE_BORDER, // Flags
|
||||
&window); // Parent
|
||||
|
||||
|
@ -480,13 +491,13 @@ void OnImportRaw(const CommandContext &context)
|
|||
|
||||
wxString fileName =
|
||||
FileNames::SelectFile(FileNames::Operation::Open,
|
||||
XO("Select any uncompressed audio file"),
|
||||
wxEmptyString, // Path
|
||||
wxT(""), // Name
|
||||
wxT(""), // Extension
|
||||
_("All files|*"),
|
||||
wxRESIZE_BORDER, // Flags
|
||||
&window); // Parent
|
||||
XO("Select any uncompressed audio file"),
|
||||
wxEmptyString, // Path
|
||||
wxT(""), // Name
|
||||
wxT(""), // Extension
|
||||
{ FileNames::AllFiles },
|
||||
wxRESIZE_BORDER, // Flags
|
||||
&window); // Parent
|
||||
|
||||
if (fileName.empty())
|
||||
return;
|
||||
|
|
|
@ -63,7 +63,7 @@ void ShowDiagnostics(
|
|||
wxEmptyString,
|
||||
defaultPath,
|
||||
wxT("txt"),
|
||||
wxT("*.txt"),
|
||||
{ FileNames::TextFiles },
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
&window);
|
||||
if (!fName.empty())
|
||||
|
|
|
@ -344,13 +344,13 @@ void KeyConfigPrefs::OnImport(wxCommandEvent & WXUNUSED(event))
|
|||
wxString file = wxT("Audacity-keys.xml");
|
||||
|
||||
file = FileNames::SelectFile(FileNames::Operation::Open,
|
||||
XO("Select an XML file containing Audacity keyboard shortcuts..."),
|
||||
wxEmptyString,
|
||||
file,
|
||||
wxT(""),
|
||||
_("XML files (*.xml)|*.xml|All files|*"),
|
||||
wxRESIZE_BORDER,
|
||||
this);
|
||||
XO("Select an XML file containing Audacity keyboard shortcuts..."),
|
||||
wxEmptyString,
|
||||
file,
|
||||
wxT(""),
|
||||
{ FileNames::XMLFiles, FileNames::AllFiles },
|
||||
wxRESIZE_BORDER,
|
||||
this);
|
||||
|
||||
if (!file) {
|
||||
return;
|
||||
|
@ -373,13 +373,13 @@ void KeyConfigPrefs::OnExport(wxCommandEvent & WXUNUSED(event))
|
|||
wxString file = wxT("Audacity-keys.xml");
|
||||
|
||||
file = FileNames::SelectFile(FileNames::Operation::Export,
|
||||
XO("Export Keyboard Shortcuts As:"),
|
||||
wxEmptyString,
|
||||
file,
|
||||
wxT("xml"),
|
||||
_("XML files (*.xml)|*.xml|All files|*"),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
this);
|
||||
XO("Export Keyboard Shortcuts As:"),
|
||||
wxEmptyString,
|
||||
file,
|
||||
wxT("xml"),
|
||||
{ FileNames::XMLFiles, FileNames::AllFiles },
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||
this);
|
||||
|
||||
if (!file) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue