00001 /* 00002 Copyright (C) 2003 Commonwealth Scientific and Industrial Research 00003 Organisation (CSIRO) Australia 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions 00007 are met: 00008 00009 - Redistributions of source code must retain the above copyright 00010 notice, this list of conditions and the following disclaimer. 00011 00012 - Redistributions in binary form must reproduce the above copyright 00013 notice, this list of conditions and the following disclaimer in the 00014 documentation and/or other materials provided with the distribution. 00015 00016 - Neither the name of CSIRO Australia nor the names of its 00017 contributors may be used to endorse or promote products derived from 00018 this software without specific prior written permission. 00019 00020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00021 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00022 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 00023 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR 00024 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00025 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00026 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00027 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00028 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00029 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00030 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00031 */ 00032 00033 #ifndef __OGGZ_COMMENT_H__ 00034 #define __OGGZ_COMMENT_H__ 00035 00086 #include <oggz/oggz.h> 00087 00091 typedef struct { 00093 char * name; 00094 00096 char * value; 00097 } OggzComment; 00098 00099 #ifdef __cplusplus 00100 extern "C" { 00101 #endif 00102 00112 const char * 00113 oggz_comment_get_vendor (OGGZ * oggz, long serialno); 00114 00127 int 00128 oggz_comment_set_vendor (OGGZ * oggz, long serialno, 00129 const char * vendor_string); 00130 00139 const OggzComment * 00140 oggz_comment_first (OGGZ * oggz, long serialno); 00141 00152 const OggzComment * 00153 oggz_comment_next (OGGZ * oggz, long serialno, const OggzComment * comment); 00154 00166 const OggzComment * 00167 oggz_comment_first_byname (OGGZ * oggz, long serialno, char * name); 00168 00181 const OggzComment * 00182 oggz_comment_next_byname (OGGZ * oggz, long serialno, 00183 const OggzComment * comment); 00184 00194 int 00195 oggz_comment_add (OGGZ * oggz, long serialno, OggzComment * comment); 00196 00207 int 00208 oggz_comment_add_byname (OGGZ * oggz, long serialno, 00209 const char * name, const char * value); 00210 00223 int 00224 oggz_comment_remove (OGGZ * oggz, long serialno, OggzComment * comment); 00225 00237 int 00238 oggz_comment_remove_byname (OGGZ * oggz, long serialno, char * name); 00239 00262 ogg_packet * 00263 oggz_comments_generate(OGGZ * oggz, long serialno, 00264 int FLAC_final_metadata_block); 00265 00266 /* 00267 * Copy comments between two streams. 00268 * \param src A OGGZ* handle 00269 * \param src_serialno Identify a logical bitstream within \a src 00270 * \param dest A OGGZ* handle (created with OGGZ_WRITE) 00271 * \param dest_serialno Identify a logical bitstream within \a dest 00272 * \retval OGGZ_ERR_BAD \a oggz is not a valid OGGZ* handle 00273 * \retval OGGZ_ERR_INVALID Operation not suitable for \a dest 00274 */ 00275 int 00276 oggz_comments_copy (OGGZ * src, long src_serialno, 00277 OGGZ * dest, long dest_serialno); 00278 00284 void oggz_packet_destroy (ogg_packet *packet); 00285 00286 #ifdef __cplusplus 00287 } 00288 #endif 00289 00290 #endif /* __OGGZ_COMMENTS_H__ */