diff --git a/src/import/ImportRaw.cpp b/src/import/ImportRaw.cpp index 647816417..7f4fa0bf9 100644 --- a/src/import/ImportRaw.cpp +++ b/src/import/ImportRaw.cpp @@ -89,8 +89,7 @@ class ImportRawDialog final : public wxDialogWrapper { wxTextCtrl *mPercentText; wxComboBox *mRateText; - int mNumEncodings; - ArrayOf mEncodingSubtype; + std::vector mEncodingSubtype; wxString mFileName; @@ -269,6 +268,24 @@ void ImportRaw(const AudacityProject &project, wxWindow *parent, const wxString } } + +// Get endian choice from SF_FORMAT +static int getEndianChoice(int sfFormat) { + switch (sfFormat & SF_FORMAT_ENDMASK) + { + default: + case SF_ENDIAN_FILE: + return 0; + case SF_ENDIAN_LITTLE: + return 1; + case SF_ENDIAN_BIG: + return 2; + case SF_ENDIAN_CPU: + return 3; + } +} + + // // ImportRawDialog // @@ -293,30 +310,23 @@ ImportRawDialog::ImportRawDialog(wxWindow * parent, const wxString & fileName) wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), mFileName(fileName) { - wxASSERT(mChannels >= 1); + wxASSERT(0 < mChannels && mChannels <= 16); SetName(); // Append filename at window title wxFileName wfn{ fileName }; - wxDialog::SetTitle(GetTitle() + ": " + wfn.GetFullName()); + wxString windowTitle = XO("%s: %s").Format(GetTitle(), wfn.GetFullName()).Translation(); + wxDialog::SetTitle(windowTitle); ShuttleGui S(this, eIsCreating); TranslatableStrings encodings; - int num; - int selection; - int endian; - int i; - num = sf_num_encodings(); - mNumEncodings = 0; - mEncodingSubtype.reinit(static_cast(num)); + int num = sf_num_encodings(); - selection = 0; - for (i=0; iSetSelection(selection); mEndianChoice->SetSelection(endian);