[openbeos-midi] Re: The first version of Milestone 3

  • From: "Philippe Houdoin" <philippe.houdoin@xxxxxxx>
  • To: openbeos-midi@xxxxxxxxxxxxx
  • Date: Sat, 11 Jan 2003 01:02:39 +0100 (added by postmaster@wanadoo.fr)

> That's really simply (perhaps too=3D3F)
> this version use write/read for sending/receiving midi data to 
> hardware.
> that work,
> 
> you can see result here : http://jerome.leveque.free.fr/
> Midi=3D5FDrivers.zip

I just give it a quick look, but it seems great already.
:-)

MidiDrivers* don't sound a good name for such classes.
MidiPortProducer and MidiPortConsumer seems more accurate to me, but 
that's just a suggestion. 

Beside this, for the Consumer side, I'll be intersted to see if most of 
/dev/midi/* ports 
don't already return from read() only one event at a time, by using the 
midi parser kernel module.
You won't need to do it again in your GetData() thread, in this case.

However, there is still the sysex messages to handle...
 
> todo list(not good order)
>       - Adding good icon for Patchbay

Yeah, capture this default midi=5Fserver icon for the /dev/midi/* port he 
publish.
According to nm --demangle midi=5Fserver, it come as small (16x16) and 
big size (32x32), but not as resource unfortunatly... 

>       - Automatic creation for all entry in /dev/midi/

// recursively wander down from a path, looking for "midi" devices to 
publish
static void lookup=5Fdevices(const char *       path)
{
        BDirectory dir(path);

        if (dir.InitCheck() !=3D B=5FOK)
                return;
                
        BEntry entry;

        dir.Rewind();
        while (dir.GetNextEntry(&entry) >=3D 0) {
                BPath name;
                entry.GetPath(&name);
                if (entry.IsDirectory())
                        lookup=5Fdevices(name.Path());

                int file =3D open("/dev/midi/ymf754/1", O=5FRDWR | O=5FEXCL);
                
                cons =3D new MidiPortConsumer(file, name.Path());
                cons->Register();
                prod =3D new MidiPortProducer(file, name.Path());
                prod->Register();

        };      // while        
}

And somewhere in your main:

lookup=5Fdevices("/dev/midi");

Hope this help.

-Philippe

--
Fortune Cookie Says:

Pretend to spank me -- I'm a pseudo-masochist!


Other related posts: