mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-02-16 21:35:58 +00:00
- lowercase style parsing implemented (or put back?)
- alpha sorted preset file entries git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@370 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
@ -13,6 +13,8 @@
|
||||
#include "Preset.hpp"
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <set>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <errno.h>
|
||||
@ -68,6 +70,7 @@ void PresetLoader::rescan()
|
||||
}
|
||||
|
||||
struct dirent * dir_entry;
|
||||
std::set<std::string> alphaSortedFileSet;
|
||||
|
||||
while ((dir_entry = readdir(m_dir)) != NULL)
|
||||
{
|
||||
@ -87,13 +90,15 @@ void PresetLoader::rescan()
|
||||
// Create full path name
|
||||
out << m_dirname << PATH_SEPARATOR << filename;
|
||||
|
||||
// std::cerr << "[PresetLoader]" << filename << std::endl;
|
||||
// Add to our directory entry collection
|
||||
m_entries.push_back(out.str());
|
||||
alphaSortedFileSet.insert(out.str());
|
||||
|
||||
// the directory entry struct is freed elsewhere
|
||||
}
|
||||
|
||||
// Push all entries in order from the file set to the file entries member (which is an indexed vector)
|
||||
for (std::set<std::string>::iterator pos = alphaSortedFileSet.begin(); pos != alphaSortedFileSet.end();++pos)
|
||||
m_entries.push_back(*pos);
|
||||
}
|
||||
|
||||
std::auto_ptr<Preset> PresetLoader::loadPreset(unsigned int index, const PresetInputs & presetInputs, PresetOutputs & presetOutputs) const
|
||||
|
||||
Reference in New Issue
Block a user