mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-19 22:30:06 +01:00
renamed functions, changed livido header file to pass function pointers to livido_setup_f
git-svn-id: svn://code.dyne.org/veejay/trunk@483 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
@@ -3,8 +3,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <include/vevo.h>
|
||||
#include <include/livido.h>
|
||||
#include <include/libvevo.h>
|
||||
|
||||
static struct {
|
||||
int32_t iv;
|
||||
@@ -45,13 +44,13 @@ static int fundemental_index = 0;
|
||||
|
||||
int test_fundemental_atoms(livido_port_t * port)
|
||||
{
|
||||
livido_property_set(port, "int_value", LIVIDO_ATOM_TYPE_INT, 1,
|
||||
vevo_property_set(port, "int_value", LIVIDO_ATOM_TYPE_INT, 1,
|
||||
&(fundementals[fundemental_index].iv));
|
||||
livido_property_set(port, "double_value", LIVIDO_ATOM_TYPE_DOUBLE, 1,
|
||||
vevo_property_set(port, "double_value", LIVIDO_ATOM_TYPE_DOUBLE, 1,
|
||||
&(fundementals[fundemental_index].dv));
|
||||
livido_property_set(port, "string_value", LIVIDO_ATOM_TYPE_STRING, 1,
|
||||
vevo_property_set(port, "string_value", LIVIDO_ATOM_TYPE_STRING, 1,
|
||||
&(fundementals[fundemental_index].sv));
|
||||
livido_property_set(port, "bool_value", LIVIDO_ATOM_TYPE_BOOLEAN, 1,
|
||||
vevo_property_set(port, "bool_value", LIVIDO_ATOM_TYPE_BOOLEAN, 1,
|
||||
&(fundementals[fundemental_index].bv));
|
||||
fundemental_index++;
|
||||
|
||||
@@ -60,54 +59,54 @@ int test_fundemental_atoms(livido_port_t * port)
|
||||
|
||||
void test_arrays(livido_port_t * port)
|
||||
{
|
||||
livido_property_set(port, "int_values", LIVIDO_ATOM_TYPE_INT, 4,
|
||||
vevo_property_set(port, "int_values", LIVIDO_ATOM_TYPE_INT, 4,
|
||||
&(arrays[array_index].iv));
|
||||
livido_property_set(port, "double_values", LIVIDO_ATOM_TYPE_DOUBLE, 4,
|
||||
vevo_property_set(port, "double_values", LIVIDO_ATOM_TYPE_DOUBLE, 4,
|
||||
&(arrays[array_index].dv));
|
||||
livido_property_set(port, "string_values", LIVIDO_ATOM_TYPE_STRING, 4,
|
||||
vevo_property_set(port, "string_values", LIVIDO_ATOM_TYPE_STRING, 4,
|
||||
&(arrays[array_index].sv));
|
||||
livido_property_set(port, "bool_values", LIVIDO_ATOM_TYPE_BOOLEAN, 4,
|
||||
vevo_property_set(port, "bool_values", LIVIDO_ATOM_TYPE_BOOLEAN, 4,
|
||||
&(arrays[array_index].bv));
|
||||
array_index++;
|
||||
}
|
||||
|
||||
void test_store_empty_atoms(livido_port_t * port)
|
||||
{
|
||||
livido_property_set(port, "empty_double", LIVIDO_ATOM_TYPE_DOUBLE, 0 , NULL );
|
||||
vevo_property_set(port, "empty_double", LIVIDO_ATOM_TYPE_DOUBLE, 0 , NULL );
|
||||
|
||||
livido_property_set(port, "empty_string", LIVIDO_ATOM_TYPE_STRING,0, NULL );
|
||||
vevo_property_set(port, "empty_string", LIVIDO_ATOM_TYPE_STRING,0, NULL );
|
||||
|
||||
livido_property_set(port, "empty_bool", LIVIDO_ATOM_TYPE_BOOLEAN, 0, NULL );
|
||||
vevo_property_set(port, "empty_bool", LIVIDO_ATOM_TYPE_BOOLEAN, 0, NULL );
|
||||
|
||||
livido_property_set(port, "empty_int", LIVIDO_ATOM_TYPE_INT,0, NULL );
|
||||
vevo_property_set(port, "empty_int", LIVIDO_ATOM_TYPE_INT,0, NULL );
|
||||
|
||||
livido_property_set(port, "empty_array", LIVIDO_ATOM_TYPE_PORTPTR,0,NULL);
|
||||
vevo_property_set(port, "empty_array", LIVIDO_ATOM_TYPE_PORTPTR,0,NULL);
|
||||
|
||||
}
|
||||
|
||||
void dump_empty_atoms(livido_port_t * port)
|
||||
{
|
||||
if (livido_property_get(port, "ghost", 0, NULL) == LIVIDO_NO_ERROR) {
|
||||
if (vevo_property_get(port, "ghost", 0, NULL) == LIVIDO_NO_ERROR) {
|
||||
printf("\tEmpty property 'ghost' exists\n");
|
||||
}
|
||||
if( livido_property_get(port , "empty_string", 0,NULL ) == LIVIDO_NO_ERROR )
|
||||
if( vevo_property_get(port , "empty_string", 0,NULL ) == LIVIDO_NO_ERROR )
|
||||
printf("\tProperty '%s' exists\n", "empty_string" );
|
||||
|
||||
if( livido_property_get(port , "empty_bool", 0,NULL ) == LIVIDO_NO_ERROR )
|
||||
if( vevo_property_get(port , "empty_bool", 0,NULL ) == LIVIDO_NO_ERROR )
|
||||
printf("\tProperty '%s' exists\n", "empty_bool" );
|
||||
|
||||
if( livido_property_get(port , "empty_int", 0,NULL ) == LIVIDO_NO_ERROR )
|
||||
if( vevo_property_get(port , "empty_int", 0,NULL ) == LIVIDO_NO_ERROR )
|
||||
printf("\tProperty '%s' exists\n", "empty_int" );
|
||||
|
||||
if( livido_property_get(port , "empty_double", 0,NULL ) == LIVIDO_NO_ERROR )
|
||||
if( vevo_property_get(port , "empty_double", 0,NULL ) == LIVIDO_NO_ERROR )
|
||||
printf("\tProperty '%s' exists\n", "empty_double" );
|
||||
|
||||
int i;
|
||||
for(i =0; i < 4; i ++ )
|
||||
{
|
||||
if( livido_property_get(port , "empty_array", 0,NULL ) == LIVIDO_NO_ERROR )
|
||||
if( vevo_property_get(port , "empty_array", 0,NULL ) == LIVIDO_NO_ERROR )
|
||||
printf("\tProperty '%s' exists , element %d has size %d\n", "empty_array",
|
||||
i, livido_property_element_size( port, "empty_array", 0) );
|
||||
i, vevo_property_element_size( port, "empty_array", 0) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -125,21 +124,21 @@ void dump_arrays(livido_port_t * port)
|
||||
/* allocate space for string list */
|
||||
int j;
|
||||
for (j = 0; j < 4; j++) {
|
||||
livido_property_get(port, "int_values", j, &int_value);
|
||||
vevo_property_get(port, "int_values", j, &int_value);
|
||||
printf("\tElement %d of int_values has value %d\n", j, int_value);
|
||||
|
||||
livido_property_get(port, "double_values", j, &double_value);
|
||||
vevo_property_get(port, "double_values", j, &double_value);
|
||||
printf("\tElement %d of double_values has value %g\n", j,
|
||||
double_value);
|
||||
|
||||
int ssize = livido_property_element_size(port, "string_values", j);
|
||||
int ssize = vevo_property_element_size(port, "string_values", j);
|
||||
string_value = (char *) malloc(sizeof(char) * ssize);
|
||||
livido_property_get(port, "string_values", j, &string_value);
|
||||
vevo_property_get(port, "string_values", j, &string_value);
|
||||
printf("\tElement %d of string_values has value '%s'\n", j,
|
||||
string_value);
|
||||
free(string_value);
|
||||
|
||||
livido_property_get(port, "bool_values", j, &bool_value);
|
||||
vevo_property_get(port, "bool_values", j, &bool_value);
|
||||
printf("\tElement %d of bool_values has value %d\n", j,
|
||||
bool_value);
|
||||
}
|
||||
@@ -149,15 +148,15 @@ void dump_port(livido_port_t * port)
|
||||
int32_t int_value = 0;
|
||||
double double_value = 0.0;
|
||||
int32_t bool_value = FALSE;
|
||||
livido_property_get(port, "int_value", 0, &int_value);
|
||||
livido_property_get(port, "double_value", 0, &double_value);
|
||||
vevo_property_get(port, "int_value", 0, &int_value);
|
||||
vevo_property_get(port, "double_value", 0, &double_value);
|
||||
|
||||
char *string_value =
|
||||
(char *)
|
||||
malloc(livido_property_element_size(port, "string_value", 0));
|
||||
livido_property_get(port, "string_value", 0, &string_value);
|
||||
malloc(vevo_property_element_size(port, "string_value", 0));
|
||||
vevo_property_get(port, "string_value", 0, &string_value);
|
||||
|
||||
livido_property_get(port, "bool_value", 0, &bool_value);
|
||||
vevo_property_get(port, "bool_value", 0, &bool_value);
|
||||
|
||||
printf("\tProperty int_value has value %d\n", int_value);
|
||||
printf("\tProperty double_value has value %g\n", double_value);
|
||||
@@ -172,12 +171,12 @@ void dump_ptr_port(livido_port_t * port)
|
||||
int i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
uint8_t *plane;
|
||||
livido_property_get(port, "pixeldata", i, &plane);
|
||||
vevo_property_get(port, "pixeldata", i, &plane);
|
||||
printf("\tProperty pixeldata by index %d = %p\n", i, plane);
|
||||
}
|
||||
for (i = 0; i < 4; i++) {
|
||||
void *p = NULL;
|
||||
livido_property_get(port, "ports", i, &p);
|
||||
vevo_property_get(port, "ports", i, &p);
|
||||
printf("\tProperty ports by index %d = %p\n", i, p);
|
||||
}
|
||||
}
|
||||
@@ -185,7 +184,7 @@ void dump_ptr_port(livido_port_t * port)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
void *port = livido_port_new(0);
|
||||
void *port = vevo_port_new(0);
|
||||
printf("Testing fundementals\n");
|
||||
while (fundementals[fundemental_index].sv != NULL) {
|
||||
test_fundemental_atoms(port);
|
||||
@@ -206,9 +205,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
printf("\tport__data %p, %p, %p, %p\n", (void *) port, (void *) port,
|
||||
(void *) port, (void *) port);
|
||||
livido_property_set(port, "pixeldata", LIVIDO_ATOM_TYPE_VOIDPTR, 4,
|
||||
vevo_property_set(port, "pixeldata", LIVIDO_ATOM_TYPE_VOIDPTR, 4,
|
||||
&pixel_data);
|
||||
livido_property_set(port, "ports", LIVIDO_ATOM_TYPE_PORTPTR, 4,
|
||||
vevo_property_set(port, "ports", LIVIDO_ATOM_TYPE_PORTPTR, 4,
|
||||
&ports);
|
||||
dump_ptr_port(port);
|
||||
|
||||
@@ -226,9 +225,9 @@ int main(int argc, char *argv[])
|
||||
printf("Freeing port %p\n", port);
|
||||
printf("Dumping properties in port %p\n", port);
|
||||
|
||||
char **list = livido_list_properties(port);
|
||||
char **list = vevo_list_properties(port);
|
||||
|
||||
livido_port_free(port);
|
||||
vevo_port_free(port);
|
||||
|
||||
for (i = 0; list[i] != NULL; i++) {
|
||||
printf("\tproperty %s\n", list[i]);
|
||||
|
||||
Reference in New Issue
Block a user