mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-01-20 23:04:59 +01:00
Added subsSplit global settings to keep different subcollections separated
in the menu. Added clearInputClear support for playlist change.
This commit is contained in:
parent
445fd7ae6e
commit
39671bcee5
@ -44,6 +44,7 @@ CollectionInfo::CollectionInfo(std::string name,
|
|||||||
, saveRequest(false)
|
, saveRequest(false)
|
||||||
, metadataType(metadataType)
|
, metadataType(metadataType)
|
||||||
, menusort(true)
|
, menusort(true)
|
||||||
|
, subsSplit(false)
|
||||||
, metadataPath_(metadataPath)
|
, metadataPath_(metadataPath)
|
||||||
, extensions_(extensions)
|
, extensions_(extensions)
|
||||||
{
|
{
|
||||||
@ -158,6 +159,13 @@ void CollectionInfo::extensionList(std::vector<std::string> &extensionlist)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string CollectionInfo::lowercaseName()
|
||||||
|
{
|
||||||
|
std::string lcstr = name;
|
||||||
|
std::transform(lcstr.begin(), lcstr.end(), lcstr.begin(), ::tolower);
|
||||||
|
return lcstr;
|
||||||
|
}
|
||||||
|
|
||||||
void CollectionInfo::addSubcollection(CollectionInfo *newinfo)
|
void CollectionInfo::addSubcollection(CollectionInfo *newinfo)
|
||||||
{
|
{
|
||||||
items.insert(items.begin(), newinfo->items.begin(), newinfo->items.end());
|
items.insert(items.begin(), newinfo->items.begin(), newinfo->items.end());
|
||||||
@ -168,6 +176,8 @@ bool CollectionInfo::itemIsLess(Item *lhs, Item *rhs)
|
|||||||
if(lhs->leaf && !rhs->leaf) return true;
|
if(lhs->leaf && !rhs->leaf) return true;
|
||||||
if(!lhs->leaf && rhs->leaf) return false;
|
if(!lhs->leaf && rhs->leaf) return false;
|
||||||
if(!lhs->collectionInfo->menusort && lhs->leaf && rhs->leaf) return false;
|
if(!lhs->collectionInfo->menusort && lhs->leaf && rhs->leaf) return false;
|
||||||
|
if(lhs->collectionInfo->subsSplit && lhs->collectionInfo != rhs->collectionInfo)
|
||||||
|
return lhs->collectionInfo->lowercaseName() < rhs->collectionInfo->lowercaseName();
|
||||||
return lhs->lowercaseFullTitle() < rhs->lowercaseFullTitle();
|
return lhs->lowercaseFullTitle() < rhs->lowercaseFullTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,7 @@ public:
|
|||||||
void addSubcollection(CollectionInfo *info);
|
void addSubcollection(CollectionInfo *info);
|
||||||
void extensionList(std::vector<std::string> &extensions);
|
void extensionList(std::vector<std::string> &extensions);
|
||||||
std::string name;
|
std::string name;
|
||||||
|
std::string lowercaseName();
|
||||||
std::string listpath;
|
std::string listpath;
|
||||||
bool saveRequest;
|
bool saveRequest;
|
||||||
std::string metadataType;
|
std::string metadataType;
|
||||||
@ -43,6 +44,7 @@ public:
|
|||||||
Playlists_T playlists;
|
Playlists_T playlists;
|
||||||
|
|
||||||
bool menusort;
|
bool menusort;
|
||||||
|
bool subsSplit;
|
||||||
private:
|
private:
|
||||||
std::string metadataPath_;
|
std::string metadataPath_;
|
||||||
std::string extensions_;
|
std::string extensions_;
|
||||||
|
|||||||
@ -481,6 +481,15 @@ void RetroFE::run( )
|
|||||||
case RETROFE_PLAYLIST_ENTER:
|
case RETROFE_PLAYLIST_ENTER:
|
||||||
if (currentPage_->isIdle( ))
|
if (currentPage_->isIdle( ))
|
||||||
{
|
{
|
||||||
|
bool collectionInputClear = false;
|
||||||
|
config_.getProperty( "collectionInputClear", collectionInputClear );
|
||||||
|
if ( collectionInputClear )
|
||||||
|
{
|
||||||
|
// Empty event queue
|
||||||
|
SDL_Event e;
|
||||||
|
while ( SDL_PollEvent( &e ) );
|
||||||
|
input_.resetStates( );
|
||||||
|
}
|
||||||
state = RETROFE_IDLE;
|
state = RETROFE_IDLE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1161,9 +1170,14 @@ Page *RetroFE::loadSplashPage( )
|
|||||||
CollectionInfo *RetroFE::getCollection(std::string collectionName)
|
CollectionInfo *RetroFE::getCollection(std::string collectionName)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Check if subcollections should be merged or split
|
||||||
|
bool subsSplit = false;
|
||||||
|
config_.getProperty( "subsSplit", subsSplit );
|
||||||
|
|
||||||
// Build the collection
|
// Build the collection
|
||||||
CollectionInfoBuilder cib(config_, *metadb_);
|
CollectionInfoBuilder cib(config_, *metadb_);
|
||||||
CollectionInfo *collection = cib.buildCollection( collectionName );
|
CollectionInfo *collection = cib.buildCollection( collectionName );
|
||||||
|
collection->subsSplit = subsSplit;
|
||||||
cib.injectMetadata( collection );
|
cib.injectMetadata( collection );
|
||||||
|
|
||||||
DIR *dp;
|
DIR *dp;
|
||||||
@ -1191,6 +1205,7 @@ CollectionInfo *RetroFE::getCollection(std::string collectionName)
|
|||||||
|
|
||||||
CollectionInfo *subcollection = cib.buildCollection( basename, collectionName );
|
CollectionInfo *subcollection = cib.buildCollection( basename, collectionName );
|
||||||
collection->addSubcollection( subcollection );
|
collection->addSubcollection( subcollection );
|
||||||
|
subcollection->subsSplit = subsSplit;
|
||||||
cib.injectMetadata( subcollection );
|
cib.injectMetadata( subcollection );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1206,7 +1221,7 @@ CollectionInfo *RetroFE::getCollection(std::string collectionName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MenuParser mp;
|
MenuParser mp;
|
||||||
mp.buildMenuItems( collection, menuSort );
|
mp.buildMenuItems( collection, menuSort);
|
||||||
|
|
||||||
cib.addPlaylists( collection );
|
cib.addPlaylists( collection );
|
||||||
collection->sortPlaylists( );
|
collection->sortPlaylists( );
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
std::string retrofe_version_major = "0";
|
std::string retrofe_version_major = "0";
|
||||||
std::string retrofe_version_minor = "8";
|
std::string retrofe_version_minor = "8";
|
||||||
std::string retrofe_version_build = "15b8";
|
std::string retrofe_version_build = "15b10";
|
||||||
|
|
||||||
|
|
||||||
std::string Version::getString( )
|
std::string Version::getString( )
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user