You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @brief Structure containing the values of a single expression variable.
58
+
*
59
+
* This struct is used to return the values of a single, monitored expression variable. Depending
60
+
* on how often a certain code block is being executed, this struct will contain one or more values.
61
+
* For example, per_frame variables will only have one entry, while variables in custom waveform
62
+
* per_point expressions will have as many entries as there were points rendered in the last frame.
63
+
*
64
+
* For user sprites, @a index is the sprite slot returned by @a projectm_sprite_create().
65
+
*
66
+
* If a code block wasn't executed at all, e.g. if a preset doesn't use a certain effect, the count
67
+
* will be zero and the values array a NULL pointer.
68
+
*
69
+
* The application must not change the contents of the returned structure, as it is considered
70
+
* read-only.
71
+
*
72
+
* @note There is no last NULL element in the values array. Use value_count to iterate over the
73
+
* correct number of values!
74
+
* @since 4.2.0
75
+
*/
76
+
structprojectm_expression_variable_values {
77
+
uint32_tvalue_count; //!< The number of entries in @a values.
78
+
uint32_tindex; //!< The custom shape/waveform or user sprite index. 0 for any other block.
79
+
double**values; //!< An array of double pointers, containing the values of the expression values as they were set to at the end of the last rendered frame.
80
+
};
81
+
82
+
/**
83
+
* @brief Available expression blocks for watches.
84
+
*
85
+
* Currently, the five code blocks executed per frame are available for watching, plus the Milkdrop
86
+
* user sprite per_frame code.
87
+
*
88
+
* Init blocks cannot be watched, as they are only executed once whenever a preset is loaded, and use
89
+
* the same variables as their respective per_frame counterparts.
90
+
*
91
+
* @since 4.2.0
92
+
*/
93
+
typedefenum
94
+
{
95
+
PROJECTM_EXPR_PER_FRAME, //!< Variables in the "per_frame_" code block
96
+
PROJECTM_EXPR_PER_POINT, //!< Variables in the "per_point_" (AKA per vertex) code block
97
+
PROJECTM_EXPR_SHAPE_PER_FRAME, //!< Variables in
98
+
PROJECTM_EXPR_WAVE_PER_FRAME,
99
+
PROJECTM_EXPR_WAVE_PER_POINT,
100
+
PROJECTM_EXPR_MILKDROP_SPRITE
101
+
} projectm_expression_blocks;
102
+
103
+
/**
104
+
* @brief Adds a new variable watch and returns a pointer to the data holder structure.
105
+
*
106
+
* This function will add a new watch for a single variable in the specified code block. If the code
107
+
* block was valid, a pointer to a @a projectm_expression_variable_values will be returned. This
108
+
* pointer will stay valid until this specific or all watches are removed, or the watched projectM
109
+
* instance is being destroyed.
110
+
*
111
+
* Only the "active" preset is being watched. During a transition, the newly loaded preset is not
112
+
* the active one - it will become active once the transition is finished and the previous preset
113
+
* was unloaded. Hard cuts will change the active preset immediately.
114
+
*
115
+
* Variables which are not used/defined by a preset will always return 0.0. The value count will
116
+
* still match the number of block invocations.
117
+
*
118
+
* User sprites will be watched based on their slot index, as returned by @a projectm_sprite_create().
119
+
*
120
+
* Adding watches only have a very small performance impact, with most of the work being done on
121
+
* preset load. During runtime, the overhead basically consists of copying the watched double values
122
+
* from the expression context into the watch structure.
123
+
*
124
+
* @note The returned structure is owned by projectM. Do not free the structure externally!
125
+
* @param instance The projectM instance handle.
126
+
* @param block The code block to add the watch for.
127
+
* @param index The custom shape/waveform or user sprite index. Ignored for other block types.
128
+
* @param variable_name The name of the variable to watch.
129
+
* @return A pointer to a @a projectm_expression_variable_values structure which will contain the
130
+
* variable data, or NULL if the watch could not be added.
0 commit comments