Reformat audio module
This commit is contained in:
parent
069318dc0b
commit
9656552878
3 changed files with 12 additions and 12 deletions
|
@ -1,12 +1,12 @@
|
||||||
set(SRC
|
set(SRC
|
||||||
include/audio.hpp
|
include/audio.hpp
|
||||||
src/audio.cpp)
|
src/audio.cpp)
|
||||||
|
|
||||||
add_library(Audio STATIC ${SRC})
|
add_library(Audio STATIC ${SRC})
|
||||||
target_include_directories(Audio PUBLIC include)
|
target_include_directories(Audio PUBLIC include)
|
||||||
target_link_libraries(Audio PRIVATE
|
target_link_libraries(Audio PRIVATE
|
||||||
Log
|
Log
|
||||||
opus
|
opus
|
||||||
opusfile
|
opusfile
|
||||||
Core)
|
Core)
|
||||||
set_engine_properties(Audio)
|
set_engine_properties(Audio)
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
#include "path.hpp"
|
#include "path.hpp"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Audio API
|
* Audio API
|
||||||
*/
|
*/
|
||||||
namespace audio {
|
namespace audio {
|
||||||
void initialize();
|
void initialize();
|
||||||
|
|
||||||
void play_file(const prism::path& path, float gain = 1.0f);
|
void play_file(const prism::path& path, float gain = 1.0f);
|
||||||
}
|
} // namespace audio
|
||||||
|
|
|
@ -18,12 +18,12 @@ struct AudioFile {
|
||||||
std::vector<AudioFile> audio_files;
|
std::vector<AudioFile> audio_files;
|
||||||
|
|
||||||
void audio::initialize() {
|
void audio::initialize() {
|
||||||
// todo: stub
|
// todo: stub
|
||||||
}
|
}
|
||||||
|
|
||||||
void audio::play_file(const prism::path& path, const float gain) {
|
void audio::play_file(const prism::path& path, const float gain) {
|
||||||
auto audio_file = prism::open_file(path);
|
auto audio_file = prism::open_file(path);
|
||||||
if(audio_file == std::nullopt)
|
if (audio_file == std::nullopt)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
audio_file->read_all();
|
audio_file->read_all();
|
||||||
|
|
Reference in a new issue