mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 15:49:41 +02:00
More work on i18n (22 less _ calls), bug fix, less use of wx headers
This commit is contained in:
commit
3501a27aaf
@ -20,7 +20,8 @@ $copyright (_ "Released under terms of the GNU General Public License version 2"
|
||||
$control fxname (_ "Select target EQ effect") choice (("Graphic" (_ "Graphic EQ"))
|
||||
("FilterCurve" (_ "Filter Curve EQ"))) 0
|
||||
|
||||
$control infile (_ "Equalization XML file") file "" "*default*/EQCurves.xml" "XML file|*.xml;*.XML|All files|*.*;*" "open,exists"
|
||||
$control infile (_ "Equalization XML file") file "" "*default*/EQCurves.xml" (((_ "XML file") (xml XML))
|
||||
((_ "All files") (""))) "open,exists"
|
||||
|
||||
$control overwrite (_ "If output text file exists") choice (("Append" (_ "Append number"))
|
||||
("Overwrite" (_ "Overwrite"))
|
||||
|
@ -17,7 +17,12 @@ $copyright (_ "Released under terms of the GNU General Public License version 2"
|
||||
|
||||
|
||||
;i18n-hint: "Browse..." is text on a button that launches a file browser.
|
||||
$control files (_ "Select file(s) to install") file (_ "Browse...") "~/Desktop/" "Plug-in|*.ny;*.NY|Lisp file|*.lsp;*.LSP|HTML file|*.htm;*.HTM;*.html;*.HTML|Text file|*.txt;*.TXT|All supported|*.ny;*.NY;*.lsp;*.LSP;*.htm;*.HTM;*.html;*.HTML;*.txt;*.TXT|All files|*.*;*" "open,exists,multiple"
|
||||
$control files (_ "Select file(s) to install") file (_ "Browse...") "~/Desktop/" (((_ "Plug-in") (ny NY))
|
||||
((_ "Lisp file") (lsp LSP))
|
||||
((_ "HTML file") (htm HTM html HTML))
|
||||
((_ "Text file") (txt TXT))
|
||||
((_ "All supported") (ny NY lsp LSP htm HTM html HTML txt TXT))
|
||||
((_ "All files") (""))) "open,exists,multiple"
|
||||
$control overwrite (_ "Allow overwriting") choice ((_ "Disallow") (_ "Allow")) 0
|
||||
|
||||
|
||||
|
@ -12,7 +12,10 @@ $copyright (_ "Released under terms of the GNU General Public License version 2"
|
||||
|
||||
$control number (_ "Limit output to first") int-text (_ "samples") 100 1 1000000
|
||||
$control units (_ "Measurement scale") choice ((_ "dB") (_ "Linear")) 0
|
||||
$control filename (_ "Export data to") file (_ "Select a file") "*default*/sample-data.txt" "Text file|*.txt;*.TXT|CSV files|*.csv;*.CSV|HTML files|*.html;*.HTML;*.htm;*.HTM|All files|*.*;*" "save,overwrite"
|
||||
$control filename (_ "Export data to") file (_ "Select a file") "*default*/sample-data.txt" (((_ "Text file") (txt TXT))
|
||||
((_ "CSV files") (csv CSV))
|
||||
((_ "HTML files") (html HTML htm HTM))
|
||||
((_ "All files") (""))) "save,overwrite"
|
||||
$control fileformat (_ "Index (text files only)") choice ((_ "None")
|
||||
("Count" (_ "Sample Count"))
|
||||
("Time" (_ "Time Indexed")))
|
||||
|
@ -8,7 +8,8 @@ $author (_ "Steve Daulton")
|
||||
$release 2.3.0
|
||||
$copyright (_ "Released under terms of the GNU General Public License version 2")
|
||||
|
||||
$control filename (_ "Select file") file "" "*default*/sample-data.txt" "Text file|*.txt;*.TXT|All files|*.*;*" "open,exists"
|
||||
$control filename (_ "Select file") file "" "*default*/sample-data.txt" (((_ "Text file") (txt TXT))
|
||||
((_ "All files") (""))) "open,exists"
|
||||
$control bad-data (_ "Invalid data handling") choice (("ThrowError" (_ "Throw Error"))
|
||||
("ReadAsZero" (_ "Read as Zero"))) 0
|
||||
|
||||
|
@ -31,12 +31,10 @@
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/filefn.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/ffile.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/textfile.h>
|
||||
#include <wx/thread.h>
|
||||
#include <wx/tooltip.h>
|
||||
|
@ -21,7 +21,6 @@ processing. See also MacrosWindow and ApplyMacroDialog.
|
||||
|
||||
#include <wx/defs.h>
|
||||
#include <wx/dir.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/textfile.h>
|
||||
|
||||
#include "Project.h"
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <wx/defs.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statbox.h>
|
||||
|
@ -25,7 +25,6 @@ of the BlockFile system.
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/timer.h>
|
||||
|
@ -43,7 +43,6 @@ AliasedFile s.
|
||||
#include <wx/filename.h>
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/menu.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/dataobj.h>
|
||||
|
@ -72,7 +72,6 @@
|
||||
#include <wx/log.h>
|
||||
#include <wx/filefn.h>
|
||||
#include <wx/hash.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/timer.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/file.h>
|
||||
|
@ -27,7 +27,6 @@ License: GPL v2. See License.txt.
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/dynlib.h>
|
||||
#include <wx/file.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/textctrl.h>
|
||||
|
||||
|
@ -48,7 +48,6 @@ the mouse around.
|
||||
#include <wx/font.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/file.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/scrolbar.h>
|
||||
#include <wx/sizer.h>
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <wx/choice.h>
|
||||
#include <wx/dc.h>
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/grid.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/scrolbar.h>
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include <math.h>
|
||||
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/timer.h>
|
||||
#include <wx/intl.h>
|
||||
|
||||
|
@ -55,7 +55,6 @@
|
||||
|
||||
#include <wx/button.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/listctrl.h>
|
||||
|
@ -34,9 +34,7 @@
|
||||
#include <wx/dir.h>
|
||||
#include <wx/datectrl.h>
|
||||
#include <wx/datetime.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/timer.h>
|
||||
|
@ -25,7 +25,6 @@ or "OFF" point
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/textfile.h>
|
||||
#include <wx/intl.h>
|
||||
#include <iostream>
|
||||
|
@ -35,7 +35,6 @@
|
||||
#endif
|
||||
|
||||
#include <wx/button.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/valtext.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/wfstream.h>
|
||||
|
@ -663,6 +663,15 @@ bool Effect::CanExportPresets()
|
||||
return true;
|
||||
}
|
||||
|
||||
static const FileNames::FileTypes &PresetTypes()
|
||||
{
|
||||
static const FileNames::FileTypes result {
|
||||
{ XO("Presets"), { wxT("txt") }, true },
|
||||
FileNames::AllFiles
|
||||
};
|
||||
return result;
|
||||
};
|
||||
|
||||
void Effect::ExportPresets()
|
||||
{
|
||||
wxString params;
|
||||
@ -672,11 +681,11 @@ void Effect::ExportPresets()
|
||||
|
||||
auto path = FileNames::DefaultToDocumentsFolder(wxT("Presets/Path"));
|
||||
|
||||
wxFileDialog dlog(NULL,
|
||||
_("Export Effect Parameters"),
|
||||
FileDialogWrapper dlog(nullptr,
|
||||
XO("Export Effect Parameters"),
|
||||
path.GetFullPath(),
|
||||
wxEmptyString,
|
||||
_("Presets (*.txt)|*.txt|All files|*"),
|
||||
PresetTypes(),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER);
|
||||
|
||||
if (dlog.ShowModal() != wxID_OK) {
|
||||
@ -721,11 +730,11 @@ void Effect::ImportPresets()
|
||||
|
||||
auto path = FileNames::DefaultToDocumentsFolder(wxT("Presets/Path"));
|
||||
|
||||
wxFileDialog dlog(NULL,
|
||||
_("Import Effect Parameters"),
|
||||
FileDialogWrapper dlog(nullptr,
|
||||
XO("Import Effect Parameters"),
|
||||
path.GetPath(),
|
||||
wxEmptyString,
|
||||
_("Presets (*.txt)|*.txt|All files|*"),
|
||||
PresetTypes(),
|
||||
wxFD_OPEN | wxRESIZE_BORDER);
|
||||
|
||||
if (dlog.ShowModal() != wxID_OK) {
|
||||
|
@ -3721,16 +3721,20 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
|
||||
#endif
|
||||
}
|
||||
|
||||
static const auto XMLtypes = FileNames::FileTypes{
|
||||
FileNames::XMLFiles
|
||||
};
|
||||
static const FileNames::FileTypes &XMLtypes()
|
||||
{
|
||||
static const FileNames::FileTypes results{
|
||||
FileNames::XMLFiles
|
||||
};
|
||||
return results;
|
||||
}
|
||||
|
||||
void EditCurvesDialog::OnImport( wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
FileDialogWrapper filePicker(
|
||||
this,
|
||||
XO("Choose an EQ curve file"), FileNames::DataDir(), wxT(""),
|
||||
XMLtypes );
|
||||
XMLtypes() );
|
||||
wxString fileName;
|
||||
if( filePicker.ShowModal() == wxID_CANCEL)
|
||||
return;
|
||||
@ -3752,7 +3756,7 @@ void EditCurvesDialog::OnExport( wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
FileDialogWrapper filePicker(this, XO("Export EQ curves as..."),
|
||||
FileNames::DataDir(), wxT(""),
|
||||
XMLtypes,
|
||||
XMLtypes(),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER); // wxFD_CHANGE_DIR?
|
||||
wxString fileName;
|
||||
if( filePicker.ShowModal() == wxID_CANCEL)
|
||||
|
@ -37,7 +37,6 @@ It \TODO: description
|
||||
#include <wx/image.h>
|
||||
#include <wx/dcmemory.h>
|
||||
#include <wx/file.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/stattext.h>
|
||||
|
@ -11,10 +11,12 @@
|
||||
#ifndef AUDACITY_VSTCONTROLGTK_H
|
||||
#define AUDACITY_VSTCONTROLGTK_H
|
||||
|
||||
|
||||
// Must include after ours since we have a lot of name collisions
|
||||
#define Region XRegion // Conflicts with Audacity's Region structure
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#undef Success
|
||||
#undef Region
|
||||
|
||||
#include "VSTControl.h"
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include "../../Audacity.h" // for USE_* macros
|
||||
#include "VSTEffect.h"
|
||||
|
||||
#include "../../widgets/ProgressDialog.h"
|
||||
|
||||
#if 0
|
||||
#if defined(BUILDING_AUDACITY)
|
||||
#include "../../PlatformCompatibility.h"
|
||||
@ -58,7 +60,6 @@
|
||||
#include <wx/log.h>
|
||||
#include <wx/module.h>
|
||||
#include <wx/process.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/recguard.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/slider.h>
|
||||
@ -517,7 +518,7 @@ unsigned VSTEffectsModule::DiscoverPluginsAtPath(
|
||||
wxString effectIDs = wxT("0;");
|
||||
wxStringTokenizer effectTzr(effectIDs, wxT(";"));
|
||||
|
||||
Optional<wxProgressDialog> progress{};
|
||||
Optional<ProgressDialog> progress{};
|
||||
size_t idCnt = 0;
|
||||
size_t idNdx = 0;
|
||||
|
||||
@ -577,17 +578,18 @@ unsigned VSTEffectsModule::DiscoverPluginsAtPath(
|
||||
idCnt = effectTzr.CountTokens();
|
||||
if (idCnt > 3)
|
||||
{
|
||||
progress.emplace( _("Scanning Shell VST"),
|
||||
wxString::Format(_("Registering %d of %d: %-64.64s"), 0, idCnt,
|
||||
proc.GetSymbol().Translation()),
|
||||
static_cast<int>(idCnt),
|
||||
nullptr,
|
||||
wxPD_APP_MODAL |
|
||||
progress.emplace( XO("Scanning Shell VST"),
|
||||
XO("Registering %d of %d: %-64.64s")
|
||||
.Format( 0, idCnt, proc.GetSymbol().Translation())
|
||||
/*
|
||||
, wxPD_APP_MODAL |
|
||||
wxPD_AUTO_HIDE |
|
||||
wxPD_CAN_ABORT |
|
||||
wxPD_ELAPSED_TIME |
|
||||
wxPD_ESTIMATED_TIME |
|
||||
wxPD_REMAINING_TIME );
|
||||
wxPD_REMAINING_TIME
|
||||
*/
|
||||
);
|
||||
progress->Show();
|
||||
}
|
||||
break;
|
||||
@ -652,9 +654,10 @@ unsigned VSTEffectsModule::DiscoverPluginsAtPath(
|
||||
if (progress)
|
||||
{
|
||||
idNdx++;
|
||||
cont = progress->Update(idNdx,
|
||||
wxString::Format(_("Registering %d of %d: %-64.64s"), idNdx, idCnt,
|
||||
proc.GetSymbol().Translation() ));
|
||||
auto result = progress->Update((int)idNdx, (int)idCnt,
|
||||
XO("Registering %d of %d: %-64.64s")
|
||||
.Format( idNdx, idCnt, proc.GetSymbol().Translation() ));
|
||||
cont = (result == ProgressResult::Success);
|
||||
}
|
||||
|
||||
if (!skip && cont)
|
||||
|
@ -1657,6 +1657,48 @@ std::vector<EnumValueSymbol> NyquistEffect::ParseChoice(const wxString & text)
|
||||
return results;
|
||||
}
|
||||
|
||||
FileExtensions NyquistEffect::ParseFileExtensions(const wxString & text)
|
||||
{
|
||||
// todo: error handling
|
||||
FileExtensions results;
|
||||
if (text[0] == wxT('(')) {
|
||||
Tokenizer tzer;
|
||||
tzer.Tokenize(text, true, 1, 1);
|
||||
for (const auto &token : tzer.tokens)
|
||||
results.push_back( UnQuote( token ) );
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
FileNames::FileType NyquistEffect::ParseFileType(const wxString & text)
|
||||
{
|
||||
// todo: error handling
|
||||
FileNames::FileType result;
|
||||
if (text[0] == wxT('(')) {
|
||||
Tokenizer tzer;
|
||||
tzer.Tokenize(text, true, 1, 1);
|
||||
auto &tokens = tzer.tokens;
|
||||
if ( tokens.size() == 2 )
|
||||
result =
|
||||
{ UnQuoteMsgid( tokens[0] ), ParseFileExtensions( tokens[1] ) };
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
FileNames::FileTypes NyquistEffect::ParseFileTypes(const wxString & text)
|
||||
{
|
||||
// todo: error handling
|
||||
FileNames::FileTypes results;
|
||||
if (text[0] == wxT('(')) {
|
||||
Tokenizer tzer;
|
||||
tzer.Tokenize(text, true, 1, 1);
|
||||
auto &types = tzer.tokens;
|
||||
for (auto &type : types)
|
||||
results.push_back( ParseFileType( type ) );
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
void NyquistEffect::RedirectOutput()
|
||||
{
|
||||
mRedirectOutput = true;
|
||||
@ -1686,7 +1728,7 @@ void NyquistEffect::Stop()
|
||||
mStop = true;
|
||||
}
|
||||
|
||||
wxString NyquistEffect::UnQuote(const wxString &s, bool allowParens,
|
||||
TranslatableString NyquistEffect::UnQuoteMsgid(const wxString &s, bool allowParens,
|
||||
wxString *pExtraString)
|
||||
{
|
||||
if (pExtraString)
|
||||
@ -1695,7 +1737,8 @@ wxString NyquistEffect::UnQuote(const wxString &s, bool allowParens,
|
||||
int len = s.length();
|
||||
if (len >= 2 && s[0] == wxT('\"') && s[len - 1] == wxT('\"')) {
|
||||
auto unquoted = s.Mid(1, len - 2);
|
||||
return wxGetTranslation( unquoted );
|
||||
// Sorry, no context strings, yet
|
||||
return TranslatableString{ unquoted, {} };
|
||||
}
|
||||
else if (allowParens &&
|
||||
len >= 2 && s[0] == wxT('(') && s[len - 1] == wxT(')')) {
|
||||
@ -1708,12 +1751,13 @@ wxString NyquistEffect::UnQuote(const wxString &s, bool allowParens,
|
||||
// ("InternalString" (_ "Visible string"))
|
||||
// Recur to find the two strings
|
||||
*pExtraString = UnQuote(tokens[0], false);
|
||||
return UnQuote(tokens[1]);
|
||||
return UnQuoteMsgid(tokens[1]);
|
||||
}
|
||||
else {
|
||||
// Assume the first token was _ -- we don't check that
|
||||
// And the second is the string, which is internationalized
|
||||
return UnQuote( tokens[1], false );
|
||||
// Sorry, no context strings, yet
|
||||
return UnQuoteMsgid( tokens[1], false );
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1721,7 +1765,13 @@ wxString NyquistEffect::UnQuote(const wxString &s, bool allowParens,
|
||||
}
|
||||
else
|
||||
// If string was not quoted, assume no translation exists
|
||||
return s;
|
||||
return Verbatim( s );
|
||||
}
|
||||
|
||||
wxString NyquistEffect::UnQuote(const wxString &s, bool allowParens,
|
||||
wxString *pExtraString)
|
||||
{
|
||||
return UnQuoteMsgid( s, allowParens, pExtraString ).Translation();
|
||||
}
|
||||
|
||||
double NyquistEffect::GetCtrlValue(const wxString &s)
|
||||
@ -2088,6 +2138,13 @@ bool NyquistEffect::Parse(
|
||||
ctrl.choices = ParseChoice(ctrl.label);
|
||||
ctrl.label = wxT("");
|
||||
}
|
||||
else if (tokens[3] == wxT("file")) {
|
||||
ctrl.type = NYQ_CTRL_FILE;
|
||||
ctrl.fileTypes = ParseFileTypes(tokens[6]);
|
||||
// will determine file dialog styles:
|
||||
ctrl.highStr = UnQuote( tokens[7] );
|
||||
ctrl.label = wxT("");
|
||||
}
|
||||
else {
|
||||
ctrl.label = UnQuote( ctrl.label );
|
||||
|
||||
@ -2106,8 +2163,6 @@ bool NyquistEffect::Parse(
|
||||
ctrl.type = NYQ_CTRL_INT_TEXT;
|
||||
else if (tokens[3] == wxT("time"))
|
||||
ctrl.type = NYQ_CTRL_TIME;
|
||||
else if (tokens[3] == wxT("file"))
|
||||
ctrl.type = NYQ_CTRL_FILE;
|
||||
else
|
||||
{
|
||||
wxString str;
|
||||
@ -2767,18 +2822,11 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S)
|
||||
S.AddSpace(10, 10);
|
||||
|
||||
// Get default file extension if specified in wildcards
|
||||
wxString defaultExtension;
|
||||
size_t len = ctrl.lowStr.length();
|
||||
int characters = ctrl.lowStr.Find("*");
|
||||
|
||||
if (characters != wxNOT_FOUND)
|
||||
{
|
||||
if (static_cast<int>(ctrl.lowStr.find("|", characters)) != wxNOT_FOUND)
|
||||
len = ctrl.lowStr.find("|", characters) - 1;
|
||||
if (static_cast<int>(ctrl.lowStr.find(";", characters)) != wxNOT_FOUND)
|
||||
len = std::min(static_cast<int>(len), static_cast<int>(ctrl.lowStr.find(";", characters)) - 1);
|
||||
|
||||
defaultExtension = ctrl.lowStr.wxString::Mid(characters + 1, len - characters);
|
||||
FileExtension defaultExtension;
|
||||
if (!ctrl.fileTypes.empty()) {
|
||||
const auto &type = ctrl.fileTypes[0];
|
||||
if ( !type.extensions.empty() )
|
||||
defaultExtension = type.extensions[0];
|
||||
}
|
||||
resolveFilePath(ctrl.valStr, defaultExtension);
|
||||
|
||||
@ -3014,36 +3062,6 @@ void NyquistEffect::OnFileButton(wxCommandEvent& evt)
|
||||
{
|
||||
int i = evt.GetId() - ID_FILE;
|
||||
NyqControl & ctrl = mControls[i];
|
||||
ctrl.lowStr.Trim(true).Trim(false); // Wildcard filter.
|
||||
|
||||
// Basic sanity check of wildcard flags so that we
|
||||
// don't show scary wxFAIL_MSG from wxParseCommonDialogsFilter.
|
||||
if (!ctrl.lowStr.empty())
|
||||
{
|
||||
bool validWildcards = true;
|
||||
size_t wildcards = 0;
|
||||
wxStringTokenizer tokenizer(ctrl.lowStr, "|");
|
||||
while (tokenizer.HasMoreTokens())
|
||||
{
|
||||
wxString token = tokenizer.GetNextToken().Trim(true).Trim(false);
|
||||
if (token.empty())
|
||||
{
|
||||
validWildcards = false;
|
||||
break;
|
||||
}
|
||||
wildcards += 1;
|
||||
}
|
||||
// Users should not normally see this, unless they are writing Nyquist plug-ins.
|
||||
if (wildcards % 2 != 0 || !validWildcards || ctrl.lowStr.EndsWith("|"))
|
||||
{
|
||||
Effect::MessageBox(
|
||||
XO("Invalid wildcard string in 'path' control.'\n"
|
||||
"Using empty string instead."),
|
||||
wxOK | wxICON_EXCLAMATION | wxCENTRE,
|
||||
XO("Error") );
|
||||
ctrl.lowStr = "";
|
||||
}
|
||||
}
|
||||
|
||||
// Get style flags:
|
||||
// Ensure legal combinations so that wxWidgets does not throw an assert error.
|
||||
@ -3087,18 +3105,18 @@ void NyquistEffect::OnFileButton(wxCommandEvent& evt)
|
||||
wxFileName fname = ctrl.valStr;
|
||||
wxString defaultDir = fname.GetPath();
|
||||
wxString defaultFile = fname.GetName();
|
||||
wxString message = _("Select a file");
|
||||
auto message = XO("Select a file");
|
||||
|
||||
if (flags & wxFD_MULTIPLE)
|
||||
message = _("Select one or more files");
|
||||
message = XO("Select one or more files");
|
||||
else if (flags & wxFD_SAVE)
|
||||
message = _("Save file as");
|
||||
message = XO("Save file as");
|
||||
|
||||
wxFileDialog openFileDialog(mUIParent->FindWindow(ID_FILE + i),
|
||||
FileDialogWrapper openFileDialog(mUIParent->FindWindow(ID_FILE + i),
|
||||
message,
|
||||
defaultDir,
|
||||
defaultFile,
|
||||
ctrl.lowStr, // wildcard filter
|
||||
ctrl.fileTypes,
|
||||
flags); // styles
|
||||
|
||||
if (openFileDialog.ShowModal() == wxID_CANCEL)
|
||||
@ -3128,7 +3146,7 @@ void NyquistEffect::OnFileButton(wxCommandEvent& evt)
|
||||
mUIParent->FindWindow(ID_Text + i)->GetValidator()->TransferToWindow();
|
||||
}
|
||||
|
||||
void NyquistEffect::resolveFilePath(wxString& path, wxString extension /* empty string */)
|
||||
void NyquistEffect::resolveFilePath(wxString& path, FileExtension extension /* empty string */)
|
||||
{
|
||||
#if defined(__WXMSW__)
|
||||
path.Replace("/", wxFileName::GetPathSeparator());
|
||||
@ -3181,7 +3199,7 @@ void NyquistEffect::resolveFilePath(wxString& path, wxString extension /* empty
|
||||
{
|
||||
path = fname.GetPathWithSep() + _("untitled");
|
||||
if (!extension.empty())
|
||||
path = path + extension;
|
||||
path = path + '.' + extension;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define __AUDACITY_EFFECT_NYQUIST__
|
||||
|
||||
#include "../Effect.h"
|
||||
#include "../../FileNames.h"
|
||||
|
||||
#include "nyx.h"
|
||||
|
||||
@ -49,6 +50,7 @@ public:
|
||||
wxString name;
|
||||
wxString label;
|
||||
std::vector<EnumValueSymbol> choices;
|
||||
FileNames::FileTypes fileTypes;
|
||||
wxString valStr;
|
||||
wxString lowStr;
|
||||
wxString highStr;
|
||||
@ -137,6 +139,10 @@ private:
|
||||
wxString EscapeString(const wxString & inStr);
|
||||
static std::vector<EnumValueSymbol> ParseChoice(const wxString & text);
|
||||
|
||||
FileExtensions ParseFileExtensions(const wxString & text);
|
||||
FileNames::FileType ParseFileType(const wxString & text);
|
||||
FileNames::FileTypes ParseFileTypes(const wxString & text);
|
||||
|
||||
static int StaticGetCallback(float *buffer, int channel,
|
||||
long start, long len, long totlen,
|
||||
void *userdata);
|
||||
@ -161,7 +167,7 @@ private:
|
||||
bool q { false };
|
||||
int paren{ 0 };
|
||||
wxString tok;
|
||||
wxArrayString tokens;
|
||||
wxArrayStringEx tokens;
|
||||
|
||||
bool Tokenize(
|
||||
const wxString &line, bool eof,
|
||||
@ -169,6 +175,8 @@ private:
|
||||
};
|
||||
bool Parse(Tokenizer &tokenizer, const wxString &line, bool eof, bool first);
|
||||
|
||||
static TranslatableString UnQuoteMsgid(const wxString &s, bool allowParens = true,
|
||||
wxString *pExtraString = nullptr);
|
||||
static wxString UnQuote(const wxString &s, bool allowParens = true,
|
||||
wxString *pExtraString = nullptr);
|
||||
double GetCtrlValue(const wxString &s);
|
||||
@ -183,7 +191,7 @@ private:
|
||||
void OnTime(wxCommandEvent & evt);
|
||||
void OnFileButton(wxCommandEvent & evt);
|
||||
|
||||
void resolveFilePath(wxString & path, wxString extension = {});
|
||||
void resolveFilePath(wxString & path, FileExtension extension = {});
|
||||
bool validatePath(wxString path);
|
||||
wxString ToTimeFormat(double t);
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include <wx/file.h>
|
||||
#include <wx/filectrl.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/simplebook.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/slider.h>
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include <wx/button.h>
|
||||
#include <wx/cmdline.h>
|
||||
#include <wx/combobox.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/process.h>
|
||||
#include <wx/sizer.h>
|
||||
|
@ -26,7 +26,6 @@ function.
|
||||
#include <wx/choice.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/timer.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/listbox.h>
|
||||
|
@ -50,7 +50,6 @@
|
||||
#include <wx/choice.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/timer.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/listbox.h>
|
||||
@ -2278,8 +2277,11 @@ void ExportFFmpegOptions::OnLoadPreset(wxCommandEvent& WXUNUSED(event))
|
||||
DoOnCodecList();
|
||||
}
|
||||
|
||||
static const FileNames::FileTypes FileTypes{
|
||||
FileNames::XMLFiles, FileNames::AllFiles
|
||||
static const FileNames::FileTypes &FileTypes()
|
||||
{
|
||||
static const FileNames::FileTypes result{
|
||||
FileNames::XMLFiles, FileNames::AllFiles };
|
||||
return result;
|
||||
};
|
||||
|
||||
///
|
||||
@ -2291,7 +2293,7 @@ void ExportFFmpegOptions::OnImportPresets(wxCommandEvent& WXUNUSED(event))
|
||||
XO("Select xml file with presets to import"),
|
||||
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
|
||||
wxEmptyString,
|
||||
FileTypes,
|
||||
FileTypes(),
|
||||
wxFD_OPEN);
|
||||
if (dlg.ShowModal() == wxID_CANCEL) return;
|
||||
path = dlg.GetPath();
|
||||
@ -2324,7 +2326,7 @@ void ExportFFmpegOptions::OnExportPresets(wxCommandEvent& WXUNUSED(event))
|
||||
XO("Select xml file to export presets into"),
|
||||
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
|
||||
wxEmptyString,
|
||||
FileTypes,
|
||||
FileTypes(),
|
||||
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||
if (dlg.ShowModal() == wxID_CANCEL) return;
|
||||
path = dlg.GetPath();
|
||||
|
@ -24,7 +24,6 @@ and libvorbis examples, Monty <monty@xiph.org>
|
||||
|
||||
#include "Export.h"
|
||||
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/ffile.h>
|
||||
#include <wx/log.h>
|
||||
|
||||
|
@ -69,7 +69,6 @@
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/dynlib.h>
|
||||
#include <wx/ffile.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/mimetype.h>
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <wx/dirdlg.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/listbase.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/filefn.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/intl.h>
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <wx/filename.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/timer.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/window.h>
|
||||
|
@ -65,7 +65,6 @@ static Importer::RegisteredUnusableImportPlugin registered{
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/file.h>
|
||||
#include <wx/thread.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/timer.h>
|
||||
#include <wx/intl.h>
|
||||
|
@ -44,7 +44,6 @@ and sample size to help you importing data of an unknown format.
|
||||
#include <wx/choice.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/progdlg.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/textctrl.h>
|
||||
|
@ -41,121 +41,90 @@ void DoManagePluginsMenu(AudacityProject &project, EffectType type)
|
||||
|
||||
bool CompareEffectsByName(const PluginDescriptor *a, const PluginDescriptor *b)
|
||||
{
|
||||
auto akey = a->GetSymbol().Translation();
|
||||
auto bkey = b->GetSymbol().Translation();
|
||||
|
||||
akey += a->GetPath();
|
||||
bkey += b->GetPath();
|
||||
|
||||
return akey.CmpNoCase(bkey) < 0;
|
||||
return
|
||||
std::make_pair( a->GetSymbol().Translation(), a->GetPath() ) <
|
||||
std::make_pair( b->GetSymbol().Translation(), b->GetPath() );
|
||||
}
|
||||
|
||||
bool CompareEffectsByPublisher(
|
||||
const PluginDescriptor *a, const PluginDescriptor *b)
|
||||
{
|
||||
auto &em = EffectManager::Get();
|
||||
auto akey = em.GetVendorName(a->GetID()).Translation();
|
||||
auto bkey = em.GetVendorName(b->GetID()).Translation();
|
||||
|
||||
auto akey = em.GetVendorName(a->GetID());
|
||||
auto bkey = em.GetVendorName(b->GetID());
|
||||
|
||||
if (akey.empty())
|
||||
{
|
||||
akey = _("Uncategorized");
|
||||
}
|
||||
akey = XO("Uncategorized");
|
||||
if (bkey.empty())
|
||||
{
|
||||
bkey = _("Uncategorized");
|
||||
}
|
||||
bkey = XO("Uncategorized");
|
||||
|
||||
akey += a->GetSymbol().Translation();
|
||||
bkey += b->GetSymbol().Translation();
|
||||
|
||||
akey += a->GetPath();
|
||||
bkey += b->GetPath();
|
||||
|
||||
return akey.CmpNoCase(bkey) < 0;
|
||||
return
|
||||
std::make_tuple(
|
||||
akey.Translation(), a->GetSymbol().Translation(), a->GetPath() ) <
|
||||
std::make_tuple(
|
||||
bkey.Translation(), b->GetSymbol().Translation(), b->GetPath() );
|
||||
}
|
||||
|
||||
bool CompareEffectsByPublisherAndName(
|
||||
const PluginDescriptor *a, const PluginDescriptor *b)
|
||||
{
|
||||
auto &em = EffectManager::Get();
|
||||
auto akey = em.GetVendorName(a->GetID()).Translation();
|
||||
auto bkey = em.GetVendorName(b->GetID()).Translation();
|
||||
auto akey = em.GetVendorName(a->GetID());
|
||||
auto bkey = em.GetVendorName(b->GetID());
|
||||
|
||||
if (a->IsEffectDefault())
|
||||
{
|
||||
akey = wxEmptyString;
|
||||
}
|
||||
akey = {};
|
||||
if (b->IsEffectDefault())
|
||||
{
|
||||
bkey = wxEmptyString;
|
||||
}
|
||||
bkey = {};
|
||||
|
||||
akey += a->GetSymbol().Translation();
|
||||
bkey += b->GetSymbol().Translation();
|
||||
|
||||
akey += a->GetPath();
|
||||
bkey += b->GetPath();
|
||||
|
||||
return akey.CmpNoCase(bkey) < 0;
|
||||
return
|
||||
std::make_tuple(
|
||||
akey.Translation(), a->GetSymbol().Translation(), a->GetPath() ) <
|
||||
std::make_tuple(
|
||||
bkey.Translation(), b->GetSymbol().Translation(), b->GetPath() );
|
||||
}
|
||||
|
||||
bool CompareEffectsByTypeAndName(
|
||||
const PluginDescriptor *a, const PluginDescriptor *b)
|
||||
{
|
||||
auto &em = EffectManager::Get();
|
||||
auto akey = em.GetEffectFamilyName(a->GetID()).Translation();
|
||||
auto bkey = em.GetEffectFamilyName(b->GetID()).Translation();
|
||||
auto akey = em.GetEffectFamilyName(a->GetID());
|
||||
auto bkey = em.GetEffectFamilyName(b->GetID());
|
||||
|
||||
if (akey.empty())
|
||||
{
|
||||
akey = _("Uncategorized");
|
||||
}
|
||||
akey = XO("Uncategorized");
|
||||
if (bkey.empty())
|
||||
{
|
||||
bkey = _("Uncategorized");
|
||||
}
|
||||
bkey = XO("Uncategorized");
|
||||
|
||||
if (a->IsEffectDefault())
|
||||
{
|
||||
akey = wxEmptyString;
|
||||
}
|
||||
akey = {};
|
||||
if (b->IsEffectDefault())
|
||||
{
|
||||
bkey = wxEmptyString;
|
||||
}
|
||||
bkey = {};
|
||||
|
||||
akey += a->GetSymbol().Translation();
|
||||
bkey += b->GetSymbol().Translation();
|
||||
|
||||
akey += a->GetPath();
|
||||
bkey += b->GetPath();
|
||||
|
||||
return akey.CmpNoCase(bkey) < 0;
|
||||
return
|
||||
std::make_tuple(
|
||||
akey.Translation(), a->GetSymbol().Translation(), a->GetPath() ) <
|
||||
std::make_tuple(
|
||||
bkey.Translation(), b->GetSymbol().Translation(), b->GetPath() );
|
||||
}
|
||||
|
||||
bool CompareEffectsByType(const PluginDescriptor *a, const PluginDescriptor *b)
|
||||
{
|
||||
auto &em = EffectManager::Get();
|
||||
auto akey = em.GetEffectFamilyName(a->GetID()).Translation();
|
||||
auto bkey = em.GetEffectFamilyName(b->GetID()).Translation();
|
||||
auto akey = em.GetEffectFamilyName(a->GetID());
|
||||
auto bkey = em.GetEffectFamilyName(b->GetID());
|
||||
|
||||
if (akey.empty())
|
||||
{
|
||||
akey = _("Uncategorized");
|
||||
}
|
||||
akey = XO("Uncategorized");
|
||||
if (bkey.empty())
|
||||
{
|
||||
bkey = _("Uncategorized");
|
||||
}
|
||||
bkey = XO("Uncategorized");
|
||||
|
||||
akey += a->GetSymbol().Translation();
|
||||
bkey += b->GetSymbol().Translation();
|
||||
|
||||
akey += a->GetPath();
|
||||
bkey += b->GetPath();
|
||||
|
||||
return akey.CmpNoCase(bkey) < 0;
|
||||
return
|
||||
std::make_tuple(
|
||||
akey.Translation(), a->GetSymbol().Translation(), a->GetPath() ) <
|
||||
std::make_tuple(
|
||||
bkey.Translation(), b->GetSymbol().Translation(), b->GetPath() );
|
||||
}
|
||||
|
||||
// Forward-declared function has its definition below with OnEffect in view
|
||||
|
@ -27,7 +27,6 @@ KeyConfigPrefs and MousePrefs use.
|
||||
#include <wx/defs.h>
|
||||
#include <wx/ffile.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/menu.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/radiobut.h>
|
||||
|
@ -153,11 +153,13 @@ void SelectionBar::Create(wxWindow * parent)
|
||||
}
|
||||
|
||||
|
||||
auStaticText * SelectionBar::AddTitle( const wxString & Title, wxSizer * pSizer ){
|
||||
auStaticText * pTitle = safenew auStaticText(this, Title );
|
||||
auStaticText * SelectionBar::AddTitle(
|
||||
const TranslatableString & Title, wxSizer * pSizer ){
|
||||
const auto translated = Title.Translation();
|
||||
auStaticText * pTitle = safenew auStaticText(this, translated );
|
||||
pTitle->SetBackgroundColour( theTheme.Colour( clrMedium ));
|
||||
pTitle->SetForegroundColour( theTheme.Colour( clrTrackPanelText ) );
|
||||
pSizer->Add( pTitle,0, wxALIGN_CENTER_VERTICAL | wxRIGHT, (Title.length() == 1 ) ? 0:5);
|
||||
pSizer->Add( pTitle,0, wxALIGN_CENTER_VERTICAL | wxRIGHT, (translated.length() == 1 ) ? 0:5);
|
||||
return pTitle;
|
||||
}
|
||||
|
||||
@ -212,12 +214,12 @@ void SelectionBar::Populate()
|
||||
// Top row (mostly labels)
|
||||
wxColour clrText = theTheme.Colour( clrTrackPanelText );
|
||||
wxColour clrText2 = *wxBLUE;
|
||||
AddTitle( _("Project Rate (Hz)"), mainSizer );
|
||||
AddTitle( XO("Project Rate (Hz)"), mainSizer );
|
||||
AddVLine( mainSizer );
|
||||
AddTitle( _("Snap-To"), mainSizer );
|
||||
AddTitle( XO("Snap-To"), mainSizer );
|
||||
AddVLine( mainSizer );
|
||||
#ifdef TIME_IN_SELECT_TOOLBAR
|
||||
AddTitle( _("Audio Position"), mainSizer );
|
||||
AddTitle( XO("Audio Position"), mainSizer );
|
||||
AddVLine( mainSizer );
|
||||
#endif
|
||||
|
||||
|
@ -66,7 +66,7 @@ class SelectionBar final : public ToolBar {
|
||||
void RegenerateTooltips() override;
|
||||
|
||||
private:
|
||||
auStaticText * AddTitle( const wxString & Title,
|
||||
auStaticText * AddTitle( const TranslatableString & Title,
|
||||
wxSizer * pSizer );
|
||||
NumericTextCtrl * AddTime( const TranslatableString &Name, int id, wxSizer * pSizer );
|
||||
void AddVLine( wxSizer * pSizer );
|
||||
|
@ -357,7 +357,7 @@ namespace
|
||||
shiftDown;
|
||||
|
||||
tip =
|
||||
_("Click and drag to move center selection frequency.");
|
||||
XO("Click and drag to move center selection frequency.");
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -28,10 +28,10 @@ Paul Licameli split from TrackPanel.cpp
|
||||
|
||||
#if defined(__WXMAC__)
|
||||
/* i18n-hint: Command names a modifier key on Macintosh keyboards */
|
||||
#define CTRL_CLICK _("Command+Click")
|
||||
#define CTRL_CLICK XO("Command+Click")
|
||||
#else
|
||||
/* i18n-hint: Ctrl names a modifier key on Windows or Linux keyboards */
|
||||
#define CTRL_CLICK _("Ctrl+Click")
|
||||
#define CTRL_CLICK XO("Ctrl+Click")
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
Loading…
x
Reference in New Issue
Block a user