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


C++ nglPath::Exists方法代码示例

本文整理汇总了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;
}
开发者ID:YetToCome,项目名称:nui3,代码行数:13,代码来源:nuiImageDropZone.cpp

示例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;
  }
开发者ID:JamesLinus,项目名称:nui3,代码行数:63,代码来源:DecoderTest.cpp


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