#define RemoteStartDev ""//No devices passed
// FIXME - check C++ - I think some of these are in std:: now ?
+// FIXME - Not on Windows. Obviously. Also _snprintf doesn't guarantee null termination.
+// FIXME When the Windows code is upped to VS2015 use snprintf instead of _snprintf.
#define SNPRINTF _snprintf
#define VSNPRINTF _vsnprintf
#define STRCASECMP _stricmp
pinfo.hasaccessunit=false;
}
-int DemuxerTS::scan(UCHAR *buf, int len)
+int DemuxerTS::scan(UCHAR* /*buf*/, int /*len*/)
{
switch (atype)
{
{
}
-int LedRaspberry::init(int tdevice)
+int LedRaspberry::init(int /*tdevice*/)
{
if (initted) return 0;
FILE *led=fopen(GREEN_LED,"w");
// ----------------------------------- Callback
-void PlayerLiveRadio::call(void* caller)
+void PlayerLiveRadio::call(void* /*caller*/)
{
}
}
}
}
+ FALLTHROUGH // keep compiler happy (all posibilities return)
case S_PAUSE_P: // from S_PAUSE_P -----------------------------------
{
switch(toState)
}
}
}
+ FALLTHROUGH // keep compiler happy (all posibilities return)
case S_STOP: // from S_STOP -----------------------------------
{
switch(toState)
// ----------------------------------- Callback
-void PlayerRadio::call(void* caller)
+void PlayerRadio::call(void* /*caller*/)
{
threadSignalNoLock();
}
Timers::getInstance()->setTimerT(this, 1, dt);
}
-void VEpg::timercall(int clientReference)
+void VEpg::timercall(int /*clientReference*/)
{
drawData();
boxstack->update(this);
}
}
-int VPictureBanner::handleCommand(int command)
+int VPictureBanner::handleCommand(int /*command*/)
{
//don not handle commands - leave this to the picture viewer
return 0;
VRecordingList();
virtual ~VRecordingList();
-
+ using TBBoxx::draw;
virtual void draw(bool doIndexPop = false)=0;
+
int handleCommand(int command);
void processMessage(Message* m);
bool load();
/*
- Copyright 2004-2007 Chris Tallon
+ Copyright 2004-2020 Chris Tallon
This file is part of VOMP.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
-#include "vrecordinglistadvanced.h"
+#include <cstdio>
+#include <sstream>
#include "recman.h"
#include "directory.h"
#include "seriesinfo.h"
#include "staticartwork.h"
-#include <sstream>
+#include "vrecordinglistadvanced.h"
VRecordingListAdvanced::VRecordingListAdvanced()
{
- setSize(640, 500); //old setSize(570, 420);
- createBuffer();
-
- setPosition(40, 40);
-
- setTitleBarOn(1);
- setTitleBarColour(DrawStyle::TITLEBARBACKGROUND);
- TVMediaInfo *info= new TVMediaInfo();
- info->setStaticArtwork(sa_recordings);
- setTitleBarIcon(info);
-
- sl.setPosition(10, 30 + 5);
- sl.setSize(area.w*42/100 - 20, area.h - 30 - 15 - 30);
- sl.setLinesPerOption(2.4f);
- add(&sl);
-
- Region slarea=sl.getRegionR();
-
- epg.setParaMode(true);
- epg.setPosition(slarea.x +slarea.w+10 ,30+5);
- epg.setSize(area.w -slarea.x -slarea.w -10, area.h - 30 - 15 - 30);
- add(&epg);
- epg.setText("");
- epg.setBackgroundColour(DrawStyle::VIEWBACKGROUND);
-
- epgTVmedia.setPosition(epg.getRegionR().w-100-10,10);
- epgTVmedia.setSize(100,(UINT)(150/Osd::getInstance()->getPixelAspect()));
- epg.add(&epgTVmedia);
-
+ setSize(640, 500);
+ createBuffer();
+
+ setPosition(40, 40);
+
+ setTitleBarOn(1);
+ setTitleBarColour(DrawStyle::TITLEBARBACKGROUND);
+ TVMediaInfo* info = new TVMediaInfo();
+ info->setStaticArtwork(sa_recordings);
+ setTitleBarIcon(info);
+
+ sl.setPosition(10, 30 + 5);
+ sl.setSize(area.w*42/100 - 20, area.h - 30 - 15 - 30);
+ sl.setLinesPerOption(2.4f);
+ add(&sl);
+
+ Region slarea = sl.getRegionR();
+
+ epg.setParaMode(true);
+ epg.setPosition(slarea.x +slarea.w+10 ,30+5);
+ epg.setSize(area.w -slarea.x -slarea.w -10, area.h - 30 - 15 - 30);
+ add(&epg);
+ epg.setText("");
+ epg.setBackgroundColour(DrawStyle::VIEWBACKGROUND);
+
+ epgTVmedia.setPosition(epg.getRegionR().w-100-10,10);
+ epgTVmedia.setSize(100, static_cast<UINT>(150/Osd::getInstance()->getPixelAspect()));
+ epg.add(&epgTVmedia);
}
VRecordingListAdvanced::~VRecordingListAdvanced()
for (i = dirList->begin(); i != dirList->end(); i++)
{
currentSubDir = *i;
- SNPRINTF(tempA, 299, tr("\t%s \n \t <dir> %lu/%lu"), currentSubDir->name, currentSubDir->getNumNewRecordings(), currentSubDir->getNumRecordings());
+ SNPRINTF(tempA, 300, tr("\t%s \n \t <dir> %lu/%lu"), currentSubDir->name, currentSubDir->getNumNewRecordings(), currentSubDir->getNumRecordings());
TVMediaInfo *info=new TVMediaInfo();
if (currentSubDir->recList.begin() != currentSubDir->recList.end())
for (j = recList->begin(); j != recList->end(); j++)
{
currentRec = *j;
- time_t recStartTime = (time_t)currentRec->getStartTime();
+ time_t recStartTime = static_cast<time_t>(currentRec->getStartTime());
LOCALTIME_R(&recStartTime, &btime);
-//NMT does not like this too!
- //#ifndef _MSC_VER
-// strftime(tempA, 299, "%0d/%0m %0H:%0M ", &btime);
-//#else
strftime(tempA, 299, "%d/%m/%y %H:%M ", &btime);
-//#endif
- sprintf(tempB, "%c\t%s\n \t%s", (currentRec->getNew() ? '*': ' '), currentRec->getProgName(),tempA);
+ int check = SNPRINTF(tempB, 300, "%c\t%s\n \t%s", (currentRec->getNew() ? '*': ' '), currentRec->getProgName(), tempA);
+ if ((check < 0) || (check > 299)) Log::getInstance()->log("VRecordingsListAdvanced", Log::ERR, "String too big");
+
// New TVMedia stuff
TVMediaInfo *info= new TVMediaInfo();
info->setPosterThumb(currentRec->getFileName());
if (recman->isSubDir())
{
char title[300];
- SNPRINTF(title, 299, tr("Recordings - %s"), recman->getCurDirName());
+ SNPRINTF(title, 300, tr("Recordings - %s"), recman->getCurDirName());
setTitleText(title, 364);
}
else
drawData(doIndexPop);
}
-
TBBoxx::draw();
if (loading)
{
char freeSpace[50];
int gigFree = recman->getFreeSpace() / 1024;
- SNPRINTF(freeSpace, 49, tr("%lu%% used, %iGB free"), recman->getUsedPercent(), gigFree);
+ SNPRINTF(freeSpace, 50, tr("%lu%% used, %iGB free"), recman->getUsedPercent(), gigFree);
drawTextRJ(freeSpace, 560+70, 5, DrawStyle::LIGHTTEXT);
// Symbols
rectangle(area.w/2-65, area.h-115, 180, 25, DrawStyle::VIEWBACKGROUND);
#endif
char showing[200];
- sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
+ SNPRINTF(showing, 200, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
drawText(showing, area.w/2-65, area.h-35, DrawStyle::LIGHTTEXT);
}
{
currentRec = *j;
- time_t recStartTime = (time_t)currentRec->getStartTime();
+ time_t recStartTime = static_cast<time_t>(currentRec->getStartTime());
LOCALTIME_R(&recStartTime, &btime);
strftime(tempA, 299, "%d/%m/%y %H:%M ", &btime);
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef VRECORDINGLIST_ADVANCED_H
#define VRECORDINGLIST_ADVANCED_H
-
-
-#include "vrecordinglist.h"
#include "wtextbox.h"
#include "wtvmedia.h"
+#include "vrecordinglist.h"
class VRecordingListAdvanced : public VRecordingList
{
VRecordingListAdvanced();
virtual ~VRecordingListAdvanced();
+ using TBBoxx::draw; // Signal the compiler we are intentionally overriding the draw() virtual with different args
void draw(bool doIndexPop = false);
+
bool load();
void drawData(bool doIndexPop = false);
WTextbox epg;
WTVMedia epgTVmedia;
-
};
#endif
/*
- Copyright 2004-2007 Chris Tallon
+ Copyright 2004-2020 Chris Tallon
This file is part of VOMP.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
-#include "vrecordinglistclassic.h"
-
#include "recman.h"
#include "directory.h"
#include "recording.h"
#include "vinfo.h"
#include "log.h"
+#include "vrecordinglistclassic.h"
+
VRecordingListClassic::VRecordingListClassic()
{
setSize(570, 420);
for (i = dirList->begin(); i != dirList->end(); i++)
{
currentSubDir = *i;
- SNPRINTF(tempA, 299, tr("<dir> %lu/%lu\t \t%s"), currentSubDir->getNumNewRecordings(), currentSubDir->getNumRecordings(), currentSubDir->name);
+ SNPRINTF(tempA, 300, tr("<dir> %lu/%lu\t \t%s"), currentSubDir->getNumNewRecordings(), currentSubDir->getNumRecordings(), currentSubDir->name);
currentSubDir->index = sl.addOption(tempA, 0, first);
first = 0;
}
for (j = recList->begin(); j != recList->end(); j++)
{
currentRec = *j;
- time_t recStartTime = (time_t)currentRec->getStartTime();
+ time_t recStartTime = static_cast<time_t>(currentRec->getStartTime());
LOCALTIME_R(&recStartTime, &btime);
-//NMT does not like this too!
- //#ifndef _MSC_VER
-// strftime(tempA, 299, "%0d/%0m %0H:%0M ", &btime);
-//#else
- strftime(tempA, 299, "%d/%m %H:%M ", &btime);
-//#endif
- sprintf(tempB, "%s\t%c\t%s", tempA, (currentRec->getNew() ? '*': ' '), currentRec->getProgName());
+ strftime(tempA, 300, "%d/%m %H:%M ", &btime);
+ int check = SNPRINTF(tempB, 300, "%s\t%c\t%s", tempA, (currentRec->getNew() ? '*': ' '), currentRec->getProgName());
+ if ((check < 0) || (check > 299)) Log::getInstance()->log("VRecordingListClassic", Log::ERR, "String too big");
currentRec->index = sl.addOption(tempB, 0, first);
first = 0;
if (recman->isSubDir())
{
char title[300];
- SNPRINTF(title, 299, tr("Recordings - %s"), recman->getCurDirName());
+ SNPRINTF(title, 300, tr("Recordings - %s"), recman->getCurDirName());
setTitleText(title, 364);
}
else
{
char freeSpace[50];
int gigFree = recman->getFreeSpace() / 1024;
- SNPRINTF(freeSpace, 49, tr("%lu%% used, %iGB free"), recman->getUsedPercent(), gigFree);
+ SNPRINTF(freeSpace, 50, tr("%lu%% used, %iGB free"), recman->getUsedPercent(), gigFree);
drawTextRJ(freeSpace, 560, 5, DrawStyle::LIGHTTEXT);
// Symbols
rectangle(220, 385, 180, 25, DrawStyle::VIEWBACKGROUND);
#endif
char showing[200];
- sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
+ SNPRINTF(showing, 200, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
drawText(showing, 220, 385, DrawStyle::LIGHTTEXT);
}
/*
- Copyright 2004-2005 Chris Tallon
+ Copyright 2004-2020 Chris Tallon
This file is part of VOMP.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef VRECORDINGLIST_CLASSIC_H
#define VRECORDINGLIST_CLASSIC_H
-
-
#include "vrecordinglist.h"
-
class VRecordingListClassic : public VRecordingList
{
public:
VRecordingListClassic();
virtual ~VRecordingListClassic();
+ using TBBoxx::draw;
void draw(bool doIndexPop = false);
+
bool load();
void drawData(bool doIndexPop = false);
protected:
void quickUpdate();
void doShowingBar();
-
};
#endif
threadStart();
}
-int VScreensaver::handleCommand(int command)
+int VScreensaver::handleCommand(int /*command*/)
{
threadCancel();
return 4;
/*
- Copyright 2004-2005 Chris Tallon
+ Copyright 2004-2020 Chris Tallon
This file is part of VOMP.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
-#include "vtimerlist.h"
+#include <stdio.h>
+#include <string.h>
+#include <cstdio>
+#include <vector>
#include "message.h"
#include "input.h"
#include "vtimeredit.h"
#include "command.h"
#include "boxstack.h"
-#include "vdr.h"
#include "vinfo.h"
#include "log.h"
#include "staticartwork.h"
+#include "vtimerlist.h"
+
VTimerList::VTimerList()
{
- recTimerList = NULL;
-
clockRegion.x = 420;
clockRegion.y = 0;
clockRegion.w = 150;
clockRegion.h = 30;
-
-
- flipflop = true;
-
setSize(570, 420);
createBuffer();
{
recTimer = (*recTimerList)[i];
time_t rectime = recTimer->startTime;
- LOCALTIME_R((time_t*)&rectime, &btime);
+ LOCALTIME_R(&rectime, &btime);
strftime(strA, 299, "%d/%m %H:%M ", &btime);
- SNPRINTF(strB, 299, "%s\t%s", strA, recTimer->getName());
+ int check = SNPRINTF(strB, 300, "%s\t%s", strA, recTimer->getName());
+ if ((check < 0) || (check > 299)) Log::getInstance()->log("VTimerList", Log::ERR, "String too big");
sl.addOption(strB, recTimer, first);
first = 0;
}
case Input::OK:
{
RecTimer* recTimer = NULL;
- if (recTimerList) recTimer = (RecTimer*)sl.getCurrentOptionData();
+ if (recTimerList) recTimer = reinterpret_cast<RecTimer*>(sl.getCurrentOptionData());
if (recTimer == NULL) return 2;
VTimerEdit* v = new VTimerEdit(recTimer);
}
else if (m->message == Message::DELETE_SELECTED_TIMER)
{
- RecTimer* recTimer = (RecTimer*)sl.getCurrentOptionData();
+ RecTimer* recTimer = reinterpret_cast<RecTimer*>(sl.getCurrentOptionData());
if (recTimer == NULL) return;
Log::getInstance()->log("VTimerList", Log::DEBUG, "Got timer to delete");
/*
- Copyright 2004-2005 Chris Tallon
+ Copyright 2004-2020 Chris Tallon
This file is part of VOMP.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with VOMP; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef VTIMERLIST_H
#define VTIMERLIST_H
-#include <stdio.h>
-#include <string.h>
-#include <vector>
-
+#include "vdr.h"
#include "tbboxx.h"
#include "timerreceiver.h"
-#include "vdr.h"
#include "wselectlist.h"
#include "region.h"
void draw();
private:
- RecTimerList* recTimerList;
-
- WSelectList sl;
-
void drawClock();
void drawShowing();
void drawData();
void drawIndicators();
void quickUpdate();
+ RecTimerList* recTimerList{};
+ WSelectList sl;
+ bool flipflop{true};
Region clockRegion;
Region indicatorsRegion;
-
- bool flipflop;
};
#endif