Skip to content

Commit

Permalink
media_server: Initial move to BServer
Browse files Browse the repository at this point in the history
  • Loading branch information
Numerio committed Apr 3, 2016
1 parent 6501f7f commit 1199f32
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/servers/media/Jamfile
Expand Up @@ -2,7 +2,7 @@ SubDir HAIKU_TOP src servers media ;

SetSubDirSupportedPlatformsBeOSCompatible ;

UsePrivateHeaders media shared storage ;
UsePrivateHeaders media shared storage app ;
UsePrivateSystemHeaders ;

AddResources media_server : media_server.rdef ;
Expand Down
25 changes: 14 additions & 11 deletions src/servers/media/media_server.cpp
Expand Up @@ -37,7 +37,7 @@ char __dont_remove_copyright_from_binary[] = "Copyright (c) 2002, 2003 "
#include <string.h>

#include <Alert.h>
#include <Application.h>
#include <Server.h>
#include <Autolock.h>
#include <Directory.h>
#include <Roster.h>
Expand Down Expand Up @@ -69,10 +69,10 @@ NotificationManager* gNotificationManager;
#define REPLY_TIMEOUT ((bigtime_t)500000)


class ServerApp : BApplication {
class ServerApp : public BServer {
public:
ServerApp();
~ServerApp();
ServerApp(status_t& error);
virtual ~ServerApp();

protected:
virtual void ArgvReceived(int32 argc, char** argv);
Expand All @@ -89,17 +89,17 @@ class ServerApp : BApplication {
private:
port_id _ControlPort() const { return fControlPort; }

static int32 _ControlThread(void* arg);
static int32 _ControlThread(void* arg);

BLocker fLocker;
port_id fControlPort;
thread_id fControlThread;
};


ServerApp::ServerApp()
ServerApp::ServerApp(status_t& error)
:
BApplication(B_MEDIA_SERVER_SIGNATURE),
BServer(B_MEDIA_SERVER_SIGNATURE, true, &error),
fLocker("media server locker")
{
gNotificationManager = new NotificationManager;
Expand Down Expand Up @@ -971,8 +971,11 @@ ServerApp::MessageReceived(BMessage* msg)
int
main()
{
new ServerApp;
be_app->Run();
delete be_app;
return 0;
status_t status;
ServerApp app(status);

if (status == B_OK)
app.Run();

return status == B_OK ? EXIT_SUCCESS : EXIT_FAILURE;
}

0 comments on commit 1199f32

Please sign in to comment.