Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
fd265bfd
Commit
fd265bfd
authored
Jun 06, 2004
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* variables: helpers: var_Get* .
parent
c861d721
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
0 deletions
+78
-0
include/variables.h
include/variables.h
+78
-0
No files found.
include/variables.h
View file @
fd265bfd
...
...
@@ -326,6 +326,84 @@ static inline int __var_SetVoid( vlc_object_t *p_obj, const char *psz_name )
*/
#define var_SetVoid(a,b) __var_SetVoid( VLC_OBJECT(a),b)
/**
* Get a integer value
*
* \param p_obj The object that holds the variable
* \param psz_name The name of the variable
*/
static
inline
int
__var_GetInteger
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
{
vlc_value_t
val
;
if
(
!
__var_Get
(
p_obj
,
psz_name
,
&
val
)
)
return
val
.
i_int
;
else
return
0
;
}
/**
* Get a time value
*
* \param p_obj The object that holds the variable
* \param psz_name The name of the variable
*/
static
inline
int64_t
__var_GetTime
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
{
vlc_value_t
val
;
if
(
!
__var_Get
(
p_obj
,
psz_name
,
&
val
)
)
return
val
.
i_time
;
else
return
0
;
}
/**
* Get a float value
*
* \param p_obj The object that holds the variable
* \param psz_name The name of the variable
*/
static
inline
float
__var_GetFloat
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
{
vlc_value_t
val
;
if
(
!
__var_Get
(
p_obj
,
psz_name
,
&
val
)
)
return
val
.
f_float
;
else
return
0
.
0
;
}
/**
* Get a string value
*
* \param p_obj The object that holds the variable
* \param psz_name The name of the variable
*/
static
inline
char
*
__var_GetString
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
{
vlc_value_t
val
;
if
(
!
__var_Get
(
p_obj
,
psz_name
,
&
val
)
)
return
val
.
psz_string
;
else
return
strdup
(
""
);
}
/**
* __var_GetInteger() with automatic casting
*/
#define var_GetInteger(a,b) __var_GetInteger( VLC_OBJECT(a),b)
/**
* __var_GetTime() with automatic casting
*/
#define var_GetTime(a,b) __var_GetTime( VLC_OBJECT(a),b)
/**
* __var_GetFloat() with automatic casting
*/
#define var_GetFloat(a,b) __var_GetFloat( VLC_OBJECT(a),b)
/**
* __var_GetString() with automatic casting
*/
#define var_GetString(a,b) __var_GetString( VLC_OBJECT(a),b)
/**
* Create a integer variable with inherit and get its value.
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment