Lines Matching defs:msg

99 MidiServerApp::MessageReceived(BMessage* msg)
102 printf("IN "); msg->PrintToStream();
105 switch (msg->what) {
107 _OnRegisterApp(msg);
110 _OnCreateEndpoint(msg);
113 _OnDeleteEndpoint(msg);
116 _OnPurgeEndpoint(msg);
119 _OnChangeEndpoint(msg);
122 _OnConnectDisconnect(msg);
125 _OnConnectDisconnect(msg);
129 super::MessageReceived(msg);
136 MidiServerApp::_OnRegisterApp(BMessage* msg)
148 if (msg->FindMessenger("midi:messenger", &app->messenger) == B_OK
168 MidiServerApp::_OnCreateEndpoint(BMessage* msg)
175 endpoint->app = _WhichApp(msg);
181 if (msg->FindBool("midi:consumer", &endpoint->consumer) == B_OK
182 && msg->FindBool("midi:registered", &endpoint->registered) == B_OK
183 && msg->FindString("midi:name", &endpoint->name) == B_OK
184 && msg->FindMessage("midi:properties", &endpoint->properties)
187 if (msg->FindInt32("midi:port", &endpoint->port) == B_OK
188 && msg->FindInt64("midi:latency", &endpoint->latency)
205 if (_SendReply(endpoint->app, msg, &reply) && status == B_OK)
206 _AddEndpoint(msg, endpoint);
213 MidiServerApp::_OnDeleteEndpoint(BMessage* msg)
222 app_t* app = _WhichApp(msg);
224 endpoint_t* endpoint = _WhichEndpoint(msg, app);
232 MidiServerApp::_OnPurgeEndpoint(BMessage* msg)
242 if (!msg->IsSourceRemote()) {
244 if (msg->FindInt32("midi:id", &id) == B_OK) {
254 MidiServerApp::_OnChangeEndpoint(BMessage* msg)
261 app_t* app = _WhichApp(msg);
265 endpoint = _WhichEndpoint(msg, app);
275 if (_SendReply(app, msg, &reply) && status == B_OK) {
283 if (msg->FindBool("midi:registered", &registered) == B_OK) {
289 if (msg->FindString("midi:name", &name) == B_OK) {
295 if (msg->FindMessage("midi:properties", &properties) == B_OK) {
301 if (msg->FindInt64("midi:latency", &latency) == B_OK) {
316 MidiServerApp::_OnConnectDisconnect(BMessage* msg)
320 bool mustConnect = msg->what == MSG_CONNECT_ENDPOINTS;
326 app_t* app = _WhichApp(msg);
334 if (msg->FindInt32("midi:producer", &producerID) == B_OK
335 && msg->FindInt32("midi:consumer", &consumerID) == B_OK) {
357 if (_SendReply(app, msg, &reply) && status == B_OK) {
436 MidiServerApp::_AddEndpoint(BMessage* msg, endpoint_t* endpoint)
438 ASSERT(msg != NULL)
507 MidiServerApp::_MakeCreatedNotification(BMessage* msg, endpoint_t* endpoint)
509 ASSERT(msg != NULL)
512 msg->MakeEmpty();
513 msg->what = MSG_ENDPOINT_CREATED;
514 msg->AddInt32("midi:id", endpoint->id);
515 msg->AddBool("midi:consumer", endpoint->consumer);
516 msg->AddBool("midi:registered", endpoint->registered);
517 msg->AddString("midi:name", endpoint->name);
518 msg->AddMessage("midi:properties", &endpoint->properties);
521 msg->AddInt32("midi:port", endpoint->port);
522 msg->AddInt64("midi:latency", endpoint->latency);
529 MidiServerApp::_MakeConnectedNotification(BMessage* msg, endpoint_t* producer,
532 ASSERT(msg != NULL)
538 msg->MakeEmpty();
541 msg->what = MSG_ENDPOINTS_CONNECTED;
543 msg->what = MSG_ENDPOINTS_DISCONNECTED;
545 msg->AddInt32("midi:producer", producer->id);
546 msg->AddInt32("midi:consumer", consumer->id);
554 MidiServerApp::_WhichApp(BMessage* msg)
556 ASSERT(msg != NULL)
558 BMessenger retadr = msg->ReturnAddress();
578 MidiServerApp::_WhichEndpoint(BMessage* msg, app_t* app)
580 ASSERT(msg != NULL)
584 if (msg->FindInt32("midi:id", &id) == B_OK) {
619 MidiServerApp::_NotifyAll(BMessage* msg, app_t* except)
621 ASSERT(msg != NULL)
625 if (app != except && !_SendNotification(app, msg)) {
640 MidiServerApp::_SendNotification(app_t* app, BMessage* msg)
643 ASSERT(msg != NULL)
645 status_t status = app->messenger.SendMessage(msg, (BHandler*) NULL,
659 MidiServerApp::_SendReply(app_t* app, BMessage* msg, BMessage* reply)
661 ASSERT(msg != NULL)
664 status_t status = msg->SendReply(reply, (BHandler*) NULL, TIMEOUT);
700 BMessage msg;
705 msg.MakeEmpty();
706 msg.what = MSG_PURGE_ENDPOINT;
707 msg.AddInt32("midi:id", endpoint->id);
717 if (be_app_messenger.SendMessage(&msg, (BHandler*)NULL,