[openbeos-midi] Re: Other question on BMidiEndPoint

  • From: Michael Pfeiffer <michael.pfeiffer@xxxxxxxxx>
  • To: openbeos-midi@xxxxxxxxxxxxx
  • Date: Thu, 10 Oct 2002 11:01:08 -0700

>Now I understand what do Release and Acquire
>
>how is decided the id of the BMidiEndPoint?

This seems to be a system wide unique number.
The midi_server has to manage it.

>Now question about Register an Unregister

In Midi Kit 2 an application can publish BMidiEndpoint
objects so they are available to other applications.

I think BMidiEndpoint::Register is implemented
something like:

status_t BMidiEndpoint::Register() {
  BMidiRoster* roster = BMidiRoster::MidiRoster();
  if (roster) return roster->Register(this);
  else return B_ERROR;
}

BMidiRoster::NextEndPoint(int32* id) allows to querry 
published BMidiEndpoint objects.

ie.
BMidiRoster* roster = BMidiRoster::MidiRoster();
int32 id = 0;
BMidiEndpoint* e;
while ((e = roster->NextEndPoint(&id)) != NULL) {
        // do something with endpoint ...
}

>I think for this 2 functions that publish device in /dev/midi/ for other app 
>can talk 
>together but the question is how create and read/write with the new *entry*?

AFAIK sound card device drivers publish in /dev/midi the Midi ports of the 
sound card.

- Michael





Other related posts: