Added missing calls to cStatus::MsgOsdStatusMessage() and added the new virtual function cStatus::OsdStatusMessage2(), which can be used to get the type of the message

This commit is contained in:
Klaus Schmidinger 2025-02-12 21:18:53 +01:00
parent 03afc4a353
commit baa97e9ff1
8 changed files with 32 additions and 16 deletions

View File

@ -2594,6 +2594,8 @@ Markus Ehrnsperger <markus.ehrnsperger@googlemail.com>
for reporting an improper call of cStatus::OsdCurrentItem() before cStatus::OsdItem2()
for fixing unnecessary calls to DisplayCurrent() for editable menu items
for implementing cStatus::OsdCurrentItem2() with the index of the current item
for adding missing calls to cStatus::MsgOsdStatusMessage() and implementing
cStatus::OsdStatusMessage2() with the type of the message
Werner Färber <w.faerber@gmx.de>
for reporting a bug in handling the cPluginManager::Active() result when pressing

View File

@ -10034,7 +10034,7 @@ Video Disk Recorder Revision History
(suggested by Stefan Hofmann).
- Added vdrrootdir and incdir to vdr.pc (thanks to Stefan Hofmann).
2025-02-05:
2025-02-12:
- Removed all DEPRECATED_* code.
- Fixed error checking in case the fps value can't be determined by the frame parser.
@ -10073,3 +10073,8 @@ Video Disk Recorder Revision History
cStatus::OsdCurrentItem() will still work as before, because the default implementation
of cStatus::OsdCurrentItem2() calls cStatus::OsdCurrentItem().
- Fixed unnecessary calls to cStatus::OsdCurrentItem2() when scrolling.
- Added missing calls to cStatus::MsgOsdStatusMessage() and added the new virtual function
cStatus::OsdStatusMessage2(), which can be used to get the type of the message (thanks
to Markus Ehrnsperger). Plugins that implemented cStatus::OsdStatusMessage() will still
work as before, because the default implementation of cStatus::OsdStatusMessage2() calls
cStatus::OsdStatusMessage().

View File

