1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-13 14:13:32 +02:00

Define and use wxArrayStringEx...

reducing verbosity where there were repeated calls of Add(), and defining
move construction and assignment for efficient returns from functions
This commit is contained in:
Paul Licameli
2019-02-12 16:30:22 -05:00
parent 07a42e8e19
commit 6d5bc21d50
30 changed files with 383 additions and 262 deletions

View File

@@ -321,8 +321,6 @@ ImportRawDialog::ImportRawDialog(wxWindow * parent,
ShuttleGui S(this, eIsCreating);
wxArrayString encodings;
wxArrayString endians;
wxArrayString chans;
int num;
int selection;
int endian;
@@ -354,18 +352,20 @@ ImportRawDialog::ImportRawDialog(wxWindow * parent,
}
}
/* i18n-hint: Refers to byte-order. Don't translate "endianness" if you don't
wxArrayStringEx endians{
/* i18n-hint: Refers to byte-order. Don't translate "endianness" if you don't
know the correct technical word. */
_("No endianness") ,
/* i18n-hint: Refers to byte-order. Don't translate this if you don't
know the correct technical word. */
endians.Add(_("No endianness"));
/* i18n-hint: Refers to byte-order. Don't translate this if you don't
know the correct technical word. */
endians.Add(_("Little-endian"));
/* i18n-hint: Refers to byte-order. Don't translate this if you don't
know the correct technical word. */
endians.Add(_("Big-endian"));
/* i18n-hint: Refers to byte-order. Don't translate "endianness" if you don't
know the correct technical word. */
endians.Add(_("Default endianness"));
_("Little-endian") ,
/* i18n-hint: Refers to byte-order. Don't translate this if you don't
know the correct technical word. */
_("Big-endian") ,
/* i18n-hint: Refers to byte-order. Don't translate "endianness" if you don't
know the correct technical word. */
_("Default endianness") ,
};
switch (mEncoding & (SF_FORMAT_ENDMASK))
{
@@ -384,8 +384,10 @@ ImportRawDialog::ImportRawDialog(wxWindow * parent,
break;
}
chans.Add(_("1 Channel (Mono)"));
chans.Add(_("2 Channels (Stereo)"));
wxArrayStringEx chans{
_("1 Channel (Mono)") ,
_("2 Channels (Stereo)") ,
};
for (i=2; i<16; i++) {
chans.push_back(wxString::Format(_("%d Channels"), i + 1));
}