当前位置: 首页>>代码示例>>C++>>正文


C++ StringPairArray::getValue方法代码示例

本文整理汇总了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);
        }
    }
}
开发者ID:EQ4,项目名称:editor,代码行数:25,代码来源:juce_AiffAudioFormat.cpp

示例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);
                }
            }
        }
开发者ID:Sentinel77,项目名称:dexed,代码行数:28,代码来源:juce_AiffAudioFormat.cpp

示例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;
}
开发者ID:EQ4,项目名称:editor,代码行数:27,代码来源:juce_AiffAudioFormat.cpp

示例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);
        }
    }
开发者ID:LeapMotionRV,项目名称:Badaboum,代码行数:10,代码来源:juce_LAMEEncoderAudioFormat.cpp

示例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;
}
开发者ID:UIKit0,项目名称:SFZero,代码行数:20,代码来源:SFZSample.cpp


注:本文中的StringPairArray::getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。