[haiku-development] Cortex fix ticket 1763
- From: Maurice Kalinowski <haiku@xxxxxxxxxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Sat, 01 Mar 2008 00:09:06 +0100
Hi all,
find attached a small patch to partly close ticket 1763. The problem is,
that the GetDormantFlavorInfoFor() actually fails under Haiku though we
got a dormant_node_info. So in case we cannot access needed information,
we simply set the icon to be a generic one. This leads me to a question.
Actually GetDormantNodeFor in MediaIcon.cpp line 134 works, though the
system timesource is not part of an addon. See
http://www.beunited.org/bebook/The%20Media%20Kit/MediaRoster.html#GetDormantNodes()
for description of dormant nodes themself. It is not part of the
application either, so it seems like the system time source needs to be
handled specifically. As I have no R5 laying around, maybe someone else
can check how R5 behaves in this case? I guess GetDormantNodeFor will
fail there for the system time source.
I didn't want to add code to the MediaKit already, instead I was looking
for some input from someone with deeper experience into these things.
So finally, the issue of not displaying an icon or garbage has been
fixed. Unfortunately it still does not display the correct icon (a time
source one) but a generic one. This is why I called it a partial fix so far.
Cheerio,
Maurice
--- ../../../../../haiku/src/apps/cortex/support/MediaIcon.cpp 2008-02-21
20:29:47.000000000 +0100
+++ MediaIcon.cpp 2008-02-29 23:52:57.000000000 +0100
@@ -170,6 +170,11 @@
bool audioIn = false, audioOut = false, videoIn = false,
videoOut = false;
_getMediaTypesFor(flavorInfo, &audioIn, &audioOut, &videoIn,
&videoOut);
_findDefaultIconFor(audioIn, audioOut, videoIn, videoOut);
+ } else {
+ if (m_size == B_LARGE_ICON)
+ SetBits(M_GENERIC_ICON.large, 1024, 0, B_CMAP8);
+ else if (m_size == B_MINI_ICON)
+ SetBits(M_GENERIC_ICON.small, 256, 0, B_CMAP8);
}
}
Other related posts: