Fix "no remove aqua speed" bug when player leaves the water
[ryzomcore.git] / nel / src / sound / stream_file_sound.cpp
blobf5fbaffc3140e362a4fe911165d42d4cb716cbf9
1 /**
2 * \file stream_file_sound.cpp
3 * \brief CStreamFileSound
4 * \date 2012-04-11 09:57GMT
5 * \author Jan Boon (Kaetemi)
6 * CStreamFileSound
7 */
9 // NeL - MMORPG Framework <https://wiki.ryzom.dev/>
10 // Copyright (C) 2012-2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
12 // This program is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU Affero General Public License as
14 // published by the Free Software Foundation, either version 3 of the
15 // License, or (at your option) any later version.
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU Affero General Public License for more details.
22 // You should have received a copy of the GNU Affero General Public License
23 // along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include "stdsound.h"
26 #include <nel/sound/stream_file_sound.h>
28 // STL includes
30 // NeL includes
31 // #include <nel/misc/debug.h>
32 #include <nel/sound/group_controller_root.h>
34 // Project includes
36 using namespace std;
37 // using namespace NLMISC;
39 namespace NLSOUND {
41 CStreamFileSound::CStreamFileSound() : m_Async(true)
46 CStreamFileSound::~CStreamFileSound()
51 void CStreamFileSound::importForm(const std::string &filename, NLGEORGES::UFormElm &root)
53 // Call the base class
54 CStreamSound::importForm(filename, root);
56 // Async
57 root.getValueByName(m_Async, ".SoundType.Async");
59 // FilePath
60 root.getValueByName(m_FilePath, ".SoundType.FilePath");
63 void CStreamFileSound::serial(NLMISC::IStream &s)
65 CStreamSound::serial(s);
67 s.serial(m_Async);
68 s.serial(m_FilePath);
71 void CStreamFileSound::setMusicFilePath(const std::string &filePath, bool async, bool loop)
73 #if !FINAL_VERSION
74 _Name = NLMISC::CStringMapper::map(std::string("<MusicChannel:") + NLMISC::CFile::getFilenameWithoutExtension(filePath) + ">");
75 #else
76 _Name = NLMISC::CStringMapper::map("<MusicChannel>");
77 #endif
78 _ConeInnerAngle = NLMISC::Pi * 2;
79 _ConeOuterAngle = NLMISC::Pi * 2;
80 _Looping = loop;
81 _Gain = 1.0f;
82 _ConeOuterGain = 1.0f;
83 _Direction = NLMISC::CVector(0.f, 0.f, 0.f);
84 _Pitch = 1.0f;
85 _Priority = HighestPri;
86 _MaxDist = 9000.0f;
87 _MinDist = 1000.0f;
88 m_Async = async;
89 m_FilePath = filePath;
90 _GroupController = CGroupControllerRoot::getInstance()->getGroupController(NLSOUND_SHEET_V1_DEFAULT_SOUND_MUSIC_GROUP_CONTROLLER);
93 } /* namespace NLSOUND */
95 /* end of file */