本文整理汇总了C++中DataStream::getEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ DataStream::getEnd方法的具体用法?C++ DataStream::getEnd怎么用?C++ DataStream::getEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataStream
的用法示例。
在下文中一共展示了DataStream::getEnd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bFoundMatch
/*override*/ Transformation::Result GenericRemover::apply(const Mp3Handler& h, const TransfConfig& transfConfig, const std::string& strOrigSrcName, std::string& strTempName)
{
const vector<DataStream*>& vpStreams (h.getStreams());
bool bFoundMatch (false);
for (int i = 0, n = cSize(vpStreams); i < n; ++i)
{
if (matches(vpStreams[i]))
{
bFoundMatch = true;
break;
}
}
if (!bFoundMatch)
{
return NOT_CHANGED;
}
//ttt2 see InnerNonAudioRemover: Lambo has an error in mplayer, because of bit reservoir
ifstream_utf8 in (h.getName().c_str(), ios::binary);
{ // comp
switch (transfConfig.getCompAction())
{
case TransfConfig::TRANSF_DONT_CREATE: break;
case TransfConfig::TRANSF_CREATE:
{
in.seekg(0);
for (int i = 0, n = cSize(vpStreams); i < n; ++i)
{
DataStream* p (vpStreams[i]);
if (matches(p))
{
MpegStream* pPrevAudio (i > 0 ? dynamic_cast<MpegStream*>(vpStreams[i - 1]) : 0);
MpegStream* pNextAudio (i < n - 1 ? dynamic_cast<MpegStream*>(vpStreams[i + 1]) : 0);
string strCompBefore;
string strCompAfter;
transfConfig.getCompNames(strOrigSrcName, getActionName(), strCompBefore, strCompAfter);
streampos posCompBeg (0 != pPrevAudio ? findNearMpegFrameAtLeft(pPrevAudio->getEnd(), in, pPrevAudio) : p->getPos());
streampos posCompEnd (0 != pNextAudio ? findNearMpegFrameAtRight(pNextAudio->getPos(), in, pNextAudio) : p->getEnd());
{ // comp before
ofstream_utf8 out (strCompBefore.c_str(), ios::binary);
appendFilePart(in, out, posCompBeg, posCompEnd - posCompBeg);
}
{ // comp after
if (0 != pPrevAudio || 0 != pNextAudio)
{
ofstream_utf8 out (strCompAfter.c_str(), ios::binary);
appendFilePart(in, out, posCompBeg, p->getPos() - posCompBeg);
appendFilePart(in, out, p->getEnd(), posCompEnd - p->getEnd());
}
}
}
}
}
break;
default: CB_ASSERT (false);
}
}
{ // temp
transfConfig.getTempName(strOrigSrcName, getActionName(), strTempName);
ofstream_utf8 out (strTempName.c_str(), ios::binary);
in.seekg(0);
for (int i = 0, n = cSize(vpStreams); i < n; ++i)
{
DataStream* pDataStream (vpStreams[i]);
if (!matches(pDataStream))
{
//qDebug("copying %d for %s", (int)pDataStream->getSize(), pDataStream->getDisplayName());
pDataStream->copy(in, out);
}
/*else
{
qDebug("skipping %d for %s", (int)pDataStream->getSize(), pDataStream->getDisplayName());
}*/
}
}
return CHANGED; // CHANGED_NO_RECALL would be ok in some cases but it's hard to tell when
}