libxputty  0.1
A damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces
xplayhead.c File Reference
#include "xplayhead.h"
#include "xplayhead_private.h"
Include dependency graph for xplayhead.c:

Go to the source code of this file.

Functions

void playhead_mem_free (void *w_, void *user_data)
 
Widget_tadd_playhead (Widget_t *parent, const char *label, Adjustment_t *clip, Adjustment_t *cut, int x, int y, int width, int height)
 add_playhead - add a playhead to a Widget_t connect to func.value_changed_callback to implement your actions More...
 

Function Documentation

◆ add_playhead()

Widget_t* add_playhead ( Widget_t parent,
const char *  label,
Adjustment_t clip,
Adjustment_t cut,
int  x,
int  y,
int  width,
int  height 
)

add_playhead - add a playhead to a Widget_t connect to func.value_changed_callback to implement your actions

Parameters
*parent- pointer to the Widget_t request the vumeter
*label- Label to show on the vumeter
x,y,width,height- the position/geometry to create the vumeter
Returns
Widget_t* - pointer to the Widget_t meter struct

Definition at line 32 of file xplayhead.c.

33  {
34 
35  Widget_t *wid = create_widget(parent->app, parent, x, y, width, height);
36  _create_playhead_image(wid, width, height);
37  wid->flags |= HAS_MEM;
38  wid->label = label;
39  wid->adj = add_adjustment(wid,0.0, 0.0, 0.0, 1000.0,1.0, CL_METER);
40  wid->adj_x = clip;
41  wid->adj_y = cut;
42  wid->scale.gravity = ASPECT;
45  return wid;
46 }

References _create_playhead_image(), _draw_playhead(), add_adjustment(), Widget_t::adj, Widget_t::adj_x, Widget_t::adj_y, Widget_t::app, ASPECT, CL_METER, create_widget(), Func_t::expose_callback, Widget_t::flags, Widget_t::func, Resize_t::gravity, HAS_MEM, Widget_t::label, Func_t::mem_free_callback, playhead_mem_free(), and Widget_t::scale.

◆ playhead_mem_free()

void playhead_mem_free ( void *  w_,
void *  user_data 
)

Definition at line 25 of file xplayhead.c.

25  {
26  Widget_t *wid = (Widget_t*)w_;
27  wid->adj_x = NULL;
28  wid->adj_y = NULL;
29 }

References Widget_t::adj_x, and Widget_t::adj_y.

_create_playhead_image
void _create_playhead_image(Widget_t *w, int width, int height)
_create_playhead_image - internal draw the playhead image to the cairo image surface
Definition: xplayhead_private.c:25
Resize_t::gravity
Gravity gravity
Definition: xwidget.h:192
create_widget
Widget_t * create_widget(Xputty *app, Widget_t *win, int x, int y, int width, int height)
*create_widget - create a widget A Widget_t could only be created as child of a other Widget_t To...
Definition: xwidget.c:268
Func_t::expose_callback
xevfunc expose_callback
Definition: xwidget.h:80
playhead_mem_free
void playhead_mem_free(void *w_, void *user_data)
Definition: xplayhead.c:25
Widget_t::flags
long long flags
Definition: xwidget.h:324
_draw_playhead
void _draw_playhead(void *w_, void *user_data)
_draw_playhead - internal draw the playhead to the buffer
Definition: xplayhead_private.c:59
Widget_t::adj
Adjustment_t * adj
Definition: xwidget.h:334
Widget_t::scale
Resize_t scale
Definition: xwidget.h:356
HAS_MEM
@ HAS_MEM
Definition: xwidget.h:251
Widget_t::app
Xputty * app
Definition: xwidget.h:300
Widget_t
Widget_t - struct to hold the basic Widget_t info.
Definition: xwidget.h:298
ASPECT
@ ASPECT
Definition: xwidget.h:167
Func_t::mem_free_callback
xevfunc mem_free_callback
Definition: xwidget.h:87
CL_METER
@ CL_METER
Definition: xadjustment.h:59
Widget_t::adj_y
Adjustment_t * adj_y
Definition: xwidget.h:332
Widget_t::func
Func_t func
Definition: xwidget.h:310
add_adjustment
Adjustment_t * add_adjustment(Widget_t *w, float std_value, float value, float min_value, float max_value, float step, CL_type type)
*add_adjustment - adding a adjustment to a Widget_t
Definition: xadjustment.c:25
Widget_t::label
const char * label
Definition: xwidget.h:326
Widget_t::adj_x
Adjustment_t * adj_x
Definition: xwidget.h:330