[mythtv] Extending mythnotification UDP interface?

Warpme warpme at o2.pl
Thu Jul 4 18:38:23 UTC 2013


On 7/4/13 6:30 AM, Jean-Yves Avenard wrote:
> Hi
>
>
> On 3 July 2013 22:09, warpme <warpme at o2.pl <mailto:warpme at o2.pl>> wrote:
>
>
>     Short-term: add to UDP interface possibility to provide all fields
>     (coverart,album,artist,time,info,progress). Only in UDP. mythutil
>     can stay like today.
>
>
> this is done; all field can be populated using the UDP interface, 
> including fullscreen display
>
Jya,
Thx so much for this addition. You reading my mind also regarding widget 
names.
Perfect.Thx!

For my purposes I add possibility to select predefined window definition 
when notification is sent.
Namely: if UDP received xml structure contains additional tag 
<type>some_type</type> then mythuinotification subsystem will load 
"notification-some_type" window definition from notification-ui.xml file.
This allows to have multiple notification window definitions and select 
them via UDP.
I'm attaching patch for this as I believe this might be nice "hidden 
feature".

So now for me only missing thing - for having production-grade 
notifications - is issue with Esc when notification is during playback.
Currently Esc causes playback exit (with still present notification) 
instead of clearing notification and keeping playback.
Is this issue by design or it is rather "work-in-progress" thing?

BTW: fe shows me in log things like this:
2013-07-04 18:37:12.481731 I  Received notification 'message_text', 
timeout 48
2013-07-04 18:37:12.482338 N  Custom notification theme request 
type:big, will load:notification-big
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
2013-07-04 18:37:12.528114 E  MythPainter::GetImageFromTextLayout: 
Invalid canvas.
2013-07-04 18:37:12.528139 D  MythPainter::DrawTextLayout: Rendered 
image is null.
2013-07-04 18:37:12.530599 E  MythPainter::GetImageFromTextLayout: 
Invalid canvas.
2013-07-04 18:37:12.530627 D  MythPainter::DrawTextLayout: Rendered 
image is null.
2013-07-04 18:37:12.544235 E  MythPainter::GetImageFromTextLayout: 
Invalid canvas.
2013-07-04 18:37:12.544260 D  MythPainter::DrawTextLayout: Rendered 
image is null.
2013-07-04 18:37:12.563888 E  MythPainter::GetImageFromTextLayout: 
Invalid canvas.
2013-07-04 18:37:12.563908 D  MythPainter::DrawTextLayout: Rendered 
image is null.
2013-07-04 18:37:12.583484 E  MythPainter::GetImageFromTextLayout: 
Invalid canvas.
2013-07-04 18:37:12.583504 D  MythPainter::DrawTextLayout: Rendered 
image is null.
2013-07-04 18:37:12.602762 E  MythPainter::GetImageFromTextLayout: 
Invalid canvas.
2013-07-04 18:37:12.602782 D  MythPainter::DrawTextLayout: Rendered 
image is null.
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::begin: Paint device returned engine == 0, type: 3
2013-07-04 18:37:12.623488 E  MythPainter::GetImageFromTextLayout: 
Invalid canvas.
2013-07-04 18:37:12.623509 D  MythPainter::DrawTextLayout: Rendered 
image is null.
2013-07-04 18:37:12.643484 E  MythPainter::GetImageFromTextLayout: 
Invalid canvas.
2013-07-04 18:37:12.643505 D  MythPainter::DrawTextLayout: Rendered 
image is null.
2013-07-04 18:37:12.663519 E  MythPainter::GetImageFromTextLayout: 
Invalid canvas.
2013-07-04 18:37:12.663540 D  MythPainter::DrawTextLayout: Rendered 
image is null.
2013-07-04 18:37:12.682780 E  MythPainter::GetImageFromTextLayout: 
Invalid canvas.
2013-07-04 18:37:12.682800 D  MythPainter::DrawTextLayout: Rendered 
image is null.
2013-07-04 18:37:12.702790 E  MythPainter::GetImageFromTextLayout: 
Invalid canvas.
2013-07-04 18:37:12.702811 D  MythPainter::DrawTextLayout: Rendered 
image is null.
QPainter::begin: Paint device returned engine == 0, type: 3
2013-07-04 18:37:12.722910 E  MythPainter::GetImageFromTextLayout: 
Invalid canvas.
2013-07-04 18:37:12.722929 D  MythPainter::DrawTextLayout: Rendered 
image is null.

