diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2014-08-31 11:11:40 +0200 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2014-08-31 11:15:36 +0200 |
commit | 301de2a4fefa447a7f64d248ec17fac4c511e5bb (patch) | |
tree | d843d02d8a341a139d494e5021dffdf3b9f05d15 /src | |
parent | 44302aee47348c36a853e6f29ad5f80cfd3e333b (diff) |
media library: change data fetch delay to 250ms
Diffstat (limited to 'src')
-rw-r--r-- | src/media_library.cpp | 11 | ||||
-rw-r--r-- | src/media_library.h | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/media_library.cpp b/src/media_library.cpp index de75818d..7d8b8f41 100644 --- a/src/media_library.cpp +++ b/src/media_library.cpp @@ -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); diff --git a/src/media_library.h b/src/media_library.h index 6ce94931..cabb52df 100644 --- a/src/media_library.h +++ b/src/media_library.h @@ -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; |