From bebc6e955114a0907c43df9a9c00f22b1f743446 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan <clyne@bitgloo.com> Date: Mon, 30 Sep 2019 15:29:49 -0400 Subject: created Audio component --- src/components/Audio.hpp | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/components/Audio.hpp (limited to 'src/components/Audio.hpp') diff --git a/src/components/Audio.hpp b/src/components/Audio.hpp new file mode 100644 index 0000000..3f7296d --- /dev/null +++ b/src/components/Audio.hpp @@ -0,0 +1,47 @@ +/** + * Copyright (C) 2019 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#ifndef COMPONENT_AUDIO_HPP_ +#define COMPONENT_AUDIO_HPP_ + +#include <AL/al.h> + +#include "Component.hpp" + +struct Audio : Component<Audio> +{ +public: + ALuint source; + + Audio(ALuint _source = 0) : + source(_source) {} + + Audio FromLua([[maybe_unused]] sol::object ref) + { + // TODO load from file name? + return *this; + } + + void serialize([[maybe_unused]] cereal::JSONOutputArchive& ar) final {} + void serialize([[maybe_unused]] cereal::JSONInputArchive& ar) final {} + + std::string serializeName(void) const final { + return "Audio"; + } +}; + +#endif // COMPONENT_AUDIO_HPP_ + -- cgit v1.2.3