Changeset 67

Show
Ignore:
Timestamp:
02/14/05 00:37:51 (19 years ago)
Author:
pieterpalmers
Message:

- XML based loading of files
- Not ready yet, don't kow if it even compiles.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libfreebobctl/configure.in

    r61 r67  
    2323AC_CHECK_LIB(pthread, pthread_create) 
    2424 
     25PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.6.0) 
     26AC_SUBST([LIBXML_LIBS]) 
     27AC_SUBST([LIBXML_CFLAGS]) 
     28 
    2529AC_ENABLE_STATIC(no) 
    2630AC_ENABLE_SHARED(yes) 
     
    3034AC_SUBST(ac_doxygen) 
    3135 
    32 AC_OUTPUT(Makefile src/Makefile freebobctl/Makefile examples/Makefile doc/Makefile freebobctl/version.h doc/libfreebobctl.doxygen freebobctl.pc libfreebobctl.spec) 
     36AC_OUTPUT(Makefile src/Makefile freebobctl/Makefile examples/Makefile doc/Makefile freebobctl/version.h doc/libfreebobctl.doxygen libfreebobctl.pc libfreebobctl.spec) 
    3337 
  • trunk/libfreebobctl/examples/Makefile.am

    r61 r67  
     1AM_CFLAGS = -Wall -I@top_srcdir@ $(LIBXML_CFLAGS) 
    12 
    2 AM_CFLAGS = -Wall -I@top_srcdir@ 
     3noinst_PROGRAMS = test-freebobctl 
     4noinst_HEADERS =  
    35 
    4 noinst_PROGRAMS =  
    5 noinst_HEADERS =  
     6test_freebobctl_SOURCES = test-freebobctl.c 
     7test_freebobctl_LDADD   = @top_srcdir@/src/libfreebobctl.la $(LIBXML_LIBS) 
    68 
    79#example_client_SOURCES = example_client.c 
  • trunk/libfreebobctl/freebobctl/freebobctl.h

    r66 r67  
    2828#ifndef __FREEBOBCTL_FREEBOBCTL_H 
    2929#define __FREEBOBCTL_FREEBOBCTL_H 
    30   
     30 
     31 
     32 
     33#define FREEBOBCTL_MAX_NAME_LEN 256 
    3134/* 
    3235 * Buffer specification 
     
    3437 
    3538typedef struct _freebob_stream_spec freebob_stream_spec_t; 
     39typedef struct _freebob_stream_info freebob_stream_info_t; 
    3640typedef struct _freebob_connection_spec freebob_connection_spec_t; 
    3741typedef struct _freebob_connection_info freebob_connection_info_t; 
     
    4650        int type; 
    4751        int destination_port; 
    48         char name[IEC61883_MAX_NAME_LEN]; 
     52        char name[FREEBOBCTL_MAX_NAME_LEN]; 
    4953}; 
    5054 
     55struct _freebob_stream_info { 
     56        int nb_streams; 
     57        freebob_stream_spec_t **streams; 
     58}; 
    5159/*  
    5260 * Connection specification 
     
    5967         
    6068        int dimension; // due to the midi stuff, the dimension isn't equal to the number of streams 
    61         int nb_streams; 
    6269         
    6370        int samplerate; // this should be equal for all connections when using jack. maybe not when using other api's 
    6471         
    65         freebob_stream_spec_t *streams;         
     72        freebob_stream_info_t *stream_info; 
    6673}; 
    6774 
     
    7178 
    7279struct _freebob_connection_info { 
     80        int direction; 
    7381        int nb_connections; 
    74         freebob_connection_spec_t *connections; 
     82        freebob_connection_spec_t **connections; 
    7583}; 
    7684 
    7785 
    78 freebob_connection_spec_t *freebob_get_connections(enum freebob_connection_direction); 
    79 void freebob_free_connections(freebob_connection_spec_t *); 
     86freebob_connection_info_t *freebobctl_get_connection_info(int direction); 
     87 
     88void freebobctl_free_connection_info(freebob_connection_info_t *); 
     89void freebobctl_free_connection_spec(freebob_connection_spec_t *connection_spec); 
     90void freebobctl_free_stream_info(freebob_stream_info_t *stream_info); 
     91void freebobctl_free_stream_spec(freebob_stream_spec_t *stream_spec); 
     92 
     93void freebobctl_print_connection_info(freebob_connection_info_t *connection_info); 
     94 
     95const char * freebobctl_get_version(); 
    8096 
    8197#endif // __FREEBOBCTL_FREEBOBCTL_H 
  • trunk/libfreebobctl/Makefile.am

    r61 r67  
    22 
    33pkgconfigdir = $(libdir)/pkgconfig 
    4 pkgconfig_DATA = freebobctl.pc 
     4pkgconfig_DATA = libfreebobctl.pc 
  • trunk/libfreebobctl/src/freebobctl.c

    r66 r67  
    1   
     1// freebobctl.c 
     2// 
     3/**************************************************************************** 
     4   libfreebobctl - Freebob Control API 
     5    
     6   Copyright (C) 2005, Pieter Palmers. All rights reserved. 
     7   <pieterpalmers@users.sourceforge.net>    
     8    
     9   Freebob = FireWire Audio for Linux...  
     10   http://freebob.sf.net 
     11    
     12   This library is free software; you can redistribute it and/or 
     13   modify it under the terms of the GNU Lesser General Public 
     14   License as published by the Free Software Foundation; either 
     15   version 2.1 of the License, or (at your option) any later version. 
     16 
     17   This library is distributed in the hope that it will be useful, 
     18   but WITHOUT ANY WARRANTY; without even the implied warranty of 
     19   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
     20   Lesser General Public License for more details. 
     21 
     22   You should have received a copy of the GNU Lesser General Public 
     23   License along with this library; if not, write to the Free Software 
     24   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
     25 
     26*****************************************************************************/ 
     27#include <stdio.h> 
     28#include <stdlib.h> 
     29#include <string.h> 
     30#include <libxml/xmlmemory.h> 
     31#include <libxml/parser.h> 
     32 
     33#include "freebobctl/version.h" 
     34#include "freebobctl/freebobctl.h" 
     35#include "freebobctl/xmlparser.h" 
     36 
     37const char * freebobctl_get_version() { 
     38        return FREEBOBCTL_VERSION" (Build "__DATE__" - "__TIME__")"; 
     39
     40 
     41 
     42freebob_connection_info_t *freebobctl_get_connection_info(int direction) { 
     43 
     44 
     45        return NULL; 
     46
     47 
     48void freebobctl_free_connection_info(freebob_connection_info_t *connection_info) { 
     49        int i; 
     50         
     51        if (!connection_info) { 
     52                return; 
     53        } 
     54         
     55        for (i=0;i<connection_info->nb_connections;i++) { 
     56                freebobctl_free_connection_spec(connection_info->connections[i]); 
     57        } 
     58         
     59        free(connection_info->connections); 
     60        free(connection_info); 
     61
     62 
     63void freebobctl_free_connection_spec(freebob_connection_spec_t *connection_spec) { 
     64         
     65        if (!connection_spec) { 
     66                return; 
     67        } 
     68         
     69        freebobctl_free_stream_info(connection_spec->stream_info); 
     70        free(connection_spec); 
     71}        
     72 
     73 
     74void freebobctl_free_stream_info(freebob_stream_info_t *stream_info) { 
     75        int i; 
     76        if (!stream_info) { 
     77                return; 
     78        } 
     79         
     80        for (i=0;i<stream_info->nb_streams;i++) { 
     81                freebobctl_free_stream_spec(stream_info->streams[i]); 
     82        } 
     83        free(stream_info->streams); 
     84        free(stream_info); 
     85
     86 
     87void freebobctl_free_stream_spec(freebob_stream_spec_t *stream_spec) { 
     88         
     89        if (!stream_spec) { 
     90                return; 
     91        } 
     92         
     93        free(stream_spec); 
     94}        
     95 
     96void 
     97freebobctl_print_connection_info(freebob_connection_info_t *connection_info) { 
     98        int i,j; 
     99        freebob_connection_spec_t * connection_spec; 
     100        freebob_stream_spec_t *stream_spec; 
     101         
     102        if (!connection_info) { 
     103                fprintf(stderr,"connection_info==NULL\n"); 
     104                return; 
     105        } 
     106         
     107        printf("connection_info->direction=%d\n",connection_info->direction); 
     108         
     109        for (i=0;i<connection_info->nb_connections;i++) { 
     110                connection_spec=connection_info->connections[i]; 
     111                if(connection_spec) { 
     112                        printf("connection_info->connections[%d]->id         = %d\n",i,connection_spec->id); 
     113                        printf("connection_info->connections[%d]->port       = %d\n",i,connection_spec->port); 
     114                        printf("connection_info->connections[%d]->node       = %d\n",i,connection_spec->node); 
     115                        printf("connection_info->connections[%d]->plug       = %d\n",i,connection_spec->plug); 
     116                        printf("connection_info->connections[%d]->dimension  = %d\n",i,connection_spec->dimension); 
     117                        printf("connection_info->connections[%d]->samplerate = %d\n",i,connection_spec->samplerate); 
     118                        if (connection_info->connections[i]->stream_info) { 
     119                                printf("connection_info->connections[%d]->stream_info->nb_streams = %d\n",i,connection_spec->stream_info->nb_streams); 
     120                         
     121                                for (j=0;j<connection_spec->stream_info->nb_streams;j++) { 
     122                                        stream_spec=connection_spec->stream_info->streams[j]; 
     123                                        if(stream_spec) { 
     124                                                printf("connection_info->connections[%d]->stream_info->streams[%d] = 0x%02X / 0x%02X / 0x%02X / 0x%02X / %02d / [%s]\n",i,j,stream_spec->position, stream_spec->location,stream_spec->format,stream_spec->type,stream_spec->destination_port,stream_spec->name); 
     125                                                 
     126                                        } 
     127                                } 
     128                        } 
     129                } 
     130                 
     131        } 
     132 
     133        return; 
     134
     135 
     136 
     137 
     138 
     139 
     140// end of freebobctl.c 
  • trunk/libfreebobctl/src/Makefile.am

    r66 r67  
    11 
    2 AM_CFLAGS = -Wall -I@top_srcdir@ 
     2AM_CFLAGS = -Wall -I@top_srcdir@ $(LIBXML_CFLAGS) 
    33 
    44lib_LTLIBRARIES = libfreebobctl.la 
    55 
    6 libfreebobctl_la_SOURCES = client.c freebobctl.c 
    7 libfreebobctl_la_LIBADD  = -lpthread 
     6libfreebobctl_la_SOURCES = client.c freebobctl.c xmlparser.c 
     7libfreebobctl_la_LIBADD  = -lpthread $(LIBXML_LIBS) 
    88 
    99noinst_HEADERS =