MCPcopy Create free account
hub / github.com/SFML/SFML / SoundBase

Method SoundBase

src/SFML/Audio/MiniaudioUtils.cpp:114–128  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

112{
113////////////////////////////////////////////////////////////
114MiniaudioUtils::SoundBase::SoundBase(const ma_data_source_vtable& dataSourceVTable,
115 AudioDevice::ResourceEntry::Func reinitializeFunc)
116{
117 // Set this object up as a miniaudio data source
118 ma_data_source_config config = ma_data_source_config_init();
119 config.vtable = &dataSourceVTable;
120
121 if (const ma_result result = ma_data_source_init(&config, &dataSourceBase); result != MA_SUCCESS)
122 err() << "Failed to initialize audio data source: " << ma_result_description(result) << std::endl;
123
124 resourceEntryIter = AudioDevice::registerResource(
125 this,
126 [](void* ptr) { static_cast<SoundBase*>(ptr)->deinitialize(); },
127 reinitializeFunc);
128}
129
130
131////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

deinitializeMethod · 0.80

Tested by

no test coverage detected