本文整理汇总了C++中SoundSource::getIntProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundSource::getIntProperty方法的具体用法?C++ SoundSource::getIntProperty怎么用?C++ SoundSource::getIntProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundSource
的用法示例。
在下文中一共展示了SoundSource::getIntProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_notification
bool test_notification()
{
using namespace spatosc;
Scene scene;
scene.addTranslator("dummy", new DummyTranslator());
SoundSource *source = scene.createSoundSource("source");
if (DummyTranslator::string_updated || DummyTranslator::float_updated || DummyTranslator::int_updated)
{
std::cerr <<" should not have received a property update yet.\n";
return false;
}
// String property:
source->setStringProperty("foo", "bar");
if (! DummyTranslator::string_updated)
{
std::cerr <<" should have received a string property update.\n";
return false;
}
std::string s_value("");
source->getStringProperty("foo", s_value);
if (s_value != "bar")
{
std::cerr <<" string property has not been set.\n";
return false;
}
// Float property:
source->setFloatProperty("bar", 3.14159);
if (! DummyTranslator::float_updated)
{
std::cerr <<" should have received a float property update.\n";
return false;
}
double f_value(0.0);
source->getFloatProperty("bar", f_value);
if (f_value != 3.14159)
{
std::cerr <<" float property has not been set.\n";
return false;
}
// Int property:
source->setIntProperty("egg", 2);
if (! DummyTranslator::int_updated)
{
std::cerr <<" should have received an int property update.\n";
return false;
}
int i_value(0);
source->getIntProperty("egg", i_value);
if (i_value != 2)
{
std::cerr <<" int property has not been set.\n";
return false;
}
source->removeIntProperty("egg");
i_value = 0;
source->getIntProperty("egg", i_value);
if (i_value != 0)
{
std::cerr <<" int property has not been removed.\n";
return false;
}
return true;
}