player_8c.html

来自「MP3 Player Source Code」· HTML 代码 · 共 945 行 · 第 1/5 页

HTML
945 行
字号
00814       ; <span class="comment">/* Wait untis some key is pressed or playing state not normal*/</span>00815 00816     00817     <span class="comment">/* See if keystroke requests previous/next song */</span>00818     <span class="keywordflow">if</span> (<a class="code" href="board_8h.html#a18">KEY_FARLEFT</a>) currentFile--;00819     <span class="keywordflow">if</span> (<a class="code" href="board_8h.html#a15">KEY_FARRIGHT</a>) currentFile++;00820     <span class="keywordflow">if</span> (currentFile==0) currentFile = 1;00821 00822     <span class="keywordflow">if</span> (<a class="code" href="board_8h.html#a14">KEY_BUTTON</a> || 00823         (<a class="code" href="player_8c.html#a3">playingState</a>==<a class="code" href="ui_8h.html#a25a14">PS_NEXT_SONG</a>) || 00824         (<a class="code" href="player_8c.html#a3">playingState</a>==<a class="code" href="ui_8h.html#a25a15">PS_PREVIOUS_SONG</a>)){00825       <span class="keywordflow">while</span> (<a class="code" href="board_8h.html#a14">KEY_BUTTON</a>)00826         ;00827 00828       <a class="code" href="player_8c.html#a13">PlayCurrentFile</a>();00829       ConsoleWrite (<span class="stringliteral">"Playing state after playing is: "</span>);00830       ConsolePutUInt (playingState);00831       00832       <span class="keywordflow">if</span> (<a class="code" href="player_8c.html#a3">playingState</a> == <a class="code" href="ui_8h.html#a25a15">PS_PREVIOUS_SONG</a>) currentFile--;00833       <span class="keywordflow">if</span> (<a class="code" href="player_8c.html#a3">playingState</a> == <a class="code" href="ui_8h.html#a25a14">PS_NEXT_SONG</a>) currentFile++;00834       <span class="keywordflow">if</span> (currentFile==0) currentFile = 1;00835       <span class="keywordflow">if</span> (<a class="code" href="player_8c.html#a3">playingState</a> == <a class="code" href="ui_8h.html#a25a13">PS_END_OF_SONG</a>) <a class="code" href="player_8c.html#a3">playingState</a> = <a class="code" href="ui_8h.html#a25a12">PS_NORMAL</a>;      00836       00837       00838       <a class="code" href="vs10xx_8c.html#a2">Mp3SoftReset</a>();00839       <a class="code" href="player_8c.html#a9">LoadPatch</a>();00840       <a class="code" href="player_8c.html#a10">StartPatch</a>();00841 00842 00843       <span class="keywordflow">while</span> ((<a class="code" href="board_8h.html#a14">KEY_BUTTON</a>)||(<a class="code" href="board_8h.html#a18">KEY_FARLEFT</a>)||(<a class="code" href="board_8h.html#a15">KEY_FARRIGHT</a>)||00844              (<a class="code" href="board_8h.html#a17">KEY_LEFT</a>)||(<a class="code" href="board_8h.html#a16">KEY_RIGHT</a>))00845         ; <span class="comment">/* Wait until no key is pressed */</span>00846     }00847 00848     00849   }00850    00851 00852 }</div></pre><p>Here is the call graph for this function:<p><center><img src="player_8c_a14_cgraph.png" border="0" usemap="#player_8c_a14_cgraph_map" alt=""></center><map name="player_8c_a14_cgraph_map"><area href="board_8c.html#a4" shape="rect" coords="147,7,205,31" alt=""><area href="display_8h.html#a14" shape="rect" coords="328,107,394,131" alt=""><area href="lcd_8c.html#a4" shape="rect" coords="492,81,553,105" alt=""><area href="filesys_8c.html#a24" shape="rect" coords="131,305,221,329" alt=""><area href="lcd_8h.html#a14" shape="rect" coords="107,404,245,428" alt=""><area href="lcd_8h.html#a6" shape="rect" coords="322,380,400,404" alt=""><area href="lcd_8h.html#a10" shape="rect" coords="294,452,428,476" alt=""><area href="lcd_8h.html#a15" shape="rect" coords="140,550,212,574" alt=""><area href="player_8c.html#a9" shape="rect" coords="141,598,211,622" alt=""><area href="vs10xx_8c.html#a3" shape="rect" coords="328,205,394,229" alt=""><area href="vs10xx_8c.html#a2" shape="rect" coords="477,231,568,255" alt=""><area href="filesys_8h.html#a8" shape="rect" coords="147,646,205,670" alt=""><area href="player_8c.html#a13" shape="rect" coords="128,452,224,476" alt=""><area href="record_8c.html#a3" shape="rect" coords="152,156,200,180" alt=""><area href="player_8c.html#a10" shape="rect" coords="141,694,211,718" alt=""></map>    </td>  </tr></table><a class="anchor" name="a13" doxytag="player.c::PlayCurrentFile" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void PlayCurrentFile           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Plays a disk file. <p>Returns 1) if the file ends or 2) if the global variable playingState is not PS_NORMAL i.e. user has requested stop or next or previous. <p>Definition at line <a class="el" href="player_8c-source.html#l00692">692</a> of file <a class="el" href="player_8c-source.html">player.c</a>.<p>References <a class="el" href="filesys_8c-source.html#l00401">BuildFragmentTable()</a>, <a class="el" href="filesys_8c.html#a6">fragment</a>, <a class="el" href="buffer_8h-source.html#l00129">Address::l</a>, <a class="el" href="lcd_8h-source.html#l00017">LcdLocateHome</a>, <a class="el" href="lcd_8c-source.html#l00102">LcdPutConstantString()</a>, <a class="el" href="vs10xx_8h-source.html#l00068">Mp3WriteRegister</a>, <a class="el" href="vs10xx_8c-source.html#l00202">PlayDiskSectors()</a>, <a class="el" href="player_8c-source.html#l00221">playingState</a>, <a class="el" href="ui_8h.html#a25a14">PS_NEXT_SONG</a>, <a class="el" href="ui_8h.html#a25a12">PS_NORMAL</a>, <a class="el" href="buffer_8c-source.html#l00015">sectorAddress</a>, <a class="el" href="vs10xx_8c-source.html#l00178">SendZerosToVS10xx()</a>, <a class="el" href="vs10xx_8h-source.html#l00039">SM_OUTOFWAV</a>, <a class="el" href="vs10xx_8h-source.html#l00019">SPI_MODE</a>, and <a class="el" href="filesys_8h-source.html#l00026">fragmentEntry::start</a>.<p>Referenced by <a class="el" href="player_8c-source.html#l00733">main()</a>.<p><pre class="fragment"><div>00692                       {00693   xdata <span class="keywordtype">char</span> c, nFragments;00694 00695   <a class="code" href="player_8c.html#a3">playingState</a> = <a class="code" href="ui_8h.html#a25a12">PS_NORMAL</a>; <span class="comment">/* Request to play normally */</span>00696   <span class="comment">//uiMode = UI_SPEC; /* User interface: show title SPECANA FOR VS1003*/</span>00697 00698   <a class="code" href="lcd_8h.html#a1">LcdLocateHome</a>();00699   <a class="code" href="lcd_8h.html#a10">LcdPutConstantString</a>(<span class="stringliteral">"Opening "</span>);00700 00701   ConsoleWrite (<span class="stringliteral">"Building file fragment table..."</span>);00702   nFragments = <a class="code" href="filesys_8c.html#a19">BuildFragmentTable</a>(); <span class="comment">/* Too slow, rewrite! */</span>00703   ConsoleWrite(<span class="stringliteral">"\rFragments: "</span>);00704   ConsolePutUInt(nFragments);00705 00706   <a class="code" href="lcd_8h.html#a1">LcdLocateHome</a>();00707   <a class="code" href="lcd_8h.html#a10">LcdPutConstantString</a>(<span class="stringliteral">"Playing "</span>);00708 00709   <span class="keywordflow">for</span> (c=0; c&lt;nFragments; c++){00710     <a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o0">l</a> = <a class="code" href="filesys_8c.html#a6">fragment</a>[c].<a class="code" href="structfragmentEntry.html#o0">start</a>;00711     ConsoleWrite (<span class="stringliteral">"\rPlayer: Playing from sector "</span>);00712     ConsolePutUInt (<a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o0">l</a>);00713     <span class="keywordflow">if</span> (<a class="code" href="vs10xx_8h.html#a40">PlayDiskSectors</a>(fragment[c].length)!=0){00714       <a class="code" href="vs10xx_8h.html#a32">Mp3WriteRegister</a>(SPI_MODE,0,SM_OUTOFWAV);00715       <a class="code" href="vs10xx_8c.html#a5">SendZerosToVS10xx</a>();00716       <span class="keywordflow">return</span>; <span class="comment">//return without touching the value of playingState</span>00717     }00718   }00719   <a class="code" href="vs10xx_8c.html#a5">SendZerosToVS10xx</a>();00720 00721   <span class="comment">// After finishing normally default to requesting to play next song        </span>00722   <a class="code" href="player_8c.html#a3">playingState</a> = <a class="code" href="ui_8h.html#a25a14">PS_NEXT_SONG</a>;00723 00724 }</div></pre><p>Here is the call graph for this function:<p><center><img src="player_8c_a13_cgraph.png" border="0" usemap="#player_8c_a13_cgraph_map" alt=""></center><map name="player_8c_a13_cgraph_map"><area href="filesys_8c.html#a19" shape="rect" coords="170,33,293,57" alt=""><area href="lcd_8h.html#a10" shape="rect" coords="165,131,298,155" alt=""><area href="vs10xx_8h.html#a40" shape="rect" coords="180,204,284,228" alt=""><area href="vs10xx_8c.html#a5" shape="rect" coords="365,350,493,374" alt=""><area href="storage_8h.html#a2" shape="rect" coords="563,107,665,131" alt=""><area href="lcd_8h.html#a6" shape="rect" coords="390,57,467,81" alt=""><area href="player_8c.html#a12" shape="rect" coords="354,204,503,228" alt=""><area href="vs10xx_8h.html#a38" shape="rect" coords="558,228,670,252" alt=""><area href="aviplay_8c.html#a6" shape="rect" coords="403,156,454,180" alt=""><area href="storage_8h.html#a1" shape="rect" coords="349,302,509,326" alt=""></map>    </td>  </tr></table><a class="anchor" name="a11" doxytag="player.c::ScreenSetPlayTime" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void ScreenSetPlayTime           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Sets playing time and mode icon to left display title. <p><p>Definition at line <a class="el" href="player_8c-source.html#l00285">285</a> of file <a class="el" href="player_8c-source.html">player.c</a>.<p>References <a class="el" href="display_8c-source.html#l00011">displayTitle</a>, <a class="el" href="vs10xx_8c-source.html#l00017">Mp3ReadRegister()</a>, <a class="el" href="player_8c-source.html#l00221">playingState</a>, <a class="el" href="ui_8h.html#a25a12">PS_NORMAL</a>, <a class="el" href="ui_8h.html#a25a23">PS_RECORDING</a>, and <a class="el" href="vs10xx_8h-source.html#l00023">SPI_DECODE_TIME</a>.<p>Referenced by <a class="el" href="player_8c-source.html#l00327">AvailableProcessorTime()</a>.<p><pre class="fragment"><div>00285                         {00286   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> playTime;00287   <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> minutes, seconds;00288 00289   playTime = <a class="code" href="vs10xx_8h.html#a38">Mp3ReadRegister</a>(SPI_DECODE_TIME);00290   minutes = playTime/60;00291   seconds = playTime%60;00292   <a class="code" href="display_

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?