2 * \file stream_file_sound.cpp
3 * \brief CStreamFileSound
4 * \date 2012-04-11 09:57GMT
5 * \author Jan Boon (Kaetemi)
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/>.
26 #include <nel/sound/stream_file_sound.h>
31 // #include <nel/misc/debug.h>
32 #include <nel/sound/group_controller_root.h>
37 // using namespace NLMISC;
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
);
57 root
.getValueByName(m_Async
, ".SoundType.Async");
60 root
.getValueByName(m_FilePath
, ".SoundType.FilePath");
63 void CStreamFileSound::serial(NLMISC::IStream
&s
)
65 CStreamSound::serial(s
);
71 void CStreamFileSound::setMusicFilePath(const std::string
&filePath
, bool async
, bool loop
)
74 _Name
= NLMISC::CStringMapper::map(std::string("<MusicChannel:") + NLMISC::CFile::getFilenameWithoutExtension(filePath
) + ">");
76 _Name
= NLMISC::CStringMapper::map("<MusicChannel>");
78 _ConeInnerAngle
= NLMISC::Pi
* 2;
79 _ConeOuterAngle
= NLMISC::Pi
* 2;
82 _ConeOuterGain
= 1.0f
;
83 _Direction
= NLMISC::CVector(0.f
, 0.f
, 0.f
);
85 _Priority
= HighestPri
;
89 m_FilePath
= filePath
;
90 _GroupController
= CGroupControllerRoot::getInstance()->getGroupController(NLSOUND_SHEET_V1_DEFAULT_SOUND_MUSIC_GROUP_CONTROLLER
);
93 } /* namespace NLSOUND */