From e5ca9dfde8a0d140b0c299edbf31b1261ab2dc65 Mon Sep 17 00:00:00 2001 From: Bob van Loosen Date: Wed, 26 Dec 2012 22:59:36 +0100 Subject: [PATCH] added: commandline argument -f to set the fps --- src/bitvis.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/bitvis.cpp b/src/bitvis.cpp index 72c23da..234b956 100644 --- a/src/bitvis.cpp +++ b/src/bitvis.cpp @@ -58,6 +58,23 @@ CBitVis::CBitVis(int argc, char *argv[]) m_fontdisplay = 0; m_songupdatetime = GetTimeUs(); + const char* flags = "f:"; + int c; + while ((c = getopt(argc, argv, flags)) != -1) + { + if (c == 'f') //fps + { + int fps; + if (!StrToInt(string(optarg), fps) || fps <= 0) + { + LogError("Wrong argument \"%s\" for fps", optarg); + exit(1); + } + + m_fps = fps; + } + } + m_mpdclient = new CMpdClient("music.bitlair", 6600); m_mpdclient->StartThread(); }