#ifndef MAPBAR_LIKE_TIMIDI 
#ifndef MAPBAR_LIKE_TMIDI 
static void CanvasMapUpdate(int flag){	RECT rc;	int i,j;	int change_flag = 0;	if(!CanvasOK)   	return;	CanvasMapDrawMapBar(flag);   if(Canvas.UpdateAll)   	flag = 1;	gdi_lock(); // gdi_lock	if(PInfoOK && Canvas.MapMode==CMAP_MODE_16){   if(flag || Panel->changed){		int ch;		for(ch=0;ch<Canvas.MapCh;ch++){			int x,y;         COLORREF color;			COLORREF colorFG, colorBG;			int drumflag = IS_SET_CHANNELMASK(Canvas.DrumChannel,ch);			if(!flag && !(Canvas.MapChChanged & (1<<ch)))         	continue;			if(drumflag){				colorFG = CanvasColor(CC_DFORE);				colorBG = CanvasColor(CC_DFORE_HALF);      	} else {				colorFG = CanvasColor(CC_FORE);				colorBG = CanvasColor(CC_FORE_HALF);      	}         rc.left = Canvas.rcMapSub.left + (5 + 1) * ch;         rc.right = rc.left + 5 - 1;			// PAN         rc.top = Canvas.rcMapSub.top;         rc.bottom = rc.top + 3 - 1;				for(x=rc.left;x<=rc.right;x++){				for(y=rc.top;y<=rc.bottom;y++)        			SetPixelV(Canvas.hmdc,x,y,colorBG);				}			if(Canvas.MapPan[ch]>=0){				x = rc.left + Canvas.MapPan[ch];				for(y=rc.top;y<=rc.bottom;y++)     				SetPixelV(Canvas.hmdc,x,y,colorFG);			}         // SUSTAIN         rc.top = rc.bottom + 2;         rc.bottom = rc.top + 2 - 1;				if(Canvas.MapSustain[ch]){					for(x=rc.left;x<=rc.right;x++){					for(y=rc.top;y<=rc.bottom;y++)        				SetPixelV(Canvas.hmdc,x,y,colorFG);					}				} else {					for(x=rc.left;x<=rc.right;x++){					for(y=rc.top;y<=rc.bottom;y++)        				SetPixelV(Canvas.hmdc,x,y,colorBG);					}         // EXPRESSION         rc.top = rc.bottom + 2;         rc.bottom = rc.top + 2 - 1;			for(i=1;i<=10;i++){         		if(i <= Canvas.MapExpression[ch])            	color = colorFG;            else            	color = colorBG;			x = rc.left + (i-1)/2;			y = rc.top + (i+1)%2;  				SetPixelV(Canvas.hmdc,x,y,color);			}         // VOLUME         rc.top = rc.bottom + 2;         rc.bottom = rc.top + 2 - 1;			for(i=1;i<=10;i++){        		if(i <= Canvas.MapVolume[ch])            	color = colorFG;            else            	color = colorBG;            x = rc.left + (i-1)/2;				y = rc.top + (i+1)%2;  				SetPixelV(Canvas.hmdc,x,y,color);			}         // PITCH_BEND         rc.top = rc.bottom + 2;         rc.bottom = rc.top + 3 - 1;					for(x=rc.left;x<=rc.right;x++){				for(y=rc.top;y<=rc.bottom;y++)        			SetPixelV(Canvas.hmdc,x,y,colorBG);					}         if(Canvas.MapPitchbend[ch]==-2){         	y = rc.top + 1;				for(x=rc.left;x<=rc.right;x++)  					SetPixelV(Canvas.hmdc,x,y,colorFG);				y++;				for(x=rc.left;x<=rc.right;x++)  					SetPixelV(Canvas.hmdc,x,y,colorFG);			} else if(Canvas.MapPitchbend[ch]>0x2000){         	y = rc.top;				for(x=rc.left;x<=rc.left;x++)  					SetPixelV(Canvas.hmdc,x,y,colorFG);				y++;				for(x=rc.left;x<=rc.left+2;x++)  					SetPixelV(Canvas.hmdc,x,y,colorFG);				y++;				for(x=rc.left;x<=rc.left+4;x++)		 			SetPixelV(Canvas.hmdc,x,y,colorFG);			} else if(Canvas.MapPitchbend[ch]<0x2000){         	y = rc.top;				for(x=rc.right;x<=rc.right;x++)  					SetPixelV(Canvas.hmdc,x,y,colorFG);				y++;				for(x=rc.right-2;x<=rc.right;x++)  					SetPixelV(Canvas.hmdc,x,y,colorFG);				y++;				for(x=rc.right-4;x<=rc.right;x++)		 			SetPixelV(Canvas.hmdc,x,y,colorFG);         }      }      }	 		InvalidateRect(hCanvasWnd,(RECT *)&(Canvas.rcMapSub),FALSE);   }   }	if(!Canvas.MapResidual && !flag)   	return;	change_flag = 0;#ifndef MAPBAR_LIKE_TIMIDI	for(i=0;i<Canvas.MapCh;i++){		for(j=0;j<Canvas.MapBarMax;j++){			if(Canvas.MapMap[i][j]!=Canvas.MapMapOld[i][j] || flag){				int x,y;				COLORREF color = CanvasColor(Canvas.MapMap[i][j]);            rc.left = Canvas.rcMap.left + (Canvas.MapBarWidth + 1) * i;            rc.right = rc.left -1 + Canvas.MapBarWidth;            rc.top = Canvas.rcMap.top + (2 + 1) * j;            rc.bottom = rc.top -1 + 2;				for(x=rc.left;x<=rc.right;x++)					for(y=rc.top;y<=rc.bottom;y++)          			SetPixelV(Canvas.hmdc,x,y,color);				change_flag = 1;    		}   	}	}#else	if(Canvas.MapMode==CMAP_MODE_16){	for(i=0;i<Canvas.MapCh;i++){		for(j=0;j<Canvas.MapBarMax;j++){			if(Canvas.MapMap[i][j]!=Canvas.MapMapOld[i][j] || flag){				int x,y;				COLORREF color = CanvasColor(Canvas.MapMap[i][j]);				rc.left = Canvas.rcMap.left + (Canvas.MapBarWidth + 1) * i;				rc.right = rc.left -1 + Canvas.MapBarWidth;				rc.top = Canvas.rcMap.top + (2 + 1) * j;				rc.bottom = rc.top -1 + 2;					for(x=rc.left;x<=rc.right;x++){					for(y=rc.top;y<=rc.bottom;y++)          			SetPixelV(Canvas.hmdc,x,y,color);					}				change_flag = 1;    		}   		}	}	} else {	for(i=0;i<Canvas.MapCh;i++){		for(j=0;j<Canvas.MapBarMax;j++){			if(Canvas.MapMap[i][j]!=Canvas.MapMapOld[i][j] || flag){				int x,y;				COLORREF color = CanvasColor(Canvas.MapMap[i][j]);				if(i<=15){					rc.left = Canvas.rcMap.left + (Canvas.MapBarWidth + 1) * i;					rc.right = rc.left -1 + Canvas.MapBarWidth;						rc.top = -1 + Canvas.rcMap.top + (2 + 1) * j;					rc.bottom = rc.top -1 + 2;				} else {					rc.left = Canvas.rcMap.left + (Canvas.MapBarWidth + 1) * (i-16);					rc.right = rc.left -1 + Canvas.MapBarWidth;						rc.top = -1 + Canvas.rcMap.top + (2 + 1) * j + Canvas.MapBarMax*(2+1) + 2 ;					rc.bottom = rc.top -1 + 2;				}				for(x=rc.left;x<=rc.right;x++)					for(y=rc.top;y<=rc.bottom;y++)	          			SetPixelV(Canvas.hmdc,x,y,color);				change_flag = 1;    		}   		}	}	}#endif#ifdef CMAP_ALL_UPDATE	if(change_flag)		InvalidateRect(hCanvasWnd,NULL,FALSE);#else	if(change_flag)		InvalidateRect(hCanvasWnd,(RECT *)&(Canvas.rcMapMap),FALSE);#endif	if(Canvas.UpdateAll)		InvalidateRect(hCanvasWnd,NULL,FALSE);	if(Canvas.MapResidual<0)		Canvas.MapResidual = 0;	gdi_unlock(); // gdi_lock}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/b145888026ba74b152bd275692a491408aa2b59e/w32g_i.c/buggy/interface/w32g_i.c