Exemple #1
0
void PlayRangeCurrPos(struct Tracker_Windows *window){
	struct WBlocks *wblock;
	Place *place;

	PlayStopReally(false);

	wblock=window->wblock;

	if( ! wblock->isranged) return;

	root->setfirstpos=false;

	if(wblock->rangey1==0) root->setfirstpos=true;

	place=getRangeStartPlace(wblock);
	pc->seqtime=-Place2STime(wblock->block,place);

//	printf("playrange, time: %d\n",pc->seqtime);

        Place *place_start = getRangeStartPlace(wblock);
        Place *place_end   = getRangeEndPlace(wblock);
        pc->range_duration = Place2STime(wblock->block, place_end) - Place2STime(wblock->block, place_start);
        pc->is_playing_range = true;
        
	PlayBlock(wblock->block,place,true);
}
Exemple #2
0
void PlaySongCurrPos(struct Tracker_Windows *window){
	struct Blocks *block;
	struct WBlocks *wblock;
	Place *place;
	int playpos;
	bool changeblock=false;

	wblock=window->wblock;

	PlayStopReally(false);

	root->setfirstpos=false;

	playpos=root->curr_playlist;
                
	block=BL_GetBlockFromPos(playpos);
	if(block==NULL) return;

	if(wblock->l.num!=block->l.num){
		wblock=ListFindElement1(&window->wblocks->l,block->l.num);
		changeblock=true;
		root->setfirstpos=true;
	}

	if(
		! changeblock &&
		playpos==root->song->length-1 &&
		wblock->curr_realline==wblock->num_reallines  // ??. Never supposed to happen.
	){
		return;
	}

	if(wblock->curr_realline==0) root->setfirstpos=true;


	debug("contsong, playpos: %d , root->curr_block: %d\n",playpos,root->curr_block);

	if(changeblock){
		place=PlaceGetFirstPos();
		pc->seqtime=0;
	}else{
		place=&wblock->reallines[wblock->curr_realline]->l.p;
		pc->seqtime=-Place2STime(wblock->block,place);
	}
	debug("contsong, time: %d, playpos: %d , root->curr_block: %d\n",pc->seqtime,playpos,root->curr_block);

	place->line++;
	debug("nextline: %d\n",Place2STime(wblock->block,place));
	place->line--;

	PlaySong(place,playpos);
}
Exemple #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);
        }
}
Exemple #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);
        }
}
Exemple #5
0
void PlayBlockCurrPos(struct Tracker_Windows *window){
	struct WBlocks *wblock;
	Place *place;
	PlayStopReally(false);

	root->setfirstpos=false;

	wblock=window->wblock;

	if(wblock->curr_realline==0) root->setfirstpos=true;

	place       = &wblock->reallines[wblock->curr_realline]->l.p;
	pc->seqtime = -Place2STime(wblock->block,place);

//	printf("contblock, time: %d\n",pc->seqtime);

	PlayBlock(wblock->block,place,true);
}
Exemple #6
0
void PlayStop(void){
	if(! pc->isplaying)
          StopAllInstruments();
        else
          PlayStopReally(true);
}