JACK-AUDIO-CONNECTION-KIT  0.124.1
metadata.h
Go to the documentation of this file.
00001 /*
00002   Copyright (C) 2011 David Robillard
00003   Copyright (C) 2013 Paul Davis
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of the GNU Lesser General Public License as published by
00007   the Free Software Foundation; either version 2.1 of the License, or (at
00008   your option) any later version.
00009 
00010   This program is distributed in the hope that it will be useful, but WITHOUT
00011   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00013   License for more details.
00014 
00015   You should have received a copy of the GNU Lesser General Public License
00016   along with this program; if not, write to the Free Software Foundation,
00017   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */
00019 
00027 #ifndef __jack_metadata_h__
00028 #define __jack_metadata_h__
00029 
00030 #include <jack/types.h>
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035 
00044 typedef struct {
00046     const char* key;
00047 
00049     const char* data;
00050 
00068     const char* type;
00069 } jack_property_t;
00070 
00082 int
00083 jack_set_property(jack_client_t*,
00084                   jack_uuid_t subject,
00085                   const char* key,
00086                   const char* value,
00087                   const char* type);
00088 
00102 int
00103 jack_get_property(jack_uuid_t subject,
00104                   const char* key,
00105                   char**      value,
00106                   char**      type);
00107 
00111 typedef struct {
00112     jack_uuid_t      subject;        
00113     uint32_t         property_cnt;   
00114     jack_property_t* properties;     
00115     uint32_t         property_size;  
00116 } jack_description_t;
00117 
00124 void
00125 jack_free_description (jack_description_t* desc, int free_description_itself);
00126 
00134 int
00135 jack_get_properties (jack_uuid_t         subject,
00136                      jack_description_t* desc);
00137 
00145 int
00146 jack_get_all_properties (jack_description_t** descs);
00147 
00157 int jack_remove_property (jack_client_t* client, jack_uuid_t subject, const char* key);
00158 
00167 int jack_remove_properties (jack_client_t* client, jack_uuid_t subject);
00168 
00180 int jack_remove_all_properties (jack_client_t* client);
00181 
00182 typedef enum {
00183         PropertyCreated,
00184         PropertyChanged,
00185         PropertyDeleted
00186 } jack_property_change_t;
00187 
00188 typedef void (*JackPropertyChangeCallback)(jack_uuid_t            subject,
00189                                            const char*            key,
00190                                            jack_property_change_t change,
00191                                            void*                  arg);
00192 
00203 int jack_set_property_change_callback (jack_client_t*             client,
00204                                        JackPropertyChangeCallback callback,
00205                                        void*                      arg);
00206 
00207 #ifdef __cplusplus
00208 } /* namespace */
00209 #endif
00210 
00215 extern const char* JACK_METADATA_PRETTY_NAME;
00216 extern const char* JACK_METADATA_HARDWARE;
00217 extern const char* JACK_METADATA_CONNECTED;
00218 extern const char* JACK_METADATA_PORT_GROUP;
00219 extern const char* JACK_METADATA_ICON_SMALL;
00220 extern const char* JACK_METADATA_ICON_LARGE;
00221 
00222 #endif  /* __jack_metadata_h__ */
00223