本文整理汇总了C++中ZipFile::createStreamForEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ ZipFile::createStreamForEntry方法的具体用法?C++ ZipFile::createStreamForEntry怎么用?C++ ZipFile::createStreamForEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZipFile
的用法示例。
在下文中一共展示了ZipFile::createStreamForEntry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createSVGDrawable
void createSVGDrawable()
{
lastSVGLoadTime = Time::getCurrentTime();
MemoryInputStream iconsFileStream (BinaryData::icons_zip, BinaryData::icons_zipSize, false);
ZipFile icons (&iconsFileStream, false);
// Load a random SVG file from our embedded icons.zip file.
const ScopedPointer<InputStream> svgFileStream (icons.createStreamForEntry (Random::getSystemRandom().nextInt (icons.getNumEntries())));
if (svgFileStream != nullptr)
{
svgDrawable = dynamic_cast <DrawableComposite*> (Drawable::createFromImageDataStream (*svgFileStream));
if (svgDrawable != nullptr)
{
// to make our icon the right size, we'll set its bounding box to the size and position that we want.
svgDrawable->setBoundingBox (RelativeParallelogram (Point<float> (-100, -100),
Point<float> (100, -100),
Point<float> (-100, 100)));
}
}
}
示例2: createSVGDrawable
Drawable* ResourceLoader::createSVGDrawable(const String& filename)
{
initObjectIconMap();
if (iconsFromZipFile.size() == 0)
{
// If we've not already done so, load all the images from the zip file..
MemoryInputStream iconsFileStream (BinaryData::icons_zip, BinaryData::icons_zipSize, false);
ZipFile icons (&iconsFileStream, false);
for (int i = 0; i < icons.getNumEntries(); ++i)
{
ScopedPointer<InputStream> svgFileStream (icons.createStreamForEntry (i));
if (svgFileStream != 0)
{
iconNames.add (icons.getEntry(i)->filename);
iconsFromZipFile.add (Drawable::createFromImageDataStream (*svgFileStream));
}
}
}
return iconsFromZipFile [iconNames.indexOf (filename)];//->createCopy();
}
示例3: iconsFileStream
//==============================================================================
PreferencesPane::PreferencesPane (const Value& loudnessBarWidth,
const Value& loudnessBarMinValue,
const Value& loudnessBarMaxValue,
const Value& showIntegratedLoudnessHistoryValue,
const Value& showLoudnessRangeHistoryValue,
const Value& showShortTermLoudnessHistoryValue,
const Value& showMomentaryLoudnessHistoryValue)
: loudnessHistoryGroup (String::empty, "History Graph"),
showIntegratedLoudnessHistory ("I"),
showLoudnessRangeHistory("LRA"),
showShortTimeLoudnessHistory ("S"),
showMomentaryLoudnessHistory ("M")
{
// Get the icons from the embedded zip.
// ------------------------------------
// Source: JuceDemo WidgetsDemo.cpp:616
StringArray iconNames;
OwnedArray<Drawable> iconsFromZipFile;
const bool dontKeepInternalCopyOfData = false;
MemoryInputStream iconsFileStream (BinaryData::icons_zip, BinaryData::icons_zipSize, dontKeepInternalCopyOfData);
const bool dontDeleteStreamWhenDestroyed = false;
ZipFile icons (&iconsFileStream, dontDeleteStreamWhenDestroyed);
for (int i = 0; i < icons.getNumEntries(); ++i)
{
ScopedPointer<InputStream> svgFileStream (icons.createStreamForEntry (i));
if (svgFileStream != 0)
{
// DBG(icons.getEntry(i)->filename);
iconNames.add (icons.getEntry(i)->filename);
iconsFromZipFile.add (Drawable::createFromImageDataStream (*svgFileStream));
}
}
ScopedPointer<DrawableComposite> wrench = dynamic_cast <DrawableComposite*> (iconsFromZipFile [iconNames.indexOf ("wrenchByIonicons.svg")]->createCopy());
AnimatedSidePanel::setCaptionAndIcon("Preferences", wrench);
loudnessBarSizeLeftIcon = dynamic_cast <DrawableComposite*> (iconsFromZipFile [iconNames.indexOf ("barsWide.svg")]->createCopy());
addAndMakeVisible (loudnessBarSizeLeftIcon);
loudnessBarSizeRightIcon = dynamic_cast <DrawableComposite*> (iconsFromZipFile [iconNames.indexOf ("barsNarrow.svg")]->createCopy());
addAndMakeVisible (loudnessBarSizeRightIcon);
loudnessBarRangeLeftIcon = dynamic_cast <DrawableComposite*> (iconsFromZipFile [iconNames.indexOf ("rangeArrow.svg")]->createCopy());
addAndMakeVisible (loudnessBarRangeLeftIcon);
resized();
const bool isReadOnly = false;
const int textEntryBoxWidth = 0;
const int textEntryBoxHeight = 0;
loudnessBarSize.setRange (-300.0, -5.0, 1.0); // This value multiplied by -1 results in the used with
// for each loudness bar. Negative values have been chosen to invert the behaviour of the slider
// (left side: big bars, right side: small bars).
loudnessBarSize.getValueObject().referTo(loudnessBarWidth);
loudnessBarSize.setTextBoxStyle(Slider::NoTextBox, isReadOnly, textEntryBoxWidth, textEntryBoxHeight);
loudnessBarSize.setColour(Slider::trackColourId, Colours::black);
addAndMakeVisible (&loudnessBarSize);
loudnessBarRange.setRange (-100, 0.0, 1.0);
loudnessBarRange.getMinValueObject().referTo (loudnessBarMinValue);
loudnessBarRange.getMaxValueObject().referTo (loudnessBarMaxValue);
loudnessBarRange.setTextBoxStyle (Slider::NoTextBox, isReadOnly, textEntryBoxWidth, textEntryBoxHeight);
loudnessBarRange.setPopupDisplayEnabled (true, this);
loudnessBarRange.setTextValueSuffix (" LUFS");
addAndMakeVisible (&loudnessBarRange);
addAndMakeVisible (&loudnessHistoryGroup);
showIntegratedLoudnessHistory.setClickingTogglesState (true);
showIntegratedLoudnessHistory.getToggleStateValue().referTo (showIntegratedLoudnessHistoryValue);
showIntegratedLoudnessHistory.setWantsKeyboardFocus (false);
loudnessHistoryGroup.addAndMakeVisible (&showIntegratedLoudnessHistory);
showLoudnessRangeHistory.setClickingTogglesState (true);
showLoudnessRangeHistory.getToggleStateValue().referTo (showLoudnessRangeHistoryValue);
showLoudnessRangeHistory.setWantsKeyboardFocus (false);
loudnessHistoryGroup.addAndMakeVisible (&showLoudnessRangeHistory);
showShortTimeLoudnessHistory.setClickingTogglesState (true);
showShortTimeLoudnessHistory.getToggleStateValue().referTo (showShortTermLoudnessHistoryValue);
showShortTimeLoudnessHistory.setWantsKeyboardFocus (false);
loudnessHistoryGroup.addAndMakeVisible (&showShortTimeLoudnessHistory);
showMomentaryLoudnessHistory.setClickingTogglesState (true);
showMomentaryLoudnessHistory.getToggleStateValue().referTo (showMomentaryLoudnessHistoryValue);
showMomentaryLoudnessHistory.setWantsKeyboardFocus (false);
loudnessHistoryGroup.addAndMakeVisible (&showMomentaryLoudnessHistory);
// Colours
// -------
setBackgroundColour (Colours::white.withAlpha (0.5f));
loudnessBarSize.setColour (Slider::thumbColourId, Colours::black);
loudnessBarRange.setColour (Slider::thumbColourId, Colours::black);
//.........这里部分代码省略.........