[haiku-commits] r34602 - haiku/trunk/src/kits/support

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 9 Dec 2009 20:06:24 +0100 (CET)

Author: axeld
Date: 2009-12-09 20:06:24 +0100 (Wed, 09 Dec 2009)
New Revision: 34602
Changeset: http://dev.haiku-os.org/changeset/34602/haiku

Modified:
   haiku/trunk/src/kits/support/Beep.cpp
Log:
* Forgot to check in Beep.cpp. Sorry!


Modified: haiku/trunk/src/kits/support/Beep.cpp
===================================================================
--- haiku/trunk/src/kits/support/Beep.cpp       2009-12-09 17:57:07 UTC (rev 
34601)
+++ haiku/trunk/src/kits/support/Beep.cpp       2009-12-09 19:06:24 UTC (rev 
34602)
@@ -1,34 +1,34 @@
 /*
-** Copyright 2004, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx All rights reserved.
-** Copyright 2007, Jérôme Duval. All rights reserved.
-** Distributed under the terms of the Haiku License.
-*/
+ * Copyright 2004-2009, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx
+ * Copyright 2007, Jérôme Duval. All rights reserved.
+ * Distributed under the terms of the Haiku License.
+ */
 
 
 #include <Beep.h>
+
 #include <stdio.h>
 
-#include "DataExchange.h"
-#include "MediaSounds.h"
+#include <DataExchange.h>
+#include <MediaSounds.h>
 
 
 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");
        if (!messenger.IsValid())
                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_TYPE_KEY, MEDIA_TYPE_SOUNDS);
 
-       status_t err = messenger.SendMessage(&msg, &reply);
-       if ((err != B_OK)
-               || (reply.FindInt32("error", &err) != B_OK))
-               err = B_BAD_REPLY;
-       return err;
+       status_t status = messenger.SendMessage(&msg, &reply);
+       if (status != B_OK || reply.FindInt32("error", &status) != B_OK)
+               status = B_BAD_REPLY;
+
+       return status;
 }
 
 
@@ -40,20 +40,21 @@
 
 
 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");
        if (!messenger.IsValid())
                return B_ERROR;
+
        BMessage msg(MEDIA_SERVER_ADD_SYSTEM_BEEP_EVENT), reply;
        msg.AddString(MEDIA_NAME_KEY, name);
        msg.AddString(MEDIA_TYPE_KEY, MEDIA_TYPE_SOUNDS);
        msg.AddInt32(MEDIA_FLAGS_KEY, flags);
 
-       status_t err = messenger.SendMessage(&msg, &reply);
-       if ((err != B_OK)
-               || (reply.FindInt32("error", &err) != B_OK))
-               err = B_BAD_REPLY;
-       return err;
+       status_t status = messenger.SendMessage(&msg, &reply);
+       if (status != B_OK || reply.FindInt32("error", &status) != B_OK)
+               status = B_BAD_REPLY;
+
+       return status;
 }
 


Other related posts:

  • » [haiku-commits] r34602 - haiku/trunk/src/kits/support - axeld