?? update_playlist.c
字號:
#include "Sample Playback.h"
// at end of sample in flash, reset the byte-address, and cue the LED sweep routine
void UpdatePlaylist(void)
{
Csample* SampleP;
//update address for each all valid audio clips
for(SampleP=FirstSample; SampleP!=0; SampleP=SampleP->Next){
//increment current byte address by two (16-bit samples)
SampleP->CurrentAddr+=2;
}
//First clip in list is always accessed circularly, so at end of clip
//wrap pointer to beginning and resynchronize LED sweeping.
if( (FirstSample->CurrentAddr - FirstSample->StartAddr) >= FirstSample->Bytes){
FirstSample->CurrentAddr = FirstSample->StartAddr;
start_sweep = 1;
sweep_count++;
}
//after the second sweep, play back the other ("all systems go") audio sample
//by adding another Csample to the linked list.
if ( sweep_count == 3 ) {
sweep_count++;
SampleP=FirstSample;
//find end of playlist
while(SampleP->Next) SampleP=SampleP->Next;
//create new sample descriptor on the heap and add to end of list
SampleP->Next=(Csample*)malloc(sizeof(Csample));
//init that new descriptor
SampleP->Next->StartAddr = 0x1060000;
SampleP->Next->CurrentAddr = 0x1060000;
SampleP->Next->Bytes = 111180;
SampleP->Next->Next = 0;
}
//after the third sweep, remove the other clip from playlist
if ( sweep_count > 4 ) {
SampleP=FirstSample;
//find end of list. Move through list until you point at a descriptor with
//a Next value == 0), then erase pointer to that descriptor.
while(SampleP->Next->Next) SampleP=SampleP->Next;
//delete last node
SampleP->Next = 0;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -