summaryrefslogtreecommitdiff
path: root/apps/system
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-07-24 08:28:10 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-07-24 08:28:10 -0600
commit5716f3e6f0bc5e5cbe04198923a5cdd8b6e89b3c (patch)
treea14e7c416bc79a4f46676eb4469f21b977c9f046 /apps/system
parentd01e4f9d601e86759fdec1832f9326159f1005e2 (diff)
downloadnuttx-5716f3e6f0bc5e5cbe04198923a5cdd8b6e89b3c.tar.gz
nuttx-5716f3e6f0bc5e5cbe04198923a5cdd8b6e89b3c.tar.bz2
nuttx-5716f3e6f0bc5e5cbe04198923a5cdd8b6e89b3c.zip
Audio: Add hooks for fast-forward and rewind needed by CMediaPlayer; add hooks for equalizer settings needed by the WM8904
Diffstat (limited to 'apps/system')
-rw-r--r--apps/system/nxplayer/nxplayer.c110
1 files changed, 110 insertions, 0 deletions
diff --git a/apps/system/nxplayer/nxplayer.c b/apps/system/nxplayer/nxplayer.c
index c49fcdd5f..bbd9d5cec 100644
--- a/apps/system/nxplayer/nxplayer.c
+++ b/apps/system/nxplayer/nxplayer.c
@@ -905,6 +905,33 @@ int nxplayer_setvolume(FAR struct nxplayer_s *pPlayer, uint16_t volume)
#endif /* CONFIG_AUDIO_EXCLUDE_VOLUME */
/****************************************************************************
+ * Name: nxplayer_setequalization
+ *
+ * Sets the level on each band of an equalizer. Each band setting is
+ * represented in one percent increments, so the range is 0-100.
+ *
+ * Input Parameters:
+ * pPlayer - Pointer to the context to initialize
+ * equalization - Pointer to array of equalizer settings of size
+ * CONFIG_AUDIO_EQUALIZER_NBANDS bytes. Each byte
+ * represents the setting for one band in the range of
+ * 0-100.
+ *
+ * Returned Value:
+ * OK if equalization was set correctly.
+ *
+ **************************************************************************/
+
+#ifndef CONFIG_AUDIO_EXCLUDE_EQUALIZER
+int nxplayer_setequalization(FAR struct nxplayer_s *pPlayer,
+ FAR uint8_t *equalization)
+{
+#warning Missing logic
+ return -ENOSYS;
+}
+#endif
+
+/****************************************************************************
* Name: nxplayer_setbass
*
* nxplayer_setbass() sets the bass level and range.
@@ -1112,6 +1139,89 @@ int nxplayer_resume(FAR struct nxplayer_s *pPlayer)
#endif /* CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME */
/****************************************************************************
+ * Name: nxplayer_fforward
+ *
+ * Selects to fast forward in the audio data stream. The fast forward
+ * operation can be cancelled by simply selected no sub-sampling with
+ * the SUBSAMPLE_1X argument returning to normal 1x forward play.
+ *
+ * The preferred way to cancel a fast forward operation is via
+ * nxplayer_cancel_motion() that provides the option to also return to
+ * paused, non-playing state.
+ *
+ * Input Parameters:
+ * pPlayer - Pointer to the context to initialize
+ * subsample - Identifies the fast forward rate (in terms of sub-sampling,
+ * but does not explicitly require sub-sampling)
+ *
+ * Returned Value:
+ * OK if fast forward operation successful.
+ *
+ **************************************************************************/
+
+#ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD
+int nxplayer_fforward(FAR struct nxplayer_s *pPlayer,
+ enum nxplayer_subsample_e subsample)
+{
+#warning Missing logic
+ return -ENOSYS;
+}
+#endif
+
+/****************************************************************************
+ * Name: nxplayer_rewind
+ *
+ * Selects to rewind in the audio data stream. The rewind operation must
+ * be cancelled with nxplayer_cancel_motion.
+ *
+ * NOTE that cancellation of the rewind operation differs from
+ * cancellation of the fast forward operation because we must both restore
+ * the sub-sampling rate to 1x and also return to forward play.
+ *
+ * Input Parameters:
+ * pPlayer - Pointer to the context to initialize
+ * subsample - Identifies the rewind rate (in terms of sub-sampling, but
+ * does not explicitly require sub-sampling)
+ *
+ * Returned Value:
+ * OK if rewind operation successfully initiated.
+ *
+ **************************************************************************/
+
+#ifndef CONFIG_AUDIO_EXCLUDE_REWIND
+int nxplayer_rewind(FAR struct nxplayer_s *pPlayer,
+ enum nxplayer_subsample_e subsample)
+{
+#warning Missing logic
+ return -ENOSYS;
+}
+#endif
+
+/****************************************************************************
+ * Name: nxplayer_cancel_motion
+ *
+ * Cancel a rewind or fast forward operation and return to either the
+ * paused state or to the normal, forward play state.
+ *
+ * Input Parameters:
+ * pPlayer - Pointer to the context to initialize
+ * paused - True: return to the paused state, False: return to the 1X
+ * forward play state.
+ *
+ * Returned Value:
+ * OK if rewind operation successfully cancelled.
+ *
+ **************************************************************************/
+
+#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND)
+int nxplayer_cancel_motion(FAR struct nxplayer_s *pPlayer, bool paused)
+{
+#warning Missing logic
+ return -ENOSYS;
+}
+#endif
+
+/****************************************************************************
* Name: nxplayer_setdevice
*
* nxplayer_setdevice() sets the perferred audio device to use with the