145{
146
147 wxUnusedVar(OV_CALLBACKS_DEFAULT);
148 wxUnusedVar(OV_CALLBACKS_NOCLOSE);
149 wxUnusedVar(OV_CALLBACKS_STREAMONLY);
150 wxUnusedVar(OV_CALLBACKS_STREAMONLY_NOCLOSE);
151
152 auto vorbisFile = std::make_unique<OggVorbis_File>();
153 auto file = std::make_unique<wxFFile>(filename,
wxT(
"rb"));
154
155 if (!file->IsOpened()) {
156
157 return nullptr;
158 }
159
160 int err = ov_open(file->fp(), vorbisFile.get(), NULL, 0);
161
162 if (err < 0) {
164
165 switch (err) {
166 case OV_EREAD:
167 message =
XO(
"Media read error");
168 break;
169 case OV_ENOTVORBIS:
170 message =
XO(
"Not an Ogg Vorbis file");
171 break;
172 case OV_EVERSION:
173 message =
XO(
"Vorbis version mismatch");
174 break;
175 case OV_EBADHEADER:
176 message =
XO(
"Invalid Vorbis bitstream header");
177 break;
178 case OV_EFAULT:
179 message =
XO(
"Internal logic fault");
180 break;
181 }
182
183
184 return nullptr;
185 }
186
187 return std::make_unique<OggImportFileHandle>(filename, std::move(file), std::move(vorbisFile));
188}
Holds a msgid for the translation catalog; may also bind format arguments.