Above errors are with & without my patch.
Do You believe this is something related to my setup?

br


-------------- next part --------------
diff -Naur mythtv-0.26-20130702-gc9accc2-old/mythtv/libs/libmythui/mythudplistener.cpp mythtv-0.26-20130702-gc9accc2-new/mythtv/libs/libmythui/mythudplistener.cpp
--- mythtv-0.26-20130702-gc9accc2-old/mythtv/libs/libmythui/mythudplistener.cpp	2013-07-04 09:39:46.000000000 +0200
+++ mythtv-0.26-20130702-gc9accc2-new/mythtv/libs/libmythui/mythudplistener.cpp	2013-07-04 14:22:09.000000000 +0200
@@ -110,6 +110,7 @@
     QString description = "";
     QString extra = "";
     QString progress_text = "";
+    QString type = "";
     float progress = -1.0f;
     bool fullscreen;
 
@@ -142,6 +143,8 @@
                 if (!ok)
                     progress = -1.0f;
             }
+            else if (notification && e.tagName() == "type")
+                type = e.text();
             else
             {
                 LOG(VB_GENERAL, LOG_ERR, LOC + QString("Unknown element: %1")
@@ -165,6 +168,7 @@
             data["asar"] = origin.isNull() ? tr("UDP Listener") : origin;
             data["asal"] = description;
             data["asfm"] = extra;
+            data["astp"] = type;
 
             MythNotification *n;
             if (!image.isEmpty())
diff -Naur mythtv-0.26-20130702-gc9accc2-old/mythtv/libs/libmythui/mythuinotificationcenter.cpp mythtv-0.26-20130702-gc9accc2-new/mythtv/libs/libmythui/mythuinotificationcenter.cpp
--- mythtv-0.26-20130702-gc9accc2-old/mythtv/libs/libmythui/mythuinotificationcenter.cpp	2013-07-04 09:39:46.000000000 +0200
+++ mythtv-0.26-20130702-gc9accc2-new/mythtv/libs/libmythui/mythuinotificationcenter.cpp	2013-07-04 15:02:48.471578900 +0200
@@ -171,6 +171,12 @@
     {
         theme = "notification-image";
     }
+    else if (!m_type.isEmpty())
+    {
+        theme = QString("notification-%1").arg(m_type);
+        LOG(VB_GENERAL, LOG_NOTICE, QString("Custom notification theme request type:%1, will load:%2")
+            .arg(m_type).arg(theme));
+    }
     else
     {
         theme = "notification";
@@ -371,6 +377,11 @@
     {
         m_format = tmp;
     }
+    tmp = data["astp"];
+    if (!(tmp.isNull() && (m_update & kMetaData)))
+    {
+        m_type = tmp;
+    }
 }
 
 /**
diff -Naur mythtv-0.26-20130702-gc9accc2-old/mythtv/libs/libmythui/mythuinotificationcenter_private.h mythtv-0.26-20130702-gc9accc2-new/mythtv/libs/libmythui/mythuinotificationcenter_private.h
--- mythtv-0.26-20130702-gc9accc2-old/mythtv/libs/libmythui/mythuinotificationcenter_private.h	2013-07-04 09:39:46.000000000 +0200
+++ mythtv-0.26-20130702-gc9accc2-new/mythtv/libs/libmythui/mythuinotificationcenter_private.h	2013-07-04 14:28:51.000000000 +0200
@@ -85,6 +85,7 @@
     MythUIText         *m_formatText;
     MythUIText         *m_timeText;
     MythUIProgressBar  *m_progressBar;
+    QString             m_type;
 
 };
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: warpme.vcf
Type: text/x-vcard
Size: 83 bytes
Desc: not available
URL: <http://www.mythtv.org/pipermail/mythtv-dev/attachments/20130704/6efcea82/attachment.vcf>


More information about the mythtv-dev mailing list