⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 player_8c.html

📁 MP3播放器源代码, VS1003B
💻 HTML
📖 第 1 页 / 共 5 页
字号:
00827         <span class="keywordflow">while</span>(1);00828       }00829     }00830    00831     <a class="code" href="lcd_8c.html#a4">LcdReset</a>();00832     <a class="code" href="lcd_8h.html#a10">LcdPutConstantString</a>(<span class="stringliteral">"File "</span>);00833     <a class="code" href="lcd_8h.html#a15">LcdPutUInt</a>(currentFile);00834     <a class="code" href="lcd_8h.html#a2">LcdLocateLine2</a>();00835     <span class="keywordflow">for</span> (<a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o0">c</a>=0; <a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o0">c</a>&lt;8; <a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o0">c</a>++){00836       <a class="code" href="lcd_8h.html#a6">LcdPutChar</a>(currentFileName[<a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o0">c</a>]);00837     }00838     00839         00840     <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>)||00841            (<a class="code" href="board_8h.html#a17">KEY_LEFT</a>)||(<a class="code" href="board_8h.html#a16">KEY_RIGHT</a>))00842       ; <span class="comment">/* Wait until no key is pressed */</span>00843 00844     <span class="keywordflow">while</span> (((!<a class="code" href="board_8h.html#a14">KEY_BUTTON</a>)&amp;&amp;(!<a class="code" href="board_8h.html#a18">KEY_FARLEFT</a>)&amp;&amp;(!<a class="code" href="board_8h.html#a15">KEY_FARRIGHT</a>))00845            &amp;&amp;(<a class="code" href="player_8c.html#a3">playingState</a> == <a class="code" href="ui_8h.html#a25a12">PS_NORMAL</a>))00846       ; <span class="comment">/* Wait untis some key is pressed or playing state not normal*/</span>00847 00848     00849     <span class="comment">/* See if keystroke requests previous/next song */</span>00850     <span class="keywordflow">if</span> (<a class="code" href="board_8h.html#a18">KEY_FARLEFT</a>) currentFile--;00851     <span class="keywordflow">if</span> (<a class="code" href="board_8h.html#a15">KEY_FARRIGHT</a>) currentFile++;00852     <span class="keywordflow">if</span> (currentFile==0) currentFile = 1;00853 00854     <span class="keywordflow">if</span> (<a class="code" href="board_8h.html#a14">KEY_BUTTON</a> || 00855         (<a class="code" href="player_8c.html#a3">playingState</a>==<a class="code" href="ui_8h.html#a25a14">PS_NEXT_SONG</a>) || 00856         (<a class="code" href="player_8c.html#a3">playingState</a>==<a class="code" href="ui_8h.html#a25a15">PS_PREVIOUS_SONG</a>)){00857       <span class="keywordflow">while</span> (<a class="code" href="board_8h.html#a14">KEY_BUTTON</a>)00858         ;00859 00860       <a class="code" href="player_8c.html#a13">PlayCurrentFile</a>();00861       ConsoleWrite (<span class="stringliteral">"Playing state after playing is: "</span>);00862       ConsolePutUInt (playingState);00863       00864       <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--;00865       <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++;00866       <span class="keywordflow">if</span> (currentFile==0) currentFile = 1;00867       <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>;      00868       00869       00870       <a class="code" href="vs10xx_8c.html#a2">Mp3SoftReset</a>();00871       <a class="code" href="player_8c.html#a9">LoadPatch</a>();00872       <a class="code" href="player_8c.html#a10">StartPatch</a>();00873 00874 00875       <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>)||00876              (<a class="code" href="board_8h.html#a17">KEY_LEFT</a>)||(<a class="code" href="board_8h.html#a16">KEY_RIGHT</a>))00877         ; <span class="comment">/* Wait until no key is pressed */</span>00878     }00879 00880     00881   }00882    00883 00884 }</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#l00724">724</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#l00226">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#l00765">main()</a>.<p><pre class="fragment"><div>00724                       {00725   xdata <span class="keywordtype">char</span> c, nFragments;00726 00727   <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>00728   <span class="comment">//uiMode = UI_SPEC; /* User interface: show title SPECANA FOR VS1003*/</span>00729 00730   <a class="code" href="lcd_8h.html#a1">LcdLocateHome</a>();00731   <a class="code" href="lcd_8h.html#a10">LcdPutConstantString</a>(<span class="stringliteral">"Opening "</span>);00732 00733   ConsoleWrite (<span class="stringliteral">"Building file fragment table..."</span>);00734   nFragments = <a class="code" href="filesys_8c.html#a19">BuildFragmentTable</a>(); <span class="comment">/* Too slow, rewrite! */</span>00735   ConsoleWrite(<span class="stringliteral">"\rFragments: "</span>);00736   ConsolePutUInt(nFragments);00737 00738   <a class="code" href="lcd_8h.html#a1">LcdLocateHome</a>();00739   <a class="code" href="lcd_8h.html#a10">LcdPutConstantString</a>(<span class="stringliteral">"Playing "</span>);00740 00741   <span class="keywordflow">for</span> (c=0; c&lt;nFragments; c++){00742     <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>;00743     ConsoleWrite (<span class="stringliteral">"\rPlayer: Playing from sector "</span>);00744     ConsolePutUInt (<a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o0">l</a>);00745     <span class="keywordflow">if</span> (<a class="code" href="vs10xx_8h.html#a40">PlayDiskSectors</a>(fragment[c].length)!=0){00746       <a class="code" href="vs10xx_8h.html#a32">Mp3WriteRegister</a>(SPI_MODE,0,SM_OUTOFWAV);00747       <a class="code" href="vs10xx_8c.html#a5">SendZerosToVS10xx</a>();00748       <span class="keywordflow">return</span>; <span class="comment">//return without touching the value of playingState</span>00749     }00750   }00751   <a class="code" href="vs10xx_8c.html#a5">SendZerosToVS10xx</a>();00752 00753   <span class="comment">// After finishing normally default to requesting to play next song        </span>00754   <a class="code" href="player_8c.html#a3">playingState</a> = <a class="code" href="ui_8h.html#a25a14">PS_NEXT_SONG</a>;00755 00756 }</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 playin

⌨️ 快捷键说明

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