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

📄 player_8c.html

📁 MP3播放器源代码, VS1003B
💻 HTML
📖 第 1 页 / 共 5 页
字号:
00688       <a class="code" href="player_8c.html#a3">playingState</a> = <a class="code" href="ui_8h.html#a25a13">PS_END_OF_SONG</a>; <span class="comment">/* Request to abort playing */</span>00689     }      00690     <span class="keywordflow">break</span>; <span class="comment">// UI_STOP</span>00691     00692   <span class="keywordflow">case</span> <a class="code" href="ui_8h.html#a24a7">UI_CUE</a>:00693     00694     <span class="keywordflow">if</span> (<a class="code" href="player_8c.html#a3">playingState</a> == <a class="code" href="ui_8h.html#a25a12">PS_NORMAL</a>){ <span class="comment">/* Only control when PS_NORMAL */</span>00695       <span class="keywordflow">if</span> (<a class="code" href="board_8h.html#a15">KEY_FARRIGHT</a>){00696         uiReturnDelay = <a class="code" href="player_8c.html#a2">UI_RETURN_DELAY</a>; <span class="comment">/* Don't go back to title just yet */</span>00697         <a class="code" href="player_8c.html#a3">playingState</a> = <a class="code" href="ui_8h.html#a25a16">PS_CUE</a>; <span class="comment">/* Request */</span>00698       }      00699       <span class="keywordflow">if</span> (<a class="code" href="board_8h.html#a18">KEY_FARLEFT</a>){00700         uiReturnDelay = <a class="code" href="player_8c.html#a2">UI_RETURN_DELAY</a>;00701         <a class="code" href="player_8c.html#a3">playingState</a> = <a class="code" href="ui_8h.html#a25a19">PS_REWIND</a>; <span class="comment">/* Request */</span>00702       }      00703     }00704 00705     <span class="keywordflow">break</span>; <span class="comment">// UI_SKIP</span>00706 00707   <span class="keywordflow">case</span> <a class="code" href="ui_8h.html#a24a11">UI_END_OF_MODES</a>:00708     <a class="code" href="player_8c.html#a6">uiMode</a> = <a class="code" href="ui_8h.html#a24a2">UI_TITLE</a>;00709     <span class="keywordflow">break</span>; <span class="comment">// UI_END_OF_MODES</span>00710     00711 00712   } <span class="comment">//End Switch</span>00713 00714 00715   <span class="comment">// Draw screen</span>00716   <a class="code" href="display_8c.html#a7">UpdateDisplay</a>();00717 }</div></pre><p>Here is the call graph for this function:<p><center><img src="player_8c_a12_cgraph.png" border="0" usemap="#player_8c_a12_cgraph_map" alt=""></center><map name="player_8c_a12_cgraph_map"><area href="lcd_8c.html#a4" shape="rect" coords="245,7,306,31" alt=""><area href="lcd_8h.html#a5" shape="rect" coords="396,56,486,80" alt=""><area href="vs10xx_8h.html#a38" shape="rect" coords="385,105,497,129" alt=""><area href="player_8c.html#a11" shape="rect" coords="214,156,337,180" alt=""><area href="display_8c.html#a7" shape="rect" coords="230,205,321,229" alt=""><area href="lcd_8h.html#a7" shape="rect" coords="388,7,494,31" alt=""><area href="lcd_8h.html#a10" shape="rect" coords="546,105,680,129" alt=""><area href="lcd_8h.html#a6" shape="rect" coords="574,229,652,253" alt=""><area href="lcd_8h.html#a15" shape="rect" coords="405,254,477,278" alt=""></map>    </td>  </tr></table><a class="anchor" name="a9" doxytag="player.c::LoadPatch" ></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 LoadPatch           </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>Load a patch code to VS10xx. <p><p>Definition at line <a class="el" href="player_8c-source.html#l00265">265</a> of file <a class="el" href="player_8c-source.html">player.c</a>.<p>References <a class="el" href="loud__sa_8c-source.html#l00004">atab</a>, <a class="el" href="loud__sa_8c-source.html#l00003">CODELEN</a>, <a class="el" href="board_8c-source.html#l00036">Delay()</a>, <a class="el" href="loud__sa_8c-source.html#l00815">dtab</a>, <a class="el" href="board_8h-source.html#l00254">Temp::i</a>, <a class="el" href="vs10xx_8h-source.html#l00068">Mp3WriteRegister</a>, and <a class="el" href="board_8c.html#a0">temp</a>.<p>Referenced by <a class="el" href="player_8c-source.html#l00765">main()</a>.<p><pre class="fragment"><div>00265                 {00266   ConsoleWrite (<span class="stringliteral">"Loading patch.\r"</span>);00267   <span class="keywordflow">for</span> (<a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o1">i</a>=0; <a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o1">i</a> &lt; <a class="code" href="loud__sa_8c.html#a0">CODELEN</a>; <a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o1">i</a>++) {    00268     <a class="code" href="vs10xx_8h.html#a32">Mp3WriteRegister</a>(atab[<a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o1">i</a>], dtab[<a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o1">i</a>]&gt;&gt;8, dtab[<a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o1">i</a>]&amp;0xff);00269    }00270   <a class="code" href="board_8h.html#a51">Delay</a>(10);00271 }</div></pre><p>Here is the call graph for this function:<p><center><img src="player_8c_a9_cgraph.png" border="0" usemap="#player_8c_a9_cgraph_map" alt=""></center><map name="player_8c_a9_cgraph_map"><area href="board_8h.html#a51" shape="rect" coords="138,7,178,30" alt=""></map>    </td>  </tr></table><a class="anchor" name="a14" doxytag="player.c::main" ></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 main           </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>Program Entry Point. <p>In the final program, <a class="el" href="player_8c.html#a14">main()</a> should be very small. Currently it's the playground for developing the player functionality. Most of it will be cleared away to new functions soon. <p>Definition at line <a class="el" href="player_8c-source.html#l00765">765</a> of file <a class="el" href="player_8c-source.html">player.c</a>.<p>References <a class="el" href="board_8h-source.html#l00253">Temp::c</a>, <a class="el" href="filesys_8c-source.html#l00065">currentFileName</a>, <a class="el" href="display_8h-source.html#l00008">DS_STATIC</a>, <a class="el" href="board_8c-source.html#l00044">InitBoard()</a>, <a class="el" href="display_8c-source.html#l00023">InitDisplay()</a>, <a class="el" href="filesys_8c-source.html#l00923">InitFileSystem()</a>, <a class="el" href="board_8h-source.html#l00095">KEY_BUTTON</a>, <a class="el" href="board_8h-source.html#l00110">KEY_FARLEFT</a>, <a class="el" href="board_8h-source.html#l00098">KEY_FARRIGHT</a>, <a class="el" href="board_8h-source.html#l00104">KEY_LEFT</a>, <a class="el" href="board_8h-source.html#l00101">KEY_RIGHT</a>, <a class="el" href="lcd_8h-source.html#l00020">LcdLocateLine2</a>, <a class="el" href="lcd_8c-source.html#l00185">LcdPrintGenericResult()</a>, <a class="el" href="lcd_8c-source.html#l00017">LcdPutChar()</a>, <a class="el" href="lcd_8c-source.html#l00102">LcdPutConstantString()</a>, <a class="el" href="lcd_8c-source.html#l00221">LcdPutUInt()</a>, <a class="el" href="lcd_8c-source.html#l00056">LcdReset()</a>, <a class="el" href="player_8c-source.html#l00265">LoadPatch()</a>, <a class="el" href="vs10xx_8c-source.html#l00069">Mp3Reset()</a>, <a class="el" href="vs10xx_8c-source.html#l00035">Mp3SoftReset()</a>, <a class="el" href="filesys_8c-source.html#l00610">OpenFile()</a>, <a class="el" href="player_8c-source.html#l00724">PlayCurrentFile()</a>, <a class="el" href="player_8c-source.html#l00226">playingState</a>, <a class="el" href="ui_8h.html#a25a13">PS_END_OF_SONG</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="ui_8h.html#a25a15">PS_PREVIOUS_SONG</a>, <a class="el" href="ui_8h.html#a25a23">PS_RECORDING</a>, <a class="el" href="record_8c-source.html#l00101">Record()</a>, <a class="el" href="player_8c-source.html#l00238">SPMax</a>, <a class="el" href="player_8c-source.html#l00274">StartPatch()</a>, <a class="el" href="board_8c.html#a0">temp</a>, <a class="el" href="ui_8h.html#a24a3">UI_SPEC</a>, <a class="el" href="ui_8h.html#a24a2">UI_TITLE</a>, and <a class="el" href="player_8c-source.html#l00236">uiMode</a>.<p><pre class="fragment"><div>00765            {00766 00767   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> currentFile;00768 00769   <a class="code" href="board_8c.html#a4">InitBoard</a>();00770 00771   <span class="comment">// Start "User Interface" timer</span>00772   ET0 = 1;00773   EA = 1; 00774   TR0 = 1;00775 00776   <span class="comment">//LcdSplashScreen(); </span>00777   <a class="code" href="display_8h.html#a14">InitDisplay</a> (DS_STATIC,<span class="stringliteral">"        "</span>,<span class="stringliteral">"        "</span>,0);00778   00779   ConsoleWrite (<span class="stringliteral">"\rVLSIPlayer\rStarting up.\r\r"</span>);00780      00781   <a class="code" href="lcd_8c.html#a4">LcdReset</a>();00782   <a class="code" href="lcd_8h.html#a10">LcdPutConstantString</a> (<span class="stringliteral">"Filesys "</span>);00783   <a class="code" href="lcd_8h.html#a2">LcdLocateLine2</a>();00784   <a class="code" href="lcd_8h.html#a14">LcdPrintGenericResult</a> (<a class="code" href="filesys_8c.html#a24">InitFileSystem</a>());00785 00786   <a class="code" href="vs10xx_8c.html#a3">Mp3Reset</a>();00787   <a class="code" href="player_8c.html#a9">LoadPatch</a>();00788   <a class="code" href="player_8c.html#a10">StartPatch</a>();00789 00790   <span class="comment">// If left button is pressed during boot, enter recording.</span>00791   <span class="keywordflow">if</span> (<a class="code" href="board_8h.html#a18">KEY_FARLEFT</a>){00792     <span class="keywordflow">while</span>(<a class="code" href="board_8h.html#a17">KEY_LEFT</a>)00793       ;00794     <a class="code" href="record_8c.html#a3">Record</a>();00795   }00796 00797   00798 <span class="preprocessor">#ifdef VS1003</span>00799 <span class="preprocessor"></span>  <a class="code" href="player_8c.html#a6">uiMode</a> = <a class="code" href="ui_8h.html#a24a3">UI_SPEC</a>;   <span class="comment">//For VS1003 default to SPECTRUM ANALYZER screen</span>00800 <span class="preprocessor">#else</span>00801 <span class="preprocessor"></span>  <a class="code" href="player_8c.html#a6">uiMode</a> = <a class="code" href="ui_8h.html#a24a2">UI_TITLE</a>;  <span class="comment">//For others, default to TITLE screen</span>00802 <span class="preprocessor">#endif</span>00803 <span class="preprocessor"></span>  00804   <a class="code" href="player_8c.html#a3">playingState</a> = <a class="code" href="ui_8h.html#a25a14">PS_NEXT_SONG</a>;00805   currentFile = 1;00806 00807   <span class="keywordflow">while</span> (1){00808     ConsoleWrite(<span class="stringliteral">"SPMax: "</span>);ConsolePutHex8(SPMax);00809     ConsoleWrite(<span class="stringliteral">"PlayingState: "</span>);ConsolePutHex8(playingState);00810 00811     <span class="comment">// has someone requested to record?</span>00812     <span class="keywordflow">if</span> (<a class="code" href="player_8c.html#a3">playingState</a> == <a class="code" href="ui_8h.html#a25a23">PS_RECORDING</a>){00813       <a class="code" href="player_8c.html#a6">uiMode</a> = <a class="code" href="ui_8h.html#a24a2">UI_TITLE</a>;00814       <a class="code" href="player_8c.html#a3">playingState</a> = <a class="code" href="record_8c.html#a3">Record</a>(); <span class="comment">//record returns PS_NEXT_SONG or PS_RECORDING</span>00815       <span class="keywordflow">while</span> (<a class="code" href="board_8h.html#a14">KEY_BUTTON</a>)00816         ; <span class="comment">//Wait until button is depressed</span>00817       ConsoleWrite(<span class="stringliteral">"\rFinished recording.\r"</span>);      00818       currentFile = 1;00819       <a class="code" href="player_8c.html#a3">playingState</a> == <a class="code" href="ui_8h.html#a25a14">PS_NEXT_SONG</a>;     00820     }        00821 00822     <span class="keywordflow">if</span> (<a class="code" href="filesys_8h.html#a8">OpenFile</a>(currentFile)){00823       currentFile = 1;00824       <span class="keywordflow">if</span> (<a class="code" href="filesys_8h.html#a8">OpenFile</a>(currentFile)){00825         <a class="code" href="lcd_8c.html#a4">LcdReset</a>();00826         <a class="code" href="lcd_8h.html#a10">LcdPutConstantString</a>(<span class="stringliteral">"No files."</span>);

⌨️ 快捷键说明

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