本文整理汇总了C++中ParameterSet::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterSet::Set方法的具体用法?C++ ParameterSet::Set怎么用?C++ ParameterSet::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterSet
的用法示例。
在下文中一共展示了ParameterSet::Set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAll
/*--------------------------------------------------------------------------------*/
void AudioObjectParameters::GetAll(ParameterSet& set, bool force) const
{
GetParameterFromParameters<>(Parameter_channel, values.channel, set, force);
GetParameterFromParameters<>(Parameter_duration, values.duration, set, force);
GetParameterFromParameters<>(Parameter_cartesian, values.cartesian, set, force);
if (force || IsParameterSet(Parameter_position)) position.SetParameters(set, parameterdescs[Parameter_position].name);
if (force || IsParameterSet(Parameter_minposition))
{
const Position *pos = minposition ? minposition : &nullposition;
pos->SetParameters(set, parameterdescs[Parameter_minposition].name);
}
if (force || IsParameterSet(Parameter_maxposition))
{
const Position *pos = maxposition ? maxposition : &nullposition;
pos->SetParameters(set, parameterdescs[Parameter_maxposition].name);
}
GetParameterFromParameters<>(Parameter_gain, values.gain, set, force);
GetParameterFromParameters<>(Parameter_width, values.width, set, force);
GetParameterFromParameters<>(Parameter_depth, values.depth, set, force);
GetParameterFromParameters<>(Parameter_height, values.height, set, force);
GetParameterFromParameters<>(Parameter_divergencebalance, values.divergencebalance, set, force);
GetParameterFromParameters<>(Parameter_divergenceazimuth, values.divergenceazimuth, set, force);
GetParameterFromParameters<>(Parameter_diffuseness, values.diffuseness, set, force);
GetParameterFromParameters<>(Parameter_delay, values.delay, set, force);
GetParameterFromParameters<>(Parameter_objectimportance, values.objectimportance, set, force);
GetParameterFromParameters<>(Parameter_channelimportance, values.channelimportance, set, force);
GetParameterFromParameters<>(Parameter_dialogue, values.dialogue, set, force);
GetParameterFromParameters<>(Parameter_channellock, values.channellock, set, force);
GetParameterFromParameters<>(Parameter_channellockmaxdistance, values.channellockmaxdistance, set, force);
GetParameterFromParameters<>(Parameter_interact, values.interact, set, force);
GetParameterFromParameters<>(Parameter_interpolate, values.interpolate, set, force);
GetParameterFromParameters<>(Parameter_interpolationtime, values.interpolationtime, set, force);
GetParameterFromParameters<>(Parameter_onscreen, values.onscreen, set, force);
GetParameterFromParameters<>(Parameter_disableducking, values.disableducking, set, force);
GetParameterFromParameters<>(Parameter_othervalues, othervalues, set, force);
const ExcludedZone *zone;
if ((zone = excludedZones) != NULL)
{
ParameterSet zones;
uint_t n = 0;
while (zone)
{
ParameterSet zonerep;
Position c1 = zone->GetMinCorner();
Position c2 = zone->GetMaxCorner();
zonerep.Set("name", zone->GetName());
zonerep.Set("minx", c1.pos.x);
zonerep.Set("miny", c1.pos.y);
zonerep.Set("minz", c1.pos.z);
zonerep.Set("maxx", c2.pos.x);
zonerep.Set("maxy", c2.pos.y);
zonerep.Set("maxz", c2.pos.z);
zones.Set(StringFrom(n), zonerep);
zone = zone->GetNext();
n++;
}
set.Set("excludedzones", zones);
}
}
示例2: main
int main(int argc, char *argv[])
{
// print library versions (the actual loaded versions, if dynamically linked)
printf("Versions:\n%s\n", LoadedVersions::Get().GetVersionsList().c_str());
if (argc < 2)
{
fprintf(stderr, "Usage: write-separate-adm <filename>\n");
exit(1);
}
// create basic ADM
XMLADMData *adm;
if ((adm = XMLADMData::CreateADM()) != NULL)
{
ADMData::OBJECTNAMES names;
// set programme name
// if an audioProgramme object of this name doesn't exist, one will be created
names.programmeName = "ADM Test Programme";
// set content name
// if an audioContent object of this name doesn't exist, one will be created
names.contentName = "ADM Test Content";
// create 16 tracks, channels and streams
uint_t t, ntracks = 16;
for (t = 0; t < ntracks; t++)
{
ADMAudioTrack *track;
std::string trackname;
printf("------------- Track %2u -----------------\n", t + 1);
// create default audioTrackFormat name (used for audioStreamFormat objects as well)
Printf(trackname, "Track %u", t + 1);
names.trackNumber = t;
// create audioTrackUID for chna chunk
if ((track = adm->CreateTrack(names.trackNumber)) != NULL)
{
track->SetSampleRate(48000);
track->SetBitDepth(24);
}
// derive channel and stream names from track name
names.channelFormatName = trackname;
names.streamFormatName = "PCM_" + trackname;
names.trackFormatName = "PCM_" + trackname;
// set object name
// create 4 objects, each of 4 tracks
names.objectName = ""; // need this because Printf() APPENDS!
Printf(names.objectName, "Object %u", 1 + (t / 4));
// set pack name from object name
// create 4 packs, each of 4 tracks
names.packFormatName = ""; // need this because Printf() APPENDS!
Printf(names.packFormatName, "Pack %u", 1 + (t / 4));
adm->CreateObjects(names);
// note how the programme and content names are left in place in 'names'
// this is necessary to ensure that things are linked up properly
// find channel format object for this track
ADMAudioChannelFormat *cf;
if ((cf = dynamic_cast<ADMAudioChannelFormat *>(adm->GetWritableObjectByName(names.channelFormatName, ADMAudioChannelFormat::Type))) != NULL)
{
// found channel format, generate block formats for it
ADMAudioBlockFormat *bf;
uint_t i;
for (i = 0; i < 20; i++)
{
if ((bf = adm->CreateBlockFormat(cf)) != NULL)
{
AudioObjectParameters params;
Position pos;
// set start time to be index * 25ms
bf->SetRTime(i * 25000000);
// set duration to be 25ms
bf->SetDuration(25000000);
pos.polar = true;
pos.pos.az = fmod((double)(t + i) * 20.0, 360.0);
pos.pos.el = (double)i / (double)ntracks * 60.0;
pos.pos.d = 1.0;
params.SetPosition(pos);
params.SetGain(2.0);
params.SetWidth(5.0);
params.SetHeight(10.0);
params.SetDepth(15.0);
params.SetDiffuseness(20.0);
params.SetDelay(25.0);
params.SetObjectImportance(5);
params.SetChannelImportance(2);
//.........这里部分代码省略.........
示例3: main
int main(void)
{
// print library versions (the actual loaded versions, if dynamically linked)
printf("Versions:\n%s\n", LoadedVersions::Get().GetVersionsList().c_str());
XMLADMData *adm;
// create basic ADM
if ((adm = XMLADMData::CreateADM()) != NULL)
{
ADMData::OBJECTNAMES names;
// set programme name
// if an audioProgramme object of this name doesn't exist, one will be created
names.programmeName = "ADM Test Programme";
// set content name
// if an audioContent object of this name doesn't exist, one will be created
names.contentName = "ADM Test Content";
// create 16 tracks, channels and streams
uint_t t, ntracks = 16;
for (t = 0; t < ntracks; t++)
{
std::string trackname;
printf("------------- Track %2u -----------------\n", t + 1);
// create default audioTrackFormat name (used for audioStreamFormat objects as well)
Printf(trackname, "Track %u", t + 1);
names.trackNumber = t;
// derive channel and stream names from track name
names.channelFormatName = trackname;
names.streamFormatName = "PCM_" + trackname;
names.trackFormatName = "PCM_" + trackname;
// set object name
// create 4 objects, each of 4 tracks
names.objectName = ""; // need this because Printf() APPENDS!
Printf(names.objectName, "Object %u", 1 + (t / 4));
// set pack name from object name
// create 4 packs, each of 4 tracks
names.packFormatName = ""; // need this because Printf() APPENDS!
Printf(names.packFormatName, "Pack %u", 1 + (t / 4));
adm->CreateObjects(names);
// note how the programme and content names are left in place in 'names'
// this is necessary to ensure that things are linked up properly
// find channel format object for this track
ADMAudioChannelFormat *cf;
if ((cf = dynamic_cast<ADMAudioChannelFormat *>(adm->GetWritableObjectByName(names.channelFormatName, ADMAudioChannelFormat::Type))) != NULL)
{
// found channel format, generate block formats for it
ADMAudioBlockFormat *bf;
uint_t i;
for (i = 0; i < 20; i++)
{
if ((bf = adm->CreateBlockFormat(cf)) != NULL)
{
AudioObjectParameters params;
Position pos;
// set start time to be index * 25ms
bf->SetRTime(i * 25000000);
// set duration to be 25ms
bf->SetDuration(25000000);
pos.polar = true;
pos.pos.az = fmod((double)(t + i) * 20.0, 360.0);
pos.pos.el = (double)i / (double)ntracks * 60.0;
pos.pos.d = 1.0;
params.SetPosition(pos);
params.SetGain(2.0);
params.SetWidth(5.0);
params.SetHeight(10.0);
params.SetDepth(15.0);
params.SetDiffuseness(20.0);
params.SetDelay(25.0);
params.SetObjectImportance(5);
params.SetChannelImportance(2);
params.SetDialogue(1);
params.SetChannelLock(true);
params.SetInteract(true);
params.SetInterpolate(true);
params.SetInterpolationTimeS(5.2);
params.SetOnScreen(true);
ParameterSet othervalues = params.GetOtherValues();
params.SetOtherValues(othervalues.Set("other1", 1).Set("other2", "2"));
// set object parameters
bf->GetObjectParameters() = params;
}
else fprintf(stderr, "Failed to create audioBlockFormat (t: %u, i: %u)\n", t, i);
//.........这里部分代码省略.........