///////////////////////////////////////////////////////
| 112 | { |
| 113 | //////////////////////////////////////////////////////////// |
| 114 | MiniaudioUtils::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 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected