From bd3f5af3d441460c420af23eb56a6a570717c0c8 Mon Sep 17 00:00:00 2001 From: Phil Greenway Date: Tue, 24 Sep 2002 12:58:04 +0000 Subject: [PATCH] Command Line Beep. Coded by Mahmoud Al Gammal git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1156 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/bin/beep.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/apps/bin/beep.cpp diff --git a/src/apps/bin/beep.cpp b/src/apps/bin/beep.cpp new file mode 100644 index 0000000000..a18bb776f9 --- /dev/null +++ b/src/apps/bin/beep.cpp @@ -0,0 +1,51 @@ +//=========================================================================== +// ABOUT //////////////////////////////////////////////////////////////////// +//=========================================================================== + +// DESCRIPTION: BeOS' command line "beep" command +// AUTHOR: Mahmoud Al Gammal +// STARTED: MON, SPT 23th, 2002 +// LAST MODIFIED: MON, SPT 23th, 2002 + +//=========================================================================== +// END ABOUT //////////////////////////////////////////////////////////////// +//=========================================================================== + +//====================// + +//=========================================================================== +// INCLUDE ////////////////////////////////////////////////////////////////// +//=========================================================================== + +#include +#include + +//=========================================================================== +// END INCLUDE ////////////////////////////////////////////////////////////// +//=========================================================================== + +//====================// + +//=========================================================================== +// MAIN ///////////////////////////////////////////////////////////////////// +//=========================================================================== + +int main( int argc, char* argv[] ) { + + // "beep" can only take a single optional event name + if( argc > 2 ) { + cout << "usage: beep [ eventname ]\n" + "Event names are found in the Sounds preferences panel." + << std::endl; + + return B_OK; + } + + // if no event name is specified, play the default "Beep" event + if( argc == 1 ) return beep(); + else return system_beep( argv[1] ); +} + +//=========================================================================== +// END MAIN ///////////////////////////////////////////////////////////////// +//===========================================================================