X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Faudio%2Fstream_sound_source.hpp;h=9e8ac9a4de269c8539df6abcc5c5c0be6647202d;hb=8e52a5b000d732e96b1cc461163c4778b434dc27;hp=aa621b39fb0044513470b2da5946ee4ccefd42eb;hpb=fea3446f05e1e7673607b835c269d3e8d1929ab3;p=supertux.git diff --git a/src/audio/stream_sound_source.hpp b/src/audio/stream_sound_source.hpp index aa621b39f..9e8ac9a4d 100644 --- a/src/audio/stream_sound_source.hpp +++ b/src/audio/stream_sound_source.hpp @@ -1,12 +1,10 @@ -// $Id$ -// // SuperTux // Copyright (C) 2006 Matthias Braun // -// 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 2 -// of the License, or (at your option) any later version. +// 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 @@ -14,15 +12,12 @@ // 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, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// along with this program. If not, see . -#ifndef __STREAM_SOUND_SOURCE_H__ -#define __STREAM_SOUND_SOURCE_H__ +#ifndef HEADER_SUPERTUX_AUDIO_STREAM_SOUND_SOURCE_HPP +#define HEADER_SUPERTUX_AUDIO_STREAM_SOUND_SOURCE_HPP -#include -#include -#include "openal_sound_source.hpp" +#include "audio/openal_sound_source.hpp" class SoundFile; @@ -32,9 +27,9 @@ public: StreamSoundSource(); virtual ~StreamSoundSource(); - void set_sound_file(SoundFile* file); + void set_sound_file(std::unique_ptr newfile); - enum FadeState { NoFading, FadingOn, FadingOff }; + enum FadeState { NoFading, FadingOn, FadingOff, FadingPause, FadingResume }; void set_fading(FadeState state, float fadetime); FadeState get_fade_state() const @@ -43,9 +38,9 @@ public: } void update(); - void set_looping(bool looping) + void set_looping(bool looping_) { - this->looping = looping; + this->looping = looping_; } bool get_looping() const { @@ -56,16 +51,22 @@ private: static const size_t STREAMBUFFERSIZE = 1024 * 500; static const size_t STREAMFRAGMENTS = 5; static const size_t STREAMFRAGMENTSIZE - = STREAMBUFFERSIZE / STREAMFRAGMENTS; + = STREAMBUFFERSIZE / STREAMFRAGMENTS; bool fillBufferAndQueue(ALuint buffer); - SoundFile* file; + std::unique_ptr file; ALuint buffers[STREAMFRAGMENTS]; FadeState fade_state; float fade_start_time; float fade_time; bool looping; + +private: + StreamSoundSource(const StreamSoundSource&); + StreamSoundSource& operator=(const StreamSoundSource&); }; #endif + +/* EOF */