[haiku-development] Re: Call for vector icon gurus: need a midi port vector icon

  • From: Philippe Houdoin <philippe.houdoin@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 30 Oct 2009 11:27:04 +0100

> I'm not clear [again (:-/] on exactly how the vector icon scheme ties
> in with other programs.  At the moment, I think about the only app
> that uses endpoint icons is PatchBay,

Nope. To support midi endpoint vector icon, you should have:
1) at least one endpoint coming with a vector icon in its properties
2) an app able to display endpoint icon, and supporting vector icon type.

For 1), every MIDI app registering an endpoint should have to be
enhanced to publish a vector icon.
For obvious reason, as hinted by this icon request, midi_server will
be the first:

DeviceWatcher::_SetIcons(BMidiEndpoint* endpoint)
{
        BMessage msg;

-        // TODO: handle Haiku vector icon type
+      msg.AddData("be:vector_icon", B_VECTOR_ICON_TYPE, fVectorIcon->Bits(),
                fVectorIcon->BitsLength());

        msg.AddData("be:large_icon", B_LARGE_ICON_TYPE, fLargeIcon->Bits(),
                fLargeIcon->BitsLength());

        msg.AddData("be:mini_icon", B_MINI_ICON_TYPE, fMiniIcon->Bits(),
                fMiniIcon->BitsLength());

        endpoint->SetProperties(&msg);
}

But any MIDI app driving an endpoint, like "MIDI keyboard" etc could
attach an icon to their endpoint properties
in the same way.

For 2), indeed, PatchBay is our best candidate, MeV could be another
one in a near future.

> and looking at the code, it doesn't seem
> as if there's any way it would pick up vector ones.
> I presume programs  just have to be rewritten to use them?
> (API details anywhere?)

From a resource, check src/kits/interface/Alert.cpp, BAlert::_InitIcon()
Except that rawIcon should be retrieve from endpoint's properties, aka
from a BMessage, in PatchBay.

> I may well play with trying to create such an icon myself, just to see
> how it all works.  But don't expect a masterpiece... (:-))

Replacing a icon by a better looking one is never an issue.
;-)

Bye,
  Philippe.

Other related posts: