mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-01 17:58:29 +00:00
Added an error dialog if no visualizers are installed.
This commit is contained in:
parent
0f7a5a20b5
commit
f79daccb1e
@ -41,15 +41,35 @@
|
|||||||
#include <cursespp/App.h>
|
#include <cursespp/App.h>
|
||||||
#include <cursespp/SimpleScrollAdapter.h>
|
#include <cursespp/SimpleScrollAdapter.h>
|
||||||
#include <cursespp/ListOverlay.h>
|
#include <cursespp/ListOverlay.h>
|
||||||
|
#include <cursespp/DialogOverlay.h>
|
||||||
|
|
||||||
using namespace musik::box;
|
using namespace musik::box;
|
||||||
using namespace musik::core::audio;
|
using namespace musik::core::audio;
|
||||||
using namespace cursespp;
|
using namespace cursespp;
|
||||||
|
|
||||||
|
static void showNoVisualizersMessage() {
|
||||||
|
std::shared_ptr<DialogOverlay> dialog(new DialogOverlay());
|
||||||
|
|
||||||
|
(*dialog)
|
||||||
|
.SetTitle("musikbox")
|
||||||
|
.SetMessage("no visualizers found!")
|
||||||
|
.AddButton(
|
||||||
|
"KEY_ENTER",
|
||||||
|
"ENTER",
|
||||||
|
"ok");
|
||||||
|
|
||||||
|
App::Overlays().Push(dialog);
|
||||||
|
}
|
||||||
|
|
||||||
VisualizerOverlay::VisualizerOverlay() {
|
VisualizerOverlay::VisualizerOverlay() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualizerOverlay::Show() {
|
void VisualizerOverlay::Show() {
|
||||||
|
if (!vis::VisualizerCount()) {
|
||||||
|
showNoVisualizersMessage();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
using Adapter = cursespp::SimpleScrollAdapter;
|
using Adapter = cursespp::SimpleScrollAdapter;
|
||||||
using ListOverlay = cursespp::ListOverlay;
|
using ListOverlay = cursespp::ListOverlay;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user