aboutsummaryrefslogtreecommitdiffstats
path: root/src/gaudio/gaudio_driver_record.h
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2015-01-21 17:26:24 +1000
committerinmarket <andrewh@inmarket.com.au>2015-01-21 17:26:24 +1000
commitfa8167b94d13e94a6cb953e7f549a89f155f77c6 (patch)
tree8c33f78c45ca72ac2653327607f1d7caed668c5e /src/gaudio/gaudio_driver_record.h
parent34939386d7390b0876973a1969f336b814313a22 (diff)
downloaduGFX-fa8167b94d13e94a6cb953e7f549a89f155f77c6.tar.gz
uGFX-fa8167b94d13e94a6cb953e7f549a89f155f77c6.tar.bz2
uGFX-fa8167b94d13e94a6cb953e7f549a89f155f77c6.zip
Big file rename to reduce problems with brain-dead IDE's that don't handle project file hierarchies well.
Naming is more consistent with the new scheme. May affect some third party drivers (header file renames).
Diffstat (limited to 'src/gaudio/gaudio_driver_record.h')
-rw-r--r--src/gaudio/gaudio_driver_record.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/src/gaudio/gaudio_driver_record.h b/src/gaudio/gaudio_driver_record.h
new file mode 100644
index 00000000..280be5d1
--- /dev/null
+++ b/src/gaudio/gaudio_driver_record.h
@@ -0,0 +1,108 @@
+/*
+ * This file is subject to the terms of the GFX License. If a copy of
+ * the license was not distributed with this file, you can obtain one at:
+ *
+ * http://ugfx.org/license.html
+ */
+
+/**
+ * @file src/gaudio/gaudio_driver_record.h
+ * @brief GAUDIO - Audio Recording driver header file.
+ *
+ * @defgroup Driver Driver
+ * @ingroup GAUDIO
+ * @{
+ */
+
+#ifndef _GAUDIO_RECORD_LLD_H
+#define _GAUDIO_RECORD_LLD_H
+
+#include "gfx.h"
+
+#if (GFX_USE_GAUDIO && GAUDIO_NEED_RECORD) || defined(__DOXYGEN__)
+
+/*===========================================================================*/
+/* Type definitions */
+/*===========================================================================*/
+
+/**
+ * @brief Get a free block of audio data that we can record into
+ * @return A pointer to the GAaudioData structure or NULL if none is currently available
+ *
+ * @note Defined in the high level GAUDIO code for use by the GAUDIO record drivers.
+ *
+ * @iclass
+ * @notapi
+ */
+#define gaudioRecordGetFreeBlockI() gfxBufferGetI()
+
+/**
+ * @brief Save a block of recorded audio data ready for the application
+ *
+ * @param[in] paud The GDataBuffer block with data.
+ *
+ * @note Defined in the high level GAUDIO code for use by the GAUDIO record drivers.
+ *
+ * @iclass
+ * @notapi
+ */
+void gaudioRecordSaveDataBlockI(GDataBuffer *paud);
+
+/**
+ * @brief Signal that all recording has now stopped
+ *
+ * @note Defined in the high level GAUDIO code for use by the GAUDIO record drivers.
+ *
+ * @iclass
+ * @notapi
+ */
+void gaudioRecordDoneI(void);
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Initialise the record driver
+ * @return TRUE if the channel, frequency and format are valid.
+ *
+ * @param[in] channel The channel to use (see the driver for the available channels provided)
+ * @param[in] frequency The sample frequency to use
+ * @param[in] format The sample format
+ *
+ * @note The driver will always have been stopped and de-init before this is called.
+ *
+ * @api
+ */
+bool_t gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format);
+
+/**
+ * @brief Start the audio recording
+ *
+ * @api
+ */
+void gaudio_record_lld_start(void);
+
+/**
+ * @brief Stop the audio recording.
+ *
+ * @note Some drivers may only stop recording at a data block boundary.
+ * @note This routine should not return until any currently active buffers have been
+ * saved (even if with zero length) and @p gaudioRecordDoneI() has been called.
+ *
+ * @api
+ */
+void gaudio_record_lld_stop(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_RECORD */
+
+#endif /* _GAUDIO_RECORD_LLD_H */
+/** @} */