本文整理汇总了C++中CFileBrowser::getSelectedFiles方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileBrowser::getSelectedFiles方法的具体用法?C++ CFileBrowser::getSelectedFiles怎么用?C++ CFileBrowser::getSelectedFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileBrowser
的用法示例。
在下文中一共展示了CFileBrowser::getSelectedFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plugin_exec
void plugin_exec(void)
{
CFileBrowser fileBrowser;
CFileFilter fileFilter;
CMoviePlayerGui tmpMoviePlayerGui;
fileFilter.addFilter("vob");
fileBrowser.Filter = &fileFilter;
fileBrowser.Multi_Select = true;
fileBrowser.Dirs_Selectable = false;
std::string Path_dvd = "/mnt/dvd";
// create mount path
safe_mkdir((char *)Path_dvd.c_str());
// mount selected iso image
char cmd[128];
sprintf(cmd, "mount -o loop /media/hdd/dvd.iso %s", (char *)Path_dvd.c_str());
system(cmd);
DVD_BROWSER:
if(fileBrowser.exec(Path_dvd.c_str()))
{
Path_dvd = fileBrowser.getCurrentDir();
CFileList::const_iterator files = fileBrowser.getSelectedFiles().begin();
for(; files != fileBrowser.getSelectedFiles().end(); files++)
{
CFile file;
file.Name = files->Name;
tmpMoviePlayerGui.addToPlaylist(file);
}
tmpMoviePlayerGui.exec(NULL, "urlplayback");
neutrino_msg_t msg;
neutrino_msg_data_t data;
g_RCInput->getMsg_ms(&msg, &data, 10);
if (msg != CRCInput::RC_home)
{
goto DVD_BROWSER;
}
}
}
示例2: testShowPictureFolder
void CTestMenu::testShowPictureFolder()
{
neutrino_msg_t msg;
neutrino_msg_data_t data;
CFileBrowser * fileBrowser;
CFileFilter fileFilter;
CFileList filelist;
int selected = 0;
fileFilter.addFilter("png");
fileFilter.addFilter("bmp");
fileFilter.addFilter("jpg");
fileFilter.addFilter("jpeg");
fileBrowser = new CFileBrowser();
fileBrowser->Multi_Select = true;
fileBrowser->Dirs_Selectable = true;
fileBrowser->Filter = &fileFilter;
std::string Path_local = g_settings.network_nfs_audioplayerdir;
BROWSER:
if (fileBrowser->exec(Path_local.c_str()))
{
Path_local = fileBrowser->getCurrentDir();
CPictureViewerGui tmpPictureViewerGui;
CPicture pic;
struct stat statbuf;
CFileList::const_iterator files = fileBrowser->getSelectedFiles().begin();
for(; files != fileBrowser->getSelectedFiles().end(); files++)
{
if (files->getType() == CFile::FILE_PICTURE)
{
pic.Filename = files->Name;
std::string tmp = files->Name.substr(files->Name.rfind('/') + 1);
pic.Name = tmp.substr(0, tmp.rfind('.'));
pic.Type = tmp.substr(tmp.rfind('.') + 1);
if(stat(pic.Filename.c_str(), &statbuf) != 0)
printf("stat error");
pic.Date = statbuf.st_mtime;
tmpPictureViewerGui.addToPlaylist(pic);
}
}
tmpPictureViewerGui.exec(NULL, "urlplayback");
g_RCInput->getMsg_ms(&msg, &data, 10); // 1 sec
if (msg != CRCInput::RC_home)
{
goto BROWSER;
}
}
delete fileBrowser;
}
示例3: testPlayAudioFolder
void CTestMenu::testPlayAudioFolder()
{
neutrino_msg_t msg;
neutrino_msg_data_t data;
CFileBrowser * fileBrowser;
CFileFilter fileFilter;
CFileList filelist;
fileFilter.addFilter("cdr");
fileFilter.addFilter("mp3");
fileFilter.addFilter("m2a");
fileFilter.addFilter("mpa");
fileFilter.addFilter("mp2");
fileFilter.addFilter("ogg");
fileFilter.addFilter("wav");
fileFilter.addFilter("flac");
fileFilter.addFilter("aac");
fileFilter.addFilter("dts");
fileFilter.addFilter("m4a");
fileBrowser = new CFileBrowser();
fileBrowser->Multi_Select = true;
fileBrowser->Dirs_Selectable = false;
fileBrowser->Filter = &fileFilter;
std::string Path_local = g_settings.network_nfs_audioplayerdir;
BROWSER:
if (fileBrowser->exec(Path_local.c_str()))
{
Path_local = fileBrowser->getCurrentDir();
CAudioPlayerGui tmpAudioPlayerGui;
CFileList::const_iterator files = fileBrowser->getSelectedFiles().begin();
for(; files != fileBrowser->getSelectedFiles().end(); files++)
{
if ( (files->getExtension() == CFile::EXTENSION_CDR)
|| (files->getExtension() == CFile::EXTENSION_MP3)
|| (files->getExtension() == CFile::EXTENSION_WAV)
|| (files->getExtension() == CFile::EXTENSION_FLAC)
)
{
CAudiofileExt audiofile(files->Name, files->getExtension());
tmpAudioPlayerGui.addToPlaylist(audiofile);
}
}
tmpAudioPlayerGui.exec(NULL, "urlplayback");
g_RCInput->getMsg_ms(&msg, &data, 10); // 1 sec
if (msg != CRCInput::RC_home)
{
goto BROWSER;
}
}
delete fileBrowser;
}