// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief TypeInfo non-inline non-template implementation */
+ \brief Beeper non-inline non-template implementation */
#include "Beeper.hh"
//#include "Beeper.ih"
// Custom includes
#include <unistd.h>
-#include <sys/ioctl.h>
#include <fcntl.h>
-#include <linux/kd.h>
#include <boost/bind.hpp>
#include "Exception.hh"
::close(fd_);
}
-prefix_ bool senf::Beeper::start_beep(float freq)
-{
- return ::ioctl(fd_, KIOCSOUND, (int)(CLOCK_TICK_RATE/freq)) == 0;
-}
-
-prefix_ void senf::Beeper::stop_beep()
-{
- ::ioctl(fd_, KIOCSOUND, 0);
-}
-
prefix_ void senf::Beeper::beep_sync(float freq, unsigned length, unsigned count, unsigned delay)
{
for (unsigned i = 0; i < count; ++i) {
--- /dev/null
+// $Id$
+//
+// Copyright (C) 2010
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
+// Thorsten Horstmann <tho@berlios.de>
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/** \file
+ \brief Beeper inline non-template implementation */
+
+// Custom includes
+#include <sys/ioctl.h>
+#include <linux/kd.h>
+
+#define prefix_ inline
+///////////////////////////////cci.p////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////
+// senf::Beeper
+
+prefix_ bool senf::Beeper::start_beep(float freq)
+{
+ return ::ioctl(fd_, KIOCSOUND, (int)(CLOCK_TICK_RATE/freq)) == 0;
+}
+
+prefix_ void senf::Beeper::stop_beep()
+{
+ ::ioctl(fd_, KIOCSOUND, 0);
+}
+
+///////////////////////////////cci.e////////////////////////////////////////
+#undef prefix_
+
+\f
+// Local Variables:
+// mode: c++
+// fill-column: 100
+// c-file-style: "senf"
+// indent-tabs-mode: nil
+// ispell-local-dictionary: "american"
+// compile-command: "scons -u test"
+// comment-column: 40
+// End:
void beep_sync(float freq, unsigned length, unsigned count = 1, unsigned delay = 100);
///< play beep synchronous
- /**< \param freq frequency in Hz, where 0 <freqN < 20000.
+ /**< \param freq frequency in Hz, where 0 < \e freq < 20000.
The regular terminal beep is around 750Hz.
\param length duration in milliseconds.
\param count number of repetitions (defaults to 1).
\param delay delay between repetitions in milliseconds. */
void beep_async(float freq, unsigned length, unsigned count = 1, unsigned delay = 100);
///< play beep asynchronous
- /**< \param freq frequency in Hz, where 0 <freqN < 20000.
+ /**< \param freq frequency in Hz, where 0 < \e freq < 20000.
The regular terminal beep is around 750Hz.
\param length duration in milliseconds.
\param count number of repetitions (defaults to 1).
\param delay delay between repetitions in milliseconds. */
void stop_beep(); ///< stop playing.
+ bool start_beep(float freq); ///< start playing.
+ /**< start playing until any other member is called.
+ \param freq frequency in Hz, where 0 < \e freq < 20000.
+ \returns \a true on success.*/
private:
static const unsigned CLOCK_TICK_RATE = 1193180;
} params_;
#endif
- bool start_beep(float freq);
void timeout();
};
}
///////////////////////////////hh.e////////////////////////////////////////
-//#include "Beeper.cci"
+#include "Beeper.cci"
//#include "Beeper.ct"
//#include "Beeper.cti"
#endif