示例#1
0
static void exciter_draw_move(t_exciter *x, t_glist *glist)
{
    t_canvas *canvas=glist_getcanvas(glist);
    t_int polyray = ( x->x_height / x->x_nbevents) / 2;
    t_int ei, gi;

    SYS_VGUI7(".x%lx.c coords %xLINE %d %d %d %d \n",
              canvas, x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
              text_xpix(&x->x_obj, glist)+x->x_width, text_ypix(&x->x_obj, glist)+x->x_height
             );
    SYS_VGUI5(".x%lx.c coords %xLOWERCAPTION %d %d\n",
              canvas, x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist) + x->x_height + 10 );
    SYS_VGUI5(".x%lx.c coords %xHIGHERCAPTION %d %d\n",
              canvas, x, text_xpix(&x->x_obj, glist) + x->x_width, text_ypix(&x->x_obj, glist) + x->x_height + 10);
    SYS_VGUI7(".x%lx.c coords %xIN %d %d %d %d\n",
              canvas, x, text_xpix(&x->x_obj, glist),
              text_ypix(&x->x_obj, glist) - 2,
              text_xpix(&x->x_obj, glist) + 5,
              text_ypix(&x->x_obj, glist)
             );
    if ( x->x_nbevents > 1 )
    {
        for ( ei=0; ei<x->x_nbevents; ei++ )
        {
            SYS_VGUI8(".x%lx.c coords %xOUT%d %d %d %d %d\n",
                      canvas, x, ei, text_xpix(&x->x_obj, glist) + ( ei * (x->x_width - 5) )/ (x->x_nbevents-1),
                      text_ypix(&x->x_obj, glist) + x->x_height,
                      text_xpix(&x->x_obj, glist) + ( ei * (x->x_width - 5) )/ (x->x_nbevents-1) + 5,
                      text_ypix(&x->x_obj, glist) + x->x_height + 2
                     );
        }
    }
    else
    {
        SYS_VGUI8(".x%lx.c coords %xOUT%d %d %d %d %d\n",
                  canvas, x, 0, text_xpix(&x->x_obj, glist),
                  text_ypix(&x->x_obj, glist) + x->x_height,
                  text_xpix(&x->x_obj, glist) + 5,
                  text_ypix(&x->x_obj, glist) + x->x_height + 2
                 );
    }
    for ( ei=0; ei<x->x_nbevents; ei++ )
    {
        for ( gi=0; gi<(x->x_width/EXCITER_PIXEL_GRAIN); gi++ )
        {
            SYS_VGUI13(".x%lx.c coords %xEVENT%.4d%.4d %d %d %d %d %d %d %d %d\n",
                       canvas, x, gi, ei,
                       text_xpix(&x->x_obj, glist) + gi*EXCITER_PIXEL_GRAIN,
                       text_ypix(&x->x_obj, glist) + x->x_height - (ei+1)*x->x_height/x->x_nbevents + 2*polyray,
                       text_xpix(&x->x_obj, glist) + gi*EXCITER_PIXEL_GRAIN + polyray,
                       text_ypix(&x->x_obj, glist) + x->x_height - (ei+1)*x->x_height/x->x_nbevents + polyray,
                       text_xpix(&x->x_obj, glist) + gi*EXCITER_PIXEL_GRAIN + 2*polyray,
                       text_ypix(&x->x_obj, glist) + x->x_height - (ei+1)*x->x_height/x->x_nbevents,
                       text_xpix(&x->x_obj, glist) + gi*EXCITER_PIXEL_GRAIN + polyray,
                       text_ypix(&x->x_obj, glist) + x->x_height - (ei+1)*x->x_height/x->x_nbevents - polyray
                      );
        }
    }
    canvas_fixlinesfor( canvas, (t_text*)x );
}
示例#2
0
static void scratcher_draw_new(t_scratcher *x, t_glist *glist)
{
    t_canvas *canvas=glist_getcanvas(glist);
    t_int ci;

    SYS_VGUI7(".x%lx.c create oval %d %d %d %d -fill #000000 -tags %xSCRATCHER\n",
              canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
              text_xpix(&x->x_obj, glist) + x->x_width,
              text_ypix(&x->x_obj, glist) + x->x_height,
              x);
    for ( ci=0; ci<SCRATCHER_NB_GROOVES; ci ++)
    {
        SYS_VGUI8(".x%lx.c create oval %d %d %d %d -outline #FFFFFF -tags %xGROOVE%d\n",
                  canvas, text_xpix(&x->x_obj, glist) + ci*x->x_width/(2*SCRATCHER_NB_GROOVES),
                  text_ypix(&x->x_obj, glist) + ci*x->x_height/(2*SCRATCHER_NB_GROOVES),
                  text_xpix(&x->x_obj, glist) + x->x_width - ci*x->x_width/(2*SCRATCHER_NB_GROOVES),
                  text_ypix(&x->x_obj, glist) + x->x_height - ci*x->x_height/(2*SCRATCHER_NB_GROOVES),
                  x, ci);
    }
    if ( x->x_showspeed )
    {
        SYS_VGUI7( ".x%lx.c create line %d %d %d %d -fill #FF0000 -tags %xSPEEDBAR -width 3\n",
                   canvas, text_xpix(&x->x_obj, glist)+x->x_width/2,
                   text_ypix(&x->x_obj, glist)+x->x_height/2,
                   text_xpix(&x->x_obj, glist)+x->x_width/2 + (int)(x->x_width/2*cos( x->x_readspeed - 1. )),
                   text_ypix(&x->x_obj, glist)+x->x_height/2 - (int)(x->x_width/2*sin( x->x_readspeed - 1. )),
                   x );
    }
    SYS_VGUI7(".x%lx.c create rectangle %d %d %d %d -tags %xFSCRATCHER\n",
              canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
              text_xpix(&x->x_obj, glist) + x->x_width,
              text_ypix(&x->x_obj, glist) + x->x_height,
              x);
    canvas_fixlinesfor( canvas, (t_text*)x );
}
示例#3
0
static void exciter_draw_new(t_exciter *x, t_glist *glist)
{
    t_canvas *canvas=glist_getcanvas(glist);
    t_int ei;

    SYS_VGUI7(".x%lx.c create rectangle %d %d %d %d -outline #000000 -fill #902181 -tags %xLINE\n",
              canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
              text_xpix(&x->x_obj, glist)+x->x_width, text_ypix(&x->x_obj, glist)+x->x_height,
              x);
    SYS_VGUI5(".x%lx.c create text %d %d -font -*-courier-bold--normal--10-* -text \"0 s\" -tags %xLOWERCAPTION\n",
              canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist) + x->x_height + 10, x );
    SYS_VGUI6(".x%lx.c create text %d %d -font -*-courier-bold--normal--10-* -text \"%.2f s\" -tags %xHIGHERCAPTION\n",
              canvas, text_xpix(&x->x_obj, glist) + x->x_width, text_ypix(&x->x_obj, glist) + x->x_height + 10,
              x->x_width/EXCITER_PIXEL_GRAIN*x->x_timegrain , x);
    SYS_VGUI7(".x%lx.c create rectangle %d %d %d %d -outline #000000 -fill #000000 -tags %xIN\n",
              canvas, text_xpix(&x->x_obj, glist),
              text_ypix(&x->x_obj, glist) - 2,
              text_xpix(&x->x_obj, glist) + 5,
              text_ypix(&x->x_obj, glist) ,
              x);
    if ( x->x_nbevents > 1 )
    {
        for ( ei=0; ei<x->x_nbevents; ei++ )
        {
            SYS_VGUI8(".x%lx.c create rectangle %d %d %d %d -outline #000000 -fill #000000 -tags %xOUT%d\n",
                      canvas, text_xpix(&x->x_obj, glist) + ( ei * (x->x_width - 5) )/ (x->x_nbevents-1),
                      text_ypix(&x->x_obj, glist) + x->x_height,
                      text_xpix(&x->x_obj, glist) + ( ei * (x->x_width - 5) )/ (x->x_nbevents-1) + 5,
                      text_ypix(&x->x_obj, glist) + x->x_height + 2,
                      x, ei);
        }
    }
    else
    {
        SYS_VGUI8(".x%lx.c create rectangle %d %d %d %d -outline #000000 -fill #000000 -tags %xOUT%d\n",
                  canvas, text_xpix(&x->x_obj, glist),
                  text_ypix(&x->x_obj, glist) + x->x_height,
                  text_xpix(&x->x_obj, glist) + 5,
                  text_ypix(&x->x_obj, glist) + x->x_height + 2,
                  x, 0);
    }
    canvas_fixlinesfor( canvas, (t_text*)x );
}
示例#4
0
文件: scrolllist.c 项目: Angeldude/pd
static void scrolllist_draw_new(t_scrolllist *x, t_glist *glist)
{   
  t_canvas *canvas=glist_getcanvas(glist);    

    x->x_glist = glist;
    if ( x->x_graphics )
    {
      SYS_VGUI8(".x%x.c create rectangle %d %d %d %d -fill %s -tags %xTEXTLIST\n",
             canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
             text_xpix(&x->x_obj, glist) + x->x_width, text_ypix(&x->x_obj, glist) + x->x_height,
             x->x_bgcolor, x); 
    }
    else
    {
      SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -outline white -fill white -tags %xTEXTLIST\n",
             canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
             text_xpix(&x->x_obj, glist) + x->x_width, text_ypix(&x->x_obj, glist) + x->x_height, x); 
    }
    scrolllist_erase( x, glist );
    scrolllist_update( x, glist );
}
示例#5
0
static void scratcher_draw_move(t_scratcher *x, t_glist *glist)
{
    t_canvas *canvas=glist_getcanvas(glist);
    t_int ci;

    if ( glist_isvisible( x->x_glist ) )
    {
        SYS_VGUI7(".x%lx.c coords %xSCRATCHER %d %d %d %d\n",
                  canvas, x,
                  text_xpix(&x->x_obj, glist)-1, text_ypix(&x->x_obj, glist)-1,
                  text_xpix(&x->x_obj, glist)+x->x_width+1,
                  text_ypix(&x->x_obj, glist)+x->x_height+1);
        SYS_VGUI7(".x%lx.c coords %xFSCRATCHER %d %d %d %d\n",
                  canvas, x,
                  text_xpix(&x->x_obj, glist)-1, text_ypix(&x->x_obj, glist)-1,
                  text_xpix(&x->x_obj, glist)+x->x_width+1,
                  text_ypix(&x->x_obj, glist)+x->x_height+1);
        if ( x->x_showspeed )
        {
            SYS_VGUI7( ".x%lx.c coords %xSPEEDBAR %d %d %d %d\n",
                       canvas, x,
                       text_xpix(&x->x_obj, glist)+x->x_width/2,
                       text_ypix(&x->x_obj, glist)+x->x_height/2,
                       text_xpix(&x->x_obj, glist)+x->x_width/2 + (int)(x->x_width/2*cos( x->x_readspeed - 1 )),
                       text_ypix(&x->x_obj, glist)+x->x_height/2 - (int)(x->x_width/2*sin( x->x_readspeed - 1 ))
                     );
        }
        for ( ci=0; ci<SCRATCHER_NB_GROOVES; ci ++)
        {
            SYS_VGUI8(".x%lx.c coords %xGROOVE%d %d %d %d %d\n",
                      canvas, x, ci,
                      text_xpix(&x->x_obj, glist) + ci*x->x_width/(2*SCRATCHER_NB_GROOVES),
                      text_ypix(&x->x_obj, glist) + ci*x->x_height/(2*SCRATCHER_NB_GROOVES),
                      text_xpix(&x->x_obj, glist) + x->x_width - ci*x->x_width/(2*SCRATCHER_NB_GROOVES),
                      text_ypix(&x->x_obj, glist) + x->x_height - ci*x->x_height/(2*SCRATCHER_NB_GROOVES)
                     );
        }
        canvas_fixlinesfor( canvas, (t_text*)x );
    }
}