// Copyright (C) 2005 Gideon May // // Permission to copy, use, sell and distribute this software is granted // provided this copyright notice appears in all copies. // Permission to modify the code and to distribute modified code is granted // provided this copyright notice appears in all copies, and a notice // that the code was modified is included with the copyright notice. // // This software is provided "as is" without express or implied warranty, // and with no claim as to its suitability for any purpose. #include #include #include #include #include #include #include "held_ptr.hpp" using namespace boost::python; class Sample { public: Sample(const std::string& file) { osgAL::SoundManager::instance()->getSample(file.c_str(), false); } private: openalpp::ref_ptr sample; }; void init_sm() { osgAL::SoundManager::instance()->init(16); osgAL::SoundManager::instance()->getEnvironment()->setDistanceModel(openalpp::InverseDistance); osgAL::SoundManager::instance()->getEnvironment()->setDopplerFactor(1); } namespace PyOSG { void init_SoundManager() { class_ soundmanager("SoundManager", no_init); soundmanager .def("instance", &osgAL::SoundManager::instance, return_internal_reference<>()) .staticmethod("instance") ; def("init", &init_sm); class_, boost::noncopyable> soundroot("SoundRoot", no_init); soundroot ; class_, boost::noncopyable > soundnode("SoundNode", no_init); soundnode ; class_, boost::noncopyable > soundstate("SoundState", no_init); soundstate ; class_ sample("Sample", no_init); sample .def(init ()) ; } }