本文整理汇总了C++中VideoMetadataListManager::setList方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoMetadataListManager::setList方法的具体用法?C++ VideoMetadataListManager::setList怎么用?C++ VideoMetadataListManager::setList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoMetadataListManager
的用法示例。
在下文中一共展示了VideoMetadataListManager::setList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildFsysList
void VideoListImp::buildFsysList()
{
//
// Fill metadata from directory structure
//
typedef vector<pair<QString, QString> > node_to_path_list;
node_to_path_list node_paths;
QStringList dirs = GetVideoDirs();
if (dirs.size() > 1)
{
for (QStringList::const_iterator iter = dirs.begin();
iter != dirs.end(); ++iter)
{
node_paths.push_back(
node_to_path_list::value_type(path_to_node_name(*iter),
*iter));
}
}
else
{
node_paths.push_back(
node_to_path_list::value_type(QObject::tr("videos"), dirs[0]));
}
//
// Add all root-nodes to the tree.
//
metadata_list ml;
for (node_to_path_list::iterator p = node_paths.begin();
p != node_paths.end(); ++p)
{
smart_dir_node root = m_metadata_tree.addSubDir(p->second, p->first);
root->setPathRoot();
buildFileList(root, ml, p->second);
}
// retrieve any MediaServer data that may be available
if (UPNPScanner::Instance())
UPNPScanner::Instance()->GetInitialMetadata(&ml, &m_metadata_tree);
// See if we can find this filename in DB
if (m_LoadMetaData)
{
// Load the DB data so metadata lookups work
// TODO: ugly, pass the list
VideoMetadataListManager mdlm;
metadata_list db_metadata;
VideoMetadataListManager::loadAllFromDatabase(db_metadata);
mdlm.setList(db_metadata);
for (metadata_list::iterator p = ml.begin(); p != ml.end(); ++p)
{
(*p)->FillDataFromFilename(mdlm);
}
}
m_metadata.setList(ml);
}
示例2: buildTVList
void VideoListImp::buildTVList(void)
{
metadata_list ml;
VideoMetadataListManager::loadAllFromDatabase(ml);
m_metadata.setList(ml);
metadata_view_list mlist;
mlist.reserve(m_metadata.getList().size());
back_insert_iterator<metadata_view_list> mli(mlist);
transform(m_metadata.getList().begin(), m_metadata.getList().end(),
mli, to_metadata_ptr());
metadata_path_sort mps(true);
sort(mlist.begin(), mlist.end(), mps);
typedef map<QString, meta_dir_node *> group_to_node_map;
group_to_node_map gtnm;
meta_dir_node *video_root = &m_metadata_tree;
smart_dir_node sdn = video_root->addSubDir(QObject::tr("Television"));
meta_dir_node* television_node = sdn.get();
smart_dir_node vdn = video_root->addSubDir(QObject::tr("Movies"));
meta_dir_node* movie_node = vdn.get();
for (metadata_view_list::iterator p = mlist.begin(); p != mlist.end(); ++p)
{
VideoMetadata *data = *p;
if (((*p)->GetSeason() > 0) || ((*p)->GetEpisode() > 0))
{
smart_dir_node sdn = television_node->addSubDir((*p)->GetTitle());
meta_dir_node* title_node = sdn.get();
smart_dir_node ssdn = title_node->addSubDir(
QObject::tr("Season %1").arg((*p)->GetSeason()));
meta_dir_node* season_node = ssdn.get();
season_node->addEntry(smart_meta_node(new meta_data_node(data)));
}
else
movie_node->addEntry(smart_meta_node(new meta_data_node(data)));
}
}
示例3: buildDbList
void VideoListImp::buildDbList()
{
metadata_list ml;
VideoMetadataListManager::loadAllFromDatabase(ml);
m_metadata.setList(ml);
metadata_view_list mlist;
mlist.reserve(m_metadata.getList().size());
back_insert_iterator<metadata_view_list> mli(mlist);
transform(m_metadata.getList().begin(), m_metadata.getList().end(),
mli, to_metadata_ptr());
// print_meta_list(mlist);
metadata_path_sort mps(true);
sort(mlist.begin(), mlist.end(), mps);
// TODO: break out the prefix in the DB so this isn't needed
typedef map<QString, meta_dir_node *> prefix_to_node_map;
prefix_to_node_map ptnm;
QStringList dirs = GetVideoDirs();
if (dirs.isEmpty())
return;
QString test_prefix(dirs[0]);
meta_dir_node *video_root = &m_metadata_tree;
if (dirs.size() == 1)
{
video_root->setPathRoot();
video_root->setPath(test_prefix);
video_root->setName("videos");
ptnm.insert(prefix_to_node_map::value_type(test_prefix, video_root));
}
for (metadata_view_list::iterator p = mlist.begin(); p != mlist.end(); ++p)
{
AddMetadataToDir(*p, video_root);
}
// print_dir_tree(m_metadata_tree); // AEW DEBUG
}
示例4: fillMetadata
void VideoListImp::fillMetadata(metadata_list_type whence)
{
if (m_metadata_list_type != whence)
{
m_metadata_list_type = whence;
// flush existing data
metadata_list ml;
m_metadata.setList(ml);
m_metadata_tree.clear();
switch (whence)
{
case ltFileSystem:
buildFsysList();
break;
case ltDBMetadata:
buildDbList();
break;
case ltTVMetadata:
buildTVList();
break;
case ltDBGenreGroup:
case ltDBCategoryGroup:
case ltDBYearGroup:
case ltDBDirectorGroup:
case ltDBStudioGroup:
case ltDBCastGroup:
case ltDBUserRatingGroup:
case ltDBInsertDateGroup:
buildGroupList(whence);
break;
case ltNone:
break;
}
}
}
示例5: buildGroupList
void VideoListImp::buildGroupList(metadata_list_type whence)
{
metadata_list ml;
VideoMetadataListManager::loadAllFromDatabase(ml);
m_metadata.setList(ml);
metadata_view_list mlist;
mlist.reserve(m_metadata.getList().size());
back_insert_iterator<metadata_view_list> mli(mlist);
transform(m_metadata.getList().begin(), m_metadata.getList().end(),
mli, to_metadata_ptr());
metadata_path_sort mps(true);
sort(mlist.begin(), mlist.end(), mps);
typedef map<QString, meta_dir_node *> group_to_node_map;
group_to_node_map gtnm;
meta_dir_node *video_root = &m_metadata_tree;
smart_dir_node sdn = video_root->addSubDir("All");
meta_dir_node* all_group_node = sdn.get();
for (metadata_view_list::iterator p = mlist.begin(); p != mlist.end(); ++p)
{
VideoMetadata *data = *p;
all_group_node->addEntry(smart_meta_node(new meta_data_node(data)));
vector<QString> groups;
switch (whence)
{
case ltDBGenreGroup:
{
vector<pair <int, QString> > genres =
data->GetGenres();
for (vector<pair <int, QString> >::iterator i =
genres.begin(); i != genres.end(); ++i)
{
pair<int, QString> item = *i;
groups.push_back(item.second);
}
break;
}
case ltDBCategoryGroup:
{
groups.push_back(data->GetCategory());
break;
}
case ltDBYearGroup:
{
groups.push_back(QString::number(data->GetYear()));
break;
}
case ltDBDirectorGroup:
{
groups.push_back(data->GetDirector());
break;
}
case ltDBStudioGroup:
{
groups.push_back(data->GetStudio());
break;
}
case ltDBCastGroup:
{
vector<pair<int, QString> > cast = data->GetCast();
for (vector<pair<int, QString> >::iterator i =
cast.begin(); i != cast.end(); ++i)
{
pair<int, QString> item = *i;
groups.push_back(item.second);
}
break;
}
case ltDBUserRatingGroup:
{
int i = data->GetUserRating();
groups.push_back(QString::number(i));
break;
}
case ltDBInsertDateGroup:
{
QDate date = data->GetInsertdate();
QString tmp = MythDate::toString(
date, MythDate::kDateFull | MythDate::kSimplify);
groups.push_back(tmp);
break;
}
default:
{
LOG(VB_GENERAL, LOG_ERR, "Invalid type of grouping");
break;
}
}
//.........这里部分代码省略.........