From c40ee636dfddcf8156f1f6db15122033ece65422 Mon Sep 17 00:00:00 2001
From: Chris Tallon <chris@vomp.tv>
Date: Sat, 3 Dec 2005 17:08:19 +0000
Subject: [PATCH] Channel number on vlivebanner

---
 command.cc     | 18 ------------------
 vlivebanner.cc |  5 ++++-
 2 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/command.cc b/command.cc
index abf770b..60c9f8c 100644
--- a/command.cc
+++ b/command.cc
@@ -131,13 +131,11 @@ void Command::run()
   {
     // unlock and wait
     pthread_mutex_unlock(&masterLock);
-    logger->log("Command", Log::DEBUG, "un-LOCKED MASTER MUTEX");
 
     button = remote->getButtonPress(2);  // FIXME why is this set to 2 and not 0? so it can quit
     // something happened, lock and process
 
     pthread_mutex_lock(&masterLock);
-    logger->log("Command", Log::DEBUG, "LOCKED MASTER MUTEX");
 
     if ((button == Remote::NA_NONE) || (button == Remote::NA_UNKNOWN)) continue;
 
@@ -156,11 +154,9 @@ void Command::postMessage(Message* m)
   // locking the mutex ensures that the master thread is waiting on getButtonPress
 
   pthread_mutex_lock(&masterLock);
-    logger->log("Command", Log::DEBUG, "LOCKED MASTER MUTEX");
   MessageQueue::postMessage(m);
   kill(mainPid, SIGURG);
   pthread_mutex_unlock(&masterLock);
-    logger->log("Command", Log::DEBUG, "un-LOCKED MASTER MUTEX");
 }
 
 bool Command::postMessageIfNotBusy(Message* m)
@@ -171,11 +167,9 @@ bool Command::postMessageIfNotBusy(Message* m)
 
   if (pthread_mutex_trylock(&masterLock) != EBUSY)
   {
-      logger->log("Command", Log::DEBUG, "LOCKED MASTER MUTEX");
     MessageQueue::postMessage(m);
     kill(mainPid, SIGURG);
     pthread_mutex_unlock(&masterLock);
-      logger->log("Command", Log::DEBUG, "un-LOCKED MASTER MUTEX");
     return true;
   }
   else
@@ -217,13 +211,6 @@ void Command::processMessage(Message* m)
     }
     case Message::TIMER:
     {
-      // FIXME lock main mutex
-      // FIXME Reply - if messages are being processed then main loop is on processMessageQueue()
-      // -- this means the mutex is locked
-
-      // FIXME investigate whether timer can have fired, but waits on this mutex,
-      // a view is deleted, then the timer runs on a non-object
-
       // FIXME - go to one message queue only - then instead of having
       // objects deriving from messagequeues, make them derive from
       // messagereceiver - then one messagequeue can deliver any message to anywhere
@@ -231,11 +218,6 @@ void Command::processMessage(Message* m)
 
       // deliver timer
 
-      logger->log("Command", Log::DEBUG, "m = %p", m);
-      logger->log("Command", Log::DEBUG, "m->message = %i", m->message);
-      logger->log("Command", Log::DEBUG, "m->from = %p", m->from);
-      logger->log("Command", Log::DEBUG, "m->to = %p", m->to);
-      logger->log("Command", Log::DEBUG, "m->parameter = %p", m->parameter);
       ((TimerReceiver*)m->to)->timercall(m->parameter);
       handleCommand(Remote::NA_NONE); // in case any timer has posted messages to viewman,
                                       // run viewman message queue here. FIXME improve this!
diff --git a/vlivebanner.cc b/vlivebanner.cc
index 539b2ad..4af19cd 100644
--- a/vlivebanner.cc
+++ b/vlivebanner.cc
@@ -76,7 +76,10 @@ void VLiveBanner::setChannel(Channel* tChannel)
   currentChannel = tChannel;
   // get the data
 
-  setTitleText(currentChannel->name);
+  char ttitleText[100];
+  snprintf(ttitleText, 99, "%03lu - %s", currentChannel->number, currentChannel->name);
+
+  setTitleText(ttitleText);
   eventList = VDR::getInstance()->getChannelSchedule(currentChannel->number);
 
   if (!eventList)
-- 
2.39.5