165{
166
167 wxUnusedVar(OV_CALLBACKS_DEFAULT);
168 wxUnusedVar(OV_CALLBACKS_NOCLOSE);
169 wxUnusedVar(OV_CALLBACKS_STREAMONLY);
170 wxUnusedVar(OV_CALLBACKS_STREAMONLY_NOCLOSE);
171
172 auto vorbisFile = std::make_unique<OggVorbis_File>();
173 auto file = std::make_unique<wxFFile>(filename,
wxT(
"rb"));
174
175 if (!file->IsOpened()) {
176
177 return nullptr;
178 }
179
180 int err = ov_open(file->fp(), vorbisFile.get(), NULL, 0);
181
182 if (err < 0) {
184
185 switch (err) {
186 case OV_EREAD:
187 message =
XO(
"Media read error");
188 break;
189 case OV_ENOTVORBIS:
190 message =
XO(
"Not an Ogg Vorbis file");
191 break;
192 case OV_EVERSION:
193 message =
XO(
"Vorbis version mismatch");
194 break;
195 case OV_EBADHEADER:
196 message =
XO(
"Invalid Vorbis bitstream header");
197 break;
198 case OV_EFAULT:
199 message =
XO(
"Internal logic fault");
200 break;
201 }
202
203
204 return nullptr;
205 }
206
207 return std::make_unique<OggImportFileHandle>(filename, std::move(file), std::move(vorbisFile));
208}
Holds a msgid for the translation catalog; may also bind format arguments.