-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparams.h
More file actions
89 lines (80 loc) · 2.45 KB
/
Copy pathparams.h
File metadata and controls
89 lines (80 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* This file is part of the libopeninv project.
*
* Copyright (C) 2011 Johannes Huebner <dev@johanneshuebner.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PARAM_H_INCLUDED
#define PARAM_H_INCLUDED
#include "param_prj.h"
#include "my_fp.h"
namespace Param
{
#define PARAM_ENTRY(category, name, unit, min, max, def, id) name,
#define TESTP_ENTRY(category, name, unit, min, max, def, id) name,
#define VALUE_ENTRY(name, unit, id) name,
typedef enum
{
PARAM_LIST
PARAM_LAST,
PARAM_INVALID
} PARAM_NUM;
#undef PARAM_ENTRY
#undef TESTP_ENTRY
#undef VALUE_ENTRY
typedef enum
{
FLAG_NONE = 0,
FLAG_HIDDEN = 1
} PARAM_FLAG;
typedef enum
{
TYPE_PARAM,
TYPE_TESTPARAM,
TYPE_SPOTVALUE,
} PARAM_TYPE;
typedef struct
{
char const *category;
char const *name;
char const *unit;
float min;
float max;
float def;
uint16_t id;
uint16_t type;
} Attributes;
int Set(PARAM_NUM ParamNum, s32fp ParamVal);
s32fp Get(PARAM_NUM ParamNum);
int GetInt(PARAM_NUM ParamNum);
float GetFloat(PARAM_NUM ParamNum);
bool GetBool(PARAM_NUM ParamNum);
void SetInt(PARAM_NUM ParamNum, int ParamVal);
void SetFixed(PARAM_NUM ParamNum, s32fp ParamVal);
void SetFloat(PARAM_NUM ParamNum, float ParamVal);
PARAM_NUM NumFromString(const char *name);
PARAM_NUM NumFromId(uint32_t id);
const Attributes *GetAttrib(PARAM_NUM ParamNum);
void LoadDefaults();
void SetFlagsRaw(PARAM_NUM param, uint8_t rawFlags);
void SetFlag(PARAM_NUM param, PARAM_FLAG flag);
void ClearFlag(PARAM_NUM param, PARAM_FLAG flag);
PARAM_FLAG GetFlag(PARAM_NUM param);
PARAM_TYPE GetType(PARAM_NUM param);
uint32_t GetIdSum();
//User defined callback
void Change(Param::PARAM_NUM ParamNum);
}
#endif //PARAM_H_INCLUDED