Play startup sound after the first defaults rescan is done. This fixed #1902.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34189 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2009-11-22 16:26:12 +00:00
parent 78f94f81ff
commit 2795d5dca5
3 changed files with 19 additions and 2 deletions

View File

@ -104,6 +104,7 @@ enum {
// Raw port based communication
enum {
ADDONSERVER_RESCAN_MEDIAADDON_FLAVORS = 0x50,
ADDONSERVER_RESCAN_FINISHED_NOTIFY,
SERVER_MESSAGE_START = 0x100,
SERVER_REGISTER_APP,
@ -715,6 +716,9 @@ struct addonserver_rescan_mediaaddon_flavors_command : command_data {
media_addon_id addonid;
};
struct addonserver_rescan_finished_notify_command : command_data {
};
struct server_register_mediaaddon_request : request_data {
xfer_entry_ref ref;
};

View File

@ -332,6 +332,9 @@ DefaultManager::RescanThread()
} else {
ERROR("DefaultManager: Did not try to connect mixer and soundcard\n");
}
addonserver_rescan_finished_notify_command cmd;
SendToAddonServer(ADDONSERVER_RESCAN_FINISHED_NOTIFY, &cmd, sizeof(cmd));
printf("DefaultManager::RescanThread() leave\n");
}

View File

@ -29,6 +29,7 @@
#include <Alert.h>
#include <Application.h>
#include <Beep.h>
#include <Directory.h>
#include <Entry.h>
#include <FindDirectory.h>
@ -101,6 +102,7 @@ private:
port_id fControlPort;
thread_id fControlThread;
bool fStartup;
bool fStartupSound;
typedef BApplication inherited;
};
@ -108,7 +110,8 @@ private:
MediaAddonServer::MediaAddonServer(const char *sig)
: BApplication(sig),
fStartup(true)
fStartup(true),
fStartupSound(true)
{
CALLED();
fMediaRoster = BMediaRoster::Roster();
@ -168,7 +171,14 @@ MediaAddonServer::HandleMessage(int32 code, const void *data, size_t size)
_DormantNodeManager->PutAddon(command->addonid);
break;
}
case ADDONSERVER_RESCAN_FINISHED_NOTIFY:
if (fStartupSound) {
system_beep(MEDIA_SOUNDS_STARTUP);
fStartupSound = false;
}
break;
default:
ERROR("media_addon_server: received unknown message code %#08lx\n",code);
}