Antigona Release #1
1 changed files with 7 additions and 9 deletions
|
@ -48,7 +48,7 @@ ma_result MiniAudioEngine::startDevice(int id)
|
|||
deviceConfig.pUserData = &engine;
|
||||
result = ma_device_init(&context, &deviceConfig, &device);
|
||||
if (result != MA_SUCCESS) {
|
||||
printf("Failed to initialize audio device %s.", pPlaybackDeviceInfos[id].name);
|
||||
qCritical("Failed to initialize audio device %s.", pPlaybackDeviceInfos[id].name);
|
||||
return result;
|
||||
}
|
||||
engineConfig = ma_engine_config_init();
|
||||
|
@ -57,16 +57,16 @@ ma_result MiniAudioEngine::startDevice(int id)
|
|||
engineConfig.noAutoStart = MA_TRUE;
|
||||
result = ma_engine_init(NULL, &engine);
|
||||
if (result != MA_SUCCESS) {
|
||||
printf("Failed to initialize audio engine.");
|
||||
qCritical("Failed to initialize audio engine.");
|
||||
return result;
|
||||
}
|
||||
result = ma_engine_start(&engine);
|
||||
if (result != MA_SUCCESS) {
|
||||
printf("Failed to start audio engine %i.", id);
|
||||
qCritical("Failed to start audio engine %i.", id);
|
||||
return result;
|
||||
}
|
||||
iChosenDevice = id;
|
||||
printf("Initialized audio device %d: %s", id, pPlaybackDeviceInfos[id].name);
|
||||
qInfo("Initialized audio device %d: %s", id, pPlaybackDeviceInfos[id].name);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -81,12 +81,12 @@ ma_result MiniAudioEngine::startContext()
|
|||
resourceManagerConfig.jobThreadCount = 0;
|
||||
result = ma_resource_manager_init(&resourceManagerConfig, &resourceManager);
|
||||
if (result != MA_SUCCESS) {
|
||||
printf("Failed to initialize audio resource manager.");
|
||||
qCritical("Failed to initialize audio resource manager.");
|
||||
return result;
|
||||
}
|
||||
result = ma_context_init(NULL, 0, NULL, &context);
|
||||
if (result != MA_SUCCESS) {
|
||||
printf("Failed to initialize audio context.");
|
||||
qCritical("Failed to initialize audio context.");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ ma_result MiniAudioEngine::getAllAudioDevices()
|
|||
|
||||
result = ma_context_get_devices(&context, &pPlaybackDeviceInfos, &playbackDeviceCount, NULL, NULL);
|
||||
if (result != MA_SUCCESS) {
|
||||
printf("Failed to enumerate playback devices.\n");
|
||||
qWarning("Failed to enumerate playback devices.\n");
|
||||
ma_context_uninit(&context);
|
||||
return result;
|
||||
}
|
||||
|
@ -246,6 +246,4 @@ void MiniAudioEngine::setCursor(int layer, int cursor)
|
|||
ma_sound_get_length_in_pcm_frames(&m_currentSound[layer], &f);
|
||||
f = (cursor * f) / 65025;
|
||||
ma_sound_seek_to_pcm_frame(&m_currentSound[layer], f);
|
||||
//ma_sound_set_start_time_in_pcm_frames(&m_currentSound[layer], f);
|
||||
//ma_data_source_set_range_in_pcm_frames(&m_currentSound[layer], f, total);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue