Beispiel #1
0
int GetXSubTrack_B2(
	const struct WBlocks *wblock,
	NInt track,
	int subtrack
){
	if(track>=0) return GetXSubTrack2(ListFindElement1(&wblock->wtracks->l,track),subtrack);
	switch(track){
		case SIGNATURETRACK:
			return wblock->signaturearea.x2;
			break;
		case LPBTRACK:
			return wblock->lpbarea.x2;
			break;
		case TEMPOTRACK:
			return wblock->tempoarea.x2;
			break;
		case TEMPONODETRACK:
			return wblock->temponodearea.x2;
			break;
	};
	RError("Error in function GetXSubTrack_B2 in file gfx_subtrack.c\n");
	return 0;
}
Beispiel #2
0
const struct NodeLine *GetVelocityNodeLines(const struct Tracker_Windows *window, const struct WBlocks *wblock, const struct WTracks *wtrack, const struct Notes *note){
  struct Velocities *first_velocity = (struct Velocities*)&note->first_velocity;
  first_velocity->l.p = note->l.p;
  first_velocity->l.next = &note->velocities->l;
  first_velocity->velocity = note->velocity;
  first_velocity->logtype = note->velocity_first_logtype;
  
  struct Velocities *last_velocity = (struct Velocities*)&note->last_velocity;
  last_velocity->l.p = note->end;
  last_velocity->l.next = NULL;
  last_velocity->velocity = note->velocity_end;
  last_velocity->logtype = LOGTYPE_IRRELEVANT;
  
  //printf("Note: %s, pointer: %p, subtrack: %d\n",NotesTexts3[(int)note->note],note,note->subtrack);
  subtrack_x1 = GetXSubTrack1(wtrack,note->subtrack);
  subtrack_x2 = GetXSubTrack2(wtrack,note->subtrack);
  
  return create_nodelines(window,
                          wblock,
                          &first_velocity->l,
                          get_velocity_x,
                          &last_velocity->l
                          );
}
Beispiel #3
0
int CursorRight(struct Tracker_Windows *window,struct WBlocks *wblock){
	struct WTracks *wtrack=wblock->wtrack;
	struct WTracks *leftwtrack;
	struct WTracks *rightwtrack;
	int update=0;
	int x2;
        
	if(window->curr_track>=0){

		window->curr_track_sub++;
                int num_subtracks = GetNumSubtracks(wtrack);

		if(window->curr_track_sub>=num_subtracks){
			window->curr_track++;
			if(NextWTrack(wtrack)==NULL){
				window->curr_track--;
				window->curr_track_sub--;
				return 0;
			}else{
				window->curr_track_sub= -1;
				ATOMIC_WRITE(wblock->wtrack, NextWTrack(wtrack));
			}
		}

		while(
			window->curr_track>wblock->right_track
			||
			(
			 window->curr_track==wblock->right_track
			 && window->curr_track_sub>wblock->right_subtrack
			 )
		){
			leftwtrack=ListFindElement1(&wblock->wtracks->l,wblock->left_track);
                        int num_subtracks = GetNumSubtracks(leftwtrack);
			wblock->left_subtrack++;
			if(wblock->left_subtrack>=num_subtracks){
                          if (wblock->left_track < wblock->block->num_tracks-1) {
                            wblock->left_subtrack= -1;
                            wblock->left_track++;
                            //return 0;
                          } else {
                            UpdateAllWTracksCoordinates(window,wblock);
                            wblock->left_subtrack--;
                            return 1;
                          }
			}
			leftwtrack=ListFindElement1(&wblock->wtracks->l,wblock->left_track);
			if(
				wblock->left_track==wblock->block->num_tracks-1 &&
				wblock->left_subtrack==num_subtracks-1
			){
                                UpdateAllWTracksCoordinates(window,wblock);
				return 2;
			}
			UpdateAllWTracksCoordinates(window,wblock);
			update=1;
		}
		for(;;){
		  rightwtrack=ListFindElement1(&wblock->wtracks->l,window->curr_track);
                  int num_subtracks = GetNumSubtracks(rightwtrack);
		  x2=GetXSubTrack2(rightwtrack,window->curr_track_sub);
		  if(x2>wblock->a.x2){
			leftwtrack=ListFindElement1(&wblock->wtracks->l,wblock->left_track);
			wblock->left_subtrack++;
			if(wblock->left_subtrack>=num_subtracks){
                          if (wblock->left_track < wblock->block->num_tracks-1) {
				wblock->left_subtrack= -1;
				wblock->left_track++;
                          } else {
                            wblock->left_subtrack--;
                            UpdateAllWTracksCoordinates(window,wblock);
                            return 1;
                          }
			}
			leftwtrack=ListFindElement1(&wblock->wtracks->l,wblock->left_track);
			UpdateAllWTracksCoordinates(window,wblock);
			update=1;
		  }else{
		    break;
		  }
		}
	
	}else{
                ATOMIC_INC(window->curr_track, 1);

                if (window->curr_track==LPBTRACK && window->show_lpb_track==false)
                  ATOMIC_INC(window->curr_track, 1);

                if (window->curr_track==SIGNATURETRACK && window->show_signature_track==false)
                  ATOMIC_INC(window->curr_track, 1);
                
                if (window->curr_track==LINENUMBTRACK)
                  ATOMIC_INC(window->curr_track, 1);

                if (window->curr_track==TEMPONODETRACK && window->show_reltempo_track==false)
                  ATOMIC_INC(window->curr_track, 1);

		if (0==window->curr_track)
                  window->curr_track_sub= -1;
                
                
	}
	if(update==1){
		return 2;
	}else{
		return 1;
	}
}
Beispiel #4
0
int GetSubTrackWidth(const struct WTracks *wtrack,int subtrack){
	return GetXSubTrack2(wtrack,subtrack)-GetXSubTrack1(wtrack,subtrack);
}