do not initialize screens lazily as it doesn't make much sense
This commit is contained in:
@@ -93,6 +93,42 @@ void Action::ValidateScreenSize()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Action::InitializeScreens()
|
||||||
|
{
|
||||||
|
myHelp = new Help;
|
||||||
|
myPlaylist = new Playlist;
|
||||||
|
myBrowser = new Browser;
|
||||||
|
mySearcher = new SearchEngine;
|
||||||
|
myLibrary = new MediaLibrary;
|
||||||
|
myPlaylistEditor = new PlaylistEditor;
|
||||||
|
myLyrics = new Lyrics;
|
||||||
|
mySelectedItemsAdder = new SelectedItemsAdder;
|
||||||
|
mySongInfo = new SongInfo;
|
||||||
|
mySortPlaylistDialog = new SortPlaylistDialog;
|
||||||
|
|
||||||
|
# ifdef HAVE_CURL_CURL_H
|
||||||
|
myLastfm = new Lastfm;
|
||||||
|
# endif // HAVE_CURL_CURL_H
|
||||||
|
|
||||||
|
# ifdef HAVE_TAGLIB_H
|
||||||
|
myTinyTagEditor = new TinyTagEditor;
|
||||||
|
myTagEditor = new TagEditor;
|
||||||
|
# endif // HAVE_TAGLIB_H
|
||||||
|
|
||||||
|
# ifdef ENABLE_VISUALIZER
|
||||||
|
myVisualizer = new Visualizer;
|
||||||
|
# endif // ENABLE_VISUALIZER
|
||||||
|
|
||||||
|
# ifdef ENABLE_OUTPUTS
|
||||||
|
myOutputs = new Outputs;
|
||||||
|
# endif // ENABLE_OUTPUTS
|
||||||
|
|
||||||
|
# ifdef ENABLE_CLOCK
|
||||||
|
myClock = new Clock;
|
||||||
|
# endif // ENABLE_CLOCK
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void Action::SetResizeFlags()
|
void Action::SetResizeFlags()
|
||||||
{
|
{
|
||||||
myHelp->hasToBeResized = 1;
|
myHelp->hasToBeResized = 1;
|
||||||
@@ -891,8 +927,6 @@ void SavePlaylist::Run()
|
|||||||
if (result == MPD_ERROR_SUCCESS)
|
if (result == MPD_ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
Statusbar::msg("Playlist saved as \"%s\"", playlist_name.c_str());
|
Statusbar::msg("Playlist saved as \"%s\"", playlist_name.c_str());
|
||||||
if (myPlaylistEditor->main()) // check if initialized
|
|
||||||
myPlaylistEditor->Playlists->clear(); // make playlist's list update itself
|
|
||||||
}
|
}
|
||||||
else if (result == MPD_SERVER_ERROR_EXIST)
|
else if (result == MPD_SERVER_ERROR_EXIST)
|
||||||
{
|
{
|
||||||
@@ -905,15 +939,12 @@ void SavePlaylist::Run()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
Statusbar::msg("Aborted");
|
Statusbar::msg("Aborted");
|
||||||
if (myPlaylistEditor->main()) // check if initialized
|
|
||||||
myPlaylistEditor->Playlists->clear(); // make playlist's list update itself
|
|
||||||
if (myScreen == myPlaylist)
|
if (myScreen == myPlaylist)
|
||||||
myPlaylist->EnableHighlighting();
|
myPlaylist->EnableHighlighting();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (myBrowser->main()
|
if (!myBrowser->isLocal()
|
||||||
&& !myBrowser->isLocal()
|
|
||||||
&& myBrowser->CurrentDir() == "/"
|
&& myBrowser->CurrentDir() == "/"
|
||||||
&& !myBrowser->main()->empty())
|
&& !myBrowser->main()->empty())
|
||||||
myBrowser->GetDirectory(myBrowser->CurrentDir());
|
myBrowser->GetDirectory(myBrowser->CurrentDir());
|
||||||
@@ -1522,10 +1553,8 @@ void EditPlaylistName::Run()
|
|||||||
{
|
{
|
||||||
const char msg[] = "Playlist renamed to \"%ls\"";
|
const char msg[] = "Playlist renamed to \"%ls\"";
|
||||||
Statusbar::msg(msg, wideShorten(ToWString(new_name), COLS-const_strlen(msg)).c_str());
|
Statusbar::msg(msg, wideShorten(ToWString(new_name), COLS-const_strlen(msg)).c_str());
|
||||||
if (myBrowser->main() && !myBrowser->isLocal())
|
if (!myBrowser->isLocal())
|
||||||
myBrowser->GetDirectory("/");
|
myBrowser->GetDirectory("/");
|
||||||
if (myPlaylistEditor->main())
|
|
||||||
myPlaylistEditor->Playlists->clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2145,7 +2174,7 @@ bool SetSelectedItemsPriority::canBeRun() const
|
|||||||
Statusbar::msg("Priorities are supported in MPD >= 0.17.0");
|
Statusbar::msg("Priorities are supported in MPD >= 0.17.0");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return myScreen->activeWindow() == myPlaylist->main() && !myPlaylist->main()->empty();
|
return myScreen == myPlaylist && !myPlaylist->main()->empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetSelectedItemsPriority::Run()
|
void SetSelectedItemsPriority::Run()
|
||||||
@@ -2260,7 +2289,7 @@ void NextScreen::Run()
|
|||||||
}
|
}
|
||||||
else if (!Config.screens_seq.empty())
|
else if (!Config.screens_seq.empty())
|
||||||
{
|
{
|
||||||
std::list<BasicScreen *>::const_iterator screen = std::find(Config.screens_seq.begin(), Config.screens_seq.end(), myScreen);
|
auto screen = std::find(Config.screens_seq.begin(), Config.screens_seq.end(), myScreen);
|
||||||
if (++screen == Config.screens_seq.end())
|
if (++screen == Config.screens_seq.end())
|
||||||
Config.screens_seq.front()->switchTo();
|
Config.screens_seq.front()->switchTo();
|
||||||
else
|
else
|
||||||
@@ -2282,7 +2311,7 @@ void PreviousScreen::Run()
|
|||||||
}
|
}
|
||||||
else if (!Config.screens_seq.empty())
|
else if (!Config.screens_seq.empty())
|
||||||
{
|
{
|
||||||
std::list<BasicScreen *>::const_iterator screen = std::find(Config.screens_seq.begin(), Config.screens_seq.end(), myScreen);
|
auto screen = std::find(Config.screens_seq.begin(), Config.screens_seq.end(), myScreen);
|
||||||
if (screen == Config.screens_seq.begin())
|
if (screen == Config.screens_seq.begin())
|
||||||
Config.screens_seq.back()->switchTo();
|
Config.screens_seq.back()->switchTo();
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ struct Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void ValidateScreenSize();
|
static void ValidateScreenSize();
|
||||||
|
static void InitializeScreens();
|
||||||
static void SetResizeFlags();
|
static void SetResizeFlags();
|
||||||
static void ResizeScreen(bool reload_main_window);
|
static void ResizeScreen(bool reload_main_window);
|
||||||
static void SetWindowsDimensions();
|
static void SetWindowsDimensions();
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ using MPD::itDirectory;
|
|||||||
using MPD::itSong;
|
using MPD::itSong;
|
||||||
using MPD::itPlaylist;
|
using MPD::itPlaylist;
|
||||||
|
|
||||||
Browser *myBrowser = new Browser;
|
Browser *myBrowser;
|
||||||
|
|
||||||
namespace {//
|
namespace {//
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ bool BrowserEntryMatcher(const Regex &rx, const MPD::Item &item, bool filter);
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Browser::init()
|
Browser::Browser() : itsBrowseLocally(0), itsScrollBeginning(0), itsBrowsedDir("/")
|
||||||
{
|
{
|
||||||
w = new NC::Menu<MPD::Item>(0, MainStartY, COLS, MainHeight, Config.columns_in_browser && Config.titles_visibility ? Display::Columns(COLS) : "", Config.main_color, NC::brNone);
|
w = new NC::Menu<MPD::Item>(0, MainStartY, COLS, MainHeight, Config.columns_in_browser && Config.titles_visibility ? Display::Columns(COLS) : "", Config.main_color, NC::brNone);
|
||||||
w->setHighlightColor(Config.main_highlight_color);
|
w->setHighlightColor(Config.main_highlight_color);
|
||||||
@@ -73,8 +73,6 @@ void Browser::init()
|
|||||||
|
|
||||||
if (SupportedExtensions.empty())
|
if (SupportedExtensions.empty())
|
||||||
Mpd.GetSupportedExtensions(SupportedExtensions);
|
Mpd.GetSupportedExtensions(SupportedExtensions);
|
||||||
|
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Browser::resize()
|
void Browser::resize()
|
||||||
@@ -99,9 +97,6 @@ void Browser::switchTo()
|
|||||||
# endif // !WIN32
|
# endif // !WIN32
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (myLockedScreen)
|
if (myLockedScreen)
|
||||||
updateInactiveScreen(this);
|
updateInactiveScreen(this);
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
struct Browser : public Screen< NC::Menu<MPD::Item> >, public Filterable, public HasSongs, public Searchable
|
struct Browser : public Screen< NC::Menu<MPD::Item> >, public Filterable, public HasSongs, public Searchable
|
||||||
{
|
{
|
||||||
Browser() : itsBrowseLocally(0), itsScrollBeginning(0), itsBrowsedDir("/") { }
|
Browser();
|
||||||
|
|
||||||
// Screen< NC::Menu<MPD::Item> > implementation
|
// Screen< NC::Menu<MPD::Item> > implementation
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
@@ -80,7 +80,6 @@ struct Browser : public Screen< NC::Menu<MPD::Item> >, public Filterable, public
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return true; }
|
virtual bool isLockable() OVERRIDE { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ using Global::MainHeight;
|
|||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
using Global::myScreen;
|
using Global::myScreen;
|
||||||
|
|
||||||
Clock *myClock = new Clock;
|
Clock *myClock;
|
||||||
|
|
||||||
short Clock::disp[11] =
|
short Clock::disp[11] =
|
||||||
{
|
{
|
||||||
@@ -52,13 +52,12 @@ long Clock::older[6], Clock::next[6], Clock::newer[6], Clock::mask;
|
|||||||
size_t Clock::Width;
|
size_t Clock::Width;
|
||||||
const size_t Clock::Height = 8;
|
const size_t Clock::Height = 8;
|
||||||
|
|
||||||
void Clock::init()
|
Clock::Clock()
|
||||||
{
|
{
|
||||||
Width = Config.clock_display_seconds ? 60 : 40;
|
Width = Config.clock_display_seconds ? 60 : 40;
|
||||||
|
|
||||||
itsPane = new NC::Window(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
itsPane = new NC::Window(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
||||||
w = new NC::Window((COLS-Width)/2, (MainHeight-Height)/2+MainStartY, Width, Height-1, "", Config.main_color, NC::Border(Config.main_color));
|
w = new NC::Window((COLS-Width)/2, (MainHeight-Height)/2+MainStartY, Width, Height-1, "", Config.main_color, NC::Border(Config.main_color));
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Clock::resize()
|
void Clock::resize()
|
||||||
@@ -82,9 +81,6 @@ void Clock::switchTo()
|
|||||||
if (myScreen == this)
|
if (myScreen == this)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (myLockedScreen)
|
if (myLockedScreen)
|
||||||
updateInactiveScreen(this);
|
updateInactiveScreen(this);
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
|
|
||||||
struct Clock : public Screen<NC::Window>
|
struct Clock : public Screen<NC::Window>
|
||||||
{
|
{
|
||||||
|
Clock();
|
||||||
|
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
|
|
||||||
@@ -46,7 +48,6 @@ struct Clock : public Screen<NC::Window>
|
|||||||
virtual bool isMergable() OVERRIDE { return true; }
|
virtual bool isMergable() OVERRIDE { return true; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return false; }
|
virtual bool isLockable() OVERRIDE { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
using Global::MainHeight;
|
using Global::MainHeight;
|
||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
|
|
||||||
Help *myHelp = new Help;
|
Help *myHelp;
|
||||||
|
|
||||||
namespace {//
|
namespace {//
|
||||||
|
|
||||||
@@ -95,12 +95,11 @@ std::string keyToString(const Key &key, bool *print_backspace)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Help::init()
|
Help::Help()
|
||||||
{
|
{
|
||||||
w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
||||||
GetKeybindings();
|
GetKeybindings();
|
||||||
w->flush();
|
w->flush();
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Help::resize()
|
void Help::resize()
|
||||||
@@ -120,9 +119,6 @@ void Help::switchTo()
|
|||||||
if (myScreen == this)
|
if (myScreen == this)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (myLockedScreen)
|
if (myLockedScreen)
|
||||||
updateInactiveScreen(this);
|
updateInactiveScreen(this);
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
struct Help : public Screen<NC::Scrollpad>
|
struct Help : public Screen<NC::Scrollpad>
|
||||||
{
|
{
|
||||||
|
Help();
|
||||||
|
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
|
|
||||||
@@ -40,7 +42,6 @@ struct Help : public Screen<NC::Scrollpad>
|
|||||||
virtual bool isMergable() OVERRIDE { return true; }
|
virtual bool isMergable() OVERRIDE { return true; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return true; }
|
virtual bool isLockable() OVERRIDE { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -43,12 +43,11 @@
|
|||||||
using Global::MainHeight;
|
using Global::MainHeight;
|
||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
|
|
||||||
Lastfm *myLastfm = new Lastfm;
|
Lastfm *myLastfm;
|
||||||
|
|
||||||
void Lastfm::init()
|
Lastfm::Lastfm() : isReadyToTake(0), isDownloadInProgress(0)
|
||||||
{
|
{
|
||||||
w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lastfm::resize()
|
void Lastfm::resize()
|
||||||
@@ -90,9 +89,6 @@ void Lastfm::switchTo()
|
|||||||
if (myScreen == this)
|
if (myScreen == this)
|
||||||
return myOldScreen->switchTo();
|
return myOldScreen->switchTo();
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (myLockedScreen)
|
if (myLockedScreen)
|
||||||
updateInactiveScreen(this);
|
updateInactiveScreen(this);
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
struct Lastfm : public Screen<NC::Scrollpad>
|
struct Lastfm : public Screen<NC::Scrollpad>
|
||||||
{
|
{
|
||||||
Lastfm() : isReadyToTake(0), isDownloadInProgress(0) { }
|
Lastfm();
|
||||||
|
|
||||||
// Screen<NC::Scrollpad>
|
// Screen<NC::Scrollpad>
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
@@ -56,7 +56,6 @@ struct Lastfm : public Screen<NC::Scrollpad>
|
|||||||
bool SetArtistInfoArgs(const std::string &artist, const std::string &lang = "");
|
bool SetArtistInfoArgs(const std::string &artist, const std::string &lang = "");
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return false; }
|
virtual bool isLockable() OVERRIDE { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -48,12 +48,15 @@ pthread_mutex_t Lyrics::itsDIBLock = PTHREAD_MUTEX_INITIALIZER;
|
|||||||
size_t Lyrics::itsWorkersNumber = 0;
|
size_t Lyrics::itsWorkersNumber = 0;
|
||||||
#endif // HAVE_CURL_CURL_H
|
#endif // HAVE_CURL_CURL_H
|
||||||
|
|
||||||
Lyrics *myLyrics = new Lyrics;
|
Lyrics *myLyrics;
|
||||||
|
|
||||||
void Lyrics::init()
|
Lyrics::Lyrics() : ReloadNP(0),
|
||||||
|
#ifdef HAVE_CURL_CURL_H
|
||||||
|
isReadyToTake(0), isDownloadInProgress(0),
|
||||||
|
#endif // HAVE_CURL_CURL_H
|
||||||
|
itsScrollBegin(0)
|
||||||
{
|
{
|
||||||
w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lyrics::resize()
|
void Lyrics::resize()
|
||||||
@@ -99,9 +102,6 @@ void Lyrics::switchTo()
|
|||||||
if (myScreen == this)
|
if (myScreen == this)
|
||||||
return myOldScreen->switchTo();
|
return myOldScreen->switchTo();
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (hasToBeResized)
|
if (hasToBeResized)
|
||||||
resize();
|
resize();
|
||||||
|
|
||||||
|
|||||||
@@ -30,11 +30,7 @@
|
|||||||
|
|
||||||
struct Lyrics : public Screen<NC::Scrollpad>
|
struct Lyrics : public Screen<NC::Scrollpad>
|
||||||
{
|
{
|
||||||
Lyrics() : ReloadNP(0),
|
Lyrics();
|
||||||
# ifdef HAVE_CURL_CURL_H
|
|
||||||
isReadyToTake(0), isDownloadInProgress(0),
|
|
||||||
# endif // HAVE_CURL_CURL_H
|
|
||||||
itsScrollBegin(0) { }
|
|
||||||
|
|
||||||
// Screen<NC::Scrollpad> implementation
|
// Screen<NC::Scrollpad> implementation
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
@@ -63,7 +59,6 @@ struct Lyrics : public Screen<NC::Scrollpad>
|
|||||||
bool ReloadNP;
|
bool ReloadNP;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return false; }
|
virtual bool isLockable() OVERRIDE { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ using Global::MainHeight;
|
|||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
using Global::myScreen;
|
using Global::myScreen;
|
||||||
|
|
||||||
MediaLibrary *myLibrary = new MediaLibrary;
|
MediaLibrary *myLibrary;
|
||||||
|
|
||||||
namespace {//
|
namespace {//
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ public:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MediaLibrary::init()
|
MediaLibrary::MediaLibrary()
|
||||||
{
|
{
|
||||||
hasTwoColumns = 0;
|
hasTwoColumns = 0;
|
||||||
itsLeftColWidth = COLS/3-1;
|
itsLeftColWidth = COLS/3-1;
|
||||||
@@ -146,7 +146,6 @@ void MediaLibrary::init()
|
|||||||
Songs->setItemDisplayer(std::bind(Display::Songs, _1, this, Config.song_library_format));
|
Songs->setItemDisplayer(std::bind(Display::Songs, _1, this, Config.song_library_format));
|
||||||
|
|
||||||
w = Tags;
|
w = Tags;
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MediaLibrary::resize()
|
void MediaLibrary::resize()
|
||||||
@@ -228,9 +227,6 @@ void MediaLibrary::switchTo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (myLockedScreen)
|
if (myLockedScreen)
|
||||||
updateInactiveScreen(this);
|
updateInactiveScreen(this);
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
struct MediaLibrary : public Screen<NC::Window>, public Filterable, public HasColumns, public HasSongs, public Searchable
|
struct MediaLibrary : public Screen<NC::Window>, public Filterable, public HasColumns, public HasSongs, public Searchable
|
||||||
{
|
{
|
||||||
|
MediaLibrary();
|
||||||
|
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
|
|
||||||
@@ -89,8 +91,7 @@ struct MediaLibrary : public Screen<NC::Window>, public Filterable, public HasCo
|
|||||||
NC::Menu<MPD::Song> *Songs;
|
NC::Menu<MPD::Song> *Songs;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init();
|
virtual bool isLockable() OVERRIDE { return true; }
|
||||||
virtual bool isLockable() { return true; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AddToPlaylist(bool);
|
void AddToPlaylist(bool);
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
Action::SetWindowsDimensions();
|
Action::SetWindowsDimensions();
|
||||||
Action::ValidateScreenSize();
|
Action::ValidateScreenSize();
|
||||||
|
Action::InitializeScreens();
|
||||||
|
|
||||||
wHeader = new NC::Window(0, 0, COLS, Action::HeaderHeight, "", Config.header_color, NC::brNone);
|
wHeader = new NC::Window(0, 0, COLS, Action::HeaderHeight, "", Config.header_color, NC::brNone);
|
||||||
if (Config.header_visibility || Config.new_design)
|
if (Config.header_visibility || Config.new_design)
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ using Global::MainHeight;
|
|||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
using Global::myScreen;
|
using Global::myScreen;
|
||||||
|
|
||||||
Outputs *myOutputs = new Outputs;
|
Outputs *myOutputs;
|
||||||
|
|
||||||
void Outputs::init()
|
Outputs::Outputs()
|
||||||
{
|
{
|
||||||
w = new NC::Menu<MPD::Output>(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
w = new NC::Menu<MPD::Output>(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
||||||
w->cyclicScrolling(Config.use_cyclic_scrolling);
|
w->cyclicScrolling(Config.use_cyclic_scrolling);
|
||||||
@@ -43,7 +43,6 @@ void Outputs::init()
|
|||||||
w->setHighlightColor(Config.main_highlight_color);
|
w->setHighlightColor(Config.main_highlight_color);
|
||||||
w->setItemDisplayer(Display::Outputs);
|
w->setItemDisplayer(Display::Outputs);
|
||||||
|
|
||||||
isInitialized = 1;
|
|
||||||
FetchList();
|
FetchList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,9 +53,6 @@ void Outputs::switchTo()
|
|||||||
if (myScreen == this)
|
if (myScreen == this)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (myLockedScreen)
|
if (myLockedScreen)
|
||||||
updateInactiveScreen(this);
|
updateInactiveScreen(this);
|
||||||
|
|
||||||
@@ -116,8 +112,6 @@ void Outputs::mouseButtonPressed(MEVENT me)
|
|||||||
|
|
||||||
void Outputs::FetchList()
|
void Outputs::FetchList()
|
||||||
{
|
{
|
||||||
if (!isInitialized)
|
|
||||||
return;
|
|
||||||
w->clear();
|
w->clear();
|
||||||
auto outputs = Mpd.GetOutputs();
|
auto outputs = Mpd.GetOutputs();
|
||||||
for (auto o = outputs.begin(); o != outputs.end(); ++o)
|
for (auto o = outputs.begin(); o != outputs.end(); ++o)
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
struct Outputs : public Screen< NC::Menu<MPD::Output> >
|
struct Outputs : public Screen< NC::Menu<MPD::Output> >
|
||||||
{
|
{
|
||||||
|
Outputs();
|
||||||
|
|
||||||
// Screen< NC::Menu<MPD::Output> > implementation
|
// Screen< NC::Menu<MPD::Output> > implementation
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
@@ -50,7 +52,6 @@ struct Outputs : public Screen< NC::Menu<MPD::Output> >
|
|||||||
void FetchList();
|
void FetchList();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return true; }
|
virtual bool isLockable() OVERRIDE { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ using namespace std::placeholders;
|
|||||||
using Global::MainHeight;
|
using Global::MainHeight;
|
||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
|
|
||||||
Playlist *myPlaylist = new Playlist;
|
Playlist *myPlaylist;
|
||||||
|
|
||||||
bool Playlist::ReloadTotalLength = 0;
|
bool Playlist::ReloadTotalLength = 0;
|
||||||
bool Playlist::ReloadRemaining = false;
|
bool Playlist::ReloadRemaining = false;
|
||||||
@@ -50,7 +50,7 @@ bool playlistEntryMatcher(const Regex &rx, const MPD::Song &s);
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Playlist::init()
|
Playlist::Playlist() : itsTotalLength(0), itsRemainingTime(0), itsScrollBegin(0)
|
||||||
{
|
{
|
||||||
w = new NC::Menu<MPD::Song>(0, MainStartY, COLS, MainHeight, Config.columns_in_playlist && Config.titles_visibility ? Display::Columns(COLS) : "", Config.main_color, NC::brNone);
|
w = new NC::Menu<MPD::Song>(0, MainStartY, COLS, MainHeight, Config.columns_in_playlist && Config.titles_visibility ? Display::Columns(COLS) : "", Config.main_color, NC::brNone);
|
||||||
w->cyclicScrolling(Config.use_cyclic_scrolling);
|
w->cyclicScrolling(Config.use_cyclic_scrolling);
|
||||||
@@ -62,8 +62,6 @@ void Playlist::init()
|
|||||||
w->setItemDisplayer(std::bind(Display::SongsInColumns, _1, this));
|
w->setItemDisplayer(std::bind(Display::SongsInColumns, _1, this));
|
||||||
else
|
else
|
||||||
w->setItemDisplayer(std::bind(Display::Songs, _1, this, Config.song_list_format));
|
w->setItemDisplayer(std::bind(Display::Songs, _1, this, Config.song_list_format));
|
||||||
|
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Playlist::switchTo()
|
void Playlist::switchTo()
|
||||||
@@ -75,9 +73,6 @@ void Playlist::switchTo()
|
|||||||
if (myScreen == this)
|
if (myScreen == this)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
itsScrollBegin = 0;
|
itsScrollBegin = 0;
|
||||||
|
|
||||||
if (myLockedScreen)
|
if (myLockedScreen)
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
|
|
||||||
struct Playlist : public Screen<NC::Menu<MPD::Song>>, public Filterable, public HasSongs, public Searchable
|
struct Playlist : public Screen<NC::Menu<MPD::Song>>, public Filterable, public HasSongs, public Searchable
|
||||||
{
|
{
|
||||||
Playlist() : itsTotalLength(0), itsRemainingTime(0), itsScrollBegin(0) { }
|
Playlist();
|
||||||
~Playlist() { }
|
|
||||||
|
|
||||||
// Screen<NC::Menu<MPD::Song>> implementation
|
// Screen<NC::Menu<MPD::Song>> implementation
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
@@ -90,7 +89,6 @@ struct Playlist : public Screen<NC::Menu<MPD::Song>>, public Filterable, public
|
|||||||
static bool ReloadRemaining;
|
static bool ReloadRemaining;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return true; }
|
virtual bool isLockable() OVERRIDE { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ using namespace std::placeholders;
|
|||||||
using Global::MainHeight;
|
using Global::MainHeight;
|
||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
|
|
||||||
PlaylistEditor *myPlaylistEditor = new PlaylistEditor;
|
PlaylistEditor *myPlaylistEditor;
|
||||||
|
|
||||||
namespace {//
|
namespace {//
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ bool SongEntryMatcher(const Regex &rx, const MPD::Song &s);
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaylistEditor::init()
|
PlaylistEditor::PlaylistEditor()
|
||||||
{
|
{
|
||||||
LeftColumnWidth = COLS/3-1;
|
LeftColumnWidth = COLS/3-1;
|
||||||
RightColumnStartX = LeftColumnWidth+1;
|
RightColumnStartX = LeftColumnWidth+1;
|
||||||
@@ -81,7 +81,6 @@ void PlaylistEditor::init()
|
|||||||
Content->setItemDisplayer(std::bind(Display::Songs, _1, this, Config.song_list_format));
|
Content->setItemDisplayer(std::bind(Display::Songs, _1, this, Config.song_list_format));
|
||||||
|
|
||||||
w = Playlists;
|
w = Playlists;
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaylistEditor::resize()
|
void PlaylistEditor::resize()
|
||||||
@@ -123,9 +122,6 @@ void PlaylistEditor::switchTo()
|
|||||||
if (myScreen == this)
|
if (myScreen == this)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (myLockedScreen)
|
if (myLockedScreen)
|
||||||
updateInactiveScreen(this);
|
updateInactiveScreen(this);
|
||||||
|
|
||||||
@@ -509,8 +505,6 @@ void PlaylistEditor::nextColumn()
|
|||||||
|
|
||||||
void PlaylistEditor::Locate(const std::string &name)
|
void PlaylistEditor::Locate(const std::string &name)
|
||||||
{
|
{
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
update();
|
update();
|
||||||
for (size_t i = 0; i < Playlists->size(); ++i)
|
for (size_t i = 0; i < Playlists->size(); ++i)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
struct PlaylistEditor : public Screen<NC::Window>, public Filterable, public HasColumns, public HasSongs, public Searchable
|
struct PlaylistEditor : public Screen<NC::Window>, public Filterable, public HasColumns, public HasSongs, public Searchable
|
||||||
{
|
{
|
||||||
|
PlaylistEditor();
|
||||||
|
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
|
|
||||||
@@ -78,7 +80,6 @@ struct PlaylistEditor : public Screen<NC::Window>, public Filterable, public Has
|
|||||||
NC::Menu<MPD::Song> *Content;
|
NC::Menu<MPD::Song> *Content;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return true; }
|
virtual bool isLockable() OVERRIDE { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
13
src/screen.h
13
src/screen.h
@@ -32,9 +32,7 @@ void scrollpadMouseButtonPressed(NC::Scrollpad *w, MEVENT me);
|
|||||||
/// basic class to be non-template to allow it.
|
/// basic class to be non-template to allow it.
|
||||||
struct BasicScreen
|
struct BasicScreen
|
||||||
{
|
{
|
||||||
/// Initializes all variables to zero
|
BasicScreen() : hasToBeResized(false) { }
|
||||||
BasicScreen() : hasToBeResized(0), isInitialized(0) { }
|
|
||||||
|
|
||||||
virtual ~BasicScreen() { }
|
virtual ~BasicScreen() { }
|
||||||
|
|
||||||
/// @see Screen::activeWindow()
|
/// @see Screen::activeWindow()
|
||||||
@@ -93,12 +91,6 @@ struct BasicScreen
|
|||||||
static void unlock();
|
static void unlock();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Since screens initialization is lazy, we don't want to do
|
|
||||||
/// this in the constructor. This function should be invoked
|
|
||||||
/// only once and after that isInitialized flag has to be set
|
|
||||||
/// to true to somehow avoid next attempt of initialization.
|
|
||||||
virtual void init() = 0;
|
|
||||||
|
|
||||||
/// @return true if screen can be locked. Note that returning
|
/// @return true if screen can be locked. Note that returning
|
||||||
/// false here doesn't neccesarily mean that screen is also not
|
/// false here doesn't neccesarily mean that screen is also not
|
||||||
/// mergable (eg. lyrics screen is not lockable since that wouldn't
|
/// mergable (eg. lyrics screen is not lockable since that wouldn't
|
||||||
@@ -110,9 +102,6 @@ protected:
|
|||||||
/// automatically adjust locked screen's dimensions (if there is one set)
|
/// automatically adjust locked screen's dimensions (if there is one set)
|
||||||
/// if current screen is going to be subwindow.
|
/// if current screen is going to be subwindow.
|
||||||
void getWindowResizeParams(size_t &x_offset, size_t &width, bool adjust_locked_screen = true);
|
void getWindowResizeParams(size_t &x_offset, size_t &width, bool adjust_locked_screen = true);
|
||||||
|
|
||||||
/// Flag that inditates whether the screen is initialized or not
|
|
||||||
bool isInitialized;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void applyToVisibleWindows(void (BasicScreen::*f)());
|
void applyToVisibleWindows(void (BasicScreen::*f)());
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ using namespace std::placeholders;
|
|||||||
using Global::MainHeight;
|
using Global::MainHeight;
|
||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
|
|
||||||
SearchEngine *mySearcher = new SearchEngine;
|
SearchEngine *mySearcher;
|
||||||
|
|
||||||
namespace {//
|
namespace {//
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ size_t SearchEngine::StaticOptions = 20;
|
|||||||
size_t SearchEngine::ResetButton = 16;
|
size_t SearchEngine::ResetButton = 16;
|
||||||
size_t SearchEngine::SearchButton = 15;
|
size_t SearchEngine::SearchButton = 15;
|
||||||
|
|
||||||
void SearchEngine::init()
|
SearchEngine::SearchEngine()
|
||||||
{
|
{
|
||||||
w = new NC::Menu<SEItem>(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
w = new NC::Menu<SEItem>(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
||||||
w->setHighlightColor(Config.main_highlight_color);
|
w->setHighlightColor(Config.main_highlight_color);
|
||||||
@@ -111,7 +111,6 @@ void SearchEngine::init()
|
|||||||
w->setSelectedPrefix(Config.selected_item_prefix);
|
w->setSelectedPrefix(Config.selected_item_prefix);
|
||||||
w->setSelectedSuffix(Config.selected_item_suffix);
|
w->setSelectedSuffix(Config.selected_item_suffix);
|
||||||
SearchMode = &SearchModes[Config.search_engine_default_search_mode];
|
SearchMode = &SearchModes[Config.search_engine_default_search_mode];
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchEngine::resize()
|
void SearchEngine::resize()
|
||||||
@@ -135,9 +134,6 @@ void SearchEngine::switchTo()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (myLockedScreen)
|
if (myLockedScreen)
|
||||||
updateInactiveScreen(this);
|
updateInactiveScreen(this);
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ struct SEItem
|
|||||||
|
|
||||||
struct SearchEngine : public Screen< NC::Menu<SEItem> >, public Filterable, public HasSongs, public Searchable
|
struct SearchEngine : public Screen< NC::Menu<SEItem> >, public Filterable, public HasSongs, public Searchable
|
||||||
{
|
{
|
||||||
|
SearchEngine();
|
||||||
|
|
||||||
// Screen< NC::Menu<SEItem> > implementation
|
// Screen< NC::Menu<SEItem> > implementation
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
@@ -115,7 +117,6 @@ struct SearchEngine : public Screen< NC::Menu<SEItem> >, public Filterable, publ
|
|||||||
static size_t ResetButton;
|
static size_t ResetButton;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return true; }
|
virtual bool isLockable() OVERRIDE { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ using Global::MainStartY;
|
|||||||
using Global::myScreen;
|
using Global::myScreen;
|
||||||
using Global::myOldScreen;
|
using Global::myOldScreen;
|
||||||
|
|
||||||
SelectedItemsAdder *mySelectedItemsAdder = new SelectedItemsAdder;
|
SelectedItemsAdder *mySelectedItemsAdder;
|
||||||
|
|
||||||
void SelectedItemsAdder::init()
|
SelectedItemsAdder::SelectedItemsAdder() : itsPSWidth(35), itsPSHeight(11)
|
||||||
{
|
{
|
||||||
SetDimensions();
|
SetDimensions();
|
||||||
itsPlaylistSelector = new NC::Menu<std::string>((COLS-itsWidth)/2, (MainHeight-itsHeight)/2+MainStartY, itsWidth, itsHeight, "Add selected item(s) to...", Config.main_color, Config.window_border);
|
itsPlaylistSelector = new NC::Menu<std::string>((COLS-itsWidth)/2, (MainHeight-itsHeight)/2+MainStartY, itsWidth, itsHeight, "Add selected item(s) to...", Config.main_color, Config.window_border);
|
||||||
@@ -62,7 +62,6 @@ void SelectedItemsAdder::init()
|
|||||||
itsPositionSelector->addItem("Cancel");
|
itsPositionSelector->addItem("Cancel");
|
||||||
|
|
||||||
w = itsPlaylistSelector;
|
w = itsPlaylistSelector;
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectedItemsAdder::switchTo()
|
void SelectedItemsAdder::switchTo()
|
||||||
@@ -76,9 +75,6 @@ void SelectedItemsAdder::switchTo()
|
|||||||
if (!hs || !hs->allowsSelection())
|
if (!hs || !hs->allowsSelection())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
// default to main window
|
// default to main window
|
||||||
w = itsPlaylistSelector;
|
w = itsPlaylistSelector;
|
||||||
|
|
||||||
@@ -189,14 +185,6 @@ void SelectedItemsAdder::enterPressed()
|
|||||||
if (Mpd.CommitCommandsList())
|
if (Mpd.CommitCommandsList())
|
||||||
Statusbar::msg("Selected item(s) added to playlist \"%s\"", w->current().value().c_str());
|
Statusbar::msg("Selected item(s) added to playlist \"%s\"", w->current().value().c_str());
|
||||||
}
|
}
|
||||||
if (pos != w->size()-1)
|
|
||||||
{
|
|
||||||
// refresh playlist's lists
|
|
||||||
if (myBrowser->main() && !myBrowser->isLocal() && myBrowser->CurrentDir() == "/")
|
|
||||||
myBrowser->GetDirectory("/");
|
|
||||||
if (myPlaylistEditor->main())
|
|
||||||
myPlaylistEditor->Playlists->clear(); // make playlist editor update itself
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
struct SelectedItemsAdder : public Screen< NC::Menu<std::string> >
|
struct SelectedItemsAdder : public Screen< NC::Menu<std::string> >
|
||||||
{
|
{
|
||||||
SelectedItemsAdder() : itsPSWidth(35), itsPSHeight(11) { }
|
SelectedItemsAdder();
|
||||||
|
|
||||||
// Screen< NC::Menu<std::string> > implementation
|
// Screen< NC::Menu<std::string> > implementation
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
@@ -44,7 +44,6 @@ struct SelectedItemsAdder : public Screen< NC::Menu<std::string> >
|
|||||||
virtual bool isTabbable() OVERRIDE { return false; }
|
virtual bool isTabbable() OVERRIDE { return false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return false; }
|
virtual bool isLockable() OVERRIDE { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -32,15 +32,13 @@ using Global::myOldScreen;
|
|||||||
|
|
||||||
ServerInfo *myServerInfo = new ServerInfo;
|
ServerInfo *myServerInfo = new ServerInfo;
|
||||||
|
|
||||||
void ServerInfo::init()
|
ServerInfo::ServerInfo()
|
||||||
{
|
{
|
||||||
SetDimensions();
|
SetDimensions();
|
||||||
w = new NC::Scrollpad((COLS-itsWidth)/2, (MainHeight-itsHeight)/2+MainStartY, itsWidth, itsHeight, "MPD server info", Config.main_color, Config.window_border);
|
w = new NC::Scrollpad((COLS-itsWidth)/2, (MainHeight-itsHeight)/2+MainStartY, itsWidth, itsHeight, "MPD server info", Config.main_color, Config.window_border);
|
||||||
|
|
||||||
itsURLHandlers = Mpd.GetURLHandlers();
|
itsURLHandlers = Mpd.GetURLHandlers();
|
||||||
itsTagTypes = Mpd.GetTagTypes();
|
itsTagTypes = Mpd.GetTagTypes();
|
||||||
|
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerInfo::switchTo()
|
void ServerInfo::switchTo()
|
||||||
@@ -53,9 +51,6 @@ void ServerInfo::switchTo()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
// resize() can fall back to old screen, so we need it updated
|
// resize() can fall back to old screen, so we need it updated
|
||||||
myOldScreen = myScreen;
|
myOldScreen = myScreen;
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
struct ServerInfo : public Screen<NC::Scrollpad>
|
struct ServerInfo : public Screen<NC::Scrollpad>
|
||||||
{
|
{
|
||||||
|
ServerInfo();
|
||||||
|
|
||||||
// Screen<NC::Scrollpad> implementation
|
// Screen<NC::Scrollpad> implementation
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
@@ -40,7 +42,6 @@ struct ServerInfo : public Screen<NC::Scrollpad>
|
|||||||
virtual bool isTabbable() OVERRIDE { return false; }
|
virtual bool isTabbable() OVERRIDE { return false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return false; }
|
virtual bool isLockable() OVERRIDE { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ namespace
|
|||||||
return NC::Border(stringToColor(border));
|
return NC::Border(stringToColor(border));
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicScreen *intToScreen(int n)
|
ScreenRef intToScreen(int n)
|
||||||
{
|
{
|
||||||
switch (n)
|
switch (n)
|
||||||
{
|
{
|
||||||
@@ -120,7 +120,7 @@ namespace
|
|||||||
return myClock;
|
return myClock;
|
||||||
# endif // ENABLE_CLOCK
|
# endif // ENABLE_CLOCK
|
||||||
default:
|
default:
|
||||||
return 0;
|
return ScreenRef();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -667,7 +667,7 @@ void Configuration::Read()
|
|||||||
++it;
|
++it;
|
||||||
if (it == v.end())
|
if (it == v.end())
|
||||||
break;
|
break;
|
||||||
if (BasicScreen *screen = intToScreen(atoi(&*it)))
|
if (auto screen = intToScreen(atoi(&*it)))
|
||||||
screens_seq.push_back(screen);
|
screens_seq.push_back(screen);
|
||||||
while (it != v.end() && isdigit(*it))
|
while (it != v.end() && isdigit(*it))
|
||||||
++it;
|
++it;
|
||||||
|
|||||||
@@ -45,6 +45,27 @@ struct Column
|
|||||||
bool display_empty_tag;
|
bool display_empty_tag;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// FIXME: temporary hack
|
||||||
|
struct ScreenRef
|
||||||
|
{
|
||||||
|
ScreenRef() : m_ptr(0) { }
|
||||||
|
template <typename ScreenT>
|
||||||
|
ScreenRef(ScreenT *&ptr) : m_ptr(reinterpret_cast<BasicScreen **>(&ptr)) { }
|
||||||
|
|
||||||
|
BasicScreen &operator*() const { return **m_ptr; }
|
||||||
|
BasicScreen *operator->() const { return *m_ptr; }
|
||||||
|
|
||||||
|
bool operator==(const ScreenRef &rhs) const { return m_ptr == rhs.m_ptr; }
|
||||||
|
bool operator!=(const ScreenRef &rhs) const { return m_ptr != rhs.m_ptr; }
|
||||||
|
bool operator==(const BasicScreen *rhs) const { return *m_ptr == rhs; }
|
||||||
|
bool operator!=(const BasicScreen *rhs) const { return *m_ptr != rhs; }
|
||||||
|
|
||||||
|
operator bool() { return m_ptr != 0; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
BasicScreen **m_ptr;
|
||||||
|
};
|
||||||
|
|
||||||
struct Configuration
|
struct Configuration
|
||||||
{
|
{
|
||||||
Configuration();
|
Configuration();
|
||||||
@@ -187,8 +208,8 @@ struct Configuration
|
|||||||
size_t now_playing_prefix_length;
|
size_t now_playing_prefix_length;
|
||||||
size_t now_playing_suffix_length;
|
size_t now_playing_suffix_length;
|
||||||
|
|
||||||
BasicScreen *startup_screen;
|
ScreenRef startup_screen;
|
||||||
std::list<BasicScreen *> screens_seq;
|
std::list<ScreenRef> screens_seq;
|
||||||
|
|
||||||
SortMode browser_sort_mode;
|
SortMode browser_sort_mode;
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
using Global::MainHeight;
|
using Global::MainHeight;
|
||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
|
|
||||||
SongInfo *mySongInfo = new SongInfo;
|
SongInfo *mySongInfo;
|
||||||
|
|
||||||
const SongInfo::Metadata SongInfo::Tags[] =
|
const SongInfo::Metadata SongInfo::Tags[] =
|
||||||
{
|
{
|
||||||
@@ -47,13 +47,12 @@ const SongInfo::Metadata SongInfo::Tags[] =
|
|||||||
{ "Performer", &MPD::Song::getPerformer, &MPD::MutableSong::setPerformer },
|
{ "Performer", &MPD::Song::getPerformer, &MPD::MutableSong::setPerformer },
|
||||||
{ "Disc", &MPD::Song::getDisc, &MPD::MutableSong::setDisc },
|
{ "Disc", &MPD::Song::getDisc, &MPD::MutableSong::setDisc },
|
||||||
{ "Comment", &MPD::Song::getComment, &MPD::MutableSong::setComment },
|
{ "Comment", &MPD::Song::getComment, &MPD::MutableSong::setComment },
|
||||||
{ 0, 0, 0 }
|
{ 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
void SongInfo::init()
|
SongInfo::SongInfo()
|
||||||
{
|
{
|
||||||
w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
w = new NC::Scrollpad(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SongInfo::resize()
|
void SongInfo::resize()
|
||||||
@@ -79,9 +78,6 @@ void SongInfo::switchTo()
|
|||||||
if (myScreen == this)
|
if (myScreen == this)
|
||||||
return myOldScreen->switchTo();
|
return myOldScreen->switchTo();
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (myLockedScreen)
|
if (myLockedScreen)
|
||||||
updateInactiveScreen(this);
|
updateInactiveScreen(this);
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ struct SongInfo : public Screen<NC::Scrollpad>
|
|||||||
MPD::MutableSong::SetFunction Set;
|
MPD::MutableSong::SetFunction Set;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SongInfo();
|
||||||
|
|
||||||
// Screen<NC::Scrollpad> implementation
|
// Screen<NC::Scrollpad> implementation
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
@@ -51,7 +53,6 @@ struct SongInfo : public Screen<NC::Scrollpad>
|
|||||||
static const Metadata Tags[];
|
static const Metadata Tags[];
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return false; }
|
virtual bool isLockable() OVERRIDE { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -29,9 +29,9 @@
|
|||||||
using Global::MainHeight;
|
using Global::MainHeight;
|
||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
|
|
||||||
SortPlaylistDialog *mySortPlaylistDialog = new SortPlaylistDialog;
|
SortPlaylistDialog *mySortPlaylistDialog;
|
||||||
|
|
||||||
void SortPlaylistDialog::init()
|
SortPlaylistDialog::SortPlaylistDialog()
|
||||||
{
|
{
|
||||||
setDimensions();
|
setDimensions();
|
||||||
|
|
||||||
@@ -54,12 +54,10 @@ void SortPlaylistDialog::init()
|
|||||||
m_sort_options = w->size();
|
m_sort_options = w->size();
|
||||||
m_sort_entry = std::make_pair("Sort", static_cast<MPD::Song::GetFunction>(0));
|
m_sort_entry = std::make_pair("Sort", static_cast<MPD::Song::GetFunction>(0));
|
||||||
m_cancel_entry = std::make_pair("Cancel", static_cast<MPD::Song::GetFunction>(0));
|
m_cancel_entry = std::make_pair("Cancel", static_cast<MPD::Song::GetFunction>(0));
|
||||||
|
|
||||||
w->addSeparator();
|
w->addSeparator();
|
||||||
w->addItem(m_sort_entry);
|
w->addItem(m_sort_entry);
|
||||||
w->addItem(m_cancel_entry);
|
w->addItem(m_cancel_entry);
|
||||||
|
|
||||||
isInitialized = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SortPlaylistDialog::switchTo()
|
void SortPlaylistDialog::switchTo()
|
||||||
@@ -71,9 +69,6 @@ void SortPlaylistDialog::switchTo()
|
|||||||
|
|
||||||
assert(myScreen != this);
|
assert(myScreen != this);
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (hasToBeResized)
|
if (hasToBeResized)
|
||||||
resize();
|
resize();
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
struct SortPlaylistDialog : public Screen< NC::Menu< std::pair<std::string, MPD::Song::GetFunction> > >
|
struct SortPlaylistDialog : public Screen< NC::Menu< std::pair<std::string, MPD::Song::GetFunction> > >
|
||||||
{
|
{
|
||||||
|
SortPlaylistDialog();
|
||||||
|
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
|
|
||||||
@@ -45,8 +47,7 @@ struct SortPlaylistDialog : public Screen< NC::Menu< std::pair<std::string, MPD:
|
|||||||
void moveSortOrderDown();
|
void moveSortOrderDown();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init();
|
virtual bool isLockable() OVERRIDE { return false; }
|
||||||
virtual bool isLockable() { return false; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setDimensions();
|
void setDimensions();
|
||||||
|
|||||||
@@ -176,12 +176,9 @@ void Status::Changes::playlist()
|
|||||||
|
|
||||||
void Status::Changes::storedPlaylists()
|
void Status::Changes::storedPlaylists()
|
||||||
{
|
{
|
||||||
if (myPlaylistEditor->main())
|
myPlaylistEditor->requestPlaylistsUpdate();
|
||||||
{
|
myPlaylistEditor->requestContentsUpdate();
|
||||||
myPlaylistEditor->requestPlaylistsUpdate();
|
if (myBrowser->CurrentDir() == "/")
|
||||||
myPlaylistEditor->requestContentsUpdate();
|
|
||||||
}
|
|
||||||
if (myBrowser->main() && myBrowser->CurrentDir() == "/")
|
|
||||||
{
|
{
|
||||||
myBrowser->GetDirectory("/");
|
myBrowser->GetDirectory("/");
|
||||||
if (isVisible(myBrowser))
|
if (isVisible(myBrowser))
|
||||||
@@ -191,26 +188,17 @@ void Status::Changes::storedPlaylists()
|
|||||||
|
|
||||||
void Status::Changes::database()
|
void Status::Changes::database()
|
||||||
{
|
{
|
||||||
if (myBrowser->main())
|
if (isVisible(myBrowser))
|
||||||
{
|
myBrowser->GetDirectory(myBrowser->CurrentDir());
|
||||||
if (isVisible(myBrowser))
|
else
|
||||||
myBrowser->GetDirectory(myBrowser->CurrentDir());
|
myBrowser->main()->clear();
|
||||||
else
|
|
||||||
myBrowser->main()->clear();
|
|
||||||
}
|
|
||||||
# ifdef HAVE_TAGLIB_H
|
# ifdef HAVE_TAGLIB_H
|
||||||
if (myTagEditor->main())
|
myTagEditor->Dirs->clear();
|
||||||
{
|
|
||||||
myTagEditor->Dirs->clear();
|
|
||||||
}
|
|
||||||
# endif // HAVE_TAGLIB_H
|
# endif // HAVE_TAGLIB_H
|
||||||
if (myLibrary->main())
|
if (myLibrary->Columns() == 2)
|
||||||
{
|
myLibrary->Albums->clear();
|
||||||
if (myLibrary->Columns() == 2)
|
else
|
||||||
myLibrary->Albums->clear();
|
myLibrary->Tags->clear();
|
||||||
else
|
|
||||||
myLibrary->Tags->clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Status::Changes::playerState()
|
void Status::Changes::playerState()
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ using Global::myScreen;
|
|||||||
using Global::MainHeight;
|
using Global::MainHeight;
|
||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
|
|
||||||
TagEditor *myTagEditor = new TagEditor;
|
TagEditor *myTagEditor;
|
||||||
|
|
||||||
namespace {//
|
namespace {//
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ bool SongEntryMatcher(const Regex &rx, const MPD::MutableSong &s);
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TagEditor::init()
|
TagEditor::TagEditor() : FParser(0), FParserHelper(0), FParserLegend(0), FParserPreview(0), itsBrowsedDir("/")
|
||||||
{
|
{
|
||||||
PatternsFile = Config.ncmpcpp_directory + "patterns.list";
|
PatternsFile = Config.ncmpcpp_directory + "patterns.list";
|
||||||
SetDimensions(0, COLS);
|
SetDimensions(0, COLS);
|
||||||
@@ -142,7 +142,6 @@ void TagEditor::init()
|
|||||||
FParserPreview = new NC::Scrollpad((COLS-FParserWidth)/2+FParserWidthOne, (MainHeight-FParserHeight)/2+MainStartY, FParserWidthTwo, FParserHeight, "Preview", Config.main_color, Config.window_border);
|
FParserPreview = new NC::Scrollpad((COLS-FParserWidth)/2+FParserWidthOne, (MainHeight-FParserHeight)/2+MainStartY, FParserWidthTwo, FParserHeight, "Preview", Config.main_color, Config.window_border);
|
||||||
|
|
||||||
w = Dirs;
|
w = Dirs;
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TagEditor::SetDimensions(size_t x_offset, size_t width)
|
void TagEditor::SetDimensions(size_t x_offset, size_t width)
|
||||||
@@ -200,9 +199,6 @@ void TagEditor::switchTo()
|
|||||||
if (myScreen == this)
|
if (myScreen == this)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (myLockedScreen)
|
if (myLockedScreen)
|
||||||
updateInactiveScreen(this);
|
updateInactiveScreen(this);
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
struct TagEditor : public Screen<NC::Window>, public Filterable, public HasColumns, public HasSongs, public Searchable
|
struct TagEditor : public Screen<NC::Window>, public Filterable, public HasColumns, public HasSongs, public Searchable
|
||||||
{
|
{
|
||||||
TagEditor() : FParser(0), FParserHelper(0), FParserLegend(0), FParserPreview(0), itsBrowsedDir("/") { }
|
TagEditor();
|
||||||
|
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
@@ -87,8 +87,7 @@ struct TagEditor : public Screen<NC::Window>, public Filterable, public HasColum
|
|||||||
NC::Menu<MPD::MutableSong> *Tags;
|
NC::Menu<MPD::MutableSong> *Tags;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init();
|
virtual bool isLockable() OVERRIDE { return true; }
|
||||||
virtual bool isLockable() { return true; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetDimensions(size_t, size_t);
|
void SetDimensions(size_t, size_t);
|
||||||
|
|||||||
@@ -43,16 +43,15 @@ using Global::MainHeight;
|
|||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
using Global::myOldScreen;
|
using Global::myOldScreen;
|
||||||
|
|
||||||
TinyTagEditor *myTinyTagEditor = new TinyTagEditor;
|
TinyTagEditor *myTinyTagEditor;
|
||||||
|
|
||||||
void TinyTagEditor::init()
|
TinyTagEditor::TinyTagEditor()
|
||||||
{
|
{
|
||||||
w = new NC::Menu<NC::Buffer>(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
w = new NC::Menu<NC::Buffer>(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::brNone);
|
||||||
w->setHighlightColor(Config.main_highlight_color);
|
w->setHighlightColor(Config.main_highlight_color);
|
||||||
w->cyclicScrolling(Config.use_cyclic_scrolling);
|
w->cyclicScrolling(Config.use_cyclic_scrolling);
|
||||||
w->centeredCursor(Config.centered_cursor);
|
w->centeredCursor(Config.centered_cursor);
|
||||||
w->setItemDisplayer(Display::Default<NC::Buffer>);
|
w->setItemDisplayer(Display::Default<NC::Buffer>);
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TinyTagEditor::resize()
|
void TinyTagEditor::resize()
|
||||||
@@ -191,9 +190,6 @@ bool TinyTagEditor::getTags()
|
|||||||
std::string ext = itsEdited.getURI();
|
std::string ext = itsEdited.getURI();
|
||||||
ext = lowercase(ext.substr(ext.rfind(".")+1));
|
ext = lowercase(ext.substr(ext.rfind(".")+1));
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
w->clear();
|
w->clear();
|
||||||
w->reset();
|
w->reset();
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
|
|
||||||
struct TinyTagEditor : public Screen< NC::Menu<NC::Buffer> >
|
struct TinyTagEditor : public Screen< NC::Menu<NC::Buffer> >
|
||||||
{
|
{
|
||||||
|
TinyTagEditor();
|
||||||
|
|
||||||
// Screen< NC::Menu<NC::Buffer> > implementation
|
// Screen< NC::Menu<NC::Buffer> > implementation
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
@@ -49,7 +51,6 @@ struct TinyTagEditor : public Screen< NC::Menu<NC::Buffer> >
|
|||||||
void SetEdited(const MPD::Song &);
|
void SetEdited(const MPD::Song &);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init() OVERRIDE;
|
|
||||||
virtual bool isLockable() OVERRIDE { return true; }
|
virtual bool isLockable() OVERRIDE { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -40,11 +40,11 @@
|
|||||||
using Global::MainStartY;
|
using Global::MainStartY;
|
||||||
using Global::MainHeight;
|
using Global::MainHeight;
|
||||||
|
|
||||||
Visualizer *myVisualizer = new Visualizer;
|
Visualizer *myVisualizer;
|
||||||
|
|
||||||
const int Visualizer::WindowTimeout = 1000/25; /* 25 fps */
|
const int Visualizer::WindowTimeout = 1000/25; /* 25 fps */
|
||||||
|
|
||||||
void Visualizer::init()
|
Visualizer::Visualizer()
|
||||||
{
|
{
|
||||||
w = new NC::Window(0, MainStartY, COLS, MainHeight, "", Config.visualizer_color, NC::brNone);
|
w = new NC::Window(0, MainStartY, COLS, MainHeight, "", Config.visualizer_color, NC::brNone);
|
||||||
|
|
||||||
@@ -59,8 +59,6 @@ void Visualizer::init()
|
|||||||
# endif // HAVE_FFTW3_H
|
# endif // HAVE_FFTW3_H
|
||||||
|
|
||||||
FindOutputID();
|
FindOutputID();
|
||||||
|
|
||||||
isInitialized = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Visualizer::switchTo()
|
void Visualizer::switchTo()
|
||||||
@@ -71,9 +69,6 @@ void Visualizer::switchTo()
|
|||||||
if (myScreen == this)
|
if (myScreen == this)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!isInitialized)
|
|
||||||
init();
|
|
||||||
|
|
||||||
if (myLockedScreen)
|
if (myLockedScreen)
|
||||||
updateInactiveScreen(this);
|
updateInactiveScreen(this);
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
struct Visualizer : public Screen<NC::Window>
|
struct Visualizer : public Screen<NC::Window>
|
||||||
{
|
{
|
||||||
|
Visualizer();
|
||||||
|
|
||||||
virtual void switchTo() OVERRIDE;
|
virtual void switchTo() OVERRIDE;
|
||||||
virtual void resize() OVERRIDE;
|
virtual void resize() OVERRIDE;
|
||||||
|
|
||||||
@@ -57,8 +59,7 @@ struct Visualizer : public Screen<NC::Window>
|
|||||||
static const int WindowTimeout;
|
static const int WindowTimeout;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void init();
|
virtual bool isLockable() OVERRIDE { return true; }
|
||||||
virtual bool isLockable() { return true; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void DrawSoundWave(int16_t *, ssize_t, size_t, size_t);
|
void DrawSoundWave(int16_t *, ssize_t, size_t, size_t);
|
||||||
|
|||||||
Reference in New Issue
Block a user