midi_server: Converted to BServer, launched on demand.
This commit is contained in:
+1
-1
@@ -40,7 +40,7 @@ service x-vnd.Haiku-media_server {
|
|||||||
service x-vnd.Haiku-midi_server {
|
service x-vnd.Haiku-midi_server {
|
||||||
launch /system/servers/midi_server
|
launch /system/servers/midi_server
|
||||||
no_safemode
|
no_safemode
|
||||||
legacy
|
on_demand
|
||||||
}
|
}
|
||||||
|
|
||||||
service x-vnd.Haiku-mail_daemon {
|
service x-vnd.Haiku-mail_daemon {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ SubDir HAIKU_TOP src servers midi ;
|
|||||||
|
|
||||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||||
|
|
||||||
UsePrivateHeaders midi shared storage ;
|
UsePrivateHeaders app midi shared storage ;
|
||||||
|
|
||||||
Server midi_server :
|
Server midi_server :
|
||||||
MidiServerApp.cpp
|
MidiServerApp.cpp
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2002-2015, Haiku, Inc. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Matthijs Hollemans
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002-2004 Matthijs Hollemans
|
* Copyright (c) 2002-2004 Matthijs Hollemans
|
||||||
*
|
*
|
||||||
@@ -36,9 +44,9 @@
|
|||||||
using std::nothrow;
|
using std::nothrow;
|
||||||
|
|
||||||
|
|
||||||
MidiServerApp::MidiServerApp()
|
MidiServerApp::MidiServerApp(status_t& error)
|
||||||
:
|
:
|
||||||
BApplication(MIDI_SERVER_SIGNATURE)
|
BServer(MIDI_SERVER_SIGNATURE, true, &error)
|
||||||
{
|
{
|
||||||
TRACE(("Running Haiku MIDI server"))
|
TRACE(("Running Haiku MIDI server"))
|
||||||
|
|
||||||
@@ -816,7 +824,11 @@ MidiServerApp::_DumpEndpoints()
|
|||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
MidiServerApp app;
|
status_t status;
|
||||||
|
MidiServerApp app(status);
|
||||||
|
|
||||||
|
if (status == B_OK)
|
||||||
app.Run();
|
app.Run();
|
||||||
return 0;
|
|
||||||
|
return status == B_OK ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#define MIDI_SERVER_APP_H
|
#define MIDI_SERVER_APP_H
|
||||||
|
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Server.h>
|
||||||
#include <List.h>
|
#include <List.h>
|
||||||
|
|
||||||
#include "DeviceWatcher.h"
|
#include "DeviceWatcher.h"
|
||||||
@@ -24,16 +24,16 @@ struct endpoint_t;
|
|||||||
incoming messages from libmidi2.so, and notifies the apps
|
incoming messages from libmidi2.so, and notifies the apps
|
||||||
when something interesting happens.
|
when something interesting happens.
|
||||||
*/
|
*/
|
||||||
class MidiServerApp : public BApplication {
|
class MidiServerApp : public BServer {
|
||||||
public:
|
public:
|
||||||
MidiServerApp();
|
MidiServerApp(status_t& error);
|
||||||
virtual ~MidiServerApp();
|
virtual ~MidiServerApp();
|
||||||
|
|
||||||
virtual void AboutRequested();
|
virtual void AboutRequested();
|
||||||
virtual void MessageReceived(BMessage* msg);
|
virtual void MessageReceived(BMessage* msg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef BApplication super;
|
typedef BServer super;
|
||||||
|
|
||||||
void _OnRegisterApp(BMessage* msg);
|
void _OnRegisterApp(BMessage* msg);
|
||||||
void _OnCreateEndpoint(BMessage* msg);
|
void _OnCreateEndpoint(BMessage* msg);
|
||||||
|
|||||||
Reference in New Issue
Block a user