player_8c.html
来自「MP3 Player Source Code」· HTML 代码 · 共 945 行 · 第 1/5 页
HTML
945 行
00677 <span class="keywordflow">break</span>; <span class="comment">// UI_END_OF_MODES</span>00678 00679 00680 } <span class="comment">//End Switch</span>00681 00682 00683 <span class="comment">// Draw screen</span>00684 <a class="code" href="display_8c.html#a7">UpdateDisplay</a>();00685 }</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">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Load a patch code to VS10xx. <p><p>Definition at line <a class="el" href="player_8c-source.html#l00260">260</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#l00035">Delay()</a>, <a class="el" href="loud__sa_8c-source.html#l00815">dtab</a>, <a class="el" href="board_8h-source.html#l00236">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#l00733">main()</a>.<p><pre class="fragment"><div>00260 {00261 ConsoleWrite (<span class="stringliteral">"Loading patch.\r"</span>);00262 <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> < <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>++) { 00263 <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>]>>8, dtab[<a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o1">i</a>]&0xff);00264 }00265 <a class="code" href="board_8h.html#a49">Delay</a>(10);00266 }</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#a49" 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">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </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#l00733">733</a> of file <a class="el" href="player_8c-source.html">player.c</a>.<p>References <a class="el" href="board_8h-source.html#l00235">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#l00043">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#l00083">KEY_BUTTON</a>, <a class="el" href="board_8h-source.html#l00098">KEY_FARLEFT</a>, <a class="el" href="board_8h-source.html#l00086">KEY_FARRIGHT</a>, <a class="el" href="board_8h-source.html#l00092">KEY_LEFT</a>, <a class="el" href="board_8h-source.html#l00089">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#l00260">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#l00692">PlayCurrentFile()</a>, <a class="el" href="player_8c-source.html#l00221">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#l00233">SPMax</a>, <a class="el" href="player_8c-source.html#l00269">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#l00231">uiMode</a>.<p><pre class="fragment"><div>00733 {00734 00735 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> currentFile;00736 00737 <a class="code" href="board_8c.html#a4">InitBoard</a>();00738 00739 <span class="comment">// Start "User Interface" timer</span>00740 ET0 = 1;00741 EA = 1; 00742 TR0 = 1;00743 00744 <span class="comment">//LcdSplashScreen(); </span>00745 <a class="code" href="display_8h.html#a14">InitDisplay</a> (DS_STATIC,<span class="stringliteral">" "</span>,<span class="stringliteral">" "</span>,0);00746 00747 ConsoleWrite (<span class="stringliteral">"\rVLSIPlayer\rStarting up.\r\r"</span>);00748 00749 <a class="code" href="lcd_8c.html#a4">LcdReset</a>();00750 <a class="code" href="lcd_8h.html#a10">LcdPutConstantString</a> (<span class="stringliteral">"Filesys "</span>);00751 <a class="code" href="lcd_8h.html#a2">LcdLocateLine2</a>();00752 <a class="code" href="lcd_8h.html#a14">LcdPrintGenericResult</a> (<a class="code" href="filesys_8c.html#a24">InitFileSystem</a>());00753 00754 <a class="code" href="vs10xx_8c.html#a3">Mp3Reset</a>();00755 <a class="code" href="player_8c.html#a9">LoadPatch</a>();00756 <a class="code" href="player_8c.html#a10">StartPatch</a>();00757 00758 <span class="comment">// If left button is pressed during boot, enter recording.</span>00759 <span class="keywordflow">if</span> (<a class="code" href="board_8h.html#a18">KEY_FARLEFT</a>){00760 <span class="keywordflow">while</span>(<a class="code" href="board_8h.html#a17">KEY_LEFT</a>)00761 ;00762 <a class="code" href="record_8c.html#a3">Record</a>();00763 }00764 00765 00766 <span class="preprocessor">#ifdef VS1003</span>00767 <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>00768 <span class="preprocessor">#else</span>00769 <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>00770 <span class="preprocessor">#endif</span>00771 <span class="preprocessor"></span> 00772 <a class="code" href="player_8c.html#a3">playingState</a> = <a class="code" href="ui_8h.html#a25a14">PS_NEXT_SONG</a>;00773 currentFile = 1;00774 00775 <span class="keywordflow">while</span> (1){00776 ConsoleWrite(<span class="stringliteral">"SPMax: "</span>);ConsolePutHex8(SPMax);00777 ConsoleWrite(<span class="stringliteral">"PlayingState: "</span>);ConsolePutHex8(playingState);00778 00779 <span class="comment">// has someone requested to record?</span>00780 <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>){00781 <a class="code" href="player_8c.html#a6">uiMode</a> = <a class="code" href="ui_8h.html#a24a2">UI_TITLE</a>;00782 <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>00783 <span class="keywordflow">while</span> (<a class="code" href="board_8h.html#a14">KEY_BUTTON</a>)00784 ; <span class="comment">//Wait until button is depressed</span>00785 ConsoleWrite(<span class="stringliteral">"\rFinished recording.\r"</span>); 00786 currentFile = 1;00787 <a class="code" href="player_8c.html#a3">playingState</a> == <a class="code" href="ui_8h.html#a25a14">PS_NEXT_SONG</a>; 00788 } 00789 00790 <span class="keywordflow">if</span> (<a class="code" href="filesys_8h.html#a8">OpenFile</a>(currentFile)){00791 currentFile = 1;00792 <span class="keywordflow">if</span> (<a class="code" href="filesys_8h.html#a8">OpenFile</a>(currentFile)){00793 <a class="code" href="lcd_8c.html#a4">LcdReset</a>();00794 <a class="code" href="lcd_8h.html#a10">LcdPutConstantString</a>(<span class="stringliteral">"No files."</span>);00795 <span class="keywordflow">while</span>(1);00796 }00797 }00798 00799 <a class="code" href="lcd_8c.html#a4">LcdReset</a>();00800 <a class="code" href="lcd_8h.html#a10">LcdPutConstantString</a>(<span class="stringliteral">"File "</span>);00801 <a class="code" href="lcd_8h.html#a15">LcdPutUInt</a>(currentFile);00802 <a class="code" href="lcd_8h.html#a2">LcdLocateLine2</a>();00803 <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><8; <a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o0">c</a>++){00804 <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>]);00805 }00806 00807 00808 <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>)||00809 (<a class="code" href="board_8h.html#a17">KEY_LEFT</a>)||(<a class="code" href="board_8h.html#a16">KEY_RIGHT</a>))00810 ; <span class="comment">/* Wait until no key is pressed */</span>00811 00812 <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>))00813 &&(<a class="code" href="player_8c.html#a3">playingState</a> == <a class="code" href="ui_8h.html#a25a12">PS_NORMAL</a>))
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?