本文整理汇总了C++中StringPairArray::getValue方法的典型用法代码示例。如果您正苦于以下问题:C++ StringPairArray::getValue方法的具体用法?C++ StringPairArray::getValue怎么用?C++ StringPairArray::getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringPairArray
的用法示例。
在下文中一共展示了StringPairArray::getValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
void create (MemoryBlock& block, const StringPairArray& values)
{
const int numNotes = values.getValue ("NumCueNotes", "0").getIntValue();
if (numNotes > 0)
{
MemoryOutputStream out (block, false);
out.writeShortBigEndian ((short) numNotes);
for (int i = 0; i < numNotes; ++i)
{
const String prefix ("CueNote" + String (i));
out.writeIntBigEndian (values.getValue (prefix + "TimeStamp", "0").getIntValue());
out.writeShortBigEndian ((short) values.getValue (prefix + "Identifier", "0").getIntValue());
const String comment (values.getValue (prefix + "Text", String::empty));
out.write (comment.toUTF8(), jmin (comment.getNumBytesAsUTF8(), 65534));
out.writeByte (0);
if ((out.getDataSize() & 1) != 0)
out.writeByte (0);
}
}
}
示例2: create
static void create (MemoryBlock& block, const StringPairArray& values)
{
auto numNotes = values.getValue ("NumCueNotes", "0").getIntValue();
if (numNotes > 0)
{
MemoryOutputStream out (block, false);
out.writeShortBigEndian ((short) numNotes);
for (int i = 0; i < numNotes; ++i)
{
auto prefix = "CueNote" + String (i);
out.writeIntBigEndian (values.getValue (prefix + "TimeStamp", "0").getIntValue());
out.writeShortBigEndian ((short) values.getValue (prefix + "Identifier", "0").getIntValue());
auto comment = values.getValue (prefix + "Text", String());
auto commentLength = jmin (comment.getNumBytesAsUTF8(), (size_t) 65534);
out.writeShortBigEndian ((short) commentLength + 1);
out.write (comment.toUTF8(), commentLength);
out.writeByte (0);
if ((out.getDataSize() & 1) != 0)
out.writeByte (0);
}
}
}
示例3: metaDataContainsZeroIdentifiers
bool metaDataContainsZeroIdentifiers (const StringPairArray& values)
{
// (zero cue identifiers are valid for WAV but not for AIFF)
const String cueString ("Cue");
const String noteString ("CueNote");
const String identifierString ("Identifier");
const StringArray& keys = values.getAllKeys();
for (int i = 0; i < keys.size(); ++i)
{
const String key (keys[i]);
if (key.startsWith (noteString))
continue; // zero identifier IS valid in a COMT chunk
if (key.startsWith (cueString) && key.contains (identifierString))
{
const int value = values.getValue (key, "-1").getIntValue();
if (value == 0)
return true;
}
}
return false;
}
示例4: addMetadataArg
void addMetadataArg (const StringPairArray& metadata, const char* key, const char* lameFlag)
{
const String value (metadata.getValue (key, String::empty));
if (value.isNotEmpty())
{
args.add (lameFlag);
args.add (value);
}
}
示例5: load
bool SFZSample::load(AudioFormatManager* formatManager)
{
AudioFormatReader* reader = formatManager->createReaderFor(file);
if (reader == NULL)
return false;
sampleRate = reader->sampleRate;
sampleLength = reader->lengthInSamples;
// Read some extra samples, which will be filled with zeros, so interpolation
// can be done without having to check for the edge all the time.
buffer = new AudioSampleBuffer(reader->numChannels, sampleLength + 4);
reader->read(buffer, 0, sampleLength + 4, 0, true, true);
StringPairArray* metadata = &reader->metadataValues;
int numLoops = metadata->getValue("NumSampleLoops", "0").getIntValue();
if (numLoops > 0) {
loopStart = metadata->getValue("Loop0Start", "0").getLargeIntValue();
loopEnd = metadata->getValue("Loop0End", "0").getLargeIntValue();
}
delete reader;
return true;
}