📄 player.c
字号:
/************************************************** * * player.c * * CVS ID: $Id: player.c,v 1.167 2007/11/14 17:24:27 trubac Exp $ * Author: Fabio Dell'orto [FD] - STM * Date: $Date: 2007/11/14 17:24:27 $ * Revision: $Revision: 1.167 $ * * Description: * * Main entry point for the player task. * *************************************************** * * COPYRIGHT (C) ST Microelectronics 2005 * All Rights Reserved * *************************************************** * * STM CVS Log: * * $Log: player.c,v $ * Revision 1.167 2007/11/14 17:24:27 trubac * handling of array limit during adding files to playlist * * Revision 1.166 2007/11/13 15:40:15 marcucci * Fix for Absolute/Relative Track # (see FHA tag) * * Revision 1.165 2007/11/09 13:21:12 sedmik * fix for shuffle on playlist (safe solution) * * Revision 1.164 2007/11/09 12:55:08 trubac * Fixed shuffle from playlist (issue#16) * Fixed compilation problem for IPOD_AP = 0 * * Revision 1.163 2007/11/09 11:20:02 longauer * variables/functions movement from iAP.* * * Revision 1.162 2007/11/09 08:49:43 marcucci * Fix to avoid different Relative & absolute Track for CD Audio (issue#2 & issue#12) * of Visteon Issue List * * Revision 1.161 2007/11/08 17:30:00 sedmik * fix for SDC/USB unplug during aceeesing 2 play (no stop cmd sent to ctrl, ctrl proceeds with internal stop) * new funcs for cmds/statuses channels on IPOD_AP * * Revision 1.160 2007/11/07 11:56:32 trubac * added ipod fsm calling to task loop * * Revision 1.159 2007/11/06 15:23:11 trubac * added ipod message handling for virtual navigation * * Revision 1.158 2007/10/22 08:31:40 marcucci * Removed Sending the PAUSE command to Capture at the end of CD. * It is managed by Servo * * Revision 1.157 2007/10/18 10:47:42 longauer * handle authentication and automatically switches to the extended mode * * Revision 1.156 2007/10/11 09:39:59 sedmik * fix for random (increase probablity of last number choosing) * * Revision 1.155 2007/10/02 14:22:51 dellorto * fixed couting of loader retries in case of reverse direction not allowed * * Revision 1.154 2007/10/02 09:05:34 belardi * Commented out unused function * * Revision 1.153 2007/09/27 12:27:02 belardi * Configure GestGuess from configuration option * * Revision 1.152 2007/09/21 11:34:46 belardi * Fix compilation problem whenb IPOD_IAP=0 * * Revision 1.151 2007/09/21 05:36:15 hara * Initial implementation for WMDRM feature into A+. * * Revision 1.150 2007/09/20 21:35:52 longauer * virtual iPod authentication is working * * Revision 1.149 2007/09/19 07:36:42 belardi * Bug fix for scratch disc: if corrupted file is detected, it's necessary to copy next->current song info * * Revision 1.148 2007/09/14 13:05:53 belardi * Removed the 'dirty fix' for spurious time message until customer approval * * Revision 1.147 2007/09/13 12:23:42 sedmik * msgtimeinfo enable sending time info on player_mode only during playback (play, seek, pause) * * Revision 1.146 2007/09/12 09:07:22 sedmik * fix for last in.. reporting - configuration check added * * Revision 1.145 2007/09/07 07:09:17 dellorto * Fixed bug related to the handling of Tanashin loader retries * * Revision 1.144 2007/09/03 13:25:19 longauer * Ipod Rx Archive; files affected: ACP.h, iAP.*, player.c, gendef.h * * Revision 1.143 2007/08/24 12:40:24 sedmik * fix for playlist enabling during playback * * Revision 1.142 2007/08/23 10:05:34 sedmik * fix for shuffle range recalculation * * Revision 1.141 2007/08/21 09:36:00 belardi * Automatic MsgTextInfo uses the length configured through TextInfoSetting * * Revision 1.140 2007/08/20 10:05:10 sedmik * fix for playlist=on - added check for player_requested_song, otherwise playback command (at curr. pos) sets to 1st in playlist file by default * * Revision 1.139 2007/08/16 11:30:40 sedmik * fix for CmdPlayCurrent(dir) - if 1st file is unplayable, seek to playable one * * Revision 1.138 2007/08/15 13:11:50 trubac * fixing CD mounting killed by unplugging other device * * Revision 1.137 2007/08/14 15:29:35 dellorto * multiple mechanisms * * Revision 1.136 2007/08/10 12:33:29 longauer * IPOD_AP compilation switch enables future iAP * * Revision 1.135 2007/07/31 11:58:52 belardi * Removed compiler warning * * Revision 1.134 2007/07/16 12:40:34 trubac * Disabling USB device when closed due to Hi-Z command event * * Revision 1.133 2007/07/16 10:01:47 trubac * USB HIGH-Z control roughly tested * * Revision 1.132 2007/07/11 07:56:24 longauer * usb events renaming * * Revision 1.131 2007/07/09 16:39:51 sedmik * resume info via i2c fix (added CRC data into stream) * * Revision 1.130 2007/07/05 08:15:09 belardi * Removed compiler warning * * Revision 1.129 2007/07/03 13:51:39 belardi * Removed unused global 'dim_playlist' variable * * Revision 1.128 2007/07/02 11:24:53 marcucci * Modified initialization of Random seed te have better random generation * * Revision 1.127 2007/06/19 14:20:14 sedmik * reverted back configuration pathtable/parent-child (now following CIS 3.1.1) * * Revision 1.126 2007/06/04 16:58:46 longauer * USBtask rearrangement in order to support more logical units; new file usb_pri.h added with USBtask private declarations; USB compilation switches added; constants renaming; * * Revision 1.125 2007/06/01 13:53:29 sedmik * fixed issues - pause command at end of range to cap is provided, configuration pathtable/parent-child was used opposite way * * Revision 1.124 2007/04/25 08:38:18 sedmik * fixed 2 times reporting of read error * * Revision 1.123 2007/04/11 14:20:37 belardi * Integration of HAVE_CD_MECHA modification by [GP] * * Revision 1.122 2007/03/19 15:56:54 sedmik * fixed: * - unforced song playback, which result only EOP (unforced file with no playable part) * - FB on beginning of first song (wrap off), next FB on current pos. started playback from the end of same file * * Revision 1.121 2007/03/14 14:58:08 sedmik * Read Error during playback doesnt' select new song, app goes to stop * * Revision 1.120 2007/03/09 09:44:06 sedmik * fix for scan off (scan direction) issue #79 * * Revision 1.119 2007/03/01 10:51:47 sedmik * fix for CDCA reporting * * Revision 1.118 2007/02/26 13:29:09 trubac * HAVE_SDC conditional compiling * * Revision 1.117 2007/02/23 11:40:38 sedmik * report_msg_insert_mode alignment, ipod status unplug reporting to hostif, shuffle navigation setting configurable * * Revision 1.116 2007/02/23 09:20:46 trubac * Playlist compares file names stored without extension * * Revision 1.115 2007/02/21 20:18:14 longauer * usb states and error reorganization; usb state is propagated to player task = usb * state messaging * * Revision 1.114 2007/02/15 16:09:37 sedmik * BinaryTransfer improved - new func for resume info upstream preparation, new param in command for binary transfer(resume info/flash update) * * Revision 1.113 2007/02/13 11:05:58 sedmik * - changes related to playlist shuffle * - player_mode_update redesigned * - scan fix * - time info fix * * Revision 1.112 2007/02/09 12:14:04 belardi * First integration of iPod pass-through * - change in include position * * Revision 1.111 2007/02/08 16:00:06 trubac * XAR_NextFile has one more parameter (Optimization of song indexing) * * Revision 1.110 2006/12/21 10:34:47 sedmik * shuffle can be cofigured for flat navigation/shuffle for all cmds * * Revision 1.109 2006/12/19 17:02:03 dellorto * improved loader recoveries * * Revision 1.108 2006/12/18 17:59:47 sedmik * flash update fix (after operation, app goes to power off, if flashed USB/SDC no eject of CD, if flashed CD no autoload after prw off) * * Revision 1.107 2006/12/18 12:26:52 sedmik * resume info changed, * CmdNext fix (sent many times up to end of range), * pause off continued playback on invalid song, player update fix * power off fix * * Revision 1.106 2006/12/14 17:31:47 belardi * Changes in HAVE_HOST_UPDATE_NEW * * Revision 1.105 2006/12/14 13:40:45 marcucci * modification for HAVE_UPDATE in player_mout_transition() * * Revision 1.104 2006/12/14 11:27:10 belardi * Fix in loader by [FD] * * Revision 1.103 2006/12/14 09:58:32 sedmik * fixed rel track_nr init value for timeinfo * * Revision 1.102 2006/12/13 14:28:40 trubac * Fixed changing directories with respect of playable contents * * Revision 1.101 2006/12/13 14:04:17 sedmik * - fix for have update functionality,xid sychronisation (player - ctrl) on pause off, repeat 1 in scan mode * * Revision 1.100 2006/12/13 09:26:43 belardi * - fixed MsgTimeInfo (added DirNo, removed frame number, rearranged parameter order to comply with CIS 0.09) * - Optomech stability fix for SDC driver (P061212) * * Revision 1.99 2006/12/12 10:56:46 sedmik * - fix in error management of unplayable file * - power off alignemnt, call of reading resume info from NVRAM on startup * - fix in disabling playlist functionality * - defined new commands hostif to player - file update state machine used * - time info init value aligned with spec * * Revision 1.98 2006/12/07 15:13:33 trubac * fixed song selection when playlist turned on * * Revision 1.97 2006/12/07 13:07:09 trubac * relative indexing of playlist items, pls processing improved "..\" * * Revision 1.96 2006/12/04 15:11:35 sedmik * -fix in shuffle selection for CDDA, playlist mode - cmdnext/previous dir during mode stop keeps stop(playback doesn't start) * * Revision 1.95 2006/12/04 14:47:52 dellorto * added emergency eject command * improved loader transitions and processing of loader events * * Revision 1.94 2006/12/01 17:25:20 trubac * Improved parsing for various text encodings * * Revision 1.93 2006/12/01 15:41:50 sedmik * fixes in playlist navigation * fix for pause at eos * CmdSourceChange, USB/SDC unplug disables playlist mode, scan, repeat 1, reports diabling * * Revision 1.92 2006/11/28 14:55:07 sedmik * added enabling/disabling extesions MP1,MP2, AAC - added extension "m4a" * * Revision 1.91 2006/11/24 15:38:55 sedmik * fix in CmdNext/Preevious DIR commands * * Revision 1.90 2006/11/22 15:57:22 sedmik * fix in for scan - when at the end/beginning of scan win paused, advanced settings are also taken in account on next action * * Revision 1.89 2006/11/21 15:37:51 sedmik * improved files navigation(rep1,Cmdcontinue set during playback), * seek command (at current position) is allowed when seek already in progress * * Revision 1.88 2006/11/21 13:58:57 dellorto * improved hostif reporting of servo parameters in case of restart * * Revision 1.87 2006/11/20 13:31:29 sedmik * improved navigation for playlists, minor fixes in normal navigation, * aligned disc type reporting with CIS0.09 * random init val taken from timer * * Revision 1.86 2006/11/17 16:40:48 dellorto * added auto text messages * * Revision 1.85 2006/11/16 13:19:44 trubac * CountFilesForDevice changed parameter t_SearchMode * * Revision 1.84 2006/11/14 16:50:01 belardi * removed warnings previsouly not visible due to PLAYER_DEBUG being defined * * Revision 1.83 2006/11/14 16:32:00 belardi * commented out PLAYER_DEBUG * * Revision 1.82 2006/11/10 16:28:36 dellorto * added resetting of servo parameters for hostif * * Revision 1.81 2006/11/07 18:59:59 sedmik * changes related to playlist support (playback transition, commands checking), * relative files numbering fix * * Revision 1.80 2006/11/07 13:46:14 belardi * Removed unused variable to get rid of compiler warning * * Revision 1.79 2006/11/01 15:44:07 trubac * CountFilesForVolume/CountFilesForDevice now allows counting of playlists * * Revision 1.78 2006/10/27 15:11:56 sedmik * fixed bugs in fluent playback (previously sometimes no next song played) , scan improved, pause at EOS fix, resume - added * slots for all devices, fix for update transition; temporarily disabled storing resume info to VNRAM (to be checked with Optomech) * * Revision 1.77 2006/10/26 10:26:01 dellorto * replacement of loader transition label * * Revision 1.76 2006/10/18 12:42:08 belardi * Removed USE_STM_HOSTIF * * Revision 1.75 2006/10/17 10:07:19 trubac * mounting is not comparing discid - it is in controller now * * Revision 1.74 2006/10/05 07:35:06 trubac * Implementing TOC info at the end of string pool * * Revision 1.73 2006/09/29 15:09:43 zaccaria * Fixed bug in playlist state * * Revision 1.72 2006/09/28 11:48:12 zaccaria * Playlist calling modification. * * Revision 1.71 2006/09/27 19:52:30 belardi * Removed (global) unused variables * * Revision 1.70 2006/09/26 09:35:42 belardi * Moved intial_messaging_timeout() to accordoptimer.c from player.c * * Revision 1.69 2006/09/25 13:19:00 zaccaria * DEBUG_PLAYLIST #define eliminated (in player_mount_transition function) * * Revision 1.68 2006/09/19 12:42:47 belardi * - Removed unused variables * - Fixed == usage where = was needed * * Revision 1.67 2006/09/15 20:00:11 belardi * Merged the m8_cav2_cm80506_cs3563. * - removed xtoc from XItem, created temporary XTOC variable * * ***************************************************/#include "configuration.h" //[LL]#include "string.h"#include "gendef.h"#include "osal.h"#include "loader.h"#include "monitor.h"#include "srvinc.h"#if (DEBUG_INCLUDE_PCDEB==1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -