本文整理汇总了C++中nglPath::Exists方法的典型用法代码示例。如果您正苦于以下问题:C++ nglPath::Exists方法的具体用法?C++ nglPath::Exists怎么用?C++ nglPath::Exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nglPath
的用法示例。
在下文中一共展示了nglPath::Exists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetImage
bool nuiImageDropZone::SetImage(const nglPath& rPath)
{
if (!rPath.Exists())
return false;
mPath = rPath;
mpImage->Trash();
mpImage = new nuiImage(mPath);
AddChild(mpImage);
return true;
}
示例2: ConvertCompressedAudioFile
bool ConvertCompressedAudioFile(nglPath inPath, nglPath outPath)
{
if (!inPath.Exists())
return false;
bool res = false;
//INPUT
nglIFile inFile(inPath);
nuiAudioDecoder* pDecoder = new nuiAudioDecoder(inFile);
//OUTPUT
nglOFile outFile(outPath, eOFileCreate);
nuiWaveWriter* pWriter = new nuiWaveWriter(outFile);
nuiSampleInfo inInfo;
nuiSampleInfo outInfo;
if (pDecoder->GetInfo(inInfo))
{
NGL_OUT(_T("********************************************************\Audio infos:\n"));
PrintAudioInfos(inInfo);
uint32 channels = inInfo.GetChannels();
float* pInterleavedBuffer = new float[channels * FRAMES_PACKET];
//write output samples infos
outInfo.SetChannels(inInfo.GetChannels());
outInfo.SetSampleRate(inInfo.GetSampleRate());
outInfo.SetBitsPerSample(inInfo.GetBitsPerSample());
outInfo.SetFileFormat(eAudioWave);
outInfo.SetFormatTag(eWaveFormatPcm);
pWriter->WriteInfo(outInfo);
uint32 FramesToRead = FRAMES_PACKET;
uint32 FramesRead = 0;
uint32 FramesWritten = 0;
uint32 TotalFramesRead = 0;
uint32 TotalFramesWritten = 0;
do
{
FramesRead = pDecoder->ReadIN(pInterleavedBuffer, FramesToRead);
FramesWritten = pWriter->Write(pInterleavedBuffer, FramesRead, eSampleFloat32);
TotalFramesRead += FramesRead;
TotalFramesWritten += FramesWritten;
}
while (FramesRead);
NGL_OUT(_T("SUCCESS: FILE DECOMPRESSED\n"));
NGL_OUT(_T("%ld samples read and %ld samples written\n"), TotalFramesRead, TotalFramesWritten);
//finalize wave file writing
if (!pWriter->Finalize())
NGL_OUT(_T("nuiWaveWriter: Failed to finalize!!!!!!!\n"));
delete[] pInterleavedBuffer;
res = true;
}