diff --git a/RetroFE/Source/Collection/CollectionInfo.cpp b/RetroFE/Source/Collection/CollectionInfo.cpp index d07db47..eeac63e 100644 --- a/RetroFE/Source/Collection/CollectionInfo.cpp +++ b/RetroFE/Source/Collection/CollectionInfo.cpp @@ -44,6 +44,7 @@ CollectionInfo::CollectionInfo(std::string name, , saveRequest(false) , metadataType(metadataType) , menusort(true) + , subsSplit(false) , metadataPath_(metadataPath) , extensions_(extensions) { @@ -158,6 +159,13 @@ void CollectionInfo::extensionList(std::vector &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) { 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 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(); } diff --git a/RetroFE/Source/Collection/CollectionInfo.h b/RetroFE/Source/Collection/CollectionInfo.h index 1f52389..4620e73 100644 --- a/RetroFE/Source/Collection/CollectionInfo.h +++ b/RetroFE/Source/Collection/CollectionInfo.h @@ -33,6 +33,7 @@ public: void addSubcollection(CollectionInfo *info); void extensionList(std::vector &extensions); std::string name; + std::string lowercaseName(); std::string listpath; bool saveRequest; std::string metadataType; @@ -43,6 +44,7 @@ public: Playlists_T playlists; bool menusort; + bool subsSplit; private: std::string metadataPath_; std::string extensions_; diff --git a/RetroFE/Source/RetroFE.cpp b/RetroFE/Source/RetroFE.cpp index 1390f61..83b5453 100644 --- a/RetroFE/Source/RetroFE.cpp +++ b/RetroFE/Source/RetroFE.cpp @@ -481,6 +481,15 @@ void RetroFE::run( ) case RETROFE_PLAYLIST_ENTER: 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; } break; @@ -1161,9 +1170,14 @@ Page *RetroFE::loadSplashPage( ) CollectionInfo *RetroFE::getCollection(std::string collectionName) { + // Check if subcollections should be merged or split + bool subsSplit = false; + config_.getProperty( "subsSplit", subsSplit ); + // Build the collection CollectionInfoBuilder cib(config_, *metadb_); CollectionInfo *collection = cib.buildCollection( collectionName ); + collection->subsSplit = subsSplit; cib.injectMetadata( collection ); DIR *dp; @@ -1191,6 +1205,7 @@ CollectionInfo *RetroFE::getCollection(std::string collectionName) CollectionInfo *subcollection = cib.buildCollection( basename, collectionName ); collection->addSubcollection( subcollection ); + subcollection->subsSplit = subsSplit; cib.injectMetadata( subcollection ); } } @@ -1206,7 +1221,7 @@ CollectionInfo *RetroFE::getCollection(std::string collectionName) } MenuParser mp; - mp.buildMenuItems( collection, menuSort ); + mp.buildMenuItems( collection, menuSort); cib.addPlaylists( collection ); collection->sortPlaylists( ); diff --git a/RetroFE/Source/Version.cpp b/RetroFE/Source/Version.cpp index f45fe9e..e650aab 100644 --- a/RetroFE/Source/Version.cpp +++ b/RetroFE/Source/Version.cpp @@ -21,7 +21,7 @@ std::string retrofe_version_major = "0"; std::string retrofe_version_minor = "8"; -std::string retrofe_version_build = "15b8"; +std::string retrofe_version_build = "15b10"; std::string Version::getString( )