本文整理汇总了C++中frm_dir_map_t类的典型用法代码示例。如果您正苦于以下问题:C++ frm_dir_map_t类的具体用法?C++ frm_dir_map_t怎么用?C++ frm_dir_map_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了frm_dir_map_t类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetMap
void CommBreakMap::GetMap(frm_dir_map_t &map) const
{
QMutexLocker locker(&commBreakMapLock);
map.clear();
map = commBreakMap;
map.detach();
}
开发者ID:drescherjm,项目名称:mythtv,代码行数:7,代码来源:commbreakmap.cpp
示例2: if
// Convert from a "relative" (cutlist-adjusted) value to its
// "absolute" (not cutlist-adjusted) mapped value. Usually the
// position argument is in milliseconds, the map argument maps frames
// to milliseconds, the fallback_ratio is 1000/framerate_fps, and the
// return value is also in milliseconds. Upon return, if necessary,
// the result may need a separate, non-cutlist adjusted conversion
// from milliseconds to frame number, using the inverse
// millisecond-to-frame map and the inverse fallback_ratio; see for
// example TranslatePositionMsToFrame().
//
// If the map and fallback_ratio arguments are omitted, it simply
// converts from a relatve (cutlist-adjusted) frame number to an
// absolute frame number.
uint64_t
DecoderBase::TranslatePositionRelToAbs(const frm_dir_map_t &deleteMap,
uint64_t relPosition, // ms
const frm_pos_map_t &map, // frame->ms
float fallback_ratio)
{
uint64_t addition = 0;
uint64_t startOfCutRegion = 0;
bool withinCut = false;
bool first = true;
for (frm_dir_map_t::const_iterator i = deleteMap.begin();
i != deleteMap.end(); ++i)
{
if (first)
withinCut = (i.value() == MARK_CUT_END);
first = false;
uint64_t mappedKey = TranslatePosition(map, i.key(), fallback_ratio);
if (i.value() == MARK_CUT_START && !withinCut)
{
withinCut = true;
startOfCutRegion = mappedKey;
if (relPosition + addition <= startOfCutRegion)
break;
}
else if (i.value() == MARK_CUT_END && withinCut)
{
withinCut = false;
addition += (mappedKey - startOfCutRegion);
}
}
return relPosition + addition;
}
开发者ID:DragonStalker,项目名称:mythtv,代码行数:45,代码来源:decoderbase.cpp
示例3: SetMap
void CommBreakMap::SetMap(const frm_dir_map_t &newMap, uint64_t framesPlayed)
{
QMutexLocker locker(&m_commBreakMapLock);
LOG(VB_COMMFLAG, LOG_INFO, LOC +
QString("Setting New Commercial Break List, old size %1, new %2")
.arg(m_commBreakMap.size()).arg(newMap.size()));
m_commBreakMap.clear();
m_commBreakMap = newMap;
m_hascommbreaktable = !m_commBreakMap.isEmpty();
SetTracker(framesPlayed);
}
开发者ID:tomhughes,项目名称:mythtv,代码行数:12,代码来源:commbreakmap.cpp
示例4: streamOutCommercialBreakList
static void streamOutCommercialBreakList(
ostream &output, const frm_dir_map_t &commercialBreakList)
{
if (progress)
output << "----------------------------" << endl;
if (commercialBreakList.empty())
{
if (progress)
output << "No breaks" << endl;
}
else
{
frm_dir_map_t::const_iterator it = commercialBreakList.begin();
for (; it != commercialBreakList.end(); ++it)
{
output << "framenum: " << it.key() << "\tmarktype: " << *it
<< endl;
}
}
if (progress)
output << "----------------------------" << endl;
}
开发者ID:JGunning,项目名称:OpenAOL-TV,代码行数:24,代码来源:main.cpp
示例5: SetRegions
void OSD::SetRegions(const QString &window, frm_dir_map_t &map,
long long total)
{
MythScreenType *win = GetWindow(window);
if (!win)
return;
MythUIEditBar *bar = dynamic_cast<MythUIEditBar*>(win->GetChild("editbar"));
if (!bar)
return;
bar->ClearRegions();
if (!map.size() || total < 1)
{
bar->Display();
return;
}
long long start = -1;
long long end = -1;
bool first = true;
QMapIterator<uint64_t, MarkTypes> it(map);
while (it.hasNext())
{
bool error = false;
it.next();
if (it.value() == MARK_CUT_START)
{
start = it.key();
if (end > -1)
error = true;
}
else if (it.value() == MARK_CUT_END)
{
if (first)
start = 0;
if (start < 0)
error = true;
end = it.key();
}
else if (it.value() == MARK_PLACEHOLDER)
{
start = end = it.key();
}
first = false;
if (error)
{
LOG(VB_GENERAL, LOG_ERR, LOC + "deleteMap discontinuity");
start = -1;
end = -1;
}
if (start >=0 && end >= 0)
{
bar->AddRegion((float)((double)start/(double)total),
(float)((double)end/(double)total));
start = -1;
end = -1;
}
}
if (start > -1 && end < 0)
bar->AddRegion((float)((double)start/(double)total), 1.0f);
bar->Display();
}
开发者ID:jshattoc,项目名称:mythtv,代码行数:66,代码来源:osd.cpp
示例6: GetMap
void CommBreakMap::GetMap(frm_dir_map_t &map) const
{
QMutexLocker locker(&m_commBreakMapLock);
map.clear();
map = m_commBreakMap;
}
开发者ID:tomhughes,项目名称:mythtv,代码行数:6,代码来源:commbreakmap.cpp
注:本文中的frm_dir_map_t类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论