media library: change data fetch delay to 250ms

This commit is contained in:
Andrzej Rybczak
2014-08-31 11:11:40 +02:00
parent 44302aee47
commit 301de2a4fe
2 changed files with 12 additions and 1 deletions

View File

@@ -47,7 +47,8 @@ MediaLibrary *myLibrary;
namespace {
const auto fetch_delay = boost::posix_time::milliseconds(500);
const auto ml_wtimeout = 250;
const auto fetch_delay = boost::posix_time::milliseconds(ml_wtimeout);
bool hasTwoColumns;
size_t itsLeftColStartX;
@@ -422,6 +423,14 @@ void MediaLibrary::update()
}
}
int MediaLibrary::windowTimeout()
{
if (Albums.reallyEmpty() || Songs.reallyEmpty())
return ml_wtimeout;
else
return Screen<WindowType>::windowTimeout();
}
void MediaLibrary::enterPressed()
{
AddToPlaylist(true);

View File

@@ -37,6 +37,8 @@ struct MediaLibrary: Screen<NC::Window *>, Filterable, HasColumns, HasSongs, Sea
virtual void refresh() OVERRIDE;
virtual void update() OVERRIDE;
virtual int windowTimeout() OVERRIDE;
virtual void enterPressed() OVERRIDE;
virtual void spacePressed() OVERRIDE;
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;