@ -77,8 +77,9 @@ VDR Plugin 'status' Revision History
- Official release.
2025-01-29: Version 2.6.1
2025-02-10: Version 2.6.1
- Added cStatus::OsdItem2().
- Activated logging of OsdItem2().
- Added cStatus::OsdCurrentItem2().
- Added cStatus::OsdStatusMessage2().

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: status.c 5.3 2025/01/29 11:15:26 kls Exp $
* $Id: status.c 5.4 2025/02/12 21:18:53 kls Exp $
*/
#include <vdr/plugin.h>
@ -27,7 +27,7 @@ protected:
virtual void SetSubtitleTrack(int Index, const char * const *Tracks);
virtual void OsdClear(void);
virtual void OsdTitle(const char *Title);
virtual void OsdStatusMessage(const char *Message);
virtual void OsdStatusMessage2(eMessageType Type, const char *Message);
virtual void OsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue);
virtual void OsdItem2(const char *Text, int Index, bool Selectable);
virtual void OsdCurrentItem2(const char *Text, int Index);
@ -86,9 +86,9 @@ void cStatusTest::OsdTitle(const char *Title)
dsyslog("status: cStatusTest::OsdTitle '%s'", Title);
}
void cStatusTest::OsdStatusMessage(const char *Message)
void cStatusTest::OsdStatusMessage2(eMessageType Type, const char *Message)
{
dsyslog("status: cStatusTest::OsdStatusMessage '%s'", Message);
dsyslog("status: cStatusTest::OsdStatusMessage2 %d '%s'", Type, Message);
}
void cStatusTest::OsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue)

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: osdbase.c 5.6 2025/02/05 22:12:32 kls Exp $
* $Id: osdbase.c 5.7 2025/02/12 21:18:53 kls Exp $
*/
#include "osdbase.h"
@ -170,6 +170,7 @@ void cOsdMenu::SetStatus(const char *s)
free(status);
status = s ? strdup(s) : NULL;
displayMenu->SetMessage(mtStatus, s);
cStatus::MsgOsdStatusMessage(mtStatus, s);
}
void cOsdMenu::SetTitle(const char *Title)
@ -242,6 +243,7 @@ void cOsdMenu::Display(void)
if (cOsdProvider::OsdSizeChanged(osdState))
SetDisplayMenu();
displayMenu->SetMessage(mtStatus, NULL);
cStatus::MsgOsdStatusMessage(mtStatus, NULL);
displayMenu->Clear();
if (conveyStatus)
cStatus::MsgOsdClear();
@ -287,8 +289,10 @@ void cOsdMenu::Display(void)
}
}
displayMenu->SetScrollbar(count, first);
if (!isempty(status))
if (!isempty(status)) {
displayMenu->SetMessage(mtStatus, status);
cStatus::MsgOsdStatusMessage(mtStatus, status);
}
}
void cOsdMenu::SetCurrent(cOsdItem *Item)

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: skins.c 5.4 2024/09/21 16:21:08 kls Exp $
* $Id: skins.c 5.5 2025/02/12 21:18:53 kls Exp $
*/
#include "skins.h"
@ -305,7 +305,7 @@ eKeys cSkins::Message(eMessageType Type, const char *s, int Seconds)
}
cSkinDisplay::Current()->SetMessage(Type, s);
cSkinDisplay::Current()->Flush();
cStatus::MsgOsdStatusMessage(s);
cStatus::MsgOsdStatusMessage(Type, s);
eKeys k = kNone;
if (Type != mtStatus) {
k = Interface->Wait(Seconds);
@ -316,7 +316,7 @@ eKeys cSkins::Message(eMessageType Type, const char *s, int Seconds)
}
else {
cSkinDisplay::Current()->SetMessage(Type, NULL);
cStatus::MsgOsdStatusMessage(NULL);
cStatus::MsgOsdStatusMessage(Type, NULL);
}
}
else if (!s && displayMessage) {

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: status.c 5.2 2025/01/29 11:15:26 kls Exp $
* $Id: status.c 5.3 2025/02/12 21:18:53 kls Exp $
*/
#include "status.h"
@ -95,10 +95,10 @@ void cStatus::MsgOsdTitle(const char *Title)
sm->OsdTitle(Title);
}
void cStatus::MsgOsdStatusMessage(const char *Message)
void cStatus::MsgOsdStatusMessage(eMessageType Type, const char *Message)
{
for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
sm->OsdStatusMessage(Message);
sm->OsdStatusMessage2(Type, Message);
}
void cStatus::MsgOsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue)

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: status.h 5.2 2025/01/29 11:15:26 kls Exp $
* $Id: status.h 5.3 2025/02/12 21:18:53 kls Exp $
*/
#ifndef __STATUS_H
@ -13,6 +13,7 @@
#include "config.h"
#include "device.h"
#include "player.h"
#include "skins.h"
#include "tools.h"
// Several member functions of the following classes are called with a pointer to
@ -81,6 +82,7 @@ protected:
virtual void OsdTitle(const char *Title) {}
// Title has been displayed in the title line of the menu.
virtual void OsdStatusMessage(const char *Message) {}
virtual void OsdStatusMessage2(eMessageType Type, const char *Message) { OsdStatusMessage(Message); }
// Message has been displayed in the status line of the menu.
// If Message is NULL, the status line has been cleared.
virtual void OsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue) {}
@ -121,7 +123,9 @@ public:
static void MsgSetSubtitleTrack(int Index, const char * const *Tracks);
static void MsgOsdClear(void);
static void MsgOsdTitle(const char *Title);
static void MsgOsdStatusMessage(const char *Message);
[[deprecated("use MsgOsdStatusMessage(eMessageType Type, const char *Message) instead")]]
static void MsgOsdStatusMessage(const char *Message) { MsgOsdStatusMessage(mtStatus, Message); }
static void MsgOsdStatusMessage(eMessageType Type, const char *Message);
static void MsgOsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue);
static void MsgOsdItem(const char *Text, int Index, bool Selectable = true);
static void MsgOsdCurrentItem(const char *Text, int Index = -1);