Ejemplo n.º 1
0
static void STP_Constructor(STimePlace *stp,struct Blocks *block){

	/* Misc */
	PlaceSetFirstPos(&stp->firstplace);
	PlaceSetLastPos(block,&stp->lastplace);
	stp->btempo=false;
	stp->blpb=false;
	stp->breltempo=false;

	/* Times */
	stp->times = talloc(sizeof(struct STimes)*(block->num_lines+1));


	/* Tempos */
	stp->tempo=root->tempo;
	stp->stempo= block->tempos;
	if(stp->stempo!=NULL && PlaceEqual(&stp->firstplace,&stp->stempo->l.p)){
		stp->tempo=stp->stempo->tempo;
		stp->stempo=NextTempo(stp->stempo);
	}

	/* LBPs */
	stp->lpb=root->lpb;
	stp->slpb=block->lpbs;
	if(stp->slpb!=NULL && PlaceEqual(&stp->firstplace,&stp->slpb->l.p)){
		stp->lpb=stp->slpb->lpb;
		stp->slpb=NextLPB(stp->slpb);
	}

	/* TempoNodes */
	stp->temponode=block->temponodes;
	stp->relp1=GetDoubleFromPlace(&stp->temponode->l.p);	// first temponode is allways at firstplace (just try dragging down the highest temponode).
	stp->reltempo1=stp->temponode->reltempo;

	stp->temponode=NextTempoNode(stp->temponode);
	stp->relp2=GetDoubleFromPlace(&stp->temponode->l.p);	// There is allways at least two temponode objects for each block.
	stp->reltempo2=stp->temponode->reltempo;


	/* Placements */
	stp->p1= &stp->firstplace;

	stp->p2=&stp->temponode->l.p;
	if(stp->stempo!=NULL){
		stp->p2=PlaceMin(stp->p2,&stp->stempo->l.p);
	}
	if(stp->slpb!=NULL){
		stp->p2=PlaceMin(stp->p2,&stp->slpb->l.p);
	}

	/* bools */
	if(stp->stempo!=NULL && PlaceEqual(stp->p2,&stp->stempo->l.p)) stp->btempo=true;
	if(stp->slpb!=NULL && PlaceEqual(stp->p2,&stp->slpb->l.p)) stp->blpb=true;
	if(PlaceEqual(stp->p2,&stp->temponode->l.p)) stp->breltempo=true;

	/* time */
	stp->nexttime=0;


}
Ejemplo n.º 2
0
void InvertTrack(
	struct Blocks *block,
	struct Tracks *track
){
	Place p1,p2;

	PlaceSetFirstPos(&p1);
	PlaceSetLastPos(block,&p2);

	Invert_notes(track->notes,&p1,&p2,true,0);
}
Ejemplo n.º 3
0
void PlayBlockFromStart(struct Tracker_Windows *window,bool do_loop){
	PlayStopReally(false);

	root->setfirstpos=true;
	pc->seqtime=0;

        {
          struct WBlocks *wblock=window->wblock;
          Place place;
          PlaceSetFirstPos(&place);
          PlayBlock(wblock->block,&place,do_loop);
        }
}
Ejemplo n.º 4
0
void PlaySongFromStart(struct Tracker_Windows *window){
	PlayStopReally(false);

	BS_SelectPlaylistPos(0);
	debug("root->curr_block: %d\n",root->curr_block);
	root->setfirstpos=true;
	pc->seqtime=0;

	InitAllInstrumentsForPlaySongFromStart();

        {
          Place place;
          PlaceSetFirstPos(&place);
          PlaySong(&place,0);
        }
}
Ejemplo n.º 5
0
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
}