Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions RetroFE/Source/Graphics/Component/Component.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ class Component
virtual void setText(std::string text, int id = -1) {};
virtual void setImage(std::string filePath, int id = -1) {};
int getId( );
std::string playlistName;

protected:
Page &page;

std::string playlistName;

private:

bool animate();
Expand Down
22 changes: 18 additions & 4 deletions RetroFE/Source/Graphics/Component/ReloadableMedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,19 @@ void ReloadableMedia::freeGraphicsMemory()

void ReloadableMedia::reloadTexture()
{
std::string typeLC = Utils::toLower(type_);
Item* selectedItem = page.getSelectedItem(displayOffset_);

if(loadedComponent_)
{
delete loadedComponent_;
loadedComponent_ = NULL;
// delete image/video/text if no selected Item, or if not a playlist type or playlists are different
if (!selectedItem || !(typeLC.rfind("playlist", 0) == 0 && (page.getPlaylistName() == loadedComponent_->playlistName)))
{
delete loadedComponent_;
loadedComponent_ = NULL;
}
}

Item *selectedItem = page.getSelectedItem(displayOffset_);
if(!selectedItem) return;

config_.getProperty("currentCollection", currentCollection_);
Expand All @@ -138,7 +144,6 @@ void ReloadableMedia::reloadTexture()
names.push_back(selectedItem->cloneof);
}

std::string typeLC = Utils::toLower(type_);
if (typeLC == "isfavorite")
{
if (selectedItem->isFavorite)
Expand Down Expand Up @@ -169,6 +174,13 @@ void ReloadableMedia::reloadTexture()
for(unsigned int n = 0; n < names.size() && !loadedComponent_; ++n)
{
std::string basename = names[n];

// support reloadable video based on playlist# type
if (basename != "default" && typeLC.rfind("playlist", 0) == 0)
{
basename = page.getPlaylistName();
}

if(systemMode_)
{

Expand Down Expand Up @@ -229,6 +241,7 @@ void ReloadableMedia::reloadTexture()

if(loadedComponent_)
{
loadedComponent_->playlistName = page.getPlaylistName();
loadedComponent_->allocateGraphicsMemory();
baseViewInfo.ImageWidth = loadedComponent_->baseViewInfo.ImageWidth;
baseViewInfo.ImageHeight = loadedComponent_->baseViewInfo.ImageHeight;
Expand Down Expand Up @@ -404,6 +417,7 @@ void ReloadableMedia::reloadTexture()

if (loadedComponent_ != NULL)
{
loadedComponent_->playlistName = page.getPlaylistName();
loadedComponent_->allocateGraphicsMemory();
baseViewInfo.ImageWidth = loadedComponent_->baseViewInfo.ImageWidth;
baseViewInfo.ImageHeight = loadedComponent_->baseViewInfo.ImageHeight;
Expand Down