MCPcopy Create free account
hub / github.com/audacity/audacity / Open

Method Open

modules/import-export/mod-wavpack/ImportWavPack.cpp:106–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106std::unique_ptr<ImportFileHandle> WavPackImportPlugin::Open(const FilePath &filename, AudacityProject*)
107{
108 char errMessage[100]; // To hold possible error message
109 int flags = OPEN_WVC | OPEN_FILE_UTF8 | OPEN_TAGS | OPEN_DSD_AS_PCM | OPEN_NORMALIZE;
110 WavpackContext *wavpackContext = WavpackOpenFileInput(filename.ToUTF8(), errMessage, flags, 0);
111
112 if (!wavpackContext) {
113 // Some error occured(e.g. File not found or is invalid)
114 wxLogDebug("WavpackOpenFileInput() failed on file %s, error = %s", filename, errMessage);
115 return nullptr;
116 }
117
118 auto handle = std::make_unique<WavPackImportFileHandle>(filename, wavpackContext);
119
120 return std::move(handle);
121}
122
123static Importer::RegisteredImportPlugin registered{ "WavPack",
124 std::make_unique< WavPackImportPlugin >()

Callers 1

ProcessMethod · 0.45

Calls 1

moveFunction · 0.85

Tested by

no test coverage detected