2006-12-22 08:19:00 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright 2002-2006, Haiku Inc. All rights reserved.
|
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
|
*
|
|
|
|
|
* Authors:
|
|
|
|
|
* Mahmoud Al Gammal
|
|
|
|
|
*/
|
|
|
|
|
|
2002-09-24 12:58:04 +00:00
|
|
|
|
|
|
|
|
#include <Beep.h>
|
2006-12-22 08:19:00 +00:00
|
|
|
|
2002-10-21 21:53:52 +00:00
|
|
|
#include <stdio.h>
|
2002-09-24 12:58:04 +00:00
|
|
|
|
2006-12-22 08:19:00 +00:00
|
|
|
|
2002-10-21 21:53:52 +00:00
|
|
|
int
|
2006-12-22 08:19:00 +00:00
|
|
|
main(int argc, char* argv[])
|
2002-10-21 21:53:52 +00:00
|
|
|
{
|
2002-09-24 12:58:04 +00:00
|
|
|
// "beep" can only take a single optional event name
|
2012-04-01 13:02:21 -05:00
|
|
|
if (argc > 2
|
2006-12-22 08:19:00 +00:00
|
|
|
|| (argc == 2 && argv[1][0] == '-')) {
|
2012-04-01 13:02:21 -05:00
|
|
|
fprintf(stdout, "usage: beep [ eventname ]\n");
|
|
|
|
|
fprintf(stdout, "Event names are found in the "
|
|
|
|
|
"Sounds preferences panel.\n");
|
|
|
|
|
fflush(stdout);
|
2002-09-24 12:58:04 +00:00
|
|
|
return B_OK;
|
|
|
|
|
}
|
2012-04-01 13:02:21 -05:00
|
|
|
|
2002-09-24 12:58:04 +00:00
|
|
|
// if no event name is specified, play the default "Beep" event
|
2006-12-22 08:19:00 +00:00
|
|
|
if (argc == 1)
|
2002-10-21 21:53:52 +00:00
|
|
|
return beep();
|
2006-12-22 08:19:00 +00:00
|
|
|
else
|
2002-10-21 21:53:52 +00:00
|
|
|
return system_beep(argv[1]);
|
2002-09-24 12:58:04 +00:00
|
|
|
}
|