static void PlayBlock( struct Blocks *block, Place *place, bool do_loop ){ // GC isn't used in the player thread, but the player thread sometimes holds pointers to gc-allocated memory. //while(GC_is_disabled()==false){ //printf("Calling gc_disable: %d\n",GC_dont_gc); while(GC_dont_gc<=0){ GC_disable(); } pc->initplaying=true; pc->playpos=0; pc->play_id++; if(do_loop==true) pc->playtype=PLAYBLOCK; else pc->playtype=PLAYBLOCK_NONLOOP; pc->block=block; root->curr_block=pc->block->l.num; printf("Play block. root->curr_block: %d. Block: %p\n",root->curr_block,pc->block); //abort(); fflush(stdout); #if !USE_OPENGL pc->isplaying=true; (*Ptask2MtaskCallBack)(); #endif pc->isplaying=false; PATCH_reset_time(); InitPEQclock(); InitPEQ_LPB(pc->block,place); InitPEQ_Signature(pc->block,place); InitPEQ_Beat(pc->block,place); InitPEQrealline(block,place); InitPEQline(block,place); InitPEQblock(block,place); InitAllPEQnotes(block,place); StartPlayer(); // An OS spesific function. pc->isplaying=true; pc->initplaying=false; }
static void PlaySong( Place *place, int playpos ){ debug("haaasfdfsafsa, root->song->length: %d\n\n\n",root->song->length); pc->initplaying=true; struct Blocks *block=BL_GetBlockFromPos(playpos); printf("Play song. blocknum:%d. Block: %p\n",block->l.num, block); pc->playpos=playpos; pc->play_id++; root->curr_playlist=playpos; pc->playtype=PLAYSONG; pc->block=block; root->curr_block=block->l.num; #if !USE_OPENGL pc->isplaying=true; (*Ptask2MtaskCallBack)(); #endif pc->isplaying=false; PATCH_reset_time(); InitPEQclock(); InitPEQ_LPB(pc->block,place); InitPEQ_Signature(pc->block,place); InitPEQ_Beat(pc->block,place); InitPEQrealline(block,place); InitPEQline(block,place); InitPEQblock(block,place); InitAllPEQnotes(block,place); StartPlayer(); // An OS spesific function. pc->isplaying=true; pc->initplaying=false; // GC isn't used in the player thread, but the player thread sometimes holds pointers to gc-allocated memory. while(GC_is_disabled()==false) GC_disable(); }
void PC_StopPause(void){ #ifdef NOPAUSEPLAY return; #else Place place; STime pausetime; struct PEventQueue *peq; if( ! is_playing()) return; pausetime=pc->pausetime; PlaceSetFirstPos(&place); InitPEQclock(); InitPEQ_LPB(pc->block,place); InitPEQ_Signature(pc->block,place); InitPEQ_Beat(pc->block,place); InitPEQrealline(pc->block,&place); InitPEQline(pc->block,&place); InitPEQblock(pc->block,&place); InitAllPEQnotes(pc->block,&place); peq=pc->peq; while(peq!=NULL && pausetime>=peq->l.time){ PC_RemoveFirst(); (*peq->TreatMe)(pausetime,peq,0); peq=pc->peq; } ATOMIC_SET(root->setfirstpos, false); StopPausePlayer(); #endif }