#include "board.h"
#include "lcd.h"
#include "filesys.h"
#include "vs10xx.h"
#include "storage.h"
#include "display.h"
#include "string.h"
#include "ui.h"
#include "mmc.h"
#include "record.h"
#include "loud_sa.c"
Include dependency graph for player.c:
Go to the source code of this file.
Defines | |
#define | u_int8 code unsigned char |
typedef for loading patch code | |
#define | u_int16 code unsigned int |
typedef for loading patch code | |
#define | UI_RETURN_DELAY 150 |
How much to wait for button pressed before returning to title. | |
Functions | |
void | timer0_interrupt (void) |
User Interface Timer interrupt. | |
void | LoadPatch () |
Load a patch code to VS10xx. | |
void | StartPatch () |
Start patch code. | |
void | ScreenSetPlayTime () |
Sets playing time and mode icon to left display title. | |
void | AvailableProcessorTime () |
This is called when there is free processor time, implement externally. | |
void | PlayCurrentFile () |
Plays a disk file. | |
void | main () |
Program Entry Point. | |
Variables | |
xdata playingstatetype | playingState = PS_NORMAL |
Playing State Global, 0=normal playing, 1=abort playing. | |
unsigned char | intlevel = 0 |
Current interrupt level. | |
xdata unsigned char | userInterfaceDelayElapsed = 0 |
Interrupt-driven flag to reduce unnecessary UI updates. | |
xdata uimodetype | uiMode = UI_SPEC |
Current User Interface mode (Title, Volume, ...). | |
xdata unsigned char | SPMax = 0 |
This file contains the main() function. It's also the main playground for player UI development. Many functions will be transferred to a new module when they're ok.
Definition in file player.c.
|
typedef for loading patch code
|
|
typedef for loading patch code
|
|
How much to wait for button pressed before returning to title.
Definition at line 218 of file player.c. Referenced by AvailableProcessorTime(). |
|
This is called when there is free processor time, implement externally. The basic task of this function is to implement the player user interface. Local variables:
Bass/Treble setting calculation There are 2 or 4 adjustments possible:
In this software, all are adjusted based from a single setting (0..128) for bass and another for treble. You may wish to allow user to control frequency and level separately or set fixed frequencies for a known speaker type. This algorithm increases the frequency range of adjustment with the increasing level. Definition at line 327 of file player.c. References displayStyle, displayTitle, displayValue, DS_NO_YES, DS_PERCENTAGE, DS_RAWTEXT, DS_TEXT, KEY_BUTTON, KEY_FARLEFT, KEY_FARRIGHT, lcdFont_barchars, lcdFont_vertical_barchars, LcdReset(), LcdSelectFont(), Mp3ReadRegister(), Mp3SetVolume, Mp3WriteRegister, playingState, PS_CUE, PS_END_OF_SONG, PS_NEXT_SONG, PS_NORMAL, PS_PREVIOUS_SONG, PS_RECORDING, PS_REWIND, ScreenSetPlayTime(), SPI_AICTRL1, SPI_BASS, SPIPutChar, SPIWait, UI_BASS, UI_CUE, UI_END_OF_MODES, UI_INFO, UI_RECLEVEL, UI_RETURN_DELAY, UI_SPEC, UI_STOP, UI_TITLE, UI_TREBLE, UI_VOLUME, uiMode, UpdateDisplay(), and userInterfaceDelayElapsed. Referenced by GetAVIBlock(), PlayDiskSectors(), and Record().
Here is the call graph for this function: |
|
Load a patch code to VS10xx.
Definition at line 260 of file player.c. References atab, CODELEN, Delay(), dtab, Temp::i, Mp3WriteRegister, and temp. Referenced by main().
Here is the call graph for this function: |
|
Program Entry Point. In the final program, main() 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. Definition at line 733 of file player.c. References Temp::c, currentFileName, DS_STATIC, InitBoard(), InitDisplay(), InitFileSystem(), KEY_BUTTON, KEY_FARLEFT, KEY_FARRIGHT, KEY_LEFT, KEY_RIGHT, LcdLocateLine2, LcdPrintGenericResult(), LcdPutChar(), LcdPutConstantString(), LcdPutUInt(), LcdReset(), LoadPatch(), Mp3Reset(), Mp3SoftReset(), OpenFile(), PlayCurrentFile(), playingState, PS_END_OF_SONG, PS_NEXT_SONG, PS_NORMAL, PS_PREVIOUS_SONG, PS_RECORDING, Record(), SPMax, StartPatch(), temp, UI_SPEC, UI_TITLE, and uiMode.
Here is the call graph for this function: |
|
Plays a disk file. 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. Definition at line 692 of file player.c. References BuildFragmentTable(), fragment, Address::l, LcdLocateHome, LcdPutConstantString(), Mp3WriteRegister, PlayDiskSectors(), playingState, PS_NEXT_SONG, PS_NORMAL, sectorAddress, SendZerosToVS10xx(), SM_OUTOFWAV, SPI_MODE, and fragmentEntry::start. Referenced by main().
Here is the call graph for this function: |
|
Sets playing time and mode icon to left display title.
Definition at line 285 of file player.c. References displayTitle, Mp3ReadRegister(), playingState, PS_NORMAL, PS_RECORDING, and SPI_DECODE_TIME. Referenced by AvailableProcessorTime().
Here is the call graph for this function: |
|
Start patch code.
Definition at line 269 of file player.c. Referenced by main().
|
|
User Interface Timer interrupt. Does NOT do any screen/button handling, only updates screen scroll variable and the userInterfaceDelayElapsed flag. Definition at line 241 of file player.c. References displayLength, displayPosition, SPMax, and userInterfaceDelayElapsed.
|
|
Current interrupt level.
|
|
Playing State Global, 0=normal playing, 1=abort playing.
Definition at line 221 of file player.c. Referenced by AvailableProcessorTime(), main(), PlayCurrentFile(), PlayDiskSectors(), Record(), and ScreenSetPlayTime(). |
|
Definition at line 233 of file player.c. Referenced by main(), and timer0_interrupt(). |
|
Current User Interface mode (Title, Volume, ...).
Definition at line 231 of file player.c. Referenced by AvailableProcessorTime(), main(), and Record(). |
|
Interrupt-driven flag to reduce unnecessary UI updates. This is set to 1 by timer interrupt every n milliseconds. Definition at line 228 of file player.c. Referenced by AvailableProcessorTime(), and timer0_interrupt(). |