#!/usr/bin/env python

# Mandatory for openpluginlib initialisation
import platform
import sys
import os.path

if platform.system( ) == "Linux":
	import dl
	sys.setdlopenflags( dl.RTLD_NOW | dl.RTLD_GLOBAL )

# Import the player lib
import openpluginlib as opl

key=opl.create_key_from_string( "foo" )
print key

propa=opl.property( key )
propb=opl.property( opl.create_key_from_string( "bar" ) )

property_container=opl.property_container()

propa.set( 1 )
propb.set( 2 )

property_container.append( propa )
property_container.append( propa )
property_container.append( propb )

for k in property_container.get_keys():
	p=property_container.get_property(k)
	print "property[%s] %s -> %i" % (k, p, p.value_as_int())

cloned=property_container.clone()

property_container.remove( propa )
for k in property_container.get_keys():
	p=property_container.get_property(k)
	print "property[%s] %s -> %i" % (k, p, p.value_as_int())

for k in cloned.get_keys():
	p=cloned.get_property(k)
	print "property[%s] %s -> %i" % (k, p, p.value_as_int())

print property_container.get_property( "bar" ) == cloned.get_property( "bar" )
print property_container.get_property( "bar" ) == propb
