1
0
Fork 0

Used tied property list.

This commit is contained in:
ThorstenB 2011-03-09 23:10:55 +01:00
parent b3d59ed563
commit 59f2328551
2 changed files with 5 additions and 18 deletions

View file

@ -2137,17 +2137,6 @@ MK_VIII::IOHandler::set_present_status (bool value)
// FGVoicePlayer //////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
void
FGVoicePlayer::PropertiesHandler::unbind ()
{
vector<SGPropertyNode_ptr>::iterator iter;
for (iter = tied_properties.begin(); iter != tied_properties.end(); iter++)
(*iter)->untie();
tied_properties.clear();
}
void
FGVoicePlayer::Speaker::bind (SGPropertyNode *node)
{

View file

@ -29,9 +29,9 @@
#include <map>
#include <simgear/props/props.hxx>
#include <simgear/props/tiedpropertylist.hxx>
#include <simgear/sound/sample_openal.hxx>
#include <simgear/structure/subsystem_mgr.hxx>
using std::vector;
using std::deque;
using std::map;
@ -98,16 +98,14 @@ public:
setter_t _setter;
};
class PropertiesHandler
class PropertiesHandler : public simgear::TiedPropertyList
{
public:
vector<SGPropertyNode_ptr> tied_properties;
template <class T>
inline void tie (SGPropertyNode *node, const SGRawValue<T> &raw_value)
{
node->tie(raw_value);
tied_properties.push_back(node);
Tie(node,raw_value);
}
template <class T>
@ -115,12 +113,12 @@ public:
const char *relative_path,
const SGRawValue<T> &raw_value)
{
tie(node->getNode(relative_path, true), raw_value);
Tie(node->getNode(relative_path, true),raw_value);
}
PropertiesHandler() {};
void unbind ();
void unbind () {Untie();}
};
///////////////////////////////////////////////////////////////////////////