void DrawLeftSlider(struct Tracker_Windows *window){ window->leftslider.x=window->wblock->t.y1; window->leftslider.x2=window->wblock->t.y2+1; GFX_Box( window, 1, 0, window->leftslider.x, window->leftslider.width, window->leftslider.x2, PAINT_DIRECTLY ); window->leftslider.lx=window->leftslider.x+2; window->leftslider.lx2=window->leftslider.x2-2; GFX_FilledBox( window, 2, 2, window->leftslider.lx, window->leftslider.width - 2, window->leftslider.lx2, PAINT_DIRECTLY ); UpdateLeftSlider(window); }
void DrawBottomSlider_old(struct Tracker_Windows *window){ window->bottomslider.x = window->wblock->t.x1; int y1 = window->height - window->bottomslider.width + 2; int y2 = window->height - 3; while(y2<=y1){ y1--; y2++; } GFX_Box( window, 1, window->bottomslider.x, y1 - 2, window->bottomslider.x2, y2 + 2, PAINT_DIRECTLY ); GFX_Box( window, 0, window->bottomslider.x+1, y1 - 1, window->bottomslider.x2-1, y1 + 1, PAINT_DIRECTLY ); window->bottomslider.lx=window->bottomslider.x + 2, window->bottomslider.lx2=window->bottomslider.x2 - 2, GFX_FilledBox( window, 2, window->bottomslider.lx, y1, window->bottomslider.lx2, y2, PAINT_DIRECTLY ); UpdateBottomSlider(window); }
void DrawSlider( struct Tracker_Windows *window, const TBox *box, float f_val, float f_min, float f_max, bool onoff, int where ){ int y1=box->y1; int y2=box->y2; int x = scale(f_val, f_min,f_max, box->x1, box->x2); if (!onoff) GFX_SetMixColor(window,EDITOR_SLIDERS_COLOR_NUM,LOW_EDITOR_BACKGROUND_COLOR_NUM,300); //printf(" slider x: %d -> %d -> %d\n", box->x1+2, x, box->x2-2); GFX_FilledBox( window,EDITOR_SLIDERS_COLOR_NUM, box->x1+2,y1, x,y2, where ); // if (!onoff) // GFX_SetMixColor(window,0,0,500); // background GFX_SetMixColor(window,LOW_EDITOR_BACKGROUND_COLOR_NUM,HIGH_BACKGROUND_COLOR_NUM,500); GFX_FilledBox( window,LOW_EDITOR_BACKGROUND_COLOR_NUM, x,y1, box->x2,y2, where ); // border GFX_SetMixColor(window,BLACK_COLOR_NUM,LOW_EDITOR_BACKGROUND_COLOR_NUM,300); GFX_Box( window,TEXT_COLOR_NUM, box->x1+1,y1, box->x2,y2, where ); }
void DrawSlider( struct Tracker_Windows *window, TBox *box, float f_val, float f_min, float f_max, bool onoff, int where ){ int y1=box->y1; int y2=box->y2; int x = scale(f_val, f_min,f_max, box->x1, box->x2); if (!onoff) GFX_SetMixColor(window,5,0,500); GFX_FilledBox( window,5, box->x1,y1, x,y2, where ); // if (!onoff) // GFX_SetMixColor(window,0,0,500); // background GFX_SetMixColor(window,0,11,500); GFX_FilledBox( window,0, x,y1, box->x2,y2, where ); // border GFX_SetMixColor(window,1,0,300); GFX_Box( window,1, box->x1+1,y1, box->x2,y2, where ); }
void DrawBottomSlider(struct Tracker_Windows *window){ window->bottomslider.x = window->wblock->t.x1; int x1 = window->bottomslider.x; int x2 = window->bottomslider.x2; int y1 = window->wblock->reltempo.y1; int y2 = window->wblock->reltempo.y2; SliderData data = get_sliderdata(window); int inner_x1 = scale(data.leftmost_visible_x, 0, data.total_width, x1, x2); int inner_x2 = scale(data.rightmost_visible_x, 0, data.total_width, x1, x2); // background GFX_FilledBox( window, HIGH_BACKGROUND_COLOR_NUM, window->wblock->reltempo.x2,y1, x2,y2, PAINT_DIRECTLY ); // slider GFX_FilledBox( window,TRACK_SLIDER_COLOR_NUM, inner_x1,y1, inner_x2,y2, PAINT_DIRECTLY ); // border GFX_Box( window,TRACK_SLIDER_COLOR_NUM, x1,y1, x2,y2, PAINT_DIRECTLY ); }
/********************************************************************* FUNCTION Is ment to be called instead of clearing all of the window, to avoid flicker. *********************************************************************/ void ClearUnusedWindowsAreas(struct Tracker_Windows *window){ const int color = 0; struct WBlocks *wblock = window->wblock; #if !USE_OPENGL // Clears the area between the header and the first line, if there is space. { int top_line_y = Common_oldGetReallineY1Pos(window, wblock, 0); //printf("top_line_y: %d. wblock->t.y1: %d\n", top_line_y, wblock->t.y1); if(top_line_y>wblock->t.y1) GFX_FilledBox(window,color, window->leftslider.width+1, wblock->t.y1, window->width, top_line_y-1, PAINT_DIRECTLY ); } // Clears the area between the last line and the bottom slider, if there is space. { int bot_line_y2 = Common_oldGetReallineY2Pos(window, wblock, R_MIN(wblock->num_reallines-1,wblock->bot_realline)); if(bot_line_y2 < wblock->a.y2) GFX_FilledBox(window,color, window->leftslider.width+1, bot_line_y2, window->width, wblock->a.y2, PAINT_DIRECTLY ); } #endif // !USE_OPENGL // Clear the small area between the temposlider and the bottom slider. GFX_FilledBox( window,color, wblock->reltempo.x2+1, window->height - window->bottomslider.width+1, window->bottomslider.x-1, window->height-1, PAINT_DIRECTLY ); #if 0 // Clear the area to the right of the rightmost track. { struct WTracks *last_wtrack = ListLast1(&wblock->wtracks->l); if(last_wtrack->fxarea.x2<wblock->a.x2){ //GFX_P_FilledBox(window,color,last_wtrack->fxarea.x2+2,wblock->t.y1,wblock->a.x2,wblock->t.y2); GFX_FilledBox(window,color, last_wtrack->fxarea.x2+2, 0, wblock->a.x2, wblock->t.y1, PAINT_DIRECTLY ); } } #endif #if !USE_OPENGL // Clear the area between the Left slider and the line numbers. //printf("sl.x2: %d / %d\n", window->leftslider.width+1,wblock->zoomlevelarea.x-1); //if(window->leftslider.width+1 < wblock->zoomlevelarea.x-1) GFX_FilledBox( window,color, window->leftslider.width+1, wblock->t.y1, wblock->linenumarea.x, wblock->t.y2+1, PAINT_DIRECTLY ); //printf("%d/%d -> %d/%d\n",window->leftslider.width+1, wblock->t.y1, // wblock->zoomlevelarea.x-1, wblock->t.y2); // Clear the one pixel wide area in the left slider. GFX_Box( window,color, 1, wblock->t.y1+1, window->leftslider.width-1, wblock->t.y2, PAINT_DIRECTLY ); #endif }
void DrawSlider_old( struct Tracker_Windows *window, TBox *box, float f_val, float f_min, float f_max, bool onoff, bool t ){ int y1=box->y1+1; int y2=box->y2-1; int max=(int)(1000*(f_max-f_min)); int val=(int)(1000*(f_val-f_min)); if(y2<y1){ y1--; y2++; } if(t){ GFX_T_Box( window,1, box->x1,box->y1, box->x2,box->y2, PAINT_BUFFER ); if(!onoff){ GFX_T_FilledBox( window,0, box->x1+1,y1, box->x2-1,y2, PAINT_BUFFER ); GFX_T_FilledBox( window,3, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max)-3, box->x2-1 ), y1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max)+3, box->x2-1 ), y2, PAINT_BUFFER ); GFX_T_FilledBox( window,1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max), box->x2-1 ), y1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max), box->x2-1 ), y2, PAINT_BUFFER ); return; } GFX_T_FilledBox( window,2, box->x1+1,y1, box->x2-1,y2, PAINT_BUFFER ); GFX_T_FilledBox( window,3, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max)-9, box->x2-1 ), y1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max)+9, box->x2-1 ), y2, PAINT_BUFFER ); GFX_T_FilledBox( window,1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max)-3, box->x2-1 ), y1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max)+3, box->x2-1 ), y2, PAINT_BUFFER ); GFX_T_FilledBox( window,2, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max), box->x2-1 ), y1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max), box->x2-1 ), y2, PAINT_BUFFER ); }else{ GFX_Box( window,1, box->x1,box->y1, box->x2,box->y2, PAINT_DIRECTLY ); if(!onoff){ GFX_FilledBox( window,0, box->x1+1,y1, box->x2-1,y2, PAINT_DIRECTLY ); GFX_FilledBox( window,3, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max)-3, box->x2-1 ), y1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max)+3, box->x2-1 ), y2, PAINT_DIRECTLY ); GFX_FilledBox( window,1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max), box->x2-1 ), y1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max), box->x2-1 ), y2, PAINT_DIRECTLY ); return; } GFX_FilledBox( window,2, box->x1+1,y1, box->x2-1,y2, PAINT_DIRECTLY ); GFX_FilledBox( window,3, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max)-9, box->x2-1 ), y1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max)+9, box->x2-1 ), y2, PAINT_DIRECTLY ); GFX_FilledBox( window,1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max)-3, box->x2-1 ), y1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max)+3, box->x2-1 ), y2, PAINT_DIRECTLY ); GFX_FilledBox( window,2, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max), box->x2-1 ), y1, R_BOUNDARIES( box->x1+1, box->x1+((box->x2-box->x1)*val/max), box->x2-1 ), y2, PAINT_DIRECTLY ); } }