* Forgot to check in Beep.cpp. Sorry!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34602 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+22
-21
@@ -1,34 +1,34 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2004-2009, Axel Dörfler, [email protected].
|
||||||
** Copyright 2007, Jérôme Duval. All rights reserved.
|
* Copyright 2007, Jérôme Duval. All rights reserved.
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the Haiku License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <Beep.h>
|
#include <Beep.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "DataExchange.h"
|
#include <DataExchange.h>
|
||||||
#include "MediaSounds.h"
|
#include <MediaSounds.h>
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
system_beep(const char *eventName)
|
system_beep(const char* eventName)
|
||||||
{
|
{
|
||||||
// TODO: Axel, fix me!
|
|
||||||
static const uint32 MEDIA_ADDON_SERVER_PLAY_MEDIA = 0;
|
|
||||||
BMessenger messenger("application/x-vnd.Be.addon-host");
|
BMessenger messenger("application/x-vnd.Be.addon-host");
|
||||||
if (!messenger.IsValid())
|
if (!messenger.IsValid())
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
BMessage msg(MEDIA_ADDON_SERVER_PLAY_MEDIA), reply;
|
|
||||||
|
BMessage msg(MEDIA_ADD_ON_SERVER_PLAY_MEDIA), reply;
|
||||||
msg.AddString(MEDIA_NAME_KEY, eventName ? eventName : MEDIA_SOUNDS_BEEP);
|
msg.AddString(MEDIA_NAME_KEY, eventName ? eventName : MEDIA_SOUNDS_BEEP);
|
||||||
msg.AddString(MEDIA_TYPE_KEY, MEDIA_TYPE_SOUNDS);
|
msg.AddString(MEDIA_TYPE_KEY, MEDIA_TYPE_SOUNDS);
|
||||||
|
|
||||||
status_t err = messenger.SendMessage(&msg, &reply);
|
status_t status = messenger.SendMessage(&msg, &reply);
|
||||||
if ((err != B_OK)
|
if (status != B_OK || reply.FindInt32("error", &status) != B_OK)
|
||||||
|| (reply.FindInt32("error", &err) != B_OK))
|
status = B_BAD_REPLY;
|
||||||
err = B_BAD_REPLY;
|
|
||||||
return err;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -40,20 +40,21 @@ beep()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
add_system_beep_event(const char *name, uint32 flags)
|
add_system_beep_event(const char* name, uint32 flags)
|
||||||
{
|
{
|
||||||
BMessenger messenger("application/x-vnd.Be.media-server");
|
BMessenger messenger("application/x-vnd.Be.media-server");
|
||||||
if (!messenger.IsValid())
|
if (!messenger.IsValid())
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
BMessage msg(MEDIA_SERVER_ADD_SYSTEM_BEEP_EVENT), reply;
|
BMessage msg(MEDIA_SERVER_ADD_SYSTEM_BEEP_EVENT), reply;
|
||||||
msg.AddString(MEDIA_NAME_KEY, name);
|
msg.AddString(MEDIA_NAME_KEY, name);
|
||||||
msg.AddString(MEDIA_TYPE_KEY, MEDIA_TYPE_SOUNDS);
|
msg.AddString(MEDIA_TYPE_KEY, MEDIA_TYPE_SOUNDS);
|
||||||
msg.AddInt32(MEDIA_FLAGS_KEY, flags);
|
msg.AddInt32(MEDIA_FLAGS_KEY, flags);
|
||||||
|
|
||||||
status_t err = messenger.SendMessage(&msg, &reply);
|
status_t status = messenger.SendMessage(&msg, &reply);
|
||||||
if ((err != B_OK)
|
if (status != B_OK || reply.FindInt32("error", &status) != B_OK)
|
||||||
|| (reply.FindInt32("error", &err) != B_OK))
|
status = B_BAD_REPLY;
|
||||||
err = B_BAD_REPLY;
|
|
||||||
return err;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user