libxputty  0.1
A damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces
xmeter.h
Go to the documentation of this file.
1 /*
2  * 0BSD
3  *
4  * BSD Zero Clause License
5  *
6  * Copyright (c) 2019 Hermann Meyer
7  *
8  * Permission to use, copy, modify, and/or distribute this software for any
9  * purpose with or without fee is hereby granted.
10 
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13  * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  *
19  */
20 
21 #pragma once
22 
23 #ifndef XMETER_H_
24 #define XMETER_H_
25 
26 #include "xputty.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 
33 /**
34  * @brief power2db - power (db) input to db output consider falloff
35  * @param power - mesured power
36  * @return float - calculated db
37  */
38 
39 float power2db(Widget_t *w, float power);
40 
41 /**
42  * @brief add_vmeter - add a vumeter to a Widget_t
43  * connect to func.value_changed_callback to implement your actions
44  * @param *parent - pointer to the Widget_t request the vumeter
45  * @param *label - Label to show on the vumeter
46  * @param x,y,width,height - the position/geometry to create the vumeter
47  * @return Widget_t* - pointer to the Widget_t mete struct
48  */
49 
50 Widget_t* add_vmeter(Widget_t *parent, const char * label, bool show_scale,
51  int x, int y, int width, int height);
52 
53 /**
54  * @brief add_hmeter - add a vumeter to a Widget_t
55  * connect to func.value_changed_callback to implement your actions
56  * @param *parent - pointer to the Widget_t request the vumeter
57  * @param *label - Label to show on the vumeter
58  * @param x,y,width,height - the position/geometry to create the vumeter
59  * @return Widget_t* - pointer to the Widget_t meter struct
60  */
61 
62 Widget_t* add_hmeter(Widget_t *parent, const char * label, bool show_scale,
63  int x, int y, int width, int height);
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif //XMETER_H_
xputty.h
add_vmeter
Widget_t * add_vmeter(Widget_t *parent, const char *label, bool show_scale, int x, int y, int width, int height)
add_vmeter - add a vumeter to a Widget_t connect to func.value_changed_callback to implement your act...
Definition: xmeter.c:47
Widget_t
Widget_t - struct to hold the basic Widget_t info.
Definition: xwidget.h:298
power2db
float power2db(Widget_t *w, float power)
power2db - power (db) input to db output consider falloff
Definition: xmeter.c:26
add_hmeter
Widget_t * add_hmeter(Widget_t *parent, const char *label, bool show_scale, int x, int y, int width, int height)
add_hmeter - add a vumeter to a Widget_t connect to func.value_changed_callback to implement your act...
Definition: xmeter.c:66