2013-10-27 14:23:01 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* apps/system/nxplayer/nxplayer.h
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013 Ken Pettit. All rights reserved.
|
|
|
|
* Author: Ken Pettit <pettitkd@gmail.com>
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* With updates, enhancements, and modifications by:
|
|
|
|
*
|
|
|
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
|
|
|
*
|
2013-10-27 14:23:01 +01:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in
|
|
|
|
* the documentation and/or other materials provided with the
|
|
|
|
* distribution.
|
|
|
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
* used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __APPS_SYSTEM_NXPLAYER_NXPLAYER_H
|
|
|
|
#define __APPS_SYSTEM_NXPLAYER_NXPLAYER_H 1
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Type Declarations
|
|
|
|
****************************************************************************/
|
2014-07-24 16:28:10 +02:00
|
|
|
/* This structure describes the internal state of the NxPlayer */
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
struct nxplayer_s
|
|
|
|
{
|
|
|
|
int state; /* Current player state */
|
|
|
|
int devFd; /* File descriptor of active device */
|
|
|
|
mqd_t mq; /* Message queue for the playthread */
|
|
|
|
char mqname[16]; /* Name of our message queue */
|
|
|
|
pthread_t playId; /* Thread ID of the playthread */
|
|
|
|
int crefs; /* Number of references to the player */
|
|
|
|
sem_t sem; /* Thread sync semaphore */
|
|
|
|
FILE* fileFd; /* File descriptor of open file */
|
|
|
|
#ifdef CONFIG_NXPLAYER_INCLUDE_PREFERRED_DEVICE
|
|
|
|
char prefdevice[CONFIG_NAME_MAX]; /* Preferred audio device */
|
|
|
|
int prefformat; /* Formats supported by preferred device */
|
|
|
|
int preftype; /* Types supported by preferred device */
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_NXPLAYER_INCLUDE_MEDIADIR
|
|
|
|
char mediadir[CONFIG_NAME_MAX]; /* Root media directory where media is located */
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_AUDIO_MULTI_SESSION
|
|
|
|
FAR void* session; /* Session assigment from device */
|
|
|
|
#endif
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME
|
|
|
|
uint16_t volume; /* Volume as a whole percentage (0-100) */
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_BALANCE
|
|
|
|
uint16_t balance; /* Balance as a whole % (0=left off, 100=right off) */
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_TONE
|
|
|
|
uint16_t treble; /* Treble as a whole % */
|
|
|
|
uint16_t bass; /* Bass as a whole % */
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef int (*nxplayer_func)(FAR struct nxplayer_s* pPlayer, char* pargs);
|
|
|
|
|
2014-07-24 02:21:08 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define EXTERN extern "C"
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
2013-10-27 14:23:01 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_create
|
|
|
|
*
|
2013-10-27 14:45:16 +01:00
|
|
|
* Allocates and Initializes a NxPlayer context that is passed to all
|
|
|
|
* nxplayer routines. The player MUST be destroyed using the
|
2013-10-27 14:23:01 +01:00
|
|
|
* nxplayer_destroy() routine since the context is reference counted.
|
|
|
|
* The context can be used in a mode where the caller creates the
|
|
|
|
* context, starts a file playing, and then forgets about the context
|
2013-10-27 14:45:16 +01:00
|
|
|
* and it will self free. This is because the nxplayer_playfile
|
2013-10-27 14:23:01 +01:00
|
|
|
* will also create a reference to the context, so the client calling
|
|
|
|
* nxplayer_destroy() won't actually de-allocate anything. The freeing
|
|
|
|
* will occur after the playthread has completed.
|
|
|
|
*
|
|
|
|
* Alternately, the caller can create the objec and hold on to it, then
|
|
|
|
* the context will persist until the original creator destroys it.
|
|
|
|
*
|
|
|
|
* Input Parameters: None
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
2013-10-27 14:23:01 +01:00
|
|
|
* Pointer to created NxPlayer context or NULL if error.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
FAR struct nxplayer_s *nxplayer_create(void);
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_release
|
|
|
|
*
|
|
|
|
* Reduces the reference count to the player and if it reaches zero,
|
|
|
|
* frees all memory used by the context.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer Pointer to the NxPlayer context
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
|
|
|
* None
|
2013-10-27 14:23:01 +01:00
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
void nxplayer_release(FAR struct nxplayer_s *pPlayer);
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_reference
|
|
|
|
*
|
|
|
|
* Increments the reference count to the player.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer Pointer to the NxPlayer context
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
|
|
|
* None
|
2013-10-27 14:23:01 +01:00
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
void nxplayer_reference(FAR struct nxplayer_s *pPlayer);
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_setdevice
|
|
|
|
*
|
2013-10-27 14:45:16 +01:00
|
|
|
* Sets the preferred Audio device to use with the instance of the
|
2013-10-27 14:23:01 +01:00
|
|
|
* nxplayer. Without a preferred device set, the nxplayer will search
|
2013-10-27 14:45:16 +01:00
|
|
|
* the audio subsystem to find a suitable device depending on the
|
|
|
|
* type of audio operation requested (i.e. an MP3 decoder device when
|
2013-10-27 14:23:01 +01:00
|
|
|
* playing an MP3 file, a WAV decoder device for a WAV file, etc.).
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer - Pointer to the context to initialize
|
|
|
|
* device - Pointer to pathname of the preferred device
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
2013-10-27 14:23:01 +01:00
|
|
|
* OK if context initialized successfully, error code otherwise.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
2014-07-24 23:06:54 +02:00
|
|
|
int nxplayer_setdevice(FAR struct nxplayer_s *pPlayer,
|
|
|
|
FAR const char *device);
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_playfile
|
|
|
|
*
|
|
|
|
* Plays the specified media file (from the filesystem) using the
|
|
|
|
* Audio system. If a preferred device has been set, that device
|
2013-10-27 14:45:16 +01:00
|
|
|
* will be used for the playback, otherwise the first suitable device
|
2013-10-27 14:23:01 +01:00
|
|
|
* found in the /dev/audio directory will be used.
|
2013-10-27 14:45:16 +01:00
|
|
|
*
|
2013-10-27 14:23:01 +01:00
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer - Pointer to the context to initialize
|
|
|
|
* filename - Pointer to pathname of the file to play
|
2013-10-27 14:45:16 +01:00
|
|
|
* filefmt - Format of audio in filename if known, AUDIO_FMT_UNDEF
|
2013-10-27 14:23:01 +01:00
|
|
|
* to let nxplayer_playfile() determine automatically.
|
2013-10-28 19:11:52 +01:00
|
|
|
* subfmt - Sub-Format of audio in filename if known, AUDIO_FMT_UNDEF
|
|
|
|
* to let nxplayer_playfile() determine automatically.
|
2013-10-27 14:23:01 +01:00
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
2013-10-27 14:23:01 +01:00
|
|
|
* OK if file found, device found, and playback started.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
2014-07-24 23:06:54 +02:00
|
|
|
int nxplayer_playfile(FAR struct nxplayer_s *pPlayer,
|
|
|
|
FAR const char *filename, int filefmt, int subfmt);
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_stop
|
|
|
|
*
|
|
|
|
* Stops current playback.
|
2013-10-27 14:45:16 +01:00
|
|
|
*
|
2013-10-27 14:23:01 +01:00
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer - Pointer to the context to initialize
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
2013-10-27 14:23:01 +01:00
|
|
|
* OK if file found, device found, and playback started.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_STOP
|
|
|
|
int nxplayer_stop(FAR struct nxplayer_s *pPlayer);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_pause
|
|
|
|
*
|
|
|
|
* Pauses current playback.
|
2013-10-27 14:45:16 +01:00
|
|
|
*
|
2013-10-27 14:23:01 +01:00
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer - Pointer to the context to initialize
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
2013-10-27 14:23:01 +01:00
|
|
|
* OK if file found, device found, and playback started.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME
|
|
|
|
int nxplayer_pause(FAR struct nxplayer_s *pPlayer);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_resume
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Resumes current playback.
|
2013-10-27 14:45:16 +01:00
|
|
|
*
|
2013-10-27 14:23:01 +01:00
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer - Pointer to the context to initialize
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
2013-10-27 14:23:01 +01:00
|
|
|
* OK if file found, device found, and playback started.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME
|
|
|
|
int nxplayer_resume(FAR struct nxplayer_s *pPlayer);
|
|
|
|
#endif
|
|
|
|
|
2014-07-24 16:28:10 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* 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
|
2014-07-27 20:26:03 +02:00
|
|
|
* the AUDIO_SUBSAMPLE_NONE argument returning to normal 1x forward play.
|
2014-07-24 16:28:10 +02:00
|
|
|
*
|
|
|
|
* 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,
|
2014-07-27 20:26:03 +02:00
|
|
|
* but does not explicitly require sub-sampling). See
|
|
|
|
* AUDIO_SUBSAMPLE_* definitions.
|
2014-07-24 16:28:10 +02:00
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* OK if fast forward operation successful.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2014-07-24 16:28:10 +02:00
|
|
|
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD
|
2014-07-27 20:26:03 +02:00
|
|
|
int nxplayer_fforward(FAR struct nxplayer_s *pPlayer, uint8_t subsample);
|
2014-07-24 16:28:10 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_rewind
|
|
|
|
*
|
|
|
|
* Selects to rewind in the audio data stream. The rewind operation must
|
2014-07-27 20:26:03 +02:00
|
|
|
* be cancelled with nxplayer_cancel_motion. This function may be called
|
|
|
|
* multiple times to change rewind rate.
|
2014-07-24 16:28:10 +02:00
|
|
|
*
|
|
|
|
* 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.
|
2014-07-27 20:26:03 +02:00
|
|
|
* AUDIO_SUBSAMPLE_NONE is not a valid argument to this function.
|
2014-07-24 16:28:10 +02:00
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer - Pointer to the context to initialize
|
|
|
|
* subsample - Identifies the rewind rate (in terms of sub-sampling, but
|
2014-07-27 20:26:03 +02:00
|
|
|
* does not explicitly require sub-sampling). See
|
|
|
|
* AUDIO_SUBSAMPLE_* definitions.
|
2014-07-24 16:28:10 +02:00
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* OK if rewind operation successfully initiated.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2014-07-24 16:28:10 +02:00
|
|
|
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_REWIND
|
2014-07-27 20:26:03 +02:00
|
|
|
int nxplayer_rewind(FAR struct nxplayer_s *pPlayer, uint8_t subsample);
|
2014-07-24 16:28:10 +02:00
|
|
|
#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.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2014-07-24 16:28:10 +02:00
|
|
|
|
|
|
|
#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND)
|
|
|
|
int nxplayer_cancel_motion(FAR struct nxplayer_s *pPlayer, bool paused);
|
|
|
|
#endif
|
|
|
|
|
2013-10-27 14:23:01 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_setvolume
|
|
|
|
*
|
|
|
|
* Sets the playback volume. The volume is represented in 1/10th of a
|
|
|
|
* percent increments, so the range is 0-1000. A value of 10 would mean
|
2013-10-27 14:45:16 +01:00
|
|
|
* 1%.
|
|
|
|
*
|
2013-10-27 14:23:01 +01:00
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer - Pointer to the context to initialize
|
|
|
|
* volume - Volume level to set in 1/10th percent increments
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
2013-10-27 14:23:01 +01:00
|
|
|
* OK if file found, device found, and playback started.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME
|
|
|
|
int nxplayer_setvolume(FAR struct nxplayer_s *pPlayer, uint16_t volume);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_setbalance
|
|
|
|
*
|
|
|
|
* Sets the playback balance. The balance is represented in 1/10th of a
|
|
|
|
* percent increments, so the range is 0-1000. A value of 10 would mean
|
2013-10-27 14:45:16 +01:00
|
|
|
* 1%.
|
|
|
|
*
|
2013-10-27 14:23:01 +01:00
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer - Pointer to the context to initialize
|
|
|
|
* balance - Balance level to set in 1/10th percent increments
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
2013-10-27 14:23:01 +01:00
|
|
|
* OK if file found, device found, and playback started.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_BALANCE
|
|
|
|
int nxplayer_setbalance(FAR struct nxplayer_s *pPlayer, uint16_t balance);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_setmediadir
|
|
|
|
*
|
|
|
|
* Sets the root media directory for non-path qualified file searches.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer - Pointer to the context to initialize
|
|
|
|
* mediadir - Pointer to pathname of the media directory
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
|
|
|
* None
|
2013-10-27 14:23:01 +01:00
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
2014-07-24 23:06:54 +02:00
|
|
|
void nxplayer_setmediadir(FAR struct nxplayer_s *pPlayer,
|
|
|
|
FAR const char *mediadir);
|
2013-10-27 14:23:01 +01:00
|
|
|
|
2014-07-24 16:28:10 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* 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.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2014-07-24 16:28:10 +02:00
|
|
|
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_EQUALIZER
|
|
|
|
int nxplayer_setequalization(FAR struct nxplayer_s *pPlayer,
|
|
|
|
FAR uint8_t *equalization);
|
|
|
|
#endif
|
|
|
|
|
2013-10-27 14:23:01 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_setbass
|
|
|
|
*
|
|
|
|
* Sets the playback bass level. The bass is represented in one percent
|
2013-10-27 14:45:16 +01:00
|
|
|
* increments, so the range is 0-100.
|
|
|
|
*
|
2013-10-27 14:23:01 +01:00
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer - Pointer to the context to initialize
|
|
|
|
* bass - Bass level to set in one percent increments
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
|
|
|
* OK if the bass level was set successfully
|
2013-10-27 14:23:01 +01:00
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_TONE
|
|
|
|
int nxplayer_setbass(FAR struct nxplayer_s *pPlayer, uint8_t bass);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_settreble
|
|
|
|
*
|
|
|
|
* Sets the playback treble level. The bass is represented in one percent
|
2013-10-27 14:45:16 +01:00
|
|
|
* increments, so the range is 0-100.
|
|
|
|
*
|
2013-10-27 14:23:01 +01:00
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer - Pointer to the context to initialize
|
|
|
|
* treble - Treble level to set in one percent increments
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
|
|
|
* OK if the treble level was set successfully
|
2013-10-27 14:23:01 +01:00
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
#ifndef CONFIG_AUDIO_EXCLUDE_TONE
|
|
|
|
int nxplayer_settreble(FAR struct nxplayer_s *pPlayer, uint8_t treble);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxplayer_systemreset
|
|
|
|
*
|
|
|
|
* Performs an audio system reset, including a hardware reset on all
|
|
|
|
* registered audio devices.
|
2013-10-27 14:45:16 +01:00
|
|
|
*
|
2013-10-27 14:23:01 +01:00
|
|
|
* Input Parameters:
|
|
|
|
* pPlayer - Pointer to the context to initialize
|
|
|
|
*
|
2014-07-24 16:28:10 +02:00
|
|
|
* Returned Value:
|
2013-10-27 14:23:01 +01:00
|
|
|
* OK if file found, device found, and playback started.
|
|
|
|
*
|
2015-10-03 01:35:18 +02:00
|
|
|
****************************************************************************/
|
2013-10-27 14:23:01 +01:00
|
|
|
|
|
|
|
#ifdef CONFIG_NXPLAYER_INCLUDE_SYSTEM_RESET
|
|
|
|
int nxplayer_systemreset(FAR struct nxplayer_s *pPlayer);
|
|
|
|
#endif
|
|
|
|
|
2014-07-24 02:21:08 +02:00
|
|
|
#undef EXTERN
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-10-27 14:23:01 +01:00
|
|
|
#endif /* __APPS_SYSTEM_NXPLAYER_NXPLAYER_H */
|