Changeset 67
- Timestamp:
- 02/14/05 00:37:51 (19 years ago)
- Files:
-
- trunk/libfreebobctl/configure.in (modified) (2 diffs)
- trunk/libfreebobctl/examples/Makefile.am (modified) (1 diff)
- trunk/libfreebobctl/examples/quatafire610.xml (added)
- trunk/libfreebobctl/examples/test-freebobctl.c (added)
- trunk/libfreebobctl/freebobctl.pc.in (deleted)
- trunk/libfreebobctl/freebobctl/freebobctl.h (modified) (5 diffs)
- trunk/libfreebobctl/freebobctl/xmlparser.h (added)
- trunk/libfreebobctl/libfreebobctl.pc.in (added)
- trunk/libfreebobctl/Makefile.am (modified) (1 diff)
- trunk/libfreebobctl/src/freebobctl.c (modified) (1 diff)
- trunk/libfreebobctl/src/Makefile.am (modified) (1 diff)
- trunk/libfreebobctl/src/xmlparser.c (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libfreebobctl/configure.in
r61 r67 23 23 AC_CHECK_LIB(pthread, pthread_create) 24 24 25 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.6.0) 26 AC_SUBST([LIBXML_LIBS]) 27 AC_SUBST([LIBXML_CFLAGS]) 28 25 29 AC_ENABLE_STATIC(no) 26 30 AC_ENABLE_SHARED(yes) … … 30 34 AC_SUBST(ac_doxygen) 31 35 32 AC_OUTPUT(Makefile src/Makefile freebobctl/Makefile examples/Makefile doc/Makefile freebobctl/version.h doc/libfreebobctl.doxygen freebobctl.pc libfreebobctl.spec)36 AC_OUTPUT(Makefile src/Makefile freebobctl/Makefile examples/Makefile doc/Makefile freebobctl/version.h doc/libfreebobctl.doxygen libfreebobctl.pc libfreebobctl.spec) 33 37 trunk/libfreebobctl/examples/Makefile.am
r61 r67 1 AM_CFLAGS = -Wall -I@top_srcdir@ $(LIBXML_CFLAGS) 1 2 2 AM_CFLAGS = -Wall -I@top_srcdir@ 3 noinst_PROGRAMS = test-freebobctl 4 noinst_HEADERS = 3 5 4 noinst_PROGRAMS = 5 noinst_HEADERS = 6 test_freebobctl_SOURCES = test-freebobctl.c 7 test_freebobctl_LDADD = @top_srcdir@/src/libfreebobctl.la $(LIBXML_LIBS) 6 8 7 9 #example_client_SOURCES = example_client.c trunk/libfreebobctl/freebobctl/freebobctl.h
r66 r67 28 28 #ifndef __FREEBOBCTL_FREEBOBCTL_H 29 29 #define __FREEBOBCTL_FREEBOBCTL_H 30 30 31 32 33 #define FREEBOBCTL_MAX_NAME_LEN 256 31 34 /* 32 35 * Buffer specification … … 34 37 35 38 typedef struct _freebob_stream_spec freebob_stream_spec_t; 39 typedef struct _freebob_stream_info freebob_stream_info_t; 36 40 typedef struct _freebob_connection_spec freebob_connection_spec_t; 37 41 typedef struct _freebob_connection_info freebob_connection_info_t; … … 46 50 int type; 47 51 int destination_port; 48 char name[ IEC61883_MAX_NAME_LEN];52 char name[FREEBOBCTL_MAX_NAME_LEN]; 49 53 }; 50 54 55 struct _freebob_stream_info { 56 int nb_streams; 57 freebob_stream_spec_t **streams; 58 }; 51 59 /* 52 60 * Connection specification … … 59 67 60 68 int dimension; // due to the midi stuff, the dimension isn't equal to the number of streams 61 int nb_streams;62 69 63 70 int samplerate; // this should be equal for all connections when using jack. maybe not when using other api's 64 71 65 freebob_stream_ spec_t *streams;72 freebob_stream_info_t *stream_info; 66 73 }; 67 74 … … 71 78 72 79 struct _freebob_connection_info { 80 int direction; 73 81 int nb_connections; 74 freebob_connection_spec_t * connections;82 freebob_connection_spec_t **connections; 75 83 }; 76 84 77 85 78 freebob_connection_spec_t *freebob_get_connections(enum freebob_connection_direction); 79 void freebob_free_connections(freebob_connection_spec_t *); 86 freebob_connection_info_t *freebobctl_get_connection_info(int direction); 87 88 void freebobctl_free_connection_info(freebob_connection_info_t *); 89 void freebobctl_free_connection_spec(freebob_connection_spec_t *connection_spec); 90 void freebobctl_free_stream_info(freebob_stream_info_t *stream_info); 91 void freebobctl_free_stream_spec(freebob_stream_spec_t *stream_spec); 92 93 void freebobctl_print_connection_info(freebob_connection_info_t *connection_info); 94 95 const char * freebobctl_get_version(); 80 96 81 97 #endif // __FREEBOBCTL_FREEBOBCTL_H trunk/libfreebobctl/Makefile.am
r61 r67 2 2 3 3 pkgconfigdir = $(libdir)/pkgconfig 4 pkgconfig_DATA = freebobctl.pc4 pkgconfig_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 37 const char * freebobctl_get_version() { 38 return FREEBOBCTL_VERSION" (Build "__DATE__" - "__TIME__")"; 39 } 40 41 42 freebob_connection_info_t *freebobctl_get_connection_info(int direction) { 43 44 45 return NULL; 46 } 47 48 void 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 63 void 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 74 void 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 87 void 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 96 void 97 freebobctl_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 1 1 2 AM_CFLAGS = -Wall -I@top_srcdir@ 2 AM_CFLAGS = -Wall -I@top_srcdir@ $(LIBXML_CFLAGS) 3 3 4 4 lib_LTLIBRARIES = libfreebobctl.la 5 5 6 libfreebobctl_la_SOURCES = client.c freebobctl.c 7 libfreebobctl_la_LIBADD = -lpthread 6 libfreebobctl_la_SOURCES = client.c freebobctl.c xmlparser.c 7 libfreebobctl_la_LIBADD = -lpthread $(LIBXML_LIBS) 8 8 9 9 noinst_HEADERS =