-#CXXFLAGS_DEV = $(DEFINES) -DDEV -g -O0 -Wall -Wextra -Wshadow -Werror=return-type -Wmissing-format-attribute -Wdisabled-optimization -Wmissing-declarations -Wmissing-noreturn -Winit-self -Woverloaded-virtual -Wold-style-cast -Wconversion -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
-CXXFLAGS_DEV = $(DEFINES) -DDEV -g -O0 -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
+CXXFLAGS_DEV = $(DEFINES) -DDEV -g -O0 -Wall -Wextra -Wshadow -Werror=return-type -Wmissing-format-attribute -Wdisabled-optimization -Wmissing-declarations -Wmissing-noreturn -Winit-self -Woverloaded-virtual -Wold-style-cast -Wconversion -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
+#CXXFLAGS_DEV = $(DEFINES) -DDEV -g -O0 -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
CXXFLAGS_REL = $(DEFINES) -O3 -Wall -Werror -std=c++14 $(CXXFLAGS_EXTRA) $(INCLUDES)
.PHONY: clean fresh all install strip
#include "messagequeue.h"
#include "input.h"
-#include "oldlog.h"
+#include "log.h"
+
+static const char* TAG = "BoxStack";
BoxStack* BoxStack::instance = NULL;
int BoxStack::add(Boxx* v)
{
if (!initted) return 0;
- Log::getInstance()->log("BoxStack", Log::DEBUG, "add called");
+ LogNT::getInstance()->debug(TAG, "add called");
boxLock.lock();
- Log::getInstance()->log("BoxStack", Log::DEBUG, "Locked for add");
+ LogNT::getInstance()->debug(TAG, "Locked for add");
if (numBoxes == 16)
{ //Error
- Log::getInstance()->log("BoxStack", Log::ERR, "More than 16 boxes! Unlocked for add");
+ LogNT::getInstance()->error(TAG, "More than 16 boxes! Unlocked for add");
boxLock.unlock();
return 0;
}
boxLock.unlock();
VideoDisplay vd;
if (v->getVideoDisplay(vd)) {
- Log::getInstance()->log("BoxStack", Log::DEBUG, "Add video display");
+ LogNT::getInstance()->debug(TAG, "Add video display");
addVideoDisplay(v,vd);
}
- Log::getInstance()->log("BoxStack", Log::DEBUG, "Unlocked for add");
+ LogNT::getInstance()->debug(TAG, "Unlocked for add");
return 1;
}
VideoDisplay *display = NULL;
boxLock.lock();
- Log::getInstance()->log("BoxStack", Log::DEBUG, "Locked for remove");
+ LogNT::getInstance()->debug(TAG, "Locked for remove");
if (numBoxes == 0)
{
boxLock.unlock();
- Log::getInstance()->log("BoxStack", Log::ERR, "Unlocked for remove numBoxes == 0");
+ LogNT::getInstance()->error(TAG, "Unlocked for remove numBoxes == 0");
return 0;
}
-// Log::getInstance()->log("BoxStack", Log::DEBUG, "entering remove, numBoxes=%i", numBoxes);
+// LogNT::getInstance()->debug(TAG, "entering remove, numBoxes={}", numBoxes);
int i;
// to be deleted box is more likely to be at the top
for (i = numBoxes-1; i >= 0; i--)
{
-// Log::getInstance()->log("BoxStack", Log::DEBUG, "todel: %p, i=%i, boxes[i]=%p", toDelete, i, boxes[i]);
+// LogNT::getInstance()->debug(TAG, "todel: {}, i={}, boxes[i]={}", (void*)toDelete, i, (void*)boxes[i]);
if (boxes[i] == toDelete) break;
}
// not a Box we have!
// FIXME
boxLock.unlock();
- Log::getInstance()->log("BoxStack", Log::ERR, "Unlocked for remove - no boxx deleted");
+ LogNT::getInstance()->error(TAG, "Unlocked for remove - no boxx deleted");
return 0;
}
}
boxLock.lock();
- //Log::getInstance()->log("BoxStack", Log::DEBUG, "Starting repaintRevealed loop");
+ //LogNT::getInstance()->debug(TAG, "Starting repaintRevealed loop");
RegionList rl;
boxSplit(boxes[i]->area, i + 1, numBoxes, 1, rl);
while(!rl.empty())
repaintRevealed(i, rl.front());
rl.pop_front();
}
- //Log::getInstance()->log("BoxStack", Log::DEBUG, "Done repaintRevealed loop");
+ //LogNT::getInstance()->debug(TAG, "Done repaintRevealed loop");
// Shift the boxes on top down one
--numBoxes;
if (!videoStack.empty()) display=&videoStack.top().second;
}
boxLock.unlock();
- Log::getInstance()->log("BoxStack", Log::DEBUG, "Unlocked for remove");
+ LogNT::getInstance()->debug(TAG, "Unlocked for remove");
// Delete the box
//AVO: do this delete outside the lock to allow for recursive calls within the destructor
// as this box is not in the stack any more, there is no chance for a second delete
- Log::getInstance()->log("BoxStack", Log::DEBUG, "remove: going to delete boxx %p, num %d", toDelete, numBoxes);
+ LogNT::getInstance()->debug(TAG, "remove: going to delete boxx {}, num {}", (void*)toDelete, numBoxes);
delete toDelete;
osd->doRender();
if (display) {
- Log::getInstance()->log("BoxStack", Log::DEBUG, "setVideoDisplay %d %d %d %d %d %d", display->mode, display->fallbackMode,
+ LogNT::getInstance()->debug(TAG, "setVideoDisplay {} {} {} {} {} {}", display->mode, display->fallbackMode,
display->x, display->y, display->width, display->height);
Video::getInstance()->setVideoDisplay(*display);
}
void BoxStack::update(Boxx* toUpdate, const Region* regionToUpdate)
{
-// Log::getInstance()->log("BoxStack", Log::DEBUG, "Update called");
+// LogNT::getInstance()->debug(TAG, "Update called");
if (!initted) return; // it is allowed to call this before init
boxLock.lock();
-// Log::getInstance()->log("BoxStack", Log::DEBUG, "Locked for update");
+// LogNT::getInstance()->debug(TAG, "Locked for update");
// Get the z index of the box
int z = 0;
{
// not a Box we have!
boxLock.unlock();
- Log::getInstance()->log("BoxStack", Log::ERR, "Unlocked for update! box not inside boxstack");
+ LogNT::getInstance()->error(TAG, "Unlocked for update! box not inside boxstack");
return;
}
}
if (!toUpdate) {
boxLock.unlock();
- Log::getInstance()->log("BoxStack", Log::DEBUG, "Unlocked for update, no box present");
+ LogNT::getInstance()->debug(TAG, "Unlocked for update, no box present");
return ;
}
}
boxLock.unlock();
-// Log::getInstance()->log("BoxStack", Log::DEBUG, "Unlocked for update");
+// LogNT::getInstance()->debug(TAG, "Unlocked for update");
}
void BoxStack::repaintRevealed(int x, Region r)
}
else
{
- Log::getInstance()->log("BoxStack", Log::ERR, "Can this actually happen? Why?");
+ LogNT::getInstance()->error(TAG, "Can this actually happen? Why?");
toDel = NULL;
}
boxLock.unlock();
//AVO: do the delete outside the lock to allow for recursive deletes
- Log::getInstance()->log("BoxStack", Log::DEBUG, "removeall: going to delete boxx %p, num=%d", toDel, numBoxes);
+ LogNT::getInstance()->debug(TAG, "removeall: going to delete boxx {}, num={}", (void*)toDel, numBoxes);
if (display) Video::getInstance()->setVideoDisplay(*display);
if (toDel) delete toDel;
for (i=numBoxes-1; i>=0; i--)
{
- // Log::getInstance()->log("BoxStack", Log::DEBUG, "Giving command to i=%i", i);
+ // LogNT::getInstance()->debug(TAG, "Giving command to i={}", i);
retVal = boxes[i]->handleCommand(command);
if (retVal == 1)
{
}
else if (retVal == 4)
{
-// Log::getInstance()->log("BoxStack", Log::DEBUG, "Return 4: i=%i, boxes[i]=%p", i, boxes[i]);
+// LogNT::getInstance()->debug(TAG, "Return 4: i={}, boxes[i]={}", i, (void*)boxes[i]);
remove(boxes[i]);
retVal2 = 1;
break;
{
if (boxes[i] == m->to)
{
- Log::getInstance()->log("BoxStack", Log::DEBUG, "sending message from box %p to box %p %lu", m->from, m->to, m->message);
+ LogNT::getInstance()->debug(TAG, "sending message from box {} to box {} {}", (void*)m->from, (void*)m->to, m->message);
boxes[i]->processMessage(m);
return;
}
return;
}
- Log::getInstance()->log("BoxStack", Log::DEBUG, "it's for meeee!");
+ LogNT::getInstance()->debug(TAG, "it's for meeee!");
switch(m->message)
{
{
"main":
{
- "debug": false,
"daemonize": true
},
"log":
{
- "enabled": true,
+ "enabled": false,
"filename": "stdout",
"level": "debug"
},
#include "callback.h"
#include "dvbsubtitles.h"
-#include "oldlog.h"
+#include "log.h"
#include <cstdlib>
#include <algorithm>
#define SEEK_THRESHOLD 150000 // About 1.5 seconds
+static const char* TAG = "Demuxer";
+
// Statics
const int Demuxer::FrameRates[9] = { 0, 23, 24, 25, 29, 30, 50, 59, 60 };
Demuxer* Demuxer::instance = NULL;
pos+=nalu.getPos();
} if (testpattern==DEMUXER_H264_CODED_SLICE_IDR || testpattern==DEMUXER_H264_CODED_SLICE_NON_IDR ) {
- /* Log::getInstance()->log("Demuxer", Log::ERR,
+ /* LogNT::getInstance()->error(TAG,
"Has slice %d %d %d %d %d",pinfo.hasaccessunit, pinfo.hassps,pinfo.frame_mbs_only_flag,pinfo.separate_color_plane_flag,
pinfo.log2_max_frame_num);*/
if (pinfo.hasaccessunit && pinfo.hassps) {
!audiostream.init(audio, demuxMemoryA) ||
!teletextstream.init(teletext, demuxMemoryT))
{
- Log::getInstance()->log("Demuxer", Log::CRIT,
- "Failed to initialize demuxer");
+ LogNT::getInstance()->crit(TAG, "Failed to initialize demuxer");
shutdown();
return 0;
}
void Demuxer::reset()
{
- Log::getInstance()->log("Demuxer", Log::DEBUG, "Reset called");
+ LogNT::getInstance()->debug(TAG, "Reset called");
flush();
video_current = audio_current = teletext_current = subtitle_current = -1;
horizontal_size = vertical_size = 0;
void Demuxer::flush()
{
- Log::getInstance()->log("Demuxer", Log::DEBUG, "Flush called");
+ LogNT::getInstance()->debug(TAG, "Flush called");
videostream.flush();
audiostream.flush();
{
if ((aspect_ratio != ar) || (parx != taspectx) || (pary != taspecty) )
{
- Log::getInstance()->log("Demux", Log::DEBUG,
- "Aspect ratio difference signalled");
+ LogNT::getInstance()->debug(TAG, "Aspect ratio difference signalled");
if (++arcnt > 3) // avoid changing aspect ratio if glitch in signal
{
arcnt = 0;
video_pts_seek + (1LL<<33) - audio_pts < SEEK_THRESHOLD) ))
{
aud_seeking = 0;
- Log::getInstance()->log("Demuxer", Log::DEBUG,
- "Leaving audio sync: Audio PTS = %llu", audio_pts);
+ LogNT::getInstance()->debug(TAG, "Leaving audio sync: Audio PTS = {}", audio_pts);
}
}
}
video_pts_seek + (1LL<<33) - audio_pts < SEEK_THRESHOLD) ))
{
aud_seeking = 0;
- Log::getInstance()->log("Demuxer", Log::DEBUG, "Leaving audio sync: Audio PTS = %llu", audio_pts);
+ LogNT::getInstance()->debug(TAG, "Leaving audio sync: Audio PTS = {}", audio_pts);
}
}
break;
int commona;
int commonb;
- // Log::getInstance()->log("Demuxer", Log::DEBUG, "PAR test1 %d %d %d %d ", aspectx,aspecty,commona,commonb);
+ // LogNT::getInstance()->debug(TAG, "PAR test1 {} {} {} {}", aspectx, aspecty, commona, commonb);
commona=aspectx;
commonb=aspecty;
}
aspectx=aspectx/commona;
aspecty=aspecty/commona;
- //Log::getInstance()->log("Demuxer", Log::DEBUG, "PAR test2 %d %d %d %d %d %d %d", aspectx,aspecty,aspectDARx,aspectDARy,horizontal_size,vertical_size,commona);
+ //LogNT::getInstance()->debug(TAG, "PAR test2 {} {} {} {} {} {} {}", aspectx,aspecty,aspectDARx,aspectDARy,horizontal_size,vertical_size,commona);
setAspectRatio(aspect,aspectx,aspecty);
frame_rate = packet[pos+3] & 0x0f;
{
vid_seeking = 0;
video_pts_seek = video_pts;
- Log::getInstance()->log("Demuxer", Log::DEBUG,
- "Entering audio sync: Video PTS = %llu", video_pts);
- Log::getInstance()->log("Demuxer", Log::DEBUG,
- "Entering audio sync: Audio PTS = %llu", audio_pts);
+ LogNT::getInstance()->debug(TAG, "Entering audio sync: Video PTS = {}", video_pts);
+ LogNT::getInstance()->debug(TAG, "Entering audio sync: Audio PTS = {}", audio_pts);
}
return;
}
*/
#include "demuxerts.h"
-#include "oldlog.h"
+#include "log.h"
#include "video.h"
#include "vdr.h"
#include "audio.h"
int pmtpid = (*(curbuf+11)<< 8) | *(curbuf+12);
if ((pmtpid >> 13) != 0x07)
{
- Log::getInstance()->log("findPTS", Log::DEBUG, "PMTPID=%02x %02x TRAILING 111 not set but %x", *(curbuf+11),*(curbuf+12), (pmtpid >> 13));
+ LogNT::getInstance()->debug("findPTS", "PMTPID={:#x} {:#x} TRAILING 111 not set but {:#x}", *(curbuf+11),*(curbuf+12), (pmtpid >> 13));
}
else
{
p += 2; //skip ES length
if ((foundpid >> 13) != 0x07)
{
- Log::getInstance()->log("findPTS", Log::DEBUG, "FOUNDPID=%02x %02x TRAILING 111 not set but %x", *(buf+p),*(buf+p+1), (foundpid >> 13));
+ LogNT::getInstance()->debug("findPTS", "FOUNDPID={:#x} {:#x} TRAILING 111 not set but {:#x}", *(buf+p),*(buf+p+1), (foundpid >> 13));
}
else
{
frameCounting = true;
frameNumber = frame;
framereserve=0;
- Log::getInstance()->log("DemuxerTS", Log::DEBUG, "setFrameNum %d", frame);
+ LogNT::getInstance()->debug("DemuxerTS", "setFrameNum {}", frame);
}
void DemuxerTS::setPacketNum(ULONG npacket)
{
packetCounting = true;
packetNumber = npacket;
- Log::getInstance()->log("DemuxerTS", Log::DEBUG, "setPacketNum %d", npacket);
+ LogNT::getInstance()->debug("DemuxerTS", "setPacketNum {}", npacket);
}
int DemuxerTS::put(UCHAR* buf, int len)
else
{ // Packet not terminated. Find another candidate, and shift store
if (!misaligned_mess) {
- Log::getInstance()->log("TS Demuxer", Log::ERR, "TS Misaligned!A");
+ LogNT::getInstance()->error("TS Demuxer", "TS Misaligned!A");
misaligned_mess=true; // do not alarm more than once
}
int search = 1;
while (len > 0 && *buf != TS_SIG)
{
if (!misaligned_mess) {
- Log::getInstance()->log("TS Demuxer", Log::ERR, "TS Misaligned!B");
+ LogNT::getInstance()->error("TS Demuxer", "TS Misaligned!B");
misaligned_mess=true; // do not alarm more than once
}
buf++; ret++; len--;
int pmtpid = (*(buf+11)<< 8) | *(buf+12);
if ((pmtpid >> 13) != 0x07)
{
- Log::getInstance()->log("ProcessTS", Log::DEBUG, "PMTPID=%02x %02x TRAILING 111 not set but %x", *(buf+11),*(buf+12), (pmtpid >> 13));
+ LogNT::getInstance()->debug("ProcessTS", "PMTPID={:#x} {:#x} TRAILING 111 not set but {:#x}", *(buf+11),*(buf+12), (pmtpid >> 13));
}
else
{
p += 2; //skip ES length
if ((foundpid >> 13) != 0x07)
{
- Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDPID=%02x %02x TRAILING 111 not set but %x", *(buf+p),*(buf+p+1), (foundpid >> 13));
+ LogNT::getInstance()->debug("ProcessTS", "FOUNDPID={:#x} {:#x} TRAILING 111 not set but {:#x}", *(buf+p),*(buf+p+1), (foundpid >> 13));
}
else
{
bool notfound=false;
bool nolang=true;
int pos=0;
- // Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDPID is %x %x", foundpid,streamtype);
+ // LogNT::getInstance()->debug("ProcessTS", "FOUNDPID is {:#x} {:#x}", foundpid,streamtype);
switch (streamtype)
{
case 0x1B: //MPEG 4 for future use
if (streamtype==0x1b) h264=true;
else h264=false;
- // Log::getInstance()->log("ProcessTS", Log::DEBUG, "Set video PID to %x", foundpid);
+ // LogNT::getInstance()->debug("ProcessTS", "Set video PID to {:#x}", foundpid);
}break;
case 0x0F: //AAC ADTS packaging
case 0x11: // LATM packaging
newapid.desc[2]=buf[p+pos+4];
newapid.desc[3]=0;
nolang=false;
- // Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDLANG is %s", newapid.desc);
+ // LogNT::getInstance()->debug("ProcessTS", "FOUNDLANG is {}", newapid.desc);
} break;
};
newapid.desc[3]=0;
newapid.data1=(buf[p+pos+5]<<8) |(buf[p+pos+6]);
newapid.data2=(buf[p+pos+7]<<8) |(buf[p+pos+8]);
- // Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDSUB is %s", newapid.desc);
+ // LogNT::getInstance()->debug("ProcessTS", "FOUNDSUB is {}", newapid.desc);
notfound=false;
nolang=false;
} break;
newapid.desc[2]=buf[p+pos+4];
newapid.desc[3]=0;
nolang=false;
- // Log::getInstance()->log("ProcessTS", Log::DEBUG, "FOUNDLANG is %s", newapid.desc);
+ // LogNT::getInstance()->debug("ProcessTS", "FOUNDLANG is {}", newapid.desc);
} break;
case 0x56: {
type=3;
if (pid == subID && subActive && subPacket.getLength() == subLength)
{
parsePacketDetails(subPacket);
-//Log::getInstance()->log("DEMUXERTS", Log::DEBUG, "SUBMITTING A SUBTITLE PACKET %d %x", subLength, subPacket.getSubstream());
+//LogNT::getInstance()->debug("DEMUXERTS", "SUBMITTING A SUBTITLE PACKET {} {:#x}", subLength, subPacket.getSubstream());
submitPacket(subPacket);
subActive = false;
}
while (iter != pts_map.end())
{
++total;
- //Log::getInstance()->log("DemuxerTS", Log::DEBUG, "getFrameNumfromPTS pts1 %lld pts2 %lld", pts, iter->pts);
+ //LogNT::getInstance()->debug("DemuxerTS", "getFrameNumfromPTS pts1 {} pts2 {}", pts, iter->pts);
if (PTSDifference(iter->pts, pts) < PTS_ALLOWANCE)
{
difference = 0;
}
pts_map_mutex.unlock();
- //Log::getInstance()->log("DemuxerTS", Log::DEBUG, "getFrameNumfromPTS pts %lld deleted %d difference %lld", pts, total,difference);
+ //LogNT::getInstance()->debug("DemuxerTS", "getFrameNumfromPTS pts {} deleted {} difference {}", pts, total,difference);
if (difference == (1LL<<33))
return 0; // We cannot make sense of the pts
int pmtpid = (*(curbuf+11)<< 8) | *(curbuf+12);
if ((pmtpid >> 13) != 0x07)
{
- Log::getInstance()->log("DemuxerTS", Log::DEBUG, "PMTPID=%02x %02x TRAILING 111 not set but %x", *(curbuf+11),*(curbuf+12), (pmtpid >> 13));
+ LogNT::getInstance()->debug("DemuxerTS", "PMTPID={:#x} {:#x} TRAILING 111 not set but {:#x}", *(curbuf+11),*(curbuf+12), (pmtpid >> 13));
}
else
{
pmtpid = pmtpid & 0x1FFF; //clear upper 3 bits
pmtpidy = pmtpid;
- Log::getInstance()->log("DemuxerTS", Log::DEBUG, "PMT pid%02x",pmtpid );
+ LogNT::getInstance()->debug("DemuxerTS", "PMT pid {:#x}", pmtpid);
}
} else if (pid == pmtpidy) { //PMT
p += 2; //skip ES length
if ((foundpid >> 13) != 0x07)
{
- Log::getInstance()->log("DemuxerTS", Log::DEBUG, "FOUNDPID=%02x %02x TRAILING 111 not set but %x", *(buf+p),*(buf+p+1), (foundpid >> 13));
+ LogNT::getInstance()->debug("DemuxerTS", "FOUNDPID={:#x} {:#x} TRAILING 111 not set but {:#x}", *(buf+p),*(buf+p+1), (foundpid >> 13));
}
else
{
foundpid = foundpid & 0x1FFF; //clear upper 3 bits
// int pos=0; UNUSED?
- Log::getInstance()->log("DemuxerTS", Log::DEBUG, "Pid found %02x type %02x",foundpid ,streamtype);
+ LogNT::getInstance()->debug("DemuxerTS", "Pid found {:#x} type {:#x}",foundpid ,streamtype);
if (streamtype==1 || streamtype ==2) {
ish264=false;
- Log::getInstance()->log("DemuxerTS", Log::DEBUG, "Found Mpeg2 Video");
+ LogNT::getInstance()->debug("DemuxerTS", "Found Mpeg2 Video");
return true;
}
if (streamtype==0x1b) {
ish264=true;
- Log::getInstance()->log("DemuxerTS", Log::DEBUG, "Found h264 Video");
+ LogNT::getInstance()->debug("DemuxerTS", "Found h264 Video");
return true;
}
}
#include "demuxervdr.h"
#include "video.h"
#include "dvbsubtitles.h"
-#include "oldlog.h"
+#include "log.h"
#ifndef WIN32
#include <endian.h>
#define PTS_JUMP_MARGIN 10000
#define PTS_ALLOWANCE 90000
+static const char* TAG = "DemuxerVDR";
+
// TODO: PTS class to handle wrapping arithmetic & comparisons?
static ULLONG PTSDistance(ULLONG pts1, ULLONG pts2)
{
{
frameCounting = true;
frameNumber = frame;
- Log::getInstance()->log("Demuxer", Log::DEBUG, "setFrameNum %d", frame);
+ LogNT::getInstance()->debug(TAG, "setFrameNum {}", frame);
}
void DemuxerVDR::setPacketNum(ULONG npacket)
{
packetCounting = true;
packetNumber = npacket;
- Log::getInstance()->log("Demuxer", Log::DEBUG, "setPacketNum %d", npacket);
+ LogNT::getInstance()->debug(TAG, "setPacketNum {}", npacket);
}
int DemuxerVDR::put(UCHAR* buf, int len)
me.pts = packet.getPTS();
me.frame = frame_num;
pts_map_mutex.unlock();
-Log::getInstance()->log("Demuxer", Log::DEBUG, "+* PTS INIT *+ %llu %u", me.pts, me.frame);
+LogNT::getInstance()->debug(TAG, "+* PTS INIT *+ {} {}", me.pts, me.frame);
pts_map_mutex.lock();
pts_map.push_front(me);
}
if (PTSDistance(pts_expected, packet.getPTS()) > PTS_JUMP_MARGIN) // PTS jump!
{
-Log::getInstance()->log("Demuxer", Log::DEBUG, "+* PTS JUMP *+ %llu %u", packet.getPTS(), frame_num);
+LogNT::getInstance()->debug(TAG, "+* PTS JUMP *+ {} {}", packet.getPTS(), frame_num);
me.pts = packet.getPTS();
me.frame = frame_num;
pts_map_mutex.lock();
#endif*/
#include "vdr.h"
-#include "oldlog.h"
I18n::trans_table I18n::Translations;
*/
#include <bcm_host.h>
+
+#include "log.h"
#include "videoomx.h"
-#include "oldlog.h"
#include "vdr.h"
#include "woptionpane.h"
#include "util.h"
#include <bcm_host.h>
-#include "oldlog.h"
+#include "log.h"
#include "vdr.h"
#include "woptionpane.h"
#include "inputcec.h"
*/
#include <stdio.h>
+#include <unistd.h>
#include <linux/input.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "defines.h"
+class ExternLogger
+{
+ public:
+ virtual bool LogExtern(const char* message)=0;
+};
+
class LogNT
{
public:
#include "config.h"
#include "log.h"
-#include "oldlog.h"
#include "util.h"
#include "control.h"
[[ noreturn ]] void shutdown(int code);
Config* config;
-Log* logger;
LogNT* loggerNT;
Control* control;
}
// Start Log --------------------------------------------------------------------------------------------------
- logger = new Log();
- if (!logger)
- {
- printf("Failed to create Log object\n");
- shutdown(1);
- }
-
- bool debugEnabled;
- config->getBool("main", "debug", debugEnabled);
- if (!logger->init(Log::DEBUG, "dummy", debugEnabled ? 1 : 0)) // NCONFIG x2
- {
- printf("Could not initialise log object. Aborting.\n");
- shutdown(1);
- }
-
- logger->log("Main", Log::INFO, "Old log starting up...");
-
-
loggerNT = new LogNT();
if (!loggerNT)
std::string logFileName("stdout");
config->getString("log", "filename", logFileName);
+ bool debugEnabled;
+ config->getBool("main", "debug", debugEnabled);
if (!loggerNT->init(logFileName, debugEnabled ? 1 : 0)) // NCONFIG x2
{
printf("Could not initialise log object. Aborting.\n");
close(fdtty);
#endif
- if (logger)
+ if (loggerNT)
{
loggerNT->info(TAG, "Log module shutting down... bye!\n\n");
- logger->shutdown();
- delete logger;
+#warning loggerNT has no shutdown
+ //loggerNT->shutdown();
+ delete loggerNT;
}
if (config)
OBJ_COMMON = util.o control.o thread.o timers.o i18n.o udp4.o udp6.o vdpc.o tcp.o \
- message.o messagequeue.o wol.o audio.o video.o oldlog.o \
+ message.o messagequeue.o wol.o audio.o video.o \
vdr.o recman.o recording.o recinfo.o channel.o rectimer.o event.o \
directory.o mark.o option.o vfeed.o afeed.o \
demuxer.o demuxervdr.o demuxerts.o stream.o osd.o surface.o \
+++ /dev/null
-/*
- Copyright 2004-2005 Chris Tallon
- Copyright 2003-2004 University Of Bradford
-
- This file is part of VOMP.
-
- VOMP is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- VOMP is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- 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.
-*/
-
-#include <sys/types.h>
-
-#ifndef WIN32
-#include <sys/syscall.h>
-#include <unistd.h>
-#endif
-
-#include "vdr.h"
-
-
-#include "oldlog.h"
-
-
-#ifdef __ANDROID__
-#include <android/log.h>
-#endif
-
-Log* Log::instance = NULL;
-
-Log::Log()
-{
- if (instance) return;
- instance = this;
- logfile = NULL;
- initted = 0;
- logLevel = 0;
- extlog = NULL;
-}
-
-Log::~Log()
-{
- instance = NULL;
-}
-
-Log* Log::getInstance()
-{
- return instance;
-}
-
-void Log::upLogLevel()
-{
- if (logLevel == Log::DEBUG)
- {
- log("Log", logLevel, "Log level is at its highest already");
- return;
- }
-
- logLevel++;
- log("Log", logLevel, "Log level is now %i", logLevel);
-}
-
-void Log::downLogLevel()
-{
- if (logLevel == Log::CRAZY)
- {
- log("Log", logLevel, "Log level is at its lowest already");
- return;
- }
-
- logLevel--;
- log("Log", logLevel, "Log level is now %i", logLevel);
-}
-
-int Log::init(int startLogLevel, const char* fileName, int tenabled)
-{
- (void)fileName;
-
- initted = 1;
- logLevel = startLogLevel;
- enabled = tenabled;
-
- // FIXME fix this with NCONFIG
-// logfile = fopen(fileName, "a");
-// logfile = fopen(stdout, "a");
- logfile = stdout;
-// logfile = fopen("/log", "a");
-
- if (logfile) return 1;
- else return 0;
-}
-
-int Log::shutdown()
-{
- if (!initted) return 1;
- if (enabled && (logfile != stdout)) fclose(logfile);
- return 1;
-}
-
-int Log::log(const char *fromModule, int level,const char* message, ...)
-{
- if (!instance || !logfile) return 0;
-
- if (!enabled && !extlog) return 1;
- if (level > logLevel) return 1;
-
- char buffer[151];
- int spaceLeft = 150;
-
-#ifndef _MSC_VER
- struct timeval tv;
- gettimeofday(&tv, NULL);
- struct tm tms;
- LOCALTIME_R(&tv.tv_sec, &tms);
- spaceLeft -= strftime(buffer, spaceLeft, "%H:%M:%S.", &tms);
- spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%06lu ", static_cast<unsigned long>(tv.tv_usec));
-#else
- struct _timeb tb;
- _ftime(&tb);
- struct tm* tms = localtime(&tb.time);
- spaceLeft -= strftime(buffer, spaceLeft, "%H:%M:%S.", tms);
- spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%06lu ", (unsigned long)tb.millitm);
-#endif
-
- char levelString[10];
- if (level == CRAZY) strcpy(levelString, "[CRAZY] ");
- if (level == EMERG) strcpy(levelString, "[EMERG] ");
- if (level == ALERT) strcpy(levelString, "[ALERT] ");
- if (level == CRIT) strcpy(levelString, "[CRIT] ");
- if (level == ERR) strcpy(levelString, "[ERR] ");
- if (level == WARN) strcpy(levelString, "[WARN] ");
- if (level == NOTICE) strcpy(levelString, "[notice]");
- if (level == INFO) strcpy(levelString, "[info] ");
- if (level == DEBUG) strcpy(levelString, "[debug] ");
-
-#ifndef WIN32
- spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%s %lu %li %s - ", levelString, pthread_self(), syscall(SYS_gettid), fromModule);
-#else
- spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%s %s - ", levelString, fromModule);
-#endif
-
- va_list ap;
- va_start(ap, message);
- spaceLeft = VSNPRINTF(&buffer[150-spaceLeft], spaceLeft, message, ap);
- va_end(ap);
-
- int messageLength = strlen(buffer);
- if (messageLength < 150)
- {
- buffer[messageLength] = '\n';
- buffer[messageLength+1] = '\0';
- }
- else
- {
- buffer[149] = '\n';
- buffer[150] = '\0';
- }
-
- int success = 1;
- if (enabled)
- {
-#ifndef __ANDROID__
- success = fputs(buffer, logfile);
- fflush(NULL);
-#else
- int and_level=0;
- switch (level) {
- case CRAZY:
- case ALERT:
- case EMERG :
- case CRIT:{
- and_level=ANDROID_LOG_FATAL;
- } break;
- case ERR: {
- and_level=ANDROID_LOG_ERROR;
- } break;
- case WARN: {
- and_level=ANDROID_LOG_WARN;
- } break;
- case NOTICE:
- case INFO: {
- and_level=ANDROID_LOG_INFO;
- } break;
- case DEBUG :{
- and_level=ANDROID_LOG_DEBUG;
- } break;
- };
- __android_log_vprint(and_level, fromModule,
- message, ap);
-#endif
- }
-
- if (extlog) extlog->LogExtern(buffer); //Replacement for network logging
-
-
- if (success != EOF)
- return 1;
- else
- return 0;
-
-}
-
-void Log::logLongString(const char *fromModule, int level,const char *message)
-{
- int string_size=strlen(message);
- char buffer[100];
- const char * pointer=message;
- for (int str_written=0; str_written<string_size;str_written+=99) {
- strncpy(buffer,pointer,99);
- buffer[99]=0;
- pointer+=99;
- log(fromModule,level,"%s",buffer);
- }
-
-}
-
-int Log::status()
-{
- if (instance && logfile) return 1;
- else return 0;
-}
-
-void Log::setExternLogger(ExternLogger* login) {
- extlog=login;
- log("Log", Log::DEBUG, "Extern logging started");
-}
-
-
-
-
+++ /dev/null
-/*
- Copyright 2004-2005 Chris Tallon
- Copyright 2003-2004 University Of Bradford
-
- This file is part of VOMP.
-
- VOMP is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- VOMP is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- 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.
-*/
-
-#ifndef LOG_H
-#define LOG_H
-
-#include <stdio.h>
-#ifndef WIN32
- #include <unistd.h>
- #include <sys/time.h>
-#else
- #include <sys/timeb.h>
-#endif
-
-#include <time.h>
-#include <string.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include "defines.h"
-
-
-class ExternLogger {
-public:
- virtual bool LogExtern(const char* message)=0;
-};
-
-
-class Log
-{
- public:
- Log();
- ~Log();
- static Log* getInstance();
-
- int init(int defaultLevel,const char* fileName, int enabled);
- int shutdown();
-
- [[deprecated]]
- int log(const char *fromModule, int level,const char *message, ...);
-
- [[deprecated]]
- void logLongString(const char *fromModule, int level,const char *message);
- int status();
- void upLogLevel();
- void downLogLevel();
- [[deprecated]]
- void setExternLogger(ExternLogger* log);
- [[deprecated]]
- void unsetExternLogger() {
- extlog=NULL;
- }
-
-
-
- const static int CRAZY = 0; // mad crazy things that should never happen
- const static int EMERG = 1; // human assist required NOW
- const static int ALERT = 2; // system unusable, but happy to sit there
- const static int CRIT = 3; // still working, but maybe about to die
- const static int ERR = 4; // that response is not even listed...
- const static int WARN = 5; // this could be a bad thing. still running tho
- const static int NOTICE = 6; // significant good thing
- const static int INFO = 7; // verbose good thing
- const static int DEBUG = 8; // debug-level messages
-
- private:
- static Log* instance;
- int initted;
- int logLevel;
- int enabled;
-
- FILE *logfile;
-
- ExternLogger* extlog;
-
-
-};
-
-#endif
-
-/*
-
-Documentation
--------------
-
-This class is intended to be instatiated once by the core.
-For a one off use:
-
-Log::getInstance()->log("<module-name>", Log::<levelname>, "<message>");
-
-Or, a pointer can be stored and used:
-
-Log *myptr = Log::getInstance();
-
-myptr->log("<module-name>", Log::<levelname>, "<message>");
-myptr->log("<module-name>", Log::<levelname>, "<message>");
-
-Level usages are above.
-
-The message parameter in the log function can be used in the same way as printf, eg.
-
-myptr->log("<module-name>", Log::<levelname>, "Success: %s %i", stringpointer, integer);
-
-*/
#include <math.h>
#include <bcm_host.h>
-#include "oldlog.h"
+#include "log.h"
#include "videoomx.h"
#include "surface.h"
#include "message.h"
#include <time.h>
#include "defines.h"
-#include "oldlog.h"
+#include "log.h"
#include "audio.h"
#include "demuxerts.h"
#include "vdr.h"
#include "playerradiolive.h"
+static const char* TAG = "PlayerRadioLive";
+
// ----------------------------------- Called from outside, one offs or info funcs
PlayerRadioLive::PlayerRadioLive(MessageQueue* tmessageQueue, void* tmessageReceiver, ChannelList* tchanList)
: messageQueue(tmessageQueue), messageReceiver(tmessageReceiver), afeed(this), chanList(tchanList)
{
audio = Audio::getInstance();
- logger = Log::getInstance();
+ logger = LogNT::getInstance();
vdr = VDR::getInstance();
Video::getInstance()->turnVideoOff();
if (!demuxer->init(this, audio, NULL, NULL, 0, 200000, 0))
{
- logger->log("PlayerRadioLive", Log::ERR, "Demuxer failed to init");
+ logger->error(TAG, "Demuxer failed to init");
shutdown();
return 0;
}
if (!initted) return 0;
if (state != S_STOP) // FIXME check when this is called and how. This is not thread-sync bullet proof as-is.
{
- logger->log("PlayerRadioLive", Log::DEBUG, "state is not stop, calling");
+ logger->debug(TAG, "state is not stop, calling");
stop();
}
initted = false;
void PlayerRadioLive::setChannel(ULONG index)
{
- logger->log("PlayerRadioLive", Log::DEBUG, "setChannel");
+ logger->debug(TAG, "setChannel");
struct PLInstruction i;
i.instruction = I_SETCHANNEL;
i.channelIndex = index;
instructions.push(i);
- logger->log("PlayerRadioLive", Log::DEBUG, "posted setChannel instruction, now %i in queue", instructions.size());
+ logger->debug(TAG, "posted setChannel instruction, now {} in queue", instructions.size());
playerThreadCond.notify_one();
}
void PlayerRadioLive::stop()
{
- logger->log("PlayerRadioLive", Log::DEBUG, "stop");
+ logger->debug(TAG, "stop");
playerThreadMutex.lock();
struct PLInstruction i;
i.instruction = I_STOP;
playerThreadCond.notify_one();
playerThreadMutex.unlock();
playerThread.join();
- logger->log("PlayerRadioLive", Log::DEBUG, "stop successful");
+ logger->debug(TAG, "stop successful");
}
// ----------------------------------- Callback
{
// Too many chunks in streamChunks, drop this chunk
free(data);
- logger->log("PlayerRadioLive", Log::WARN, "Dropped chunk");
+ logger->warn(TAG, "Dropped chunk");
}
}
{
while(streamChunks.size())
{
- logger->log("PlayerRadioLive", Log::DEBUG, "Dropping chunk from old stream");
+ logger->debug(TAG, "Dropping chunk from old stream");
struct StreamChunk s = streamChunks.front();
streamChunks.pop();
free(s.data);
{
StreamChunk s = streamChunks.front();
streamChunks.pop();
- //logger->log("PlayerRadioLive", Log::DEBUG, "About to call demuxer with %p %lu", s.data, s.len);
+ //logger->debug(TAG, "About to call demuxer with {} {}", (void*)s.data, s.len);
/*int a =*/ demuxer->put(static_cast<UCHAR*>(s.data), s.len);
- //logger->log("PlayerRadioLive", Log::DEBUG, "put %i to demuxer", a);
+ //logger->debug(TAG, "put {} to demuxer", a);
free(s.data);
}
void PlayerRadioLive::switchState(UCHAR newState)
{
- logger->log("PlayerRadioLive", Log::DEBUG, "Switch from state %u to state %u", state, newState);
+ logger->debug(TAG, "Switch from state {} to state {}", state, newState);
switch(state)
{
}
default:
{
- logger->log("PlayerRadioLive", Log::EMERG, "Thread called state %u to state %u which is not supported", state, newState);
+ logger->crit(TAG, "Thread called state {} to state {} which is not supported", state, newState);
abort();
break;
}
}
default:
{
- logger->log("PlayerRadioLive", Log::EMERG, "Thread called state %u to state %u which is not supported", state, newState);
+ logger->crit(TAG, "Thread called state {} to state {} which is not supported", state, newState);
abort();
break;
}
}
default:
{
- logger->log("PlayerRadioLive", Log::EMERG, "Thread called state %u to state %u which is not supported", state, newState);
+ logger->crit(TAG, "Thread called state {} to state {} which is not supported", state, newState);
abort();
break;
}
{
if (instructions.size() > 1)
{
- logger->log("PlayerRadioLive", Log::DEBUG, "Should optimise");
+ logger->debug(TAG, "Should optimise");
optimizeInstructionQueue();
}
if (i.instruction == I_SETCHANNEL)
{
- logger->log("PlayerRadioLive", Log::DEBUG, "start new stream");
+ logger->debug(TAG, "start new stream");
switchState(S_PREBUFFERING);
{
demuxer->setAID(chan->apids[j].pid, 0, chan->apids[j].type, true);
audio->setStreamType(Audio::MPEG2_PES);
- logger->log("PlayerRadioLive", Log::DEBUG, "Demuxer pids: %u %u %u", chan->vpid, chan->apids[j].pid, chan->apids[j].type);
+ logger->debug(TAG, "Demuxer pids: {} {} {}", chan->vpid, chan->apids[j].pid, chan->apids[j].type);
found = true;
}
j++;
{
demuxer->setAID(chan->dpids[j].pid, 1, chan->dpids[j].type, true);
audio->setStreamType(Audio::MPEG2_PES);
- logger->log("PlayerRadioLive", Log::DEBUG, "Demuxer pids: %u %u (ac3) %u", chan->vpid, chan->dpids[j].pid, chan->dpids[j].type);
+ logger->debug(TAG, "Demuxer pids: {} {} (ac3) {}", chan->vpid, chan->dpids[j].pid, chan->dpids[j].type);
found=true;
}
j++;
}
else
{
- logger->log("PlayerRadioLive", Log::WARN, "Demuxer no pids!");
+ logger->warn(TAG, "Demuxer no pids!");
}
}
}
else if (i.instruction == I_STOP)
{
- logger->log("PlayerRadioLive", Log::DEBUG, "Stopping");
+ logger->debug(TAG, "Stopping");
switchState(S_STOP);
checkError();
return;
++preBufferCount;
ULONG percentDone = (preBufferCount * 100) / preBufferAmount;
- logger->log("PlayerRadioLive", Log::DEBUG, "Prebuffering %lu%%", percentDone);
+ logger->debug(TAG, "Prebuffering {}%", percentDone);
Message* m = new Message();
m->from = this;
ul.unlock();
}
- logger->log("PlayerRadioLive", Log::DEBUG, "End of thread");
+ logger->debug(TAG, "End of thread");
}
#include <queue>
+#include "log.h"
#include "playerlive.h"
#include "callback.h"
#include "defines.h"
class MessageQueue;
class Audio;
-class Log;
+class LogNT;
class DemuxerTS;
class PlayerRadioLive : public PlayerLive, public Callback, public StreamReceiver
private:
MessageQueue* messageQueue;
void* messageReceiver;
- Log* logger;
+ LogNT* logger;
Audio* audio;
DemuxerTS* demuxer;
VDR* vdr;
#endif
#include <time.h>
-#include "oldlog.h"
+#include "log.h"
#include "audio.h"
#include "video.h"
#include "demuxervdr.h"
#include "playerradiorec.h"
+static const char* TAG = "PlayerRadioRec";
+
// ----------------------------------- Called from outside, one offs or info funcs
PlayerRadioRec::PlayerRadioRec(MessageQueue* tmessageQueue, void* tmessageReceiver)
: messageQueue(tmessageQueue), messageReceiver(tmessageReceiver), afeed(this)
{
audio = Audio::getInstance();
- logger = Log::getInstance();
+ logger = LogNT::getInstance();
vdr = VDR::getInstance();
Video::getInstance()->turnVideoOff();
}
if (!demuxer->init(this, audio, NULL, NULL, 0, 40000, 0))
{
- logger->log("PlayerRadioRec", Log::ERR, "Demuxer failed to init");
+ logger->error(TAG, "Demuxer failed to init");
shutdown();
return false;
}
lengthBytes = tlengthBytes;
lengthFrames = tlengthFrames;
- logger->log("PlayerRadioRec", Log::DEBUG, "PlayerRadioRec has received length bytes of %llu", lengthBytes);
+ logger->debug(TAG, "PlayerRadioRec has received length bytes of {}", lengthBytes);
UINT thisRead = 0;
int success;
UCHAR* buffer = vdr->getBlock(0, 10000, &thisRead);
if (!buffer)
{
- logger->log("PlayerRadioRec", Log::ERR, "Failed to get start block");
+ logger->error(TAG, "Failed to get start block");
shutdown();
if (!vdr->isConnected()) doConnectionLost();
return false;
success = demuxer->findPTS(buffer, thisRead, &startPTS);
if (!success)
{
- logger->log("PlayerRadioRec", Log::ERR, "Failed to get start PTS");
+ logger->error(TAG, "Failed to get start PTS");
free(buffer);
shutdown();
return false;
if (!setLengthSeconds())
{
- logger->log("PlayerRadioRec", Log::ERR, "Failed to setLengthSeconds");
+ logger->error(TAG, "Failed to setLengthSeconds");
shutdown();
return false;
}
UCHAR* buffer = vdr->getBlock(lengthBytes - 10000, 10000, &thisRead);
if (!buffer)
{
- logger->log("PlayerRadioRec", Log::ERR, "Failed to get end block");
+ logger->error(TAG, "Failed to get end block");
if (!vdr->isConnected()) doConnectionLost();
return false;
}
free(buffer);
if (!success)
{
- logger->log("PlayerRadioRec", Log::ERR, "Failed to get end PTS");
+ logger->error(TAG, "Failed to get end PTS");
return false;
}
if (!initted) return;
if (state == S_STOP) return;
stateLock.lock();
- logger->log("PlayerRadioRec", Log::DEBUG, "Stop called lock");
+ logger->debug(TAG, "Stop called lock");
switchState(S_STOP);
stateLock.unlock();
}
void PlayerRadioRec::jumpToPercent(double percent)
{
stateLock.lock();
- logger->log("PlayerRadioRec", Log::DEBUG, "JUMP TO %i%%", percent);
+ logger->debug(TAG, "JUMP TO {}%", percent);
ULONG newFrame = static_cast<ULONG>(percent * lengthFrames / 100);
switchState(S_JUMP, newFrame);
stateLock.unlock();
void PlayerRadioRec::skipForward(UINT seconds)
{
std::lock_guard<std::mutex> lg(stateLock);
- logger->log("PlayerRadioRec", Log::DEBUG, "SKIP FORWARD %i SECONDS", seconds);
+ logger->debug(TAG, "SKIP FORWARD {} SECONDS", seconds);
ULONG currentSeconds = getCurrentSeconds();
ULONG currentFrame = demuxer->getPacketNum();
void PlayerRadioRec::skipBackward(UINT seconds)
{
std::lock_guard<std::mutex> lg(stateLock);
- logger->log("PlayerRadioRec", Log::DEBUG, "SKIP BACKWARD %i SECONDS", seconds);
+ logger->debug(TAG, "SKIP BACKWARD {} SECONDS", seconds);
ULONG currentSeconds = getCurrentSeconds();
ULONG currentFrame = demuxer->getPacketNum();
{
if (!initted) return;
- logger->log("PlayerRadioRec", Log::DEBUG, "Switch state from %u to %u", state, toState);
+ logger->debug(TAG, "Switch state from {} to {}", state, toState);
switch(state) // current state selector
{
void PlayerRadioRec::doConnectionLost()
{
- logger->log("PlayerRadioRec", Log::DEBUG, "Connection lost, sending message");
+ logger->debug(TAG, "Connection lost, sending message");
Message* m = new Message();
m->to = messageReceiver;
m->from = this;
feedPosition = vdr->positionFromFrameNumber(currentFrameNumber);
if (!vdr->isConnected()) { doConnectionLost(); return; }
- logger->log("PlayerRadioRec", Log::DEBUG, "startFeedPlay: wantedFrame %i goto %llu", currentFrameNumber, feedPosition);
+ logger->debug(TAG, "startFeedPlay: wantedFrame {} goto {}", currentFrameNumber, feedPosition);
Buffer threadBuffer;
{
lengthBytes = vdr->rescanRecording(&lengthFrames);
if (!vdr->isConnected()) { doConnectionLost(); return; }
- logger->log("PlayerRadioRec", Log::DEBUG, "Rescanned and reset length: %llu", lengthBytes);
+ logger->debug(TAG, "Rescanned and reset length: {}", lengthBytes);
lastRescan = time(NULL);
if (!setLengthSeconds())
{
- logger->log("PlayerRadioRec", Log::ERR, "Failed to setLengthSeconds in thread");
+ logger->error(TAG, "Failed to setLengthSeconds in thread");
return;
}
}
{
int a_stream = demuxer->scan(threadBuffer.ucharp(), thisRead);
demuxer->setAudioStream(a_stream);
- logger->log("PlayerRadioRec", Log::DEBUG, "Startup Audio stream chosen %x", a_stream);
+ logger->debug(TAG, "Startup Audio stream chosen {:#x}", a_stream);
startup = false;
}
}
// end of recording
- logger->log("PlayerRadioRec", Log::DEBUG, "Recording playback ends");
+ logger->debug(TAG, "Recording playback ends");
if (threadReqQuit) return;
m->from = this;
m->message = Message::PLAYER_EVENT;
m->parameter = PlayerRadioRec::STOP_PLAYBACK;
- logger->log("PlayerRadioRec", Log::DEBUG, "Posting message to %p...", messageQueue);
+ logger->debug(TAG, "Posting message to {}...", (void*)messageQueue);
messageQueue->postMessage(m);
}
#include "callback.h"
#include "afeed.h"
-class Log;
+class LogNT;
class Audio;
class Video;
class Demuxer;
MessageQueue* messageQueue;
void* messageReceiver;
- Log* logger;
+ LogNT* logger;
Audio* audio;
Demuxer* demuxer;
VDR* vdr;
#include "recman.h"
#include "vdr.h"
-#include "oldlog.h"
+#include "log.h"
RecMan::RecMan()
{
void RecMan::sort()
{
- Log::getInstance()->log("RecMan", Log::DEBUG, "Sort");
+ LogNT::getInstance()->debug("RecMan", "Sort");
rootDir->sort(chronoSortOrder);
}
*/
#include "defines.h"
-#include "oldlog.h"
+#include "log.h"
#include "input.h"
#include "wsymbol.h"
#include "colour.h"
SleepTimer::SleepTimer()
{
- logger = Log::getInstance();
+ logger = LogNT::getInstance();
boxstack = BoxStack::getInstance();
timers = Timers::getInstance();
}
{
if (state == 0) // inactive
{
- logger->log("SleepTimer", Log::ERR, "Received timercall when state 0");
+ logger->error("SleepTimer", "Received timercall when state 0");
}
else if (state == 1 || state == 2) // counting (either with or without modify display showing)
{
}
else if (state == 4) // not counting, off dialogue showing
{
- logger->log("SleepTimer", Log::ERR, "Received timercall when state 4");
+ logger->error("SleepTimer", "Received timercall when state 4");
}
}
}
#include "wsymbol.h"
#include "timers.h"
-class Log;
+class LogNT;
class BoxStack;
class VSleepTimer;
class VCountdown;
void shutdown();
private:
- Log* logger{};
+ LogNT* logger{};
BoxStack* boxstack{};
Timers* timers{};
#include <stdlib.h>
#include <string.h>
-#include "oldlog.h"
+//#include "oldlog.h"
#include "stream.h"
Stream::~Stream()
#include <math.h>
#include <algorithm>
#include "osd.h"
-#include "oldlog.h"
#include "video.h"
#include "teletxt/txtfont.h"
#include "tbboxx.h"
-#include "oldlog.h"
-
TBBoxx::TBBoxx()
{
titleBarOn = 0;
along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
-#include "oldlog.h"
#include "demuxer.h"
#include "callback.h"
#include "util.h"
#include "message.h"
#include "messagequeue.h"
#include "recinfo.h"
-#include "oldlog.h"
+#include "log.h"
#include "channel.h"
#include "vaudioselector.h"
int currentSubtitleChannel, int currentSubtitleType, RecInfo* recInfo)
: parent(tparent), liveMode(false)
{
- Log::getInstance()->log("VAS", Log::DEBUG, "%i", currentAudioChannel);
+ LogNT::getInstance()->debug("VAudioSelector", "{}", currentAudioChannel);
int i;
along with VOMP. If not, see <https://www.gnu.org/licenses/>.
*/
-
#include "input.h"
#include "message.h"
#include "boxstack.h"
#include "colour.h"
-#include "oldlog.h"
#include "vdr.h"
#include "messagequeue.h"
#include "i18n.h"
#include "boxstack.h"
#include "message.h"
-#include "oldlog.h"
+#include "log.h"
#include "vdr.h"
#include "wol.h"
#include "vserverselect.h"
#include "vconnect.h"
+static const char* TAG = "VConnect";
+
VConnect::VConnect()
{
boxstack = BoxStack::getInstance();
vdr = VDR::getInstance();
- logger = Log::getInstance();
+ logger = LogNT::getInstance();
setSize(400, 200);
createBuffer();
void VConnect::draw()
{
VInfo::draw();
- logger->log("VConnect", Log::DEBUG, "Draw done");
+ logger->debug(TAG, "Draw done");
}
int VConnect::handleCommand(int /* command */)
void VConnect::threadMethod()
{
- logger->log("VConnect", Log::DEBUG, "start threadMethod");
+ logger->debug(TAG, "start threadMethod");
ULONG delay = 0;
int success;
if (!vdpc.init())
{
- logger->log("VConnect", Log::CRIT, "Failed to init VDPC");
+ logger->crit(TAG, "Failed to init VDPC");
return;
}
}
for (ULONG i = 0; i < vdpc.numServers(); i++)
- logger->log("VConnect", Log::INFO, "Found server: %i %s %s %u", vdpc[i].ipVersion, vdpc[i].ip.c_str(), vdpc[i].name.c_str(), vdpc[i].port, vdpc[i].version);
+ logger->info(TAG, "Found server: {} {} {} {}", vdpc[i].ipVersion, vdpc[i].ip.c_str(), vdpc[i].name.c_str(), vdpc[i].port, vdpc[i].version);
if (vdpc.numServers() == 1)
{
if (threadReqQuit) return;
- logger->log("VConnect", Log::NOTICE, "Connecting to server at %s %u", vdpc[selectedServer].ip.c_str(), vdpc[selectedServer].port);
+ logger->info(TAG, "Connecting to server at {} {}", vdpc[selectedServer].ip.c_str(), vdpc[selectedServer].port);
Wol::getInstance()->setWakeUpIP(vdpc[selectedServer].ip.c_str());
vdr->setServerIP(vdpc[selectedServer].ip.c_str());
vdr->setServerPort(vdpc[selectedServer].port);
if (success)
{
- logger->log("VConnect", Log::DEBUG, "Connected ok, doing login");
+ logger->debug(TAG, "Connected ok, doing login");
unsigned int version_server_min, version_server_max, version_client;
int subtitles;
success = vdr->doLogin(&version_server_min, &version_server_max, &version_client, Control::getInstance()->getASLList(), subtitles);
if (threadReqQuit) return;
} while(!success);
- logger->log("VConnect", Log::INFO, "Send VDR connected message");
+ logger->info(TAG, "Send VDR connected message");
Message* m = new Message(); // Must be done after this thread ends
m->from = this;
m->p_to = Message::CONTROL;
#include "vinfo.h"
#include "vdpc.h"
-class Log;
+class LogNT;
class BoxStack;
class Message;
private:
BoxStack* boxstack;
- Log* logger;
+ LogNT* logger;
VDPC vdpc;
VDR* vdr;
#include <mutex>
#include "defines.h"
+#include "log.h"
#include "rectimer.h"
#include "mark.h"
#ifdef VOMP_MEDIAPLAYER
#endif
#include "eventdispatcher.h"
#include "i18n.h"
-#include "oldlog.h"
#include "control.h"
#include "tcp.h"
#include "boxstack.h"
#include "channel.h"
#include "i18n.h"
-#include "oldlog.h"
+#include "log.h"
#include "vepg.h"
+static const char* TAG = "VEpg";
+
VEpg* VEpg::instance = NULL;
VEpg::VEpg(void* tparent, UINT tcurrentChannelIndex, ChannelList* tchanList)
}
case Input::DOWN:
{ // cursor down the channel list
- Log::getInstance()->log("VEPG", Log::DEBUG, "Down start");
+ LogNT::getInstance()->debug(TAG, "Down start");
chanListbox.down();
drawData();
boxstack->update(this);
- Log::getInstance()->log("VEPG", Log::DEBUG, "Down end");
+ LogNT::getInstance()->debug(TAG, "Down end");
return 2;
}
case Input::RECORD:
{
if (!chanList) return 2;
- Log::getInstance()->log("VEPG", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s", thisEvent.id, thisEvent.time, thisEvent.duration, thisEvent.title);
+ LogNT::getInstance()->debug(TAG, "ID {} TIME {} DURATION {} TITLE {}", thisEvent.id, thisEvent.time, thisEvent.duration, thisEvent.title);
VEpgSetTimer* vs = new VEpgSetTimer(&thisEvent, (*chanList)[chanListbox.getCurrentOption()]);
vs->draw();
boxstack->add(vs);
#include "video.h"
#include "i18n.h"
#include "messagequeue.h"
-#include "oldlog.h"
+#include "log.h"
#include "movieinfo.h"
#include "seriesinfo.h"
#include "event.h"
#include "vepglistadvanced.h"
+static const char* TAG = "VEpgListAdvanced";
+
VEpgListAdvanced::VEpgListAdvanced(VVideoLiveTV* tvideolive, ChannelList* tchanList, ULONG initialChannelNumber)
{
channelNumber = initialChannelNumber;
void VEpgListAdvanced::doNext()
{
- Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "doNext");
+ LogNT::getInstance()->debug(TAG, "doNext");
ULONG slCurrentOption = reinterpret_cast<ULONG>(sl.getCurrentOptionData());
if (mode != OneChannel)
void VEpgListAdvanced::doNow()
{
- Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "doNow");
+ LogNT::getInstance()->debug(TAG, "doNow");
ULONG slCurrentOption = reinterpret_cast<ULONG>(sl.getCurrentOptionData());
if (mode != OneChannel)
void VEpgListAdvanced::doProgramm()
{
- Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "doProgram");
+ LogNT::getInstance()->debug(TAG, "doProgram");
mode = OneChannel;
ULONG slCurrentOption = reinterpret_cast<ULONG>(sl.getCurrentOptionData());
Channel* chan = (*chanList)[slCurrentOption];
channelNumber = chan->number;
}
- Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "doSwitch %d", channelNumber);
+ LogNT::getInstance()->debug(TAG, "doSwitch {}", channelNumber);
Message* m = new Message(); // Must be done after this view deleted
m->from = this;
m->to = videolive;
if (current)
{
- Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "Found the option you pointed at. %s %d", current->title, current->id);
+ LogNT::getInstance()->debug(TAG, "Found the option you pointed at. {} {}", current->title, current->id);
unsigned int chanlistsize = chanList->size();
Channel* chan;
UINT listIndex;
if (chan->number == channel) break;
}
- Log::getInstance()->log("VEpgSummary", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s",
+ LogNT::getInstance()->debug(TAG, "ID {} TIME {} DURATION {} TITLE {}",
current->id, current->time, current->duration, current->title);
VEpgSetTimer* vs = new VEpgSetTimer(current, chan);
vs->draw();
time_t now;
time(&now);
eventLista[0] = VDR::getInstance()->getChannelSchedule(channelNumber, now, 24 * 60 * 60 * 30); // one month
- Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "Eventlist %x %d", eventLista[0], channelNumber);
+ LogNT::getInstance()->debug(TAG, "Eventlist {:#x} {}", (void*)eventLista[0], channelNumber);
}
void VEpgListAdvanced::drawData(bool doIndexPop)
strftime(tempB, 300, "- %H:%M ", &btime);
int check = SNPRINTF(tempC, 300, "\t %s\n \t \t%s%s", currentEvent->title.c_str(), tempA, tempB);
- if ((check < 0) || (check > 299)) Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "String too big");
+ if ((check < 0) || (check > 299)) LogNT::getInstance()->debug(TAG, "String too big");
// New TVMedia stuff
TVMediaInfo* info = new TVMediaInfo();
strftime(tempB, 300, "- %H:%M ", &btime);
int check = SNPRINTF(tempC, 300, "%s\n%s\t %s%s", currentEvent->title.c_str(), chan->name, tempA, tempB);
- if ((check < 0) || (check > 299)) Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "String too big");
+ if ((check < 0) || (check > 299)) LogNT::getInstance()->debug(TAG, "String too big");
}
else
{
if (current)
{
- Log::getInstance()->log("VEventListAdvanced", Log::DEBUG, "Found the option you pointed at. %s %d", current->title.c_str(), current->id);
+ LogNT::getInstance()->debug(TAG, "Found the option you pointed at. {} {}", current->title.c_str(), current->id);
unsigned int chanlistsize = chanList->size();
Channel* chan;
UINT listIndex;
void VEpgListAdvanced::processMessage(Message* m)
{
- Log::getInstance()->log("VEpgListAdvanced", Log::DEBUG, "Got message value %lu", m->message);
+ LogNT::getInstance()->debug(TAG, "Got message value {}", m->message);
if (m->message == Message::MOUSE_MOVE)
{
#include "channel.h"
#include "boxstack.h"
#include "vdr.h"
-#include "oldlog.h"
+#include "log.h"
#include "vinfo.h"
#include "message.h"
#include "control.h"
#include "vepgsettimer.h"
+static const char* TAG = "VEPGST";
+
VEpgSetTimer::VEpgSetTimer(Event* tevent, Channel* tchannel)
{
boxstack = BoxStack::getInstance();
vdr = VDR::getInstance();
- logger = Log::getInstance();
+ logger = LogNT::getInstance();
event = tevent;
channel = tchannel;
buttonYes.setActive(1);
selectedOption = YES;
- logger->log("VEPGST", Log::DEBUG, "Title: %s", event->title);
- logger->log("VEPGST", Log::DEBUG, "Time: %lu", event->time);
- logger->log("VEPGST", Log::DEBUG, "Duration: %lu", event->duration);
- logger->log("VEPGST", Log::DEBUG, "Channel: %i", channel->number);
+ logger->debug(TAG, "Title: {}", event->title);
+ logger->debug(TAG, "Time: {}", event->time);
+ logger->debug(TAG, "Duration: {}", event->duration);
+ logger->debug(TAG, "Channel: {}", channel->number);
}
VEpgSetTimer::~VEpgSetTimer()
void VEpgSetTimer::doit()
{
char* timerString = genTimerString();
- logger->log("VEPGST", Log::DEBUG, "%s", timerString);
+ logger->debug(TAG, "{}", timerString);
ULONG ret = vdr->setEventTimer(timerString);
delete[] timerString;
Control::getInstance()->connectionLost();
}
- if (ret == 0) logger->log("VEPGST", Log::DEBUG, "Success");
- else if (ret == 1) logger->log("VEPGST", Log::DEBUG, "Fail: Timer already set for this event");
- else if (ret == 2) logger->log("VEPGST", Log::DEBUG, "Fail: General failure setting timer");
+ if (ret == 0) logger->debug(TAG, "Success");
+ else if (ret == 1) logger->debug(TAG, "Fail: Timer already set for this event");
+ else if (ret == 2) logger->debug(TAG, "Fail: General failure setting timer");
VInfo* vi = new VInfo();
vi->setSize(400, 150);
class Event;
class Channel;
-class Log;
+class LogNT;
class VDR;
class Message;
class BoxStack;
private:
BoxStack* boxstack;
- Log* logger;
+ LogNT* logger;
VDR* vdr;
Event* event;
#include "boxstack.h"
#include "woptionpane.h"
#include "wremoteconfig.h"
-#include "oldlog.h"
+#include "log.h"
#include "option.h"
#include "vdr.h"
#include "messagequeue.h"
#include "vopts.h"
+static const char* TAG = "VOpts";
+
VOpts::VOpts()
{
setTitleBarOn(1);
{
if (options[i]->configChoice == options[i]->userSetChoice) continue; // no change
- Log::getInstance()->log("Options", Log::DEBUG, "Option %i has changed", i);
+ LogNT::getInstance()->debug(TAG, "Option {} has changed", i);
// Save to vdr
{
if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "RGB+composite")==0)
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting RGB/Composite");
+ LogNT::getInstance()->debug(TAG, "Setting RGB/Composite");
Video::getInstance()->setConnection(Video::COMPOSITERGB);
}
else if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "S-Video")==0)
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting S-Video");
+ LogNT::getInstance()->debug(TAG, "Setting S-Video");
Video::getInstance()->setConnection(Video::SVIDEO);
}
else if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "HDMI")==0)
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting HDMI");
+ LogNT::getInstance()->debug(TAG, "Setting HDMI");
Video::getInstance()->setConnection(Video::HDMI);
}
else if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "HDMI3D")==0)
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting HDMI");
+ LogNT::getInstance()->debug(TAG, "Setting HDMI");
Video::getInstance()->setConnection(Video::HDMI3D);
}
break;
{
if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "16:9")==0)
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting 16:9 TV");
+ LogNT::getInstance()->debug(TAG, "Setting 16:9 TV");
Video::getInstance()->setTVsize(Video::ASPECT16X9);
}
else if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "4:3")==0)
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting 4:3 TV");
+ LogNT::getInstance()->debug(TAG, "Setting 4:3 TV");
Video::getInstance()->setTVsize(Video::ASPECT4X3);
}
else if (STRCASECMP(options[i]->optionkeys[options[i]->userSetChoice], "14:9")==0)
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting 14:9 TV");
+ LogNT::getInstance()->debug(TAG, "Setting 14:9 TV");
Video::getInstance()->setTVsize(Video::ASPECT14X9);
}
break;
{
if (options[i]->userSetChoice == 1)
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting letterbox");
+ LogNT::getInstance()->debug(TAG, "Setting letterbox");
Video::getInstance()->setMode(Video::LETTERBOX);
}
else
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting chop-sides");
+ LogNT::getInstance()->debug(TAG, "Setting chop-sides");
Video::getInstance()->setMode(Video::NORMAL);
}
break;
else if (options[i]->userSetChoice == 5) newTCPsize = 16384;
else if (options[i]->userSetChoice == 6) newTCPsize = 32768;
else if (options[i]->userSetChoice == 7) newTCPsize = 65536;
- Log::getInstance()->log("Options", Log::DEBUG, "Setting TCP window size %i", newTCPsize);
+ LogNT::getInstance()->debug(TAG, "Setting TCP window size {}", newTCPsize);
VDR::getInstance()->setReceiveWindow(newTCPsize);
break;
}
{
if (options[i]->userSetChoice == 1)
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting automatic vdr shutdown");
+ LogNT::getInstance()->debug(TAG, "Setting automatic vdr shutdown");
VDR::getInstance()->setVDRShutdown(true);
}
else
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting local shutdown");
+ LogNT::getInstance()->debug(TAG, "Setting local shutdown");
VDR::getInstance()->setVDRShutdown(false);
}
break;
{
if (options[i]->userSetChoice == 1)
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting classic menu");
+ LogNT::getInstance()->debug(TAG, "Setting classic menu");
Control::getInstance()->setAdvMenus(false);
}
else
{
- Log::getInstance()->log("Options", Log::DEBUG, "Setting advanced menu");
+ LogNT::getInstance()->debug(TAG, "Setting advanced menu");
Control::getInstance()->setAdvMenus(true);
}
break;
case 20:
{
SkinFactory::InitSkin(options[i]->userSetChoice);
- Log::getInstance()->log("Options", Log::DEBUG, "Init Skin %d",options[i]->userSetChoice);
+ LogNT::getInstance()->debug(TAG, "Init Skin {}", options[i]->userSetChoice);
break;
}
}
#include "vinfo.h"
#include "boxstack.h"
#include "i18n.h"
-#include "oldlog.h"
+#include "log.h"
VPictureBanner::VPictureBanner(bool ld, bool sl)
{
setPosition(50, v->getScreenHeight()-50);
setTitleBarOn(0);
info=NULL;
- Log::getInstance()->log("VPictureBanner",Log::DEBUG,"created %p",this);
+ LogNT::getInstance()->debug("VPictureBanner", "created {}", (void*)this);
//TODO compute sizes from text
rotsize=70;
infsize=50;
VPictureBanner::~VPictureBanner()
{
- Log::getInstance()->log("VPictureBanner",Log::DEBUG,"deleted %p",this);
+ LogNT::getInstance()->debug("VPictureBanner", "deleted {}", (void*)this);
}
void VRadioRec::drawBarClocks()
{
- Log* logger = Log::getInstance();
- LogNT::getInstance()->debug(TAG, "Draw bar clocks");
+ LogNT* logger = LogNT::getInstance();
+ logger->debug(TAG, "Draw bar clocks");
// Draw RTC
// Blank the area first
#include "vrecordinglist.h"
#include "recording.h"
#include "message.h"
-#include "oldlog.h"
+#include "log.h"
#include "wmovieview.h"
#include "wseriesview.h"
#include "wpictureview.h"
+static const char* TAG = "VRecording";
+
VRecording::VRecording(RecMan* trecman, Recording* trec)
{
rec = trec;
buttons = true;
selected = RESUME;
- Log::getInstance()->log("VRecording", Log::DEBUG, "%s", rec->getProgName());
+ LogNT::getInstance()->debug(TAG, "{}", rec->getProgName());
rec->loadRecInfo();
- Log::getInstance()->log("VRecording", Log::DEBUG, "%s", rec->getProgName());
+ LogNT::getInstance()->debug(TAG, "{}", rec->getProgName());
if (Video::getInstance()->getFormat() == Video::PAL)
#include "vrecordinglist.h"
+#include "log.h"
#include "recman.h"
#include "directory.h"
#include "recording.h"
#include "i18n.h"
#include "control.h"
#include "vinfo.h"
-#include "oldlog.h"
+
+static const char* TAG = "VRecordingList";
VRecordingList::VRecordingList()
{
void VRecordingList::processMessage(Message* m)
{
- Log::getInstance()->log("VRecordingList", Log::DEBUG, "Got message value %lu", m->message);
+ LogNT::getInstance()->debug(TAG, "Got message value {}", m->message);
if (m->message == Message::MOUSE_MOVE)
{
}
else if (m->message == Message::DELETE_SELECTED_RECORDING)
{
- Log::getInstance()->log("VRecordingList", Log::DEBUG, "Doing delete selected");
+ LogNT::getInstance()->debug(TAG, "Doing delete selected");
doDeleteSelected();
}
else if (m->message == Message::MOVE_RECORDING)
{
- Log::getInstance()->log("VRecordingList", Log::DEBUG, "Doing move recording");
+ LogNT::getInstance()->debug(TAG, "Doing move recording");
doMoveRecording(reinterpret_cast<Directory*>(m->parameter));
}
else if (m->message == Message::PLAY_SELECTED_RECORDING)
if (!toDelete) return;
- Log::getInstance()->log("VRecordingList", Log::DEBUG, "FOUND: %i %s %s", toDelete->index, toDelete->getProgName(), toDelete->getFileName());
+ LogNT::getInstance()->debug(TAG, "FOUND: {} {} {}", toDelete->index, toDelete->getProgName(), toDelete->getFileName());
int success = recman->deleteRecording(toDelete);
if (!VDR::getInstance()->isConnected())
Recording* toMove = getCurrentOptionRecording();
if (!toMove || !toDir) return;
- Log::getInstance()->log("VRecordingList", Log::DEBUG, "MOVE: %s %s", toMove->getProgName(), toDir->name);
+ LogNT::getInstance()->debug(TAG, "MOVE: {} {}", toMove->getProgName(), toDir->name);
int success = recman->moveRecording(toMove, toDir);
if (!VDR::getInstance()->isConnected())
Recording* current = getCurrentOptionRecording();
if (current)
{
- Log::getInstance()->log("VRecordingList", Log::DEBUG, "Found the option you pointed at. %s %s", current->getProgName(), current->getFileName());
+ LogNT::getInstance()->debug(TAG, "Found the option you pointed at. {} {}", current->getProgName(), current->getFileName());
/*
VRecordingMenu* v = new VRecordingMenu(recman);
#include "i18n.h"
#include "control.h"
#include "vinfo.h"
-#include "oldlog.h"
+#include "log.h"
#include "movieinfo.h"
#include "seriesinfo.h"
#include "staticartwork.h"
LOCALTIME_R(&recStartTime, &btime);
strftime(tempA, 299, "%d/%m/%y %H:%M ", &btime);
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");
+ if ((check < 0) || (check > 299)) LogNT::getInstance()->error("VRecordingsListAdvanced", "String too big");
// New TVMedia stuff
TVMediaInfo *info= new TVMediaInfo();
#include "i18n.h"
#include "control.h"
#include "vinfo.h"
-#include "oldlog.h"
+#include "log.h"
#include "vrecordinglistclassic.h"
LOCALTIME_R(&recStartTime, &btime);
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");
+ if ((check < 0) || (check > 299)) LogNT::getInstance()->error("VRecordingListClassic", "String too big");
currentRec->index = sl.addOption(tempB, 0, first);
first = 0;
#include <math.h>
#include "defines.h"
-#include "oldlog.h"
#include "input.h"
#include "colour.h"
#include "video.h"
#include <math.h>
+#include "log.h"
#include "video.h"
#include "boxstack.h"
#include "input.h"
VTeletextView::~VTeletextView()
{
- Log::getInstance()->log("VTeletextView", Log::DEBUG, "VTeletextView destruct");
+ LogNT::getInstance()->debug("VTeletextView", "destruct");
pv->draw();
BoxStack::getInstance()->update(pv);
ttdecoder->unRegisterTeletextView(this);
void VTeletextView::draw(bool completedraw, bool onlyfirstline)
{
- //Log::getInstance()->log("VTeletextView", Log::ERR, "Start draw");
+ LogNT::getInstance()->error("VTeletextView", "Start draw");
Boxx::draw();
int x, y;
ttdecoder->setChar(x, y, c);
}
}
-// Log::getInstance()->log("VTeletextView", Log::ERR, "Line %d",y);
+// LogNT::getInstance()->error("VTeletextView", "Line {}", y);
if (onlyfirstline) break;
}
- // Log::getInstance()->log("VTeletextView", Log::ERR, "Start end");
+ // LogNT::getInstance()->error("VTeletextView", "Start end");
}
int VTeletextView::handleCommand(int command)
#include "control.h"
#include "boxstack.h"
#include "vinfo.h"
-#include "oldlog.h"
+#include "log.h"
#include "staticartwork.h"
#include "vtimerlist.h"
+static const char* TAG = "VTimerList";
+
VTimerList::VTimerList()
{
clockRegion.x = 420;
LOCALTIME_R(&rectime, &btime);
strftime(strA, 299, "%d/%m %H:%M ", &btime);
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");
+ if ((check < 0) || (check > 299)) LogNT::getInstance()->error(TAG, "String too big");
sl.addOption(strB, recTimer, first);
first = 0;
}
{
RecTimer* recTimer = reinterpret_cast<RecTimer*>(sl.getCurrentOptionData());
if (recTimer == NULL) return;
- Log::getInstance()->log("VTimerList", Log::DEBUG, "Got timer to delete");
+ LogNT::getInstance()->debug(TAG, "Got timer to delete");
ULONG retval = VDR::getInstance()->deleteTimer(recTimer);
if (!VDR::getInstance()->isConnected()) { Control::getInstance()->connectionLost(); return; }
- Log::getInstance()->log("VTimerList", Log::DEBUG, "Got return fron delete timer: %lu", retval);
+ LogNT::getInstance()->debug(TAG, "Got return fron delete timer: {}", retval);
if (retval != 10)
{
#include "i18n.h"
#include "bitmap.h"
#include "recinfo.h"
-#include "oldlog.h"
+#include "log.h"
#include "channel.h"
#include "vteletextview.h"
#include "messagequeue.h"
#include "vvideorec.h"
+static const char* TAG = "VVideoRec";
+
VVideoRec::VVideoRec(Recording* rec, bool ish264)
{
boxstack = BoxStack::getInstance();
delete[] cendMargin;
}
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "SM: %u EM: %u", startMargin, endMargin);
+ LogNT::getInstance()->debug(TAG, "SM: {} EM: {}", startMargin, endMargin);
setSize(video->getScreenWidth(), video->getScreenHeight());
createBuffer();
VVideoRec::~VVideoRec()
{
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "Entering vvideorec destructor");
+ LogNT::getInstance()->debug(TAG, "Entering vvideorec destructor");
video->setDefaultAspect();
else
startFrameNum = 0;
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "Starting stream: %s at frame: %lu", myRec->getFileName(), startFrameNum);
+ LogNT::getInstance()->debug(TAG, "Starting stream: {} at frame: {}", myRec->getFileName(), startFrameNum);
ULONG lengthFrames = 0;
bool isPesRecording;
ULLONG lengthBytes = vdr->streamRecording(myRec->getFileName(), &lengthFrames, &isPesRecording);
if (myRec->hasMarks())
{
// skip to previous mark
- Log* logger = Log::getInstance();
+ LogNT* logger = LogNT::getInstance();
int currentFrame = (player->getCurrentFrameNum()); // get current Frame
currentFrame -= static_cast<int>(5 * myRec->recInfo->fps); // subtrack 5 seconds, else you cannot skip more than once back ..
int prevMark = myRec->getPrevMark(currentFrame); // find previous Frame
if (prevMark)
{
- logger->log("VVideoRec", Log::NOTICE, "jump back from pos %i to mark at %i",currentFrame,prevMark);
+ logger->info(TAG, "jump back from pos {} to mark at {}",currentFrame,prevMark);
player->jumpToMark(prevMark);
}
doBar(4);
if (myRec->hasMarks())
{
// skip to next mark
- Log* logger = Log::getInstance();
+ LogNT* logger = LogNT::getInstance();
int currentFrame = (player->getCurrentFrameNum());
int nextMark = myRec->getNextMark(currentFrame);
if (nextMark)
{
- logger->log("VVideoRec", Log::NOTICE, "jump forward from pos %i to mark at %i",currentFrame,nextMark);
+ logger->info(TAG, "jump forward from pos {} to mark at {}", currentFrame,nextMark);
player->jumpToMark(nextMark);
}
doBar(3);
void VVideoRec::processMessage(Message* m)
{
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "Message received");
+ LogNT::getInstance()->debug(TAG, "Message received");
if (m->message == Message::MOUSE_LBDOWN)
{
}
else if (m->message == Message::AUDIO_CHANGE_CHANNEL)
{
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change audio channel to %i", m->parameter);
+ LogNT::getInstance()->debug(TAG, "Received change audio channel to {}", m->parameter);
player->setAudioChannel(m->parameter&0xFFFF,(m->parameter&0xFF0000)>> 16,(m->parameter&0xFF000000)>> 24 );
}
else if (m->message == Message::SUBTITLE_CHANGE_CHANNEL)
{
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change subtitle channel to %i", m->parameter);
+ LogNT::getInstance()->debug(TAG, "Received change subtitle channel to {}", m->parameter);
int type=((m->parameter & 0xFF0000)>>16);
switch (type) {
case 0x10: { //dvbsubtitle
void VVideoRec::stopPlay()
{
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "Pre stopPlay");
+ LogNT::getInstance()->debug(TAG, "Pre stopPlay");
removeBar();
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "1");
+ LogNT::getInstance()->debug(TAG, "1");
player->stop();
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "2");
+ LogNT::getInstance()->debug(TAG, "2");
vdr->stopStreaming();
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "3");
+ LogNT::getInstance()->debug(TAG, "3");
delete player;
playing = false;
if (!vdr->isConnected()) { Control::getInstance()->connectionLost(); return; }
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "Post stopPlay");
+ LogNT::getInstance()->debug(TAG, "Post stopPlay");
}
void VVideoRec::toggleChopSides()
if (!barGenHold && !barScanHold && !barVasHold)
timers->setTimerD(this, 1, 4);
- Log::getInstance()->log("VVideoRec", Log::DEBUG, "player state: %i", playerState);
+ LogNT::getInstance()->debug(TAG, "player state: {}", playerState);
if ((playerState == PlayerVideoRec::S_PAUSE_P) || (playerState == PlayerVideoRec::S_PAUSE_I))
timers->cancelTimer(this, 2);
}
}
- Log* logger = Log::getInstance();
- logger->log("VVideoRec", Log::DEBUG, "Draw bar clocks");
+ LogNT* logger = LogNT::getInstance();
+ logger->debug(TAG, "Draw bar clocks");
// Draw RTC
// Blank the area first
else
{
SNPRINTF(buffer, 99, "%01i:%02i:%02i / %01i:%02i:%02i", currentFrameHMSF.hours, currentFrameHMSF.minutes, currentFrameHMSF.seconds, lengthHMSF.hours, lengthHMSF.minutes, lengthHMSF.seconds);
- logger->log("VVideoRec", Log::DEBUG, buffer);
+ logger->debug(TAG, buffer);
}
drawText(buffer, clocksRegion.x, clocksRegion.y, DrawStyle::LIGHTTEXT);
{
int nrWidth = 302 * (lengthFrames - player->getLengthFrames()) / lengthFrames;
- Log::getInstance()->log("GVASDF", Log::DEBUG, "Length Frames: %lu", lengthFrames);
- Log::getInstance()->log("GVASDF", Log::DEBUG, "Player lf: %lu", player->getLengthFrames());
- Log::getInstance()->log("GVASDF", Log::DEBUG, "NR WDITH: %i", nrWidth);
+ LogNT::getInstance()->debug("GVASDF", "Length Frames: {}", lengthFrames);
+ LogNT::getInstance()->debug("GVASDF", "Player lf: {}", player->getLengthFrames());
+ LogNT::getInstance()->debug("GVASDF", "NR WDITH: {}", nrWidth);
rectangle(barRegion.x + progBarXbase + 4 + 302 - nrWidth, barRegion.y + 16, nrWidth, 16, DrawStyle::RED);
}
loopMark = *i;
if (loopMark->pos)
{
- logger->log("VVideoRec", Log::DEBUG, "Drawing mark at frame %i", loopMark->pos);
+ logger->debug(TAG, "Drawing mark at frame {}", loopMark->pos);
posPix = 302 * loopMark->pos / lengthFrames;
rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 3, 28, DrawStyle::DANGER);
}
*/
-#include "oldlog.h"
+#include "log.h"
#include "input.h"
#include "vdr.h"
#include "vchannellist.h"
#endif
#include "i18n.h"
-#include "oldlog.h"
#include "surface.h"
#include <sys/types.h>
#include <sys/stat.h>
-
-
#include "i18n.h"
-#include "oldlog.h"
#include "surface.h"
-
-
-
-WJpegSimple::WJpegSimple(){
-
+WJpegSimple::WJpegSimple()
+{
}
-WJpegSimple::~WJpegSimple() {
-
+WJpegSimple::~WJpegSimple()
+{
}
int WJpegSimple::init(const char* tfileName)
{
- fileName=tfileName;
-
+ fileName = tfileName;
return 1;
}
-
-
-
-
void WJpegSimple::draw()
{
- int width,height;
- width=height=1;
- drawJpeg(fileName,0,0,&width,&height);//This should went into the abstract base classes?
- //Windows has a problem with the leading / fixme
- setDimensions(width, height);
-
+ int width,height;
+ width=height=1;
+ drawJpeg(fileName,0,0,&width,&height);//This should went into the abstract base classes?
+ //Windows has a problem with the leading / fixme
+ setDimensions(width, height);
}
-
-
-
-
*/
#include "colour.h"
-#include "oldlog.h"
#ifndef WIN32
#include "unistd.h"
#endif
#include "wtextbox.h"
#include "i18n.h"
#include "woptionbox.h"
-#include "oldlog.h"
+#include "log.h"
#include "vdr.h"
#include "input.h"
#include "option.h"
{
for (UINT j = 0; j < option->numChoices; j++)
{
- Log::getInstance()->log("Options", Log::DEBUG, "Add option: %s", option->options[j]);
+ LogNT::getInstance()->debug("Options", "Add option: {}", option->options[j]);
ob->addOption(tr(option->options[j]));
}
#include <string>
-#include "oldlog.h"
#include "input.h"
#include "inputman.h"
#include "wsymbol.h"
#include <string.h>
#include "colour.h"
-#include "oldlog.h"
#include "wselectlist.h"
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include "log.h"
#include "wtabbar.h"
#include "surface.h"
#include "input.h"
}
else
{
- Log::getInstance()->log("WTabBar", Log::ERR, "Up/Down client returned not 1 or 4");
+ LogNT::getInstance()->error("WTabBar", "Up/Down client returned not 1 or 4");
}
}
}