diff --git a/.gitmodules b/.gitmodules index 7679010..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "Audio-Frameworks"] - path = Audio-Frameworks - url = https://github.com/ap4y/Audio-Frameworks.git diff --git a/Audio-Frameworks b/Audio-Frameworks deleted file mode 160000 index 92acf6a..0000000 --- a/Audio-Frameworks +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 92acf6a3efe8398aeb273080efff2e78365b4e02 diff --git a/Audio-Frameworks/CyberLink/CyberLink.xcodeproj/project.pbxproj b/Audio-Frameworks/CyberLink/CyberLink.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e247f41 --- /dev/null +++ b/Audio-Frameworks/CyberLink/CyberLink.xcodeproj/project.pbxproj @@ -0,0 +1,1311 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 9529EFD115DBF908000303A6 /* chttp.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6915DBF907000303A6 /* chttp.c */; }; + 9529EFD215DBF908000303A6 /* chttp_date.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6A15DBF907000303A6 /* chttp_date.c */; }; + 9529EFD315DBF908000303A6 /* chttp_header.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6B15DBF907000303A6 /* chttp_header.c */; }; + 9529EFD415DBF908000303A6 /* chttp_header_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6C15DBF907000303A6 /* chttp_header_list.c */; }; + 9529EFD515DBF908000303A6 /* chttp_packet.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6D15DBF907000303A6 /* chttp_packet.c */; }; + 9529EFD615DBF908000303A6 /* chttp_persistent_connection.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6E15DBF907000303A6 /* chttp_persistent_connection.c */; }; + 9529EFD715DBF908000303A6 /* chttp_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6F15DBF907000303A6 /* chttp_request.c */; }; + 9529EFD815DBF908000303A6 /* chttp_response.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7015DBF907000303A6 /* chttp_response.c */; }; + 9529EFD915DBF908000303A6 /* chttp_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7115DBF907000303A6 /* chttp_server.c */; }; + 9529EFDA15DBF908000303A6 /* chttp_server_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7215DBF907000303A6 /* chttp_server_list.c */; }; + 9529EFDB15DBF908000303A6 /* cfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7415DBF907000303A6 /* cfile.c */; }; + 9529EFDC15DBF908000303A6 /* cfile_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7515DBF907000303A6 /* cfile_list.c */; }; + 9529EFDD15DBF908000303A6 /* cdatagram_packet.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7715DBF907000303A6 /* cdatagram_packet.c */; }; + 9529EFDE15DBF908000303A6 /* cinterface.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7815DBF907000303A6 /* cinterface.c */; }; + 9529EFDF15DBF908000303A6 /* cinterface_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7915DBF907000303A6 /* cinterface_function.c */; }; + 9529EFE015DBF908000303A6 /* cinterface_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7A15DBF907000303A6 /* cinterface_list.c */; }; + 9529EFE115DBF908000303A6 /* cnet_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7B15DBF907000303A6 /* cnet_function.c */; }; + 9529EFE215DBF908000303A6 /* csocket.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7C15DBF907000303A6 /* csocket.c */; }; + 9529EFE315DBF908000303A6 /* csocket_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7D15DBF907000303A6 /* csocket_list.c */; }; + 9529EFE415DBF908000303A6 /* curi.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7E15DBF907000303A6 /* curi.c */; }; + 9529EFE515DBF908000303A6 /* curl.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7F15DBF907000303A6 /* curl.c */; }; + 9529EFE615DBF908000303A6 /* csoap.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8115DBF907000303A6 /* csoap.c */; }; + 9529EFE715DBF908000303A6 /* csoap_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8215DBF907000303A6 /* csoap_request.c */; }; + 9529EFE815DBF908000303A6 /* csoap_response.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8315DBF907000303A6 /* csoap_response.c */; }; + 9529EFE915DBF908000303A6 /* caction.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8515DBF907000303A6 /* caction.c */; }; + 9529EFEA15DBF908000303A6 /* caction_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8615DBF907000303A6 /* caction_list.c */; }; + 9529EFEB15DBF908000303A6 /* cargument.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8715DBF907000303A6 /* cargument.c */; }; + 9529EFEC15DBF908000303A6 /* cargument_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8815DBF907000303A6 /* cargument_list.c */; }; + 9529EFED15DBF908000303A6 /* ccontrolpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8915DBF907000303A6 /* ccontrolpoint.c */; }; + 9529EFEE15DBF908000303A6 /* ccontrolpoint_event.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8A15DBF907000303A6 /* ccontrolpoint_event.c */; }; + 9529EFEF15DBF908000303A6 /* ccontrolpoint_http_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8B15DBF907000303A6 /* ccontrolpoint_http_server.c */; }; + 9529EFF015DBF908000303A6 /* cdevice.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8C15DBF907000303A6 /* cdevice.c */; }; + 9529EFF115DBF908000303A6 /* cdevice_advertiser.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8D15DBF907000303A6 /* cdevice_advertiser.c */; }; + 9529EFF215DBF908000303A6 /* cdevice_http_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8E15DBF907000303A6 /* cdevice_http_server.c */; }; + 9529EFF315DBF908000303A6 /* cdevice_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8F15DBF907000303A6 /* cdevice_list.c */; }; + 9529EFF415DBF908000303A6 /* cdevice_ssdp_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9015DBF907000303A6 /* cdevice_ssdp_server.c */; }; + 9529EFF515DBF908000303A6 /* cicon.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9115DBF907000303A6 /* cicon.c */; }; + 9529EFF615DBF908000303A6 /* cicon_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9215DBF907000303A6 /* cicon_list.c */; }; + 9529EFF715DBF908000303A6 /* caction_ctrl.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9415DBF908000303A6 /* caction_ctrl.c */; }; + 9529EFF815DBF908000303A6 /* caction_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9515DBF908000303A6 /* caction_request.c */; }; + 9529EFF915DBF908000303A6 /* caction_response.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9615DBF908000303A6 /* caction_response.c */; }; + 9529EFFA15DBF908000303A6 /* ccontrol_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9715DBF908000303A6 /* ccontrol_function.c */; }; + 9529EFFB15DBF908000303A6 /* cquery_ctrl.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9815DBF908000303A6 /* cquery_ctrl.c */; }; + 9529EFFC15DBF908000303A6 /* cquery_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9915DBF908000303A6 /* cquery_request.c */; }; + 9529EFFD15DBF908000303A6 /* cquery_response.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9A15DBF908000303A6 /* cquery_response.c */; }; + 9529EFFE15DBF908000303A6 /* cservice.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9B15DBF908000303A6 /* cservice.c */; }; + 9529EFFF15DBF908000303A6 /* cservice_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9C15DBF908000303A6 /* cservice_list.c */; }; + 9529F00015DBF908000303A6 /* cservice_notify.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9D15DBF908000303A6 /* cservice_notify.c */; }; + 9529F00115DBF908000303A6 /* cservice_ssdp_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9E15DBF908000303A6 /* cservice_ssdp_server.c */; }; + 9529F00215DBF908000303A6 /* cservice_std_dcp.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9F15DBF908000303A6 /* cservice_std_dcp.c */; }; + 9529F00315DBF908000303A6 /* cservicestate_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA015DBF908000303A6 /* cservicestate_table.c */; }; + 9529F00415DBF908000303A6 /* cstatevariable.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA115DBF908000303A6 /* cstatevariable.c */; }; + 9529F00515DBF908000303A6 /* cupnp_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA215DBF908000303A6 /* cupnp_function.c */; }; + 9529F00615DBF908000303A6 /* cupnp_status.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA315DBF908000303A6 /* cupnp_status.c */; }; + 9529F00715DBF908000303A6 /* ceventlistener_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA515DBF908000303A6 /* ceventlistener_list.c */; }; + 9529F00815DBF908000303A6 /* cnotify_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA615DBF908000303A6 /* cnotify_request.c */; }; + 9529F00915DBF908000303A6 /* cproperty.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA715DBF908000303A6 /* cproperty.c */; }; + 9529F00A15DBF908000303A6 /* cproperty_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA815DBF908000303A6 /* cproperty_list.c */; }; + 9529F00B15DBF908000303A6 /* csubscriber.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA915DBF908000303A6 /* csubscriber.c */; }; + 9529F00C15DBF908000303A6 /* csubscriber_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFAA15DBF908000303A6 /* csubscriber_list.c */; }; + 9529F00D15DBF908000303A6 /* csubscription.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFAB15DBF908000303A6 /* csubscription.c */; }; + 9529F00E15DBF908000303A6 /* csubscription_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFAC15DBF908000303A6 /* csubscription_request.c */; }; + 9529F00F15DBF908000303A6 /* csubscription_response.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFAD15DBF908000303A6 /* csubscription_response.c */; }; + 9529F01015DBF908000303A6 /* chttpmu_socket.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFAF15DBF908000303A6 /* chttpmu_socket.c */; }; + 9529F01115DBF908000303A6 /* chttpu_socket.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB015DBF908000303A6 /* chttpu_socket.c */; }; + 9529F01215DBF908000303A6 /* cssdp.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB115DBF908000303A6 /* cssdp.c */; }; + 9529F01315DBF908000303A6 /* cssdp_packet.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB215DBF908000303A6 /* cssdp_packet.c */; }; + 9529F01415DBF908000303A6 /* cssdp_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB315DBF908000303A6 /* cssdp_request.c */; }; + 9529F01515DBF908000303A6 /* cssdp_response.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB415DBF908000303A6 /* cssdp_response.c */; }; + 9529F01615DBF908000303A6 /* cssdp_response_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB515DBF908000303A6 /* cssdp_response_server.c */; }; + 9529F01715DBF908000303A6 /* cssdp_response_server_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB615DBF908000303A6 /* cssdp_response_server_list.c */; }; + 9529F01815DBF908000303A6 /* cssdp_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB715DBF908000303A6 /* cssdp_server.c */; }; + 9529F01915DBF908000303A6 /* cssdp_server_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB815DBF908000303A6 /* cssdp_server_list.c */; }; + 9529F01A15DBF908000303A6 /* cssdp_socket.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB915DBF908000303A6 /* cssdp_socket.c */; }; + 9529F01B15DBF908000303A6 /* ccond.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFBB15DBF908000303A6 /* ccond.c */; }; + 9529F01C15DBF908000303A6 /* cdictionary.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFBC15DBF908000303A6 /* cdictionary.c */; }; + 9529F01D15DBF908000303A6 /* cdictionary_elem.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFBD15DBF908000303A6 /* cdictionary_elem.c */; }; + 9529F01E15DBF908000303A6 /* clist.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFBE15DBF908000303A6 /* clist.c */; }; + 9529F01F15DBF908000303A6 /* clog.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFBF15DBF908000303A6 /* clog.c */; }; + 9529F02015DBF908000303A6 /* cmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC015DBF908000303A6 /* cmutex.c */; }; + 9529F02115DBF908000303A6 /* cstring.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC115DBF908000303A6 /* cstring.c */; }; + 9529F02215DBF908000303A6 /* cstring_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC215DBF908000303A6 /* cstring_function.c */; }; + 9529F02315DBF908000303A6 /* cstring_tokenizer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC315DBF908000303A6 /* cstring_tokenizer.c */; }; + 9529F02415DBF908000303A6 /* cthread.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC415DBF908000303A6 /* cthread.c */; }; + 9529F02515DBF908000303A6 /* cthread_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC515DBF908000303A6 /* cthread_list.c */; }; + 9529F02615DBF908000303A6 /* ctime.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC615DBF908000303A6 /* ctime.c */; }; + 9529F02715DBF908000303A6 /* ctime_wince.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC715DBF908000303A6 /* ctime_wince.c */; }; + 9529F02815DBF908000303A6 /* cxml_attribute.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC915DBF908000303A6 /* cxml_attribute.c */; }; + 9529F02915DBF908000303A6 /* cxml_attribute_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFCA15DBF908000303A6 /* cxml_attribute_list.c */; }; + 9529F02A15DBF908000303A6 /* cxml_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFCB15DBF908000303A6 /* cxml_function.c */; }; + 9529F02B15DBF908000303A6 /* cxml_node.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFCC15DBF908000303A6 /* cxml_node.c */; }; + 9529F02C15DBF908000303A6 /* cxml_node_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFCD15DBF908000303A6 /* cxml_node_list.c */; }; + 9529F02D15DBF908000303A6 /* cxml_parser.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFCE15DBF908000303A6 /* cxml_parser.c */; }; + 9529F02E15DBF908000303A6 /* cxml_parser_expat.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFCF15DBF908000303A6 /* cxml_parser_expat.c */; }; + 9529F02F15DBF908000303A6 /* cxml_parser_libxml2.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFD015DBF908000303A6 /* cxml_parser_libxml2.c */; }; + 9529F05F15DBF916000303A6 /* chttp.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F03115DBF916000303A6 /* chttp.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06015DBF916000303A6 /* cfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F03315DBF916000303A6 /* cfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06115DBF916000303A6 /* cinterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F03515DBF916000303A6 /* cinterface.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06215DBF916000303A6 /* csocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F03615DBF916000303A6 /* csocket.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06315DBF916000303A6 /* curi.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F03715DBF916000303A6 /* curi.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06415DBF916000303A6 /* curl.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F03815DBF916000303A6 /* curl.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06515DBF916000303A6 /* csoap.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F03A15DBF916000303A6 /* csoap.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06615DBF916000303A6 /* typedef.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F03B15DBF916000303A6 /* typedef.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06715DBF916000303A6 /* caction.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F03D15DBF916000303A6 /* caction.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06815DBF916000303A6 /* cargument.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F03E15DBF916000303A6 /* cargument.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06915DBF916000303A6 /* ccontrolpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F03F15DBF916000303A6 /* ccontrolpoint.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06A15DBF916000303A6 /* cdevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04015DBF916000303A6 /* cdevice.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06B15DBF916000303A6 /* cicon.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04115DBF916000303A6 /* cicon.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06C15DBF916000303A6 /* ccontrol.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04315DBF916000303A6 /* ccontrol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06D15DBF916000303A6 /* cservice.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04415DBF916000303A6 /* cservice.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06E15DBF916000303A6 /* cstatevariable.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04515DBF916000303A6 /* cstatevariable.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F06F15DBF916000303A6 /* cupnp.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04615DBF916000303A6 /* cupnp.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07015DBF916000303A6 /* cupnp.h.in in Resources */ = {isa = PBXBuildFile; fileRef = 9529F04715DBF916000303A6 /* cupnp.h.in */; }; + 9529F07115DBF916000303A6 /* cupnp_function.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04815DBF916000303A6 /* cupnp_function.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07215DBF916000303A6 /* cupnp_limit.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04915DBF916000303A6 /* cupnp_limit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07315DBF916000303A6 /* cupnp_status.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04A15DBF916000303A6 /* cupnp_status.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07415DBF916000303A6 /* cevent.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04C15DBF916000303A6 /* cevent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07515DBF916000303A6 /* cnotify.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04D15DBF916000303A6 /* cnotify.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07615DBF916000303A6 /* cproperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04E15DBF916000303A6 /* cproperty.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07715DBF916000303A6 /* csubscriber.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F04F15DBF916000303A6 /* csubscriber.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07815DBF916000303A6 /* csubscription.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F05015DBF916000303A6 /* csubscription.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07915DBF916000303A6 /* cssdp.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F05215DBF916000303A6 /* cssdp.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07A15DBF916000303A6 /* cssdp_server.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F05315DBF916000303A6 /* cssdp_server.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07B15DBF916000303A6 /* ccond.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F05515DBF916000303A6 /* ccond.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07C15DBF916000303A6 /* cdictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F05615DBF916000303A6 /* cdictionary.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07D15DBF916000303A6 /* clist.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F05715DBF916000303A6 /* clist.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07E15DBF916000303A6 /* clog.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F05815DBF916000303A6 /* clog.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F07F15DBF916000303A6 /* cmutex.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F05915DBF916000303A6 /* cmutex.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F08015DBF916000303A6 /* cstring.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F05A15DBF916000303A6 /* cstring.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F08115DBF916000303A6 /* cthread.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F05B15DBF916000303A6 /* cthread.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F08215DBF916000303A6 /* ctime.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F05C15DBF916000303A6 /* ctime.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F08315DBF916000303A6 /* cxml.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F05E15DBF916000303A6 /* cxml.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F08815DBFAFC000303A6 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9529F08715DBFAFC000303A6 /* libxml2.dylib */; }; + 9529F09B15DBFBB8000303A6 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9529F08715DBFAFC000303A6 /* libxml2.dylib */; }; + 9529F09C15DBFBDC000303A6 /* chttp.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6915DBF907000303A6 /* chttp.c */; }; + 9529F09D15DBFBDC000303A6 /* chttp_date.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6A15DBF907000303A6 /* chttp_date.c */; }; + 9529F09E15DBFBDC000303A6 /* chttp_header.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6B15DBF907000303A6 /* chttp_header.c */; }; + 9529F09F15DBFBDC000303A6 /* chttp_header_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6C15DBF907000303A6 /* chttp_header_list.c */; }; + 9529F0A015DBFBDC000303A6 /* chttp_packet.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6D15DBF907000303A6 /* chttp_packet.c */; }; + 9529F0A115DBFBDC000303A6 /* chttp_persistent_connection.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6E15DBF907000303A6 /* chttp_persistent_connection.c */; }; + 9529F0A215DBFBDC000303A6 /* chttp_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF6F15DBF907000303A6 /* chttp_request.c */; }; + 9529F0A315DBFBDC000303A6 /* chttp_response.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7015DBF907000303A6 /* chttp_response.c */; }; + 9529F0A415DBFBDC000303A6 /* chttp_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7115DBF907000303A6 /* chttp_server.c */; }; + 9529F0A515DBFBDC000303A6 /* chttp_server_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7215DBF907000303A6 /* chttp_server_list.c */; }; + 9529F0A615DBFBDC000303A6 /* cfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7415DBF907000303A6 /* cfile.c */; }; + 9529F0A715DBFBDC000303A6 /* cfile_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7515DBF907000303A6 /* cfile_list.c */; }; + 9529F0A815DBFBDC000303A6 /* cdatagram_packet.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7715DBF907000303A6 /* cdatagram_packet.c */; }; + 9529F0A915DBFBDC000303A6 /* cinterface.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7815DBF907000303A6 /* cinterface.c */; }; + 9529F0AA15DBFBDC000303A6 /* cinterface_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7915DBF907000303A6 /* cinterface_function.c */; }; + 9529F0AB15DBFBDC000303A6 /* cinterface_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7A15DBF907000303A6 /* cinterface_list.c */; }; + 9529F0AC15DBFBDC000303A6 /* cnet_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7B15DBF907000303A6 /* cnet_function.c */; }; + 9529F0AD15DBFBDC000303A6 /* csocket.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7C15DBF907000303A6 /* csocket.c */; }; + 9529F0AE15DBFBDC000303A6 /* csocket_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7D15DBF907000303A6 /* csocket_list.c */; }; + 9529F0AF15DBFBDC000303A6 /* curi.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7E15DBF907000303A6 /* curi.c */; }; + 9529F0B015DBFBDC000303A6 /* curl.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF7F15DBF907000303A6 /* curl.c */; }; + 9529F0B115DBFBDC000303A6 /* csoap.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8115DBF907000303A6 /* csoap.c */; }; + 9529F0B215DBFBDC000303A6 /* csoap_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8215DBF907000303A6 /* csoap_request.c */; }; + 9529F0B315DBFBDC000303A6 /* csoap_response.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8315DBF907000303A6 /* csoap_response.c */; }; + 9529F0B415DBFBDC000303A6 /* caction.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8515DBF907000303A6 /* caction.c */; }; + 9529F0B515DBFBDC000303A6 /* caction_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8615DBF907000303A6 /* caction_list.c */; }; + 9529F0B615DBFBDC000303A6 /* cargument.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8715DBF907000303A6 /* cargument.c */; }; + 9529F0B715DBFBDC000303A6 /* cargument_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8815DBF907000303A6 /* cargument_list.c */; }; + 9529F0B815DBFBDC000303A6 /* ccontrolpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8915DBF907000303A6 /* ccontrolpoint.c */; }; + 9529F0B915DBFBDC000303A6 /* ccontrolpoint_event.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8A15DBF907000303A6 /* ccontrolpoint_event.c */; }; + 9529F0BA15DBFBDC000303A6 /* ccontrolpoint_http_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8B15DBF907000303A6 /* ccontrolpoint_http_server.c */; }; + 9529F0BB15DBFBDC000303A6 /* cdevice.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8C15DBF907000303A6 /* cdevice.c */; }; + 9529F0BC15DBFBDC000303A6 /* cdevice_advertiser.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8D15DBF907000303A6 /* cdevice_advertiser.c */; }; + 9529F0BD15DBFBDC000303A6 /* cdevice_http_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8E15DBF907000303A6 /* cdevice_http_server.c */; }; + 9529F0BE15DBFBDC000303A6 /* cdevice_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF8F15DBF907000303A6 /* cdevice_list.c */; }; + 9529F0BF15DBFBDC000303A6 /* cdevice_ssdp_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9015DBF907000303A6 /* cdevice_ssdp_server.c */; }; + 9529F0C015DBFBDC000303A6 /* cicon.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9115DBF907000303A6 /* cicon.c */; }; + 9529F0C115DBFBDC000303A6 /* cicon_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9215DBF907000303A6 /* cicon_list.c */; }; + 9529F0C215DBFBDC000303A6 /* caction_ctrl.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9415DBF908000303A6 /* caction_ctrl.c */; }; + 9529F0C315DBFBDC000303A6 /* caction_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9515DBF908000303A6 /* caction_request.c */; }; + 9529F0C415DBFBDC000303A6 /* caction_response.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9615DBF908000303A6 /* caction_response.c */; }; + 9529F0C515DBFBDC000303A6 /* ccontrol_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9715DBF908000303A6 /* ccontrol_function.c */; }; + 9529F0C615DBFBDC000303A6 /* cquery_ctrl.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9815DBF908000303A6 /* cquery_ctrl.c */; }; + 9529F0C715DBFBDC000303A6 /* cquery_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9915DBF908000303A6 /* cquery_request.c */; }; + 9529F0C815DBFBDC000303A6 /* cquery_response.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9A15DBF908000303A6 /* cquery_response.c */; }; + 9529F0C915DBFBDC000303A6 /* cservice.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9B15DBF908000303A6 /* cservice.c */; }; + 9529F0CA15DBFBDC000303A6 /* cservice_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9C15DBF908000303A6 /* cservice_list.c */; }; + 9529F0CB15DBFBDC000303A6 /* cservice_notify.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9D15DBF908000303A6 /* cservice_notify.c */; }; + 9529F0CC15DBFBDC000303A6 /* cservice_ssdp_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9E15DBF908000303A6 /* cservice_ssdp_server.c */; }; + 9529F0CD15DBFBDC000303A6 /* cservice_std_dcp.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EF9F15DBF908000303A6 /* cservice_std_dcp.c */; }; + 9529F0CE15DBFBDC000303A6 /* cservicestate_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA015DBF908000303A6 /* cservicestate_table.c */; }; + 9529F0CF15DBFBDC000303A6 /* cstatevariable.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA115DBF908000303A6 /* cstatevariable.c */; }; + 9529F0D015DBFBDC000303A6 /* cupnp_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA215DBF908000303A6 /* cupnp_function.c */; }; + 9529F0D115DBFBDC000303A6 /* cupnp_status.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA315DBF908000303A6 /* cupnp_status.c */; }; + 9529F0D215DBFBDC000303A6 /* ceventlistener_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA515DBF908000303A6 /* ceventlistener_list.c */; }; + 9529F0D315DBFBDC000303A6 /* cnotify_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA615DBF908000303A6 /* cnotify_request.c */; }; + 9529F0D415DBFBDC000303A6 /* cproperty.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA715DBF908000303A6 /* cproperty.c */; }; + 9529F0D515DBFBDC000303A6 /* cproperty_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA815DBF908000303A6 /* cproperty_list.c */; }; + 9529F0D615DBFBDC000303A6 /* csubscriber.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFA915DBF908000303A6 /* csubscriber.c */; }; + 9529F0D715DBFBDC000303A6 /* csubscriber_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFAA15DBF908000303A6 /* csubscriber_list.c */; }; + 9529F0D815DBFBDC000303A6 /* csubscription.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFAB15DBF908000303A6 /* csubscription.c */; }; + 9529F0D915DBFBDC000303A6 /* csubscription_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFAC15DBF908000303A6 /* csubscription_request.c */; }; + 9529F0DA15DBFBDC000303A6 /* csubscription_response.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFAD15DBF908000303A6 /* csubscription_response.c */; }; + 9529F0DB15DBFBDC000303A6 /* chttpmu_socket.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFAF15DBF908000303A6 /* chttpmu_socket.c */; }; + 9529F0DC15DBFBDC000303A6 /* chttpu_socket.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB015DBF908000303A6 /* chttpu_socket.c */; }; + 9529F0DD15DBFBDC000303A6 /* cssdp.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB115DBF908000303A6 /* cssdp.c */; }; + 9529F0DE15DBFBDC000303A6 /* cssdp_packet.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB215DBF908000303A6 /* cssdp_packet.c */; }; + 9529F0DF15DBFBDC000303A6 /* cssdp_request.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB315DBF908000303A6 /* cssdp_request.c */; }; + 9529F0E015DBFBDC000303A6 /* cssdp_response.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB415DBF908000303A6 /* cssdp_response.c */; }; + 9529F0E115DBFBDC000303A6 /* cssdp_response_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB515DBF908000303A6 /* cssdp_response_server.c */; }; + 9529F0E215DBFBDC000303A6 /* cssdp_response_server_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB615DBF908000303A6 /* cssdp_response_server_list.c */; }; + 9529F0E315DBFBDC000303A6 /* cssdp_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB715DBF908000303A6 /* cssdp_server.c */; }; + 9529F0E415DBFBDC000303A6 /* cssdp_server_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB815DBF908000303A6 /* cssdp_server_list.c */; }; + 9529F0E515DBFBDC000303A6 /* cssdp_socket.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFB915DBF908000303A6 /* cssdp_socket.c */; }; + 9529F0E615DBFBDC000303A6 /* ccond.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFBB15DBF908000303A6 /* ccond.c */; }; + 9529F0E715DBFBDC000303A6 /* cdictionary.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFBC15DBF908000303A6 /* cdictionary.c */; }; + 9529F0E815DBFBDC000303A6 /* cdictionary_elem.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFBD15DBF908000303A6 /* cdictionary_elem.c */; }; + 9529F0E915DBFBDC000303A6 /* clist.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFBE15DBF908000303A6 /* clist.c */; }; + 9529F0EA15DBFBDC000303A6 /* clog.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFBF15DBF908000303A6 /* clog.c */; }; + 9529F0EB15DBFBDC000303A6 /* cmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC015DBF908000303A6 /* cmutex.c */; }; + 9529F0EC15DBFBDC000303A6 /* cstring.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC115DBF908000303A6 /* cstring.c */; }; + 9529F0ED15DBFBDC000303A6 /* cstring_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC215DBF908000303A6 /* cstring_function.c */; }; + 9529F0EE15DBFBDC000303A6 /* cstring_tokenizer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC315DBF908000303A6 /* cstring_tokenizer.c */; }; + 9529F0EF15DBFBDC000303A6 /* cthread.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC415DBF908000303A6 /* cthread.c */; }; + 9529F0F015DBFBDC000303A6 /* cthread_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC515DBF908000303A6 /* cthread_list.c */; }; + 9529F0F115DBFBDC000303A6 /* ctime.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC615DBF908000303A6 /* ctime.c */; }; + 9529F0F215DBFBDC000303A6 /* ctime_wince.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC715DBF908000303A6 /* ctime_wince.c */; }; + 9529F0F315DBFBDC000303A6 /* cxml_attribute.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFC915DBF908000303A6 /* cxml_attribute.c */; }; + 9529F0F415DBFBDC000303A6 /* cxml_attribute_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFCA15DBF908000303A6 /* cxml_attribute_list.c */; }; + 9529F0F515DBFBDC000303A6 /* cxml_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFCB15DBF908000303A6 /* cxml_function.c */; }; + 9529F0F615DBFBDC000303A6 /* cxml_node.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFCC15DBF908000303A6 /* cxml_node.c */; }; + 9529F0F715DBFBDC000303A6 /* cxml_node_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFCD15DBF908000303A6 /* cxml_node_list.c */; }; + 9529F0F815DBFBDC000303A6 /* cxml_parser.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFCE15DBF908000303A6 /* cxml_parser.c */; }; + 9529F0F915DBFBDC000303A6 /* cxml_parser_expat.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFCF15DBF908000303A6 /* cxml_parser_expat.c */; }; + 9529F0FA15DBFBDC000303A6 /* cxml_parser_libxml2.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EFD015DBF908000303A6 /* cxml_parser_libxml2.c */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9529F08B15DBFBA6000303A6 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/${PRODUCT_NAME}"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 9529EF5915DBF846000303A6 /* CyberLink.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CyberLink.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9529EF5D15DBF846000303A6 /* CyberLink-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CyberLink-Info.plist"; sourceTree = ""; }; + 9529EF6115DBF846000303A6 /* CyberLink-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CyberLink-Prefix.pch"; sourceTree = ""; }; + 9529EF6915DBF907000303A6 /* chttp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chttp.c; sourceTree = ""; }; + 9529EF6A15DBF907000303A6 /* chttp_date.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chttp_date.c; sourceTree = ""; }; + 9529EF6B15DBF907000303A6 /* chttp_header.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chttp_header.c; sourceTree = ""; }; + 9529EF6C15DBF907000303A6 /* chttp_header_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chttp_header_list.c; sourceTree = ""; }; + 9529EF6D15DBF907000303A6 /* chttp_packet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chttp_packet.c; sourceTree = ""; }; + 9529EF6E15DBF907000303A6 /* chttp_persistent_connection.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chttp_persistent_connection.c; sourceTree = ""; }; + 9529EF6F15DBF907000303A6 /* chttp_request.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chttp_request.c; sourceTree = ""; }; + 9529EF7015DBF907000303A6 /* chttp_response.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chttp_response.c; sourceTree = ""; }; + 9529EF7115DBF907000303A6 /* chttp_server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chttp_server.c; sourceTree = ""; }; + 9529EF7215DBF907000303A6 /* chttp_server_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chttp_server_list.c; sourceTree = ""; }; + 9529EF7415DBF907000303A6 /* cfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cfile.c; sourceTree = ""; }; + 9529EF7515DBF907000303A6 /* cfile_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cfile_list.c; sourceTree = ""; }; + 9529EF7715DBF907000303A6 /* cdatagram_packet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cdatagram_packet.c; sourceTree = ""; }; + 9529EF7815DBF907000303A6 /* cinterface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cinterface.c; sourceTree = ""; }; + 9529EF7915DBF907000303A6 /* cinterface_function.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cinterface_function.c; sourceTree = ""; }; + 9529EF7A15DBF907000303A6 /* cinterface_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cinterface_list.c; sourceTree = ""; }; + 9529EF7B15DBF907000303A6 /* cnet_function.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cnet_function.c; sourceTree = ""; }; + 9529EF7C15DBF907000303A6 /* csocket.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = csocket.c; sourceTree = ""; }; + 9529EF7D15DBF907000303A6 /* csocket_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = csocket_list.c; sourceTree = ""; }; + 9529EF7E15DBF907000303A6 /* curi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = curi.c; sourceTree = ""; }; + 9529EF7F15DBF907000303A6 /* curl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = curl.c; sourceTree = ""; }; + 9529EF8115DBF907000303A6 /* csoap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = csoap.c; sourceTree = ""; }; + 9529EF8215DBF907000303A6 /* csoap_request.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = csoap_request.c; sourceTree = ""; }; + 9529EF8315DBF907000303A6 /* csoap_response.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = csoap_response.c; sourceTree = ""; }; + 9529EF8515DBF907000303A6 /* caction.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = caction.c; sourceTree = ""; }; + 9529EF8615DBF907000303A6 /* caction_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = caction_list.c; sourceTree = ""; }; + 9529EF8715DBF907000303A6 /* cargument.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cargument.c; sourceTree = ""; }; + 9529EF8815DBF907000303A6 /* cargument_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cargument_list.c; sourceTree = ""; }; + 9529EF8915DBF907000303A6 /* ccontrolpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccontrolpoint.c; sourceTree = ""; }; + 9529EF8A15DBF907000303A6 /* ccontrolpoint_event.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccontrolpoint_event.c; sourceTree = ""; }; + 9529EF8B15DBF907000303A6 /* ccontrolpoint_http_server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccontrolpoint_http_server.c; sourceTree = ""; }; + 9529EF8C15DBF907000303A6 /* cdevice.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cdevice.c; sourceTree = ""; }; + 9529EF8D15DBF907000303A6 /* cdevice_advertiser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cdevice_advertiser.c; sourceTree = ""; }; + 9529EF8E15DBF907000303A6 /* cdevice_http_server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cdevice_http_server.c; sourceTree = ""; }; + 9529EF8F15DBF907000303A6 /* cdevice_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cdevice_list.c; sourceTree = ""; }; + 9529EF9015DBF907000303A6 /* cdevice_ssdp_server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cdevice_ssdp_server.c; sourceTree = ""; }; + 9529EF9115DBF907000303A6 /* cicon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cicon.c; sourceTree = ""; }; + 9529EF9215DBF907000303A6 /* cicon_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cicon_list.c; sourceTree = ""; }; + 9529EF9415DBF908000303A6 /* caction_ctrl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = caction_ctrl.c; sourceTree = ""; }; + 9529EF9515DBF908000303A6 /* caction_request.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = caction_request.c; sourceTree = ""; }; + 9529EF9615DBF908000303A6 /* caction_response.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = caction_response.c; sourceTree = ""; }; + 9529EF9715DBF908000303A6 /* ccontrol_function.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccontrol_function.c; sourceTree = ""; }; + 9529EF9815DBF908000303A6 /* cquery_ctrl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cquery_ctrl.c; sourceTree = ""; }; + 9529EF9915DBF908000303A6 /* cquery_request.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cquery_request.c; sourceTree = ""; }; + 9529EF9A15DBF908000303A6 /* cquery_response.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cquery_response.c; sourceTree = ""; }; + 9529EF9B15DBF908000303A6 /* cservice.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cservice.c; sourceTree = ""; }; + 9529EF9C15DBF908000303A6 /* cservice_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cservice_list.c; sourceTree = ""; }; + 9529EF9D15DBF908000303A6 /* cservice_notify.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cservice_notify.c; sourceTree = ""; }; + 9529EF9E15DBF908000303A6 /* cservice_ssdp_server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cservice_ssdp_server.c; sourceTree = ""; }; + 9529EF9F15DBF908000303A6 /* cservice_std_dcp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cservice_std_dcp.c; sourceTree = ""; }; + 9529EFA015DBF908000303A6 /* cservicestate_table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cservicestate_table.c; sourceTree = ""; }; + 9529EFA115DBF908000303A6 /* cstatevariable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cstatevariable.c; sourceTree = ""; }; + 9529EFA215DBF908000303A6 /* cupnp_function.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cupnp_function.c; sourceTree = ""; }; + 9529EFA315DBF908000303A6 /* cupnp_status.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cupnp_status.c; sourceTree = ""; }; + 9529EFA515DBF908000303A6 /* ceventlistener_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ceventlistener_list.c; sourceTree = ""; }; + 9529EFA615DBF908000303A6 /* cnotify_request.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cnotify_request.c; sourceTree = ""; }; + 9529EFA715DBF908000303A6 /* cproperty.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cproperty.c; sourceTree = ""; }; + 9529EFA815DBF908000303A6 /* cproperty_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cproperty_list.c; sourceTree = ""; }; + 9529EFA915DBF908000303A6 /* csubscriber.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = csubscriber.c; sourceTree = ""; }; + 9529EFAA15DBF908000303A6 /* csubscriber_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = csubscriber_list.c; sourceTree = ""; }; + 9529EFAB15DBF908000303A6 /* csubscription.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = csubscription.c; sourceTree = ""; }; + 9529EFAC15DBF908000303A6 /* csubscription_request.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = csubscription_request.c; sourceTree = ""; }; + 9529EFAD15DBF908000303A6 /* csubscription_response.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = csubscription_response.c; sourceTree = ""; }; + 9529EFAF15DBF908000303A6 /* chttpmu_socket.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chttpmu_socket.c; sourceTree = ""; }; + 9529EFB015DBF908000303A6 /* chttpu_socket.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chttpu_socket.c; sourceTree = ""; }; + 9529EFB115DBF908000303A6 /* cssdp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cssdp.c; sourceTree = ""; }; + 9529EFB215DBF908000303A6 /* cssdp_packet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cssdp_packet.c; sourceTree = ""; }; + 9529EFB315DBF908000303A6 /* cssdp_request.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cssdp_request.c; sourceTree = ""; }; + 9529EFB415DBF908000303A6 /* cssdp_response.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cssdp_response.c; sourceTree = ""; }; + 9529EFB515DBF908000303A6 /* cssdp_response_server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cssdp_response_server.c; sourceTree = ""; }; + 9529EFB615DBF908000303A6 /* cssdp_response_server_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cssdp_response_server_list.c; sourceTree = ""; }; + 9529EFB715DBF908000303A6 /* cssdp_server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cssdp_server.c; sourceTree = ""; }; + 9529EFB815DBF908000303A6 /* cssdp_server_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cssdp_server_list.c; sourceTree = ""; }; + 9529EFB915DBF908000303A6 /* cssdp_socket.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cssdp_socket.c; sourceTree = ""; }; + 9529EFBB15DBF908000303A6 /* ccond.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccond.c; sourceTree = ""; }; + 9529EFBC15DBF908000303A6 /* cdictionary.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cdictionary.c; sourceTree = ""; }; + 9529EFBD15DBF908000303A6 /* cdictionary_elem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cdictionary_elem.c; sourceTree = ""; }; + 9529EFBE15DBF908000303A6 /* clist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = clist.c; sourceTree = ""; }; + 9529EFBF15DBF908000303A6 /* clog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = clog.c; sourceTree = ""; }; + 9529EFC015DBF908000303A6 /* cmutex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cmutex.c; sourceTree = ""; }; + 9529EFC115DBF908000303A6 /* cstring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cstring.c; sourceTree = ""; }; + 9529EFC215DBF908000303A6 /* cstring_function.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cstring_function.c; sourceTree = ""; }; + 9529EFC315DBF908000303A6 /* cstring_tokenizer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cstring_tokenizer.c; sourceTree = ""; }; + 9529EFC415DBF908000303A6 /* cthread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cthread.c; sourceTree = ""; }; + 9529EFC515DBF908000303A6 /* cthread_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cthread_list.c; sourceTree = ""; }; + 9529EFC615DBF908000303A6 /* ctime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ctime.c; sourceTree = ""; }; + 9529EFC715DBF908000303A6 /* ctime_wince.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ctime_wince.c; sourceTree = ""; }; + 9529EFC915DBF908000303A6 /* cxml_attribute.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cxml_attribute.c; sourceTree = ""; }; + 9529EFCA15DBF908000303A6 /* cxml_attribute_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cxml_attribute_list.c; sourceTree = ""; }; + 9529EFCB15DBF908000303A6 /* cxml_function.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cxml_function.c; sourceTree = ""; }; + 9529EFCC15DBF908000303A6 /* cxml_node.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cxml_node.c; sourceTree = ""; }; + 9529EFCD15DBF908000303A6 /* cxml_node_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cxml_node_list.c; sourceTree = ""; }; + 9529EFCE15DBF908000303A6 /* cxml_parser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cxml_parser.c; sourceTree = ""; }; + 9529EFCF15DBF908000303A6 /* cxml_parser_expat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cxml_parser_expat.c; sourceTree = ""; }; + 9529EFD015DBF908000303A6 /* cxml_parser_libxml2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cxml_parser_libxml2.c; sourceTree = ""; }; + 9529F03115DBF916000303A6 /* chttp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chttp.h; sourceTree = ""; }; + 9529F03315DBF916000303A6 /* cfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cfile.h; sourceTree = ""; }; + 9529F03515DBF916000303A6 /* cinterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cinterface.h; sourceTree = ""; }; + 9529F03615DBF916000303A6 /* csocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = csocket.h; sourceTree = ""; }; + 9529F03715DBF916000303A6 /* curi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = curi.h; sourceTree = ""; }; + 9529F03815DBF916000303A6 /* curl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = curl.h; sourceTree = ""; }; + 9529F03A15DBF916000303A6 /* csoap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = csoap.h; sourceTree = ""; }; + 9529F03B15DBF916000303A6 /* typedef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = typedef.h; path = "../../cyberlink-src/include/cybergarage/typedef.h"; sourceTree = ""; }; + 9529F03D15DBF916000303A6 /* caction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = caction.h; sourceTree = ""; }; + 9529F03E15DBF916000303A6 /* cargument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cargument.h; sourceTree = ""; }; + 9529F03F15DBF916000303A6 /* ccontrolpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccontrolpoint.h; sourceTree = ""; }; + 9529F04015DBF916000303A6 /* cdevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cdevice.h; sourceTree = ""; }; + 9529F04115DBF916000303A6 /* cicon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cicon.h; sourceTree = ""; }; + 9529F04315DBF916000303A6 /* ccontrol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccontrol.h; sourceTree = ""; }; + 9529F04415DBF916000303A6 /* cservice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cservice.h; sourceTree = ""; }; + 9529F04515DBF916000303A6 /* cstatevariable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cstatevariable.h; sourceTree = ""; }; + 9529F04615DBF916000303A6 /* cupnp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cupnp.h; sourceTree = ""; }; + 9529F04715DBF916000303A6 /* cupnp.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cupnp.h.in; sourceTree = ""; }; + 9529F04815DBF916000303A6 /* cupnp_function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cupnp_function.h; sourceTree = ""; }; + 9529F04915DBF916000303A6 /* cupnp_limit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cupnp_limit.h; sourceTree = ""; }; + 9529F04A15DBF916000303A6 /* cupnp_status.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cupnp_status.h; sourceTree = ""; }; + 9529F04C15DBF916000303A6 /* cevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cevent.h; sourceTree = ""; }; + 9529F04D15DBF916000303A6 /* cnotify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cnotify.h; sourceTree = ""; }; + 9529F04E15DBF916000303A6 /* cproperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cproperty.h; sourceTree = ""; }; + 9529F04F15DBF916000303A6 /* csubscriber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = csubscriber.h; sourceTree = ""; }; + 9529F05015DBF916000303A6 /* csubscription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = csubscription.h; sourceTree = ""; }; + 9529F05215DBF916000303A6 /* cssdp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cssdp.h; sourceTree = ""; }; + 9529F05315DBF916000303A6 /* cssdp_server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cssdp_server.h; sourceTree = ""; }; + 9529F05515DBF916000303A6 /* ccond.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccond.h; sourceTree = ""; }; + 9529F05615DBF916000303A6 /* cdictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cdictionary.h; sourceTree = ""; }; + 9529F05715DBF916000303A6 /* clist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clist.h; sourceTree = ""; }; + 9529F05815DBF916000303A6 /* clog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clog.h; sourceTree = ""; }; + 9529F05915DBF916000303A6 /* cmutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cmutex.h; sourceTree = ""; }; + 9529F05A15DBF916000303A6 /* cstring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cstring.h; sourceTree = ""; }; + 9529F05B15DBF916000303A6 /* cthread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cthread.h; sourceTree = ""; }; + 9529F05C15DBF916000303A6 /* ctime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ctime.h; sourceTree = ""; }; + 9529F05E15DBF916000303A6 /* cxml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cxml.h; sourceTree = ""; }; + 9529F08715DBFAFC000303A6 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; }; + 9529F08D15DBFBA6000303A6 /* libCyberLink.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCyberLink.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 9529F08F15DBFBA6000303A6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 9529EF5315DBF846000303A6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9529F08815DBFAFC000303A6 /* libxml2.dylib in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9529F08A15DBFBA6000303A6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9529F09B15DBFBB8000303A6 /* libxml2.dylib in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9529EF4A15DBF846000303A6 = { + isa = PBXGroup; + children = ( + 9529F08715DBFAFC000303A6 /* libxml2.dylib */, + 9529EF5B15DBF846000303A6 /* CyberLink */, + 9529F08E15DBFBA6000303A6 /* Frameworks */, + 9529EF5A15DBF846000303A6 /* Products */, + ); + sourceTree = ""; + }; + 9529EF5A15DBF846000303A6 /* Products */ = { + isa = PBXGroup; + children = ( + 9529EF5915DBF846000303A6 /* CyberLink.framework */, + 9529F08D15DBFBA6000303A6 /* libCyberLink.a */, + ); + name = Products; + sourceTree = ""; + }; + 9529EF5B15DBF846000303A6 /* CyberLink */ = { + isa = PBXGroup; + children = ( + 9529F08415DBF91E000303A6 /* headers */, + 9529EF6715DBF8E8000303A6 /* src */, + 9529EF5C15DBF846000303A6 /* Supporting Files */, + ); + path = CyberLink; + sourceTree = ""; + }; + 9529EF5C15DBF846000303A6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 9529EF5D15DBF846000303A6 /* CyberLink-Info.plist */, + 9529EF6115DBF846000303A6 /* CyberLink-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 9529EF6715DBF8E8000303A6 /* src */ = { + isa = PBXGroup; + children = ( + 9529EF6815DBF907000303A6 /* http */, + 9529EF7315DBF907000303A6 /* io */, + 9529EF7615DBF907000303A6 /* net */, + 9529EF8015DBF907000303A6 /* soap */, + 9529EF8415DBF907000303A6 /* upnp */, + 9529EFBA15DBF908000303A6 /* util */, + 9529EFC815DBF908000303A6 /* xml */, + ); + name = src; + sourceTree = ""; + }; + 9529EF6815DBF907000303A6 /* http */ = { + isa = PBXGroup; + children = ( + 9529EF6915DBF907000303A6 /* chttp.c */, + 9529EF6A15DBF907000303A6 /* chttp_date.c */, + 9529EF6B15DBF907000303A6 /* chttp_header.c */, + 9529EF6C15DBF907000303A6 /* chttp_header_list.c */, + 9529EF6D15DBF907000303A6 /* chttp_packet.c */, + 9529EF6E15DBF907000303A6 /* chttp_persistent_connection.c */, + 9529EF6F15DBF907000303A6 /* chttp_request.c */, + 9529EF7015DBF907000303A6 /* chttp_response.c */, + 9529EF7115DBF907000303A6 /* chttp_server.c */, + 9529EF7215DBF907000303A6 /* chttp_server_list.c */, + ); + name = http; + path = "../../cyberlink-src/src/cybergarage/http"; + sourceTree = ""; + }; + 9529EF7315DBF907000303A6 /* io */ = { + isa = PBXGroup; + children = ( + 9529EF7415DBF907000303A6 /* cfile.c */, + 9529EF7515DBF907000303A6 /* cfile_list.c */, + ); + name = io; + path = "../../cyberlink-src/src/cybergarage/io"; + sourceTree = ""; + }; + 9529EF7615DBF907000303A6 /* net */ = { + isa = PBXGroup; + children = ( + 9529EF7715DBF907000303A6 /* cdatagram_packet.c */, + 9529EF7815DBF907000303A6 /* cinterface.c */, + 9529EF7915DBF907000303A6 /* cinterface_function.c */, + 9529EF7A15DBF907000303A6 /* cinterface_list.c */, + 9529EF7B15DBF907000303A6 /* cnet_function.c */, + 9529EF7C15DBF907000303A6 /* csocket.c */, + 9529EF7D15DBF907000303A6 /* csocket_list.c */, + 9529EF7E15DBF907000303A6 /* curi.c */, + 9529EF7F15DBF907000303A6 /* curl.c */, + ); + name = net; + path = "../../cyberlink-src/src/cybergarage/net"; + sourceTree = ""; + }; + 9529EF8015DBF907000303A6 /* soap */ = { + isa = PBXGroup; + children = ( + 9529EF8115DBF907000303A6 /* csoap.c */, + 9529EF8215DBF907000303A6 /* csoap_request.c */, + 9529EF8315DBF907000303A6 /* csoap_response.c */, + ); + name = soap; + path = "../../cyberlink-src/src/cybergarage/soap"; + sourceTree = ""; + }; + 9529EF8415DBF907000303A6 /* upnp */ = { + isa = PBXGroup; + children = ( + 9529EF8515DBF907000303A6 /* caction.c */, + 9529EF8615DBF907000303A6 /* caction_list.c */, + 9529EF8715DBF907000303A6 /* cargument.c */, + 9529EF8815DBF907000303A6 /* cargument_list.c */, + 9529EF8915DBF907000303A6 /* ccontrolpoint.c */, + 9529EF8A15DBF907000303A6 /* ccontrolpoint_event.c */, + 9529EF8B15DBF907000303A6 /* ccontrolpoint_http_server.c */, + 9529EF8C15DBF907000303A6 /* cdevice.c */, + 9529EF8D15DBF907000303A6 /* cdevice_advertiser.c */, + 9529EF8E15DBF907000303A6 /* cdevice_http_server.c */, + 9529EF8F15DBF907000303A6 /* cdevice_list.c */, + 9529EF9015DBF907000303A6 /* cdevice_ssdp_server.c */, + 9529EF9115DBF907000303A6 /* cicon.c */, + 9529EF9215DBF907000303A6 /* cicon_list.c */, + 9529EF9315DBF907000303A6 /* control */, + 9529EF9B15DBF908000303A6 /* cservice.c */, + 9529EF9C15DBF908000303A6 /* cservice_list.c */, + 9529EF9D15DBF908000303A6 /* cservice_notify.c */, + 9529EF9E15DBF908000303A6 /* cservice_ssdp_server.c */, + 9529EF9F15DBF908000303A6 /* cservice_std_dcp.c */, + 9529EFA015DBF908000303A6 /* cservicestate_table.c */, + 9529EFA115DBF908000303A6 /* cstatevariable.c */, + 9529EFA215DBF908000303A6 /* cupnp_function.c */, + 9529EFA315DBF908000303A6 /* cupnp_status.c */, + 9529EFA415DBF908000303A6 /* event */, + 9529EFAE15DBF908000303A6 /* ssdp */, + ); + name = upnp; + path = "../../cyberlink-src/src/cybergarage/upnp"; + sourceTree = ""; + }; + 9529EF9315DBF907000303A6 /* control */ = { + isa = PBXGroup; + children = ( + 9529EF9415DBF908000303A6 /* caction_ctrl.c */, + 9529EF9515DBF908000303A6 /* caction_request.c */, + 9529EF9615DBF908000303A6 /* caction_response.c */, + 9529EF9715DBF908000303A6 /* ccontrol_function.c */, + 9529EF9815DBF908000303A6 /* cquery_ctrl.c */, + 9529EF9915DBF908000303A6 /* cquery_request.c */, + 9529EF9A15DBF908000303A6 /* cquery_response.c */, + ); + path = control; + sourceTree = ""; + }; + 9529EFA415DBF908000303A6 /* event */ = { + isa = PBXGroup; + children = ( + 9529EFA515DBF908000303A6 /* ceventlistener_list.c */, + 9529EFA615DBF908000303A6 /* cnotify_request.c */, + 9529EFA715DBF908000303A6 /* cproperty.c */, + 9529EFA815DBF908000303A6 /* cproperty_list.c */, + 9529EFA915DBF908000303A6 /* csubscriber.c */, + 9529EFAA15DBF908000303A6 /* csubscriber_list.c */, + 9529EFAB15DBF908000303A6 /* csubscription.c */, + 9529EFAC15DBF908000303A6 /* csubscription_request.c */, + 9529EFAD15DBF908000303A6 /* csubscription_response.c */, + ); + path = event; + sourceTree = ""; + }; + 9529EFAE15DBF908000303A6 /* ssdp */ = { + isa = PBXGroup; + children = ( + 9529EFAF15DBF908000303A6 /* chttpmu_socket.c */, + 9529EFB015DBF908000303A6 /* chttpu_socket.c */, + 9529EFB115DBF908000303A6 /* cssdp.c */, + 9529EFB215DBF908000303A6 /* cssdp_packet.c */, + 9529EFB315DBF908000303A6 /* cssdp_request.c */, + 9529EFB415DBF908000303A6 /* cssdp_response.c */, + 9529EFB515DBF908000303A6 /* cssdp_response_server.c */, + 9529EFB615DBF908000303A6 /* cssdp_response_server_list.c */, + 9529EFB715DBF908000303A6 /* cssdp_server.c */, + 9529EFB815DBF908000303A6 /* cssdp_server_list.c */, + 9529EFB915DBF908000303A6 /* cssdp_socket.c */, + ); + path = ssdp; + sourceTree = ""; + }; + 9529EFBA15DBF908000303A6 /* util */ = { + isa = PBXGroup; + children = ( + 9529EFBB15DBF908000303A6 /* ccond.c */, + 9529EFBC15DBF908000303A6 /* cdictionary.c */, + 9529EFBD15DBF908000303A6 /* cdictionary_elem.c */, + 9529EFBE15DBF908000303A6 /* clist.c */, + 9529EFBF15DBF908000303A6 /* clog.c */, + 9529EFC015DBF908000303A6 /* cmutex.c */, + 9529EFC115DBF908000303A6 /* cstring.c */, + 9529EFC215DBF908000303A6 /* cstring_function.c */, + 9529EFC315DBF908000303A6 /* cstring_tokenizer.c */, + 9529EFC415DBF908000303A6 /* cthread.c */, + 9529EFC515DBF908000303A6 /* cthread_list.c */, + 9529EFC615DBF908000303A6 /* ctime.c */, + 9529EFC715DBF908000303A6 /* ctime_wince.c */, + ); + name = util; + path = "../../cyberlink-src/src/cybergarage/util"; + sourceTree = ""; + }; + 9529EFC815DBF908000303A6 /* xml */ = { + isa = PBXGroup; + children = ( + 9529EFC915DBF908000303A6 /* cxml_attribute.c */, + 9529EFCA15DBF908000303A6 /* cxml_attribute_list.c */, + 9529EFCB15DBF908000303A6 /* cxml_function.c */, + 9529EFCC15DBF908000303A6 /* cxml_node.c */, + 9529EFCD15DBF908000303A6 /* cxml_node_list.c */, + 9529EFCE15DBF908000303A6 /* cxml_parser.c */, + 9529EFCF15DBF908000303A6 /* cxml_parser_expat.c */, + 9529EFD015DBF908000303A6 /* cxml_parser_libxml2.c */, + ); + name = xml; + path = "../../cyberlink-src/src/cybergarage/xml"; + sourceTree = ""; + }; + 9529F03015DBF916000303A6 /* http */ = { + isa = PBXGroup; + children = ( + 9529F03115DBF916000303A6 /* chttp.h */, + ); + name = http; + path = "../../cyberlink-src/include/cybergarage/http"; + sourceTree = ""; + }; + 9529F03215DBF916000303A6 /* io */ = { + isa = PBXGroup; + children = ( + 9529F03315DBF916000303A6 /* cfile.h */, + ); + name = io; + path = "../../cyberlink-src/include/cybergarage/io"; + sourceTree = ""; + }; + 9529F03415DBF916000303A6 /* net */ = { + isa = PBXGroup; + children = ( + 9529F03515DBF916000303A6 /* cinterface.h */, + 9529F03615DBF916000303A6 /* csocket.h */, + 9529F03715DBF916000303A6 /* curi.h */, + 9529F03815DBF916000303A6 /* curl.h */, + ); + name = net; + path = "../../cyberlink-src/include/cybergarage/net"; + sourceTree = ""; + }; + 9529F03915DBF916000303A6 /* soap */ = { + isa = PBXGroup; + children = ( + 9529F03A15DBF916000303A6 /* csoap.h */, + ); + name = soap; + path = "../../cyberlink-src/include/cybergarage/soap"; + sourceTree = ""; + }; + 9529F03C15DBF916000303A6 /* upnp */ = { + isa = PBXGroup; + children = ( + 9529F03D15DBF916000303A6 /* caction.h */, + 9529F03E15DBF916000303A6 /* cargument.h */, + 9529F03F15DBF916000303A6 /* ccontrolpoint.h */, + 9529F04015DBF916000303A6 /* cdevice.h */, + 9529F04115DBF916000303A6 /* cicon.h */, + 9529F04215DBF916000303A6 /* control */, + 9529F04415DBF916000303A6 /* cservice.h */, + 9529F04515DBF916000303A6 /* cstatevariable.h */, + 9529F04615DBF916000303A6 /* cupnp.h */, + 9529F04715DBF916000303A6 /* cupnp.h.in */, + 9529F04815DBF916000303A6 /* cupnp_function.h */, + 9529F04915DBF916000303A6 /* cupnp_limit.h */, + 9529F04A15DBF916000303A6 /* cupnp_status.h */, + 9529F04B15DBF916000303A6 /* event */, + 9529F05115DBF916000303A6 /* ssdp */, + ); + name = upnp; + path = "../../cyberlink-src/include/cybergarage/upnp"; + sourceTree = ""; + }; + 9529F04215DBF916000303A6 /* control */ = { + isa = PBXGroup; + children = ( + 9529F04315DBF916000303A6 /* ccontrol.h */, + ); + path = control; + sourceTree = ""; + }; + 9529F04B15DBF916000303A6 /* event */ = { + isa = PBXGroup; + children = ( + 9529F04C15DBF916000303A6 /* cevent.h */, + 9529F04D15DBF916000303A6 /* cnotify.h */, + 9529F04E15DBF916000303A6 /* cproperty.h */, + 9529F04F15DBF916000303A6 /* csubscriber.h */, + 9529F05015DBF916000303A6 /* csubscription.h */, + ); + path = event; + sourceTree = ""; + }; + 9529F05115DBF916000303A6 /* ssdp */ = { + isa = PBXGroup; + children = ( + 9529F05215DBF916000303A6 /* cssdp.h */, + 9529F05315DBF916000303A6 /* cssdp_server.h */, + ); + path = ssdp; + sourceTree = ""; + }; + 9529F05415DBF916000303A6 /* util */ = { + isa = PBXGroup; + children = ( + 9529F05515DBF916000303A6 /* ccond.h */, + 9529F05615DBF916000303A6 /* cdictionary.h */, + 9529F05715DBF916000303A6 /* clist.h */, + 9529F05815DBF916000303A6 /* clog.h */, + 9529F05915DBF916000303A6 /* cmutex.h */, + 9529F05A15DBF916000303A6 /* cstring.h */, + 9529F05B15DBF916000303A6 /* cthread.h */, + 9529F05C15DBF916000303A6 /* ctime.h */, + ); + name = util; + path = "../../cyberlink-src/include/cybergarage/util"; + sourceTree = ""; + }; + 9529F05D15DBF916000303A6 /* xml */ = { + isa = PBXGroup; + children = ( + 9529F05E15DBF916000303A6 /* cxml.h */, + ); + name = xml; + path = "../../cyberlink-src/include/cybergarage/xml"; + sourceTree = ""; + }; + 9529F08415DBF91E000303A6 /* headers */ = { + isa = PBXGroup; + children = ( + 9529F03015DBF916000303A6 /* http */, + 9529F03215DBF916000303A6 /* io */, + 9529F03415DBF916000303A6 /* net */, + 9529F03915DBF916000303A6 /* soap */, + 9529F03B15DBF916000303A6 /* typedef.h */, + 9529F03C15DBF916000303A6 /* upnp */, + 9529F05415DBF916000303A6 /* util */, + 9529F05D15DBF916000303A6 /* xml */, + ); + name = headers; + sourceTree = ""; + }; + 9529F08E15DBFBA6000303A6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 9529F08F15DBFBA6000303A6 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 9529EF5415DBF846000303A6 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 9529F05F15DBF916000303A6 /* chttp.h in Headers */, + 9529F06015DBF916000303A6 /* cfile.h in Headers */, + 9529F06115DBF916000303A6 /* cinterface.h in Headers */, + 9529F06215DBF916000303A6 /* csocket.h in Headers */, + 9529F06315DBF916000303A6 /* curi.h in Headers */, + 9529F06415DBF916000303A6 /* curl.h in Headers */, + 9529F06515DBF916000303A6 /* csoap.h in Headers */, + 9529F06615DBF916000303A6 /* typedef.h in Headers */, + 9529F06715DBF916000303A6 /* caction.h in Headers */, + 9529F06815DBF916000303A6 /* cargument.h in Headers */, + 9529F06915DBF916000303A6 /* ccontrolpoint.h in Headers */, + 9529F06A15DBF916000303A6 /* cdevice.h in Headers */, + 9529F06B15DBF916000303A6 /* cicon.h in Headers */, + 9529F06C15DBF916000303A6 /* ccontrol.h in Headers */, + 9529F06D15DBF916000303A6 /* cservice.h in Headers */, + 9529F06E15DBF916000303A6 /* cstatevariable.h in Headers */, + 9529F06F15DBF916000303A6 /* cupnp.h in Headers */, + 9529F07115DBF916000303A6 /* cupnp_function.h in Headers */, + 9529F07215DBF916000303A6 /* cupnp_limit.h in Headers */, + 9529F07315DBF916000303A6 /* cupnp_status.h in Headers */, + 9529F07415DBF916000303A6 /* cevent.h in Headers */, + 9529F07515DBF916000303A6 /* cnotify.h in Headers */, + 9529F07615DBF916000303A6 /* cproperty.h in Headers */, + 9529F07715DBF916000303A6 /* csubscriber.h in Headers */, + 9529F07815DBF916000303A6 /* csubscription.h in Headers */, + 9529F07915DBF916000303A6 /* cssdp.h in Headers */, + 9529F07A15DBF916000303A6 /* cssdp_server.h in Headers */, + 9529F07B15DBF916000303A6 /* ccond.h in Headers */, + 9529F07C15DBF916000303A6 /* cdictionary.h in Headers */, + 9529F07D15DBF916000303A6 /* clist.h in Headers */, + 9529F07E15DBF916000303A6 /* clog.h in Headers */, + 9529F07F15DBF916000303A6 /* cmutex.h in Headers */, + 9529F08015DBF916000303A6 /* cstring.h in Headers */, + 9529F08115DBF916000303A6 /* cthread.h in Headers */, + 9529F08215DBF916000303A6 /* ctime.h in Headers */, + 9529F08315DBF916000303A6 /* cxml.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 9529EF5815DBF846000303A6 /* CyberLink */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9529EF6415DBF846000303A6 /* Build configuration list for PBXNativeTarget "CyberLink" */; + buildPhases = ( + 9529EF5115DBF846000303A6 /* ShellScript */, + 9529EF5215DBF846000303A6 /* Sources */, + 9529EF5315DBF846000303A6 /* Frameworks */, + 9529EF5415DBF846000303A6 /* Headers */, + 9529EF5515DBF846000303A6 /* Resources */, + 9529EF5615DBF846000303A6 /* ShellScript */, + 9529EF5715DBF846000303A6 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CyberLink; + productName = CyberLink; + productReference = 9529EF5915DBF846000303A6 /* CyberLink.framework */; + productType = "com.apple.product-type.bundle"; + }; + 9529F08C15DBFBA6000303A6 /* libCyberLink */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9529F09815DBFBA6000303A6 /* Build configuration list for PBXNativeTarget "libCyberLink" */; + buildPhases = ( + 9529F08915DBFBA6000303A6 /* Sources */, + 9529F08A15DBFBA6000303A6 /* Frameworks */, + 9529F08B15DBFBA6000303A6 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = libCyberLink; + productName = libCyberLink; + productReference = 9529F08D15DBFBA6000303A6 /* libCyberLink.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 9529EF4C15DBF846000303A6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0440; + }; + buildConfigurationList = 9529EF4F15DBF846000303A6 /* Build configuration list for PBXProject "CyberLink" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 9529EF4A15DBF846000303A6; + productRefGroup = 9529EF5A15DBF846000303A6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 9529EF5815DBF846000303A6 /* CyberLink */, + 9529F08C15DBFBA6000303A6 /* libCyberLink */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 9529EF5515DBF846000303A6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9529F07015DBF916000303A6 /* cupnp.h.in in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 9529EF5115DBF846000303A6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n\tUFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Clean other platform if needed\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n\techo \"Platform \\\"$UFW_SDK_PLATFORM\\\" was cleaned recently. Cleaning \\\"$UFW_OTHER_PLATFORM\\\" as well\"\n\techo xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\n\txcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\nfi\n\n\n# Make sure we are building from fresh binaries\n\nrm -rf \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\n"; + }; + 9529EF5615DBF846000303A6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "HEADERS_ROOT=$SRCROOT/$PRODUCT_NAME\nFRAMEWORK_HEADERS_DIR=\"$BUILT_PRODUCTS_DIR/$WRAPPER_NAME/Versions/$FRAMEWORK_VERSION/Headers\"\n\n## only header files expected at this point\nPUBLIC_HEADERS=$(find $FRAMEWORK_HEADERS_DIR/. -not -type d 2> /dev/null | sed -e \"s@.*/@@g\")\n\nFIND_OPTS=\"\"\nfor PUBLIC_HEADER in $PUBLIC_HEADERS; do\n if [ -n \"$FIND_OPTS\" ]; then\n FIND_OPTS=\"$FIND_OPTS -o\"\n fi\n FIND_OPTS=\"$FIND_OPTS -name '$PUBLIC_HEADER'\"\ndone\n\nif [ -n \"$FIND_OPTS\" ]; then\n for ORIG_HEADER in $(eval \"find $HEADERS_ROOT/. $FIND_OPTS\" 2> /dev/null | sed -e \"s@^$HEADERS_ROOT/./@@g\"); do\n PUBLIC_HEADER=$(basename $ORIG_HEADER)\n RELATIVE_PATH=$(dirname $ORIG_HEADER)\n if [ -e $FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER ]; then\n mkdir -p \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH\"\n mv \"$FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER\" \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH/$PUBLIC_HEADER\"\n fi\n done\nfi\n"; + }; + 9529EF5715DBF846000303A6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\nexport UFW_MASTER_SCRIPT_RUNNING=1\n\n\n# Functions\n\n## List files in the specified directory, storing to the specified array.\n#\n# @param $1 The path to list\n# @param $2 The name of the array to fill\n#\n##\nlist_files ()\n{\n filelist=$(ls \"$1\")\n while read line\n do\n eval \"$2[\\${#$2[*]}]=\\\"\\$line\\\"\"\n done <<< \"$filelist\"\n}\n\n\n# Sanity check\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n echo \"Framework target \\\"${TARGET_NAME}\\\" had no source files to build from. Make sure your source files have the correct target membership\"\n exit 1\nfi\n\n\n# Gather information\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n UFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date.\n# We already checked the other platform in the prerun script.\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Make sure the other platform gets built\n\necho \"Build other platform\"\n\necho xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\n\n\n# Build the fat static library binary\n\necho \"Create universal static library\"\n\necho \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n\"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n\necho mv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nmv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\n\n\n# Build framework structure\n\necho \"Build symlinks\"\n\necho ln -sfh A \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\nln -sfh A \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\necho ln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\nln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\necho ln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\nln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\necho ln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\nln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\n\n\n# Link to binary for unit tests\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework\"\nln -sfh \"../${WRAPPER_NAME}/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework/.fake_fw_testing\"\n\n\n# Build embedded framework structure\n\necho \"Build Embedded Framework\"\n\necho rm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\necho mkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\nmkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\necho cp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\ncp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\n\ndeclare -a UFW_FILE_LIST\nlist_files \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\" UFW_FILE_LIST\nfor filename in \"${UFW_FILE_LIST[@]}\"\ndo\n if [[ \"${filename}\" != \"Info.plist\" ]] && [[ ! \"${filename}\" =~ .*\\.lproj$ ]]\n then\n echo ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n fi\ndone\n\n\n# Replace other platform's framework with a copy of this one (so that both have the same universal binary)\n\necho \"Copy from $UFW_SDK_PLATFORM to $UFW_OTHER_PLATFORM\"\n\necho rm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\nrm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\necho cp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\ncp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 9529EF5215DBF846000303A6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9529EFD115DBF908000303A6 /* chttp.c in Sources */, + 9529EFD215DBF908000303A6 /* chttp_date.c in Sources */, + 9529EFD315DBF908000303A6 /* chttp_header.c in Sources */, + 9529EFD415DBF908000303A6 /* chttp_header_list.c in Sources */, + 9529EFD515DBF908000303A6 /* chttp_packet.c in Sources */, + 9529EFD615DBF908000303A6 /* chttp_persistent_connection.c in Sources */, + 9529EFD715DBF908000303A6 /* chttp_request.c in Sources */, + 9529EFD815DBF908000303A6 /* chttp_response.c in Sources */, + 9529EFD915DBF908000303A6 /* chttp_server.c in Sources */, + 9529EFDA15DBF908000303A6 /* chttp_server_list.c in Sources */, + 9529EFDB15DBF908000303A6 /* cfile.c in Sources */, + 9529EFDC15DBF908000303A6 /* cfile_list.c in Sources */, + 9529EFDD15DBF908000303A6 /* cdatagram_packet.c in Sources */, + 9529EFDE15DBF908000303A6 /* cinterface.c in Sources */, + 9529EFDF15DBF908000303A6 /* cinterface_function.c in Sources */, + 9529EFE015DBF908000303A6 /* cinterface_list.c in Sources */, + 9529EFE115DBF908000303A6 /* cnet_function.c in Sources */, + 9529EFE215DBF908000303A6 /* csocket.c in Sources */, + 9529EFE315DBF908000303A6 /* csocket_list.c in Sources */, + 9529EFE415DBF908000303A6 /* curi.c in Sources */, + 9529EFE515DBF908000303A6 /* curl.c in Sources */, + 9529EFE615DBF908000303A6 /* csoap.c in Sources */, + 9529EFE715DBF908000303A6 /* csoap_request.c in Sources */, + 9529EFE815DBF908000303A6 /* csoap_response.c in Sources */, + 9529EFE915DBF908000303A6 /* caction.c in Sources */, + 9529EFEA15DBF908000303A6 /* caction_list.c in Sources */, + 9529EFEB15DBF908000303A6 /* cargument.c in Sources */, + 9529EFEC15DBF908000303A6 /* cargument_list.c in Sources */, + 9529EFED15DBF908000303A6 /* ccontrolpoint.c in Sources */, + 9529EFEE15DBF908000303A6 /* ccontrolpoint_event.c in Sources */, + 9529EFEF15DBF908000303A6 /* ccontrolpoint_http_server.c in Sources */, + 9529EFF015DBF908000303A6 /* cdevice.c in Sources */, + 9529EFF115DBF908000303A6 /* cdevice_advertiser.c in Sources */, + 9529EFF215DBF908000303A6 /* cdevice_http_server.c in Sources */, + 9529EFF315DBF908000303A6 /* cdevice_list.c in Sources */, + 9529EFF415DBF908000303A6 /* cdevice_ssdp_server.c in Sources */, + 9529EFF515DBF908000303A6 /* cicon.c in Sources */, + 9529EFF615DBF908000303A6 /* cicon_list.c in Sources */, + 9529EFF715DBF908000303A6 /* caction_ctrl.c in Sources */, + 9529EFF815DBF908000303A6 /* caction_request.c in Sources */, + 9529EFF915DBF908000303A6 /* caction_response.c in Sources */, + 9529EFFA15DBF908000303A6 /* ccontrol_function.c in Sources */, + 9529EFFB15DBF908000303A6 /* cquery_ctrl.c in Sources */, + 9529EFFC15DBF908000303A6 /* cquery_request.c in Sources */, + 9529EFFD15DBF908000303A6 /* cquery_response.c in Sources */, + 9529EFFE15DBF908000303A6 /* cservice.c in Sources */, + 9529EFFF15DBF908000303A6 /* cservice_list.c in Sources */, + 9529F00015DBF908000303A6 /* cservice_notify.c in Sources */, + 9529F00115DBF908000303A6 /* cservice_ssdp_server.c in Sources */, + 9529F00215DBF908000303A6 /* cservice_std_dcp.c in Sources */, + 9529F00315DBF908000303A6 /* cservicestate_table.c in Sources */, + 9529F00415DBF908000303A6 /* cstatevariable.c in Sources */, + 9529F00515DBF908000303A6 /* cupnp_function.c in Sources */, + 9529F00615DBF908000303A6 /* cupnp_status.c in Sources */, + 9529F00715DBF908000303A6 /* ceventlistener_list.c in Sources */, + 9529F00815DBF908000303A6 /* cnotify_request.c in Sources */, + 9529F00915DBF908000303A6 /* cproperty.c in Sources */, + 9529F00A15DBF908000303A6 /* cproperty_list.c in Sources */, + 9529F00B15DBF908000303A6 /* csubscriber.c in Sources */, + 9529F00C15DBF908000303A6 /* csubscriber_list.c in Sources */, + 9529F00D15DBF908000303A6 /* csubscription.c in Sources */, + 9529F00E15DBF908000303A6 /* csubscription_request.c in Sources */, + 9529F00F15DBF908000303A6 /* csubscription_response.c in Sources */, + 9529F01015DBF908000303A6 /* chttpmu_socket.c in Sources */, + 9529F01115DBF908000303A6 /* chttpu_socket.c in Sources */, + 9529F01215DBF908000303A6 /* cssdp.c in Sources */, + 9529F01315DBF908000303A6 /* cssdp_packet.c in Sources */, + 9529F01415DBF908000303A6 /* cssdp_request.c in Sources */, + 9529F01515DBF908000303A6 /* cssdp_response.c in Sources */, + 9529F01615DBF908000303A6 /* cssdp_response_server.c in Sources */, + 9529F01715DBF908000303A6 /* cssdp_response_server_list.c in Sources */, + 9529F01815DBF908000303A6 /* cssdp_server.c in Sources */, + 9529F01915DBF908000303A6 /* cssdp_server_list.c in Sources */, + 9529F01A15DBF908000303A6 /* cssdp_socket.c in Sources */, + 9529F01B15DBF908000303A6 /* ccond.c in Sources */, + 9529F01C15DBF908000303A6 /* cdictionary.c in Sources */, + 9529F01D15DBF908000303A6 /* cdictionary_elem.c in Sources */, + 9529F01E15DBF908000303A6 /* clist.c in Sources */, + 9529F01F15DBF908000303A6 /* clog.c in Sources */, + 9529F02015DBF908000303A6 /* cmutex.c in Sources */, + 9529F02115DBF908000303A6 /* cstring.c in Sources */, + 9529F02215DBF908000303A6 /* cstring_function.c in Sources */, + 9529F02315DBF908000303A6 /* cstring_tokenizer.c in Sources */, + 9529F02415DBF908000303A6 /* cthread.c in Sources */, + 9529F02515DBF908000303A6 /* cthread_list.c in Sources */, + 9529F02615DBF908000303A6 /* ctime.c in Sources */, + 9529F02715DBF908000303A6 /* ctime_wince.c in Sources */, + 9529F02815DBF908000303A6 /* cxml_attribute.c in Sources */, + 9529F02915DBF908000303A6 /* cxml_attribute_list.c in Sources */, + 9529F02A15DBF908000303A6 /* cxml_function.c in Sources */, + 9529F02B15DBF908000303A6 /* cxml_node.c in Sources */, + 9529F02C15DBF908000303A6 /* cxml_node_list.c in Sources */, + 9529F02D15DBF908000303A6 /* cxml_parser.c in Sources */, + 9529F02E15DBF908000303A6 /* cxml_parser_expat.c in Sources */, + 9529F02F15DBF908000303A6 /* cxml_parser_libxml2.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9529F08915DBFBA6000303A6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9529F09C15DBFBDC000303A6 /* chttp.c in Sources */, + 9529F09D15DBFBDC000303A6 /* chttp_date.c in Sources */, + 9529F09E15DBFBDC000303A6 /* chttp_header.c in Sources */, + 9529F09F15DBFBDC000303A6 /* chttp_header_list.c in Sources */, + 9529F0A015DBFBDC000303A6 /* chttp_packet.c in Sources */, + 9529F0A115DBFBDC000303A6 /* chttp_persistent_connection.c in Sources */, + 9529F0A215DBFBDC000303A6 /* chttp_request.c in Sources */, + 9529F0A315DBFBDC000303A6 /* chttp_response.c in Sources */, + 9529F0A415DBFBDC000303A6 /* chttp_server.c in Sources */, + 9529F0A515DBFBDC000303A6 /* chttp_server_list.c in Sources */, + 9529F0A615DBFBDC000303A6 /* cfile.c in Sources */, + 9529F0A715DBFBDC000303A6 /* cfile_list.c in Sources */, + 9529F0A815DBFBDC000303A6 /* cdatagram_packet.c in Sources */, + 9529F0A915DBFBDC000303A6 /* cinterface.c in Sources */, + 9529F0AA15DBFBDC000303A6 /* cinterface_function.c in Sources */, + 9529F0AB15DBFBDC000303A6 /* cinterface_list.c in Sources */, + 9529F0AC15DBFBDC000303A6 /* cnet_function.c in Sources */, + 9529F0AD15DBFBDC000303A6 /* csocket.c in Sources */, + 9529F0AE15DBFBDC000303A6 /* csocket_list.c in Sources */, + 9529F0AF15DBFBDC000303A6 /* curi.c in Sources */, + 9529F0B015DBFBDC000303A6 /* curl.c in Sources */, + 9529F0B115DBFBDC000303A6 /* csoap.c in Sources */, + 9529F0B215DBFBDC000303A6 /* csoap_request.c in Sources */, + 9529F0B315DBFBDC000303A6 /* csoap_response.c in Sources */, + 9529F0B415DBFBDC000303A6 /* caction.c in Sources */, + 9529F0B515DBFBDC000303A6 /* caction_list.c in Sources */, + 9529F0B615DBFBDC000303A6 /* cargument.c in Sources */, + 9529F0B715DBFBDC000303A6 /* cargument_list.c in Sources */, + 9529F0B815DBFBDC000303A6 /* ccontrolpoint.c in Sources */, + 9529F0B915DBFBDC000303A6 /* ccontrolpoint_event.c in Sources */, + 9529F0BA15DBFBDC000303A6 /* ccontrolpoint_http_server.c in Sources */, + 9529F0BB15DBFBDC000303A6 /* cdevice.c in Sources */, + 9529F0BC15DBFBDC000303A6 /* cdevice_advertiser.c in Sources */, + 9529F0BD15DBFBDC000303A6 /* cdevice_http_server.c in Sources */, + 9529F0BE15DBFBDC000303A6 /* cdevice_list.c in Sources */, + 9529F0BF15DBFBDC000303A6 /* cdevice_ssdp_server.c in Sources */, + 9529F0C015DBFBDC000303A6 /* cicon.c in Sources */, + 9529F0C115DBFBDC000303A6 /* cicon_list.c in Sources */, + 9529F0C215DBFBDC000303A6 /* caction_ctrl.c in Sources */, + 9529F0C315DBFBDC000303A6 /* caction_request.c in Sources */, + 9529F0C415DBFBDC000303A6 /* caction_response.c in Sources */, + 9529F0C515DBFBDC000303A6 /* ccontrol_function.c in Sources */, + 9529F0C615DBFBDC000303A6 /* cquery_ctrl.c in Sources */, + 9529F0C715DBFBDC000303A6 /* cquery_request.c in Sources */, + 9529F0C815DBFBDC000303A6 /* cquery_response.c in Sources */, + 9529F0C915DBFBDC000303A6 /* cservice.c in Sources */, + 9529F0CA15DBFBDC000303A6 /* cservice_list.c in Sources */, + 9529F0CB15DBFBDC000303A6 /* cservice_notify.c in Sources */, + 9529F0CC15DBFBDC000303A6 /* cservice_ssdp_server.c in Sources */, + 9529F0CD15DBFBDC000303A6 /* cservice_std_dcp.c in Sources */, + 9529F0CE15DBFBDC000303A6 /* cservicestate_table.c in Sources */, + 9529F0CF15DBFBDC000303A6 /* cstatevariable.c in Sources */, + 9529F0D015DBFBDC000303A6 /* cupnp_function.c in Sources */, + 9529F0D115DBFBDC000303A6 /* cupnp_status.c in Sources */, + 9529F0D215DBFBDC000303A6 /* ceventlistener_list.c in Sources */, + 9529F0D315DBFBDC000303A6 /* cnotify_request.c in Sources */, + 9529F0D415DBFBDC000303A6 /* cproperty.c in Sources */, + 9529F0D515DBFBDC000303A6 /* cproperty_list.c in Sources */, + 9529F0D615DBFBDC000303A6 /* csubscriber.c in Sources */, + 9529F0D715DBFBDC000303A6 /* csubscriber_list.c in Sources */, + 9529F0D815DBFBDC000303A6 /* csubscription.c in Sources */, + 9529F0D915DBFBDC000303A6 /* csubscription_request.c in Sources */, + 9529F0DA15DBFBDC000303A6 /* csubscription_response.c in Sources */, + 9529F0DB15DBFBDC000303A6 /* chttpmu_socket.c in Sources */, + 9529F0DC15DBFBDC000303A6 /* chttpu_socket.c in Sources */, + 9529F0DD15DBFBDC000303A6 /* cssdp.c in Sources */, + 9529F0DE15DBFBDC000303A6 /* cssdp_packet.c in Sources */, + 9529F0DF15DBFBDC000303A6 /* cssdp_request.c in Sources */, + 9529F0E015DBFBDC000303A6 /* cssdp_response.c in Sources */, + 9529F0E115DBFBDC000303A6 /* cssdp_response_server.c in Sources */, + 9529F0E215DBFBDC000303A6 /* cssdp_response_server_list.c in Sources */, + 9529F0E315DBFBDC000303A6 /* cssdp_server.c in Sources */, + 9529F0E415DBFBDC000303A6 /* cssdp_server_list.c in Sources */, + 9529F0E515DBFBDC000303A6 /* cssdp_socket.c in Sources */, + 9529F0E615DBFBDC000303A6 /* ccond.c in Sources */, + 9529F0E715DBFBDC000303A6 /* cdictionary.c in Sources */, + 9529F0E815DBFBDC000303A6 /* cdictionary_elem.c in Sources */, + 9529F0E915DBFBDC000303A6 /* clist.c in Sources */, + 9529F0EA15DBFBDC000303A6 /* clog.c in Sources */, + 9529F0EB15DBFBDC000303A6 /* cmutex.c in Sources */, + 9529F0EC15DBFBDC000303A6 /* cstring.c in Sources */, + 9529F0ED15DBFBDC000303A6 /* cstring_function.c in Sources */, + 9529F0EE15DBFBDC000303A6 /* cstring_tokenizer.c in Sources */, + 9529F0EF15DBFBDC000303A6 /* cthread.c in Sources */, + 9529F0F015DBFBDC000303A6 /* cthread_list.c in Sources */, + 9529F0F115DBFBDC000303A6 /* ctime.c in Sources */, + 9529F0F215DBFBDC000303A6 /* ctime_wince.c in Sources */, + 9529F0F315DBFBDC000303A6 /* cxml_attribute.c in Sources */, + 9529F0F415DBFBDC000303A6 /* cxml_attribute_list.c in Sources */, + 9529F0F515DBFBDC000303A6 /* cxml_function.c in Sources */, + 9529F0F615DBFBDC000303A6 /* cxml_node.c in Sources */, + 9529F0F715DBFBDC000303A6 /* cxml_node_list.c in Sources */, + 9529F0F815DBFBDC000303A6 /* cxml_parser.c in Sources */, + 9529F0F915DBFBDC000303A6 /* cxml_parser_expat.c in Sources */, + 9529F0FA15DBFBDC000303A6 /* cxml_parser_libxml2.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 9529EF6215DBF846000303A6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 9529EF6315DBF846000303A6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 9529EF6515DBF846000303A6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; + DEAD_CODE_STRIPPING = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CyberLink/CyberLink-Prefix.pch"; + HEADER_SEARCH_PATHS = ( + "../cyberlink-src/include/", + /usr/include/libxml2, + ); + INFOPLIST_FILE = "CyberLink/CyberLink-Info.plist"; + INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + WRAPPER_EXTENSION = framework; + }; + name = Debug; + }; + 9529EF6615DBF846000303A6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; + DEAD_CODE_STRIPPING = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CyberLink/CyberLink-Prefix.pch"; + HEADER_SEARCH_PATHS = ( + "../cyberlink-src/include/", + /usr/include/libxml2, + ); + INFOPLIST_FILE = "CyberLink/CyberLink-Info.plist"; + INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + WRAPPER_EXTENSION = framework; + }; + name = Release; + }; + 9529F09915DBFBA6000303A6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/libCyberLink.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + HEADER_SEARCH_PATHS = ( + "../cyberlink-src/include/", + /usr/include/libxml2, + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = CyberLink; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 9529F09A15DBFBA6000303A6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/libCyberLink.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + HEADER_SEARCH_PATHS = ( + "../cyberlink-src/include/", + /usr/include/libxml2, + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = CyberLink; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 9529EF4F15DBF846000303A6 /* Build configuration list for PBXProject "CyberLink" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9529EF6215DBF846000303A6 /* Debug */, + 9529EF6315DBF846000303A6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 9529EF6415DBF846000303A6 /* Build configuration list for PBXNativeTarget "CyberLink" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9529EF6515DBF846000303A6 /* Debug */, + 9529EF6615DBF846000303A6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 9529F09815DBFBA6000303A6 /* Build configuration list for PBXNativeTarget "libCyberLink" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9529F09915DBFBA6000303A6 /* Debug */, + 9529F09A15DBFBA6000303A6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 9529EF4C15DBF846000303A6 /* Project object */; +} diff --git a/Audio-Frameworks/CyberLink/CyberLink/CyberLink-Info.plist b/Audio-Frameworks/CyberLink/CyberLink/CyberLink-Info.plist new file mode 100644 index 0000000..8344a95 --- /dev/null +++ b/Audio-Frameworks/CyberLink/CyberLink/CyberLink-Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + ap4y.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSPrincipalClass + + + diff --git a/Audio-Frameworks/CyberLink/CyberLink/CyberLink-Prefix.pch b/Audio-Frameworks/CyberLink/CyberLink/CyberLink-Prefix.pch new file mode 100644 index 0000000..64ccdf2 --- /dev/null +++ b/Audio-Frameworks/CyberLink/CyberLink/CyberLink-Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'CyberLink' target in the 'CyberLink' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/Audio-Frameworks/FLAC/FLAC.xcodeproj/project.pbxproj b/Audio-Frameworks/FLAC/FLAC.xcodeproj/project.pbxproj new file mode 100644 index 0000000..89f52d6 --- /dev/null +++ b/Audio-Frameworks/FLAC/FLAC.xcodeproj/project.pbxproj @@ -0,0 +1,836 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 9502C2FD16C593690054F4E3 /* bitwise.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529F35D15DC0E56000303A6 /* bitwise.c */; }; + 9502C2FE16C593690054F4E3 /* framing.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529F35E15DC0E56000303A6 /* framing.c */; }; + 9502C2FF16C593690054F4E3 /* bitmath.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEDC15DBF23E000303A6 /* bitmath.c */; }; + 9502C30016C593690054F4E3 /* bitreader.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEDD15DBF23E000303A6 /* bitreader.c */; }; + 9502C30116C593690054F4E3 /* bitwriter.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEDE15DBF23E000303A6 /* bitwriter.c */; }; + 9502C30216C593690054F4E3 /* cpu.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEDF15DBF23E000303A6 /* cpu.c */; }; + 9502C30316C593690054F4E3 /* crc.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE015DBF23E000303A6 /* crc.c */; }; + 9502C30416C593690054F4E3 /* fixed.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE115DBF23E000303A6 /* fixed.c */; }; + 9502C30516C593690054F4E3 /* float.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE215DBF23E000303A6 /* float.c */; }; + 9502C30616C593690054F4E3 /* format.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE315DBF23E000303A6 /* format.c */; }; + 9502C30716C593690054F4E3 /* lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE415DBF23E000303A6 /* lpc.c */; }; + 9502C30816C593690054F4E3 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE515DBF23E000303A6 /* md5.c */; }; + 9502C30916C593690054F4E3 /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE615DBF23E000303A6 /* memory.c */; }; + 9502C30A16C593690054F4E3 /* metadata_iterators.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE715DBF23E000303A6 /* metadata_iterators.c */; }; + 9502C30B16C593690054F4E3 /* metadata_object.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE815DBF23E000303A6 /* metadata_object.c */; }; + 9502C30C16C593690054F4E3 /* ogg_decoder_aspect.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE915DBF23E000303A6 /* ogg_decoder_aspect.c */; }; + 9502C30D16C593690054F4E3 /* ogg_encoder_aspect.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEA15DBF23E000303A6 /* ogg_encoder_aspect.c */; }; + 9502C30E16C593690054F4E3 /* ogg_helper.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEB15DBF23E000303A6 /* ogg_helper.c */; }; + 9502C30F16C593690054F4E3 /* ogg_mapping.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEC15DBF23E000303A6 /* ogg_mapping.c */; }; + 9502C31016C593690054F4E3 /* stream_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEED15DBF23E000303A6 /* stream_decoder.c */; }; + 9502C31116C593690054F4E3 /* stream_encoder_framing.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEE15DBF23E000303A6 /* stream_encoder_framing.c */; }; + 9502C31216C593690054F4E3 /* stream_encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEF15DBF23E000303A6 /* stream_encoder.c */; }; + 9502C31316C593690054F4E3 /* window.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEF015DBF23E000303A6 /* window.c */; }; + 9502C31416C593790054F4E3 /* ogg.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F35015DC0C8F000303A6 /* ogg.h */; }; + 9502C31516C593790054F4E3 /* os_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F35115DC0C8F000303A6 /* os_types.h */; }; + 9502C31616C593790054F4E3 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EED915DBF05E000303A6 /* config.h */; }; + 9502C31716C593790054F4E3 /* all.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF0C15DBF3EA000303A6 /* all.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9502C31816C593790054F4E3 /* assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF0D15DBF3EA000303A6 /* assert.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9502C31916C593790054F4E3 /* callback.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF0E15DBF3EA000303A6 /* callback.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9502C31A16C593790054F4E3 /* export.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF0F15DBF3EA000303A6 /* export.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9502C31B16C593790054F4E3 /* format.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF1015DBF3EA000303A6 /* format.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9502C31C16C593790054F4E3 /* metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF1115DBF3EA000303A6 /* metadata.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9502C31D16C593790054F4E3 /* ordinals.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF1215DBF3EA000303A6 /* ordinals.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9502C31E16C593790054F4E3 /* stream_decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF1315DBF3EA000303A6 /* stream_decoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9502C31F16C593790054F4E3 /* stream_encoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF1415DBF3EA000303A6 /* stream_encoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529EF2E15DBF5F0000303A6 /* bitmath.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEDC15DBF23E000303A6 /* bitmath.c */; }; + 9529EF2F15DBF5F0000303A6 /* bitreader.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEDD15DBF23E000303A6 /* bitreader.c */; }; + 9529EF3015DBF5F0000303A6 /* bitwriter.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEDE15DBF23E000303A6 /* bitwriter.c */; }; + 9529EF3115DBF5F0000303A6 /* cpu.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEDF15DBF23E000303A6 /* cpu.c */; }; + 9529EF3215DBF5F0000303A6 /* crc.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE015DBF23E000303A6 /* crc.c */; }; + 9529EF3315DBF5F0000303A6 /* fixed.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE115DBF23E000303A6 /* fixed.c */; }; + 9529EF3415DBF5F0000303A6 /* float.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE215DBF23E000303A6 /* float.c */; }; + 9529EF3515DBF5F0000303A6 /* format.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE315DBF23E000303A6 /* format.c */; }; + 9529EF3615DBF5F0000303A6 /* lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE415DBF23E000303A6 /* lpc.c */; }; + 9529EF3715DBF5F0000303A6 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE515DBF23E000303A6 /* md5.c */; }; + 9529EF3815DBF5F0000303A6 /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE615DBF23E000303A6 /* memory.c */; }; + 9529EF3915DBF5F0000303A6 /* metadata_iterators.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE715DBF23E000303A6 /* metadata_iterators.c */; }; + 9529EF3A15DBF5F0000303A6 /* metadata_object.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE815DBF23E000303A6 /* metadata_object.c */; }; + 9529EF3B15DBF5F0000303A6 /* ogg_decoder_aspect.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE915DBF23E000303A6 /* ogg_decoder_aspect.c */; }; + 9529EF3C15DBF5F0000303A6 /* ogg_encoder_aspect.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEA15DBF23E000303A6 /* ogg_encoder_aspect.c */; }; + 9529EF3D15DBF5F0000303A6 /* ogg_helper.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEB15DBF23E000303A6 /* ogg_helper.c */; }; + 9529EF3E15DBF5F0000303A6 /* ogg_mapping.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEC15DBF23E000303A6 /* ogg_mapping.c */; }; + 9529EF3F15DBF5F0000303A6 /* stream_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEED15DBF23E000303A6 /* stream_decoder.c */; }; + 9529EF4015DBF5F0000303A6 /* stream_encoder_framing.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEE15DBF23E000303A6 /* stream_encoder_framing.c */; }; + 9529EF4115DBF5F0000303A6 /* stream_encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEF15DBF23E000303A6 /* stream_encoder.c */; }; + 9529EF4215DBF5F0000303A6 /* window.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEF015DBF23E000303A6 /* window.c */; }; + 9529EF4915DBF68E000303A6 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EED915DBF05E000303A6 /* config.h */; }; + 9529F36015DC0E56000303A6 /* bitwise.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529F35D15DC0E56000303A6 /* bitwise.c */; }; + 9529F36215DC0E56000303A6 /* framing.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529F35E15DC0E56000303A6 /* framing.c */; }; + 95AFB7C61808C8A300CBC14F /* bitwise.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529F35D15DC0E56000303A6 /* bitwise.c */; }; + 95AFB7C71808C8A300CBC14F /* framing.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529F35E15DC0E56000303A6 /* framing.c */; }; + 95AFB7C81808C8A300CBC14F /* bitmath.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEDC15DBF23E000303A6 /* bitmath.c */; }; + 95AFB7C91808C8A300CBC14F /* bitreader.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEDD15DBF23E000303A6 /* bitreader.c */; }; + 95AFB7CA1808C8A300CBC14F /* bitwriter.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEDE15DBF23E000303A6 /* bitwriter.c */; }; + 95AFB7CB1808C8A300CBC14F /* cpu.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEDF15DBF23E000303A6 /* cpu.c */; }; + 95AFB7CC1808C8A300CBC14F /* crc.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE015DBF23E000303A6 /* crc.c */; }; + 95AFB7CD1808C8A300CBC14F /* fixed.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE115DBF23E000303A6 /* fixed.c */; }; + 95AFB7CE1808C8A300CBC14F /* float.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE215DBF23E000303A6 /* float.c */; }; + 95AFB7CF1808C8A300CBC14F /* format.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE315DBF23E000303A6 /* format.c */; }; + 95AFB7D01808C8A300CBC14F /* lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE415DBF23E000303A6 /* lpc.c */; }; + 95AFB7D11808C8A300CBC14F /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE515DBF23E000303A6 /* md5.c */; }; + 95AFB7D21808C8A300CBC14F /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE615DBF23E000303A6 /* memory.c */; }; + 95AFB7D31808C8A300CBC14F /* metadata_iterators.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE715DBF23E000303A6 /* metadata_iterators.c */; }; + 95AFB7D41808C8A300CBC14F /* metadata_object.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE815DBF23E000303A6 /* metadata_object.c */; }; + 95AFB7D51808C8A300CBC14F /* ogg_decoder_aspect.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEE915DBF23E000303A6 /* ogg_decoder_aspect.c */; }; + 95AFB7D61808C8A300CBC14F /* ogg_encoder_aspect.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEA15DBF23E000303A6 /* ogg_encoder_aspect.c */; }; + 95AFB7D71808C8A300CBC14F /* ogg_helper.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEB15DBF23E000303A6 /* ogg_helper.c */; }; + 95AFB7D81808C8A300CBC14F /* ogg_mapping.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEC15DBF23E000303A6 /* ogg_mapping.c */; }; + 95AFB7D91808C8A300CBC14F /* stream_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEED15DBF23E000303A6 /* stream_decoder.c */; }; + 95AFB7DA1808C8A300CBC14F /* stream_encoder_framing.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEE15DBF23E000303A6 /* stream_encoder_framing.c */; }; + 95AFB7DB1808C8A300CBC14F /* stream_encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEEF15DBF23E000303A6 /* stream_encoder.c */; }; + 95AFB7DC1808C8A300CBC14F /* window.c in Sources */ = {isa = PBXBuildFile; fileRef = 9529EEF015DBF23E000303A6 /* window.c */; }; + 95AFB7DD1808C8AC00CBC14F /* ogg.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F35015DC0C8F000303A6 /* ogg.h */; }; + 95AFB7DE1808C8AC00CBC14F /* os_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F35115DC0C8F000303A6 /* os_types.h */; }; + 95AFB7DF1808C8AC00CBC14F /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EED915DBF05E000303A6 /* config.h */; }; + 95AFB7E01808C8AC00CBC14F /* all.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF0C15DBF3EA000303A6 /* all.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95AFB7E11808C8AC00CBC14F /* assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF0D15DBF3EA000303A6 /* assert.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95AFB7E21808C8AC00CBC14F /* callback.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF0E15DBF3EA000303A6 /* callback.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95AFB7E31808C8AC00CBC14F /* export.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF0F15DBF3EA000303A6 /* export.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95AFB7E41808C8AC00CBC14F /* format.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF1015DBF3EA000303A6 /* format.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95AFB7E51808C8AC00CBC14F /* metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF1115DBF3EA000303A6 /* metadata.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95AFB7E61808C8AC00CBC14F /* ordinals.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF1215DBF3EA000303A6 /* ordinals.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95AFB7E71808C8AC00CBC14F /* stream_decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF1315DBF3EA000303A6 /* stream_decoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95AFB7E81808C8AC00CBC14F /* stream_encoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529EF1415DBF3EA000303A6 /* stream_encoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9529EF2015DBF5D7000303A6 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/${PRODUCT_NAME}"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 9502C2E916C5932B0054F4E3 /* FLAC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FLAC.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9529EDC715DBE25F000303A6 /* FLAC-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FLAC-Info.plist"; sourceTree = ""; }; + 9529EED915DBF05E000303A6 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = SOURCE_ROOT; }; + 9529EEDC15DBF23E000303A6 /* bitmath.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bitmath.c; path = "../../flac-src/src/libFLAC/bitmath.c"; sourceTree = ""; }; + 9529EEDD15DBF23E000303A6 /* bitreader.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bitreader.c; path = "../../flac-src/src/libFLAC/bitreader.c"; sourceTree = ""; }; + 9529EEDE15DBF23E000303A6 /* bitwriter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bitwriter.c; path = "../../flac-src/src/libFLAC/bitwriter.c"; sourceTree = ""; }; + 9529EEDF15DBF23E000303A6 /* cpu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cpu.c; path = "../../flac-src/src/libFLAC/cpu.c"; sourceTree = ""; }; + 9529EEE015DBF23E000303A6 /* crc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = crc.c; path = "../../flac-src/src/libFLAC/crc.c"; sourceTree = ""; }; + 9529EEE115DBF23E000303A6 /* fixed.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fixed.c; path = "../../flac-src/src/libFLAC/fixed.c"; sourceTree = ""; }; + 9529EEE215DBF23E000303A6 /* float.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = float.c; path = "../../flac-src/src/libFLAC/float.c"; sourceTree = ""; }; + 9529EEE315DBF23E000303A6 /* format.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = format.c; path = "../../flac-src/src/libFLAC/format.c"; sourceTree = ""; }; + 9529EEE415DBF23E000303A6 /* lpc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lpc.c; path = "../../flac-src/src/libFLAC/lpc.c"; sourceTree = ""; }; + 9529EEE515DBF23E000303A6 /* md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = md5.c; path = "../../flac-src/src/libFLAC/md5.c"; sourceTree = ""; }; + 9529EEE615DBF23E000303A6 /* memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = memory.c; path = "../../flac-src/src/libFLAC/memory.c"; sourceTree = ""; }; + 9529EEE715DBF23E000303A6 /* metadata_iterators.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = metadata_iterators.c; path = "../../flac-src/src/libFLAC/metadata_iterators.c"; sourceTree = ""; }; + 9529EEE815DBF23E000303A6 /* metadata_object.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = metadata_object.c; path = "../../flac-src/src/libFLAC/metadata_object.c"; sourceTree = ""; }; + 9529EEE915DBF23E000303A6 /* ogg_decoder_aspect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ogg_decoder_aspect.c; path = "../../flac-src/src/libFLAC/ogg_decoder_aspect.c"; sourceTree = ""; }; + 9529EEEA15DBF23E000303A6 /* ogg_encoder_aspect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ogg_encoder_aspect.c; path = "../../flac-src/src/libFLAC/ogg_encoder_aspect.c"; sourceTree = ""; }; + 9529EEEB15DBF23E000303A6 /* ogg_helper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ogg_helper.c; path = "../../flac-src/src/libFLAC/ogg_helper.c"; sourceTree = ""; }; + 9529EEEC15DBF23E000303A6 /* ogg_mapping.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ogg_mapping.c; path = "../../flac-src/src/libFLAC/ogg_mapping.c"; sourceTree = ""; }; + 9529EEED15DBF23E000303A6 /* stream_decoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stream_decoder.c; path = "../../flac-src/src/libFLAC/stream_decoder.c"; sourceTree = ""; }; + 9529EEEE15DBF23E000303A6 /* stream_encoder_framing.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stream_encoder_framing.c; path = "../../flac-src/src/libFLAC/stream_encoder_framing.c"; sourceTree = ""; }; + 9529EEEF15DBF23E000303A6 /* stream_encoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stream_encoder.c; path = "../../flac-src/src/libFLAC/stream_encoder.c"; sourceTree = ""; }; + 9529EEF015DBF23E000303A6 /* window.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = window.c; path = "../../flac-src/src/libFLAC/window.c"; sourceTree = ""; }; + 9529EF0C15DBF3EA000303A6 /* all.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = all.h; path = "../../flac-src/include/FLAC/all.h"; sourceTree = ""; }; + 9529EF0D15DBF3EA000303A6 /* assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = assert.h; path = "../../flac-src/include/FLAC/assert.h"; sourceTree = ""; }; + 9529EF0E15DBF3EA000303A6 /* callback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = callback.h; path = "../../flac-src/include/FLAC/callback.h"; sourceTree = ""; }; + 9529EF0F15DBF3EA000303A6 /* export.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = export.h; path = "../../flac-src/include/FLAC/export.h"; sourceTree = ""; }; + 9529EF1015DBF3EA000303A6 /* format.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = format.h; path = "../../flac-src/include/FLAC/format.h"; sourceTree = ""; }; + 9529EF1115DBF3EA000303A6 /* metadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = metadata.h; path = "../../flac-src/include/FLAC/metadata.h"; sourceTree = ""; }; + 9529EF1215DBF3EA000303A6 /* ordinals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ordinals.h; path = "../../flac-src/include/FLAC/ordinals.h"; sourceTree = ""; }; + 9529EF1315DBF3EA000303A6 /* stream_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stream_decoder.h; path = "../../flac-src/include/FLAC/stream_decoder.h"; sourceTree = ""; }; + 9529EF1415DBF3EA000303A6 /* stream_encoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stream_encoder.h; path = "../../flac-src/include/FLAC/stream_encoder.h"; sourceTree = ""; }; + 9529EF2215DBF5D7000303A6 /* libFLAC.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFLAC.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 9529F35015DC0C8F000303A6 /* ogg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ogg.h; path = "../../libogg-src/include/ogg/ogg.h"; sourceTree = ""; }; + 9529F35115DC0C8F000303A6 /* os_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = os_types.h; path = "../../libogg-src/include/ogg/os_types.h"; sourceTree = ""; }; + 9529F35D15DC0E56000303A6 /* bitwise.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bitwise.c; path = "../../libogg-src/src/bitwise.c"; sourceTree = ""; }; + 9529F35E15DC0E56000303A6 /* framing.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = framing.c; path = "../../libogg-src/src/framing.c"; sourceTree = ""; }; + 95AFB7BB1808C86400CBC14F /* FLAC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FLAC.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 9502C2E516C5932B0054F4E3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9529EF1F15DBF5D7000303A6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95AFB7B51808C86400CBC14F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9529EDB415DBE25F000303A6 = { + isa = PBXGroup; + children = ( + 9529EDC515DBE25F000303A6 /* FLAC */, + 9529EDC415DBE25F000303A6 /* Products */, + ); + sourceTree = ""; + }; + 9529EDC415DBE25F000303A6 /* Products */ = { + isa = PBXGroup; + children = ( + 9529EF2215DBF5D7000303A6 /* libFLAC.a */, + 9502C2E916C5932B0054F4E3 /* FLAC.framework */, + 95AFB7BB1808C86400CBC14F /* FLAC.framework */, + ); + name = Products; + sourceTree = ""; + }; + 9529EDC515DBE25F000303A6 /* FLAC */ = { + isa = PBXGroup; + children = ( + 9529EF0615DBF283000303A6 /* headers */, + 9529EEDB15DBF235000303A6 /* src */, + 9529EDC615DBE25F000303A6 /* Supporting Files */, + ); + path = FLAC; + sourceTree = ""; + }; + 9529EDC615DBE25F000303A6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 9529EDC715DBE25F000303A6 /* FLAC-Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 9529EEDB15DBF235000303A6 /* src */ = { + isa = PBXGroup; + children = ( + 9529F35D15DC0E56000303A6 /* bitwise.c */, + 9529F35E15DC0E56000303A6 /* framing.c */, + 9529EEDC15DBF23E000303A6 /* bitmath.c */, + 9529EEDD15DBF23E000303A6 /* bitreader.c */, + 9529EEDE15DBF23E000303A6 /* bitwriter.c */, + 9529EEDF15DBF23E000303A6 /* cpu.c */, + 9529EEE015DBF23E000303A6 /* crc.c */, + 9529EEE115DBF23E000303A6 /* fixed.c */, + 9529EEE215DBF23E000303A6 /* float.c */, + 9529EEE315DBF23E000303A6 /* format.c */, + 9529EEE415DBF23E000303A6 /* lpc.c */, + 9529EEE515DBF23E000303A6 /* md5.c */, + 9529EEE615DBF23E000303A6 /* memory.c */, + 9529EEE715DBF23E000303A6 /* metadata_iterators.c */, + 9529EEE815DBF23E000303A6 /* metadata_object.c */, + 9529EEE915DBF23E000303A6 /* ogg_decoder_aspect.c */, + 9529EEEA15DBF23E000303A6 /* ogg_encoder_aspect.c */, + 9529EEEB15DBF23E000303A6 /* ogg_helper.c */, + 9529EEEC15DBF23E000303A6 /* ogg_mapping.c */, + 9529EEED15DBF23E000303A6 /* stream_decoder.c */, + 9529EEEE15DBF23E000303A6 /* stream_encoder_framing.c */, + 9529EEEF15DBF23E000303A6 /* stream_encoder.c */, + 9529EEF015DBF23E000303A6 /* window.c */, + ); + name = src; + sourceTree = ""; + }; + 9529EF0615DBF283000303A6 /* headers */ = { + isa = PBXGroup; + children = ( + 9529F35015DC0C8F000303A6 /* ogg.h */, + 9529F35115DC0C8F000303A6 /* os_types.h */, + 9529EED915DBF05E000303A6 /* config.h */, + 9529EF0C15DBF3EA000303A6 /* all.h */, + 9529EF0D15DBF3EA000303A6 /* assert.h */, + 9529EF0E15DBF3EA000303A6 /* callback.h */, + 9529EF0F15DBF3EA000303A6 /* export.h */, + 9529EF1015DBF3EA000303A6 /* format.h */, + 9529EF1115DBF3EA000303A6 /* metadata.h */, + 9529EF1215DBF3EA000303A6 /* ordinals.h */, + 9529EF1315DBF3EA000303A6 /* stream_decoder.h */, + 9529EF1415DBF3EA000303A6 /* stream_encoder.h */, + ); + name = headers; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 9502C2E616C5932B0054F4E3 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 9502C31716C593790054F4E3 /* all.h in Headers */, + 9502C31816C593790054F4E3 /* assert.h in Headers */, + 9502C31916C593790054F4E3 /* callback.h in Headers */, + 9502C31A16C593790054F4E3 /* export.h in Headers */, + 9502C31B16C593790054F4E3 /* format.h in Headers */, + 9502C31C16C593790054F4E3 /* metadata.h in Headers */, + 9502C31D16C593790054F4E3 /* ordinals.h in Headers */, + 9502C31E16C593790054F4E3 /* stream_decoder.h in Headers */, + 9502C31F16C593790054F4E3 /* stream_encoder.h in Headers */, + 9502C31416C593790054F4E3 /* ogg.h in Headers */, + 9502C31516C593790054F4E3 /* os_types.h in Headers */, + 9502C31616C593790054F4E3 /* config.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9529EF4815DBF687000303A6 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 9529EF4915DBF68E000303A6 /* config.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95AFB7B61808C86400CBC14F /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 95AFB7E01808C8AC00CBC14F /* all.h in Headers */, + 95AFB7E11808C8AC00CBC14F /* assert.h in Headers */, + 95AFB7E21808C8AC00CBC14F /* callback.h in Headers */, + 95AFB7E31808C8AC00CBC14F /* export.h in Headers */, + 95AFB7E41808C8AC00CBC14F /* format.h in Headers */, + 95AFB7E51808C8AC00CBC14F /* metadata.h in Headers */, + 95AFB7E61808C8AC00CBC14F /* ordinals.h in Headers */, + 95AFB7E71808C8AC00CBC14F /* stream_decoder.h in Headers */, + 95AFB7E81808C8AC00CBC14F /* stream_encoder.h in Headers */, + 95AFB7DD1808C8AC00CBC14F /* ogg.h in Headers */, + 95AFB7DE1808C8AC00CBC14F /* os_types.h in Headers */, + 95AFB7DF1808C8AC00CBC14F /* config.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 9502C2E816C5932B0054F4E3 /* FLAC_OSX */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9502C2FC16C5932B0054F4E3 /* Build configuration list for PBXNativeTarget "FLAC_OSX" */; + buildPhases = ( + 9502C2E416C5932B0054F4E3 /* Sources */, + 9502C2E516C5932B0054F4E3 /* Frameworks */, + 9502C2E616C5932B0054F4E3 /* Headers */, + 9502C2E716C5932B0054F4E3 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FLAC_OSX; + productName = FlacMac; + productReference = 9502C2E916C5932B0054F4E3 /* FLAC.framework */; + productType = "com.apple.product-type.framework"; + }; + 9529EF2115DBF5D7000303A6 /* libFLAC */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9529EF2B15DBF5D7000303A6 /* Build configuration list for PBXNativeTarget "libFLAC" */; + buildPhases = ( + 9529EF4815DBF687000303A6 /* Headers */, + 9529EF1E15DBF5D7000303A6 /* Sources */, + 9529EF1F15DBF5D7000303A6 /* Frameworks */, + 9529EF2015DBF5D7000303A6 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = libFLAC; + productName = libFLAC; + productReference = 9529EF2215DBF5D7000303A6 /* libFLAC.a */; + productType = "com.apple.product-type.library.static"; + }; + 95AFB7BA1808C86400CBC14F /* FLAC */ = { + isa = PBXNativeTarget; + buildConfigurationList = 95AFB7C31808C86400CBC14F /* Build configuration list for PBXNativeTarget "FLAC" */; + buildPhases = ( + 95AFB7B31808C86400CBC14F /* ShellScript */, + 95AFB7B41808C86400CBC14F /* Sources */, + 95AFB7B51808C86400CBC14F /* Frameworks */, + 95AFB7B61808C86400CBC14F /* Headers */, + 95AFB7B71808C86400CBC14F /* Resources */, + 95AFB7B81808C86400CBC14F /* ShellScript */, + 95AFB7B91808C86400CBC14F /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FLAC; + productName = FLAC; + productReference = 95AFB7BB1808C86400CBC14F /* FLAC.framework */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 9529EDB615DBE25F000303A6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + }; + buildConfigurationList = 9529EDB915DBE25F000303A6 /* Build configuration list for PBXProject "FLAC" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 9529EDB415DBE25F000303A6; + productRefGroup = 9529EDC415DBE25F000303A6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 95AFB7BA1808C86400CBC14F /* FLAC */, + 9529EF2115DBF5D7000303A6 /* libFLAC */, + 9502C2E816C5932B0054F4E3 /* FLAC_OSX */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 9502C2E716C5932B0054F4E3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95AFB7B71808C86400CBC14F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 95AFB7B31808C86400CBC14F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n\tUFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Clean other platform if needed\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n\techo \"Platform \\\"$UFW_SDK_PLATFORM\\\" was cleaned recently. Cleaning \\\"$UFW_OTHER_PLATFORM\\\" as well\"\n\techo xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\n\txcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\nfi\n\n\n# Make sure we are building from fresh binaries\n\nrm -rf \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\n"; + }; + 95AFB7B81808C86400CBC14F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "HEADERS_ROOT=$SRCROOT/$PRODUCT_NAME\nFRAMEWORK_HEADERS_DIR=\"$BUILT_PRODUCTS_DIR/$WRAPPER_NAME/Versions/$FRAMEWORK_VERSION/Headers\"\n\n## only header files expected at this point\nPUBLIC_HEADERS=$(find $FRAMEWORK_HEADERS_DIR/. -not -type d 2> /dev/null | sed -e \"s@.*/@@g\")\n\nFIND_OPTS=\"\"\nfor PUBLIC_HEADER in $PUBLIC_HEADERS; do\n if [ -n \"$FIND_OPTS\" ]; then\n FIND_OPTS=\"$FIND_OPTS -o\"\n fi\n FIND_OPTS=\"$FIND_OPTS -name '$PUBLIC_HEADER'\"\ndone\n\nif [ -n \"$FIND_OPTS\" ]; then\n for ORIG_HEADER in $(eval \"find $HEADERS_ROOT/. $FIND_OPTS\" 2> /dev/null | sed -e \"s@^$HEADERS_ROOT/./@@g\"); do\n PUBLIC_HEADER=$(basename $ORIG_HEADER)\n RELATIVE_PATH=$(dirname $ORIG_HEADER)\n if [ -e $FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER ]; then\n mkdir -p \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH\"\n mv \"$FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER\" \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH/$PUBLIC_HEADER\"\n fi\n done\nfi\n"; + }; + 95AFB7B91808C86400CBC14F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\nexport UFW_MASTER_SCRIPT_RUNNING=1\n\n\n# Functions\n\n## List files in the specified directory, storing to the specified array.\n#\n# @param $1 The path to list\n# @param $2 The name of the array to fill\n#\n##\nlist_files ()\n{\n filelist=$(ls \"$1\")\n while read line\n do\n eval \"$2[\\${#$2[*]}]=\\\"\\$line\\\"\"\n done <<< \"$filelist\"\n}\n\n\n# Sanity check\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n echo \"Framework target \\\"${TARGET_NAME}\\\" had no source files to build from. Make sure your source files have the correct target membership\"\n exit 1\nfi\n\n\n# Gather information\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n UFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date.\n# We already checked the other platform in the prerun script.\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Make sure the other platform gets built\n\necho \"Build other platform\"\n\necho xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\n\n\n# Build the fat static library binary\n\necho \"Create universal static library\"\n\nif [[ \"$XCODE_VERSION_MAJOR\" = \"0500\" ]]\nthen\n echo \"$DT_TOOLCHAIN_DIR/usr/bin/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$DT_TOOLCHAIN_DIR/usr/bin/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\nelse\n echo \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\nfi \n\necho mv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nmv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\n\n\n# Build framework structure\n\necho \"Build symlinks\"\n\necho ln -sfh $FRAMEWORK_VERSION \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\nln -sfh $FRAMEWORK_VERSION \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\necho ln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\nln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\necho ln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\nln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\necho ln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\nln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\n\n\n# Link to binary for unit tests\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework\"\nln -sfh \"../${WRAPPER_NAME}/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework/.fake_fw_testing\"\n\n\n# Build embedded framework structure\n\necho \"Build Embedded Framework\"\n\necho rm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\necho mkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\nmkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\necho cp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\ncp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\n\ndeclare -a UFW_FILE_LIST\nlist_files \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\" UFW_FILE_LIST\nfor filename in \"${UFW_FILE_LIST[@]}\"\ndo\n if [[ \"${filename}\" != \"Info.plist\" ]] && [[ ! \"${filename}\" =~ .*\\.lproj$ ]]\n then\n echo ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n fi\ndone\n\n\n# Replace other platform's framework with a copy of this one (so that both have the same universal binary)\n\necho \"Copy from $UFW_SDK_PLATFORM to $UFW_OTHER_PLATFORM\"\n\necho rm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\nrm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\necho cp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\ncp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 9502C2E416C5932B0054F4E3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9502C2FD16C593690054F4E3 /* bitwise.c in Sources */, + 9502C2FE16C593690054F4E3 /* framing.c in Sources */, + 9502C2FF16C593690054F4E3 /* bitmath.c in Sources */, + 9502C30016C593690054F4E3 /* bitreader.c in Sources */, + 9502C30116C593690054F4E3 /* bitwriter.c in Sources */, + 9502C30216C593690054F4E3 /* cpu.c in Sources */, + 9502C30316C593690054F4E3 /* crc.c in Sources */, + 9502C30416C593690054F4E3 /* fixed.c in Sources */, + 9502C30516C593690054F4E3 /* float.c in Sources */, + 9502C30616C593690054F4E3 /* format.c in Sources */, + 9502C30716C593690054F4E3 /* lpc.c in Sources */, + 9502C30816C593690054F4E3 /* md5.c in Sources */, + 9502C30916C593690054F4E3 /* memory.c in Sources */, + 9502C30A16C593690054F4E3 /* metadata_iterators.c in Sources */, + 9502C30B16C593690054F4E3 /* metadata_object.c in Sources */, + 9502C30C16C593690054F4E3 /* ogg_decoder_aspect.c in Sources */, + 9502C30D16C593690054F4E3 /* ogg_encoder_aspect.c in Sources */, + 9502C30E16C593690054F4E3 /* ogg_helper.c in Sources */, + 9502C30F16C593690054F4E3 /* ogg_mapping.c in Sources */, + 9502C31016C593690054F4E3 /* stream_decoder.c in Sources */, + 9502C31116C593690054F4E3 /* stream_encoder_framing.c in Sources */, + 9502C31216C593690054F4E3 /* stream_encoder.c in Sources */, + 9502C31316C593690054F4E3 /* window.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9529EF1E15DBF5D7000303A6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9529EF2E15DBF5F0000303A6 /* bitmath.c in Sources */, + 9529EF2F15DBF5F0000303A6 /* bitreader.c in Sources */, + 9529EF3015DBF5F0000303A6 /* bitwriter.c in Sources */, + 9529EF3115DBF5F0000303A6 /* cpu.c in Sources */, + 9529EF3215DBF5F0000303A6 /* crc.c in Sources */, + 9529EF3315DBF5F0000303A6 /* fixed.c in Sources */, + 9529EF3415DBF5F0000303A6 /* float.c in Sources */, + 9529EF3515DBF5F0000303A6 /* format.c in Sources */, + 9529EF3615DBF5F0000303A6 /* lpc.c in Sources */, + 9529EF3715DBF5F0000303A6 /* md5.c in Sources */, + 9529EF3815DBF5F0000303A6 /* memory.c in Sources */, + 9529EF3915DBF5F0000303A6 /* metadata_iterators.c in Sources */, + 9529EF3A15DBF5F0000303A6 /* metadata_object.c in Sources */, + 9529EF3B15DBF5F0000303A6 /* ogg_decoder_aspect.c in Sources */, + 9529EF3C15DBF5F0000303A6 /* ogg_encoder_aspect.c in Sources */, + 9529EF3D15DBF5F0000303A6 /* ogg_helper.c in Sources */, + 9529EF3E15DBF5F0000303A6 /* ogg_mapping.c in Sources */, + 9529EF3F15DBF5F0000303A6 /* stream_decoder.c in Sources */, + 9529EF4015DBF5F0000303A6 /* stream_encoder_framing.c in Sources */, + 9529EF4115DBF5F0000303A6 /* stream_encoder.c in Sources */, + 9529EF4215DBF5F0000303A6 /* window.c in Sources */, + 9529F36015DC0E56000303A6 /* bitwise.c in Sources */, + 9529F36215DC0E56000303A6 /* framing.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95AFB7B41808C86400CBC14F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 95AFB7C61808C8A300CBC14F /* bitwise.c in Sources */, + 95AFB7C71808C8A300CBC14F /* framing.c in Sources */, + 95AFB7C81808C8A300CBC14F /* bitmath.c in Sources */, + 95AFB7C91808C8A300CBC14F /* bitreader.c in Sources */, + 95AFB7CA1808C8A300CBC14F /* bitwriter.c in Sources */, + 95AFB7CB1808C8A300CBC14F /* cpu.c in Sources */, + 95AFB7CC1808C8A300CBC14F /* crc.c in Sources */, + 95AFB7CD1808C8A300CBC14F /* fixed.c in Sources */, + 95AFB7CE1808C8A300CBC14F /* float.c in Sources */, + 95AFB7CF1808C8A300CBC14F /* format.c in Sources */, + 95AFB7D01808C8A300CBC14F /* lpc.c in Sources */, + 95AFB7D11808C8A300CBC14F /* md5.c in Sources */, + 95AFB7D21808C8A300CBC14F /* memory.c in Sources */, + 95AFB7D31808C8A300CBC14F /* metadata_iterators.c in Sources */, + 95AFB7D41808C8A300CBC14F /* metadata_object.c in Sources */, + 95AFB7D51808C8A300CBC14F /* ogg_decoder_aspect.c in Sources */, + 95AFB7D61808C8A300CBC14F /* ogg_encoder_aspect.c in Sources */, + 95AFB7D71808C8A300CBC14F /* ogg_helper.c in Sources */, + 95AFB7D81808C8A300CBC14F /* ogg_mapping.c in Sources */, + 95AFB7D91808C8A300CBC14F /* stream_decoder.c in Sources */, + 95AFB7DA1808C8A300CBC14F /* stream_encoder_framing.c in Sources */, + 95AFB7DB1808C8A300CBC14F /* stream_encoder.c in Sources */, + 95AFB7DC1808C8A300CBC14F /* window.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 9502C2FA16C5932B0054F4E3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_INT_CONVERSION = YES; + COMBINE_HIDPI_IMAGES = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks\"", + ); + FRAMEWORK_VERSION = A; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; + HEADER_SEARCH_PATHS = ( + "../flac-src/src/libFLAC/include/", + "../flac-src/include/", + "../libogg-src/include/", + ); + INFOPLIST_FILE = "FLAC/FLAC-Info.plist"; + INSTALL_PATH = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.8; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = FLAC; + SDKROOT = macosx; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = framework; + }; + name = Debug; + }; + 9502C2FB16C5932B0054F4E3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_INT_CONVERSION = YES; + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks\"", + ); + FRAMEWORK_VERSION = A; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; + HEADER_SEARCH_PATHS = ( + "../flac-src/src/libFLAC/include/", + "../flac-src/include/", + "../libogg-src/include/", + ); + INFOPLIST_FILE = "FLAC/FLAC-Info.plist"; + INSTALL_PATH = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.8; + PRODUCT_NAME = FLAC; + SDKROOT = macosx; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = framework; + }; + name = Release; + }; + 9529EDCC15DBE25F000303A6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 9529EDCD15DBE25F000303A6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 9529EF2C15DBF5D7000303A6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/libFLAC.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; + HEADER_SEARCH_PATHS = ( + "../flac-src/include/", + "../libogg-src/include/", + "../flac-src/src/libFLAC/include/", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = FLAC; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 9529EF2D15DBF5D7000303A6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/libFLAC.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; + HEADER_SEARCH_PATHS = ( + "../flac-src/include/", + "../libogg-src/include/", + "../flac-src/src/libFLAC/include/", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = FLAC; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 95AFB7C41808C86400CBC14F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; + DEAD_CODE_STRIPPING = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../flac-src/include/", + "../libogg-src/include/", + "../flac-src/src/libFLAC/include/", + ); + INFOPLIST_FILE = "FLAC/FLAC-Info.plist"; + INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + WRAPPER_EXTENSION = framework; + }; + name = Debug; + }; + 95AFB7C51808C86400CBC14F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; + DEAD_CODE_STRIPPING = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + ENABLE_NS_ASSERTIONS = NO; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../flac-src/include/", + "../libogg-src/include/", + "../flac-src/src/libFLAC/include/", + ); + INFOPLIST_FILE = "FLAC/FLAC-Info.plist"; + INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + WRAPPER_EXTENSION = framework; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 9502C2FC16C5932B0054F4E3 /* Build configuration list for PBXNativeTarget "FLAC_OSX" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9502C2FA16C5932B0054F4E3 /* Debug */, + 9502C2FB16C5932B0054F4E3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 9529EDB915DBE25F000303A6 /* Build configuration list for PBXProject "FLAC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9529EDCC15DBE25F000303A6 /* Debug */, + 9529EDCD15DBE25F000303A6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 9529EF2B15DBF5D7000303A6 /* Build configuration list for PBXNativeTarget "libFLAC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9529EF2C15DBF5D7000303A6 /* Debug */, + 9529EF2D15DBF5D7000303A6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 95AFB7C31808C86400CBC14F /* Build configuration list for PBXNativeTarget "FLAC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95AFB7C41808C86400CBC14F /* Debug */, + 95AFB7C51808C86400CBC14F /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 9529EDB615DBE25F000303A6 /* Project object */; +} diff --git a/Audio-Frameworks/FLAC/FLAC/FLAC-Info.plist b/Audio-Frameworks/FLAC/FLAC/FLAC-Info.plist new file mode 100644 index 0000000..9dec469 --- /dev/null +++ b/Audio-Frameworks/FLAC/FLAC/FLAC-Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.ap4y.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSPrincipalClass + + + diff --git a/Audio-Frameworks/FLAC/config.h b/Audio-Frameworks/FLAC/config.h new file mode 100755 index 0000000..39ba8b5 --- /dev/null +++ b/Audio-Frameworks/FLAC/config.h @@ -0,0 +1,145 @@ +/* config.h. Generated by configure. */ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* define to align allocated memory on 32-byte boundaries */ +#define FLAC__ALIGN_MALLOC_DATA 1 + +/* define if building for ia32/i386 */ +#if __LITTLE_ENDIAN__ +#define FLAC__CPU_IA32 1 +#endif + +/* define if building for PowerPC */ +#if __BIG_ENDIAN__ +#define FLAC__CPU_PPC 1 +#endif + +/* define if building for SPARC */ +/* #undef FLAC__CPU_SPARC */ + +/* define if you are compiling for PowerPC and have the 'as' assembler */ +/* #undef FLAC__HAS_AS */ + +/* define if you have docbook-to-man or docbook2man */ +/* #undef FLAC__HAS_DOCBOOK_TO_MAN */ + +/* define if you are compiling for PowerPC and have the 'gas' assembler */ +#define FLAC__HAS_GAS 1 + +/* define if you are compiling for x86 and have the NASM assembler */ +#define FLAC__HAS_NASM 1 + +/* define if you have the ogg library */ +#define FLAC__HAS_OGG 1 + +/* define to disable use of assembly code */ +#define FLAC__NO_ASM 1 + +/* define if your operating system supports SSE instructions */ +/* #undef FLAC__SSE_OS */ + +/* define if building for Darwin / MacOS X */ +#define FLAC__SYS_DARWIN 1 + +/* define if building for Linux */ +/* #undef FLAC__SYS_LINUX */ + +/* define to enable use of 3Dnow! instructions */ +#define FLAC__USE_3DNOW 1 + +/* define to enable use of Altivec instructions */ +#define FLAC__USE_ALTIVEC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#define HAVE_FSEEKO 1 + +/* Define to 1 if you have the `getopt_long' function. */ +#define HAVE_GETOPT_LONG 1 + +/* Define if you have the iconv() function. */ +#define HAVE_ICONV 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if you have and nl_langinfo(CODESET). */ +#define HAVE_LANGINFO_CODESET 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if the system has the type `socklen_t'. */ +/* #undef HAVE_SOCKLEN_T */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define as const if the declaration of iconv() needs const. */ +#define ICONV_CONST + +/* Name of package */ +#define PACKAGE "flac" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* The size of a `void*', as computed by sizeof. */ +#if (defined __LP64__) || (defined __ppc64__) +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "1.2.1" + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#if __BIG_ENDIAN__ +#define WORDS_BIGENDIAN 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* #undef _LARGEFILE_SOURCE */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ diff --git a/Audio-Frameworks/Ogg/Ogg.xcodeproj/project.pbxproj b/Audio-Frameworks/Ogg/Ogg.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e7db203 --- /dev/null +++ b/Audio-Frameworks/Ogg/Ogg.xcodeproj/project.pbxproj @@ -0,0 +1,573 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 95C8733217F6C81200F6C878 /* ogg.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8733017F6C81200F6C878 /* ogg.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95C8733317F6C81200F6C878 /* os_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8733117F6C81200F6C878 /* os_types.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95C8733717F6C82B00F6C878 /* bitwise.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8733517F6C82B00F6C878 /* bitwise.c */; }; + 95C8733817F6C82B00F6C878 /* framing.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8733617F6C82B00F6C878 /* framing.c */; }; + 95C873EF17F6D1AF00F6C878 /* bitwise.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8733517F6C82B00F6C878 /* bitwise.c */; }; + 95C873F017F6D1AF00F6C878 /* framing.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8733617F6C82B00F6C878 /* framing.c */; }; + 95C873F217F6D1C200F6C878 /* ogg.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8733017F6C81200F6C878 /* ogg.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95C873F317F6D1C200F6C878 /* os_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8733117F6C81200F6C878 /* os_types.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95F27DE917F6DDBB009E13C6 /* bitwise.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8733517F6C82B00F6C878 /* bitwise.c */; }; + 95F27DEA17F6DDBB009E13C6 /* framing.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8733617F6C82B00F6C878 /* framing.c */; }; + 95F27DEB17F6DDC0009E13C6 /* ogg.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8733017F6C81200F6C878 /* ogg.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95F27DEC17F6DDC0009E13C6 /* os_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8733117F6C81200F6C878 /* os_types.h */; settings = {ATTRIBUTES = (Public, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 95C873C717F6D18300F6C878 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 95C8730117F6C7CA00F6C878 /* Ogg.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Ogg.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 95C8730C17F6C7CA00F6C878 /* Ogg-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Ogg-Info.plist"; sourceTree = ""; }; + 95C8733017F6C81200F6C878 /* ogg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ogg.h; path = "../../libogg-src/include/ogg/ogg.h"; sourceTree = ""; }; + 95C8733117F6C81200F6C878 /* os_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = os_types.h; path = "../../libogg-src/include/ogg/os_types.h"; sourceTree = ""; }; + 95C8733517F6C82B00F6C878 /* bitwise.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bitwise.c; path = "../../libogg-src/src/bitwise.c"; sourceTree = ""; }; + 95C8733617F6C82B00F6C878 /* framing.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = framing.c; path = "../../libogg-src/src/framing.c"; sourceTree = ""; }; + 95C873C917F6D18300F6C878 /* libogg.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libogg.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 95F27DC417F6DD93009E13C6 /* Ogg.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Ogg.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 95F27DC717F6DD93009E13C6 /* Ogg_ios-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Ogg_ios-Info.plist"; path = "Ogg_ios/Ogg_ios-Info.plist"; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 95C872FD17F6C7CA00F6C878 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95C873C617F6D18300F6C878 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95F27DBE17F6DD93009E13C6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 95C872F717F6C7CA00F6C878 = { + isa = PBXGroup; + children = ( + 95C8730A17F6C7CA00F6C878 /* Ogg */, + 95C8730217F6C7CA00F6C878 /* Products */, + ); + sourceTree = ""; + }; + 95C8730217F6C7CA00F6C878 /* Products */ = { + isa = PBXGroup; + children = ( + 95C8730117F6C7CA00F6C878 /* Ogg.framework */, + 95C873C917F6D18300F6C878 /* libogg.a */, + 95F27DC417F6DD93009E13C6 /* Ogg.framework */, + ); + name = Products; + sourceTree = ""; + }; + 95C8730A17F6C7CA00F6C878 /* Ogg */ = { + isa = PBXGroup; + children = ( + 95C8732F17F6C80400F6C878 /* include */, + 95C8733417F6C82100F6C878 /* src */, + 95C8730B17F6C7CA00F6C878 /* Supporting Files */, + ); + path = Ogg; + sourceTree = ""; + }; + 95C8730B17F6C7CA00F6C878 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 95F27DC717F6DD93009E13C6 /* Ogg_ios-Info.plist */, + 95C8730C17F6C7CA00F6C878 /* Ogg-Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 95C8732F17F6C80400F6C878 /* include */ = { + isa = PBXGroup; + children = ( + 95C8733017F6C81200F6C878 /* ogg.h */, + 95C8733117F6C81200F6C878 /* os_types.h */, + ); + name = include; + sourceTree = ""; + }; + 95C8733417F6C82100F6C878 /* src */ = { + isa = PBXGroup; + children = ( + 95C8733517F6C82B00F6C878 /* bitwise.c */, + 95C8733617F6C82B00F6C878 /* framing.c */, + ); + name = src; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 95C872FE17F6C7CA00F6C878 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C8733317F6C81200F6C878 /* os_types.h in Headers */, + 95C8733217F6C81200F6C878 /* ogg.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95C873F117F6D1BB00F6C878 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C873F217F6D1C200F6C878 /* ogg.h in Headers */, + 95C873F317F6D1C200F6C878 /* os_types.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95F27DBF17F6DD93009E13C6 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 95F27DEB17F6DDC0009E13C6 /* ogg.h in Headers */, + 95F27DEC17F6DDC0009E13C6 /* os_types.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 95C8730017F6C7CA00F6C878 /* Ogg */ = { + isa = PBXNativeTarget; + buildConfigurationList = 95C8732917F6C7CA00F6C878 /* Build configuration list for PBXNativeTarget "Ogg" */; + buildPhases = ( + 95C872FC17F6C7CA00F6C878 /* Sources */, + 95C872FD17F6C7CA00F6C878 /* Frameworks */, + 95C872FE17F6C7CA00F6C878 /* Headers */, + 95C872FF17F6C7CA00F6C878 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Ogg; + productName = Ogg; + productReference = 95C8730117F6C7CA00F6C878 /* Ogg.framework */; + productType = "com.apple.product-type.framework"; + }; + 95C873C817F6D18300F6C878 /* ogg */ = { + isa = PBXNativeTarget; + buildConfigurationList = 95C873ED17F6D18400F6C878 /* Build configuration list for PBXNativeTarget "ogg" */; + buildPhases = ( + 95C873C517F6D18300F6C878 /* Sources */, + 95C873C617F6D18300F6C878 /* Frameworks */, + 95C873C717F6D18300F6C878 /* CopyFiles */, + 95C873F117F6D1BB00F6C878 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ogg; + productName = ogg; + productReference = 95C873C917F6D18300F6C878 /* libogg.a */; + productType = "com.apple.product-type.library.static"; + }; + 95F27DC317F6DD93009E13C6 /* Ogg_ios */ = { + isa = PBXNativeTarget; + buildConfigurationList = 95F27DE717F6DD93009E13C6 /* Build configuration list for PBXNativeTarget "Ogg_ios" */; + buildPhases = ( + 95F27DBC17F6DD93009E13C6 /* ShellScript */, + 95F27DBD17F6DD93009E13C6 /* Sources */, + 95F27DBE17F6DD93009E13C6 /* Frameworks */, + 95F27DBF17F6DD93009E13C6 /* Headers */, + 95F27DC017F6DD93009E13C6 /* Resources */, + 95F27DC117F6DD93009E13C6 /* ShellScript */, + 95F27DC217F6DD93009E13C6 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Ogg_ios; + productName = Ogg_ios; + productReference = 95F27DC417F6DD93009E13C6 /* Ogg.framework */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 95C872F817F6C7CA00F6C878 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = "Arthur Evstifeev"; + }; + buildConfigurationList = 95C872FB17F6C7CA00F6C878 /* Build configuration list for PBXProject "Ogg" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 95C872F717F6C7CA00F6C878; + productRefGroup = 95C8730217F6C7CA00F6C878 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 95C8730017F6C7CA00F6C878 /* Ogg */, + 95C873C817F6D18300F6C878 /* ogg */, + 95F27DC317F6DD93009E13C6 /* Ogg_ios */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 95C872FF17F6C7CA00F6C878 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95F27DC017F6DD93009E13C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 95F27DBC17F6DD93009E13C6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n\tUFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Clean other platform if needed\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n\techo \"Platform \\\"$UFW_SDK_PLATFORM\\\" was cleaned recently. Cleaning \\\"$UFW_OTHER_PLATFORM\\\" as well\"\n\techo xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\n\txcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\nfi\n\n\n# Make sure we are building from fresh binaries\n\nrm -rf \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\n"; + }; + 95F27DC117F6DD93009E13C6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "HEADERS_ROOT=$SRCROOT/$PRODUCT_NAME\nFRAMEWORK_HEADERS_DIR=\"$BUILT_PRODUCTS_DIR/$WRAPPER_NAME/Versions/$FRAMEWORK_VERSION/Headers\"\n\n## only header files expected at this point\nPUBLIC_HEADERS=$(find $FRAMEWORK_HEADERS_DIR/. -not -type d 2> /dev/null | sed -e \"s@.*/@@g\")\n\nFIND_OPTS=\"\"\nfor PUBLIC_HEADER in $PUBLIC_HEADERS; do\n if [ -n \"$FIND_OPTS\" ]; then\n FIND_OPTS=\"$FIND_OPTS -o\"\n fi\n FIND_OPTS=\"$FIND_OPTS -name '$PUBLIC_HEADER'\"\ndone\n\nif [ -n \"$FIND_OPTS\" ]; then\n for ORIG_HEADER in $(eval \"find $HEADERS_ROOT/. $FIND_OPTS\" 2> /dev/null | sed -e \"s@^$HEADERS_ROOT/./@@g\"); do\n PUBLIC_HEADER=$(basename $ORIG_HEADER)\n RELATIVE_PATH=$(dirname $ORIG_HEADER)\n if [ -e $FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER ]; then\n mkdir -p \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH\"\n mv \"$FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER\" \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH/$PUBLIC_HEADER\"\n fi\n done\nfi\n"; + }; + 95F27DC217F6DD93009E13C6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\nexport UFW_MASTER_SCRIPT_RUNNING=1\n\n\n# Functions\n\n## List files in the specified directory, storing to the specified array.\n#\n# @param $1 The path to list\n# @param $2 The name of the array to fill\n#\n##\nlist_files ()\n{\n filelist=$(ls \"$1\")\n while read line\n do\n eval \"$2[\\${#$2[*]}]=\\\"\\$line\\\"\"\n done <<< \"$filelist\"\n}\n\n\n# Sanity check\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n echo \"Framework target \\\"${TARGET_NAME}\\\" had no source files to build from. Make sure your source files have the correct target membership\"\n exit 1\nfi\n\n\n# Gather information\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n UFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date.\n# We already checked the other platform in the prerun script.\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Make sure the other platform gets built\n\necho \"Build other platform\"\n\necho xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\n\n\n# Build the fat static library binary\n\necho \"Create universal static library\"\n\nif [[ \"$XCODE_VERSION_MAJOR\" = \"0500\" ]]\nthen\n echo \"$DT_TOOLCHAIN_DIR/usr/bin/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$DT_TOOLCHAIN_DIR/usr/bin/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\nelse\n echo \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\nfi \n\necho mv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nmv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\n\n\n# Build framework structure\n\necho \"Build symlinks\"\n\necho ln -sfh $FRAMEWORK_VERSION \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\nln -sfh $FRAMEWORK_VERSION \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\necho ln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\nln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\necho ln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\nln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\necho ln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\nln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\n\n\n# Link to binary for unit tests\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework\"\nln -sfh \"../${WRAPPER_NAME}/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework/.fake_fw_testing\"\n\n\n# Build embedded framework structure\n\necho \"Build Embedded Framework\"\n\necho rm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\necho mkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\nmkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\necho cp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\ncp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\n\ndeclare -a UFW_FILE_LIST\nlist_files \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\" UFW_FILE_LIST\nfor filename in \"${UFW_FILE_LIST[@]}\"\ndo\n if [[ \"${filename}\" != \"Info.plist\" ]] && [[ ! \"${filename}\" =~ .*\\.lproj$ ]]\n then\n echo ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n fi\ndone\n\n\n# Replace other platform's framework with a copy of this one (so that both have the same universal binary)\n\necho \"Copy from $UFW_SDK_PLATFORM to $UFW_OTHER_PLATFORM\"\n\necho rm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\nrm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\necho cp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\ncp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 95C872FC17F6C7CA00F6C878 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C8733817F6C82B00F6C878 /* framing.c in Sources */, + 95C8733717F6C82B00F6C878 /* bitwise.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95C873C517F6D18300F6C878 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C873EF17F6D1AF00F6C878 /* bitwise.c in Sources */, + 95C873F017F6D1AF00F6C878 /* framing.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95F27DBD17F6DD93009E13C6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 95F27DE917F6DDBB009E13C6 /* bitwise.c in Sources */, + 95F27DEA17F6DDBB009E13C6 /* framing.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 95C8732717F6C7CA00F6C878 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 95C8732817F6C7CA00F6C878 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + SDKROOT = macosx; + }; + name = Release; + }; + 95C8732A17F6C7CA00F6C878 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + INFOPLIST_FILE = "Ogg/Ogg-Info.plist"; + INSTALL_PATH = "@executable_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = framework; + }; + name = Debug; + }; + 95C8732B17F6C7CA00F6C878 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + INFOPLIST_FILE = "Ogg/Ogg-Info.plist"; + INSTALL_PATH = "@executable_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = framework; + }; + name = Release; + }; + 95C873E917F6D18400F6C878 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_ENABLE_MODULES = YES; + DSTROOT = /tmp/ogg.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 95C873EA17F6D18400F6C878 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_ENABLE_MODULES = YES; + DSTROOT = /tmp/ogg.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 95F27DE317F6DD93009E13C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_ENABLE_MODULES = YES; + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; + DEAD_CODE_STRIPPING = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + INFOPLIST_FILE = "Ogg_ios/Ogg_ios-Info.plist"; + INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + PRODUCT_NAME = Ogg; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + WRAPPER_EXTENSION = framework; + }; + name = Debug; + }; + 95F27DE417F6DD93009E13C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_ENABLE_MODULES = YES; + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; + DEAD_CODE_STRIPPING = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + INFOPLIST_FILE = "Ogg_ios/Ogg_ios-Info.plist"; + INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + PRODUCT_NAME = Ogg; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + VALIDATE_PRODUCT = YES; + WRAPPER_EXTENSION = framework; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 95C872FB17F6C7CA00F6C878 /* Build configuration list for PBXProject "Ogg" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95C8732717F6C7CA00F6C878 /* Debug */, + 95C8732817F6C7CA00F6C878 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 95C8732917F6C7CA00F6C878 /* Build configuration list for PBXNativeTarget "Ogg" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95C8732A17F6C7CA00F6C878 /* Debug */, + 95C8732B17F6C7CA00F6C878 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 95C873ED17F6D18400F6C878 /* Build configuration list for PBXNativeTarget "ogg" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95C873E917F6D18400F6C878 /* Debug */, + 95C873EA17F6D18400F6C878 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 95F27DE717F6DD93009E13C6 /* Build configuration list for PBXNativeTarget "Ogg_ios" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95F27DE317F6DD93009E13C6 /* Debug */, + 95F27DE417F6DD93009E13C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 95C872F817F6C7CA00F6C878 /* Project object */; +} diff --git a/Audio-Frameworks/Ogg/Ogg/Ogg-Info.plist b/Audio-Frameworks/Ogg/Ogg/Ogg-Info.plist new file mode 100644 index 0000000..034d641 --- /dev/null +++ b/Audio-Frameworks/Ogg/Ogg/Ogg-Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.ap4y.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSHumanReadableCopyright + Copyright © 2013 Arthur Evstifeev. All rights reserved. + NSPrincipalClass + + + diff --git a/Audio-Frameworks/Ogg/Ogg_ios/Ogg_ios-Info.plist b/Audio-Frameworks/Ogg/Ogg_ios/Ogg_ios-Info.plist new file mode 100644 index 0000000..9dec469 --- /dev/null +++ b/Audio-Frameworks/Ogg/Ogg_ios/Ogg_ios-Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.ap4y.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSPrincipalClass + + + diff --git a/Audio-Frameworks/Opus/Opus.xcodeproj/project.pbxproj b/Audio-Frameworks/Opus/Opus.xcodeproj/project.pbxproj new file mode 100644 index 0000000..96a8516 --- /dev/null +++ b/Audio-Frameworks/Opus/Opus.xcodeproj/project.pbxproj @@ -0,0 +1,1976 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 95C86EE717F6BCEA00F6C878 /* opus.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C4A17F6B30100F6C878 /* opus.c */; }; + 95C86EE917F6BCEA00F6C878 /* opus_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C4E17F6B30100F6C878 /* opus_decoder.c */; }; + 95C86EEB17F6BCEA00F6C878 /* opus_encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C5217F6B30100F6C878 /* opus_encoder.c */; }; + 95C86EEC17F6BCEA00F6C878 /* opus_multistream.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C5317F6B30100F6C878 /* opus_multistream.c */; }; + 95C86EED17F6BCEA00F6C878 /* repacketizer.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C5517F6B30100F6C878 /* repacketizer.c */; }; + 95C86EEF17F6BCFE00F6C878 /* opus.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB117F6B35500F6C878 /* opus.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95C86EF017F6BCFE00F6C878 /* opus_defines.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB317F6B35500F6C878 /* opus_defines.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95C86EF117F6BCFE00F6C878 /* opus_multistream.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB417F6B35500F6C878 /* opus_multistream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95C86EF217F6BCFE00F6C878 /* opus_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB517F6B35500F6C878 /* opus_types.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95C86EF517F6BD0B00F6C878 /* opus_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86C5417F6B30100F6C878 /* opus_private.h */; }; + 95C86F5B17F6BD7700F6C878 /* _kiss_fft_guts.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F0917F6BD7700F6C878 /* _kiss_fft_guts.h */; }; + 95C86F5D17F6BD7700F6C878 /* arch.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F0A17F6BD7700F6C878 /* arch.h */; }; + 95C86F5F17F6BD7700F6C878 /* bands.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F0B17F6BD7700F6C878 /* bands.c */; }; + 95C86F6117F6BD7700F6C878 /* bands.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F0C17F6BD7700F6C878 /* bands.h */; }; + 95C86F6317F6BD7700F6C878 /* celt.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F0D17F6BD7700F6C878 /* celt.c */; }; + 95C86F6517F6BD7700F6C878 /* celt.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F0E17F6BD7700F6C878 /* celt.h */; }; + 95C86F6917F6BD7700F6C878 /* celt_lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1117F6BD7700F6C878 /* celt_lpc.c */; }; + 95C86F6B17F6BD7700F6C878 /* celt_lpc.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1217F6BD7700F6C878 /* celt_lpc.h */; }; + 95C86F6D17F6BD7700F6C878 /* cwrs.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1317F6BD7700F6C878 /* cwrs.c */; }; + 95C86F6F17F6BD7700F6C878 /* cwrs.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1417F6BD7700F6C878 /* cwrs.h */; }; + 95C86F7117F6BD7700F6C878 /* ecintrin.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1517F6BD7700F6C878 /* ecintrin.h */; }; + 95C86F7317F6BD7700F6C878 /* entcode.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1617F6BD7700F6C878 /* entcode.c */; }; + 95C86F7517F6BD7700F6C878 /* entcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1717F6BD7700F6C878 /* entcode.h */; }; + 95C86F7717F6BD7700F6C878 /* entdec.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1817F6BD7700F6C878 /* entdec.c */; }; + 95C86F7917F6BD7700F6C878 /* entdec.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1917F6BD7700F6C878 /* entdec.h */; }; + 95C86F7B17F6BD7700F6C878 /* entenc.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1A17F6BD7700F6C878 /* entenc.c */; }; + 95C86F7D17F6BD7700F6C878 /* entenc.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1B17F6BD7700F6C878 /* entenc.h */; }; + 95C86F7F17F6BD7700F6C878 /* fixed_debug.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1C17F6BD7700F6C878 /* fixed_debug.h */; }; + 95C86F8117F6BD7700F6C878 /* fixed_generic.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1D17F6BD7700F6C878 /* fixed_generic.h */; }; + 95C86F8317F6BD7700F6C878 /* float_cast.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1E17F6BD7700F6C878 /* float_cast.h */; }; + 95C86F8517F6BD7700F6C878 /* kiss_fft.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1F17F6BD7700F6C878 /* kiss_fft.c */; }; + 95C86F8717F6BD7700F6C878 /* kiss_fft.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2017F6BD7700F6C878 /* kiss_fft.h */; }; + 95C86F8917F6BD7700F6C878 /* laplace.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2117F6BD7700F6C878 /* laplace.c */; }; + 95C86F8B17F6BD7700F6C878 /* laplace.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2217F6BD7700F6C878 /* laplace.h */; }; + 95C86F8D17F6BD7700F6C878 /* mathops.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2317F6BD7700F6C878 /* mathops.c */; }; + 95C86F8F17F6BD7700F6C878 /* mathops.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2417F6BD7700F6C878 /* mathops.h */; }; + 95C86F9117F6BD7700F6C878 /* mdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2517F6BD7700F6C878 /* mdct.c */; }; + 95C86F9317F6BD7700F6C878 /* mdct.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2617F6BD7700F6C878 /* mdct.h */; }; + 95C86F9517F6BD7700F6C878 /* mfrngcod.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2717F6BD7700F6C878 /* mfrngcod.h */; }; + 95C86F9717F6BD7700F6C878 /* modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2817F6BD7700F6C878 /* modes.c */; }; + 95C86F9917F6BD7700F6C878 /* modes.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2917F6BD7700F6C878 /* modes.h */; }; + 95C86F9D17F6BD7700F6C878 /* os_support.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2B17F6BD7700F6C878 /* os_support.h */; }; + 95C86F9F17F6BD7700F6C878 /* pitch.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2C17F6BD7700F6C878 /* pitch.c */; }; + 95C86FA117F6BD7700F6C878 /* pitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2D17F6BD7700F6C878 /* pitch.h */; }; + 95C86FA317F6BD7700F6C878 /* quant_bands.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2E17F6BD7700F6C878 /* quant_bands.c */; }; + 95C86FA517F6BD7700F6C878 /* quant_bands.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2F17F6BD7700F6C878 /* quant_bands.h */; }; + 95C86FA717F6BD7700F6C878 /* rate.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F3017F6BD7700F6C878 /* rate.c */; }; + 95C86FA917F6BD7700F6C878 /* rate.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F3117F6BD7700F6C878 /* rate.h */; }; + 95C86FAB17F6BD7700F6C878 /* stack_alloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F3217F6BD7700F6C878 /* stack_alloc.h */; }; + 95C86FAD17F6BD7700F6C878 /* static_modes_fixed.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F3317F6BD7700F6C878 /* static_modes_fixed.h */; }; + 95C86FAF17F6BD7700F6C878 /* static_modes_float.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F3417F6BD7700F6C878 /* static_modes_float.h */; }; + 95C86FC917F6BD7700F6C878 /* vq.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F4717F6BD7700F6C878 /* vq.c */; }; + 95C86FCB17F6BD7700F6C878 /* vq.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F4817F6BD7700F6C878 /* vq.h */; }; + 95C8714617F6BD9D00F6C878 /* A2NLSF.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701A17F6BD9B00F6C878 /* A2NLSF.c */; }; + 95C8714817F6BD9D00F6C878 /* ana_filt_bank_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701B17F6BD9B00F6C878 /* ana_filt_bank_1.c */; }; + 95C8714A17F6BD9D00F6C878 /* API.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8701C17F6BD9B00F6C878 /* API.h */; }; + 95C8714C17F6BD9D00F6C878 /* biquad_alt.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701D17F6BD9B00F6C878 /* biquad_alt.c */; }; + 95C8714E17F6BD9D00F6C878 /* bwexpander.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701E17F6BD9B00F6C878 /* bwexpander.c */; }; + 95C8715017F6BD9D00F6C878 /* bwexpander_32.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701F17F6BD9B00F6C878 /* bwexpander_32.c */; }; + 95C8715217F6BD9D00F6C878 /* check_control_input.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702017F6BD9B00F6C878 /* check_control_input.c */; }; + 95C8715417F6BD9D00F6C878 /* CNG.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702117F6BD9B00F6C878 /* CNG.c */; }; + 95C8715617F6BD9D00F6C878 /* code_signs.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702217F6BD9B00F6C878 /* code_signs.c */; }; + 95C8715817F6BD9D00F6C878 /* control.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8702317F6BD9B00F6C878 /* control.h */; }; + 95C8715A17F6BD9D00F6C878 /* control_audio_bandwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702417F6BD9B00F6C878 /* control_audio_bandwidth.c */; }; + 95C8715C17F6BD9D00F6C878 /* control_codec.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702517F6BD9B00F6C878 /* control_codec.c */; }; + 95C8715E17F6BD9D00F6C878 /* control_SNR.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702617F6BD9C00F6C878 /* control_SNR.c */; }; + 95C8716017F6BD9D00F6C878 /* debug.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702717F6BD9C00F6C878 /* debug.c */; }; + 95C8716217F6BD9D00F6C878 /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8702817F6BD9C00F6C878 /* debug.h */; }; + 95C8716417F6BD9D00F6C878 /* dec_API.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702917F6BD9C00F6C878 /* dec_API.c */; }; + 95C8716617F6BD9D00F6C878 /* decode_core.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702A17F6BD9C00F6C878 /* decode_core.c */; }; + 95C8716817F6BD9D00F6C878 /* decode_frame.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702B17F6BD9C00F6C878 /* decode_frame.c */; }; + 95C8716A17F6BD9D00F6C878 /* decode_indices.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702C17F6BD9C00F6C878 /* decode_indices.c */; }; + 95C8716C17F6BD9D00F6C878 /* decode_parameters.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702D17F6BD9C00F6C878 /* decode_parameters.c */; }; + 95C8716E17F6BD9D00F6C878 /* decode_pitch.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702E17F6BD9C00F6C878 /* decode_pitch.c */; }; + 95C8717017F6BD9D00F6C878 /* decode_pulses.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702F17F6BD9C00F6C878 /* decode_pulses.c */; }; + 95C8717217F6BD9D00F6C878 /* decoder_set_fs.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8703017F6BD9C00F6C878 /* decoder_set_fs.c */; }; + 95C8717417F6BD9D00F6C878 /* define.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8703117F6BD9C00F6C878 /* define.h */; }; + 95C8717617F6BD9D00F6C878 /* enc_API.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8703217F6BD9C00F6C878 /* enc_API.c */; }; + 95C8717817F6BD9D00F6C878 /* encode_indices.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8703317F6BD9C00F6C878 /* encode_indices.c */; }; + 95C8717A17F6BD9D00F6C878 /* encode_pulses.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8703417F6BD9C00F6C878 /* encode_pulses.c */; }; + 95C8717C17F6BD9D00F6C878 /* errors.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8703517F6BD9C00F6C878 /* errors.h */; }; + 95C871EE17F6BD9D00F6C878 /* apply_sine_window_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8708F17F6BD9C00F6C878 /* apply_sine_window_FLP.c */; }; + 95C871F017F6BD9D00F6C878 /* autocorrelation_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709017F6BD9C00F6C878 /* autocorrelation_FLP.c */; }; + 95C871F217F6BD9D00F6C878 /* burg_modified_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709117F6BD9C00F6C878 /* burg_modified_FLP.c */; }; + 95C871F417F6BD9D00F6C878 /* bwexpander_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709217F6BD9C00F6C878 /* bwexpander_FLP.c */; }; + 95C871F617F6BD9D00F6C878 /* corrMatrix_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709317F6BD9C00F6C878 /* corrMatrix_FLP.c */; }; + 95C871F817F6BD9D00F6C878 /* encode_frame_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709417F6BD9C00F6C878 /* encode_frame_FLP.c */; }; + 95C871FA17F6BD9D00F6C878 /* energy_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709517F6BD9C00F6C878 /* energy_FLP.c */; }; + 95C871FC17F6BD9D00F6C878 /* find_LPC_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709617F6BD9C00F6C878 /* find_LPC_FLP.c */; }; + 95C871FE17F6BD9D00F6C878 /* find_LTP_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709717F6BD9C00F6C878 /* find_LTP_FLP.c */; }; + 95C8720017F6BD9D00F6C878 /* find_pitch_lags_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709817F6BD9C00F6C878 /* find_pitch_lags_FLP.c */; }; + 95C8720217F6BD9D00F6C878 /* find_pred_coefs_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709917F6BD9C00F6C878 /* find_pred_coefs_FLP.c */; }; + 95C8720417F6BD9D00F6C878 /* inner_product_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709A17F6BD9C00F6C878 /* inner_product_FLP.c */; }; + 95C8720617F6BD9D00F6C878 /* k2a_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709B17F6BD9C00F6C878 /* k2a_FLP.c */; }; + 95C8720817F6BD9D00F6C878 /* levinsondurbin_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709C17F6BD9C00F6C878 /* levinsondurbin_FLP.c */; }; + 95C8720A17F6BD9D00F6C878 /* LPC_analysis_filter_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709D17F6BD9C00F6C878 /* LPC_analysis_filter_FLP.c */; }; + 95C8720C17F6BD9D00F6C878 /* LPC_inv_pred_gain_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709E17F6BD9C00F6C878 /* LPC_inv_pred_gain_FLP.c */; }; + 95C8720E17F6BD9D00F6C878 /* LTP_analysis_filter_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709F17F6BD9C00F6C878 /* LTP_analysis_filter_FLP.c */; }; + 95C8721017F6BD9D00F6C878 /* LTP_scale_ctrl_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A017F6BD9C00F6C878 /* LTP_scale_ctrl_FLP.c */; }; + 95C8721217F6BD9D00F6C878 /* main_FLP.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870A117F6BD9C00F6C878 /* main_FLP.h */; }; + 95C8721417F6BD9D00F6C878 /* noise_shape_analysis_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A217F6BD9C00F6C878 /* noise_shape_analysis_FLP.c */; }; + 95C8721617F6BD9D00F6C878 /* pitch_analysis_core_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A317F6BD9C00F6C878 /* pitch_analysis_core_FLP.c */; }; + 95C8721817F6BD9D00F6C878 /* prefilter_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A417F6BD9C00F6C878 /* prefilter_FLP.c */; }; + 95C8721A17F6BD9D00F6C878 /* process_gains_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A517F6BD9C00F6C878 /* process_gains_FLP.c */; }; + 95C8721C17F6BD9D00F6C878 /* regularize_correlations_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A617F6BD9C00F6C878 /* regularize_correlations_FLP.c */; }; + 95C8721E17F6BD9D00F6C878 /* residual_energy_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A717F6BD9C00F6C878 /* residual_energy_FLP.c */; }; + 95C8722017F6BD9D00F6C878 /* scale_copy_vector_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A817F6BD9C00F6C878 /* scale_copy_vector_FLP.c */; }; + 95C8722217F6BD9D00F6C878 /* scale_vector_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A917F6BD9C00F6C878 /* scale_vector_FLP.c */; }; + 95C8722417F6BD9D00F6C878 /* schur_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870AA17F6BD9C00F6C878 /* schur_FLP.c */; }; + 95C8722617F6BD9D00F6C878 /* SigProc_FLP.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870AB17F6BD9C00F6C878 /* SigProc_FLP.h */; }; + 95C8722A17F6BD9D00F6C878 /* solve_LS_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870AE17F6BD9C00F6C878 /* solve_LS_FLP.c */; }; + 95C8722C17F6BD9D00F6C878 /* sort_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870AF17F6BD9C00F6C878 /* sort_FLP.c */; }; + 95C8722E17F6BD9D00F6C878 /* structs_FLP.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870B017F6BD9C00F6C878 /* structs_FLP.h */; }; + 95C8723017F6BD9D00F6C878 /* warped_autocorrelation_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B117F6BD9C00F6C878 /* warped_autocorrelation_FLP.c */; }; + 95C8723217F6BD9D00F6C878 /* wrappers_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B217F6BD9C00F6C878 /* wrappers_FLP.c */; }; + 95C8723417F6BD9D00F6C878 /* gain_quant.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B317F6BD9C00F6C878 /* gain_quant.c */; }; + 95C8723617F6BD9D00F6C878 /* HP_variable_cutoff.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B417F6BD9C00F6C878 /* HP_variable_cutoff.c */; }; + 95C8723817F6BD9D00F6C878 /* init_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B517F6BD9C00F6C878 /* init_decoder.c */; }; + 95C8723A17F6BD9D00F6C878 /* init_encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B617F6BD9C00F6C878 /* init_encoder.c */; }; + 95C8723C17F6BD9D00F6C878 /* Inlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870B717F6BD9C00F6C878 /* Inlines.h */; }; + 95C8723E17F6BD9D00F6C878 /* inner_prod_aligned.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B817F6BD9C00F6C878 /* inner_prod_aligned.c */; }; + 95C8724017F6BD9D00F6C878 /* interpolate.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B917F6BD9C00F6C878 /* interpolate.c */; }; + 95C8724217F6BD9D00F6C878 /* lin2log.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BA17F6BD9C00F6C878 /* lin2log.c */; }; + 95C8724417F6BD9D00F6C878 /* log2lin.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BB17F6BD9C00F6C878 /* log2lin.c */; }; + 95C8724617F6BD9D00F6C878 /* LP_variable_cutoff.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BC17F6BD9C00F6C878 /* LP_variable_cutoff.c */; }; + 95C8724817F6BD9D00F6C878 /* LPC_analysis_filter.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BD17F6BD9C00F6C878 /* LPC_analysis_filter.c */; }; + 95C8724A17F6BD9D00F6C878 /* LPC_inv_pred_gain.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BE17F6BD9C00F6C878 /* LPC_inv_pred_gain.c */; }; + 95C8724C17F6BD9D00F6C878 /* MacroCount.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870BF17F6BD9C00F6C878 /* MacroCount.h */; }; + 95C8724E17F6BD9D00F6C878 /* MacroDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870C017F6BD9C00F6C878 /* MacroDebug.h */; }; + 95C8725017F6BD9D00F6C878 /* macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870C117F6BD9C00F6C878 /* macros.h */; }; + 95C8725217F6BD9D00F6C878 /* main.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870C217F6BD9C00F6C878 /* main.h */; }; + 95C8725417F6BD9D00F6C878 /* NLSF2A.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C317F6BD9C00F6C878 /* NLSF2A.c */; }; + 95C8725617F6BD9D00F6C878 /* NLSF_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C417F6BD9C00F6C878 /* NLSF_decode.c */; }; + 95C8725817F6BD9D00F6C878 /* NLSF_del_dec_quant.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C517F6BD9C00F6C878 /* NLSF_del_dec_quant.c */; }; + 95C8725A17F6BD9D00F6C878 /* NLSF_encode.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C617F6BD9C00F6C878 /* NLSF_encode.c */; }; + 95C8725C17F6BD9D00F6C878 /* NLSF_stabilize.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C717F6BD9C00F6C878 /* NLSF_stabilize.c */; }; + 95C8725E17F6BD9D00F6C878 /* NLSF_unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C817F6BD9C00F6C878 /* NLSF_unpack.c */; }; + 95C8726017F6BD9D00F6C878 /* NLSF_VQ.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C917F6BD9C00F6C878 /* NLSF_VQ.c */; }; + 95C8726217F6BD9D00F6C878 /* NLSF_VQ_weights_laroia.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CA17F6BD9C00F6C878 /* NLSF_VQ_weights_laroia.c */; }; + 95C8726417F6BD9D00F6C878 /* NSQ.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CB17F6BD9C00F6C878 /* NSQ.c */; }; + 95C8726617F6BD9D00F6C878 /* NSQ_del_dec.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CC17F6BD9C00F6C878 /* NSQ_del_dec.c */; }; + 95C8726817F6BD9D00F6C878 /* pitch_est_defines.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870CD17F6BD9C00F6C878 /* pitch_est_defines.h */; }; + 95C8726A17F6BD9D00F6C878 /* pitch_est_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CE17F6BD9C00F6C878 /* pitch_est_tables.c */; }; + 95C8726C17F6BD9D00F6C878 /* PLC.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CF17F6BD9C00F6C878 /* PLC.c */; }; + 95C8726E17F6BD9D00F6C878 /* PLC.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870D017F6BD9C00F6C878 /* PLC.h */; }; + 95C8727017F6BD9D00F6C878 /* process_NLSFs.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D117F6BD9C00F6C878 /* process_NLSFs.c */; }; + 95C8727217F6BD9D00F6C878 /* quant_LTP_gains.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D217F6BD9C00F6C878 /* quant_LTP_gains.c */; }; + 95C8727417F6BD9D00F6C878 /* resampler.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D317F6BD9C00F6C878 /* resampler.c */; }; + 95C8727617F6BD9D00F6C878 /* resampler_down2.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D417F6BD9C00F6C878 /* resampler_down2.c */; }; + 95C8727817F6BD9D00F6C878 /* resampler_down2_3.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D517F6BD9C00F6C878 /* resampler_down2_3.c */; }; + 95C8727A17F6BD9D00F6C878 /* resampler_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870D617F6BD9C00F6C878 /* resampler_private.h */; }; + 95C8727C17F6BD9D00F6C878 /* resampler_private_AR2.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D717F6BD9C00F6C878 /* resampler_private_AR2.c */; }; + 95C8727E17F6BD9D00F6C878 /* resampler_private_down_FIR.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D817F6BD9C00F6C878 /* resampler_private_down_FIR.c */; }; + 95C8728017F6BD9D00F6C878 /* resampler_private_IIR_FIR.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D917F6BD9C00F6C878 /* resampler_private_IIR_FIR.c */; }; + 95C8728217F6BD9D00F6C878 /* resampler_private_up2_HQ.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870DA17F6BD9C00F6C878 /* resampler_private_up2_HQ.c */; }; + 95C8728417F6BD9D00F6C878 /* resampler_rom.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870DB17F6BD9C00F6C878 /* resampler_rom.c */; }; + 95C8728617F6BD9D00F6C878 /* resampler_rom.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870DC17F6BD9C00F6C878 /* resampler_rom.h */; }; + 95C8728817F6BD9D00F6C878 /* resampler_structs.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870DD17F6BD9C00F6C878 /* resampler_structs.h */; }; + 95C8728A17F6BD9D00F6C878 /* shell_coder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870DE17F6BD9C00F6C878 /* shell_coder.c */; }; + 95C8728C17F6BD9D00F6C878 /* sigm_Q15.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870DF17F6BD9C00F6C878 /* sigm_Q15.c */; }; + 95C8728E17F6BD9D00F6C878 /* SigProc_FIX.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870E017F6BD9C00F6C878 /* SigProc_FIX.h */; }; + 95C8729217F6BD9D00F6C878 /* sort.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E317F6BD9C00F6C878 /* sort.c */; }; + 95C8729417F6BD9D00F6C878 /* stereo_decode_pred.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E417F6BD9C00F6C878 /* stereo_decode_pred.c */; }; + 95C8729617F6BD9D00F6C878 /* stereo_encode_pred.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E517F6BD9C00F6C878 /* stereo_encode_pred.c */; }; + 95C8729817F6BD9D00F6C878 /* stereo_find_predictor.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E617F6BD9C00F6C878 /* stereo_find_predictor.c */; }; + 95C8729A17F6BD9D00F6C878 /* stereo_LR_to_MS.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E717F6BD9C00F6C878 /* stereo_LR_to_MS.c */; }; + 95C8729C17F6BD9D00F6C878 /* stereo_MS_to_LR.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E817F6BD9C00F6C878 /* stereo_MS_to_LR.c */; }; + 95C8729E17F6BD9D00F6C878 /* stereo_quant_pred.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E917F6BD9C00F6C878 /* stereo_quant_pred.c */; }; + 95C872A017F6BD9D00F6C878 /* structs.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870EA17F6BD9C00F6C878 /* structs.h */; }; + 95C872A217F6BD9D00F6C878 /* sum_sqr_shift.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870EB17F6BD9C00F6C878 /* sum_sqr_shift.c */; }; + 95C872A417F6BD9D00F6C878 /* table_LSF_cos.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870EC17F6BD9C00F6C878 /* table_LSF_cos.c */; }; + 95C872A617F6BD9D00F6C878 /* tables.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870ED17F6BD9C00F6C878 /* tables.h */; }; + 95C872A817F6BD9D00F6C878 /* tables_gain.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870EE17F6BD9C00F6C878 /* tables_gain.c */; }; + 95C872AA17F6BD9D00F6C878 /* tables_LTP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870EF17F6BD9C00F6C878 /* tables_LTP.c */; }; + 95C872AC17F6BD9D00F6C878 /* tables_NLSF_CB_NB_MB.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F017F6BD9C00F6C878 /* tables_NLSF_CB_NB_MB.c */; }; + 95C872AE17F6BD9D00F6C878 /* tables_NLSF_CB_WB.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F117F6BD9C00F6C878 /* tables_NLSF_CB_WB.c */; }; + 95C872B017F6BD9D00F6C878 /* tables_other.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F217F6BD9C00F6C878 /* tables_other.c */; }; + 95C872B217F6BD9D00F6C878 /* tables_pitch_lag.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F317F6BD9C00F6C878 /* tables_pitch_lag.c */; }; + 95C872B417F6BD9D00F6C878 /* tables_pulses_per_block.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F417F6BD9C00F6C878 /* tables_pulses_per_block.c */; }; + 95C872B617F6BD9D00F6C878 /* tuning_parameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870F517F6BD9C00F6C878 /* tuning_parameters.h */; }; + 95C872B817F6BD9D00F6C878 /* typedef.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870F617F6BD9C00F6C878 /* typedef.h */; }; + 95C872BA17F6BD9D00F6C878 /* VAD.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F717F6BD9C00F6C878 /* VAD.c */; }; + 95C872BC17F6BD9D00F6C878 /* VQ_WMat_EC.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F817F6BD9D00F6C878 /* VQ_WMat_EC.c */; }; + 95C8742117F6D42700F6C878 /* bands.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F0B17F6BD7700F6C878 /* bands.c */; }; + 95C8742317F6D42700F6C878 /* celt.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F0D17F6BD7700F6C878 /* celt.c */; }; + 95C8742517F6D42700F6C878 /* celt_lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1117F6BD7700F6C878 /* celt_lpc.c */; }; + 95C8742717F6D42700F6C878 /* cwrs.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1317F6BD7700F6C878 /* cwrs.c */; }; + 95C8742A17F6D42700F6C878 /* entcode.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1617F6BD7700F6C878 /* entcode.c */; }; + 95C8742C17F6D42700F6C878 /* entdec.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1817F6BD7700F6C878 /* entdec.c */; }; + 95C8742E17F6D42700F6C878 /* entenc.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1A17F6BD7700F6C878 /* entenc.c */; }; + 95C8743317F6D42700F6C878 /* kiss_fft.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1F17F6BD7700F6C878 /* kiss_fft.c */; }; + 95C8743517F6D42700F6C878 /* laplace.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2117F6BD7700F6C878 /* laplace.c */; }; + 95C8743717F6D42700F6C878 /* mathops.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2317F6BD7700F6C878 /* mathops.c */; }; + 95C8743917F6D42700F6C878 /* mdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2517F6BD7700F6C878 /* mdct.c */; }; + 95C8743C17F6D42700F6C878 /* modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2817F6BD7700F6C878 /* modes.c */; }; + 95C8743F17F6D42700F6C878 /* pitch.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2C17F6BD7700F6C878 /* pitch.c */; }; + 95C8744117F6D42700F6C878 /* quant_bands.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2E17F6BD7700F6C878 /* quant_bands.c */; }; + 95C8744317F6D42700F6C878 /* rate.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F3017F6BD7700F6C878 /* rate.c */; }; + 95C8744817F6D42700F6C878 /* vq.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F4717F6BD7700F6C878 /* vq.c */; }; + 95C8744F17F6D42700F6C878 /* A2NLSF.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701A17F6BD9B00F6C878 /* A2NLSF.c */; }; + 95C8745017F6D42700F6C878 /* ana_filt_bank_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701B17F6BD9B00F6C878 /* ana_filt_bank_1.c */; }; + 95C8745217F6D42700F6C878 /* biquad_alt.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701D17F6BD9B00F6C878 /* biquad_alt.c */; }; + 95C8745317F6D42700F6C878 /* bwexpander.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701E17F6BD9B00F6C878 /* bwexpander.c */; }; + 95C8745417F6D42700F6C878 /* bwexpander_32.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701F17F6BD9B00F6C878 /* bwexpander_32.c */; }; + 95C8745517F6D42700F6C878 /* check_control_input.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702017F6BD9B00F6C878 /* check_control_input.c */; }; + 95C8745617F6D42700F6C878 /* CNG.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702117F6BD9B00F6C878 /* CNG.c */; }; + 95C8745717F6D42700F6C878 /* code_signs.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702217F6BD9B00F6C878 /* code_signs.c */; }; + 95C8745917F6D42700F6C878 /* control_audio_bandwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702417F6BD9B00F6C878 /* control_audio_bandwidth.c */; }; + 95C8745A17F6D42700F6C878 /* control_codec.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702517F6BD9B00F6C878 /* control_codec.c */; }; + 95C8745B17F6D42700F6C878 /* control_SNR.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702617F6BD9C00F6C878 /* control_SNR.c */; }; + 95C8745C17F6D42700F6C878 /* debug.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702717F6BD9C00F6C878 /* debug.c */; }; + 95C8745E17F6D42700F6C878 /* dec_API.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702917F6BD9C00F6C878 /* dec_API.c */; }; + 95C8745F17F6D42700F6C878 /* decode_core.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702A17F6BD9C00F6C878 /* decode_core.c */; }; + 95C8746017F6D42700F6C878 /* decode_frame.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702B17F6BD9C00F6C878 /* decode_frame.c */; }; + 95C8746117F6D42700F6C878 /* decode_indices.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702C17F6BD9C00F6C878 /* decode_indices.c */; }; + 95C8746217F6D42700F6C878 /* decode_parameters.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702D17F6BD9C00F6C878 /* decode_parameters.c */; }; + 95C8746317F6D42700F6C878 /* decode_pitch.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702E17F6BD9C00F6C878 /* decode_pitch.c */; }; + 95C8746417F6D42700F6C878 /* decode_pulses.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702F17F6BD9C00F6C878 /* decode_pulses.c */; }; + 95C8746517F6D42700F6C878 /* decoder_set_fs.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8703017F6BD9C00F6C878 /* decoder_set_fs.c */; }; + 95C8746717F6D42700F6C878 /* enc_API.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8703217F6BD9C00F6C878 /* enc_API.c */; }; + 95C8746817F6D42700F6C878 /* encode_indices.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8703317F6BD9C00F6C878 /* encode_indices.c */; }; + 95C8746917F6D42700F6C878 /* encode_pulses.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8703417F6BD9C00F6C878 /* encode_pulses.c */; }; + 95C8746B17F6D42700F6C878 /* apply_sine_window_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8708F17F6BD9C00F6C878 /* apply_sine_window_FLP.c */; }; + 95C8746C17F6D42700F6C878 /* autocorrelation_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709017F6BD9C00F6C878 /* autocorrelation_FLP.c */; }; + 95C8746D17F6D42700F6C878 /* burg_modified_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709117F6BD9C00F6C878 /* burg_modified_FLP.c */; }; + 95C8746E17F6D42700F6C878 /* bwexpander_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709217F6BD9C00F6C878 /* bwexpander_FLP.c */; }; + 95C8746F17F6D42700F6C878 /* corrMatrix_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709317F6BD9C00F6C878 /* corrMatrix_FLP.c */; }; + 95C8747017F6D42700F6C878 /* encode_frame_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709417F6BD9C00F6C878 /* encode_frame_FLP.c */; }; + 95C8747117F6D42700F6C878 /* energy_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709517F6BD9C00F6C878 /* energy_FLP.c */; }; + 95C8747217F6D42700F6C878 /* find_LPC_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709617F6BD9C00F6C878 /* find_LPC_FLP.c */; }; + 95C8747317F6D42700F6C878 /* find_LTP_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709717F6BD9C00F6C878 /* find_LTP_FLP.c */; }; + 95C8747417F6D42700F6C878 /* find_pitch_lags_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709817F6BD9C00F6C878 /* find_pitch_lags_FLP.c */; }; + 95C8747517F6D42700F6C878 /* find_pred_coefs_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709917F6BD9C00F6C878 /* find_pred_coefs_FLP.c */; }; + 95C8747617F6D42700F6C878 /* inner_product_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709A17F6BD9C00F6C878 /* inner_product_FLP.c */; }; + 95C8747717F6D42700F6C878 /* k2a_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709B17F6BD9C00F6C878 /* k2a_FLP.c */; }; + 95C8747817F6D42700F6C878 /* levinsondurbin_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709C17F6BD9C00F6C878 /* levinsondurbin_FLP.c */; }; + 95C8747917F6D42700F6C878 /* LPC_analysis_filter_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709D17F6BD9C00F6C878 /* LPC_analysis_filter_FLP.c */; }; + 95C8747A17F6D42700F6C878 /* LPC_inv_pred_gain_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709E17F6BD9C00F6C878 /* LPC_inv_pred_gain_FLP.c */; }; + 95C8747B17F6D42700F6C878 /* LTP_analysis_filter_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709F17F6BD9C00F6C878 /* LTP_analysis_filter_FLP.c */; }; + 95C8747C17F6D42700F6C878 /* LTP_scale_ctrl_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A017F6BD9C00F6C878 /* LTP_scale_ctrl_FLP.c */; }; + 95C8747E17F6D42700F6C878 /* noise_shape_analysis_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A217F6BD9C00F6C878 /* noise_shape_analysis_FLP.c */; }; + 95C8747F17F6D42700F6C878 /* pitch_analysis_core_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A317F6BD9C00F6C878 /* pitch_analysis_core_FLP.c */; }; + 95C8748017F6D42700F6C878 /* prefilter_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A417F6BD9C00F6C878 /* prefilter_FLP.c */; }; + 95C8748117F6D42700F6C878 /* process_gains_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A517F6BD9C00F6C878 /* process_gains_FLP.c */; }; + 95C8748217F6D42700F6C878 /* regularize_correlations_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A617F6BD9C00F6C878 /* regularize_correlations_FLP.c */; }; + 95C8748317F6D42700F6C878 /* residual_energy_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A717F6BD9C00F6C878 /* residual_energy_FLP.c */; }; + 95C8748417F6D42700F6C878 /* scale_copy_vector_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A817F6BD9C00F6C878 /* scale_copy_vector_FLP.c */; }; + 95C8748517F6D42700F6C878 /* scale_vector_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A917F6BD9C00F6C878 /* scale_vector_FLP.c */; }; + 95C8748617F6D42700F6C878 /* schur_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870AA17F6BD9C00F6C878 /* schur_FLP.c */; }; + 95C8748817F6D42700F6C878 /* solve_LS_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870AE17F6BD9C00F6C878 /* solve_LS_FLP.c */; }; + 95C8748917F6D42700F6C878 /* sort_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870AF17F6BD9C00F6C878 /* sort_FLP.c */; }; + 95C8748B17F6D42700F6C878 /* warped_autocorrelation_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B117F6BD9C00F6C878 /* warped_autocorrelation_FLP.c */; }; + 95C8748C17F6D42700F6C878 /* wrappers_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B217F6BD9C00F6C878 /* wrappers_FLP.c */; }; + 95C8748D17F6D42700F6C878 /* gain_quant.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B317F6BD9C00F6C878 /* gain_quant.c */; }; + 95C8748E17F6D42700F6C878 /* HP_variable_cutoff.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B417F6BD9C00F6C878 /* HP_variable_cutoff.c */; }; + 95C8748F17F6D42700F6C878 /* init_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B517F6BD9C00F6C878 /* init_decoder.c */; }; + 95C8749017F6D42700F6C878 /* init_encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B617F6BD9C00F6C878 /* init_encoder.c */; }; + 95C8749217F6D42700F6C878 /* inner_prod_aligned.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B817F6BD9C00F6C878 /* inner_prod_aligned.c */; }; + 95C8749317F6D42700F6C878 /* interpolate.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B917F6BD9C00F6C878 /* interpolate.c */; }; + 95C8749417F6D42700F6C878 /* lin2log.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BA17F6BD9C00F6C878 /* lin2log.c */; }; + 95C8749517F6D42700F6C878 /* log2lin.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BB17F6BD9C00F6C878 /* log2lin.c */; }; + 95C8749617F6D42700F6C878 /* LP_variable_cutoff.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BC17F6BD9C00F6C878 /* LP_variable_cutoff.c */; }; + 95C8749717F6D42700F6C878 /* LPC_analysis_filter.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BD17F6BD9C00F6C878 /* LPC_analysis_filter.c */; }; + 95C8749817F6D42700F6C878 /* LPC_inv_pred_gain.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BE17F6BD9C00F6C878 /* LPC_inv_pred_gain.c */; }; + 95C8749D17F6D42700F6C878 /* NLSF2A.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C317F6BD9C00F6C878 /* NLSF2A.c */; }; + 95C8749E17F6D42700F6C878 /* NLSF_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C417F6BD9C00F6C878 /* NLSF_decode.c */; }; + 95C8749F17F6D42700F6C878 /* NLSF_del_dec_quant.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C517F6BD9C00F6C878 /* NLSF_del_dec_quant.c */; }; + 95C874A017F6D42700F6C878 /* NLSF_encode.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C617F6BD9C00F6C878 /* NLSF_encode.c */; }; + 95C874A117F6D42700F6C878 /* NLSF_stabilize.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C717F6BD9C00F6C878 /* NLSF_stabilize.c */; }; + 95C874A217F6D42700F6C878 /* NLSF_unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C817F6BD9C00F6C878 /* NLSF_unpack.c */; }; + 95C874A317F6D42700F6C878 /* NLSF_VQ.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C917F6BD9C00F6C878 /* NLSF_VQ.c */; }; + 95C874A417F6D42700F6C878 /* NLSF_VQ_weights_laroia.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CA17F6BD9C00F6C878 /* NLSF_VQ_weights_laroia.c */; }; + 95C874A517F6D42700F6C878 /* NSQ.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CB17F6BD9C00F6C878 /* NSQ.c */; }; + 95C874A617F6D42700F6C878 /* NSQ_del_dec.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CC17F6BD9C00F6C878 /* NSQ_del_dec.c */; }; + 95C874A817F6D42700F6C878 /* pitch_est_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CE17F6BD9C00F6C878 /* pitch_est_tables.c */; }; + 95C874A917F6D42700F6C878 /* PLC.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CF17F6BD9C00F6C878 /* PLC.c */; }; + 95C874AB17F6D42700F6C878 /* process_NLSFs.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D117F6BD9C00F6C878 /* process_NLSFs.c */; }; + 95C874AC17F6D42700F6C878 /* quant_LTP_gains.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D217F6BD9C00F6C878 /* quant_LTP_gains.c */; }; + 95C874AD17F6D42700F6C878 /* resampler.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D317F6BD9C00F6C878 /* resampler.c */; }; + 95C874AE17F6D42700F6C878 /* resampler_down2.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D417F6BD9C00F6C878 /* resampler_down2.c */; }; + 95C874AF17F6D42700F6C878 /* resampler_down2_3.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D517F6BD9C00F6C878 /* resampler_down2_3.c */; }; + 95C874B117F6D42700F6C878 /* resampler_private_AR2.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D717F6BD9C00F6C878 /* resampler_private_AR2.c */; }; + 95C874B217F6D42700F6C878 /* resampler_private_down_FIR.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D817F6BD9C00F6C878 /* resampler_private_down_FIR.c */; }; + 95C874B317F6D42700F6C878 /* resampler_private_IIR_FIR.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D917F6BD9C00F6C878 /* resampler_private_IIR_FIR.c */; }; + 95C874B417F6D42700F6C878 /* resampler_private_up2_HQ.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870DA17F6BD9C00F6C878 /* resampler_private_up2_HQ.c */; }; + 95C874B517F6D42700F6C878 /* resampler_rom.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870DB17F6BD9C00F6C878 /* resampler_rom.c */; }; + 95C874B817F6D42700F6C878 /* shell_coder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870DE17F6BD9C00F6C878 /* shell_coder.c */; }; + 95C874B917F6D42700F6C878 /* sigm_Q15.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870DF17F6BD9C00F6C878 /* sigm_Q15.c */; }; + 95C874BB17F6D42700F6C878 /* sort.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E317F6BD9C00F6C878 /* sort.c */; }; + 95C874BC17F6D42700F6C878 /* stereo_decode_pred.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E417F6BD9C00F6C878 /* stereo_decode_pred.c */; }; + 95C874BD17F6D42700F6C878 /* stereo_encode_pred.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E517F6BD9C00F6C878 /* stereo_encode_pred.c */; }; + 95C874BE17F6D42700F6C878 /* stereo_find_predictor.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E617F6BD9C00F6C878 /* stereo_find_predictor.c */; }; + 95C874BF17F6D42700F6C878 /* stereo_LR_to_MS.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E717F6BD9C00F6C878 /* stereo_LR_to_MS.c */; }; + 95C874C017F6D42700F6C878 /* stereo_MS_to_LR.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E817F6BD9C00F6C878 /* stereo_MS_to_LR.c */; }; + 95C874C117F6D42700F6C878 /* stereo_quant_pred.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E917F6BD9C00F6C878 /* stereo_quant_pred.c */; }; + 95C874C317F6D42700F6C878 /* sum_sqr_shift.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870EB17F6BD9C00F6C878 /* sum_sqr_shift.c */; }; + 95C874C417F6D42700F6C878 /* table_LSF_cos.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870EC17F6BD9C00F6C878 /* table_LSF_cos.c */; }; + 95C874C617F6D42700F6C878 /* tables_gain.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870EE17F6BD9C00F6C878 /* tables_gain.c */; }; + 95C874C717F6D42700F6C878 /* tables_LTP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870EF17F6BD9C00F6C878 /* tables_LTP.c */; }; + 95C874C817F6D42700F6C878 /* tables_NLSF_CB_NB_MB.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F017F6BD9C00F6C878 /* tables_NLSF_CB_NB_MB.c */; }; + 95C874C917F6D42700F6C878 /* tables_NLSF_CB_WB.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F117F6BD9C00F6C878 /* tables_NLSF_CB_WB.c */; }; + 95C874CA17F6D42700F6C878 /* tables_other.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F217F6BD9C00F6C878 /* tables_other.c */; }; + 95C874CB17F6D42700F6C878 /* tables_pitch_lag.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F317F6BD9C00F6C878 /* tables_pitch_lag.c */; }; + 95C874CC17F6D42700F6C878 /* tables_pulses_per_block.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F417F6BD9C00F6C878 /* tables_pulses_per_block.c */; }; + 95C874CF17F6D42700F6C878 /* VAD.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F717F6BD9C00F6C878 /* VAD.c */; }; + 95C874D017F6D42700F6C878 /* VQ_WMat_EC.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F817F6BD9D00F6C878 /* VQ_WMat_EC.c */; }; + 95C874D117F6D42700F6C878 /* opus.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C4A17F6B30100F6C878 /* opus.c */; }; + 95C874D217F6D42700F6C878 /* opus_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C4E17F6B30100F6C878 /* opus_decoder.c */; }; + 95C874D317F6D42700F6C878 /* opus_encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C5217F6B30100F6C878 /* opus_encoder.c */; }; + 95C874D417F6D42700F6C878 /* opus_multistream.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C5317F6B30100F6C878 /* opus_multistream.c */; }; + 95C874D617F6D42700F6C878 /* repacketizer.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C5517F6B30100F6C878 /* repacketizer.c */; }; + 95C8759717F6D4CB00F6C878 /* opus.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB117F6B35500F6C878 /* opus.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95C8759817F6D4CB00F6C878 /* opus_defines.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB317F6B35500F6C878 /* opus_defines.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95C8759917F6D4CB00F6C878 /* opus_multistream.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB417F6B35500F6C878 /* opus_multistream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95C8759A17F6D4CB00F6C878 /* opus_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB517F6B35500F6C878 /* opus_types.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95F27E1D17F6DF15009E13C6 /* bands.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F0B17F6BD7700F6C878 /* bands.c */; }; + 95F27E1F17F6DF15009E13C6 /* celt.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F0D17F6BD7700F6C878 /* celt.c */; }; + 95F27E2117F6DF15009E13C6 /* celt_lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1117F6BD7700F6C878 /* celt_lpc.c */; }; + 95F27E2317F6DF15009E13C6 /* cwrs.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1317F6BD7700F6C878 /* cwrs.c */; }; + 95F27E2617F6DF15009E13C6 /* entcode.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1617F6BD7700F6C878 /* entcode.c */; }; + 95F27E2817F6DF15009E13C6 /* entdec.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1817F6BD7700F6C878 /* entdec.c */; }; + 95F27E2A17F6DF15009E13C6 /* entenc.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1A17F6BD7700F6C878 /* entenc.c */; }; + 95F27E2F17F6DF15009E13C6 /* kiss_fft.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F1F17F6BD7700F6C878 /* kiss_fft.c */; }; + 95F27E3117F6DF15009E13C6 /* laplace.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2117F6BD7700F6C878 /* laplace.c */; }; + 95F27E3317F6DF15009E13C6 /* mathops.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2317F6BD7700F6C878 /* mathops.c */; }; + 95F27E3517F6DF15009E13C6 /* mdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2517F6BD7700F6C878 /* mdct.c */; }; + 95F27E3817F6DF15009E13C6 /* modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2817F6BD7700F6C878 /* modes.c */; }; + 95F27E3B17F6DF15009E13C6 /* pitch.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2C17F6BD7700F6C878 /* pitch.c */; }; + 95F27E3D17F6DF15009E13C6 /* quant_bands.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F2E17F6BD7700F6C878 /* quant_bands.c */; }; + 95F27E3F17F6DF15009E13C6 /* rate.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F3017F6BD7700F6C878 /* rate.c */; }; + 95F27E4417F6DF15009E13C6 /* vq.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86F4717F6BD7700F6C878 /* vq.c */; }; + 95F27E4B17F6DF15009E13C6 /* A2NLSF.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701A17F6BD9B00F6C878 /* A2NLSF.c */; }; + 95F27E4C17F6DF15009E13C6 /* ana_filt_bank_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701B17F6BD9B00F6C878 /* ana_filt_bank_1.c */; }; + 95F27E4E17F6DF15009E13C6 /* biquad_alt.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701D17F6BD9B00F6C878 /* biquad_alt.c */; }; + 95F27E4F17F6DF15009E13C6 /* bwexpander.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701E17F6BD9B00F6C878 /* bwexpander.c */; }; + 95F27E5017F6DF15009E13C6 /* bwexpander_32.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8701F17F6BD9B00F6C878 /* bwexpander_32.c */; }; + 95F27E5117F6DF15009E13C6 /* check_control_input.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702017F6BD9B00F6C878 /* check_control_input.c */; }; + 95F27E5217F6DF15009E13C6 /* CNG.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702117F6BD9B00F6C878 /* CNG.c */; }; + 95F27E5317F6DF15009E13C6 /* code_signs.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702217F6BD9B00F6C878 /* code_signs.c */; }; + 95F27E5517F6DF15009E13C6 /* control_audio_bandwidth.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702417F6BD9B00F6C878 /* control_audio_bandwidth.c */; }; + 95F27E5617F6DF15009E13C6 /* control_codec.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702517F6BD9B00F6C878 /* control_codec.c */; }; + 95F27E5717F6DF15009E13C6 /* control_SNR.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702617F6BD9C00F6C878 /* control_SNR.c */; }; + 95F27E5817F6DF15009E13C6 /* debug.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702717F6BD9C00F6C878 /* debug.c */; }; + 95F27E5A17F6DF15009E13C6 /* dec_API.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702917F6BD9C00F6C878 /* dec_API.c */; }; + 95F27E5B17F6DF15009E13C6 /* decode_core.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702A17F6BD9C00F6C878 /* decode_core.c */; }; + 95F27E5C17F6DF15009E13C6 /* decode_frame.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702B17F6BD9C00F6C878 /* decode_frame.c */; }; + 95F27E5D17F6DF15009E13C6 /* decode_indices.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702C17F6BD9C00F6C878 /* decode_indices.c */; }; + 95F27E5E17F6DF15009E13C6 /* decode_parameters.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702D17F6BD9C00F6C878 /* decode_parameters.c */; }; + 95F27E5F17F6DF15009E13C6 /* decode_pitch.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702E17F6BD9C00F6C878 /* decode_pitch.c */; }; + 95F27E6017F6DF15009E13C6 /* decode_pulses.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8702F17F6BD9C00F6C878 /* decode_pulses.c */; }; + 95F27E6117F6DF15009E13C6 /* decoder_set_fs.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8703017F6BD9C00F6C878 /* decoder_set_fs.c */; }; + 95F27E6317F6DF15009E13C6 /* enc_API.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8703217F6BD9C00F6C878 /* enc_API.c */; }; + 95F27E6417F6DF15009E13C6 /* encode_indices.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8703317F6BD9C00F6C878 /* encode_indices.c */; }; + 95F27E6517F6DF15009E13C6 /* encode_pulses.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8703417F6BD9C00F6C878 /* encode_pulses.c */; }; + 95F27E6717F6DF15009E13C6 /* apply_sine_window_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8708F17F6BD9C00F6C878 /* apply_sine_window_FLP.c */; }; + 95F27E6817F6DF15009E13C6 /* autocorrelation_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709017F6BD9C00F6C878 /* autocorrelation_FLP.c */; }; + 95F27E6917F6DF15009E13C6 /* burg_modified_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709117F6BD9C00F6C878 /* burg_modified_FLP.c */; }; + 95F27E6A17F6DF15009E13C6 /* bwexpander_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709217F6BD9C00F6C878 /* bwexpander_FLP.c */; }; + 95F27E6B17F6DF15009E13C6 /* corrMatrix_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709317F6BD9C00F6C878 /* corrMatrix_FLP.c */; }; + 95F27E6C17F6DF15009E13C6 /* encode_frame_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709417F6BD9C00F6C878 /* encode_frame_FLP.c */; }; + 95F27E6D17F6DF15009E13C6 /* energy_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709517F6BD9C00F6C878 /* energy_FLP.c */; }; + 95F27E6E17F6DF15009E13C6 /* find_LPC_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709617F6BD9C00F6C878 /* find_LPC_FLP.c */; }; + 95F27E6F17F6DF15009E13C6 /* find_LTP_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709717F6BD9C00F6C878 /* find_LTP_FLP.c */; }; + 95F27E7017F6DF15009E13C6 /* find_pitch_lags_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709817F6BD9C00F6C878 /* find_pitch_lags_FLP.c */; }; + 95F27E7117F6DF15009E13C6 /* find_pred_coefs_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709917F6BD9C00F6C878 /* find_pred_coefs_FLP.c */; }; + 95F27E7217F6DF15009E13C6 /* inner_product_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709A17F6BD9C00F6C878 /* inner_product_FLP.c */; }; + 95F27E7317F6DF15009E13C6 /* k2a_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709B17F6BD9C00F6C878 /* k2a_FLP.c */; }; + 95F27E7417F6DF15009E13C6 /* levinsondurbin_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709C17F6BD9C00F6C878 /* levinsondurbin_FLP.c */; }; + 95F27E7517F6DF15009E13C6 /* LPC_analysis_filter_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709D17F6BD9C00F6C878 /* LPC_analysis_filter_FLP.c */; }; + 95F27E7617F6DF15009E13C6 /* LPC_inv_pred_gain_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709E17F6BD9C00F6C878 /* LPC_inv_pred_gain_FLP.c */; }; + 95F27E7717F6DF15009E13C6 /* LTP_analysis_filter_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8709F17F6BD9C00F6C878 /* LTP_analysis_filter_FLP.c */; }; + 95F27E7817F6DF15009E13C6 /* LTP_scale_ctrl_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A017F6BD9C00F6C878 /* LTP_scale_ctrl_FLP.c */; }; + 95F27E7A17F6DF15009E13C6 /* noise_shape_analysis_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A217F6BD9C00F6C878 /* noise_shape_analysis_FLP.c */; }; + 95F27E7B17F6DF15009E13C6 /* pitch_analysis_core_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A317F6BD9C00F6C878 /* pitch_analysis_core_FLP.c */; }; + 95F27E7C17F6DF15009E13C6 /* prefilter_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A417F6BD9C00F6C878 /* prefilter_FLP.c */; }; + 95F27E7D17F6DF15009E13C6 /* process_gains_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A517F6BD9C00F6C878 /* process_gains_FLP.c */; }; + 95F27E7E17F6DF15009E13C6 /* regularize_correlations_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A617F6BD9C00F6C878 /* regularize_correlations_FLP.c */; }; + 95F27E7F17F6DF15009E13C6 /* residual_energy_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A717F6BD9C00F6C878 /* residual_energy_FLP.c */; }; + 95F27E8017F6DF15009E13C6 /* scale_copy_vector_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A817F6BD9C00F6C878 /* scale_copy_vector_FLP.c */; }; + 95F27E8117F6DF15009E13C6 /* scale_vector_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870A917F6BD9C00F6C878 /* scale_vector_FLP.c */; }; + 95F27E8217F6DF15009E13C6 /* schur_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870AA17F6BD9C00F6C878 /* schur_FLP.c */; }; + 95F27E8417F6DF15009E13C6 /* solve_LS_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870AE17F6BD9C00F6C878 /* solve_LS_FLP.c */; }; + 95F27E8517F6DF15009E13C6 /* sort_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870AF17F6BD9C00F6C878 /* sort_FLP.c */; }; + 95F27E8717F6DF15009E13C6 /* warped_autocorrelation_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B117F6BD9C00F6C878 /* warped_autocorrelation_FLP.c */; }; + 95F27E8817F6DF15009E13C6 /* wrappers_FLP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B217F6BD9C00F6C878 /* wrappers_FLP.c */; }; + 95F27E8917F6DF15009E13C6 /* gain_quant.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B317F6BD9C00F6C878 /* gain_quant.c */; }; + 95F27E8A17F6DF15009E13C6 /* HP_variable_cutoff.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B417F6BD9C00F6C878 /* HP_variable_cutoff.c */; }; + 95F27E8B17F6DF15009E13C6 /* init_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B517F6BD9C00F6C878 /* init_decoder.c */; }; + 95F27E8C17F6DF15009E13C6 /* init_encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B617F6BD9C00F6C878 /* init_encoder.c */; }; + 95F27E8E17F6DF15009E13C6 /* inner_prod_aligned.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B817F6BD9C00F6C878 /* inner_prod_aligned.c */; }; + 95F27E8F17F6DF15009E13C6 /* interpolate.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870B917F6BD9C00F6C878 /* interpolate.c */; }; + 95F27E9017F6DF15009E13C6 /* lin2log.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BA17F6BD9C00F6C878 /* lin2log.c */; }; + 95F27E9117F6DF15009E13C6 /* log2lin.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BB17F6BD9C00F6C878 /* log2lin.c */; }; + 95F27E9217F6DF15009E13C6 /* LP_variable_cutoff.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BC17F6BD9C00F6C878 /* LP_variable_cutoff.c */; }; + 95F27E9317F6DF15009E13C6 /* LPC_analysis_filter.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BD17F6BD9C00F6C878 /* LPC_analysis_filter.c */; }; + 95F27E9417F6DF15009E13C6 /* LPC_inv_pred_gain.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870BE17F6BD9C00F6C878 /* LPC_inv_pred_gain.c */; }; + 95F27E9917F6DF15009E13C6 /* NLSF2A.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C317F6BD9C00F6C878 /* NLSF2A.c */; }; + 95F27E9A17F6DF15009E13C6 /* NLSF_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C417F6BD9C00F6C878 /* NLSF_decode.c */; }; + 95F27E9B17F6DF15009E13C6 /* NLSF_del_dec_quant.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C517F6BD9C00F6C878 /* NLSF_del_dec_quant.c */; }; + 95F27E9C17F6DF16009E13C6 /* NLSF_encode.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C617F6BD9C00F6C878 /* NLSF_encode.c */; }; + 95F27E9D17F6DF16009E13C6 /* NLSF_stabilize.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C717F6BD9C00F6C878 /* NLSF_stabilize.c */; }; + 95F27E9E17F6DF16009E13C6 /* NLSF_unpack.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C817F6BD9C00F6C878 /* NLSF_unpack.c */; }; + 95F27E9F17F6DF16009E13C6 /* NLSF_VQ.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870C917F6BD9C00F6C878 /* NLSF_VQ.c */; }; + 95F27EA017F6DF16009E13C6 /* NLSF_VQ_weights_laroia.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CA17F6BD9C00F6C878 /* NLSF_VQ_weights_laroia.c */; }; + 95F27EA117F6DF16009E13C6 /* NSQ.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CB17F6BD9C00F6C878 /* NSQ.c */; }; + 95F27EA217F6DF16009E13C6 /* NSQ_del_dec.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CC17F6BD9C00F6C878 /* NSQ_del_dec.c */; }; + 95F27EA417F6DF16009E13C6 /* pitch_est_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CE17F6BD9C00F6C878 /* pitch_est_tables.c */; }; + 95F27EA517F6DF16009E13C6 /* PLC.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870CF17F6BD9C00F6C878 /* PLC.c */; }; + 95F27EA717F6DF16009E13C6 /* process_NLSFs.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D117F6BD9C00F6C878 /* process_NLSFs.c */; }; + 95F27EA817F6DF16009E13C6 /* quant_LTP_gains.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D217F6BD9C00F6C878 /* quant_LTP_gains.c */; }; + 95F27EA917F6DF16009E13C6 /* resampler.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D317F6BD9C00F6C878 /* resampler.c */; }; + 95F27EAA17F6DF16009E13C6 /* resampler_down2.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D417F6BD9C00F6C878 /* resampler_down2.c */; }; + 95F27EAB17F6DF16009E13C6 /* resampler_down2_3.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D517F6BD9C00F6C878 /* resampler_down2_3.c */; }; + 95F27EAD17F6DF16009E13C6 /* resampler_private_AR2.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D717F6BD9C00F6C878 /* resampler_private_AR2.c */; }; + 95F27EAE17F6DF16009E13C6 /* resampler_private_down_FIR.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D817F6BD9C00F6C878 /* resampler_private_down_FIR.c */; }; + 95F27EAF17F6DF16009E13C6 /* resampler_private_IIR_FIR.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870D917F6BD9C00F6C878 /* resampler_private_IIR_FIR.c */; }; + 95F27EB017F6DF16009E13C6 /* resampler_private_up2_HQ.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870DA17F6BD9C00F6C878 /* resampler_private_up2_HQ.c */; }; + 95F27EB117F6DF16009E13C6 /* resampler_rom.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870DB17F6BD9C00F6C878 /* resampler_rom.c */; }; + 95F27EB417F6DF16009E13C6 /* shell_coder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870DE17F6BD9C00F6C878 /* shell_coder.c */; }; + 95F27EB517F6DF16009E13C6 /* sigm_Q15.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870DF17F6BD9C00F6C878 /* sigm_Q15.c */; }; + 95F27EB717F6DF16009E13C6 /* sort.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E317F6BD9C00F6C878 /* sort.c */; }; + 95F27EB817F6DF16009E13C6 /* stereo_decode_pred.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E417F6BD9C00F6C878 /* stereo_decode_pred.c */; }; + 95F27EB917F6DF16009E13C6 /* stereo_encode_pred.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E517F6BD9C00F6C878 /* stereo_encode_pred.c */; }; + 95F27EBA17F6DF16009E13C6 /* stereo_find_predictor.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E617F6BD9C00F6C878 /* stereo_find_predictor.c */; }; + 95F27EBB17F6DF16009E13C6 /* stereo_LR_to_MS.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E717F6BD9C00F6C878 /* stereo_LR_to_MS.c */; }; + 95F27EBC17F6DF16009E13C6 /* stereo_MS_to_LR.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E817F6BD9C00F6C878 /* stereo_MS_to_LR.c */; }; + 95F27EBD17F6DF16009E13C6 /* stereo_quant_pred.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870E917F6BD9C00F6C878 /* stereo_quant_pred.c */; }; + 95F27EBF17F6DF16009E13C6 /* sum_sqr_shift.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870EB17F6BD9C00F6C878 /* sum_sqr_shift.c */; }; + 95F27EC017F6DF16009E13C6 /* table_LSF_cos.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870EC17F6BD9C00F6C878 /* table_LSF_cos.c */; }; + 95F27EC217F6DF16009E13C6 /* tables_gain.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870EE17F6BD9C00F6C878 /* tables_gain.c */; }; + 95F27EC317F6DF16009E13C6 /* tables_LTP.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870EF17F6BD9C00F6C878 /* tables_LTP.c */; }; + 95F27EC417F6DF16009E13C6 /* tables_NLSF_CB_NB_MB.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F017F6BD9C00F6C878 /* tables_NLSF_CB_NB_MB.c */; }; + 95F27EC517F6DF16009E13C6 /* tables_NLSF_CB_WB.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F117F6BD9C00F6C878 /* tables_NLSF_CB_WB.c */; }; + 95F27EC617F6DF16009E13C6 /* tables_other.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F217F6BD9C00F6C878 /* tables_other.c */; }; + 95F27EC717F6DF16009E13C6 /* tables_pitch_lag.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F317F6BD9C00F6C878 /* tables_pitch_lag.c */; }; + 95F27EC817F6DF16009E13C6 /* tables_pulses_per_block.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F417F6BD9C00F6C878 /* tables_pulses_per_block.c */; }; + 95F27ECB17F6DF16009E13C6 /* VAD.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F717F6BD9C00F6C878 /* VAD.c */; }; + 95F27ECC17F6DF16009E13C6 /* VQ_WMat_EC.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C870F817F6BD9D00F6C878 /* VQ_WMat_EC.c */; }; + 95F27ECD17F6DF16009E13C6 /* opus.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C4A17F6B30100F6C878 /* opus.c */; }; + 95F27ECE17F6DF16009E13C6 /* opus_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C4E17F6B30100F6C878 /* opus_decoder.c */; }; + 95F27ECF17F6DF16009E13C6 /* opus_encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C5217F6B30100F6C878 /* opus_encoder.c */; }; + 95F27ED017F6DF16009E13C6 /* opus_multistream.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C5317F6B30100F6C878 /* opus_multistream.c */; }; + 95F27ED217F6DF16009E13C6 /* repacketizer.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C86C5517F6B30100F6C878 /* repacketizer.c */; }; + 95F27ED817F6DF71009E13C6 /* opus.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB117F6B35500F6C878 /* opus.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95F27ED917F6DF71009E13C6 /* opus_defines.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB317F6B35500F6C878 /* opus_defines.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95F27EDA17F6DF71009E13C6 /* opus_multistream.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB417F6B35500F6C878 /* opus_multistream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95F27EDB17F6DF71009E13C6 /* opus_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB517F6B35500F6C878 /* opus_types.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95F27EDC17F6DF79009E13C6 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86DE017F6B3F700F6C878 /* config.h */; }; + 95F27EDD17F6DF79009E13C6 /* _kiss_fft_guts.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F0917F6BD7700F6C878 /* _kiss_fft_guts.h */; }; + 95F27EDE17F6DF79009E13C6 /* arch.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F0A17F6BD7700F6C878 /* arch.h */; }; + 95F27EE017F6DF79009E13C6 /* bands.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F0C17F6BD7700F6C878 /* bands.h */; }; + 95F27EE217F6DF79009E13C6 /* celt.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F0E17F6BD7700F6C878 /* celt.h */; }; + 95F27EE417F6DF79009E13C6 /* celt_lpc.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1217F6BD7700F6C878 /* celt_lpc.h */; }; + 95F27EE617F6DF79009E13C6 /* cwrs.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1417F6BD7700F6C878 /* cwrs.h */; }; + 95F27EE717F6DF79009E13C6 /* ecintrin.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1517F6BD7700F6C878 /* ecintrin.h */; }; + 95F27EE917F6DF79009E13C6 /* entcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1717F6BD7700F6C878 /* entcode.h */; }; + 95F27EEB17F6DF79009E13C6 /* entdec.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1917F6BD7700F6C878 /* entdec.h */; }; + 95F27EED17F6DF79009E13C6 /* entenc.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1B17F6BD7700F6C878 /* entenc.h */; }; + 95F27EEE17F6DF79009E13C6 /* fixed_debug.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1C17F6BD7700F6C878 /* fixed_debug.h */; }; + 95F27EEF17F6DF79009E13C6 /* fixed_generic.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1D17F6BD7700F6C878 /* fixed_generic.h */; }; + 95F27EF017F6DF79009E13C6 /* float_cast.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F1E17F6BD7700F6C878 /* float_cast.h */; }; + 95F27EF217F6DF79009E13C6 /* kiss_fft.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2017F6BD7700F6C878 /* kiss_fft.h */; }; + 95F27EF417F6DF79009E13C6 /* laplace.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2217F6BD7700F6C878 /* laplace.h */; }; + 95F27EF617F6DF79009E13C6 /* mathops.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2417F6BD7700F6C878 /* mathops.h */; }; + 95F27EF817F6DF79009E13C6 /* mdct.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2617F6BD7700F6C878 /* mdct.h */; }; + 95F27EF917F6DF79009E13C6 /* mfrngcod.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2717F6BD7700F6C878 /* mfrngcod.h */; }; + 95F27EFB17F6DF79009E13C6 /* modes.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2917F6BD7700F6C878 /* modes.h */; }; + 95F27EFC17F6DF79009E13C6 /* os_support.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2B17F6BD7700F6C878 /* os_support.h */; }; + 95F27EFE17F6DF79009E13C6 /* pitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2D17F6BD7700F6C878 /* pitch.h */; }; + 95F27F0017F6DF79009E13C6 /* quant_bands.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F2F17F6BD7700F6C878 /* quant_bands.h */; }; + 95F27F0217F6DF79009E13C6 /* rate.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F3117F6BD7700F6C878 /* rate.h */; }; + 95F27F0317F6DF79009E13C6 /* stack_alloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F3217F6BD7700F6C878 /* stack_alloc.h */; }; + 95F27F0417F6DF79009E13C6 /* static_modes_fixed.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F3317F6BD7700F6C878 /* static_modes_fixed.h */; }; + 95F27F0517F6DF79009E13C6 /* static_modes_float.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F3417F6BD7700F6C878 /* static_modes_float.h */; }; + 95F27F0717F6DF79009E13C6 /* vq.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86F4817F6BD7700F6C878 /* vq.h */; }; + 95F27F0817F6DF79009E13C6 /* opus_custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86CB217F6B35500F6C878 /* opus_custom.h */; }; + 95F27F0B17F6DF79009E13C6 /* API.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8701C17F6BD9B00F6C878 /* API.h */; }; + 95F27F1217F6DF79009E13C6 /* control.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8702317F6BD9B00F6C878 /* control.h */; }; + 95F27F1717F6DF79009E13C6 /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8702817F6BD9C00F6C878 /* debug.h */; }; + 95F27F2017F6DF79009E13C6 /* define.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8703117F6BD9C00F6C878 /* define.h */; }; + 95F27F2417F6DF79009E13C6 /* errors.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8703517F6BD9C00F6C878 /* errors.h */; }; + 95F27F4117F6DF79009E13C6 /* SigProc_FLP.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870AB17F6BD9C00F6C878 /* SigProc_FLP.h */; }; + 95F27F4417F6DF79009E13C6 /* structs_FLP.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870B017F6BD9C00F6C878 /* structs_FLP.h */; }; + 95F27F4B17F6DF79009E13C6 /* Inlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870B717F6BD9C00F6C878 /* Inlines.h */; }; + 95F27F5317F6DF79009E13C6 /* MacroCount.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870BF17F6BD9C00F6C878 /* MacroCount.h */; }; + 95F27F5417F6DF79009E13C6 /* MacroDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870C017F6BD9C00F6C878 /* MacroDebug.h */; }; + 95F27F5517F6DF79009E13C6 /* macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870C117F6BD9C00F6C878 /* macros.h */; }; + 95F27F5617F6DF79009E13C6 /* main.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870C217F6BD9C00F6C878 /* main.h */; }; + 95F27F6117F6DF79009E13C6 /* pitch_est_defines.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870CD17F6BD9C00F6C878 /* pitch_est_defines.h */; }; + 95F27F6417F6DF79009E13C6 /* PLC.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870D017F6BD9C00F6C878 /* PLC.h */; }; + 95F27F6A17F6DF79009E13C6 /* resampler_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870D617F6BD9C00F6C878 /* resampler_private.h */; }; + 95F27F7017F6DF79009E13C6 /* resampler_rom.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870DC17F6BD9C00F6C878 /* resampler_rom.h */; }; + 95F27F7117F6DF79009E13C6 /* resampler_structs.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870DD17F6BD9C00F6C878 /* resampler_structs.h */; }; + 95F27F7417F6DF79009E13C6 /* SigProc_FIX.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870E017F6BD9C00F6C878 /* SigProc_FIX.h */; }; + 95F27F7C17F6DF79009E13C6 /* structs.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870EA17F6BD9C00F6C878 /* structs.h */; }; + 95F27F7F17F6DF79009E13C6 /* tables.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870ED17F6BD9C00F6C878 /* tables.h */; }; + 95F27F8717F6DF79009E13C6 /* tuning_parameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870F517F6BD9C00F6C878 /* tuning_parameters.h */; }; + 95F27F8817F6DF79009E13C6 /* typedef.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870F617F6BD9C00F6C878 /* typedef.h */; }; + 95F27F8F17F6DF79009E13C6 /* opus_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C86C5417F6B30100F6C878 /* opus_private.h */; }; + 95F27F9617F6DFCA009E13C6 /* main_FLP.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C870A117F6BD9C00F6C878 /* main_FLP.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 95C873F617F6D2B200F6C878 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 95C86C4A17F6B30100F6C878 /* opus.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = opus.c; sourceTree = ""; }; + 95C86C4E17F6B30100F6C878 /* opus_decoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = opus_decoder.c; sourceTree = ""; }; + 95C86C5217F6B30100F6C878 /* opus_encoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = opus_encoder.c; sourceTree = ""; }; + 95C86C5317F6B30100F6C878 /* opus_multistream.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = opus_multistream.c; sourceTree = ""; }; + 95C86C5417F6B30100F6C878 /* opus_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opus_private.h; sourceTree = ""; }; + 95C86C5517F6B30100F6C878 /* repacketizer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = repacketizer.c; sourceTree = ""; }; + 95C86CB117F6B35500F6C878 /* opus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opus.h; sourceTree = ""; }; + 95C86CB217F6B35500F6C878 /* opus_custom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opus_custom.h; sourceTree = ""; }; + 95C86CB317F6B35500F6C878 /* opus_defines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opus_defines.h; sourceTree = ""; }; + 95C86CB417F6B35500F6C878 /* opus_multistream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opus_multistream.h; sourceTree = ""; }; + 95C86CB517F6B35500F6C878 /* opus_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opus_types.h; sourceTree = ""; }; + 95C86DE017F6B3F700F6C878 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; + 95C86EBC17F6BCBD00F6C878 /* Opus.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Opus.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 95C86EC617F6BCBD00F6C878 /* Opus-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Opus-Info.plist"; sourceTree = ""; }; + 95C86F0917F6BD7700F6C878 /* _kiss_fft_guts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _kiss_fft_guts.h; sourceTree = ""; }; + 95C86F0A17F6BD7700F6C878 /* arch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = arch.h; sourceTree = ""; }; + 95C86F0B17F6BD7700F6C878 /* bands.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bands.c; sourceTree = ""; }; + 95C86F0C17F6BD7700F6C878 /* bands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bands.h; sourceTree = ""; }; + 95C86F0D17F6BD7700F6C878 /* celt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = celt.c; sourceTree = ""; }; + 95C86F0E17F6BD7700F6C878 /* celt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = celt.h; sourceTree = ""; }; + 95C86F1117F6BD7700F6C878 /* celt_lpc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = celt_lpc.c; sourceTree = ""; }; + 95C86F1217F6BD7700F6C878 /* celt_lpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = celt_lpc.h; sourceTree = ""; }; + 95C86F1317F6BD7700F6C878 /* cwrs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cwrs.c; sourceTree = ""; }; + 95C86F1417F6BD7700F6C878 /* cwrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cwrs.h; sourceTree = ""; }; + 95C86F1517F6BD7700F6C878 /* ecintrin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ecintrin.h; sourceTree = ""; }; + 95C86F1617F6BD7700F6C878 /* entcode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = entcode.c; sourceTree = ""; }; + 95C86F1717F6BD7700F6C878 /* entcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = entcode.h; sourceTree = ""; }; + 95C86F1817F6BD7700F6C878 /* entdec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = entdec.c; sourceTree = ""; }; + 95C86F1917F6BD7700F6C878 /* entdec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = entdec.h; sourceTree = ""; }; + 95C86F1A17F6BD7700F6C878 /* entenc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = entenc.c; sourceTree = ""; }; + 95C86F1B17F6BD7700F6C878 /* entenc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = entenc.h; sourceTree = ""; }; + 95C86F1C17F6BD7700F6C878 /* fixed_debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fixed_debug.h; sourceTree = ""; }; + 95C86F1D17F6BD7700F6C878 /* fixed_generic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fixed_generic.h; sourceTree = ""; }; + 95C86F1E17F6BD7700F6C878 /* float_cast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = float_cast.h; sourceTree = ""; }; + 95C86F1F17F6BD7700F6C878 /* kiss_fft.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = kiss_fft.c; sourceTree = ""; }; + 95C86F2017F6BD7700F6C878 /* kiss_fft.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kiss_fft.h; sourceTree = ""; }; + 95C86F2117F6BD7700F6C878 /* laplace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = laplace.c; sourceTree = ""; }; + 95C86F2217F6BD7700F6C878 /* laplace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = laplace.h; sourceTree = ""; }; + 95C86F2317F6BD7700F6C878 /* mathops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mathops.c; sourceTree = ""; }; + 95C86F2417F6BD7700F6C878 /* mathops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mathops.h; sourceTree = ""; }; + 95C86F2517F6BD7700F6C878 /* mdct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mdct.c; sourceTree = ""; }; + 95C86F2617F6BD7700F6C878 /* mdct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mdct.h; sourceTree = ""; }; + 95C86F2717F6BD7700F6C878 /* mfrngcod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mfrngcod.h; sourceTree = ""; }; + 95C86F2817F6BD7700F6C878 /* modes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = modes.c; sourceTree = ""; }; + 95C86F2917F6BD7700F6C878 /* modes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = modes.h; sourceTree = ""; }; + 95C86F2B17F6BD7700F6C878 /* os_support.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = os_support.h; sourceTree = ""; }; + 95C86F2C17F6BD7700F6C878 /* pitch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pitch.c; sourceTree = ""; }; + 95C86F2D17F6BD7700F6C878 /* pitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pitch.h; sourceTree = ""; }; + 95C86F2E17F6BD7700F6C878 /* quant_bands.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = quant_bands.c; sourceTree = ""; }; + 95C86F2F17F6BD7700F6C878 /* quant_bands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = quant_bands.h; sourceTree = ""; }; + 95C86F3017F6BD7700F6C878 /* rate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rate.c; sourceTree = ""; }; + 95C86F3117F6BD7700F6C878 /* rate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rate.h; sourceTree = ""; }; + 95C86F3217F6BD7700F6C878 /* stack_alloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stack_alloc.h; sourceTree = ""; }; + 95C86F3317F6BD7700F6C878 /* static_modes_fixed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = static_modes_fixed.h; sourceTree = ""; }; + 95C86F3417F6BD7700F6C878 /* static_modes_float.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = static_modes_float.h; sourceTree = ""; }; + 95C86F4717F6BD7700F6C878 /* vq.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vq.c; sourceTree = ""; }; + 95C86F4817F6BD7700F6C878 /* vq.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vq.h; sourceTree = ""; }; + 95C8701A17F6BD9B00F6C878 /* A2NLSF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = A2NLSF.c; sourceTree = ""; }; + 95C8701B17F6BD9B00F6C878 /* ana_filt_bank_1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ana_filt_bank_1.c; sourceTree = ""; }; + 95C8701C17F6BD9B00F6C878 /* API.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = API.h; sourceTree = ""; }; + 95C8701D17F6BD9B00F6C878 /* biquad_alt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = biquad_alt.c; sourceTree = ""; }; + 95C8701E17F6BD9B00F6C878 /* bwexpander.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bwexpander.c; sourceTree = ""; }; + 95C8701F17F6BD9B00F6C878 /* bwexpander_32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bwexpander_32.c; sourceTree = ""; }; + 95C8702017F6BD9B00F6C878 /* check_control_input.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = check_control_input.c; sourceTree = ""; }; + 95C8702117F6BD9B00F6C878 /* CNG.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = CNG.c; sourceTree = ""; }; + 95C8702217F6BD9B00F6C878 /* code_signs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = code_signs.c; sourceTree = ""; }; + 95C8702317F6BD9B00F6C878 /* control.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = control.h; sourceTree = ""; }; + 95C8702417F6BD9B00F6C878 /* control_audio_bandwidth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = control_audio_bandwidth.c; sourceTree = ""; }; + 95C8702517F6BD9B00F6C878 /* control_codec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = control_codec.c; sourceTree = ""; }; + 95C8702617F6BD9C00F6C878 /* control_SNR.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = control_SNR.c; sourceTree = ""; }; + 95C8702717F6BD9C00F6C878 /* debug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = debug.c; sourceTree = ""; }; + 95C8702817F6BD9C00F6C878 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = ""; }; + 95C8702917F6BD9C00F6C878 /* dec_API.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dec_API.c; sourceTree = ""; }; + 95C8702A17F6BD9C00F6C878 /* decode_core.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = decode_core.c; sourceTree = ""; }; + 95C8702B17F6BD9C00F6C878 /* decode_frame.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = decode_frame.c; sourceTree = ""; }; + 95C8702C17F6BD9C00F6C878 /* decode_indices.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = decode_indices.c; sourceTree = ""; }; + 95C8702D17F6BD9C00F6C878 /* decode_parameters.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = decode_parameters.c; sourceTree = ""; }; + 95C8702E17F6BD9C00F6C878 /* decode_pitch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = decode_pitch.c; sourceTree = ""; }; + 95C8702F17F6BD9C00F6C878 /* decode_pulses.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = decode_pulses.c; sourceTree = ""; }; + 95C8703017F6BD9C00F6C878 /* decoder_set_fs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = decoder_set_fs.c; sourceTree = ""; }; + 95C8703117F6BD9C00F6C878 /* define.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = define.h; sourceTree = ""; }; + 95C8703217F6BD9C00F6C878 /* enc_API.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = enc_API.c; sourceTree = ""; }; + 95C8703317F6BD9C00F6C878 /* encode_indices.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = encode_indices.c; sourceTree = ""; }; + 95C8703417F6BD9C00F6C878 /* encode_pulses.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = encode_pulses.c; sourceTree = ""; }; + 95C8703517F6BD9C00F6C878 /* errors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = errors.h; sourceTree = ""; }; + 95C8708F17F6BD9C00F6C878 /* apply_sine_window_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = apply_sine_window_FLP.c; sourceTree = ""; }; + 95C8709017F6BD9C00F6C878 /* autocorrelation_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = autocorrelation_FLP.c; sourceTree = ""; }; + 95C8709117F6BD9C00F6C878 /* burg_modified_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = burg_modified_FLP.c; sourceTree = ""; }; + 95C8709217F6BD9C00F6C878 /* bwexpander_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bwexpander_FLP.c; sourceTree = ""; }; + 95C8709317F6BD9C00F6C878 /* corrMatrix_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = corrMatrix_FLP.c; sourceTree = ""; }; + 95C8709417F6BD9C00F6C878 /* encode_frame_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = encode_frame_FLP.c; sourceTree = ""; }; + 95C8709517F6BD9C00F6C878 /* energy_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = energy_FLP.c; sourceTree = ""; }; + 95C8709617F6BD9C00F6C878 /* find_LPC_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = find_LPC_FLP.c; sourceTree = ""; }; + 95C8709717F6BD9C00F6C878 /* find_LTP_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = find_LTP_FLP.c; sourceTree = ""; }; + 95C8709817F6BD9C00F6C878 /* find_pitch_lags_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = find_pitch_lags_FLP.c; sourceTree = ""; }; + 95C8709917F6BD9C00F6C878 /* find_pred_coefs_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = find_pred_coefs_FLP.c; sourceTree = ""; }; + 95C8709A17F6BD9C00F6C878 /* inner_product_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inner_product_FLP.c; sourceTree = ""; }; + 95C8709B17F6BD9C00F6C878 /* k2a_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = k2a_FLP.c; sourceTree = ""; }; + 95C8709C17F6BD9C00F6C878 /* levinsondurbin_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = levinsondurbin_FLP.c; sourceTree = ""; }; + 95C8709D17F6BD9C00F6C878 /* LPC_analysis_filter_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = LPC_analysis_filter_FLP.c; sourceTree = ""; }; + 95C8709E17F6BD9C00F6C878 /* LPC_inv_pred_gain_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = LPC_inv_pred_gain_FLP.c; sourceTree = ""; }; + 95C8709F17F6BD9C00F6C878 /* LTP_analysis_filter_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = LTP_analysis_filter_FLP.c; sourceTree = ""; }; + 95C870A017F6BD9C00F6C878 /* LTP_scale_ctrl_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = LTP_scale_ctrl_FLP.c; sourceTree = ""; }; + 95C870A117F6BD9C00F6C878 /* main_FLP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = main_FLP.h; sourceTree = ""; }; + 95C870A217F6BD9C00F6C878 /* noise_shape_analysis_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = noise_shape_analysis_FLP.c; sourceTree = ""; }; + 95C870A317F6BD9C00F6C878 /* pitch_analysis_core_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pitch_analysis_core_FLP.c; sourceTree = ""; }; + 95C870A417F6BD9C00F6C878 /* prefilter_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prefilter_FLP.c; sourceTree = ""; }; + 95C870A517F6BD9C00F6C878 /* process_gains_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = process_gains_FLP.c; sourceTree = ""; }; + 95C870A617F6BD9C00F6C878 /* regularize_correlations_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regularize_correlations_FLP.c; sourceTree = ""; }; + 95C870A717F6BD9C00F6C878 /* residual_energy_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = residual_energy_FLP.c; sourceTree = ""; }; + 95C870A817F6BD9C00F6C878 /* scale_copy_vector_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = scale_copy_vector_FLP.c; sourceTree = ""; }; + 95C870A917F6BD9C00F6C878 /* scale_vector_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = scale_vector_FLP.c; sourceTree = ""; }; + 95C870AA17F6BD9C00F6C878 /* schur_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = schur_FLP.c; sourceTree = ""; }; + 95C870AB17F6BD9C00F6C878 /* SigProc_FLP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SigProc_FLP.h; sourceTree = ""; }; + 95C870AE17F6BD9C00F6C878 /* solve_LS_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = solve_LS_FLP.c; sourceTree = ""; }; + 95C870AF17F6BD9C00F6C878 /* sort_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sort_FLP.c; sourceTree = ""; }; + 95C870B017F6BD9C00F6C878 /* structs_FLP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = structs_FLP.h; sourceTree = ""; }; + 95C870B117F6BD9C00F6C878 /* warped_autocorrelation_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = warped_autocorrelation_FLP.c; sourceTree = ""; }; + 95C870B217F6BD9C00F6C878 /* wrappers_FLP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = wrappers_FLP.c; sourceTree = ""; }; + 95C870B317F6BD9C00F6C878 /* gain_quant.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gain_quant.c; sourceTree = ""; }; + 95C870B417F6BD9C00F6C878 /* HP_variable_cutoff.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = HP_variable_cutoff.c; sourceTree = ""; }; + 95C870B517F6BD9C00F6C878 /* init_decoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = init_decoder.c; sourceTree = ""; }; + 95C870B617F6BD9C00F6C878 /* init_encoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = init_encoder.c; sourceTree = ""; }; + 95C870B717F6BD9C00F6C878 /* Inlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Inlines.h; sourceTree = ""; }; + 95C870B817F6BD9C00F6C878 /* inner_prod_aligned.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inner_prod_aligned.c; sourceTree = ""; }; + 95C870B917F6BD9C00F6C878 /* interpolate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = interpolate.c; sourceTree = ""; }; + 95C870BA17F6BD9C00F6C878 /* lin2log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lin2log.c; sourceTree = ""; }; + 95C870BB17F6BD9C00F6C878 /* log2lin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = log2lin.c; sourceTree = ""; }; + 95C870BC17F6BD9C00F6C878 /* LP_variable_cutoff.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = LP_variable_cutoff.c; sourceTree = ""; }; + 95C870BD17F6BD9C00F6C878 /* LPC_analysis_filter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = LPC_analysis_filter.c; sourceTree = ""; }; + 95C870BE17F6BD9C00F6C878 /* LPC_inv_pred_gain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = LPC_inv_pred_gain.c; sourceTree = ""; }; + 95C870BF17F6BD9C00F6C878 /* MacroCount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroCount.h; sourceTree = ""; }; + 95C870C017F6BD9C00F6C878 /* MacroDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroDebug.h; sourceTree = ""; }; + 95C870C117F6BD9C00F6C878 /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macros.h; sourceTree = ""; }; + 95C870C217F6BD9C00F6C878 /* main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = main.h; sourceTree = ""; }; + 95C870C317F6BD9C00F6C878 /* NLSF2A.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = NLSF2A.c; sourceTree = ""; }; + 95C870C417F6BD9C00F6C878 /* NLSF_decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = NLSF_decode.c; sourceTree = ""; }; + 95C870C517F6BD9C00F6C878 /* NLSF_del_dec_quant.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = NLSF_del_dec_quant.c; sourceTree = ""; }; + 95C870C617F6BD9C00F6C878 /* NLSF_encode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = NLSF_encode.c; sourceTree = ""; }; + 95C870C717F6BD9C00F6C878 /* NLSF_stabilize.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = NLSF_stabilize.c; sourceTree = ""; }; + 95C870C817F6BD9C00F6C878 /* NLSF_unpack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = NLSF_unpack.c; sourceTree = ""; }; + 95C870C917F6BD9C00F6C878 /* NLSF_VQ.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = NLSF_VQ.c; sourceTree = ""; }; + 95C870CA17F6BD9C00F6C878 /* NLSF_VQ_weights_laroia.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = NLSF_VQ_weights_laroia.c; sourceTree = ""; }; + 95C870CB17F6BD9C00F6C878 /* NSQ.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = NSQ.c; sourceTree = ""; }; + 95C870CC17F6BD9C00F6C878 /* NSQ_del_dec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = NSQ_del_dec.c; sourceTree = ""; }; + 95C870CD17F6BD9C00F6C878 /* pitch_est_defines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pitch_est_defines.h; sourceTree = ""; }; + 95C870CE17F6BD9C00F6C878 /* pitch_est_tables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pitch_est_tables.c; sourceTree = ""; }; + 95C870CF17F6BD9C00F6C878 /* PLC.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = PLC.c; sourceTree = ""; }; + 95C870D017F6BD9C00F6C878 /* PLC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PLC.h; sourceTree = ""; }; + 95C870D117F6BD9C00F6C878 /* process_NLSFs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = process_NLSFs.c; sourceTree = ""; }; + 95C870D217F6BD9C00F6C878 /* quant_LTP_gains.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = quant_LTP_gains.c; sourceTree = ""; }; + 95C870D317F6BD9C00F6C878 /* resampler.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resampler.c; sourceTree = ""; }; + 95C870D417F6BD9C00F6C878 /* resampler_down2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resampler_down2.c; sourceTree = ""; }; + 95C870D517F6BD9C00F6C878 /* resampler_down2_3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resampler_down2_3.c; sourceTree = ""; }; + 95C870D617F6BD9C00F6C878 /* resampler_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resampler_private.h; sourceTree = ""; }; + 95C870D717F6BD9C00F6C878 /* resampler_private_AR2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resampler_private_AR2.c; sourceTree = ""; }; + 95C870D817F6BD9C00F6C878 /* resampler_private_down_FIR.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resampler_private_down_FIR.c; sourceTree = ""; }; + 95C870D917F6BD9C00F6C878 /* resampler_private_IIR_FIR.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resampler_private_IIR_FIR.c; sourceTree = ""; }; + 95C870DA17F6BD9C00F6C878 /* resampler_private_up2_HQ.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resampler_private_up2_HQ.c; sourceTree = ""; }; + 95C870DB17F6BD9C00F6C878 /* resampler_rom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resampler_rom.c; sourceTree = ""; }; + 95C870DC17F6BD9C00F6C878 /* resampler_rom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resampler_rom.h; sourceTree = ""; }; + 95C870DD17F6BD9C00F6C878 /* resampler_structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resampler_structs.h; sourceTree = ""; }; + 95C870DE17F6BD9C00F6C878 /* shell_coder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = shell_coder.c; sourceTree = ""; }; + 95C870DF17F6BD9C00F6C878 /* sigm_Q15.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sigm_Q15.c; sourceTree = ""; }; + 95C870E017F6BD9C00F6C878 /* SigProc_FIX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SigProc_FIX.h; sourceTree = ""; }; + 95C870E317F6BD9C00F6C878 /* sort.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sort.c; sourceTree = ""; }; + 95C870E417F6BD9C00F6C878 /* stereo_decode_pred.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stereo_decode_pred.c; sourceTree = ""; }; + 95C870E517F6BD9C00F6C878 /* stereo_encode_pred.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stereo_encode_pred.c; sourceTree = ""; }; + 95C870E617F6BD9C00F6C878 /* stereo_find_predictor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stereo_find_predictor.c; sourceTree = ""; }; + 95C870E717F6BD9C00F6C878 /* stereo_LR_to_MS.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stereo_LR_to_MS.c; sourceTree = ""; }; + 95C870E817F6BD9C00F6C878 /* stereo_MS_to_LR.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stereo_MS_to_LR.c; sourceTree = ""; }; + 95C870E917F6BD9C00F6C878 /* stereo_quant_pred.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stereo_quant_pred.c; sourceTree = ""; }; + 95C870EA17F6BD9C00F6C878 /* structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = structs.h; sourceTree = ""; }; + 95C870EB17F6BD9C00F6C878 /* sum_sqr_shift.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sum_sqr_shift.c; sourceTree = ""; }; + 95C870EC17F6BD9C00F6C878 /* table_LSF_cos.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = table_LSF_cos.c; sourceTree = ""; }; + 95C870ED17F6BD9C00F6C878 /* tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tables.h; sourceTree = ""; }; + 95C870EE17F6BD9C00F6C878 /* tables_gain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tables_gain.c; sourceTree = ""; }; + 95C870EF17F6BD9C00F6C878 /* tables_LTP.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tables_LTP.c; sourceTree = ""; }; + 95C870F017F6BD9C00F6C878 /* tables_NLSF_CB_NB_MB.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tables_NLSF_CB_NB_MB.c; sourceTree = ""; }; + 95C870F117F6BD9C00F6C878 /* tables_NLSF_CB_WB.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tables_NLSF_CB_WB.c; sourceTree = ""; }; + 95C870F217F6BD9C00F6C878 /* tables_other.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tables_other.c; sourceTree = ""; }; + 95C870F317F6BD9C00F6C878 /* tables_pitch_lag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tables_pitch_lag.c; sourceTree = ""; }; + 95C870F417F6BD9C00F6C878 /* tables_pulses_per_block.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tables_pulses_per_block.c; sourceTree = ""; }; + 95C870F517F6BD9C00F6C878 /* tuning_parameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tuning_parameters.h; sourceTree = ""; }; + 95C870F617F6BD9C00F6C878 /* typedef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = typedef.h; sourceTree = ""; }; + 95C870F717F6BD9C00F6C878 /* VAD.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = VAD.c; sourceTree = ""; }; + 95C870F817F6BD9D00F6C878 /* VQ_WMat_EC.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = VQ_WMat_EC.c; sourceTree = ""; }; + 95C873F817F6D2B200F6C878 /* libopus.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libopus.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 95F27DF517F6DEA0009E13C6 /* Opus.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Opus.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 95F27DF817F6DEA0009E13C6 /* Opus_ios-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Opus_ios-Info.plist"; path = "Opus_ios/Opus_ios-Info.plist"; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 95C86EB817F6BCBD00F6C878 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95C873F517F6D2B200F6C878 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95F27DEF17F6DEA0009E13C6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 95C86C1717F6B2A100F6C878 = { + isa = PBXGroup; + children = ( + 95C86C2517F6B2A100F6C878 /* Opus */, + 95C86C2117F6B2A100F6C878 /* Products */, + ); + sourceTree = ""; + }; + 95C86C2117F6B2A100F6C878 /* Products */ = { + isa = PBXGroup; + children = ( + 95C86EBC17F6BCBD00F6C878 /* Opus.framework */, + 95C873F817F6D2B200F6C878 /* libopus.a */, + 95F27DF517F6DEA0009E13C6 /* Opus.framework */, + ); + name = Products; + sourceTree = ""; + }; + 95C86C2517F6B2A100F6C878 /* Opus */ = { + isa = PBXGroup; + children = ( + 95C86DE017F6B3F700F6C878 /* config.h */, + 95C86EF617F6BD7700F6C878 /* celt */, + 95C86CB017F6B35500F6C878 /* include */, + 95C86FCC17F6BD9B00F6C878 /* silk */, + 95C86C4917F6B30100F6C878 /* src */, + 95C86EC517F6BCBD00F6C878 /* Supporting Files */, + ); + path = Opus; + sourceTree = ""; + }; + 95C86C4917F6B30100F6C878 /* src */ = { + isa = PBXGroup; + children = ( + 95C86C4A17F6B30100F6C878 /* opus.c */, + 95C86C4E17F6B30100F6C878 /* opus_decoder.c */, + 95C86C5217F6B30100F6C878 /* opus_encoder.c */, + 95C86C5317F6B30100F6C878 /* opus_multistream.c */, + 95C86C5417F6B30100F6C878 /* opus_private.h */, + 95C86C5517F6B30100F6C878 /* repacketizer.c */, + ); + name = src; + path = "../../libopus-src/src"; + sourceTree = ""; + }; + 95C86CB017F6B35500F6C878 /* include */ = { + isa = PBXGroup; + children = ( + 95C86CB117F6B35500F6C878 /* opus.h */, + 95C86CB217F6B35500F6C878 /* opus_custom.h */, + 95C86CB317F6B35500F6C878 /* opus_defines.h */, + 95C86CB417F6B35500F6C878 /* opus_multistream.h */, + 95C86CB517F6B35500F6C878 /* opus_types.h */, + ); + name = include; + path = "../../libopus-src/include"; + sourceTree = ""; + }; + 95C86EC517F6BCBD00F6C878 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 95F27DF817F6DEA0009E13C6 /* Opus_ios-Info.plist */, + 95C86EC617F6BCBD00F6C878 /* Opus-Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 95C86EF617F6BD7700F6C878 /* celt */ = { + isa = PBXGroup; + children = ( + 95C86F0917F6BD7700F6C878 /* _kiss_fft_guts.h */, + 95C86F0A17F6BD7700F6C878 /* arch.h */, + 95C86F0B17F6BD7700F6C878 /* bands.c */, + 95C86F0C17F6BD7700F6C878 /* bands.h */, + 95C86F0D17F6BD7700F6C878 /* celt.c */, + 95C86F0E17F6BD7700F6C878 /* celt.h */, + 95C86F1117F6BD7700F6C878 /* celt_lpc.c */, + 95C86F1217F6BD7700F6C878 /* celt_lpc.h */, + 95C86F1317F6BD7700F6C878 /* cwrs.c */, + 95C86F1417F6BD7700F6C878 /* cwrs.h */, + 95C86F1517F6BD7700F6C878 /* ecintrin.h */, + 95C86F1617F6BD7700F6C878 /* entcode.c */, + 95C86F1717F6BD7700F6C878 /* entcode.h */, + 95C86F1817F6BD7700F6C878 /* entdec.c */, + 95C86F1917F6BD7700F6C878 /* entdec.h */, + 95C86F1A17F6BD7700F6C878 /* entenc.c */, + 95C86F1B17F6BD7700F6C878 /* entenc.h */, + 95C86F1C17F6BD7700F6C878 /* fixed_debug.h */, + 95C86F1D17F6BD7700F6C878 /* fixed_generic.h */, + 95C86F1E17F6BD7700F6C878 /* float_cast.h */, + 95C86F1F17F6BD7700F6C878 /* kiss_fft.c */, + 95C86F2017F6BD7700F6C878 /* kiss_fft.h */, + 95C86F2117F6BD7700F6C878 /* laplace.c */, + 95C86F2217F6BD7700F6C878 /* laplace.h */, + 95C86F2317F6BD7700F6C878 /* mathops.c */, + 95C86F2417F6BD7700F6C878 /* mathops.h */, + 95C86F2517F6BD7700F6C878 /* mdct.c */, + 95C86F2617F6BD7700F6C878 /* mdct.h */, + 95C86F2717F6BD7700F6C878 /* mfrngcod.h */, + 95C86F2817F6BD7700F6C878 /* modes.c */, + 95C86F2917F6BD7700F6C878 /* modes.h */, + 95C86F2B17F6BD7700F6C878 /* os_support.h */, + 95C86F2C17F6BD7700F6C878 /* pitch.c */, + 95C86F2D17F6BD7700F6C878 /* pitch.h */, + 95C86F2E17F6BD7700F6C878 /* quant_bands.c */, + 95C86F2F17F6BD7700F6C878 /* quant_bands.h */, + 95C86F3017F6BD7700F6C878 /* rate.c */, + 95C86F3117F6BD7700F6C878 /* rate.h */, + 95C86F3217F6BD7700F6C878 /* stack_alloc.h */, + 95C86F3317F6BD7700F6C878 /* static_modes_fixed.h */, + 95C86F3417F6BD7700F6C878 /* static_modes_float.h */, + 95C86F4717F6BD7700F6C878 /* vq.c */, + 95C86F4817F6BD7700F6C878 /* vq.h */, + ); + name = celt; + path = "../../libopus-src/celt"; + sourceTree = ""; + }; + 95C86FCC17F6BD9B00F6C878 /* silk */ = { + isa = PBXGroup; + children = ( + 95C8701A17F6BD9B00F6C878 /* A2NLSF.c */, + 95C8701B17F6BD9B00F6C878 /* ana_filt_bank_1.c */, + 95C8701C17F6BD9B00F6C878 /* API.h */, + 95C8701D17F6BD9B00F6C878 /* biquad_alt.c */, + 95C8701E17F6BD9B00F6C878 /* bwexpander.c */, + 95C8701F17F6BD9B00F6C878 /* bwexpander_32.c */, + 95C8702017F6BD9B00F6C878 /* check_control_input.c */, + 95C8702117F6BD9B00F6C878 /* CNG.c */, + 95C8702217F6BD9B00F6C878 /* code_signs.c */, + 95C8702317F6BD9B00F6C878 /* control.h */, + 95C8702417F6BD9B00F6C878 /* control_audio_bandwidth.c */, + 95C8702517F6BD9B00F6C878 /* control_codec.c */, + 95C8702617F6BD9C00F6C878 /* control_SNR.c */, + 95C8702717F6BD9C00F6C878 /* debug.c */, + 95C8702817F6BD9C00F6C878 /* debug.h */, + 95C8702917F6BD9C00F6C878 /* dec_API.c */, + 95C8702A17F6BD9C00F6C878 /* decode_core.c */, + 95C8702B17F6BD9C00F6C878 /* decode_frame.c */, + 95C8702C17F6BD9C00F6C878 /* decode_indices.c */, + 95C8702D17F6BD9C00F6C878 /* decode_parameters.c */, + 95C8702E17F6BD9C00F6C878 /* decode_pitch.c */, + 95C8702F17F6BD9C00F6C878 /* decode_pulses.c */, + 95C8703017F6BD9C00F6C878 /* decoder_set_fs.c */, + 95C8703117F6BD9C00F6C878 /* define.h */, + 95C8703217F6BD9C00F6C878 /* enc_API.c */, + 95C8703317F6BD9C00F6C878 /* encode_indices.c */, + 95C8703417F6BD9C00F6C878 /* encode_pulses.c */, + 95C8703517F6BD9C00F6C878 /* errors.h */, + 95C8706E17F6BD9C00F6C878 /* float */, + 95C870B317F6BD9C00F6C878 /* gain_quant.c */, + 95C870B417F6BD9C00F6C878 /* HP_variable_cutoff.c */, + 95C870B517F6BD9C00F6C878 /* init_decoder.c */, + 95C870B617F6BD9C00F6C878 /* init_encoder.c */, + 95C870B717F6BD9C00F6C878 /* Inlines.h */, + 95C870B817F6BD9C00F6C878 /* inner_prod_aligned.c */, + 95C870B917F6BD9C00F6C878 /* interpolate.c */, + 95C870BA17F6BD9C00F6C878 /* lin2log.c */, + 95C870BB17F6BD9C00F6C878 /* log2lin.c */, + 95C870BC17F6BD9C00F6C878 /* LP_variable_cutoff.c */, + 95C870BD17F6BD9C00F6C878 /* LPC_analysis_filter.c */, + 95C870BE17F6BD9C00F6C878 /* LPC_inv_pred_gain.c */, + 95C870BF17F6BD9C00F6C878 /* MacroCount.h */, + 95C870C017F6BD9C00F6C878 /* MacroDebug.h */, + 95C870C117F6BD9C00F6C878 /* macros.h */, + 95C870C217F6BD9C00F6C878 /* main.h */, + 95C870C317F6BD9C00F6C878 /* NLSF2A.c */, + 95C870C417F6BD9C00F6C878 /* NLSF_decode.c */, + 95C870C517F6BD9C00F6C878 /* NLSF_del_dec_quant.c */, + 95C870C617F6BD9C00F6C878 /* NLSF_encode.c */, + 95C870C717F6BD9C00F6C878 /* NLSF_stabilize.c */, + 95C870C817F6BD9C00F6C878 /* NLSF_unpack.c */, + 95C870C917F6BD9C00F6C878 /* NLSF_VQ.c */, + 95C870CA17F6BD9C00F6C878 /* NLSF_VQ_weights_laroia.c */, + 95C870CB17F6BD9C00F6C878 /* NSQ.c */, + 95C870CC17F6BD9C00F6C878 /* NSQ_del_dec.c */, + 95C870CD17F6BD9C00F6C878 /* pitch_est_defines.h */, + 95C870CE17F6BD9C00F6C878 /* pitch_est_tables.c */, + 95C870CF17F6BD9C00F6C878 /* PLC.c */, + 95C870D017F6BD9C00F6C878 /* PLC.h */, + 95C870D117F6BD9C00F6C878 /* process_NLSFs.c */, + 95C870D217F6BD9C00F6C878 /* quant_LTP_gains.c */, + 95C870D317F6BD9C00F6C878 /* resampler.c */, + 95C870D417F6BD9C00F6C878 /* resampler_down2.c */, + 95C870D517F6BD9C00F6C878 /* resampler_down2_3.c */, + 95C870D617F6BD9C00F6C878 /* resampler_private.h */, + 95C870D717F6BD9C00F6C878 /* resampler_private_AR2.c */, + 95C870D817F6BD9C00F6C878 /* resampler_private_down_FIR.c */, + 95C870D917F6BD9C00F6C878 /* resampler_private_IIR_FIR.c */, + 95C870DA17F6BD9C00F6C878 /* resampler_private_up2_HQ.c */, + 95C870DB17F6BD9C00F6C878 /* resampler_rom.c */, + 95C870DC17F6BD9C00F6C878 /* resampler_rom.h */, + 95C870DD17F6BD9C00F6C878 /* resampler_structs.h */, + 95C870DE17F6BD9C00F6C878 /* shell_coder.c */, + 95C870DF17F6BD9C00F6C878 /* sigm_Q15.c */, + 95C870E017F6BD9C00F6C878 /* SigProc_FIX.h */, + 95C870E317F6BD9C00F6C878 /* sort.c */, + 95C870E417F6BD9C00F6C878 /* stereo_decode_pred.c */, + 95C870E517F6BD9C00F6C878 /* stereo_encode_pred.c */, + 95C870E617F6BD9C00F6C878 /* stereo_find_predictor.c */, + 95C870E717F6BD9C00F6C878 /* stereo_LR_to_MS.c */, + 95C870E817F6BD9C00F6C878 /* stereo_MS_to_LR.c */, + 95C870E917F6BD9C00F6C878 /* stereo_quant_pred.c */, + 95C870EA17F6BD9C00F6C878 /* structs.h */, + 95C870EB17F6BD9C00F6C878 /* sum_sqr_shift.c */, + 95C870EC17F6BD9C00F6C878 /* table_LSF_cos.c */, + 95C870ED17F6BD9C00F6C878 /* tables.h */, + 95C870EE17F6BD9C00F6C878 /* tables_gain.c */, + 95C870EF17F6BD9C00F6C878 /* tables_LTP.c */, + 95C870F017F6BD9C00F6C878 /* tables_NLSF_CB_NB_MB.c */, + 95C870F117F6BD9C00F6C878 /* tables_NLSF_CB_WB.c */, + 95C870F217F6BD9C00F6C878 /* tables_other.c */, + 95C870F317F6BD9C00F6C878 /* tables_pitch_lag.c */, + 95C870F417F6BD9C00F6C878 /* tables_pulses_per_block.c */, + 95C870F517F6BD9C00F6C878 /* tuning_parameters.h */, + 95C870F617F6BD9C00F6C878 /* typedef.h */, + 95C870F717F6BD9C00F6C878 /* VAD.c */, + 95C870F817F6BD9D00F6C878 /* VQ_WMat_EC.c */, + ); + name = silk; + path = "../../libopus-src/silk"; + sourceTree = ""; + }; + 95C8706E17F6BD9C00F6C878 /* float */ = { + isa = PBXGroup; + children = ( + 95C8708F17F6BD9C00F6C878 /* apply_sine_window_FLP.c */, + 95C8709017F6BD9C00F6C878 /* autocorrelation_FLP.c */, + 95C8709117F6BD9C00F6C878 /* burg_modified_FLP.c */, + 95C8709217F6BD9C00F6C878 /* bwexpander_FLP.c */, + 95C8709317F6BD9C00F6C878 /* corrMatrix_FLP.c */, + 95C8709417F6BD9C00F6C878 /* encode_frame_FLP.c */, + 95C8709517F6BD9C00F6C878 /* energy_FLP.c */, + 95C8709617F6BD9C00F6C878 /* find_LPC_FLP.c */, + 95C8709717F6BD9C00F6C878 /* find_LTP_FLP.c */, + 95C8709817F6BD9C00F6C878 /* find_pitch_lags_FLP.c */, + 95C8709917F6BD9C00F6C878 /* find_pred_coefs_FLP.c */, + 95C8709A17F6BD9C00F6C878 /* inner_product_FLP.c */, + 95C8709B17F6BD9C00F6C878 /* k2a_FLP.c */, + 95C8709C17F6BD9C00F6C878 /* levinsondurbin_FLP.c */, + 95C8709D17F6BD9C00F6C878 /* LPC_analysis_filter_FLP.c */, + 95C8709E17F6BD9C00F6C878 /* LPC_inv_pred_gain_FLP.c */, + 95C8709F17F6BD9C00F6C878 /* LTP_analysis_filter_FLP.c */, + 95C870A017F6BD9C00F6C878 /* LTP_scale_ctrl_FLP.c */, + 95C870A117F6BD9C00F6C878 /* main_FLP.h */, + 95C870A217F6BD9C00F6C878 /* noise_shape_analysis_FLP.c */, + 95C870A317F6BD9C00F6C878 /* pitch_analysis_core_FLP.c */, + 95C870A417F6BD9C00F6C878 /* prefilter_FLP.c */, + 95C870A517F6BD9C00F6C878 /* process_gains_FLP.c */, + 95C870A617F6BD9C00F6C878 /* regularize_correlations_FLP.c */, + 95C870A717F6BD9C00F6C878 /* residual_energy_FLP.c */, + 95C870A817F6BD9C00F6C878 /* scale_copy_vector_FLP.c */, + 95C870A917F6BD9C00F6C878 /* scale_vector_FLP.c */, + 95C870AA17F6BD9C00F6C878 /* schur_FLP.c */, + 95C870AB17F6BD9C00F6C878 /* SigProc_FLP.h */, + 95C870AE17F6BD9C00F6C878 /* solve_LS_FLP.c */, + 95C870AF17F6BD9C00F6C878 /* sort_FLP.c */, + 95C870B017F6BD9C00F6C878 /* structs_FLP.h */, + 95C870B117F6BD9C00F6C878 /* warped_autocorrelation_FLP.c */, + 95C870B217F6BD9C00F6C878 /* wrappers_FLP.c */, + ); + path = float; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 95C86EB917F6BCBD00F6C878 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C8715817F6BD9D00F6C878 /* control.h in Headers */, + 95C86F6F17F6BD7700F6C878 /* cwrs.h in Headers */, + 95C86F7917F6BD7700F6C878 /* entdec.h in Headers */, + 95C86FAF17F6BD7700F6C878 /* static_modes_float.h in Headers */, + 95C86F5B17F6BD7700F6C878 /* _kiss_fft_guts.h in Headers */, + 95C86EEF17F6BCFE00F6C878 /* opus.h in Headers */, + 95C86F9517F6BD7700F6C878 /* mfrngcod.h in Headers */, + 95C872A017F6BD9D00F6C878 /* structs.h in Headers */, + 95C86EF017F6BCFE00F6C878 /* opus_defines.h in Headers */, + 95C86FA517F6BD7700F6C878 /* quant_bands.h in Headers */, + 95C8724C17F6BD9D00F6C878 /* MacroCount.h in Headers */, + 95C8728E17F6BD9D00F6C878 /* SigProc_FIX.h in Headers */, + 95C86F6117F6BD7700F6C878 /* bands.h in Headers */, + 95C86F7517F6BD7700F6C878 /* entcode.h in Headers */, + 95C872B617F6BD9D00F6C878 /* tuning_parameters.h in Headers */, + 95C8717417F6BD9D00F6C878 /* define.h in Headers */, + 95C86F9D17F6BD7700F6C878 /* os_support.h in Headers */, + 95C86FA917F6BD7700F6C878 /* rate.h in Headers */, + 95C86EF117F6BCFE00F6C878 /* opus_multistream.h in Headers */, + 95C8722617F6BD9D00F6C878 /* SigProc_FLP.h in Headers */, + 95C86F5D17F6BD7700F6C878 /* arch.h in Headers */, + 95C86F8717F6BD7700F6C878 /* kiss_fft.h in Headers */, + 95C8717C17F6BD9D00F6C878 /* errors.h in Headers */, + 95C86F7F17F6BD7700F6C878 /* fixed_debug.h in Headers */, + 95C86F6B17F6BD7700F6C878 /* celt_lpc.h in Headers */, + 95C8726817F6BD9D00F6C878 /* pitch_est_defines.h in Headers */, + 95C8725217F6BD9D00F6C878 /* main.h in Headers */, + 95C8728617F6BD9D00F6C878 /* resampler_rom.h in Headers */, + 95C86FCB17F6BD7700F6C878 /* vq.h in Headers */, + 95C8728817F6BD9D00F6C878 /* resampler_structs.h in Headers */, + 95C86F9317F6BD7700F6C878 /* mdct.h in Headers */, + 95C86FAB17F6BD7700F6C878 /* stack_alloc.h in Headers */, + 95C86EF217F6BCFE00F6C878 /* opus_types.h in Headers */, + 95C86FA117F6BD7700F6C878 /* pitch.h in Headers */, + 95C8721217F6BD9D00F6C878 /* main_FLP.h in Headers */, + 95C86F8F17F6BD7700F6C878 /* mathops.h in Headers */, + 95C86F8B17F6BD7700F6C878 /* laplace.h in Headers */, + 95C8723C17F6BD9D00F6C878 /* Inlines.h in Headers */, + 95C8725017F6BD9D00F6C878 /* macros.h in Headers */, + 95C8727A17F6BD9D00F6C878 /* resampler_private.h in Headers */, + 95C8716217F6BD9D00F6C878 /* debug.h in Headers */, + 95C86FAD17F6BD7700F6C878 /* static_modes_fixed.h in Headers */, + 95C8724E17F6BD9D00F6C878 /* MacroDebug.h in Headers */, + 95C86F8117F6BD7700F6C878 /* fixed_generic.h in Headers */, + 95C872B817F6BD9D00F6C878 /* typedef.h in Headers */, + 95C86EF517F6BD0B00F6C878 /* opus_private.h in Headers */, + 95C8714A17F6BD9D00F6C878 /* API.h in Headers */, + 95C872A617F6BD9D00F6C878 /* tables.h in Headers */, + 95C86F7D17F6BD7700F6C878 /* entenc.h in Headers */, + 95C86F7117F6BD7700F6C878 /* ecintrin.h in Headers */, + 95C8722E17F6BD9D00F6C878 /* structs_FLP.h in Headers */, + 95C86F8317F6BD7700F6C878 /* float_cast.h in Headers */, + 95C8726E17F6BD9D00F6C878 /* PLC.h in Headers */, + 95C86F6517F6BD7700F6C878 /* celt.h in Headers */, + 95C86F9917F6BD7700F6C878 /* modes.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95C874DA17F6D43700F6C878 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C8759717F6D4CB00F6C878 /* opus.h in Headers */, + 95C8759817F6D4CB00F6C878 /* opus_defines.h in Headers */, + 95C8759917F6D4CB00F6C878 /* opus_multistream.h in Headers */, + 95C8759A17F6D4CB00F6C878 /* opus_types.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95F27DF017F6DEA0009E13C6 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 95F27ED817F6DF71009E13C6 /* opus.h in Headers */, + 95F27ED917F6DF71009E13C6 /* opus_defines.h in Headers */, + 95F27EDA17F6DF71009E13C6 /* opus_multistream.h in Headers */, + 95F27EDB17F6DF71009E13C6 /* opus_types.h in Headers */, + 95F27F9617F6DFCA009E13C6 /* main_FLP.h in Headers */, + 95F27EDC17F6DF79009E13C6 /* config.h in Headers */, + 95F27EDD17F6DF79009E13C6 /* _kiss_fft_guts.h in Headers */, + 95F27EDE17F6DF79009E13C6 /* arch.h in Headers */, + 95F27EE017F6DF79009E13C6 /* bands.h in Headers */, + 95F27EE217F6DF79009E13C6 /* celt.h in Headers */, + 95F27EE417F6DF79009E13C6 /* celt_lpc.h in Headers */, + 95F27EE617F6DF79009E13C6 /* cwrs.h in Headers */, + 95F27EE717F6DF79009E13C6 /* ecintrin.h in Headers */, + 95F27EE917F6DF79009E13C6 /* entcode.h in Headers */, + 95F27EEB17F6DF79009E13C6 /* entdec.h in Headers */, + 95F27EED17F6DF79009E13C6 /* entenc.h in Headers */, + 95F27EEE17F6DF79009E13C6 /* fixed_debug.h in Headers */, + 95F27EEF17F6DF79009E13C6 /* fixed_generic.h in Headers */, + 95F27EF017F6DF79009E13C6 /* float_cast.h in Headers */, + 95F27EF217F6DF79009E13C6 /* kiss_fft.h in Headers */, + 95F27EF417F6DF79009E13C6 /* laplace.h in Headers */, + 95F27EF617F6DF79009E13C6 /* mathops.h in Headers */, + 95F27EF817F6DF79009E13C6 /* mdct.h in Headers */, + 95F27EF917F6DF79009E13C6 /* mfrngcod.h in Headers */, + 95F27EFB17F6DF79009E13C6 /* modes.h in Headers */, + 95F27EFC17F6DF79009E13C6 /* os_support.h in Headers */, + 95F27EFE17F6DF79009E13C6 /* pitch.h in Headers */, + 95F27F0017F6DF79009E13C6 /* quant_bands.h in Headers */, + 95F27F0217F6DF79009E13C6 /* rate.h in Headers */, + 95F27F0317F6DF79009E13C6 /* stack_alloc.h in Headers */, + 95F27F0417F6DF79009E13C6 /* static_modes_fixed.h in Headers */, + 95F27F0517F6DF79009E13C6 /* static_modes_float.h in Headers */, + 95F27F0717F6DF79009E13C6 /* vq.h in Headers */, + 95F27F0817F6DF79009E13C6 /* opus_custom.h in Headers */, + 95F27F0B17F6DF79009E13C6 /* API.h in Headers */, + 95F27F1217F6DF79009E13C6 /* control.h in Headers */, + 95F27F1717F6DF79009E13C6 /* debug.h in Headers */, + 95F27F2017F6DF79009E13C6 /* define.h in Headers */, + 95F27F2417F6DF79009E13C6 /* errors.h in Headers */, + 95F27F4117F6DF79009E13C6 /* SigProc_FLP.h in Headers */, + 95F27F4417F6DF79009E13C6 /* structs_FLP.h in Headers */, + 95F27F4B17F6DF79009E13C6 /* Inlines.h in Headers */, + 95F27F5317F6DF79009E13C6 /* MacroCount.h in Headers */, + 95F27F5417F6DF79009E13C6 /* MacroDebug.h in Headers */, + 95F27F5517F6DF79009E13C6 /* macros.h in Headers */, + 95F27F5617F6DF79009E13C6 /* main.h in Headers */, + 95F27F6117F6DF79009E13C6 /* pitch_est_defines.h in Headers */, + 95F27F6417F6DF79009E13C6 /* PLC.h in Headers */, + 95F27F6A17F6DF79009E13C6 /* resampler_private.h in Headers */, + 95F27F7017F6DF79009E13C6 /* resampler_rom.h in Headers */, + 95F27F7117F6DF79009E13C6 /* resampler_structs.h in Headers */, + 95F27F7417F6DF79009E13C6 /* SigProc_FIX.h in Headers */, + 95F27F7C17F6DF79009E13C6 /* structs.h in Headers */, + 95F27F7F17F6DF79009E13C6 /* tables.h in Headers */, + 95F27F8717F6DF79009E13C6 /* tuning_parameters.h in Headers */, + 95F27F8817F6DF79009E13C6 /* typedef.h in Headers */, + 95F27F8F17F6DF79009E13C6 /* opus_private.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 95C86EBB17F6BCBD00F6C878 /* Opus */ = { + isa = PBXNativeTarget; + buildConfigurationList = 95C86EE117F6BCBD00F6C878 /* Build configuration list for PBXNativeTarget "Opus" */; + buildPhases = ( + 95C86EB717F6BCBD00F6C878 /* Sources */, + 95C86EB817F6BCBD00F6C878 /* Frameworks */, + 95C86EB917F6BCBD00F6C878 /* Headers */, + 95C86EBA17F6BCBD00F6C878 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Opus; + productName = Opus; + productReference = 95C86EBC17F6BCBD00F6C878 /* Opus.framework */; + productType = "com.apple.product-type.framework"; + }; + 95C873F717F6D2B200F6C878 /* opus */ = { + isa = PBXNativeTarget; + buildConfigurationList = 95C8741817F6D2B200F6C878 /* Build configuration list for PBXNativeTarget "opus" */; + buildPhases = ( + 95C873F417F6D2B200F6C878 /* Sources */, + 95C873F517F6D2B200F6C878 /* Frameworks */, + 95C873F617F6D2B200F6C878 /* CopyFiles */, + 95C874DA17F6D43700F6C878 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = opus; + productName = opus; + productReference = 95C873F817F6D2B200F6C878 /* libopus.a */; + productType = "com.apple.product-type.library.static"; + }; + 95F27DF417F6DEA0009E13C6 /* Opus_ios */ = { + isa = PBXNativeTarget; + buildConfigurationList = 95F27E1817F6DEA1009E13C6 /* Build configuration list for PBXNativeTarget "Opus_ios" */; + buildPhases = ( + 95F27DED17F6DEA0009E13C6 /* ShellScript */, + 95F27DEE17F6DEA0009E13C6 /* Sources */, + 95F27DEF17F6DEA0009E13C6 /* Frameworks */, + 95F27DF017F6DEA0009E13C6 /* Headers */, + 95F27DF117F6DEA0009E13C6 /* Resources */, + 95F27DF217F6DEA0009E13C6 /* ShellScript */, + 95F27DF317F6DEA0009E13C6 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Opus_ios; + productName = Opus_ios; + productReference = 95F27DF517F6DEA0009E13C6 /* Opus.framework */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 95C86C1817F6B2A100F6C878 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = "Arthur Evstifeev"; + }; + buildConfigurationList = 95C86C1B17F6B2A100F6C878 /* Build configuration list for PBXProject "Opus" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 95C86C1717F6B2A100F6C878; + productRefGroup = 95C86C2117F6B2A100F6C878 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 95C86EBB17F6BCBD00F6C878 /* Opus */, + 95C873F717F6D2B200F6C878 /* opus */, + 95F27DF417F6DEA0009E13C6 /* Opus_ios */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 95C86EBA17F6BCBD00F6C878 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95F27DF117F6DEA0009E13C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 95F27DED17F6DEA0009E13C6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n\tUFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Clean other platform if needed\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n\techo \"Platform \\\"$UFW_SDK_PLATFORM\\\" was cleaned recently. Cleaning \\\"$UFW_OTHER_PLATFORM\\\" as well\"\n\techo xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\n\txcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\nfi\n\n\n# Make sure we are building from fresh binaries\n\nrm -rf \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\n"; + }; + 95F27DF217F6DEA0009E13C6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "HEADERS_ROOT=$SRCROOT/$PRODUCT_NAME\nFRAMEWORK_HEADERS_DIR=\"$BUILT_PRODUCTS_DIR/$WRAPPER_NAME/Versions/$FRAMEWORK_VERSION/Headers\"\n\n## only header files expected at this point\nPUBLIC_HEADERS=$(find $FRAMEWORK_HEADERS_DIR/. -not -type d 2> /dev/null | sed -e \"s@.*/@@g\")\n\nFIND_OPTS=\"\"\nfor PUBLIC_HEADER in $PUBLIC_HEADERS; do\n if [ -n \"$FIND_OPTS\" ]; then\n FIND_OPTS=\"$FIND_OPTS -o\"\n fi\n FIND_OPTS=\"$FIND_OPTS -name '$PUBLIC_HEADER'\"\ndone\n\nif [ -n \"$FIND_OPTS\" ]; then\n for ORIG_HEADER in $(eval \"find $HEADERS_ROOT/. $FIND_OPTS\" 2> /dev/null | sed -e \"s@^$HEADERS_ROOT/./@@g\"); do\n PUBLIC_HEADER=$(basename $ORIG_HEADER)\n RELATIVE_PATH=$(dirname $ORIG_HEADER)\n if [ -e $FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER ]; then\n mkdir -p \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH\"\n mv \"$FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER\" \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH/$PUBLIC_HEADER\"\n fi\n done\nfi\n"; + }; + 95F27DF317F6DEA0009E13C6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\nexport UFW_MASTER_SCRIPT_RUNNING=1\n\n\n# Functions\n\n## List files in the specified directory, storing to the specified array.\n#\n# @param $1 The path to list\n# @param $2 The name of the array to fill\n#\n##\nlist_files ()\n{\n filelist=$(ls \"$1\")\n while read line\n do\n eval \"$2[\\${#$2[*]}]=\\\"\\$line\\\"\"\n done <<< \"$filelist\"\n}\n\n\n# Sanity check\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n echo \"Framework target \\\"${TARGET_NAME}\\\" had no source files to build from. Make sure your source files have the correct target membership\"\n exit 1\nfi\n\n\n# Gather information\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n UFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date.\n# We already checked the other platform in the prerun script.\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Make sure the other platform gets built\n\necho \"Build other platform\"\n\necho xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\n\n\n# Build the fat static library binary\n\necho \"Create universal static library\"\n\nif [[ \"$XCODE_VERSION_MAJOR\" = \"0500\" ]]\nthen\n echo \"$DT_TOOLCHAIN_DIR/usr/bin/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$DT_TOOLCHAIN_DIR/usr/bin/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\nelse\n echo \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\nfi \n\necho mv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nmv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\n\n\n# Build framework structure\n\necho \"Build symlinks\"\n\necho ln -sfh $FRAMEWORK_VERSION \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\nln -sfh $FRAMEWORK_VERSION \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\necho ln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\nln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\necho ln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\nln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\necho ln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\nln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\n\n\n# Link to binary for unit tests\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework\"\nln -sfh \"../${WRAPPER_NAME}/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework/.fake_fw_testing\"\n\n\n# Build embedded framework structure\n\necho \"Build Embedded Framework\"\n\necho rm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\necho mkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\nmkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\necho cp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\ncp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\n\ndeclare -a UFW_FILE_LIST\nlist_files \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\" UFW_FILE_LIST\nfor filename in \"${UFW_FILE_LIST[@]}\"\ndo\n if [[ \"${filename}\" != \"Info.plist\" ]] && [[ ! \"${filename}\" =~ .*\\.lproj$ ]]\n then\n echo ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n fi\ndone\n\n\n# Replace other platform's framework with a copy of this one (so that both have the same universal binary)\n\necho \"Copy from $UFW_SDK_PLATFORM to $UFW_OTHER_PLATFORM\"\n\necho rm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\nrm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\necho cp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\ncp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 95C86EB717F6BCBD00F6C878 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C8727217F6BD9D00F6C878 /* quant_LTP_gains.c in Sources */, + 95C872AC17F6BD9D00F6C878 /* tables_NLSF_CB_NB_MB.c in Sources */, + 95C8727C17F6BD9D00F6C878 /* resampler_private_AR2.c in Sources */, + 95C8725617F6BD9D00F6C878 /* NLSF_decode.c in Sources */, + 95C8724417F6BD9D00F6C878 /* log2lin.c in Sources */, + 95C872B417F6BD9D00F6C878 /* tables_pulses_per_block.c in Sources */, + 95C86F8D17F6BD7700F6C878 /* mathops.c in Sources */, + 95C871EE17F6BD9D00F6C878 /* apply_sine_window_FLP.c in Sources */, + 95C8729417F6BD9D00F6C878 /* stereo_decode_pred.c in Sources */, + 95C8715E17F6BD9D00F6C878 /* control_SNR.c in Sources */, + 95C8723217F6BD9D00F6C878 /* wrappers_FLP.c in Sources */, + 95C8725817F6BD9D00F6C878 /* NLSF_del_dec_quant.c in Sources */, + 95C871FC17F6BD9D00F6C878 /* find_LPC_FLP.c in Sources */, + 95C8729C17F6BD9D00F6C878 /* stereo_MS_to_LR.c in Sources */, + 95C8723A17F6BD9D00F6C878 /* init_encoder.c in Sources */, + 95C8729817F6BD9D00F6C878 /* stereo_find_predictor.c in Sources */, + 95C872A417F6BD9D00F6C878 /* table_LSF_cos.c in Sources */, + 95C8727E17F6BD9D00F6C878 /* resampler_private_down_FIR.c in Sources */, + 95C8726617F6BD9D00F6C878 /* NSQ_del_dec.c in Sources */, + 95C8720817F6BD9D00F6C878 /* levinsondurbin_FLP.c in Sources */, + 95C8723617F6BD9D00F6C878 /* HP_variable_cutoff.c in Sources */, + 95C86FA317F6BD7700F6C878 /* quant_bands.c in Sources */, + 95C8716617F6BD9D00F6C878 /* decode_core.c in Sources */, + 95C8714E17F6BD9D00F6C878 /* bwexpander.c in Sources */, + 95C8722417F6BD9D00F6C878 /* schur_FLP.c in Sources */, + 95C86EE717F6BCEA00F6C878 /* opus.c in Sources */, + 95C8721817F6BD9D00F6C878 /* prefilter_FLP.c in Sources */, + 95C8715A17F6BD9D00F6C878 /* control_audio_bandwidth.c in Sources */, + 95C871F617F6BD9D00F6C878 /* corrMatrix_FLP.c in Sources */, + 95C86FA717F6BD7700F6C878 /* rate.c in Sources */, + 95C872BC17F6BD9D00F6C878 /* VQ_WMat_EC.c in Sources */, + 95C8721A17F6BD9D00F6C878 /* process_gains_FLP.c in Sources */, + 95C8721617F6BD9D00F6C878 /* pitch_analysis_core_FLP.c in Sources */, + 95C8716417F6BD9D00F6C878 /* dec_API.c in Sources */, + 95C8727417F6BD9D00F6C878 /* resampler.c in Sources */, + 95C8728A17F6BD9D00F6C878 /* shell_coder.c in Sources */, + 95C8723817F6BD9D00F6C878 /* init_decoder.c in Sources */, + 95C8717A17F6BD9D00F6C878 /* encode_pulses.c in Sources */, + 95C8727617F6BD9D00F6C878 /* resampler_down2.c in Sources */, + 95C8725417F6BD9D00F6C878 /* NLSF2A.c in Sources */, + 95C8720217F6BD9D00F6C878 /* find_pred_coefs_FLP.c in Sources */, + 95C8715617F6BD9D00F6C878 /* code_signs.c in Sources */, + 95C8717217F6BD9D00F6C878 /* decoder_set_fs.c in Sources */, + 95C86F9117F6BD7700F6C878 /* mdct.c in Sources */, + 95C8727017F6BD9D00F6C878 /* process_NLSFs.c in Sources */, + 95C8714617F6BD9D00F6C878 /* A2NLSF.c in Sources */, + 95C8726417F6BD9D00F6C878 /* NSQ.c in Sources */, + 95C871FE17F6BD9D00F6C878 /* find_LTP_FLP.c in Sources */, + 95C8721417F6BD9D00F6C878 /* noise_shape_analysis_FLP.c in Sources */, + 95C8720617F6BD9D00F6C878 /* k2a_FLP.c in Sources */, + 95C8717817F6BD9D00F6C878 /* encode_indices.c in Sources */, + 95C8716017F6BD9D00F6C878 /* debug.c in Sources */, + 95C8717617F6BD9D00F6C878 /* enc_API.c in Sources */, + 95C8722C17F6BD9D00F6C878 /* sort_FLP.c in Sources */, + 95C8714C17F6BD9D00F6C878 /* biquad_alt.c in Sources */, + 95C872A217F6BD9D00F6C878 /* sum_sqr_shift.c in Sources */, + 95C8723017F6BD9D00F6C878 /* warped_autocorrelation_FLP.c in Sources */, + 95C8726A17F6BD9D00F6C878 /* pitch_est_tables.c in Sources */, + 95C86F7717F6BD7700F6C878 /* entdec.c in Sources */, + 95C86EE917F6BCEA00F6C878 /* opus_decoder.c in Sources */, + 95C872A817F6BD9D00F6C878 /* tables_gain.c in Sources */, + 95C8721E17F6BD9D00F6C878 /* residual_energy_FLP.c in Sources */, + 95C8724817F6BD9D00F6C878 /* LPC_analysis_filter.c in Sources */, + 95C86F8517F6BD7700F6C878 /* kiss_fft.c in Sources */, + 95C86F7317F6BD7700F6C878 /* entcode.c in Sources */, + 95C8723E17F6BD9D00F6C878 /* inner_prod_aligned.c in Sources */, + 95C8722A17F6BD9D00F6C878 /* solve_LS_FLP.c in Sources */, + 95C8726217F6BD9D00F6C878 /* NLSF_VQ_weights_laroia.c in Sources */, + 95C8716C17F6BD9D00F6C878 /* decode_parameters.c in Sources */, + 95C8728417F6BD9D00F6C878 /* resampler_rom.c in Sources */, + 95C8727817F6BD9D00F6C878 /* resampler_down2_3.c in Sources */, + 95C8725C17F6BD9D00F6C878 /* NLSF_stabilize.c in Sources */, + 95C86F9717F6BD7700F6C878 /* modes.c in Sources */, + 95C871F417F6BD9D00F6C878 /* bwexpander_FLP.c in Sources */, + 95C8716A17F6BD9D00F6C878 /* decode_indices.c in Sources */, + 95C8715C17F6BD9D00F6C878 /* control_codec.c in Sources */, + 95C8715417F6BD9D00F6C878 /* CNG.c in Sources */, + 95C871F017F6BD9D00F6C878 /* autocorrelation_FLP.c in Sources */, + 95C8720417F6BD9D00F6C878 /* inner_product_FLP.c in Sources */, + 95C8724217F6BD9D00F6C878 /* lin2log.c in Sources */, + 95C8724617F6BD9D00F6C878 /* LP_variable_cutoff.c in Sources */, + 95C8715017F6BD9D00F6C878 /* bwexpander_32.c in Sources */, + 95C8726C17F6BD9D00F6C878 /* PLC.c in Sources */, + 95C86F6917F6BD7700F6C878 /* celt_lpc.c in Sources */, + 95C8722217F6BD9D00F6C878 /* scale_vector_FLP.c in Sources */, + 95C8728C17F6BD9D00F6C878 /* sigm_Q15.c in Sources */, + 95C86F7B17F6BD7700F6C878 /* entenc.c in Sources */, + 95C8714817F6BD9D00F6C878 /* ana_filt_bank_1.c in Sources */, + 95C86FC917F6BD7700F6C878 /* vq.c in Sources */, + 95C8725E17F6BD9D00F6C878 /* NLSF_unpack.c in Sources */, + 95C8729E17F6BD9D00F6C878 /* stereo_quant_pred.c in Sources */, + 95C8729A17F6BD9D00F6C878 /* stereo_LR_to_MS.c in Sources */, + 95C872B217F6BD9D00F6C878 /* tables_pitch_lag.c in Sources */, + 95C8728217F6BD9D00F6C878 /* resampler_private_up2_HQ.c in Sources */, + 95C8728017F6BD9D00F6C878 /* resampler_private_IIR_FIR.c in Sources */, + 95C8729617F6BD9D00F6C878 /* stereo_encode_pred.c in Sources */, + 95C8723417F6BD9D00F6C878 /* gain_quant.c in Sources */, + 95C86EEB17F6BCEA00F6C878 /* opus_encoder.c in Sources */, + 95C8722017F6BD9D00F6C878 /* scale_copy_vector_FLP.c in Sources */, + 95C86F6317F6BD7700F6C878 /* celt.c in Sources */, + 95C86EEC17F6BCEA00F6C878 /* opus_multistream.c in Sources */, + 95C8724A17F6BD9D00F6C878 /* LPC_inv_pred_gain.c in Sources */, + 95C86F5F17F6BD7700F6C878 /* bands.c in Sources */, + 95C86F9F17F6BD7700F6C878 /* pitch.c in Sources */, + 95C8720A17F6BD9D00F6C878 /* LPC_analysis_filter_FLP.c in Sources */, + 95C8717017F6BD9D00F6C878 /* decode_pulses.c in Sources */, + 95C8716E17F6BD9D00F6C878 /* decode_pitch.c in Sources */, + 95C8726017F6BD9D00F6C878 /* NLSF_VQ.c in Sources */, + 95C872BA17F6BD9D00F6C878 /* VAD.c in Sources */, + 95C86EED17F6BCEA00F6C878 /* repacketizer.c in Sources */, + 95C86F8917F6BD7700F6C878 /* laplace.c in Sources */, + 95C86F6D17F6BD7700F6C878 /* cwrs.c in Sources */, + 95C8716817F6BD9D00F6C878 /* decode_frame.c in Sources */, + 95C871F217F6BD9D00F6C878 /* burg_modified_FLP.c in Sources */, + 95C872AA17F6BD9D00F6C878 /* tables_LTP.c in Sources */, + 95C8721017F6BD9D00F6C878 /* LTP_scale_ctrl_FLP.c in Sources */, + 95C871FA17F6BD9D00F6C878 /* energy_FLP.c in Sources */, + 95C8720017F6BD9D00F6C878 /* find_pitch_lags_FLP.c in Sources */, + 95C8720E17F6BD9D00F6C878 /* LTP_analysis_filter_FLP.c in Sources */, + 95C8715217F6BD9D00F6C878 /* check_control_input.c in Sources */, + 95C872AE17F6BD9D00F6C878 /* tables_NLSF_CB_WB.c in Sources */, + 95C8720C17F6BD9D00F6C878 /* LPC_inv_pred_gain_FLP.c in Sources */, + 95C872B017F6BD9D00F6C878 /* tables_other.c in Sources */, + 95C871F817F6BD9D00F6C878 /* encode_frame_FLP.c in Sources */, + 95C8725A17F6BD9D00F6C878 /* NLSF_encode.c in Sources */, + 95C8729217F6BD9D00F6C878 /* sort.c in Sources */, + 95C8721C17F6BD9D00F6C878 /* regularize_correlations_FLP.c in Sources */, + 95C8724017F6BD9D00F6C878 /* interpolate.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95C873F417F6D2B200F6C878 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C8742117F6D42700F6C878 /* bands.c in Sources */, + 95C8742317F6D42700F6C878 /* celt.c in Sources */, + 95C8742517F6D42700F6C878 /* celt_lpc.c in Sources */, + 95C8742717F6D42700F6C878 /* cwrs.c in Sources */, + 95C8742A17F6D42700F6C878 /* entcode.c in Sources */, + 95C8742C17F6D42700F6C878 /* entdec.c in Sources */, + 95C8742E17F6D42700F6C878 /* entenc.c in Sources */, + 95C8743317F6D42700F6C878 /* kiss_fft.c in Sources */, + 95C8743517F6D42700F6C878 /* laplace.c in Sources */, + 95C8743717F6D42700F6C878 /* mathops.c in Sources */, + 95C8743917F6D42700F6C878 /* mdct.c in Sources */, + 95C8743C17F6D42700F6C878 /* modes.c in Sources */, + 95C8743F17F6D42700F6C878 /* pitch.c in Sources */, + 95C8744117F6D42700F6C878 /* quant_bands.c in Sources */, + 95C8744317F6D42700F6C878 /* rate.c in Sources */, + 95C8744817F6D42700F6C878 /* vq.c in Sources */, + 95C8744F17F6D42700F6C878 /* A2NLSF.c in Sources */, + 95C8745017F6D42700F6C878 /* ana_filt_bank_1.c in Sources */, + 95C8745217F6D42700F6C878 /* biquad_alt.c in Sources */, + 95C8745317F6D42700F6C878 /* bwexpander.c in Sources */, + 95C8745417F6D42700F6C878 /* bwexpander_32.c in Sources */, + 95C8745517F6D42700F6C878 /* check_control_input.c in Sources */, + 95C8745617F6D42700F6C878 /* CNG.c in Sources */, + 95C8745717F6D42700F6C878 /* code_signs.c in Sources */, + 95C8745917F6D42700F6C878 /* control_audio_bandwidth.c in Sources */, + 95C8745A17F6D42700F6C878 /* control_codec.c in Sources */, + 95C8745B17F6D42700F6C878 /* control_SNR.c in Sources */, + 95C8745C17F6D42700F6C878 /* debug.c in Sources */, + 95C8745E17F6D42700F6C878 /* dec_API.c in Sources */, + 95C8745F17F6D42700F6C878 /* decode_core.c in Sources */, + 95C8746017F6D42700F6C878 /* decode_frame.c in Sources */, + 95C8746117F6D42700F6C878 /* decode_indices.c in Sources */, + 95C8746217F6D42700F6C878 /* decode_parameters.c in Sources */, + 95C8746317F6D42700F6C878 /* decode_pitch.c in Sources */, + 95C8746417F6D42700F6C878 /* decode_pulses.c in Sources */, + 95C8746517F6D42700F6C878 /* decoder_set_fs.c in Sources */, + 95C8746717F6D42700F6C878 /* enc_API.c in Sources */, + 95C8746817F6D42700F6C878 /* encode_indices.c in Sources */, + 95C8746917F6D42700F6C878 /* encode_pulses.c in Sources */, + 95C8746B17F6D42700F6C878 /* apply_sine_window_FLP.c in Sources */, + 95C8746C17F6D42700F6C878 /* autocorrelation_FLP.c in Sources */, + 95C8746D17F6D42700F6C878 /* burg_modified_FLP.c in Sources */, + 95C8746E17F6D42700F6C878 /* bwexpander_FLP.c in Sources */, + 95C8746F17F6D42700F6C878 /* corrMatrix_FLP.c in Sources */, + 95C8747017F6D42700F6C878 /* encode_frame_FLP.c in Sources */, + 95C8747117F6D42700F6C878 /* energy_FLP.c in Sources */, + 95C8747217F6D42700F6C878 /* find_LPC_FLP.c in Sources */, + 95C8747317F6D42700F6C878 /* find_LTP_FLP.c in Sources */, + 95C8747417F6D42700F6C878 /* find_pitch_lags_FLP.c in Sources */, + 95C8747517F6D42700F6C878 /* find_pred_coefs_FLP.c in Sources */, + 95C8747617F6D42700F6C878 /* inner_product_FLP.c in Sources */, + 95C8747717F6D42700F6C878 /* k2a_FLP.c in Sources */, + 95C8747817F6D42700F6C878 /* levinsondurbin_FLP.c in Sources */, + 95C8747917F6D42700F6C878 /* LPC_analysis_filter_FLP.c in Sources */, + 95C8747A17F6D42700F6C878 /* LPC_inv_pred_gain_FLP.c in Sources */, + 95C8747B17F6D42700F6C878 /* LTP_analysis_filter_FLP.c in Sources */, + 95C8747C17F6D42700F6C878 /* LTP_scale_ctrl_FLP.c in Sources */, + 95C8747E17F6D42700F6C878 /* noise_shape_analysis_FLP.c in Sources */, + 95C8747F17F6D42700F6C878 /* pitch_analysis_core_FLP.c in Sources */, + 95C8748017F6D42700F6C878 /* prefilter_FLP.c in Sources */, + 95C8748117F6D42700F6C878 /* process_gains_FLP.c in Sources */, + 95C8748217F6D42700F6C878 /* regularize_correlations_FLP.c in Sources */, + 95C8748317F6D42700F6C878 /* residual_energy_FLP.c in Sources */, + 95C8748417F6D42700F6C878 /* scale_copy_vector_FLP.c in Sources */, + 95C8748517F6D42700F6C878 /* scale_vector_FLP.c in Sources */, + 95C8748617F6D42700F6C878 /* schur_FLP.c in Sources */, + 95C8748817F6D42700F6C878 /* solve_LS_FLP.c in Sources */, + 95C8748917F6D42700F6C878 /* sort_FLP.c in Sources */, + 95C8748B17F6D42700F6C878 /* warped_autocorrelation_FLP.c in Sources */, + 95C8748C17F6D42700F6C878 /* wrappers_FLP.c in Sources */, + 95C8748D17F6D42700F6C878 /* gain_quant.c in Sources */, + 95C8748E17F6D42700F6C878 /* HP_variable_cutoff.c in Sources */, + 95C8748F17F6D42700F6C878 /* init_decoder.c in Sources */, + 95C8749017F6D42700F6C878 /* init_encoder.c in Sources */, + 95C8749217F6D42700F6C878 /* inner_prod_aligned.c in Sources */, + 95C8749317F6D42700F6C878 /* interpolate.c in Sources */, + 95C8749417F6D42700F6C878 /* lin2log.c in Sources */, + 95C8749517F6D42700F6C878 /* log2lin.c in Sources */, + 95C8749617F6D42700F6C878 /* LP_variable_cutoff.c in Sources */, + 95C8749717F6D42700F6C878 /* LPC_analysis_filter.c in Sources */, + 95C8749817F6D42700F6C878 /* LPC_inv_pred_gain.c in Sources */, + 95C8749D17F6D42700F6C878 /* NLSF2A.c in Sources */, + 95C8749E17F6D42700F6C878 /* NLSF_decode.c in Sources */, + 95C8749F17F6D42700F6C878 /* NLSF_del_dec_quant.c in Sources */, + 95C874A017F6D42700F6C878 /* NLSF_encode.c in Sources */, + 95C874A117F6D42700F6C878 /* NLSF_stabilize.c in Sources */, + 95C874A217F6D42700F6C878 /* NLSF_unpack.c in Sources */, + 95C874A317F6D42700F6C878 /* NLSF_VQ.c in Sources */, + 95C874A417F6D42700F6C878 /* NLSF_VQ_weights_laroia.c in Sources */, + 95C874A517F6D42700F6C878 /* NSQ.c in Sources */, + 95C874A617F6D42700F6C878 /* NSQ_del_dec.c in Sources */, + 95C874A817F6D42700F6C878 /* pitch_est_tables.c in Sources */, + 95C874A917F6D42700F6C878 /* PLC.c in Sources */, + 95C874AB17F6D42700F6C878 /* process_NLSFs.c in Sources */, + 95C874AC17F6D42700F6C878 /* quant_LTP_gains.c in Sources */, + 95C874AD17F6D42700F6C878 /* resampler.c in Sources */, + 95C874AE17F6D42700F6C878 /* resampler_down2.c in Sources */, + 95C874AF17F6D42700F6C878 /* resampler_down2_3.c in Sources */, + 95C874B117F6D42700F6C878 /* resampler_private_AR2.c in Sources */, + 95C874B217F6D42700F6C878 /* resampler_private_down_FIR.c in Sources */, + 95C874B317F6D42700F6C878 /* resampler_private_IIR_FIR.c in Sources */, + 95C874B417F6D42700F6C878 /* resampler_private_up2_HQ.c in Sources */, + 95C874B517F6D42700F6C878 /* resampler_rom.c in Sources */, + 95C874B817F6D42700F6C878 /* shell_coder.c in Sources */, + 95C874B917F6D42700F6C878 /* sigm_Q15.c in Sources */, + 95C874BB17F6D42700F6C878 /* sort.c in Sources */, + 95C874BC17F6D42700F6C878 /* stereo_decode_pred.c in Sources */, + 95C874BD17F6D42700F6C878 /* stereo_encode_pred.c in Sources */, + 95C874BE17F6D42700F6C878 /* stereo_find_predictor.c in Sources */, + 95C874BF17F6D42700F6C878 /* stereo_LR_to_MS.c in Sources */, + 95C874C017F6D42700F6C878 /* stereo_MS_to_LR.c in Sources */, + 95C874C117F6D42700F6C878 /* stereo_quant_pred.c in Sources */, + 95C874C317F6D42700F6C878 /* sum_sqr_shift.c in Sources */, + 95C874C417F6D42700F6C878 /* table_LSF_cos.c in Sources */, + 95C874C617F6D42700F6C878 /* tables_gain.c in Sources */, + 95C874C717F6D42700F6C878 /* tables_LTP.c in Sources */, + 95C874C817F6D42700F6C878 /* tables_NLSF_CB_NB_MB.c in Sources */, + 95C874C917F6D42700F6C878 /* tables_NLSF_CB_WB.c in Sources */, + 95C874CA17F6D42700F6C878 /* tables_other.c in Sources */, + 95C874CB17F6D42700F6C878 /* tables_pitch_lag.c in Sources */, + 95C874CC17F6D42700F6C878 /* tables_pulses_per_block.c in Sources */, + 95C874CF17F6D42700F6C878 /* VAD.c in Sources */, + 95C874D017F6D42700F6C878 /* VQ_WMat_EC.c in Sources */, + 95C874D117F6D42700F6C878 /* opus.c in Sources */, + 95C874D217F6D42700F6C878 /* opus_decoder.c in Sources */, + 95C874D317F6D42700F6C878 /* opus_encoder.c in Sources */, + 95C874D417F6D42700F6C878 /* opus_multistream.c in Sources */, + 95C874D617F6D42700F6C878 /* repacketizer.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95F27DEE17F6DEA0009E13C6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 95F27E1D17F6DF15009E13C6 /* bands.c in Sources */, + 95F27E1F17F6DF15009E13C6 /* celt.c in Sources */, + 95F27E2117F6DF15009E13C6 /* celt_lpc.c in Sources */, + 95F27E2317F6DF15009E13C6 /* cwrs.c in Sources */, + 95F27E2617F6DF15009E13C6 /* entcode.c in Sources */, + 95F27E2817F6DF15009E13C6 /* entdec.c in Sources */, + 95F27E2A17F6DF15009E13C6 /* entenc.c in Sources */, + 95F27E2F17F6DF15009E13C6 /* kiss_fft.c in Sources */, + 95F27E3117F6DF15009E13C6 /* laplace.c in Sources */, + 95F27E3317F6DF15009E13C6 /* mathops.c in Sources */, + 95F27E3517F6DF15009E13C6 /* mdct.c in Sources */, + 95F27E3817F6DF15009E13C6 /* modes.c in Sources */, + 95F27E3B17F6DF15009E13C6 /* pitch.c in Sources */, + 95F27E3D17F6DF15009E13C6 /* quant_bands.c in Sources */, + 95F27E3F17F6DF15009E13C6 /* rate.c in Sources */, + 95F27E4417F6DF15009E13C6 /* vq.c in Sources */, + 95F27E4B17F6DF15009E13C6 /* A2NLSF.c in Sources */, + 95F27E4C17F6DF15009E13C6 /* ana_filt_bank_1.c in Sources */, + 95F27E4E17F6DF15009E13C6 /* biquad_alt.c in Sources */, + 95F27E4F17F6DF15009E13C6 /* bwexpander.c in Sources */, + 95F27E5017F6DF15009E13C6 /* bwexpander_32.c in Sources */, + 95F27E5117F6DF15009E13C6 /* check_control_input.c in Sources */, + 95F27E5217F6DF15009E13C6 /* CNG.c in Sources */, + 95F27E5317F6DF15009E13C6 /* code_signs.c in Sources */, + 95F27E5517F6DF15009E13C6 /* control_audio_bandwidth.c in Sources */, + 95F27E5617F6DF15009E13C6 /* control_codec.c in Sources */, + 95F27E5717F6DF15009E13C6 /* control_SNR.c in Sources */, + 95F27E5817F6DF15009E13C6 /* debug.c in Sources */, + 95F27E5A17F6DF15009E13C6 /* dec_API.c in Sources */, + 95F27E5B17F6DF15009E13C6 /* decode_core.c in Sources */, + 95F27E5C17F6DF15009E13C6 /* decode_frame.c in Sources */, + 95F27E5D17F6DF15009E13C6 /* decode_indices.c in Sources */, + 95F27E5E17F6DF15009E13C6 /* decode_parameters.c in Sources */, + 95F27E5F17F6DF15009E13C6 /* decode_pitch.c in Sources */, + 95F27E6017F6DF15009E13C6 /* decode_pulses.c in Sources */, + 95F27E6117F6DF15009E13C6 /* decoder_set_fs.c in Sources */, + 95F27E6317F6DF15009E13C6 /* enc_API.c in Sources */, + 95F27E6417F6DF15009E13C6 /* encode_indices.c in Sources */, + 95F27E6517F6DF15009E13C6 /* encode_pulses.c in Sources */, + 95F27E6717F6DF15009E13C6 /* apply_sine_window_FLP.c in Sources */, + 95F27E6817F6DF15009E13C6 /* autocorrelation_FLP.c in Sources */, + 95F27E6917F6DF15009E13C6 /* burg_modified_FLP.c in Sources */, + 95F27E6A17F6DF15009E13C6 /* bwexpander_FLP.c in Sources */, + 95F27E6B17F6DF15009E13C6 /* corrMatrix_FLP.c in Sources */, + 95F27E6C17F6DF15009E13C6 /* encode_frame_FLP.c in Sources */, + 95F27E6D17F6DF15009E13C6 /* energy_FLP.c in Sources */, + 95F27E6E17F6DF15009E13C6 /* find_LPC_FLP.c in Sources */, + 95F27E6F17F6DF15009E13C6 /* find_LTP_FLP.c in Sources */, + 95F27E7017F6DF15009E13C6 /* find_pitch_lags_FLP.c in Sources */, + 95F27E7117F6DF15009E13C6 /* find_pred_coefs_FLP.c in Sources */, + 95F27E7217F6DF15009E13C6 /* inner_product_FLP.c in Sources */, + 95F27E7317F6DF15009E13C6 /* k2a_FLP.c in Sources */, + 95F27E7417F6DF15009E13C6 /* levinsondurbin_FLP.c in Sources */, + 95F27E7517F6DF15009E13C6 /* LPC_analysis_filter_FLP.c in Sources */, + 95F27E7617F6DF15009E13C6 /* LPC_inv_pred_gain_FLP.c in Sources */, + 95F27E7717F6DF15009E13C6 /* LTP_analysis_filter_FLP.c in Sources */, + 95F27E7817F6DF15009E13C6 /* LTP_scale_ctrl_FLP.c in Sources */, + 95F27E7A17F6DF15009E13C6 /* noise_shape_analysis_FLP.c in Sources */, + 95F27E7B17F6DF15009E13C6 /* pitch_analysis_core_FLP.c in Sources */, + 95F27E7C17F6DF15009E13C6 /* prefilter_FLP.c in Sources */, + 95F27E7D17F6DF15009E13C6 /* process_gains_FLP.c in Sources */, + 95F27E7E17F6DF15009E13C6 /* regularize_correlations_FLP.c in Sources */, + 95F27E7F17F6DF15009E13C6 /* residual_energy_FLP.c in Sources */, + 95F27E8017F6DF15009E13C6 /* scale_copy_vector_FLP.c in Sources */, + 95F27E8117F6DF15009E13C6 /* scale_vector_FLP.c in Sources */, + 95F27E8217F6DF15009E13C6 /* schur_FLP.c in Sources */, + 95F27E8417F6DF15009E13C6 /* solve_LS_FLP.c in Sources */, + 95F27E8517F6DF15009E13C6 /* sort_FLP.c in Sources */, + 95F27E8717F6DF15009E13C6 /* warped_autocorrelation_FLP.c in Sources */, + 95F27E8817F6DF15009E13C6 /* wrappers_FLP.c in Sources */, + 95F27E8917F6DF15009E13C6 /* gain_quant.c in Sources */, + 95F27E8A17F6DF15009E13C6 /* HP_variable_cutoff.c in Sources */, + 95F27E8B17F6DF15009E13C6 /* init_decoder.c in Sources */, + 95F27E8C17F6DF15009E13C6 /* init_encoder.c in Sources */, + 95F27E8E17F6DF15009E13C6 /* inner_prod_aligned.c in Sources */, + 95F27E8F17F6DF15009E13C6 /* interpolate.c in Sources */, + 95F27E9017F6DF15009E13C6 /* lin2log.c in Sources */, + 95F27E9117F6DF15009E13C6 /* log2lin.c in Sources */, + 95F27E9217F6DF15009E13C6 /* LP_variable_cutoff.c in Sources */, + 95F27E9317F6DF15009E13C6 /* LPC_analysis_filter.c in Sources */, + 95F27E9417F6DF15009E13C6 /* LPC_inv_pred_gain.c in Sources */, + 95F27E9917F6DF15009E13C6 /* NLSF2A.c in Sources */, + 95F27E9A17F6DF15009E13C6 /* NLSF_decode.c in Sources */, + 95F27E9B17F6DF15009E13C6 /* NLSF_del_dec_quant.c in Sources */, + 95F27E9C17F6DF16009E13C6 /* NLSF_encode.c in Sources */, + 95F27E9D17F6DF16009E13C6 /* NLSF_stabilize.c in Sources */, + 95F27E9E17F6DF16009E13C6 /* NLSF_unpack.c in Sources */, + 95F27E9F17F6DF16009E13C6 /* NLSF_VQ.c in Sources */, + 95F27EA017F6DF16009E13C6 /* NLSF_VQ_weights_laroia.c in Sources */, + 95F27EA117F6DF16009E13C6 /* NSQ.c in Sources */, + 95F27EA217F6DF16009E13C6 /* NSQ_del_dec.c in Sources */, + 95F27EA417F6DF16009E13C6 /* pitch_est_tables.c in Sources */, + 95F27EA517F6DF16009E13C6 /* PLC.c in Sources */, + 95F27EA717F6DF16009E13C6 /* process_NLSFs.c in Sources */, + 95F27EA817F6DF16009E13C6 /* quant_LTP_gains.c in Sources */, + 95F27EA917F6DF16009E13C6 /* resampler.c in Sources */, + 95F27EAA17F6DF16009E13C6 /* resampler_down2.c in Sources */, + 95F27EAB17F6DF16009E13C6 /* resampler_down2_3.c in Sources */, + 95F27EAD17F6DF16009E13C6 /* resampler_private_AR2.c in Sources */, + 95F27EAE17F6DF16009E13C6 /* resampler_private_down_FIR.c in Sources */, + 95F27EAF17F6DF16009E13C6 /* resampler_private_IIR_FIR.c in Sources */, + 95F27EB017F6DF16009E13C6 /* resampler_private_up2_HQ.c in Sources */, + 95F27EB117F6DF16009E13C6 /* resampler_rom.c in Sources */, + 95F27EB417F6DF16009E13C6 /* shell_coder.c in Sources */, + 95F27EB517F6DF16009E13C6 /* sigm_Q15.c in Sources */, + 95F27EB717F6DF16009E13C6 /* sort.c in Sources */, + 95F27EB817F6DF16009E13C6 /* stereo_decode_pred.c in Sources */, + 95F27EB917F6DF16009E13C6 /* stereo_encode_pred.c in Sources */, + 95F27EBA17F6DF16009E13C6 /* stereo_find_predictor.c in Sources */, + 95F27EBB17F6DF16009E13C6 /* stereo_LR_to_MS.c in Sources */, + 95F27EBC17F6DF16009E13C6 /* stereo_MS_to_LR.c in Sources */, + 95F27EBD17F6DF16009E13C6 /* stereo_quant_pred.c in Sources */, + 95F27EBF17F6DF16009E13C6 /* sum_sqr_shift.c in Sources */, + 95F27EC017F6DF16009E13C6 /* table_LSF_cos.c in Sources */, + 95F27EC217F6DF16009E13C6 /* tables_gain.c in Sources */, + 95F27EC317F6DF16009E13C6 /* tables_LTP.c in Sources */, + 95F27EC417F6DF16009E13C6 /* tables_NLSF_CB_NB_MB.c in Sources */, + 95F27EC517F6DF16009E13C6 /* tables_NLSF_CB_WB.c in Sources */, + 95F27EC617F6DF16009E13C6 /* tables_other.c in Sources */, + 95F27EC717F6DF16009E13C6 /* tables_pitch_lag.c in Sources */, + 95F27EC817F6DF16009E13C6 /* tables_pulses_per_block.c in Sources */, + 95F27ECB17F6DF16009E13C6 /* VAD.c in Sources */, + 95F27ECC17F6DF16009E13C6 /* VQ_WMat_EC.c in Sources */, + 95F27ECD17F6DF16009E13C6 /* opus.c in Sources */, + 95F27ECE17F6DF16009E13C6 /* opus_decoder.c in Sources */, + 95F27ECF17F6DF16009E13C6 /* opus_encoder.c in Sources */, + 95F27ED017F6DF16009E13C6 /* opus_multistream.c in Sources */, + 95F27ED217F6DF16009E13C6 /* repacketizer.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 95C86C4117F6B2A100F6C878 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 95C86C4217F6B2A100F6C878 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 95C86EE217F6BCBD00F6C878 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + FRAMEWORK_VERSION = A; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../libopus-src/celt", + "../libopus-src/silk", + ); + INFOPLIST_FILE = "Opus/Opus-Info.plist"; + INSTALL_PATH = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.8; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = framework; + }; + name = Debug; + }; + 95C86EE317F6BCBD00F6C878 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + FRAMEWORK_VERSION = A; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../libopus-src/celt", + "../libopus-src/silk", + ); + INFOPLIST_FILE = "Opus/Opus-Info.plist"; + INSTALL_PATH = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.8; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = framework; + }; + name = Release; + }; + 95C8741917F6D2B200F6C878 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + DSTROOT = /tmp/opus.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../libopus-src/celt", + "../libopus-src/silk", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 95C8741A17F6D2B200F6C878 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + DSTROOT = /tmp/opus.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../libopus-src/celt", + "../libopus-src/silk", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 95F27E1417F6DEA1009E13C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; + DEAD_CODE_STRIPPING = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../libopus-src/celt", + "../libopus-src/silk", + ); + INFOPLIST_FILE = "Opus_ios/Opus_ios-Info.plist"; + INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + PRODUCT_NAME = Opus; + SKIP_INSTALL = YES; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + WRAPPER_EXTENSION = framework; + }; + name = Debug; + }; + 95F27E1517F6DEA1009E13C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; + DEAD_CODE_STRIPPING = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../libopus-src/celt", + "../libopus-src/silk", + ); + INFOPLIST_FILE = "Opus_ios/Opus_ios-Info.plist"; + INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + PRODUCT_NAME = Opus; + SKIP_INSTALL = YES; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + WRAPPER_EXTENSION = framework; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 95C86C1B17F6B2A100F6C878 /* Build configuration list for PBXProject "Opus" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95C86C4117F6B2A100F6C878 /* Debug */, + 95C86C4217F6B2A100F6C878 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 95C86EE117F6BCBD00F6C878 /* Build configuration list for PBXNativeTarget "Opus" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95C86EE217F6BCBD00F6C878 /* Debug */, + 95C86EE317F6BCBD00F6C878 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 95C8741817F6D2B200F6C878 /* Build configuration list for PBXNativeTarget "opus" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95C8741917F6D2B200F6C878 /* Debug */, + 95C8741A17F6D2B200F6C878 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 95F27E1817F6DEA1009E13C6 /* Build configuration list for PBXNativeTarget "Opus_ios" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95F27E1417F6DEA1009E13C6 /* Debug */, + 95F27E1517F6DEA1009E13C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 95C86C1817F6B2A100F6C878 /* Project object */; +} diff --git a/Audio-Frameworks/Opus/Opus/Opus-Info.plist b/Audio-Frameworks/Opus/Opus/Opus-Info.plist new file mode 100644 index 0000000..5c3970b --- /dev/null +++ b/Audio-Frameworks/Opus/Opus/Opus-Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.ap4y.Opus.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSHumanReadableCopyright + Copyright © 2013 Arthur Evstifeev. All rights reserved. + NSPrincipalClass + + + diff --git a/Audio-Frameworks/Opus/Opus/config.h b/Audio-Frameworks/Opus/Opus/config.h new file mode 100644 index 0000000..99516b5 --- /dev/null +++ b/Audio-Frameworks/Opus/Opus/config.h @@ -0,0 +1,137 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Custom modes */ +/* #undef CUSTOM_MODES */ + +/* Assertions */ +/* #undef ENABLE_ASSERTIONS */ + +/* Debug fixed-point implementation */ +/* #undef FIXED_DEBUG */ + +/* Compile as fixed-point (for machines without a fast enough FPU) */ +/* #undef FIXED_POINT */ + +/* Float approximations */ +/* #undef FLOAT_APPROX */ + +/* Fuzzing */ +/* #undef FUZZING */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ALLOCA_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_GETOPT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `lrint' function. */ +#define HAVE_LRINT 1 + +/* Define to 1 if you have the `lrintf' function. */ +#define HAVE_LRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `__malloc_hook' function. */ +/* #undef HAVE___MALLOC_HOOK */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* This is a build of OPUS */ +#define OPUS_BUILD /**/ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "opus@xiph.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "opus" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "opus 1.0.3" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "opus" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.0.3" + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Make use of alloca */ +/* #undef USE_ALLOCA */ + +/* Use C99 variable-size arrays */ +#define VAR_ARRAYS /**/ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#define restrict __restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif diff --git a/Audio-Frameworks/Opus/Opus_ios/Opus_ios-Info.plist b/Audio-Frameworks/Opus/Opus_ios/Opus_ios-Info.plist new file mode 100644 index 0000000..9dec469 --- /dev/null +++ b/Audio-Frameworks/Opus/Opus_ios/Opus_ios-Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.ap4y.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSPrincipalClass + + + diff --git a/Audio-Frameworks/OpusFile/OpusFile.xcodeproj/project.pbxproj b/Audio-Frameworks/OpusFile/OpusFile.xcodeproj/project.pbxproj new file mode 100644 index 0000000..89244c2 --- /dev/null +++ b/Audio-Frameworks/OpusFile/OpusFile.xcodeproj/project.pbxproj @@ -0,0 +1,828 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 9581366517F6D764003DC5FB /* libogg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 95C8759F17F6D6EA00F6C878 /* libogg.a */; }; + 9581366617F6D764003DC5FB /* libopus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 95C875A217F6D6EA00F6C878 /* libopus.a */; }; + 95C8737317F6C89900F6C878 /* opusfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8737217F6C89900F6C878 /* opusfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95C8737C17F6C8A400F6C878 /* http.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737517F6C8A400F6C878 /* http.c */; }; + 95C8737D17F6C8A400F6C878 /* info.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737617F6C8A400F6C878 /* info.c */; }; + 95C8737E17F6C8A400F6C878 /* internal.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737717F6C8A400F6C878 /* internal.c */; }; + 95C8737F17F6C8A400F6C878 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8737817F6C8A400F6C878 /* internal.h */; }; + 95C8738017F6C8A400F6C878 /* opusfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737917F6C8A400F6C878 /* opusfile.c */; }; + 95C8738117F6C8A400F6C878 /* stream.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737A17F6C8A400F6C878 /* stream.c */; }; + 95C8738217F6C8A400F6C878 /* wincerts.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737B17F6C8A400F6C878 /* wincerts.c */; }; + 95C873BF17F6CD1800F6C878 /* Ogg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95C873B117F6CD0400F6C878 /* Ogg.framework */; }; + 95C873C017F6CD1800F6C878 /* Opus.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95C873BA17F6CD0900F6C878 /* Opus.framework */; }; + 95C875CD17F6D71E00F6C878 /* http.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737517F6C8A400F6C878 /* http.c */; }; + 95C875CE17F6D71E00F6C878 /* info.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737617F6C8A400F6C878 /* info.c */; }; + 95C875CF17F6D71E00F6C878 /* internal.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737717F6C8A400F6C878 /* internal.c */; }; + 95C875D017F6D71E00F6C878 /* opusfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737917F6C8A400F6C878 /* opusfile.c */; }; + 95C875D117F6D71E00F6C878 /* stream.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737A17F6C8A400F6C878 /* stream.c */; }; + 95C875D217F6D71E00F6C878 /* wincerts.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737B17F6C8A400F6C878 /* wincerts.c */; }; + 95C875D417F6D73000F6C878 /* opusfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8737217F6C89900F6C878 /* opusfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95C875D517F6D73000F6C878 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8737817F6C8A400F6C878 /* internal.h */; }; + 95F27FD017F6E06E009E13C6 /* http.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737517F6C8A400F6C878 /* http.c */; }; + 95F27FD117F6E06E009E13C6 /* info.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737617F6C8A400F6C878 /* info.c */; }; + 95F27FD217F6E06E009E13C6 /* internal.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737717F6C8A400F6C878 /* internal.c */; }; + 95F27FD317F6E06E009E13C6 /* opusfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737917F6C8A400F6C878 /* opusfile.c */; }; + 95F27FD417F6E06E009E13C6 /* stream.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737A17F6C8A400F6C878 /* stream.c */; }; + 95F27FD517F6E06E009E13C6 /* wincerts.c in Sources */ = {isa = PBXBuildFile; fileRef = 95C8737B17F6C8A400F6C878 /* wincerts.c */; }; + 95F27FD617F6E074009E13C6 /* opusfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8737217F6C89900F6C878 /* opusfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95F27FD717F6E074009E13C6 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C8737817F6C8A400F6C878 /* internal.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 9581366117F6D75E003DC5FB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 95C873B217F6CD0900F6C878 /* Opus.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 95C873F717F6D2B200F6C878; + remoteInfo = opus; + }; + 9581366317F6D75E003DC5FB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 95C873AC17F6CD0400F6C878 /* Ogg.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 95C873C817F6D18300F6C878; + remoteInfo = ogg; + }; + 95C873B017F6CD0400F6C878 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 95C873AC17F6CD0400F6C878 /* Ogg.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 95C8730117F6C7CA00F6C878; + remoteInfo = Ogg; + }; + 95C873B917F6CD0900F6C878 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 95C873B217F6CD0900F6C878 /* Opus.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 95C86EBC17F6BCBD00F6C878; + remoteInfo = Opus; + }; + 95C873BB17F6CD1300F6C878 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 95C873B217F6CD0900F6C878 /* Opus.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 95C86EBB17F6BCBD00F6C878; + remoteInfo = Opus; + }; + 95C873BD17F6CD1300F6C878 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 95C873AC17F6CD0400F6C878 /* Ogg.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 95C8730017F6C7CA00F6C878; + remoteInfo = Ogg; + }; + 95C8759E17F6D6EA00F6C878 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 95C873AC17F6CD0400F6C878 /* Ogg.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 95C873C917F6D18300F6C878; + remoteInfo = ogg; + }; + 95C875A117F6D6EA00F6C878 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 95C873B217F6CD0900F6C878 /* Opus.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 95C873F817F6D2B200F6C878; + remoteInfo = opus; + }; + 95F27FC517F6E025009E13C6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 95C873AC17F6CD0400F6C878 /* Ogg.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 95F27DC417F6DD93009E13C6; + remoteInfo = Ogg_ios; + }; + 95F27FC817F6E025009E13C6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 95C873B217F6CD0900F6C878 /* Opus.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 95F27DF517F6DEA0009E13C6; + remoteInfo = Opus_ios; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 95C875A517F6D6FC00F6C878 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 95C8734317F6C87600F6C878 /* OpusFile.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OpusFile.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 95C8734E17F6C87600F6C878 /* OpusFile-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OpusFile-Info.plist"; sourceTree = ""; }; + 95C8737217F6C89900F6C878 /* opusfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opusfile.h; sourceTree = ""; }; + 95C8737517F6C8A400F6C878 /* http.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = http.c; sourceTree = ""; }; + 95C8737617F6C8A400F6C878 /* info.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = info.c; sourceTree = ""; }; + 95C8737717F6C8A400F6C878 /* internal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = internal.c; sourceTree = ""; }; + 95C8737817F6C8A400F6C878 /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = ""; }; + 95C8737917F6C8A400F6C878 /* opusfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = opusfile.c; sourceTree = ""; }; + 95C8737A17F6C8A400F6C878 /* stream.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stream.c; sourceTree = ""; }; + 95C8737B17F6C8A400F6C878 /* wincerts.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = wincerts.c; sourceTree = ""; }; + 95C873AC17F6CD0400F6C878 /* Ogg.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Ogg.xcodeproj; path = ../Ogg/Ogg.xcodeproj; sourceTree = ""; }; + 95C873B217F6CD0900F6C878 /* Opus.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Opus.xcodeproj; path = ../Opus/Opus.xcodeproj; sourceTree = ""; }; + 95C875A717F6D6FC00F6C878 /* libopusfile.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libopusfile.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 95F27FA117F6E024009E13C6 /* OpusFile.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OpusFile.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 95F27FA417F6E024009E13C6 /* OpusFile_ios-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "OpusFile_ios-Info.plist"; path = "OpusFile_ios/OpusFile_ios-Info.plist"; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 95C8733F17F6C87600F6C878 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C873BF17F6CD1800F6C878 /* Ogg.framework in Frameworks */, + 95C873C017F6CD1800F6C878 /* Opus.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95C875A417F6D6FC00F6C878 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9581366517F6D764003DC5FB /* libogg.a in Frameworks */, + 9581366617F6D764003DC5FB /* libopus.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95F27F9B17F6E024009E13C6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 95C8733917F6C87600F6C878 = { + isa = PBXGroup; + children = ( + 95C873B217F6CD0900F6C878 /* Opus.xcodeproj */, + 95C873AC17F6CD0400F6C878 /* Ogg.xcodeproj */, + 95C8734C17F6C87600F6C878 /* OpusFile */, + 95C8734417F6C87600F6C878 /* Products */, + ); + sourceTree = ""; + }; + 95C8734417F6C87600F6C878 /* Products */ = { + isa = PBXGroup; + children = ( + 95C8734317F6C87600F6C878 /* OpusFile.framework */, + 95C875A717F6D6FC00F6C878 /* libopusfile.a */, + 95F27FA117F6E024009E13C6 /* OpusFile.framework */, + ); + name = Products; + sourceTree = ""; + }; + 95C8734C17F6C87600F6C878 /* OpusFile */ = { + isa = PBXGroup; + children = ( + 95C8737117F6C89900F6C878 /* include */, + 95C8737417F6C8A400F6C878 /* src */, + 95C8734D17F6C87600F6C878 /* Supporting Files */, + ); + path = OpusFile; + sourceTree = ""; + }; + 95C8734D17F6C87600F6C878 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 95C8734E17F6C87600F6C878 /* OpusFile-Info.plist */, + 95F27FA417F6E024009E13C6 /* OpusFile_ios-Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 95C8737117F6C89900F6C878 /* include */ = { + isa = PBXGroup; + children = ( + 95C8737217F6C89900F6C878 /* opusfile.h */, + ); + name = include; + path = "../../libopusfile-src/include"; + sourceTree = ""; + }; + 95C8737417F6C8A400F6C878 /* src */ = { + isa = PBXGroup; + children = ( + 95C8737517F6C8A400F6C878 /* http.c */, + 95C8737617F6C8A400F6C878 /* info.c */, + 95C8737717F6C8A400F6C878 /* internal.c */, + 95C8737817F6C8A400F6C878 /* internal.h */, + 95C8737917F6C8A400F6C878 /* opusfile.c */, + 95C8737A17F6C8A400F6C878 /* stream.c */, + 95C8737B17F6C8A400F6C878 /* wincerts.c */, + ); + name = src; + path = "../../libopusfile-src/src"; + sourceTree = ""; + }; + 95C873AD17F6CD0400F6C878 /* Products */ = { + isa = PBXGroup; + children = ( + 95C873B117F6CD0400F6C878 /* Ogg.framework */, + 95C8759F17F6D6EA00F6C878 /* libogg.a */, + 95F27FC617F6E025009E13C6 /* Ogg.framework */, + ); + name = Products; + sourceTree = ""; + }; + 95C873B317F6CD0900F6C878 /* Products */ = { + isa = PBXGroup; + children = ( + 95C873BA17F6CD0900F6C878 /* Opus.framework */, + 95C875A217F6D6EA00F6C878 /* libopus.a */, + 95F27FC917F6E025009E13C6 /* Opus.framework */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 95C8734017F6C87600F6C878 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C8737317F6C89900F6C878 /* opusfile.h in Headers */, + 95C8737F17F6C8A400F6C878 /* internal.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95C875D317F6D72400F6C878 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C875D417F6D73000F6C878 /* opusfile.h in Headers */, + 95C875D517F6D73000F6C878 /* internal.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95F27F9C17F6E024009E13C6 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 95F27FD617F6E074009E13C6 /* opusfile.h in Headers */, + 95F27FD717F6E074009E13C6 /* internal.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 95C8734217F6C87600F6C878 /* OpusFile */ = { + isa = PBXNativeTarget; + buildConfigurationList = 95C8736B17F6C87600F6C878 /* Build configuration list for PBXNativeTarget "OpusFile" */; + buildPhases = ( + 95C8733E17F6C87600F6C878 /* Sources */, + 95C8733F17F6C87600F6C878 /* Frameworks */, + 95C8734017F6C87600F6C878 /* Headers */, + 95C8734117F6C87600F6C878 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 95C873BC17F6CD1300F6C878 /* PBXTargetDependency */, + 95C873BE17F6CD1300F6C878 /* PBXTargetDependency */, + ); + name = OpusFile; + productName = OpusFile; + productReference = 95C8734317F6C87600F6C878 /* OpusFile.framework */; + productType = "com.apple.product-type.framework"; + }; + 95C875A617F6D6FC00F6C878 /* opusfile */ = { + isa = PBXNativeTarget; + buildConfigurationList = 95C875C717F6D6FC00F6C878 /* Build configuration list for PBXNativeTarget "opusfile" */; + buildPhases = ( + 95C875A317F6D6FC00F6C878 /* Sources */, + 95C875A417F6D6FC00F6C878 /* Frameworks */, + 95C875A517F6D6FC00F6C878 /* CopyFiles */, + 95C875D317F6D72400F6C878 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 9581366217F6D75E003DC5FB /* PBXTargetDependency */, + 9581366417F6D75E003DC5FB /* PBXTargetDependency */, + ); + name = opusfile; + productName = opusfile; + productReference = 95C875A717F6D6FC00F6C878 /* libopusfile.a */; + productType = "com.apple.product-type.library.static"; + }; + 95F27FA017F6E024009E13C6 /* OpusFile_ios */ = { + isa = PBXNativeTarget; + buildConfigurationList = 95F27FCA17F6E025009E13C6 /* Build configuration list for PBXNativeTarget "OpusFile_ios" */; + buildPhases = ( + 95F27F9917F6E024009E13C6 /* ShellScript */, + 95F27F9A17F6E024009E13C6 /* Sources */, + 95F27F9B17F6E024009E13C6 /* Frameworks */, + 95F27F9C17F6E024009E13C6 /* Headers */, + 95F27F9D17F6E024009E13C6 /* Resources */, + 95F27F9E17F6E024009E13C6 /* ShellScript */, + 95F27F9F17F6E024009E13C6 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = OpusFile_ios; + productName = OpusFile_ios; + productReference = 95F27FA117F6E024009E13C6 /* OpusFile.framework */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 95C8733A17F6C87600F6C878 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = "Arthur Evstifeev"; + }; + buildConfigurationList = 95C8733D17F6C87600F6C878 /* Build configuration list for PBXProject "OpusFile" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 95C8733917F6C87600F6C878; + productRefGroup = 95C8734417F6C87600F6C878 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 95C873AD17F6CD0400F6C878 /* Products */; + ProjectRef = 95C873AC17F6CD0400F6C878 /* Ogg.xcodeproj */; + }, + { + ProductGroup = 95C873B317F6CD0900F6C878 /* Products */; + ProjectRef = 95C873B217F6CD0900F6C878 /* Opus.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 95C8734217F6C87600F6C878 /* OpusFile */, + 95C875A617F6D6FC00F6C878 /* opusfile */, + 95F27FA017F6E024009E13C6 /* OpusFile_ios */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 95C873B117F6CD0400F6C878 /* Ogg.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Ogg.framework; + remoteRef = 95C873B017F6CD0400F6C878 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 95C873BA17F6CD0900F6C878 /* Opus.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Opus.framework; + remoteRef = 95C873B917F6CD0900F6C878 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 95C8759F17F6D6EA00F6C878 /* libogg.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libogg.a; + remoteRef = 95C8759E17F6D6EA00F6C878 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 95C875A217F6D6EA00F6C878 /* libopus.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libopus.a; + remoteRef = 95C875A117F6D6EA00F6C878 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 95F27FC617F6E025009E13C6 /* Ogg.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = Ogg.framework; + remoteRef = 95F27FC517F6E025009E13C6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 95F27FC917F6E025009E13C6 /* Opus.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = Opus.framework; + remoteRef = 95F27FC817F6E025009E13C6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 95C8734117F6C87600F6C878 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95F27F9D17F6E024009E13C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 95F27F9917F6E024009E13C6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n\tUFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Clean other platform if needed\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n\techo \"Platform \\\"$UFW_SDK_PLATFORM\\\" was cleaned recently. Cleaning \\\"$UFW_OTHER_PLATFORM\\\" as well\"\n\techo xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\n\txcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\nfi\n\n\n# Make sure we are building from fresh binaries\n\nrm -rf \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\n"; + }; + 95F27F9E17F6E024009E13C6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "HEADERS_ROOT=$SRCROOT/$PRODUCT_NAME\nFRAMEWORK_HEADERS_DIR=\"$BUILT_PRODUCTS_DIR/$WRAPPER_NAME/Versions/$FRAMEWORK_VERSION/Headers\"\n\n## only header files expected at this point\nPUBLIC_HEADERS=$(find $FRAMEWORK_HEADERS_DIR/. -not -type d 2> /dev/null | sed -e \"s@.*/@@g\")\n\nFIND_OPTS=\"\"\nfor PUBLIC_HEADER in $PUBLIC_HEADERS; do\n if [ -n \"$FIND_OPTS\" ]; then\n FIND_OPTS=\"$FIND_OPTS -o\"\n fi\n FIND_OPTS=\"$FIND_OPTS -name '$PUBLIC_HEADER'\"\ndone\n\nif [ -n \"$FIND_OPTS\" ]; then\n for ORIG_HEADER in $(eval \"find $HEADERS_ROOT/. $FIND_OPTS\" 2> /dev/null | sed -e \"s@^$HEADERS_ROOT/./@@g\"); do\n PUBLIC_HEADER=$(basename $ORIG_HEADER)\n RELATIVE_PATH=$(dirname $ORIG_HEADER)\n if [ -e $FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER ]; then\n mkdir -p \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH\"\n mv \"$FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER\" \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH/$PUBLIC_HEADER\"\n fi\n done\nfi\n"; + }; + 95F27F9F17F6E024009E13C6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\nexport UFW_MASTER_SCRIPT_RUNNING=1\n\n\n# Functions\n\n## List files in the specified directory, storing to the specified array.\n#\n# @param $1 The path to list\n# @param $2 The name of the array to fill\n#\n##\nlist_files ()\n{\n filelist=$(ls \"$1\")\n while read line\n do\n eval \"$2[\\${#$2[*]}]=\\\"\\$line\\\"\"\n done <<< \"$filelist\"\n}\n\n\n# Sanity check\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n echo \"Framework target \\\"${TARGET_NAME}\\\" had no source files to build from. Make sure your source files have the correct target membership\"\n exit 1\nfi\n\n\n# Gather information\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n UFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date.\n# We already checked the other platform in the prerun script.\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Make sure the other platform gets built\n\necho \"Build other platform\"\n\necho xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\n\n\n# Build the fat static library binary\n\necho \"Create universal static library\"\n\nif [[ \"$XCODE_VERSION_MAJOR\" = \"0500\" ]]\nthen\n echo \"$DT_TOOLCHAIN_DIR/usr/bin/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$DT_TOOLCHAIN_DIR/usr/bin/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\nelse\n echo \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\nfi \n\necho mv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nmv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\n\n\n# Build framework structure\n\necho \"Build symlinks\"\n\necho ln -sfh $FRAMEWORK_VERSION \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\nln -sfh $FRAMEWORK_VERSION \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\necho ln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\nln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\necho ln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\nln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\necho ln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\nln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\n\n\n# Link to binary for unit tests\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework\"\nln -sfh \"../${WRAPPER_NAME}/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework/.fake_fw_testing\"\n\n\n# Build embedded framework structure\n\necho \"Build Embedded Framework\"\n\necho rm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\necho mkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\nmkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\necho cp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\ncp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\n\ndeclare -a UFW_FILE_LIST\nlist_files \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\" UFW_FILE_LIST\nfor filename in \"${UFW_FILE_LIST[@]}\"\ndo\n if [[ \"${filename}\" != \"Info.plist\" ]] && [[ ! \"${filename}\" =~ .*\\.lproj$ ]]\n then\n echo ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n fi\ndone\n\n\n# Replace other platform's framework with a copy of this one (so that both have the same universal binary)\n\necho \"Copy from $UFW_SDK_PLATFORM to $UFW_OTHER_PLATFORM\"\n\necho rm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\nrm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\necho cp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\ncp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 95C8733E17F6C87600F6C878 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C8737C17F6C8A400F6C878 /* http.c in Sources */, + 95C8737D17F6C8A400F6C878 /* info.c in Sources */, + 95C8738217F6C8A400F6C878 /* wincerts.c in Sources */, + 95C8738017F6C8A400F6C878 /* opusfile.c in Sources */, + 95C8737E17F6C8A400F6C878 /* internal.c in Sources */, + 95C8738117F6C8A400F6C878 /* stream.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95C875A317F6D6FC00F6C878 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 95C875CD17F6D71E00F6C878 /* http.c in Sources */, + 95C875CE17F6D71E00F6C878 /* info.c in Sources */, + 95C875CF17F6D71E00F6C878 /* internal.c in Sources */, + 95C875D017F6D71E00F6C878 /* opusfile.c in Sources */, + 95C875D117F6D71E00F6C878 /* stream.c in Sources */, + 95C875D217F6D71E00F6C878 /* wincerts.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 95F27F9A17F6E024009E13C6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 95F27FD017F6E06E009E13C6 /* http.c in Sources */, + 95F27FD117F6E06E009E13C6 /* info.c in Sources */, + 95F27FD217F6E06E009E13C6 /* internal.c in Sources */, + 95F27FD317F6E06E009E13C6 /* opusfile.c in Sources */, + 95F27FD417F6E06E009E13C6 /* stream.c in Sources */, + 95F27FD517F6E06E009E13C6 /* wincerts.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 9581366217F6D75E003DC5FB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = opus; + targetProxy = 9581366117F6D75E003DC5FB /* PBXContainerItemProxy */; + }; + 9581366417F6D75E003DC5FB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = ogg; + targetProxy = 9581366317F6D75E003DC5FB /* PBXContainerItemProxy */; + }; + 95C873BC17F6CD1300F6C878 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Opus; + targetProxy = 95C873BB17F6CD1300F6C878 /* PBXContainerItemProxy */; + }; + 95C873BE17F6CD1300F6C878 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Ogg; + targetProxy = 95C873BD17F6CD1300F6C878 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 95C8736917F6C87600F6C878 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 95C8736A17F6C87600F6C878 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + SDKROOT = macosx; + }; + name = Release; + }; + 95C8736C17F6C87600F6C878 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../libopus-src/include", + ); + INFOPLIST_FILE = "OpusFile/OpusFile-Info.plist"; + INSTALL_PATH = "@executable_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = framework; + }; + name = Debug; + }; + 95C8736D17F6C87600F6C878 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../libopus-src/include", + ); + INFOPLIST_FILE = "OpusFile/OpusFile-Info.plist"; + INSTALL_PATH = "@executable_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = framework; + }; + name = Release; + }; + 95C875C817F6D6FC00F6C878 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_ENABLE_MODULES = YES; + DSTROOT = /tmp/opusfile.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../libogg-src/include", + "../libopus-src/include", + ); + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 95C875C917F6D6FC00F6C878 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_ENABLE_MODULES = YES; + DSTROOT = /tmp/opusfile.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../libogg-src/include", + "../libopus-src/include", + ); + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 95F27FC017F6E025009E13C6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_ENABLE_MODULES = YES; + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; + DEAD_CODE_STRIPPING = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../libopus-src/include", + "../libogg-src/include", + ); + INFOPLIST_FILE = "OpusFile_ios/OpusFile_ios-Info.plist"; + INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + PRODUCT_NAME = OpusFile; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + WRAPPER_EXTENSION = framework; + }; + name = Debug; + }; + 95F27FC117F6E025009E13C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_ENABLE_MODULES = YES; + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; + DEAD_CODE_STRIPPING = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "../libopus-src/include", + "../libogg-src/include", + ); + INFOPLIST_FILE = "OpusFile_ios/OpusFile_ios-Info.plist"; + INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + PRODUCT_NAME = OpusFile; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + VALIDATE_PRODUCT = YES; + WRAPPER_EXTENSION = framework; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 95C8733D17F6C87600F6C878 /* Build configuration list for PBXProject "OpusFile" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95C8736917F6C87600F6C878 /* Debug */, + 95C8736A17F6C87600F6C878 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 95C8736B17F6C87600F6C878 /* Build configuration list for PBXNativeTarget "OpusFile" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95C8736C17F6C87600F6C878 /* Debug */, + 95C8736D17F6C87600F6C878 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 95C875C717F6D6FC00F6C878 /* Build configuration list for PBXNativeTarget "opusfile" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95C875C817F6D6FC00F6C878 /* Debug */, + 95C875C917F6D6FC00F6C878 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 95F27FCA17F6E025009E13C6 /* Build configuration list for PBXNativeTarget "OpusFile_ios" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 95F27FC017F6E025009E13C6 /* Debug */, + 95F27FC117F6E025009E13C6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 95C8733A17F6C87600F6C878 /* Project object */; +} diff --git a/Audio-Frameworks/OpusFile/OpusFile/OpusFile-Info.plist b/Audio-Frameworks/OpusFile/OpusFile/OpusFile-Info.plist new file mode 100644 index 0000000..034d641 --- /dev/null +++ b/Audio-Frameworks/OpusFile/OpusFile/OpusFile-Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.ap4y.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSHumanReadableCopyright + Copyright © 2013 Arthur Evstifeev. All rights reserved. + NSPrincipalClass + + + diff --git a/Audio-Frameworks/OpusFile/OpusFile_ios/OpusFile_ios-Info.plist b/Audio-Frameworks/OpusFile/OpusFile_ios/OpusFile_ios-Info.plist new file mode 100644 index 0000000..9dec469 --- /dev/null +++ b/Audio-Frameworks/OpusFile/OpusFile_ios/OpusFile_ios-Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.ap4y.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSPrincipalClass + + + diff --git a/Audio-Frameworks/README.md b/Audio-Frameworks/README.md new file mode 100755 index 0000000..d3db848 --- /dev/null +++ b/Audio-Frameworks/README.md @@ -0,0 +1,33 @@ +MacOS/iOS static frameworks and libraries: +* FLAC +* TagLib, +* CyberlinkUPNP +* Ogg +* Opus +* OpusFile + +Instructions +------- + +Precompiled libraries and frameworks are located in `bin` folder. + +Libraries sources included as git submodules where possible, other sources should be downloaded and unarchived to the corresponding folder. + +In order to compile iOS static framework target you need to install `Fake Framework` template from [iOS-Universal-Framework](https://github.com/kstenerud/iOS-Universal-Framework) + +Credits +------- + +Frameworks official pages: + +- https://github.com/cybergarage/CyberLink4C +- http://taglib.github.com/ +- http://flac.sourceforge.net/ +- http://xiph.org/ogg/ +- https://github.com/kstenerud/iOS-Universal-Framework +- http://opus-codec.org + +License +------- + +All frameworks are copyrighted by their creators and licensed by different licenses, for more information you should look through project pages. diff --git a/Audio-Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj b/Audio-Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj new file mode 100644 index 0000000..aa0d7d2 --- /dev/null +++ b/Audio-Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj @@ -0,0 +1,1536 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 9529F1F415DBFD59000303A6 /* apefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F11C15DBFD59000303A6 /* apefile.cpp */; }; + 9529F1F515DBFD59000303A6 /* apefile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F11D15DBFD59000303A6 /* apefile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F1F615DBFD59000303A6 /* apefooter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F11E15DBFD59000303A6 /* apefooter.cpp */; }; + 9529F1F715DBFD59000303A6 /* apefooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F11F15DBFD59000303A6 /* apefooter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F1F815DBFD59000303A6 /* apeitem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12015DBFD59000303A6 /* apeitem.cpp */; }; + 9529F1F915DBFD59000303A6 /* apeitem.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F12115DBFD59000303A6 /* apeitem.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F1FA15DBFD59000303A6 /* apeproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12215DBFD59000303A6 /* apeproperties.cpp */; }; + 9529F1FB15DBFD59000303A6 /* apeproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F12315DBFD59000303A6 /* apeproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F1FC15DBFD59000303A6 /* apetag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12415DBFD59000303A6 /* apetag.cpp */; }; + 9529F1FD15DBFD59000303A6 /* apetag.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F12515DBFD59000303A6 /* apetag.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F1FE15DBFD59000303A6 /* asfattribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12715DBFD59000303A6 /* asfattribute.cpp */; }; + 9529F1FF15DBFD59000303A6 /* asfattribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F12815DBFD59000303A6 /* asfattribute.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F20015DBFD59000303A6 /* asffile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12915DBFD59000303A6 /* asffile.cpp */; }; + 9529F20115DBFD59000303A6 /* asffile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F12A15DBFD59000303A6 /* asffile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F20215DBFD59000303A6 /* asfpicture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12B15DBFD59000303A6 /* asfpicture.cpp */; }; + 9529F20315DBFD59000303A6 /* asfpicture.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F12C15DBFD59000303A6 /* asfpicture.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F20415DBFD59000303A6 /* asfproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12D15DBFD59000303A6 /* asfproperties.cpp */; }; + 9529F20515DBFD59000303A6 /* asfproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F12E15DBFD59000303A6 /* asfproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F20615DBFD59000303A6 /* asftag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12F15DBFD59000303A6 /* asftag.cpp */; }; + 9529F20715DBFD59000303A6 /* asftag.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F13015DBFD59000303A6 /* asftag.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F20815DBFD59000303A6 /* audioproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13115DBFD59000303A6 /* audioproperties.cpp */; }; + 9529F20915DBFD59000303A6 /* audioproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F13215DBFD59000303A6 /* audioproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F20B15DBFD59000303A6 /* fileref.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13415DBFD59000303A6 /* fileref.cpp */; }; + 9529F20C15DBFD59000303A6 /* fileref.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F13515DBFD59000303A6 /* fileref.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F20D15DBFD59000303A6 /* flacfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13715DBFD59000303A6 /* flacfile.cpp */; }; + 9529F20E15DBFD59000303A6 /* flacfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F13815DBFD59000303A6 /* flacfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F20F15DBFD59000303A6 /* flacmetadatablock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13915DBFD59000303A6 /* flacmetadatablock.cpp */; }; + 9529F21015DBFD59000303A6 /* flacmetadatablock.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F13A15DBFD59000303A6 /* flacmetadatablock.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F21115DBFD59000303A6 /* flacpicture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13B15DBFD59000303A6 /* flacpicture.cpp */; }; + 9529F21215DBFD59000303A6 /* flacpicture.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F13C15DBFD59000303A6 /* flacpicture.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F21315DBFD59000303A6 /* flacproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13D15DBFD59000303A6 /* flacproperties.cpp */; }; + 9529F21415DBFD59000303A6 /* flacproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F13E15DBFD59000303A6 /* flacproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F21515DBFD59000303A6 /* flacunknownmetadatablock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13F15DBFD59000303A6 /* flacunknownmetadatablock.cpp */; }; + 9529F21615DBFD59000303A6 /* flacunknownmetadatablock.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F14015DBFD59000303A6 /* flacunknownmetadatablock.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F21715DBFD59000303A6 /* itfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F14215DBFD59000303A6 /* itfile.cpp */; }; + 9529F21915DBFD59000303A6 /* itproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F14415DBFD59000303A6 /* itproperties.cpp */; }; + 9529F21B15DBFD59000303A6 /* modfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F14715DBFD59000303A6 /* modfile.cpp */; }; + 9529F21D15DBFD59000303A6 /* modfilebase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F14915DBFD59000303A6 /* modfilebase.cpp */; }; + 9529F22015DBFD59000303A6 /* modproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F14C15DBFD59000303A6 /* modproperties.cpp */; }; + 9529F22215DBFD59000303A6 /* modtag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F14E15DBFD59000303A6 /* modtag.cpp */; }; + 9529F22415DBFD59000303A6 /* mp4atom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15115DBFD59000303A6 /* mp4atom.cpp */; }; + 9529F22515DBFD59000303A6 /* mp4atom.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F15215DBFD59000303A6 /* mp4atom.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F22615DBFD59000303A6 /* mp4coverart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15315DBFD59000303A6 /* mp4coverart.cpp */; }; + 9529F22715DBFD59000303A6 /* mp4coverart.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F15415DBFD59000303A6 /* mp4coverart.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F22815DBFD59000303A6 /* mp4file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15515DBFD59000303A6 /* mp4file.cpp */; }; + 9529F22915DBFD59000303A6 /* mp4file.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F15615DBFD59000303A6 /* mp4file.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F22A15DBFD59000303A6 /* mp4item.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15715DBFD59000303A6 /* mp4item.cpp */; }; + 9529F22B15DBFD59000303A6 /* mp4item.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F15815DBFD59000303A6 /* mp4item.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F22C15DBFD59000303A6 /* mp4properties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15915DBFD59000303A6 /* mp4properties.cpp */; }; + 9529F22D15DBFD59000303A6 /* mp4properties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F15A15DBFD59000303A6 /* mp4properties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F22E15DBFD59000303A6 /* mp4tag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15B15DBFD59000303A6 /* mp4tag.cpp */; }; + 9529F22F15DBFD59000303A6 /* mp4tag.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F15C15DBFD59000303A6 /* mp4tag.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F23015DBFD59000303A6 /* mpcfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15E15DBFD59000303A6 /* mpcfile.cpp */; }; + 9529F23115DBFD59000303A6 /* mpcfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F15F15DBFD59000303A6 /* mpcfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F23215DBFD59000303A6 /* mpcproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F16015DBFD59000303A6 /* mpcproperties.cpp */; }; + 9529F23315DBFD59000303A6 /* mpcproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F16115DBFD59000303A6 /* mpcproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F23415DBFD59000303A6 /* id3v1genres.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F16415DBFD59000303A6 /* id3v1genres.cpp */; }; + 9529F23515DBFD59000303A6 /* id3v1genres.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F16515DBFD59000303A6 /* id3v1genres.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F23615DBFD59000303A6 /* id3v1tag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F16615DBFD59000303A6 /* id3v1tag.cpp */; }; + 9529F23715DBFD59000303A6 /* id3v1tag.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F16715DBFD59000303A6 /* id3v1tag.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F23815DBFD59000303A6 /* attachedpictureframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F16A15DBFD59000303A6 /* attachedpictureframe.cpp */; }; + 9529F23915DBFD59000303A6 /* attachedpictureframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F16B15DBFD59000303A6 /* attachedpictureframe.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F23A15DBFD59000303A6 /* commentsframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F16C15DBFD59000303A6 /* commentsframe.cpp */; }; + 9529F23B15DBFD59000303A6 /* commentsframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F16D15DBFD59000303A6 /* commentsframe.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F23C15DBFD59000303A6 /* generalencapsulatedobjectframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F16E15DBFD59000303A6 /* generalencapsulatedobjectframe.cpp */; }; + 9529F23D15DBFD59000303A6 /* generalencapsulatedobjectframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F16F15DBFD59000303A6 /* generalencapsulatedobjectframe.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F23E15DBFD59000303A6 /* popularimeterframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17015DBFD59000303A6 /* popularimeterframe.cpp */; }; + 9529F23F15DBFD59000303A6 /* popularimeterframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F17115DBFD59000303A6 /* popularimeterframe.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F24015DBFD59000303A6 /* privateframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17215DBFD59000303A6 /* privateframe.cpp */; }; + 9529F24115DBFD59000303A6 /* privateframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F17315DBFD59000303A6 /* privateframe.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F24215DBFD59000303A6 /* relativevolumeframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17415DBFD59000303A6 /* relativevolumeframe.cpp */; }; + 9529F24315DBFD59000303A6 /* relativevolumeframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F17515DBFD59000303A6 /* relativevolumeframe.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F24415DBFD59000303A6 /* textidentificationframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17615DBFD59000303A6 /* textidentificationframe.cpp */; }; + 9529F24515DBFD59000303A6 /* textidentificationframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F17715DBFD59000303A6 /* textidentificationframe.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F24615DBFD59000303A6 /* uniquefileidentifierframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17815DBFD59000303A6 /* uniquefileidentifierframe.cpp */; }; + 9529F24715DBFD59000303A6 /* uniquefileidentifierframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F17915DBFD59000303A6 /* uniquefileidentifierframe.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F24815DBFD59000303A6 /* unknownframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17A15DBFD59000303A6 /* unknownframe.cpp */; }; + 9529F24915DBFD59000303A6 /* unknownframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F17B15DBFD59000303A6 /* unknownframe.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F24A15DBFD59000303A6 /* unsynchronizedlyricsframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17C15DBFD59000303A6 /* unsynchronizedlyricsframe.cpp */; }; + 9529F24B15DBFD59000303A6 /* unsynchronizedlyricsframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F17D15DBFD59000303A6 /* unsynchronizedlyricsframe.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F24C15DBFD59000303A6 /* urllinkframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17E15DBFD59000303A6 /* urllinkframe.cpp */; }; + 9529F24D15DBFD59000303A6 /* urllinkframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F17F15DBFD59000303A6 /* urllinkframe.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F24E15DBFD59000303A6 /* id3v2.2.0.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9529F18015DBFD59000303A6 /* id3v2.2.0.txt */; }; + 9529F24F15DBFD59000303A6 /* id3v2.3.0.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9529F18115DBFD59000303A6 /* id3v2.3.0.txt */; }; + 9529F25015DBFD59000303A6 /* id3v2.4.0-frames.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9529F18215DBFD59000303A6 /* id3v2.4.0-frames.txt */; }; + 9529F25115DBFD59000303A6 /* id3v2.4.0-structure.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9529F18315DBFD59000303A6 /* id3v2.4.0-structure.txt */; }; + 9529F25215DBFD59000303A6 /* id3v2extendedheader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F18415DBFD59000303A6 /* id3v2extendedheader.cpp */; }; + 9529F25315DBFD59000303A6 /* id3v2extendedheader.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F18515DBFD59000303A6 /* id3v2extendedheader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F25415DBFD59000303A6 /* id3v2footer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F18615DBFD59000303A6 /* id3v2footer.cpp */; }; + 9529F25515DBFD59000303A6 /* id3v2footer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F18715DBFD59000303A6 /* id3v2footer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F25615DBFD59000303A6 /* id3v2frame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F18815DBFD59000303A6 /* id3v2frame.cpp */; }; + 9529F25715DBFD59000303A6 /* id3v2frame.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F18915DBFD59000303A6 /* id3v2frame.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F25815DBFD59000303A6 /* id3v2framefactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F18A15DBFD59000303A6 /* id3v2framefactory.cpp */; }; + 9529F25915DBFD59000303A6 /* id3v2framefactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F18B15DBFD59000303A6 /* id3v2framefactory.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F25A15DBFD59000303A6 /* id3v2header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F18C15DBFD59000303A6 /* id3v2header.cpp */; }; + 9529F25B15DBFD59000303A6 /* id3v2header.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F18D15DBFD59000303A6 /* id3v2header.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F25C15DBFD59000303A6 /* id3v2synchdata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F18E15DBFD59000303A6 /* id3v2synchdata.cpp */; }; + 9529F25D15DBFD59000303A6 /* id3v2synchdata.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F18F15DBFD59000303A6 /* id3v2synchdata.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F25E15DBFD59000303A6 /* id3v2tag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19015DBFD59000303A6 /* id3v2tag.cpp */; }; + 9529F25F15DBFD59000303A6 /* id3v2tag.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F19115DBFD59000303A6 /* id3v2tag.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F26015DBFD59000303A6 /* mpegfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19215DBFD59000303A6 /* mpegfile.cpp */; }; + 9529F26115DBFD59000303A6 /* mpegfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F19315DBFD59000303A6 /* mpegfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F26215DBFD59000303A6 /* mpegheader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19415DBFD59000303A6 /* mpegheader.cpp */; }; + 9529F26315DBFD59000303A6 /* mpegheader.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F19515DBFD59000303A6 /* mpegheader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F26415DBFD59000303A6 /* mpegproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19615DBFD59000303A6 /* mpegproperties.cpp */; }; + 9529F26515DBFD59000303A6 /* mpegproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F19715DBFD59000303A6 /* mpegproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F26615DBFD59000303A6 /* xingheader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19815DBFD59000303A6 /* xingheader.cpp */; }; + 9529F26715DBFD59000303A6 /* xingheader.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F19915DBFD59000303A6 /* xingheader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F26815DBFD59000303A6 /* oggflacfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19C15DBFD59000303A6 /* oggflacfile.cpp */; }; + 9529F26915DBFD59000303A6 /* oggflacfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F19D15DBFD59000303A6 /* oggflacfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F26A15DBFD59000303A6 /* oggfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19E15DBFD59000303A6 /* oggfile.cpp */; }; + 9529F26B15DBFD59000303A6 /* oggfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F19F15DBFD59000303A6 /* oggfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F26C15DBFD59000303A6 /* oggpage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1A015DBFD59000303A6 /* oggpage.cpp */; }; + 9529F26D15DBFD59000303A6 /* oggpage.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1A115DBFD59000303A6 /* oggpage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F26E15DBFD59000303A6 /* oggpageheader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1A215DBFD59000303A6 /* oggpageheader.cpp */; }; + 9529F26F15DBFD59000303A6 /* oggpageheader.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1A315DBFD59000303A6 /* oggpageheader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F27015DBFD59000303A6 /* speexfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1A515DBFD59000303A6 /* speexfile.cpp */; }; + 9529F27115DBFD59000303A6 /* speexfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1A615DBFD59000303A6 /* speexfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F27215DBFD59000303A6 /* speexproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1A715DBFD59000303A6 /* speexproperties.cpp */; }; + 9529F27315DBFD59000303A6 /* speexproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1A815DBFD59000303A6 /* speexproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F27415DBFD59000303A6 /* vorbisfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1AA15DBFD59000303A6 /* vorbisfile.cpp */; }; + 9529F27515DBFD59000303A6 /* vorbisfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1AB15DBFD59000303A6 /* vorbisfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F27615DBFD59000303A6 /* vorbisproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1AC15DBFD59000303A6 /* vorbisproperties.cpp */; }; + 9529F27715DBFD59000303A6 /* vorbisproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1AD15DBFD59000303A6 /* vorbisproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F27815DBFD59000303A6 /* xiphcomment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1AE15DBFD59000303A6 /* xiphcomment.cpp */; }; + 9529F27915DBFD59000303A6 /* xiphcomment.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1AF15DBFD59000303A6 /* xiphcomment.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F27A15DBFD59000303A6 /* aifffile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1B215DBFD59000303A6 /* aifffile.cpp */; }; + 9529F27B15DBFD59000303A6 /* aifffile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1B315DBFD59000303A6 /* aifffile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F27C15DBFD59000303A6 /* aiffproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1B415DBFD59000303A6 /* aiffproperties.cpp */; }; + 9529F27D15DBFD59000303A6 /* aiffproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1B515DBFD59000303A6 /* aiffproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F27E15DBFD59000303A6 /* rifffile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1B615DBFD59000303A6 /* rifffile.cpp */; }; + 9529F27F15DBFD59000303A6 /* rifffile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1B715DBFD59000303A6 /* rifffile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F28015DBFD59000303A6 /* wavfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1B915DBFD59000303A6 /* wavfile.cpp */; }; + 9529F28115DBFD59000303A6 /* wavfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1BA15DBFD59000303A6 /* wavfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F28215DBFD59000303A6 /* wavproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1BB15DBFD59000303A6 /* wavproperties.cpp */; }; + 9529F28315DBFD59000303A6 /* wavproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1BC15DBFD59000303A6 /* wavproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F28415DBFD59000303A6 /* s3mfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1BE15DBFD59000303A6 /* s3mfile.cpp */; }; + 9529F28615DBFD59000303A6 /* s3mproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1C015DBFD59000303A6 /* s3mproperties.cpp */; }; + 9529F28815DBFD59000303A6 /* tag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1C215DBFD59000303A6 /* tag.cpp */; }; + 9529F28915DBFD59000303A6 /* tag.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1C315DBFD59000303A6 /* tag.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F28B15DBFD59000303A6 /* taglib_export.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1C515DBFD59000303A6 /* taglib_export.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F28C15DBFD59000303A6 /* tagunion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1C615DBFD59000303A6 /* tagunion.cpp */; }; + 9529F28D15DBFD59000303A6 /* tagunion.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1C715DBFD59000303A6 /* tagunion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F28E15DBFD59000303A6 /* taglib.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1C915DBFD59000303A6 /* taglib.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F28F15DBFD59000303A6 /* tbytevector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1CA15DBFD59000303A6 /* tbytevector.cpp */; }; + 9529F29015DBFD59000303A6 /* tbytevector.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1CB15DBFD59000303A6 /* tbytevector.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F29115DBFD59000303A6 /* tbytevectorlist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1CC15DBFD59000303A6 /* tbytevectorlist.cpp */; }; + 9529F29215DBFD59000303A6 /* tbytevectorlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1CD15DBFD59000303A6 /* tbytevectorlist.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F29315DBFD59000303A6 /* tbytevectorstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1CE15DBFD59000303A6 /* tbytevectorstream.cpp */; }; + 9529F29415DBFD59000303A6 /* tbytevectorstream.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1CF15DBFD59000303A6 /* tbytevectorstream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F29515DBFD59000303A6 /* tdebug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1D015DBFD59000303A6 /* tdebug.cpp */; }; + 9529F29615DBFD59000303A6 /* tdebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1D115DBFD59000303A6 /* tdebug.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F29715DBFD59000303A6 /* tfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1D215DBFD59000303A6 /* tfile.cpp */; }; + 9529F29815DBFD59000303A6 /* tfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1D315DBFD59000303A6 /* tfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F29915DBFD59000303A6 /* tfilestream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1D415DBFD59000303A6 /* tfilestream.cpp */; }; + 9529F29A15DBFD59000303A6 /* tfilestream.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1D515DBFD59000303A6 /* tfilestream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F29B15DBFD59000303A6 /* tiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1D615DBFD59000303A6 /* tiostream.cpp */; }; + 9529F29C15DBFD59000303A6 /* tiostream.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1D715DBFD59000303A6 /* tiostream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F29D15DBFD59000303A6 /* tlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1D815DBFD59000303A6 /* tlist.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F29F15DBFD59000303A6 /* tmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1DA15DBFD59000303A6 /* tmap.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F2A115DBFD59000303A6 /* tpropertymap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1DC15DBFD59000303A6 /* tpropertymap.cpp */; }; + 9529F2A215DBFD59000303A6 /* tpropertymap.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1DD15DBFD59000303A6 /* tpropertymap.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F2A315DBFD59000303A6 /* tstring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1DE15DBFD59000303A6 /* tstring.cpp */; }; + 9529F2A415DBFD59000303A6 /* tstring.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1DF15DBFD59000303A6 /* tstring.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F2A515DBFD59000303A6 /* tstringlist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1E015DBFD59000303A6 /* tstringlist.cpp */; }; + 9529F2A615DBFD59000303A6 /* tstringlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1E115DBFD59000303A6 /* tstringlist.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F2A715DBFD59000303A6 /* unicode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1E215DBFD59000303A6 /* unicode.cpp */; }; + 9529F2A815DBFD59000303A6 /* unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1E315DBFD59000303A6 /* unicode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F2A915DBFD59000303A6 /* trueaudiofile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1E515DBFD59000303A6 /* trueaudiofile.cpp */; }; + 9529F2AA15DBFD59000303A6 /* trueaudiofile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1E615DBFD59000303A6 /* trueaudiofile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F2AB15DBFD59000303A6 /* trueaudioproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1E715DBFD59000303A6 /* trueaudioproperties.cpp */; }; + 9529F2AC15DBFD59000303A6 /* trueaudioproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1E815DBFD59000303A6 /* trueaudioproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F2AD15DBFD59000303A6 /* wavpackfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1EA15DBFD59000303A6 /* wavpackfile.cpp */; }; + 9529F2AE15DBFD59000303A6 /* wavpackfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1EB15DBFD59000303A6 /* wavpackfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F2AF15DBFD59000303A6 /* wavpackproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1EC15DBFD59000303A6 /* wavpackproperties.cpp */; }; + 9529F2B015DBFD59000303A6 /* wavpackproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1ED15DBFD59000303A6 /* wavpackproperties.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F2B115DBFD59000303A6 /* xmfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1EF15DBFD59000303A6 /* xmfile.cpp */; }; + 9529F2B315DBFD59000303A6 /* xmproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1F115DBFD59000303A6 /* xmproperties.cpp */; }; + 9529F2B815DBFE1C000303A6 /* itfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F14315DBFD59000303A6 /* itfile.h */; }; + 9529F2B915DBFE1C000303A6 /* itproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F14515DBFD59000303A6 /* itproperties.h */; }; + 9529F2BA15DBFE2A000303A6 /* modfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F14815DBFD59000303A6 /* modfile.h */; }; + 9529F2BB15DBFE2A000303A6 /* modfilebase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F14A15DBFD59000303A6 /* modfilebase.h */; }; + 9529F2BC15DBFE2A000303A6 /* modfileprivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F14B15DBFD59000303A6 /* modfileprivate.h */; }; + 9529F2BD15DBFE2A000303A6 /* modtag.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F14F15DBFD59000303A6 /* modtag.h */; }; + 9529F2BE15DBFE39000303A6 /* s3mfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1BF15DBFD59000303A6 /* s3mfile.h */; }; + 9529F2BF15DBFE39000303A6 /* s3mproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1C115DBFD59000303A6 /* s3mproperties.h */; }; + 9529F2C015DBFE39000303A6 /* xmfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1F015DBFD59000303A6 /* xmfile.h */; }; + 9529F2C115DBFE39000303A6 /* xmproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1F215DBFD59000303A6 /* xmproperties.h */; }; + 9529F2C215DBFE55000303A6 /* tlist.tcc in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1D915DBFD59000303A6 /* tlist.tcc */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F2C315DBFE55000303A6 /* tmap.tcc in Headers */ = {isa = PBXBuildFile; fileRef = 9529F1DB15DBFD59000303A6 /* tmap.tcc */; settings = {ATTRIBUTES = (Public, ); }; }; + 9529F2C415DBFE98000303A6 /* modproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F14D15DBFD59000303A6 /* modproperties.h */; }; + 9529F2C715DBFF0A000303A6 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F2C515DBFF0A000303A6 /* config.h */; }; + 9529F2C815DBFF0A000303A6 /* taglib_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 9529F2C615DBFF0A000303A6 /* taglib_config.h */; settings = {ATTRIBUTES = (); }; }; + 9529F2DB15DC0134000303A6 /* apefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F11C15DBFD59000303A6 /* apefile.cpp */; }; + 9529F2DC15DC0134000303A6 /* apefooter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F11E15DBFD59000303A6 /* apefooter.cpp */; }; + 9529F2DD15DC0134000303A6 /* apeitem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12015DBFD59000303A6 /* apeitem.cpp */; }; + 9529F2DE15DC0134000303A6 /* apeproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12215DBFD59000303A6 /* apeproperties.cpp */; }; + 9529F2DF15DC0134000303A6 /* apetag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12415DBFD59000303A6 /* apetag.cpp */; }; + 9529F2E015DC0134000303A6 /* asfattribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12715DBFD59000303A6 /* asfattribute.cpp */; }; + 9529F2E115DC0134000303A6 /* asffile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12915DBFD59000303A6 /* asffile.cpp */; }; + 9529F2E215DC0134000303A6 /* asfpicture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12B15DBFD59000303A6 /* asfpicture.cpp */; }; + 9529F2E315DC0134000303A6 /* asfproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12D15DBFD59000303A6 /* asfproperties.cpp */; }; + 9529F2E415DC0134000303A6 /* asftag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F12F15DBFD59000303A6 /* asftag.cpp */; }; + 9529F2E515DC0134000303A6 /* audioproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13115DBFD59000303A6 /* audioproperties.cpp */; }; + 9529F2E615DC0134000303A6 /* fileref.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13415DBFD59000303A6 /* fileref.cpp */; }; + 9529F2E715DC0134000303A6 /* flacfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13715DBFD59000303A6 /* flacfile.cpp */; }; + 9529F2E815DC0134000303A6 /* flacmetadatablock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13915DBFD59000303A6 /* flacmetadatablock.cpp */; }; + 9529F2E915DC0134000303A6 /* flacpicture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13B15DBFD59000303A6 /* flacpicture.cpp */; }; + 9529F2EA15DC0134000303A6 /* flacproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13D15DBFD59000303A6 /* flacproperties.cpp */; }; + 9529F2EB15DC0134000303A6 /* flacunknownmetadatablock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F13F15DBFD59000303A6 /* flacunknownmetadatablock.cpp */; }; + 9529F2EC15DC0134000303A6 /* itfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F14215DBFD59000303A6 /* itfile.cpp */; }; + 9529F2ED15DC0134000303A6 /* itproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F14415DBFD59000303A6 /* itproperties.cpp */; }; + 9529F2EE15DC0134000303A6 /* modfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F14715DBFD59000303A6 /* modfile.cpp */; }; + 9529F2EF15DC0134000303A6 /* modfilebase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F14915DBFD59000303A6 /* modfilebase.cpp */; }; + 9529F2F015DC0134000303A6 /* modproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F14C15DBFD59000303A6 /* modproperties.cpp */; }; + 9529F2F115DC0134000303A6 /* modtag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F14E15DBFD59000303A6 /* modtag.cpp */; }; + 9529F2F215DC0134000303A6 /* mp4atom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15115DBFD59000303A6 /* mp4atom.cpp */; }; + 9529F2F315DC0134000303A6 /* mp4coverart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15315DBFD59000303A6 /* mp4coverart.cpp */; }; + 9529F2F415DC0134000303A6 /* mp4file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15515DBFD59000303A6 /* mp4file.cpp */; }; + 9529F2F515DC0134000303A6 /* mp4item.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15715DBFD59000303A6 /* mp4item.cpp */; }; + 9529F2F615DC0134000303A6 /* mp4properties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15915DBFD59000303A6 /* mp4properties.cpp */; }; + 9529F2F715DC0134000303A6 /* mp4tag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15B15DBFD59000303A6 /* mp4tag.cpp */; }; + 9529F2F815DC0134000303A6 /* mpcfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F15E15DBFD59000303A6 /* mpcfile.cpp */; }; + 9529F2F915DC0134000303A6 /* mpcproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F16015DBFD59000303A6 /* mpcproperties.cpp */; }; + 9529F2FA15DC0134000303A6 /* id3v1genres.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F16415DBFD59000303A6 /* id3v1genres.cpp */; }; + 9529F2FB15DC0134000303A6 /* id3v1tag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F16615DBFD59000303A6 /* id3v1tag.cpp */; }; + 9529F2FC15DC0134000303A6 /* attachedpictureframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F16A15DBFD59000303A6 /* attachedpictureframe.cpp */; }; + 9529F2FD15DC0134000303A6 /* commentsframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F16C15DBFD59000303A6 /* commentsframe.cpp */; }; + 9529F2FE15DC0134000303A6 /* generalencapsulatedobjectframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F16E15DBFD59000303A6 /* generalencapsulatedobjectframe.cpp */; }; + 9529F2FF15DC0134000303A6 /* popularimeterframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17015DBFD59000303A6 /* popularimeterframe.cpp */; }; + 9529F30015DC0134000303A6 /* privateframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17215DBFD59000303A6 /* privateframe.cpp */; }; + 9529F30115DC0134000303A6 /* relativevolumeframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17415DBFD59000303A6 /* relativevolumeframe.cpp */; }; + 9529F30215DC0134000303A6 /* textidentificationframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17615DBFD59000303A6 /* textidentificationframe.cpp */; }; + 9529F30315DC0134000303A6 /* uniquefileidentifierframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17815DBFD59000303A6 /* uniquefileidentifierframe.cpp */; }; + 9529F30415DC0134000303A6 /* unknownframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17A15DBFD59000303A6 /* unknownframe.cpp */; }; + 9529F30515DC0134000303A6 /* unsynchronizedlyricsframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17C15DBFD59000303A6 /* unsynchronizedlyricsframe.cpp */; }; + 9529F30615DC0134000303A6 /* urllinkframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F17E15DBFD59000303A6 /* urllinkframe.cpp */; }; + 9529F30715DC0134000303A6 /* id3v2extendedheader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F18415DBFD59000303A6 /* id3v2extendedheader.cpp */; }; + 9529F30815DC0134000303A6 /* id3v2footer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F18615DBFD59000303A6 /* id3v2footer.cpp */; }; + 9529F30915DC0134000303A6 /* id3v2frame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F18815DBFD59000303A6 /* id3v2frame.cpp */; }; + 9529F30A15DC0134000303A6 /* id3v2framefactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F18A15DBFD59000303A6 /* id3v2framefactory.cpp */; }; + 9529F30B15DC0134000303A6 /* id3v2header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F18C15DBFD59000303A6 /* id3v2header.cpp */; }; + 9529F30C15DC0134000303A6 /* id3v2synchdata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F18E15DBFD59000303A6 /* id3v2synchdata.cpp */; }; + 9529F30D15DC0134000303A6 /* id3v2tag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19015DBFD59000303A6 /* id3v2tag.cpp */; }; + 9529F30E15DC0134000303A6 /* mpegfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19215DBFD59000303A6 /* mpegfile.cpp */; }; + 9529F30F15DC0134000303A6 /* mpegheader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19415DBFD59000303A6 /* mpegheader.cpp */; }; + 9529F31015DC0134000303A6 /* mpegproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19615DBFD59000303A6 /* mpegproperties.cpp */; }; + 9529F31115DC0134000303A6 /* xingheader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19815DBFD59000303A6 /* xingheader.cpp */; }; + 9529F31215DC0134000303A6 /* oggflacfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19C15DBFD59000303A6 /* oggflacfile.cpp */; }; + 9529F31315DC0134000303A6 /* oggfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F19E15DBFD59000303A6 /* oggfile.cpp */; }; + 9529F31415DC0135000303A6 /* oggpage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1A015DBFD59000303A6 /* oggpage.cpp */; }; + 9529F31515DC0135000303A6 /* oggpageheader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1A215DBFD59000303A6 /* oggpageheader.cpp */; }; + 9529F31615DC0135000303A6 /* speexfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1A515DBFD59000303A6 /* speexfile.cpp */; }; + 9529F31715DC0135000303A6 /* speexproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1A715DBFD59000303A6 /* speexproperties.cpp */; }; + 9529F31815DC0135000303A6 /* vorbisfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1AA15DBFD59000303A6 /* vorbisfile.cpp */; }; + 9529F31915DC0135000303A6 /* vorbisproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1AC15DBFD59000303A6 /* vorbisproperties.cpp */; }; + 9529F31A15DC0135000303A6 /* xiphcomment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1AE15DBFD59000303A6 /* xiphcomment.cpp */; }; + 9529F31B15DC0135000303A6 /* aifffile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1B215DBFD59000303A6 /* aifffile.cpp */; }; + 9529F31C15DC0135000303A6 /* aiffproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1B415DBFD59000303A6 /* aiffproperties.cpp */; }; + 9529F31D15DC0135000303A6 /* rifffile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1B615DBFD59000303A6 /* rifffile.cpp */; }; + 9529F31E15DC0135000303A6 /* wavfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1B915DBFD59000303A6 /* wavfile.cpp */; }; + 9529F31F15DC0135000303A6 /* wavproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1BB15DBFD59000303A6 /* wavproperties.cpp */; }; + 9529F32015DC0135000303A6 /* s3mfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1BE15DBFD59000303A6 /* s3mfile.cpp */; }; + 9529F32115DC0135000303A6 /* s3mproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1C015DBFD59000303A6 /* s3mproperties.cpp */; }; + 9529F32215DC0135000303A6 /* tag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1C215DBFD59000303A6 /* tag.cpp */; }; + 9529F32315DC0135000303A6 /* tagunion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1C615DBFD59000303A6 /* tagunion.cpp */; }; + 9529F32415DC0135000303A6 /* tbytevector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1CA15DBFD59000303A6 /* tbytevector.cpp */; }; + 9529F32515DC0135000303A6 /* tbytevectorlist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1CC15DBFD59000303A6 /* tbytevectorlist.cpp */; }; + 9529F32615DC0135000303A6 /* tbytevectorstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1CE15DBFD59000303A6 /* tbytevectorstream.cpp */; }; + 9529F32715DC0135000303A6 /* tdebug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1D015DBFD59000303A6 /* tdebug.cpp */; }; + 9529F32815DC0135000303A6 /* tfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1D215DBFD59000303A6 /* tfile.cpp */; }; + 9529F32915DC0135000303A6 /* tfilestream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1D415DBFD59000303A6 /* tfilestream.cpp */; }; + 9529F32A15DC0135000303A6 /* tiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1D615DBFD59000303A6 /* tiostream.cpp */; }; + 9529F32B15DC0135000303A6 /* tpropertymap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1DC15DBFD59000303A6 /* tpropertymap.cpp */; }; + 9529F32C15DC0135000303A6 /* tstring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1DE15DBFD59000303A6 /* tstring.cpp */; }; + 9529F32D15DC0135000303A6 /* tstringlist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1E015DBFD59000303A6 /* tstringlist.cpp */; }; + 9529F32E15DC0135000303A6 /* unicode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1E215DBFD59000303A6 /* unicode.cpp */; }; + 9529F32F15DC0135000303A6 /* trueaudiofile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1E515DBFD59000303A6 /* trueaudiofile.cpp */; }; + 9529F33015DC0135000303A6 /* trueaudioproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1E715DBFD59000303A6 /* trueaudioproperties.cpp */; }; + 9529F33115DC0135000303A6 /* wavpackfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1EA15DBFD59000303A6 /* wavpackfile.cpp */; }; + 9529F33215DC0135000303A6 /* wavpackproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1EC15DBFD59000303A6 /* wavpackproperties.cpp */; }; + 9529F33315DC0135000303A6 /* xmfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1EF15DBFD59000303A6 /* xmfile.cpp */; }; + 9529F33415DC0135000303A6 /* xmproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9529F1F115DBFD59000303A6 /* xmproperties.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9529F2CB15DC0097000303A6 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/${PRODUCT_NAME}"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 9529F10A15DBFC95000303A6 /* TagLib.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TagLib.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9529F10E15DBFC95000303A6 /* TagLib-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TagLib-Info.plist"; sourceTree = ""; }; + 9529F11215DBFC95000303A6 /* TagLib-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TagLib-Prefix.pch"; sourceTree = ""; }; + 9529F11C15DBFD59000303A6 /* apefile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = apefile.cpp; path = "../../taglib-src/taglib/ape/apefile.cpp"; sourceTree = ""; }; + 9529F11D15DBFD59000303A6 /* apefile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = apefile.h; path = "../../taglib-src/taglib/ape/apefile.h"; sourceTree = ""; }; + 9529F11E15DBFD59000303A6 /* apefooter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = apefooter.cpp; path = "../../taglib-src/taglib/ape/apefooter.cpp"; sourceTree = ""; }; + 9529F11F15DBFD59000303A6 /* apefooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = apefooter.h; path = "../../taglib-src/taglib/ape/apefooter.h"; sourceTree = ""; }; + 9529F12015DBFD59000303A6 /* apeitem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = apeitem.cpp; path = "../../taglib-src/taglib/ape/apeitem.cpp"; sourceTree = ""; }; + 9529F12115DBFD59000303A6 /* apeitem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = apeitem.h; path = "../../taglib-src/taglib/ape/apeitem.h"; sourceTree = ""; }; + 9529F12215DBFD59000303A6 /* apeproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = apeproperties.cpp; path = "../../taglib-src/taglib/ape/apeproperties.cpp"; sourceTree = ""; }; + 9529F12315DBFD59000303A6 /* apeproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = apeproperties.h; path = "../../taglib-src/taglib/ape/apeproperties.h"; sourceTree = ""; }; + 9529F12415DBFD59000303A6 /* apetag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = apetag.cpp; path = "../../taglib-src/taglib/ape/apetag.cpp"; sourceTree = ""; }; + 9529F12515DBFD59000303A6 /* apetag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = apetag.h; path = "../../taglib-src/taglib/ape/apetag.h"; sourceTree = ""; }; + 9529F12715DBFD59000303A6 /* asfattribute.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = asfattribute.cpp; sourceTree = ""; }; + 9529F12815DBFD59000303A6 /* asfattribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asfattribute.h; sourceTree = ""; }; + 9529F12915DBFD59000303A6 /* asffile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = asffile.cpp; sourceTree = ""; }; + 9529F12A15DBFD59000303A6 /* asffile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asffile.h; sourceTree = ""; }; + 9529F12B15DBFD59000303A6 /* asfpicture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = asfpicture.cpp; sourceTree = ""; }; + 9529F12C15DBFD59000303A6 /* asfpicture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asfpicture.h; sourceTree = ""; }; + 9529F12D15DBFD59000303A6 /* asfproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = asfproperties.cpp; sourceTree = ""; }; + 9529F12E15DBFD59000303A6 /* asfproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asfproperties.h; sourceTree = ""; }; + 9529F12F15DBFD59000303A6 /* asftag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = asftag.cpp; sourceTree = ""; }; + 9529F13015DBFD59000303A6 /* asftag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asftag.h; sourceTree = ""; }; + 9529F13115DBFD59000303A6 /* audioproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = audioproperties.cpp; path = "../../taglib-src/taglib/audioproperties.cpp"; sourceTree = ""; }; + 9529F13215DBFD59000303A6 /* audioproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = audioproperties.h; path = "../../taglib-src/taglib/audioproperties.h"; sourceTree = ""; }; + 9529F13415DBFD59000303A6 /* fileref.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fileref.cpp; path = "../../taglib-src/taglib/fileref.cpp"; sourceTree = ""; }; + 9529F13515DBFD59000303A6 /* fileref.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fileref.h; path = "../../taglib-src/taglib/fileref.h"; sourceTree = ""; }; + 9529F13715DBFD59000303A6 /* flacfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flacfile.cpp; sourceTree = ""; }; + 9529F13815DBFD59000303A6 /* flacfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flacfile.h; sourceTree = ""; }; + 9529F13915DBFD59000303A6 /* flacmetadatablock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flacmetadatablock.cpp; sourceTree = ""; }; + 9529F13A15DBFD59000303A6 /* flacmetadatablock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flacmetadatablock.h; sourceTree = ""; }; + 9529F13B15DBFD59000303A6 /* flacpicture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flacpicture.cpp; sourceTree = ""; }; + 9529F13C15DBFD59000303A6 /* flacpicture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flacpicture.h; sourceTree = ""; }; + 9529F13D15DBFD59000303A6 /* flacproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flacproperties.cpp; sourceTree = ""; }; + 9529F13E15DBFD59000303A6 /* flacproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flacproperties.h; sourceTree = ""; }; + 9529F13F15DBFD59000303A6 /* flacunknownmetadatablock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flacunknownmetadatablock.cpp; sourceTree = ""; }; + 9529F14015DBFD59000303A6 /* flacunknownmetadatablock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flacunknownmetadatablock.h; sourceTree = ""; }; + 9529F14215DBFD59000303A6 /* itfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = itfile.cpp; sourceTree = ""; }; + 9529F14315DBFD59000303A6 /* itfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = itfile.h; sourceTree = ""; }; + 9529F14415DBFD59000303A6 /* itproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = itproperties.cpp; sourceTree = ""; }; + 9529F14515DBFD59000303A6 /* itproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = itproperties.h; sourceTree = ""; }; + 9529F14715DBFD59000303A6 /* modfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = modfile.cpp; sourceTree = ""; }; + 9529F14815DBFD59000303A6 /* modfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = modfile.h; sourceTree = ""; }; + 9529F14915DBFD59000303A6 /* modfilebase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = modfilebase.cpp; sourceTree = ""; }; + 9529F14A15DBFD59000303A6 /* modfilebase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = modfilebase.h; sourceTree = ""; }; + 9529F14B15DBFD59000303A6 /* modfileprivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = modfileprivate.h; sourceTree = ""; }; + 9529F14C15DBFD59000303A6 /* modproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = modproperties.cpp; sourceTree = ""; }; + 9529F14D15DBFD59000303A6 /* modproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = modproperties.h; sourceTree = ""; }; + 9529F14E15DBFD59000303A6 /* modtag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = modtag.cpp; sourceTree = ""; }; + 9529F14F15DBFD59000303A6 /* modtag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = modtag.h; sourceTree = ""; }; + 9529F15115DBFD59000303A6 /* mp4atom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp4atom.cpp; sourceTree = ""; }; + 9529F15215DBFD59000303A6 /* mp4atom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4atom.h; sourceTree = ""; }; + 9529F15315DBFD59000303A6 /* mp4coverart.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp4coverart.cpp; sourceTree = ""; }; + 9529F15415DBFD59000303A6 /* mp4coverart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4coverart.h; sourceTree = ""; }; + 9529F15515DBFD59000303A6 /* mp4file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp4file.cpp; sourceTree = ""; }; + 9529F15615DBFD59000303A6 /* mp4file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4file.h; sourceTree = ""; }; + 9529F15715DBFD59000303A6 /* mp4item.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp4item.cpp; sourceTree = ""; }; + 9529F15815DBFD59000303A6 /* mp4item.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4item.h; sourceTree = ""; }; + 9529F15915DBFD59000303A6 /* mp4properties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp4properties.cpp; sourceTree = ""; }; + 9529F15A15DBFD59000303A6 /* mp4properties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4properties.h; sourceTree = ""; }; + 9529F15B15DBFD59000303A6 /* mp4tag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp4tag.cpp; sourceTree = ""; }; + 9529F15C15DBFD59000303A6 /* mp4tag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp4tag.h; sourceTree = ""; }; + 9529F15E15DBFD59000303A6 /* mpcfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mpcfile.cpp; sourceTree = ""; }; + 9529F15F15DBFD59000303A6 /* mpcfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpcfile.h; sourceTree = ""; }; + 9529F16015DBFD59000303A6 /* mpcproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mpcproperties.cpp; sourceTree = ""; }; + 9529F16115DBFD59000303A6 /* mpcproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpcproperties.h; sourceTree = ""; }; + 9529F16415DBFD59000303A6 /* id3v1genres.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = id3v1genres.cpp; sourceTree = ""; }; + 9529F16515DBFD59000303A6 /* id3v1genres.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3v1genres.h; sourceTree = ""; }; + 9529F16615DBFD59000303A6 /* id3v1tag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = id3v1tag.cpp; sourceTree = ""; }; + 9529F16715DBFD59000303A6 /* id3v1tag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3v1tag.h; sourceTree = ""; }; + 9529F16A15DBFD59000303A6 /* attachedpictureframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = attachedpictureframe.cpp; sourceTree = ""; }; + 9529F16B15DBFD59000303A6 /* attachedpictureframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = attachedpictureframe.h; sourceTree = ""; }; + 9529F16C15DBFD59000303A6 /* commentsframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = commentsframe.cpp; sourceTree = ""; }; + 9529F16D15DBFD59000303A6 /* commentsframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = commentsframe.h; sourceTree = ""; }; + 9529F16E15DBFD59000303A6 /* generalencapsulatedobjectframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = generalencapsulatedobjectframe.cpp; sourceTree = ""; }; + 9529F16F15DBFD59000303A6 /* generalencapsulatedobjectframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = generalencapsulatedobjectframe.h; sourceTree = ""; }; + 9529F17015DBFD59000303A6 /* popularimeterframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = popularimeterframe.cpp; sourceTree = ""; }; + 9529F17115DBFD59000303A6 /* popularimeterframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = popularimeterframe.h; sourceTree = ""; }; + 9529F17215DBFD59000303A6 /* privateframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = privateframe.cpp; sourceTree = ""; }; + 9529F17315DBFD59000303A6 /* privateframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = privateframe.h; sourceTree = ""; }; + 9529F17415DBFD59000303A6 /* relativevolumeframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = relativevolumeframe.cpp; sourceTree = ""; }; + 9529F17515DBFD59000303A6 /* relativevolumeframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = relativevolumeframe.h; sourceTree = ""; }; + 9529F17615DBFD59000303A6 /* textidentificationframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = textidentificationframe.cpp; sourceTree = ""; }; + 9529F17715DBFD59000303A6 /* textidentificationframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = textidentificationframe.h; sourceTree = ""; }; + 9529F17815DBFD59000303A6 /* uniquefileidentifierframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = uniquefileidentifierframe.cpp; sourceTree = ""; }; + 9529F17915DBFD59000303A6 /* uniquefileidentifierframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uniquefileidentifierframe.h; sourceTree = ""; }; + 9529F17A15DBFD59000303A6 /* unknownframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unknownframe.cpp; sourceTree = ""; }; + 9529F17B15DBFD59000303A6 /* unknownframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unknownframe.h; sourceTree = ""; }; + 9529F17C15DBFD59000303A6 /* unsynchronizedlyricsframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unsynchronizedlyricsframe.cpp; sourceTree = ""; }; + 9529F17D15DBFD59000303A6 /* unsynchronizedlyricsframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unsynchronizedlyricsframe.h; sourceTree = ""; }; + 9529F17E15DBFD59000303A6 /* urllinkframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = urllinkframe.cpp; sourceTree = ""; }; + 9529F17F15DBFD59000303A6 /* urllinkframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = urllinkframe.h; sourceTree = ""; }; + 9529F18015DBFD59000303A6 /* id3v2.2.0.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = id3v2.2.0.txt; sourceTree = ""; }; + 9529F18115DBFD59000303A6 /* id3v2.3.0.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = id3v2.3.0.txt; sourceTree = ""; }; + 9529F18215DBFD59000303A6 /* id3v2.4.0-frames.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "id3v2.4.0-frames.txt"; sourceTree = ""; }; + 9529F18315DBFD59000303A6 /* id3v2.4.0-structure.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "id3v2.4.0-structure.txt"; sourceTree = ""; }; + 9529F18415DBFD59000303A6 /* id3v2extendedheader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = id3v2extendedheader.cpp; sourceTree = ""; }; + 9529F18515DBFD59000303A6 /* id3v2extendedheader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3v2extendedheader.h; sourceTree = ""; }; + 9529F18615DBFD59000303A6 /* id3v2footer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = id3v2footer.cpp; sourceTree = ""; }; + 9529F18715DBFD59000303A6 /* id3v2footer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3v2footer.h; sourceTree = ""; }; + 9529F18815DBFD59000303A6 /* id3v2frame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = id3v2frame.cpp; sourceTree = ""; }; + 9529F18915DBFD59000303A6 /* id3v2frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3v2frame.h; sourceTree = ""; }; + 9529F18A15DBFD59000303A6 /* id3v2framefactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = id3v2framefactory.cpp; sourceTree = ""; }; + 9529F18B15DBFD59000303A6 /* id3v2framefactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3v2framefactory.h; sourceTree = ""; }; + 9529F18C15DBFD59000303A6 /* id3v2header.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = id3v2header.cpp; sourceTree = ""; }; + 9529F18D15DBFD59000303A6 /* id3v2header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3v2header.h; sourceTree = ""; }; + 9529F18E15DBFD59000303A6 /* id3v2synchdata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = id3v2synchdata.cpp; sourceTree = ""; }; + 9529F18F15DBFD59000303A6 /* id3v2synchdata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3v2synchdata.h; sourceTree = ""; }; + 9529F19015DBFD59000303A6 /* id3v2tag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = id3v2tag.cpp; sourceTree = ""; }; + 9529F19115DBFD59000303A6 /* id3v2tag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3v2tag.h; sourceTree = ""; }; + 9529F19215DBFD59000303A6 /* mpegfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mpegfile.cpp; sourceTree = ""; }; + 9529F19315DBFD59000303A6 /* mpegfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpegfile.h; sourceTree = ""; }; + 9529F19415DBFD59000303A6 /* mpegheader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mpegheader.cpp; sourceTree = ""; }; + 9529F19515DBFD59000303A6 /* mpegheader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpegheader.h; sourceTree = ""; }; + 9529F19615DBFD59000303A6 /* mpegproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mpegproperties.cpp; sourceTree = ""; }; + 9529F19715DBFD59000303A6 /* mpegproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpegproperties.h; sourceTree = ""; }; + 9529F19815DBFD59000303A6 /* xingheader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xingheader.cpp; sourceTree = ""; }; + 9529F19915DBFD59000303A6 /* xingheader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xingheader.h; sourceTree = ""; }; + 9529F19C15DBFD59000303A6 /* oggflacfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = oggflacfile.cpp; sourceTree = ""; }; + 9529F19D15DBFD59000303A6 /* oggflacfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = oggflacfile.h; sourceTree = ""; }; + 9529F19E15DBFD59000303A6 /* oggfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = oggfile.cpp; sourceTree = ""; }; + 9529F19F15DBFD59000303A6 /* oggfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = oggfile.h; sourceTree = ""; }; + 9529F1A015DBFD59000303A6 /* oggpage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = oggpage.cpp; sourceTree = ""; }; + 9529F1A115DBFD59000303A6 /* oggpage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = oggpage.h; sourceTree = ""; }; + 9529F1A215DBFD59000303A6 /* oggpageheader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = oggpageheader.cpp; sourceTree = ""; }; + 9529F1A315DBFD59000303A6 /* oggpageheader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = oggpageheader.h; sourceTree = ""; }; + 9529F1A515DBFD59000303A6 /* speexfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = speexfile.cpp; sourceTree = ""; }; + 9529F1A615DBFD59000303A6 /* speexfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = speexfile.h; sourceTree = ""; }; + 9529F1A715DBFD59000303A6 /* speexproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = speexproperties.cpp; sourceTree = ""; }; + 9529F1A815DBFD59000303A6 /* speexproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = speexproperties.h; sourceTree = ""; }; + 9529F1AA15DBFD59000303A6 /* vorbisfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vorbisfile.cpp; sourceTree = ""; }; + 9529F1AB15DBFD59000303A6 /* vorbisfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vorbisfile.h; sourceTree = ""; }; + 9529F1AC15DBFD59000303A6 /* vorbisproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vorbisproperties.cpp; sourceTree = ""; }; + 9529F1AD15DBFD59000303A6 /* vorbisproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vorbisproperties.h; sourceTree = ""; }; + 9529F1AE15DBFD59000303A6 /* xiphcomment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xiphcomment.cpp; sourceTree = ""; }; + 9529F1AF15DBFD59000303A6 /* xiphcomment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xiphcomment.h; sourceTree = ""; }; + 9529F1B215DBFD59000303A6 /* aifffile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = aifffile.cpp; sourceTree = ""; }; + 9529F1B315DBFD59000303A6 /* aifffile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aifffile.h; sourceTree = ""; }; + 9529F1B415DBFD59000303A6 /* aiffproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = aiffproperties.cpp; sourceTree = ""; }; + 9529F1B515DBFD59000303A6 /* aiffproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiffproperties.h; sourceTree = ""; }; + 9529F1B615DBFD59000303A6 /* rifffile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rifffile.cpp; sourceTree = ""; }; + 9529F1B715DBFD59000303A6 /* rifffile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rifffile.h; sourceTree = ""; }; + 9529F1B915DBFD59000303A6 /* wavfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wavfile.cpp; sourceTree = ""; }; + 9529F1BA15DBFD59000303A6 /* wavfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wavfile.h; sourceTree = ""; }; + 9529F1BB15DBFD59000303A6 /* wavproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wavproperties.cpp; sourceTree = ""; }; + 9529F1BC15DBFD59000303A6 /* wavproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wavproperties.h; sourceTree = ""; }; + 9529F1BE15DBFD59000303A6 /* s3mfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = s3mfile.cpp; sourceTree = ""; }; + 9529F1BF15DBFD59000303A6 /* s3mfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = s3mfile.h; sourceTree = ""; }; + 9529F1C015DBFD59000303A6 /* s3mproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = s3mproperties.cpp; sourceTree = ""; }; + 9529F1C115DBFD59000303A6 /* s3mproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = s3mproperties.h; sourceTree = ""; }; + 9529F1C215DBFD59000303A6 /* tag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tag.cpp; path = "../../taglib-src/taglib/tag.cpp"; sourceTree = ""; }; + 9529F1C315DBFD59000303A6 /* tag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tag.h; path = "../../taglib-src/taglib/tag.h"; sourceTree = ""; }; + 9529F1C515DBFD59000303A6 /* taglib_export.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = taglib_export.h; path = "../../taglib-src/taglib/taglib_export.h"; sourceTree = ""; }; + 9529F1C615DBFD59000303A6 /* tagunion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tagunion.cpp; path = "../../taglib-src/taglib/tagunion.cpp"; sourceTree = ""; }; + 9529F1C715DBFD59000303A6 /* tagunion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tagunion.h; path = "../../taglib-src/taglib/tagunion.h"; sourceTree = ""; }; + 9529F1C915DBFD59000303A6 /* taglib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = taglib.h; sourceTree = ""; }; + 9529F1CA15DBFD59000303A6 /* tbytevector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tbytevector.cpp; sourceTree = ""; }; + 9529F1CB15DBFD59000303A6 /* tbytevector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tbytevector.h; sourceTree = ""; }; + 9529F1CC15DBFD59000303A6 /* tbytevectorlist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tbytevectorlist.cpp; sourceTree = ""; }; + 9529F1CD15DBFD59000303A6 /* tbytevectorlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tbytevectorlist.h; sourceTree = ""; }; + 9529F1CE15DBFD59000303A6 /* tbytevectorstream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tbytevectorstream.cpp; sourceTree = ""; }; + 9529F1CF15DBFD59000303A6 /* tbytevectorstream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tbytevectorstream.h; sourceTree = ""; }; + 9529F1D015DBFD59000303A6 /* tdebug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tdebug.cpp; sourceTree = ""; }; + 9529F1D115DBFD59000303A6 /* tdebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tdebug.h; sourceTree = ""; }; + 9529F1D215DBFD59000303A6 /* tfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tfile.cpp; sourceTree = ""; }; + 9529F1D315DBFD59000303A6 /* tfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tfile.h; sourceTree = ""; }; + 9529F1D415DBFD59000303A6 /* tfilestream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tfilestream.cpp; sourceTree = ""; }; + 9529F1D515DBFD59000303A6 /* tfilestream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tfilestream.h; sourceTree = ""; }; + 9529F1D615DBFD59000303A6 /* tiostream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tiostream.cpp; sourceTree = ""; }; + 9529F1D715DBFD59000303A6 /* tiostream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tiostream.h; sourceTree = ""; }; + 9529F1D815DBFD59000303A6 /* tlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tlist.h; sourceTree = ""; }; + 9529F1D915DBFD59000303A6 /* tlist.tcc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tlist.tcc; sourceTree = ""; }; + 9529F1DA15DBFD59000303A6 /* tmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tmap.h; sourceTree = ""; }; + 9529F1DB15DBFD59000303A6 /* tmap.tcc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tmap.tcc; sourceTree = ""; }; + 9529F1DC15DBFD59000303A6 /* tpropertymap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tpropertymap.cpp; sourceTree = ""; }; + 9529F1DD15DBFD59000303A6 /* tpropertymap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tpropertymap.h; sourceTree = ""; }; + 9529F1DE15DBFD59000303A6 /* tstring.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tstring.cpp; sourceTree = ""; }; + 9529F1DF15DBFD59000303A6 /* tstring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tstring.h; sourceTree = ""; }; + 9529F1E015DBFD59000303A6 /* tstringlist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tstringlist.cpp; sourceTree = ""; }; + 9529F1E115DBFD59000303A6 /* tstringlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tstringlist.h; sourceTree = ""; }; + 9529F1E215DBFD59000303A6 /* unicode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unicode.cpp; sourceTree = ""; }; + 9529F1E315DBFD59000303A6 /* unicode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unicode.h; sourceTree = ""; }; + 9529F1E515DBFD59000303A6 /* trueaudiofile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = trueaudiofile.cpp; sourceTree = ""; }; + 9529F1E615DBFD59000303A6 /* trueaudiofile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = trueaudiofile.h; sourceTree = ""; }; + 9529F1E715DBFD59000303A6 /* trueaudioproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = trueaudioproperties.cpp; sourceTree = ""; }; + 9529F1E815DBFD59000303A6 /* trueaudioproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = trueaudioproperties.h; sourceTree = ""; }; + 9529F1EA15DBFD59000303A6 /* wavpackfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wavpackfile.cpp; sourceTree = ""; }; + 9529F1EB15DBFD59000303A6 /* wavpackfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wavpackfile.h; sourceTree = ""; }; + 9529F1EC15DBFD59000303A6 /* wavpackproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wavpackproperties.cpp; sourceTree = ""; }; + 9529F1ED15DBFD59000303A6 /* wavpackproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wavpackproperties.h; sourceTree = ""; }; + 9529F1EF15DBFD59000303A6 /* xmfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xmfile.cpp; sourceTree = ""; }; + 9529F1F015DBFD59000303A6 /* xmfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xmfile.h; sourceTree = ""; }; + 9529F1F115DBFD59000303A6 /* xmproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xmproperties.cpp; sourceTree = ""; }; + 9529F1F215DBFD59000303A6 /* xmproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xmproperties.h; sourceTree = ""; }; + 9529F2C515DBFF0A000303A6 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; + 9529F2C615DBFF0A000303A6 /* taglib_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = taglib_config.h; sourceTree = ""; }; + 9529F2CD15DC0097000303A6 /* libTagLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTagLib.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 9529F2CF15DC0097000303A6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 9529F10415DBFC95000303A6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9529F2CA15DC0097000303A6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9529F0FB15DBFC95000303A6 = { + isa = PBXGroup; + children = ( + 9529F10C15DBFC95000303A6 /* TagLib */, + 9529F2CE15DC0097000303A6 /* Frameworks */, + 9529F10B15DBFC95000303A6 /* Products */, + ); + sourceTree = ""; + }; + 9529F10B15DBFC95000303A6 /* Products */ = { + isa = PBXGroup; + children = ( + 9529F10A15DBFC95000303A6 /* TagLib.framework */, + 9529F2CD15DC0097000303A6 /* libTagLib.a */, + ); + name = Products; + sourceTree = ""; + }; + 9529F10C15DBFC95000303A6 /* TagLib */ = { + isa = PBXGroup; + children = ( + 9529F2C515DBFF0A000303A6 /* config.h */, + 9529F2C615DBFF0A000303A6 /* taglib_config.h */, + 9529F11A15DBFD59000303A6 /* ape */, + 9529F11C15DBFD59000303A6 /* apefile.cpp */, + 9529F11D15DBFD59000303A6 /* apefile.h */, + 9529F11E15DBFD59000303A6 /* apefooter.cpp */, + 9529F11F15DBFD59000303A6 /* apefooter.h */, + 9529F12015DBFD59000303A6 /* apeitem.cpp */, + 9529F12115DBFD59000303A6 /* apeitem.h */, + 9529F12215DBFD59000303A6 /* apeproperties.cpp */, + 9529F12315DBFD59000303A6 /* apeproperties.h */, + 9529F12415DBFD59000303A6 /* apetag.cpp */, + 9529F12515DBFD59000303A6 /* apetag.h */, + 9529F12615DBFD59000303A6 /* asf */, + 9529F13115DBFD59000303A6 /* audioproperties.cpp */, + 9529F13215DBFD59000303A6 /* audioproperties.h */, + 9529F13415DBFD59000303A6 /* fileref.cpp */, + 9529F13515DBFD59000303A6 /* fileref.h */, + 9529F13615DBFD59000303A6 /* flac */, + 9529F14115DBFD59000303A6 /* it */, + 9529F14615DBFD59000303A6 /* mod */, + 9529F15015DBFD59000303A6 /* mp4 */, + 9529F15D15DBFD59000303A6 /* mpc */, + 9529F16215DBFD59000303A6 /* mpeg */, + 9529F19A15DBFD59000303A6 /* ogg */, + 9529F1B015DBFD59000303A6 /* riff */, + 9529F1BD15DBFD59000303A6 /* s3m */, + 9529F1C215DBFD59000303A6 /* tag.cpp */, + 9529F1C315DBFD59000303A6 /* tag.h */, + 9529F1C515DBFD59000303A6 /* taglib_export.h */, + 9529F1C615DBFD59000303A6 /* tagunion.cpp */, + 9529F1C715DBFD59000303A6 /* tagunion.h */, + 9529F1C815DBFD59000303A6 /* toolkit */, + 9529F1E415DBFD59000303A6 /* trueaudio */, + 9529F1E915DBFD59000303A6 /* wavpack */, + 9529F1EE15DBFD59000303A6 /* xm */, + 9529F10D15DBFC95000303A6 /* Supporting Files */, + ); + path = TagLib; + sourceTree = ""; + }; + 9529F10D15DBFC95000303A6 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 9529F10E15DBFC95000303A6 /* TagLib-Info.plist */, + 9529F11215DBFC95000303A6 /* TagLib-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 9529F11A15DBFD59000303A6 /* ape */ = { + isa = PBXGroup; + children = ( + ); + name = ape; + path = "../../taglib-src/taglib/ape"; + sourceTree = ""; + }; + 9529F12615DBFD59000303A6 /* asf */ = { + isa = PBXGroup; + children = ( + 9529F12715DBFD59000303A6 /* asfattribute.cpp */, + 9529F12815DBFD59000303A6 /* asfattribute.h */, + 9529F12915DBFD59000303A6 /* asffile.cpp */, + 9529F12A15DBFD59000303A6 /* asffile.h */, + 9529F12B15DBFD59000303A6 /* asfpicture.cpp */, + 9529F12C15DBFD59000303A6 /* asfpicture.h */, + 9529F12D15DBFD59000303A6 /* asfproperties.cpp */, + 9529F12E15DBFD59000303A6 /* asfproperties.h */, + 9529F12F15DBFD59000303A6 /* asftag.cpp */, + 9529F13015DBFD59000303A6 /* asftag.h */, + ); + name = asf; + path = "../../taglib-src/taglib/asf"; + sourceTree = ""; + }; + 9529F13615DBFD59000303A6 /* flac */ = { + isa = PBXGroup; + children = ( + 9529F13715DBFD59000303A6 /* flacfile.cpp */, + 9529F13815DBFD59000303A6 /* flacfile.h */, + 9529F13915DBFD59000303A6 /* flacmetadatablock.cpp */, + 9529F13A15DBFD59000303A6 /* flacmetadatablock.h */, + 9529F13B15DBFD59000303A6 /* flacpicture.cpp */, + 9529F13C15DBFD59000303A6 /* flacpicture.h */, + 9529F13D15DBFD59000303A6 /* flacproperties.cpp */, + 9529F13E15DBFD59000303A6 /* flacproperties.h */, + 9529F13F15DBFD59000303A6 /* flacunknownmetadatablock.cpp */, + 9529F14015DBFD59000303A6 /* flacunknownmetadatablock.h */, + ); + name = flac; + path = "../../taglib-src/taglib/flac"; + sourceTree = ""; + }; + 9529F14115DBFD59000303A6 /* it */ = { + isa = PBXGroup; + children = ( + 9529F14215DBFD59000303A6 /* itfile.cpp */, + 9529F14315DBFD59000303A6 /* itfile.h */, + 9529F14415DBFD59000303A6 /* itproperties.cpp */, + 9529F14515DBFD59000303A6 /* itproperties.h */, + ); + name = it; + path = "../../taglib-src/taglib/it"; + sourceTree = ""; + }; + 9529F14615DBFD59000303A6 /* mod */ = { + isa = PBXGroup; + children = ( + 9529F14715DBFD59000303A6 /* modfile.cpp */, + 9529F14815DBFD59000303A6 /* modfile.h */, + 9529F14915DBFD59000303A6 /* modfilebase.cpp */, + 9529F14A15DBFD59000303A6 /* modfilebase.h */, + 9529F14B15DBFD59000303A6 /* modfileprivate.h */, + 9529F14C15DBFD59000303A6 /* modproperties.cpp */, + 9529F14D15DBFD59000303A6 /* modproperties.h */, + 9529F14E15DBFD59000303A6 /* modtag.cpp */, + 9529F14F15DBFD59000303A6 /* modtag.h */, + ); + name = mod; + path = "../../taglib-src/taglib/mod"; + sourceTree = ""; + }; + 9529F15015DBFD59000303A6 /* mp4 */ = { + isa = PBXGroup; + children = ( + 9529F15115DBFD59000303A6 /* mp4atom.cpp */, + 9529F15215DBFD59000303A6 /* mp4atom.h */, + 9529F15315DBFD59000303A6 /* mp4coverart.cpp */, + 9529F15415DBFD59000303A6 /* mp4coverart.h */, + 9529F15515DBFD59000303A6 /* mp4file.cpp */, + 9529F15615DBFD59000303A6 /* mp4file.h */, + 9529F15715DBFD59000303A6 /* mp4item.cpp */, + 9529F15815DBFD59000303A6 /* mp4item.h */, + 9529F15915DBFD59000303A6 /* mp4properties.cpp */, + 9529F15A15DBFD59000303A6 /* mp4properties.h */, + 9529F15B15DBFD59000303A6 /* mp4tag.cpp */, + 9529F15C15DBFD59000303A6 /* mp4tag.h */, + ); + name = mp4; + path = "../../taglib-src/taglib/mp4"; + sourceTree = ""; + }; + 9529F15D15DBFD59000303A6 /* mpc */ = { + isa = PBXGroup; + children = ( + 9529F15E15DBFD59000303A6 /* mpcfile.cpp */, + 9529F15F15DBFD59000303A6 /* mpcfile.h */, + 9529F16015DBFD59000303A6 /* mpcproperties.cpp */, + 9529F16115DBFD59000303A6 /* mpcproperties.h */, + ); + name = mpc; + path = "../../taglib-src/taglib/mpc"; + sourceTree = ""; + }; + 9529F16215DBFD59000303A6 /* mpeg */ = { + isa = PBXGroup; + children = ( + 9529F16315DBFD59000303A6 /* id3v1 */, + 9529F16815DBFD59000303A6 /* id3v2 */, + 9529F19215DBFD59000303A6 /* mpegfile.cpp */, + 9529F19315DBFD59000303A6 /* mpegfile.h */, + 9529F19415DBFD59000303A6 /* mpegheader.cpp */, + 9529F19515DBFD59000303A6 /* mpegheader.h */, + 9529F19615DBFD59000303A6 /* mpegproperties.cpp */, + 9529F19715DBFD59000303A6 /* mpegproperties.h */, + 9529F19815DBFD59000303A6 /* xingheader.cpp */, + 9529F19915DBFD59000303A6 /* xingheader.h */, + ); + name = mpeg; + path = "../../taglib-src/taglib/mpeg"; + sourceTree = ""; + }; + 9529F16315DBFD59000303A6 /* id3v1 */ = { + isa = PBXGroup; + children = ( + 9529F16415DBFD59000303A6 /* id3v1genres.cpp */, + 9529F16515DBFD59000303A6 /* id3v1genres.h */, + 9529F16615DBFD59000303A6 /* id3v1tag.cpp */, + 9529F16715DBFD59000303A6 /* id3v1tag.h */, + ); + path = id3v1; + sourceTree = ""; + }; + 9529F16815DBFD59000303A6 /* id3v2 */ = { + isa = PBXGroup; + children = ( + 9529F16915DBFD59000303A6 /* frames */, + 9529F18015DBFD59000303A6 /* id3v2.2.0.txt */, + 9529F18115DBFD59000303A6 /* id3v2.3.0.txt */, + 9529F18215DBFD59000303A6 /* id3v2.4.0-frames.txt */, + 9529F18315DBFD59000303A6 /* id3v2.4.0-structure.txt */, + 9529F18415DBFD59000303A6 /* id3v2extendedheader.cpp */, + 9529F18515DBFD59000303A6 /* id3v2extendedheader.h */, + 9529F18615DBFD59000303A6 /* id3v2footer.cpp */, + 9529F18715DBFD59000303A6 /* id3v2footer.h */, + 9529F18815DBFD59000303A6 /* id3v2frame.cpp */, + 9529F18915DBFD59000303A6 /* id3v2frame.h */, + 9529F18A15DBFD59000303A6 /* id3v2framefactory.cpp */, + 9529F18B15DBFD59000303A6 /* id3v2framefactory.h */, + 9529F18C15DBFD59000303A6 /* id3v2header.cpp */, + 9529F18D15DBFD59000303A6 /* id3v2header.h */, + 9529F18E15DBFD59000303A6 /* id3v2synchdata.cpp */, + 9529F18F15DBFD59000303A6 /* id3v2synchdata.h */, + 9529F19015DBFD59000303A6 /* id3v2tag.cpp */, + 9529F19115DBFD59000303A6 /* id3v2tag.h */, + ); + path = id3v2; + sourceTree = ""; + }; + 9529F16915DBFD59000303A6 /* frames */ = { + isa = PBXGroup; + children = ( + 9529F16A15DBFD59000303A6 /* attachedpictureframe.cpp */, + 9529F16B15DBFD59000303A6 /* attachedpictureframe.h */, + 9529F16C15DBFD59000303A6 /* commentsframe.cpp */, + 9529F16D15DBFD59000303A6 /* commentsframe.h */, + 9529F16E15DBFD59000303A6 /* generalencapsulatedobjectframe.cpp */, + 9529F16F15DBFD59000303A6 /* generalencapsulatedobjectframe.h */, + 9529F17015DBFD59000303A6 /* popularimeterframe.cpp */, + 9529F17115DBFD59000303A6 /* popularimeterframe.h */, + 9529F17215DBFD59000303A6 /* privateframe.cpp */, + 9529F17315DBFD59000303A6 /* privateframe.h */, + 9529F17415DBFD59000303A6 /* relativevolumeframe.cpp */, + 9529F17515DBFD59000303A6 /* relativevolumeframe.h */, + 9529F17615DBFD59000303A6 /* textidentificationframe.cpp */, + 9529F17715DBFD59000303A6 /* textidentificationframe.h */, + 9529F17815DBFD59000303A6 /* uniquefileidentifierframe.cpp */, + 9529F17915DBFD59000303A6 /* uniquefileidentifierframe.h */, + 9529F17A15DBFD59000303A6 /* unknownframe.cpp */, + 9529F17B15DBFD59000303A6 /* unknownframe.h */, + 9529F17C15DBFD59000303A6 /* unsynchronizedlyricsframe.cpp */, + 9529F17D15DBFD59000303A6 /* unsynchronizedlyricsframe.h */, + 9529F17E15DBFD59000303A6 /* urllinkframe.cpp */, + 9529F17F15DBFD59000303A6 /* urllinkframe.h */, + ); + path = frames; + sourceTree = ""; + }; + 9529F19A15DBFD59000303A6 /* ogg */ = { + isa = PBXGroup; + children = ( + 9529F19B15DBFD59000303A6 /* flac */, + 9529F19E15DBFD59000303A6 /* oggfile.cpp */, + 9529F19F15DBFD59000303A6 /* oggfile.h */, + 9529F1A015DBFD59000303A6 /* oggpage.cpp */, + 9529F1A115DBFD59000303A6 /* oggpage.h */, + 9529F1A215DBFD59000303A6 /* oggpageheader.cpp */, + 9529F1A315DBFD59000303A6 /* oggpageheader.h */, + 9529F1A415DBFD59000303A6 /* speex */, + 9529F1A915DBFD59000303A6 /* vorbis */, + 9529F1AE15DBFD59000303A6 /* xiphcomment.cpp */, + 9529F1AF15DBFD59000303A6 /* xiphcomment.h */, + ); + name = ogg; + path = "../../taglib-src/taglib/ogg"; + sourceTree = ""; + }; + 9529F19B15DBFD59000303A6 /* flac */ = { + isa = PBXGroup; + children = ( + 9529F19C15DBFD59000303A6 /* oggflacfile.cpp */, + 9529F19D15DBFD59000303A6 /* oggflacfile.h */, + ); + path = flac; + sourceTree = ""; + }; + 9529F1A415DBFD59000303A6 /* speex */ = { + isa = PBXGroup; + children = ( + 9529F1A515DBFD59000303A6 /* speexfile.cpp */, + 9529F1A615DBFD59000303A6 /* speexfile.h */, + 9529F1A715DBFD59000303A6 /* speexproperties.cpp */, + 9529F1A815DBFD59000303A6 /* speexproperties.h */, + ); + path = speex; + sourceTree = ""; + }; + 9529F1A915DBFD59000303A6 /* vorbis */ = { + isa = PBXGroup; + children = ( + 9529F1AA15DBFD59000303A6 /* vorbisfile.cpp */, + 9529F1AB15DBFD59000303A6 /* vorbisfile.h */, + 9529F1AC15DBFD59000303A6 /* vorbisproperties.cpp */, + 9529F1AD15DBFD59000303A6 /* vorbisproperties.h */, + ); + path = vorbis; + sourceTree = ""; + }; + 9529F1B015DBFD59000303A6 /* riff */ = { + isa = PBXGroup; + children = ( + 9529F1B115DBFD59000303A6 /* aiff */, + 9529F1B615DBFD59000303A6 /* rifffile.cpp */, + 9529F1B715DBFD59000303A6 /* rifffile.h */, + 9529F1B815DBFD59000303A6 /* wav */, + ); + name = riff; + path = "../../taglib-src/taglib/riff"; + sourceTree = ""; + }; + 9529F1B115DBFD59000303A6 /* aiff */ = { + isa = PBXGroup; + children = ( + 9529F1B215DBFD59000303A6 /* aifffile.cpp */, + 9529F1B315DBFD59000303A6 /* aifffile.h */, + 9529F1B415DBFD59000303A6 /* aiffproperties.cpp */, + 9529F1B515DBFD59000303A6 /* aiffproperties.h */, + ); + path = aiff; + sourceTree = ""; + }; + 9529F1B815DBFD59000303A6 /* wav */ = { + isa = PBXGroup; + children = ( + 9529F1B915DBFD59000303A6 /* wavfile.cpp */, + 9529F1BA15DBFD59000303A6 /* wavfile.h */, + 9529F1BB15DBFD59000303A6 /* wavproperties.cpp */, + 9529F1BC15DBFD59000303A6 /* wavproperties.h */, + ); + path = wav; + sourceTree = ""; + }; + 9529F1BD15DBFD59000303A6 /* s3m */ = { + isa = PBXGroup; + children = ( + 9529F1BE15DBFD59000303A6 /* s3mfile.cpp */, + 9529F1BF15DBFD59000303A6 /* s3mfile.h */, + 9529F1C015DBFD59000303A6 /* s3mproperties.cpp */, + 9529F1C115DBFD59000303A6 /* s3mproperties.h */, + ); + name = s3m; + path = "../../taglib-src/taglib/s3m"; + sourceTree = ""; + }; + 9529F1C815DBFD59000303A6 /* toolkit */ = { + isa = PBXGroup; + children = ( + 9529F1C915DBFD59000303A6 /* taglib.h */, + 9529F1CA15DBFD59000303A6 /* tbytevector.cpp */, + 9529F1CB15DBFD59000303A6 /* tbytevector.h */, + 9529F1CC15DBFD59000303A6 /* tbytevectorlist.cpp */, + 9529F1CD15DBFD59000303A6 /* tbytevectorlist.h */, + 9529F1CE15DBFD59000303A6 /* tbytevectorstream.cpp */, + 9529F1CF15DBFD59000303A6 /* tbytevectorstream.h */, + 9529F1D015DBFD59000303A6 /* tdebug.cpp */, + 9529F1D115DBFD59000303A6 /* tdebug.h */, + 9529F1D215DBFD59000303A6 /* tfile.cpp */, + 9529F1D315DBFD59000303A6 /* tfile.h */, + 9529F1D415DBFD59000303A6 /* tfilestream.cpp */, + 9529F1D515DBFD59000303A6 /* tfilestream.h */, + 9529F1D615DBFD59000303A6 /* tiostream.cpp */, + 9529F1D715DBFD59000303A6 /* tiostream.h */, + 9529F1D815DBFD59000303A6 /* tlist.h */, + 9529F1D915DBFD59000303A6 /* tlist.tcc */, + 9529F1DA15DBFD59000303A6 /* tmap.h */, + 9529F1DB15DBFD59000303A6 /* tmap.tcc */, + 9529F1DC15DBFD59000303A6 /* tpropertymap.cpp */, + 9529F1DD15DBFD59000303A6 /* tpropertymap.h */, + 9529F1DE15DBFD59000303A6 /* tstring.cpp */, + 9529F1DF15DBFD59000303A6 /* tstring.h */, + 9529F1E015DBFD59000303A6 /* tstringlist.cpp */, + 9529F1E115DBFD59000303A6 /* tstringlist.h */, + 9529F1E215DBFD59000303A6 /* unicode.cpp */, + 9529F1E315DBFD59000303A6 /* unicode.h */, + ); + name = toolkit; + path = "../../taglib-src/taglib/toolkit"; + sourceTree = ""; + }; + 9529F1E415DBFD59000303A6 /* trueaudio */ = { + isa = PBXGroup; + children = ( + 9529F1E515DBFD59000303A6 /* trueaudiofile.cpp */, + 9529F1E615DBFD59000303A6 /* trueaudiofile.h */, + 9529F1E715DBFD59000303A6 /* trueaudioproperties.cpp */, + 9529F1E815DBFD59000303A6 /* trueaudioproperties.h */, + ); + name = trueaudio; + path = "../../taglib-src/taglib/trueaudio"; + sourceTree = ""; + }; + 9529F1E915DBFD59000303A6 /* wavpack */ = { + isa = PBXGroup; + children = ( + 9529F1EA15DBFD59000303A6 /* wavpackfile.cpp */, + 9529F1EB15DBFD59000303A6 /* wavpackfile.h */, + 9529F1EC15DBFD59000303A6 /* wavpackproperties.cpp */, + 9529F1ED15DBFD59000303A6 /* wavpackproperties.h */, + ); + name = wavpack; + path = "../../taglib-src/taglib/wavpack"; + sourceTree = ""; + }; + 9529F1EE15DBFD59000303A6 /* xm */ = { + isa = PBXGroup; + children = ( + 9529F1EF15DBFD59000303A6 /* xmfile.cpp */, + 9529F1F015DBFD59000303A6 /* xmfile.h */, + 9529F1F115DBFD59000303A6 /* xmproperties.cpp */, + 9529F1F215DBFD59000303A6 /* xmproperties.h */, + ); + name = xm; + path = "../../taglib-src/taglib/xm"; + sourceTree = ""; + }; + 9529F2CE15DC0097000303A6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 9529F2CF15DC0097000303A6 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 9529F10515DBFC95000303A6 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 9529F1F515DBFD59000303A6 /* apefile.h in Headers */, + 9529F1F715DBFD59000303A6 /* apefooter.h in Headers */, + 9529F1F915DBFD59000303A6 /* apeitem.h in Headers */, + 9529F1FB15DBFD59000303A6 /* apeproperties.h in Headers */, + 9529F1FD15DBFD59000303A6 /* apetag.h in Headers */, + 9529F1FF15DBFD59000303A6 /* asfattribute.h in Headers */, + 9529F20115DBFD59000303A6 /* asffile.h in Headers */, + 9529F20315DBFD59000303A6 /* asfpicture.h in Headers */, + 9529F20515DBFD59000303A6 /* asfproperties.h in Headers */, + 9529F20715DBFD59000303A6 /* asftag.h in Headers */, + 9529F20915DBFD59000303A6 /* audioproperties.h in Headers */, + 9529F20C15DBFD59000303A6 /* fileref.h in Headers */, + 9529F20E15DBFD59000303A6 /* flacfile.h in Headers */, + 9529F21015DBFD59000303A6 /* flacmetadatablock.h in Headers */, + 9529F21215DBFD59000303A6 /* flacpicture.h in Headers */, + 9529F21415DBFD59000303A6 /* flacproperties.h in Headers */, + 9529F21615DBFD59000303A6 /* flacunknownmetadatablock.h in Headers */, + 9529F22515DBFD59000303A6 /* mp4atom.h in Headers */, + 9529F22715DBFD59000303A6 /* mp4coverart.h in Headers */, + 9529F22915DBFD59000303A6 /* mp4file.h in Headers */, + 9529F22B15DBFD59000303A6 /* mp4item.h in Headers */, + 9529F22D15DBFD59000303A6 /* mp4properties.h in Headers */, + 9529F22F15DBFD59000303A6 /* mp4tag.h in Headers */, + 9529F23115DBFD59000303A6 /* mpcfile.h in Headers */, + 9529F23315DBFD59000303A6 /* mpcproperties.h in Headers */, + 9529F23515DBFD59000303A6 /* id3v1genres.h in Headers */, + 9529F23715DBFD59000303A6 /* id3v1tag.h in Headers */, + 9529F23915DBFD59000303A6 /* attachedpictureframe.h in Headers */, + 9529F23B15DBFD59000303A6 /* commentsframe.h in Headers */, + 9529F23D15DBFD59000303A6 /* generalencapsulatedobjectframe.h in Headers */, + 9529F23F15DBFD59000303A6 /* popularimeterframe.h in Headers */, + 9529F24115DBFD59000303A6 /* privateframe.h in Headers */, + 9529F24315DBFD59000303A6 /* relativevolumeframe.h in Headers */, + 9529F24515DBFD59000303A6 /* textidentificationframe.h in Headers */, + 9529F24715DBFD59000303A6 /* uniquefileidentifierframe.h in Headers */, + 9529F24915DBFD59000303A6 /* unknownframe.h in Headers */, + 9529F24B15DBFD59000303A6 /* unsynchronizedlyricsframe.h in Headers */, + 9529F24D15DBFD59000303A6 /* urllinkframe.h in Headers */, + 9529F25315DBFD59000303A6 /* id3v2extendedheader.h in Headers */, + 9529F25515DBFD59000303A6 /* id3v2footer.h in Headers */, + 9529F25715DBFD59000303A6 /* id3v2frame.h in Headers */, + 9529F25915DBFD59000303A6 /* id3v2framefactory.h in Headers */, + 9529F25B15DBFD59000303A6 /* id3v2header.h in Headers */, + 9529F25D15DBFD59000303A6 /* id3v2synchdata.h in Headers */, + 9529F25F15DBFD59000303A6 /* id3v2tag.h in Headers */, + 9529F26115DBFD59000303A6 /* mpegfile.h in Headers */, + 9529F26315DBFD59000303A6 /* mpegheader.h in Headers */, + 9529F26515DBFD59000303A6 /* mpegproperties.h in Headers */, + 9529F26715DBFD59000303A6 /* xingheader.h in Headers */, + 9529F26915DBFD59000303A6 /* oggflacfile.h in Headers */, + 9529F26B15DBFD59000303A6 /* oggfile.h in Headers */, + 9529F26D15DBFD59000303A6 /* oggpage.h in Headers */, + 9529F26F15DBFD59000303A6 /* oggpageheader.h in Headers */, + 9529F27115DBFD59000303A6 /* speexfile.h in Headers */, + 9529F27315DBFD59000303A6 /* speexproperties.h in Headers */, + 9529F27515DBFD59000303A6 /* vorbisfile.h in Headers */, + 9529F27715DBFD59000303A6 /* vorbisproperties.h in Headers */, + 9529F27915DBFD59000303A6 /* xiphcomment.h in Headers */, + 9529F27B15DBFD59000303A6 /* aifffile.h in Headers */, + 9529F27D15DBFD59000303A6 /* aiffproperties.h in Headers */, + 9529F27F15DBFD59000303A6 /* rifffile.h in Headers */, + 9529F28115DBFD59000303A6 /* wavfile.h in Headers */, + 9529F28315DBFD59000303A6 /* wavproperties.h in Headers */, + 9529F28915DBFD59000303A6 /* tag.h in Headers */, + 9529F28B15DBFD59000303A6 /* taglib_export.h in Headers */, + 9529F28D15DBFD59000303A6 /* tagunion.h in Headers */, + 9529F28E15DBFD59000303A6 /* taglib.h in Headers */, + 9529F29015DBFD59000303A6 /* tbytevector.h in Headers */, + 9529F29215DBFD59000303A6 /* tbytevectorlist.h in Headers */, + 9529F29415DBFD59000303A6 /* tbytevectorstream.h in Headers */, + 9529F29615DBFD59000303A6 /* tdebug.h in Headers */, + 9529F29815DBFD59000303A6 /* tfile.h in Headers */, + 9529F29A15DBFD59000303A6 /* tfilestream.h in Headers */, + 9529F29C15DBFD59000303A6 /* tiostream.h in Headers */, + 9529F29D15DBFD59000303A6 /* tlist.h in Headers */, + 9529F29F15DBFD59000303A6 /* tmap.h in Headers */, + 9529F2A215DBFD59000303A6 /* tpropertymap.h in Headers */, + 9529F2A415DBFD59000303A6 /* tstring.h in Headers */, + 9529F2A615DBFD59000303A6 /* tstringlist.h in Headers */, + 9529F2A815DBFD59000303A6 /* unicode.h in Headers */, + 9529F2AA15DBFD59000303A6 /* trueaudiofile.h in Headers */, + 9529F2AC15DBFD59000303A6 /* trueaudioproperties.h in Headers */, + 9529F2AE15DBFD59000303A6 /* wavpackfile.h in Headers */, + 9529F2B015DBFD59000303A6 /* wavpackproperties.h in Headers */, + 9529F2C215DBFE55000303A6 /* tlist.tcc in Headers */, + 9529F2C315DBFE55000303A6 /* tmap.tcc in Headers */, + 9529F2C815DBFF0A000303A6 /* taglib_config.h in Headers */, + 9529F2C415DBFE98000303A6 /* modproperties.h in Headers */, + 9529F2BE15DBFE39000303A6 /* s3mfile.h in Headers */, + 9529F2BF15DBFE39000303A6 /* s3mproperties.h in Headers */, + 9529F2C015DBFE39000303A6 /* xmfile.h in Headers */, + 9529F2C115DBFE39000303A6 /* xmproperties.h in Headers */, + 9529F2BA15DBFE2A000303A6 /* modfile.h in Headers */, + 9529F2BB15DBFE2A000303A6 /* modfilebase.h in Headers */, + 9529F2BC15DBFE2A000303A6 /* modfileprivate.h in Headers */, + 9529F2BD15DBFE2A000303A6 /* modtag.h in Headers */, + 9529F2B815DBFE1C000303A6 /* itfile.h in Headers */, + 9529F2B915DBFE1C000303A6 /* itproperties.h in Headers */, + 9529F2C715DBFF0A000303A6 /* config.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 9529F10915DBFC95000303A6 /* TagLib */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9529F11515DBFC95000303A6 /* Build configuration list for PBXNativeTarget "TagLib" */; + buildPhases = ( + 9529F10215DBFC95000303A6 /* ShellScript */, + 9529F10315DBFC95000303A6 /* Sources */, + 9529F10415DBFC95000303A6 /* Frameworks */, + 9529F10515DBFC95000303A6 /* Headers */, + 9529F10615DBFC95000303A6 /* Resources */, + 9529F10715DBFC95000303A6 /* ShellScript */, + 9529F10815DBFC95000303A6 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TagLib; + productName = TagLib; + productReference = 9529F10A15DBFC95000303A6 /* TagLib.framework */; + productType = "com.apple.product-type.bundle"; + }; + 9529F2CC15DC0097000303A6 /* libTagLib */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9529F2D815DC0097000303A6 /* Build configuration list for PBXNativeTarget "libTagLib" */; + buildPhases = ( + 9529F2C915DC0097000303A6 /* Sources */, + 9529F2CA15DC0097000303A6 /* Frameworks */, + 9529F2CB15DC0097000303A6 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = libTagLib; + productName = libTagLib; + productReference = 9529F2CD15DC0097000303A6 /* libTagLib.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 9529F0FD15DBFC95000303A6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0440; + }; + buildConfigurationList = 9529F10015DBFC95000303A6 /* Build configuration list for PBXProject "TagLib" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 9529F0FB15DBFC95000303A6; + productRefGroup = 9529F10B15DBFC95000303A6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 9529F10915DBFC95000303A6 /* TagLib */, + 9529F2CC15DC0097000303A6 /* libTagLib */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 9529F10615DBFC95000303A6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9529F24E15DBFD59000303A6 /* id3v2.2.0.txt in Resources */, + 9529F24F15DBFD59000303A6 /* id3v2.3.0.txt in Resources */, + 9529F25015DBFD59000303A6 /* id3v2.4.0-frames.txt in Resources */, + 9529F25115DBFD59000303A6 /* id3v2.4.0-structure.txt in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 9529F10215DBFC95000303A6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n\tUFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Clean other platform if needed\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n\techo \"Platform \\\"$UFW_SDK_PLATFORM\\\" was cleaned recently. Cleaning \\\"$UFW_OTHER_PLATFORM\\\" as well\"\n\techo xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\n\txcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\nfi\n\n\n# Make sure we are building from fresh binaries\n\nrm -rf \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\n"; + }; + 9529F10715DBFC95000303A6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "HEADERS_ROOT=$SRCROOT/$PRODUCT_NAME\nFRAMEWORK_HEADERS_DIR=\"$BUILT_PRODUCTS_DIR/$WRAPPER_NAME/Versions/$FRAMEWORK_VERSION/Headers\"\n\n## only header files expected at this point\nPUBLIC_HEADERS=$(find $FRAMEWORK_HEADERS_DIR/. -not -type d 2> /dev/null | sed -e \"s@.*/@@g\")\n\nFIND_OPTS=\"\"\nfor PUBLIC_HEADER in $PUBLIC_HEADERS; do\n if [ -n \"$FIND_OPTS\" ]; then\n FIND_OPTS=\"$FIND_OPTS -o\"\n fi\n FIND_OPTS=\"$FIND_OPTS -name '$PUBLIC_HEADER'\"\ndone\n\nif [ -n \"$FIND_OPTS\" ]; then\n for ORIG_HEADER in $(eval \"find $HEADERS_ROOT/. $FIND_OPTS\" 2> /dev/null | sed -e \"s@^$HEADERS_ROOT/./@@g\"); do\n PUBLIC_HEADER=$(basename $ORIG_HEADER)\n RELATIVE_PATH=$(dirname $ORIG_HEADER)\n if [ -e $FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER ]; then\n mkdir -p \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH\"\n mv \"$FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER\" \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH/$PUBLIC_HEADER\"\n fi\n done\nfi\n"; + }; + 9529F10815DBFC95000303A6 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\nexport UFW_MASTER_SCRIPT_RUNNING=1\n\n\n# Functions\n\n## List files in the specified directory, storing to the specified array.\n#\n# @param $1 The path to list\n# @param $2 The name of the array to fill\n#\n##\nlist_files ()\n{\n filelist=$(ls \"$1\")\n while read line\n do\n eval \"$2[\\${#$2[*]}]=\\\"\\$line\\\"\"\n done <<< \"$filelist\"\n}\n\n\n# Sanity check\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n echo \"Framework target \\\"${TARGET_NAME}\\\" had no source files to build from. Make sure your source files have the correct target membership\"\n exit 1\nfi\n\n\n# Gather information\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n UFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date.\n# We already checked the other platform in the prerun script.\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Make sure the other platform gets built\n\necho \"Build other platform\"\n\necho xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\n\n\n# Build the fat static library binary\n\necho \"Create universal static library\"\n\necho \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n\"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n\necho mv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nmv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\n\n\n# Build framework structure\n\necho \"Build symlinks\"\n\necho ln -sfh A \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\nln -sfh A \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\necho ln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\nln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\necho ln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\nln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\necho ln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\nln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\n\n\n# Link to binary for unit tests\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework\"\nln -sfh \"../${WRAPPER_NAME}/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework/.fake_fw_testing\"\n\n\n# Build embedded framework structure\n\necho \"Build Embedded Framework\"\n\necho rm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\necho mkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\nmkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\necho cp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\ncp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\n\ndeclare -a UFW_FILE_LIST\nlist_files \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\" UFW_FILE_LIST\nfor filename in \"${UFW_FILE_LIST[@]}\"\ndo\n if [[ \"${filename}\" != \"Info.plist\" ]] && [[ ! \"${filename}\" =~ .*\\.lproj$ ]]\n then\n echo ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n fi\ndone\n\n\n# Replace other platform's framework with a copy of this one (so that both have the same universal binary)\n\necho \"Copy from $UFW_SDK_PLATFORM to $UFW_OTHER_PLATFORM\"\n\necho rm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\nrm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\necho cp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\ncp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 9529F10315DBFC95000303A6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9529F1F415DBFD59000303A6 /* apefile.cpp in Sources */, + 9529F1F615DBFD59000303A6 /* apefooter.cpp in Sources */, + 9529F1F815DBFD59000303A6 /* apeitem.cpp in Sources */, + 9529F1FA15DBFD59000303A6 /* apeproperties.cpp in Sources */, + 9529F1FC15DBFD59000303A6 /* apetag.cpp in Sources */, + 9529F1FE15DBFD59000303A6 /* asfattribute.cpp in Sources */, + 9529F20015DBFD59000303A6 /* asffile.cpp in Sources */, + 9529F20215DBFD59000303A6 /* asfpicture.cpp in Sources */, + 9529F20415DBFD59000303A6 /* asfproperties.cpp in Sources */, + 9529F20615DBFD59000303A6 /* asftag.cpp in Sources */, + 9529F20815DBFD59000303A6 /* audioproperties.cpp in Sources */, + 9529F20B15DBFD59000303A6 /* fileref.cpp in Sources */, + 9529F20D15DBFD59000303A6 /* flacfile.cpp in Sources */, + 9529F20F15DBFD59000303A6 /* flacmetadatablock.cpp in Sources */, + 9529F21115DBFD59000303A6 /* flacpicture.cpp in Sources */, + 9529F21315DBFD59000303A6 /* flacproperties.cpp in Sources */, + 9529F21515DBFD59000303A6 /* flacunknownmetadatablock.cpp in Sources */, + 9529F21715DBFD59000303A6 /* itfile.cpp in Sources */, + 9529F21915DBFD59000303A6 /* itproperties.cpp in Sources */, + 9529F21B15DBFD59000303A6 /* modfile.cpp in Sources */, + 9529F21D15DBFD59000303A6 /* modfilebase.cpp in Sources */, + 9529F22015DBFD59000303A6 /* modproperties.cpp in Sources */, + 9529F22215DBFD59000303A6 /* modtag.cpp in Sources */, + 9529F22415DBFD59000303A6 /* mp4atom.cpp in Sources */, + 9529F22615DBFD59000303A6 /* mp4coverart.cpp in Sources */, + 9529F22815DBFD59000303A6 /* mp4file.cpp in Sources */, + 9529F22A15DBFD59000303A6 /* mp4item.cpp in Sources */, + 9529F22C15DBFD59000303A6 /* mp4properties.cpp in Sources */, + 9529F22E15DBFD59000303A6 /* mp4tag.cpp in Sources */, + 9529F23015DBFD59000303A6 /* mpcfile.cpp in Sources */, + 9529F23215DBFD59000303A6 /* mpcproperties.cpp in Sources */, + 9529F23415DBFD59000303A6 /* id3v1genres.cpp in Sources */, + 9529F23615DBFD59000303A6 /* id3v1tag.cpp in Sources */, + 9529F23815DBFD59000303A6 /* attachedpictureframe.cpp in Sources */, + 9529F23A15DBFD59000303A6 /* commentsframe.cpp in Sources */, + 9529F23C15DBFD59000303A6 /* generalencapsulatedobjectframe.cpp in Sources */, + 9529F23E15DBFD59000303A6 /* popularimeterframe.cpp in Sources */, + 9529F24015DBFD59000303A6 /* privateframe.cpp in Sources */, + 9529F24215DBFD59000303A6 /* relativevolumeframe.cpp in Sources */, + 9529F24415DBFD59000303A6 /* textidentificationframe.cpp in Sources */, + 9529F24615DBFD59000303A6 /* uniquefileidentifierframe.cpp in Sources */, + 9529F24815DBFD59000303A6 /* unknownframe.cpp in Sources */, + 9529F24A15DBFD59000303A6 /* unsynchronizedlyricsframe.cpp in Sources */, + 9529F24C15DBFD59000303A6 /* urllinkframe.cpp in Sources */, + 9529F25215DBFD59000303A6 /* id3v2extendedheader.cpp in Sources */, + 9529F25415DBFD59000303A6 /* id3v2footer.cpp in Sources */, + 9529F25615DBFD59000303A6 /* id3v2frame.cpp in Sources */, + 9529F25815DBFD59000303A6 /* id3v2framefactory.cpp in Sources */, + 9529F25A15DBFD59000303A6 /* id3v2header.cpp in Sources */, + 9529F25C15DBFD59000303A6 /* id3v2synchdata.cpp in Sources */, + 9529F25E15DBFD59000303A6 /* id3v2tag.cpp in Sources */, + 9529F26015DBFD59000303A6 /* mpegfile.cpp in Sources */, + 9529F26215DBFD59000303A6 /* mpegheader.cpp in Sources */, + 9529F26415DBFD59000303A6 /* mpegproperties.cpp in Sources */, + 9529F26615DBFD59000303A6 /* xingheader.cpp in Sources */, + 9529F26815DBFD59000303A6 /* oggflacfile.cpp in Sources */, + 9529F26A15DBFD59000303A6 /* oggfile.cpp in Sources */, + 9529F26C15DBFD59000303A6 /* oggpage.cpp in Sources */, + 9529F26E15DBFD59000303A6 /* oggpageheader.cpp in Sources */, + 9529F27015DBFD59000303A6 /* speexfile.cpp in Sources */, + 9529F27215DBFD59000303A6 /* speexproperties.cpp in Sources */, + 9529F27415DBFD59000303A6 /* vorbisfile.cpp in Sources */, + 9529F27615DBFD59000303A6 /* vorbisproperties.cpp in Sources */, + 9529F27815DBFD59000303A6 /* xiphcomment.cpp in Sources */, + 9529F27A15DBFD59000303A6 /* aifffile.cpp in Sources */, + 9529F27C15DBFD59000303A6 /* aiffproperties.cpp in Sources */, + 9529F27E15DBFD59000303A6 /* rifffile.cpp in Sources */, + 9529F28015DBFD59000303A6 /* wavfile.cpp in Sources */, + 9529F28215DBFD59000303A6 /* wavproperties.cpp in Sources */, + 9529F28415DBFD59000303A6 /* s3mfile.cpp in Sources */, + 9529F28615DBFD59000303A6 /* s3mproperties.cpp in Sources */, + 9529F28815DBFD59000303A6 /* tag.cpp in Sources */, + 9529F28C15DBFD59000303A6 /* tagunion.cpp in Sources */, + 9529F28F15DBFD59000303A6 /* tbytevector.cpp in Sources */, + 9529F29115DBFD59000303A6 /* tbytevectorlist.cpp in Sources */, + 9529F29315DBFD59000303A6 /* tbytevectorstream.cpp in Sources */, + 9529F29515DBFD59000303A6 /* tdebug.cpp in Sources */, + 9529F29715DBFD59000303A6 /* tfile.cpp in Sources */, + 9529F29915DBFD59000303A6 /* tfilestream.cpp in Sources */, + 9529F29B15DBFD59000303A6 /* tiostream.cpp in Sources */, + 9529F2A115DBFD59000303A6 /* tpropertymap.cpp in Sources */, + 9529F2A315DBFD59000303A6 /* tstring.cpp in Sources */, + 9529F2A515DBFD59000303A6 /* tstringlist.cpp in Sources */, + 9529F2A715DBFD59000303A6 /* unicode.cpp in Sources */, + 9529F2A915DBFD59000303A6 /* trueaudiofile.cpp in Sources */, + 9529F2AB15DBFD59000303A6 /* trueaudioproperties.cpp in Sources */, + 9529F2AD15DBFD59000303A6 /* wavpackfile.cpp in Sources */, + 9529F2AF15DBFD59000303A6 /* wavpackproperties.cpp in Sources */, + 9529F2B115DBFD59000303A6 /* xmfile.cpp in Sources */, + 9529F2B315DBFD59000303A6 /* xmproperties.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9529F2C915DC0097000303A6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9529F2DB15DC0134000303A6 /* apefile.cpp in Sources */, + 9529F2DC15DC0134000303A6 /* apefooter.cpp in Sources */, + 9529F2DD15DC0134000303A6 /* apeitem.cpp in Sources */, + 9529F2DE15DC0134000303A6 /* apeproperties.cpp in Sources */, + 9529F2DF15DC0134000303A6 /* apetag.cpp in Sources */, + 9529F2E015DC0134000303A6 /* asfattribute.cpp in Sources */, + 9529F2E115DC0134000303A6 /* asffile.cpp in Sources */, + 9529F2E215DC0134000303A6 /* asfpicture.cpp in Sources */, + 9529F2E315DC0134000303A6 /* asfproperties.cpp in Sources */, + 9529F2E415DC0134000303A6 /* asftag.cpp in Sources */, + 9529F2E515DC0134000303A6 /* audioproperties.cpp in Sources */, + 9529F2E615DC0134000303A6 /* fileref.cpp in Sources */, + 9529F2E715DC0134000303A6 /* flacfile.cpp in Sources */, + 9529F2E815DC0134000303A6 /* flacmetadatablock.cpp in Sources */, + 9529F2E915DC0134000303A6 /* flacpicture.cpp in Sources */, + 9529F2EA15DC0134000303A6 /* flacproperties.cpp in Sources */, + 9529F2EB15DC0134000303A6 /* flacunknownmetadatablock.cpp in Sources */, + 9529F2EC15DC0134000303A6 /* itfile.cpp in Sources */, + 9529F2ED15DC0134000303A6 /* itproperties.cpp in Sources */, + 9529F2EE15DC0134000303A6 /* modfile.cpp in Sources */, + 9529F2EF15DC0134000303A6 /* modfilebase.cpp in Sources */, + 9529F2F015DC0134000303A6 /* modproperties.cpp in Sources */, + 9529F2F115DC0134000303A6 /* modtag.cpp in Sources */, + 9529F2F215DC0134000303A6 /* mp4atom.cpp in Sources */, + 9529F2F315DC0134000303A6 /* mp4coverart.cpp in Sources */, + 9529F2F415DC0134000303A6 /* mp4file.cpp in Sources */, + 9529F2F515DC0134000303A6 /* mp4item.cpp in Sources */, + 9529F2F615DC0134000303A6 /* mp4properties.cpp in Sources */, + 9529F2F715DC0134000303A6 /* mp4tag.cpp in Sources */, + 9529F2F815DC0134000303A6 /* mpcfile.cpp in Sources */, + 9529F2F915DC0134000303A6 /* mpcproperties.cpp in Sources */, + 9529F2FA15DC0134000303A6 /* id3v1genres.cpp in Sources */, + 9529F2FB15DC0134000303A6 /* id3v1tag.cpp in Sources */, + 9529F2FC15DC0134000303A6 /* attachedpictureframe.cpp in Sources */, + 9529F2FD15DC0134000303A6 /* commentsframe.cpp in Sources */, + 9529F2FE15DC0134000303A6 /* generalencapsulatedobjectframe.cpp in Sources */, + 9529F2FF15DC0134000303A6 /* popularimeterframe.cpp in Sources */, + 9529F30015DC0134000303A6 /* privateframe.cpp in Sources */, + 9529F30115DC0134000303A6 /* relativevolumeframe.cpp in Sources */, + 9529F30215DC0134000303A6 /* textidentificationframe.cpp in Sources */, + 9529F30315DC0134000303A6 /* uniquefileidentifierframe.cpp in Sources */, + 9529F30415DC0134000303A6 /* unknownframe.cpp in Sources */, + 9529F30515DC0134000303A6 /* unsynchronizedlyricsframe.cpp in Sources */, + 9529F30615DC0134000303A6 /* urllinkframe.cpp in Sources */, + 9529F30715DC0134000303A6 /* id3v2extendedheader.cpp in Sources */, + 9529F30815DC0134000303A6 /* id3v2footer.cpp in Sources */, + 9529F30915DC0134000303A6 /* id3v2frame.cpp in Sources */, + 9529F30A15DC0134000303A6 /* id3v2framefactory.cpp in Sources */, + 9529F30B15DC0134000303A6 /* id3v2header.cpp in Sources */, + 9529F30C15DC0134000303A6 /* id3v2synchdata.cpp in Sources */, + 9529F30D15DC0134000303A6 /* id3v2tag.cpp in Sources */, + 9529F30E15DC0134000303A6 /* mpegfile.cpp in Sources */, + 9529F30F15DC0134000303A6 /* mpegheader.cpp in Sources */, + 9529F31015DC0134000303A6 /* mpegproperties.cpp in Sources */, + 9529F31115DC0134000303A6 /* xingheader.cpp in Sources */, + 9529F31215DC0134000303A6 /* oggflacfile.cpp in Sources */, + 9529F31315DC0134000303A6 /* oggfile.cpp in Sources */, + 9529F31415DC0135000303A6 /* oggpage.cpp in Sources */, + 9529F31515DC0135000303A6 /* oggpageheader.cpp in Sources */, + 9529F31615DC0135000303A6 /* speexfile.cpp in Sources */, + 9529F31715DC0135000303A6 /* speexproperties.cpp in Sources */, + 9529F31815DC0135000303A6 /* vorbisfile.cpp in Sources */, + 9529F31915DC0135000303A6 /* vorbisproperties.cpp in Sources */, + 9529F31A15DC0135000303A6 /* xiphcomment.cpp in Sources */, + 9529F31B15DC0135000303A6 /* aifffile.cpp in Sources */, + 9529F31C15DC0135000303A6 /* aiffproperties.cpp in Sources */, + 9529F31D15DC0135000303A6 /* rifffile.cpp in Sources */, + 9529F31E15DC0135000303A6 /* wavfile.cpp in Sources */, + 9529F31F15DC0135000303A6 /* wavproperties.cpp in Sources */, + 9529F32015DC0135000303A6 /* s3mfile.cpp in Sources */, + 9529F32115DC0135000303A6 /* s3mproperties.cpp in Sources */, + 9529F32215DC0135000303A6 /* tag.cpp in Sources */, + 9529F32315DC0135000303A6 /* tagunion.cpp in Sources */, + 9529F32415DC0135000303A6 /* tbytevector.cpp in Sources */, + 9529F32515DC0135000303A6 /* tbytevectorlist.cpp in Sources */, + 9529F32615DC0135000303A6 /* tbytevectorstream.cpp in Sources */, + 9529F32715DC0135000303A6 /* tdebug.cpp in Sources */, + 9529F32815DC0135000303A6 /* tfile.cpp in Sources */, + 9529F32915DC0135000303A6 /* tfilestream.cpp in Sources */, + 9529F32A15DC0135000303A6 /* tiostream.cpp in Sources */, + 9529F32B15DC0135000303A6 /* tpropertymap.cpp in Sources */, + 9529F32C15DC0135000303A6 /* tstring.cpp in Sources */, + 9529F32D15DC0135000303A6 /* tstringlist.cpp in Sources */, + 9529F32E15DC0135000303A6 /* unicode.cpp in Sources */, + 9529F32F15DC0135000303A6 /* trueaudiofile.cpp in Sources */, + 9529F33015DC0135000303A6 /* trueaudioproperties.cpp in Sources */, + 9529F33115DC0135000303A6 /* wavpackfile.cpp in Sources */, + 9529F33215DC0135000303A6 /* wavpackproperties.cpp in Sources */, + 9529F33315DC0135000303A6 /* xmfile.cpp in Sources */, + 9529F33415DC0135000303A6 /* xmproperties.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 9529F11315DBFC95000303A6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 9529F11415DBFC95000303A6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 9529F11615DBFC95000303A6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; + DEAD_CODE_STRIPPING = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "TagLib/TagLib-Prefix.pch"; + INFOPLIST_FILE = "TagLib/TagLib-Info.plist"; + INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + WRAPPER_EXTENSION = framework; + }; + name = Debug; + }; + 9529F11715DBFC95000303A6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)"; + DEAD_CODE_STRIPPING = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "TagLib/TagLib-Prefix.pch"; + INFOPLIST_FILE = "TagLib/TagLib-Info.plist"; + INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist"; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + LINK_WITH_STANDARD_LIBRARIES = NO; + MACH_O_TYPE = mh_object; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources"; + WRAPPER_EXTENSION = framework; + }; + name = Release; + }; + 9529F2D915DC0097000303A6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/libTagLib.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + HEADER_SEARCH_PATHS = "../taglib-src/taglib/**"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = TagLib; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 9529F2DA15DC0097000303A6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/libTagLib.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + HEADER_SEARCH_PATHS = "../taglib-src/taglib/**"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = TagLib; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 9529F10015DBFC95000303A6 /* Build configuration list for PBXProject "TagLib" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9529F11315DBFC95000303A6 /* Debug */, + 9529F11415DBFC95000303A6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 9529F11515DBFC95000303A6 /* Build configuration list for PBXNativeTarget "TagLib" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9529F11615DBFC95000303A6 /* Debug */, + 9529F11715DBFC95000303A6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 9529F2D815DC0097000303A6 /* Build configuration list for PBXNativeTarget "libTagLib" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9529F2D915DC0097000303A6 /* Debug */, + 9529F2DA15DC0097000303A6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 9529F0FD15DBFC95000303A6 /* Project object */; +} diff --git a/Audio-Frameworks/TagLib/TagLib/TagLib-Info.plist b/Audio-Frameworks/TagLib/TagLib/TagLib-Info.plist new file mode 100644 index 0000000..8344a95 --- /dev/null +++ b/Audio-Frameworks/TagLib/TagLib/TagLib-Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + ap4y.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSPrincipalClass + + + diff --git a/Audio-Frameworks/TagLib/TagLib/TagLib-Prefix.pch b/Audio-Frameworks/TagLib/TagLib/TagLib-Prefix.pch new file mode 100644 index 0000000..4090e44 --- /dev/null +++ b/Audio-Frameworks/TagLib/TagLib/TagLib-Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'TagLib' target in the 'TagLib' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/Audio-Frameworks/TagLib/TagLib/config.h b/Audio-Frameworks/TagLib/TagLib/config.h new file mode 100755 index 0000000..febaf17 --- /dev/null +++ b/Audio-Frameworks/TagLib/TagLib/config.h @@ -0,0 +1,77 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* have cppunit */ +#define HAVE_CPPUNIT 0 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* have zlib */ +#define HAVE_ZLIB 1 + +/* Suffix for lib directories */ +#define KDELIBSUFF "" + +/* Name of package */ +#define PACKAGE "taglib" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* With ASF support */ +#define TAGLIB_WITH_ASF 1 + +/* With MP4 support */ +#define TAGLIB_WITH_MP4 1 + +/* Version number of package */ +#define VERSION "1.6.3" + +/* With ASF support */ +#define WITH_ASF 1 + +/* With MP4 support */ +#define WITH_MP4 1 diff --git a/Audio-Frameworks/TagLib/TagLib/taglib_config.h b/Audio-Frameworks/TagLib/TagLib/taglib_config.h new file mode 100755 index 0000000..0f499e2 --- /dev/null +++ b/Audio-Frameworks/TagLib/TagLib/taglib_config.h @@ -0,0 +1,4 @@ +/* taglib_config.h. Generated by cmake from taglib_config.h.cmake */ + +#define TAGLIB_WITH_ASF 1 +#define TAGLIB_WITH_MP4 1 diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/CyberLink b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/CyberLink new file mode 120000 index 0000000..0f7a952 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/CyberLink @@ -0,0 +1 @@ +Versions/Current/CyberLink \ No newline at end of file diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Headers b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Resources b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/CyberLink b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/CyberLink new file mode 100644 index 0000000..560023b Binary files /dev/null and b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/CyberLink differ diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/caction.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/caction.h new file mode 100644 index 0000000..edce1be --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/caction.h @@ -0,0 +1,369 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: caction.h +* +* Revision: +* +* 02/23/05 +* - first revision +* +* 18-Jan-06 Heikki Junnila +* - Added API comments +* +******************************************************************/ + +#ifndef _CG_UPNP_CACTION_H_ +#define _CG_UPNP_CACTION_H_ + +#include +#include +#include +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_UPNP_ACTION_ELEM_NAME "action" +#define CG_UPNP_ACTIONLIST_ELEM_NAME "actionList" + +#define CG_UPNP_ACTION_NAME "name" + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgUpnpAction { + BOOL headFlag; + struct _CgUpnpAction *prev; + struct _CgUpnpAction *next; + void *parentService; + CgXmlNode *actionNode; + CgUpnpArgumentList *argumentList; + /**** Execution Data ****/ + BOOL (*listener)(struct _CgUpnpAction *); + CgUpnpStatus *upnpStatus; + void *userData; +} CgUpnpAction, CgUpnpActionList; + +typedef BOOL (*CG_UPNP_ACTION_LISTNER)(CgUpnpAction *); + +/**************************************************************************** + * Function (Action) + ****************************************************************************/ + +/** + * Create a new action + * + * @return CgUpnpAction* + */ +CgUpnpAction *cg_upnp_action_new(); + +/** + * Destroy an action + * + * @param action The action to destroy + */ +void cg_upnp_action_delete(CgUpnpAction *action); + +/** + * Get the next action in a list of actions. Use as an iterator. + * + * @param action The current action + */ +#define cg_upnp_action_next(action) (CgUpnpAction *)cg_list_next((CgList *)action) + +/** + * Check, whether the given XML node is an action node + * + * @param node The CgXmlNode* + */ +#define cg_upnp_action_isactionnode(node) cg_xml_node_isname(node, CG_UPNP_ACTION_ELEM_NAME) + +/**************************************************************************** + * XML Node + ****************************************************************************/ + +/** + * Set the action's XML node (i.e. the XML representation of the action) + * + * @param action The action in question + * @param node The CgXmlNode* + */ +void cg_upnp_action_setactionnode(CgUpnpAction *action, CgXmlNode *node); + +/** + * Get the action's XML node (i.e. the XML representation of the action) + * + * @param action The action in question + * @return CgXmlNode* + */ +#define cg_upnp_action_getactionnode(action) (action->actionNode) + +/**************************************************************************** + * Service + ****************************************************************************/ + +/** + * Set the action's parent service + * + * @param action The action in question + * @param service The action's parent service + */ +#define cg_upnp_action_setservice(action, service) (action->parentService = service) + +/** + * Get the action's parent service + * + * @param action The action in question + * @return CgUpnpService* + */ +#define cg_upnp_action_getservice(action) ((CgUpnpService *)action->parentService) + +/**************************************************************************** + * Name + ****************************************************************************/ + +/** + * Set the action's name + * + * @param action The action in question + * @param value The action's name + */ +#define cg_upnp_action_setname(action, value) cg_xml_node_setchildnode(cg_upnp_action_getactionnode(action), CG_UPNP_ACTION_NAME, value) + +/** + * Get the action's name + * + * @param action The action in question + * @return char* + */ +#define cg_upnp_action_getname(action) cg_xml_node_getchildnodevalue(cg_upnp_action_getactionnode(action), CG_UPNP_ACTION_NAME) + +/** + * Check, whether the action's name matches the one given as parameter. + * + * @param action The action in question + * @param name The name string to compare + */ +#define cg_upnp_action_isname(action, name) cg_streq(cg_upnp_action_getname(action), name) + +/**************************************************************************** + * Argument + ****************************************************************************/ + +/** + * Get the action's list of arguments + * + * @param action The action in question + * @return CgUpnpArgumentList* + */ +#define cg_upnp_action_getargumentlist(action) (action->argumentList) + +/** + * Get the first argument from the action's list of arguments. Use as the + * starting point in iteration loops. + * + * @param action The action in question + * @return CgUpnpArgument* + */ +#define cg_upnp_action_getarguments(action) ((CgUpnpArgument *)cg_list_next((CgList *)action->argumentList)) + +/** + * Find an argument from the action by the argument's name. + * + * @param action The action in question + * @param name The name of the argument to look for + * @return CgUpnpArgument* if successfull; otherwise NULL + */ +CgUpnpArgument *cg_upnp_action_getargumentbyname(CgUpnpAction *action, char *name); + +/** + * Find out, whether the action has an argument by the given name + * + * @param action The action in question + * @param name The name to look for + * @return TRUE if the action has the argument; otherwise FALSE + */ +#define cg_upnp_action_hasargumentbyname(action,name) ((cg_upnp_action_getargumentbyname(action,name) != NULL) ? TRUE : FALSE) + +/** + * Get a value of the specified argument from the action by the argument's name directly. + * + * @param action The action in question + * @param name The name of the argument to look for + * @return char* if successfull; otherwise NULL + */ +char *cg_upnp_action_getargumentvaluebyname(CgUpnpAction *action, char *name); + +/** + * Set a value of the specified argument from the action by the argument's name directly. + * + * @param action The action in question + * @param name The name of the argument to look for + * @param value The value to set + * @return TRUE if successfull; otherwise NO + */ +BOOL cg_upnp_action_setargumentvaluebyname(CgUpnpAction *action, char *name, char *value); + +/**************************************************************************** + * Function (Action - Execution Data) + ****************************************************************************/ + +/**************************************************************************** + * UPnPStatus + ****************************************************************************/ + +/** + * Set the action's latest status code + * + * @param action The action in question + * @param code The status code (int) + */ +#define cg_upnp_action_setstatuscode(action, code) cg_upnp_status_setcode(action->upnpStatus, code) + +/** + * Get the action's latest status code + * + * @param action The action in question + * @return int + */ +#define cg_upnp_action_getstatuscode(action) cg_upnp_status_getcode(action->upnpStatus) + +/** + * Set the action's latest status description + * + * @param action The action in question + * @param value The status description string + */ +#define cg_upnp_action_setstatusdescription(action, value) cg_upnp_status_setdescription(action->upnpStatus, value) + +/** + * Get the action's latest status description + * + * @param action The action in question + * @return char* + */ +#define cg_upnp_action_getstatusdescription(action) cg_upnp_status_getdescription(action->upnpStatus) + +/**************************************************************************** + * Listener + ****************************************************************************/ + +/** + * Set the action's listener function + * + * @param action The action in question + * @param func The listener function of type: BOOL (*CG_UPNP_ACTION_LISTNER)(CgUpnpAction *) + */ +#define cg_upnp_action_setlistener(action, func) (action->listener = func) + +/** + * Get the action's listener function + * + * @param action The action in question + * @return BOOL (*CG_UPNP_ACTION_LISTNER)(CgUpnpAction *) + */ +#define cg_upnp_action_getlistener(action) (action->listener) + +/** + * @deprecated Compatibility macro for typo correction + */ +#define cg_upnp_action_setlistner cg_upnp_action_setlistener + +/** + * @deprecated Compatibility macro for typo correction + */ +#define cg_upnp_action_getlistner cg_upnp_action_getlistener + +/**************************************************************************** + * User Data + ****************************************************************************/ + +/** + * Set the action's arbitrary user data pointer + * + * @param action The action in question + * @param value The user data pointer (void*) + */ +#define cg_upnp_action_setuserdata(action, value) (action->userData = value) + +/** + * Get the action's arbitrary user data pointer + * + * @param action The action in question + * @return void* + */ +#define cg_upnp_action_getuserdata(action) (action->userData) + +/**************************************************************************** + * Function (ActionList) + ****************************************************************************/ + +/** + * Create a new list of actions + * + * @return CgUpnpActionList* + */ +CgUpnpActionList *cg_upnp_actionlist_new(); + +/** + * Destroy a list of actions + * + * @param actionList The list of actions to destroy + */ +void cg_upnp_actionlist_delete(CgUpnpActionList *actionList); + +/** + * Clear the contents of a list of actions + * + * @param actionList The list of actions to clear + */ +#define cg_upnp_actionlist_clear(actionList) cg_list_clear((CgList *)actionList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_action_delete) + +/** + * Get the number of actions in a list of actions + * + * @param actionList The list in question + * @return int + */ +#define cg_upnp_actionlist_size(actionList) cg_list_size((CgList *)actionList) + +/** + * Get the first action in a list of actions. Use as the starting point in + * iteration loops. + * + * @param actionList The list in question + * @return CgUpnpAction* + */ +#define cg_upnp_actionlist_gets(actionList) (CgUpnpAction *)cg_list_next((CgList *)actionList) + +/** + * Add an action to a list of actions + * + * @param actionList The list in question + * @param action The action to add to the list + */ +#define cg_upnp_actionlist_add(actionList, action) cg_list_add((CgList *)actionList, (CgList *)action) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cargument.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cargument.h new file mode 100644 index 0000000..ef694f5 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cargument.h @@ -0,0 +1,362 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cargument.h +* +* Revision: +* +* 02/23/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CARGUMENT_H_ +#define _CG_UPNP_CARGUMENT_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/** Definition for argument element name */ +#define CG_UPNP_ARGUMENT_ELEM_NAME "argument" + +/** Definition for argument list element name */ +#define CG_UPNP_ARGUMENTLIST_ELEM_NAME "argumentList" + +/** Definition for argument passing direction (in) */ +#define CG_UPNP_ARGUMENT_IN_DIR "in" + +/** Definition for argument passing direction (out) */ +#define CG_UPNP_ARGUMENT_OUT_DIR "out" + +/** Definition for argument element name */ +#define CG_UPNP_ARGUMENT_NAME "name" + +/** Definition for argument element "direction" */ +#define CG_UPNP_ARGUMENT_DIRECTION "direction" + +/** Definition for argument related state variable */ +#define CG_UPNP_ARGUMENT_RELATED_STATE_VARIABLE "relatedStateVariable" + +/**************************************** +* Data Type +****************************************/ + +/** + * Data type definition for UPnP argument and UPnP argument list + */ +typedef struct _CgUpnpArgument { + BOOL headFlag; + struct _CgUpnpArgument *prev; + struct _CgUpnpArgument *next; + CgXmlNode *serviceNode; + CgXmlNode *argumentNode; + /**** Execution Data ****/ + CgString *value; +} CgUpnpArgument, CgUpnpArgumentList; + +/**************************************** +* Function (Argument) +****************************************/ + +/** + * Create new argument + */ +CgUpnpArgument *cg_upnp_argument_new(); + +/** + * Delete argument + * + * @param dev Argument + */ +void cg_upnp_argument_delete(CgUpnpArgument *dev); + +/** + * Get next argument using argument as iterator + * + * @param arg Argument node + */ +#define cg_upnp_argument_next(arg) (CgUpnpArgument *)cg_list_next((CgList *)arg) + +/** + * Check if XML node is argument node + * + * @param node XML node + * + * @return True if node is argument node, false otherwise + */ +#define cg_upnp_argument_isargumentnode(node) cg_xml_node_isname(node, CG_UPNP_ARGUMENT_ELEM_NAME) + +/** + * Set XML service node for argument + * + * @param arg Argument + * @param node XML service node + */ +#define cg_upnp_argument_setservicenode(arg,node) (arg->serviceNode = node) + +/** + * Get service node from argument + * + * @param arg Argument + */ +#define cg_upnp_argument_getservicenode(arg) (arg->serviceNode) + +/** + * Set XML argument node for argument + * + * @param arg Argument + * @param node XML argument node + */ +#define cg_upnp_argument_setargumentnode(arg,node) (arg->argumentNode = node) + +/** + * Get XML argument node from argument + * + * @param arg Argument + */ +#define cg_upnp_argument_getargumentnode(arg) (arg->argumentNode) + +/**** name ****/ + +/** + * Set name for argument + * + * @param arg Argument + * @param value Argument name + */ +#define cg_upnp_argument_setname(arg, value) cg_xml_node_setchildnode(cg_upnp_argument_getargumentnode(arg), CG_UPNP_ARGUMENT_NAME, value) + +/** + * Get argument name + * + * @param arg Argument + */ +#define cg_upnp_argument_getname(arg) cg_xml_node_getchildnodevalue(cg_upnp_argument_getargumentnode(arg), CG_UPNP_ARGUMENT_NAME) + +/** + * Check if current argument name matches with the provided name + * + * @param arg Argument + * @param name Name matched with argument name + * + * @return True if argument name equals with the provided name, false otherwise + */ +#define cg_upnp_argument_isname(arg, name) cg_streq(cg_upnp_argument_getname(arg), name) + +/**** direction ****/ + +/** + * Set direction for argument + * + * @param arg Argument + * @param value New direction value + */ +#define cg_upnp_argument_setdirection(arg, value) cg_xml_node_setchildnode(cg_upnp_argument_getargumentnode(arg), CG_UPNP_ARGUMENT_DIRECTION, value) + +/** + * Get argument direction + * + * @param arg Argument + * + * @return Argument direction + */ +#define cg_upnp_argument_getdirection(arg) cg_xml_node_getchildnodevalue(cg_upnp_argument_getargumentnode(arg), CG_UPNP_ARGUMENT_DIRECTION) + +/** + * Check if argument direction is "in" + * + * @param arg Argument + * + * @return True if argument directon is "in" + */ +#define cg_upnp_argument_isindirection(arg) cg_streq(cg_upnp_argument_getdirection(arg), CG_UPNP_ARGUMENT_IN_DIR) + +/** + * Check if argument direction is "out" + * + * @param arg Argument + * + * @return True if argument direction is "out" + */ +#define cg_upnp_argument_isoutdirection(arg) cg_streq(cg_upnp_argument_getdirection(arg), CG_UPNP_ARGUMENT_OUT_DIR) + +/**** relatedStateVariable ****/ + +/** + * Set related state variable + * + * @param arg Argument + * @param value Related state variable name + */ +#define cg_upnp_argument_setrelatedstatevariable(arg, value) cg_xml_node_setchildnode(cg_upnp_argument_getargumentnode(arg), CG_UPNP_ARGUMENT_RELATED_STATE_VARIABLE, value) + +/** + * Get related state variable + * + * @param arg Argument + * + * @return String representing the related state variable + */ +#define cg_upnp_argument_getrelatedstatevariable(arg) cg_xml_node_getchildnodevalue(cg_upnp_argument_getargumentnode(arg), CG_UPNP_ARGUMENT_RELATED_STATE_VARIABLE) + +/**************************************** +* Function (Argument - Execution Data) +****************************************/ + +/**** value ****/ + +/** + * Set argument value + * + * @param arg Argument + * @param data Argument value + */ +#define cg_upnp_argument_setvalue(arg,data) cg_string_setvalue(arg->value, data) + +/** + * Get argument value + * + * @param arg Argument + * + * @return Argument value + */ +#define cg_upnp_argument_getvalue(arg) cg_string_getvalue(arg->value) + +/** + * Set argument value + * + * @param arg Argument + * @param data Argument value + */ +#define cg_upnp_argument_setintvalue(arg,data) cg_string_setintvalue(arg->value, data) + +/** + * Get argument value + * + * @param arg Argument + * + * @return Argument value + */ +#define cg_upnp_argument_getintvalue(arg) cg_string_getintvalue(arg->value) + +/** + * Set argument value + * + * @param arg Argument + * @param data Argument value + */ +#define cg_upnp_argument_setfloatvalue(arg,data) cg_string_setfloatvalue(arg->value, data) + +/** + * Get argument value + * + * @param arg Argument + * + * @return Argument value + */ +#define cg_upnp_argument_getfloatvalue(arg) cg_string_getfloatvalue(arg->value) + +/** + * Set argument value + * + * @param arg Argument + * @param data Argument value + */ +#define cg_upnp_argument_setdoublevalue(arg,data) cg_string_setdoublevalue(arg->value, data) + +/** + * Get argument value + * + * @param arg Argument + * + * @return Argument value + */ +#define cg_upnp_argument_getdoublevalue(arg) cg_string_getdoublevalue(arg->value) + +/**************************************** +* Function (ArgumentList) +****************************************/ + +/** + * Create new argument list + */ +CgUpnpArgumentList *cg_upnp_argumentlist_new(); + +/** + * Delete argument list + * + * @param argumentList Argument list + */ +void cg_upnp_argumentlist_delete(CgUpnpArgumentList *argumentList); + +/** + * Clear argument list + * + * @param argList Argument list + */ +#define cg_upnp_argumentlist_clear(argList) cg_list_clear((CgList *)argList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_argument_delete) + +/** + * Get argument list size + * + * @param argList Argument list + */ +#define cg_upnp_argumentlist_size(argList) cg_list_size((CgList *)argList) + +/** + * Get next argument from argument list + * + * @param argList Argument list + */ +#define cg_upnp_argumentlist_gets(argList) (CgUpnpArgument *)cg_list_next((CgList *)argList) + +/** + * Add argument into argument list + * + * @param argList Argument list + * @param arg Argument + */ +#define cg_upnp_argumentlist_add(argList, arg) cg_list_add((CgList *)argList, (CgList *)arg) + +/** + * Get argument from argument list based on argument name + * + * @param argumentList argumentList + * @param name Argument name + * + * @return Argument + */ +CgUpnpArgument *cg_upnp_argumentlist_get(CgUpnpArgumentList *argumentList, char *name); + +/** + * Set argument values by using source argument list. If there is an argument with the + * name in argument list and source argument list argument data is set from source + * argument list to the matching argument list. + * + * @param argumentList Argument list + * @param srcArgumentList Source argument list + */ +void cg_upnp_argumentlist_set(CgUpnpArgumentList *argumentList, CgUpnpArgumentList *srcArgumentList); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/ccond.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/ccond.h new file mode 100644 index 0000000..ef425fd --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/ccond.h @@ -0,0 +1,110 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) 2006 Nokia Corporation +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: ccond.h +* +* Revision: +* +* 16-Jan-06 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UTIL_CCOND_H_ +#define _CG_UTIL_CCOND_H_ + +#include +#include + +#if defined(WIN32) && !defined(ITRON) +#include +#elif defined(BTRON) +#include +#elif defined(ITRON) +#include +#elif defined(TENGINE) && !defined(PROCESS_BASE) +#include +#elif defined(TENGINE) && defined(PROCESS_BASE) +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** + * Data Types + ****************************************/ + +/** + * \brief The generic wrapper struct for CyberLinkC's conds. + * + * This wrapper has been created to enable 100% code + * compatibility for different platforms (Linux, Win32 etc..) + */ +typedef struct _CgCond { +#if defined(WIN32) && !defined(ITRON) + HANDLE condID; +#elif defined(BTRON) + WERR condID; +#elif defined(ITRON) + ER_ID condID; +#elif defined(TENGINE) && !defined(PROCESS_BASE) + ID condID; +#elif defined(TENGINE) && defined(PROCESS_BASE) + WERR condID; +#else + /** The cond entity */ + pthread_cond_t condID; +#endif +} CgCond; + +/**************************************** + * Functions + ****************************************/ + +/** + * Create a new condition variable + */ +CgCond *cg_cond_new(); + +/** + * Destroy a condition variable + * + * \param cond The cond to destroy + */ +BOOL cg_cond_delete(CgCond *cond); + +/** + * Wait for condition variable to be signalled. + * + * \param cond Cond to be waited + * \param mutex Mutex used for synchronization + * \param timeout Maximum time in seconds to wait, 0 to wait forever + */ +BOOL cg_cond_wait(CgCond *cond, CgMutex *mutex, unsigned long timeout); + +/** + * Signal a condition variable + * + * \param cond Cond to be signalled + */ +BOOL cg_cond_signal(CgCond *cond); + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/ccontrol.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/ccontrol.h new file mode 100644 index 0000000..4c8f429 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/ccontrol.h @@ -0,0 +1,785 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: ccontrol.h +* +* Re1vision: +* +* 04/19/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CCONTROL_H_ +#define _CG_UPNP_CCONTROL_H_ + +#include + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/**** MAN ****/ + +/** + * Definition for mandatory discover header + */ +#define CG_UPNP_MAN_DISCOVER "\"ssdp:discover\"" + +/**** NT ****/ + +/** + * Definition for NT (Notification type) root device + */ +#define CG_UPNP_NT_ROOTDEVICE "upnp:rootdevice" + +/** + * Definition for NT event + */ +#define CG_UPNP_NT_EVENT "upnp:event" + +/**** NTS ****/ + +/** + * Definition for NTS alive + */ +#define CG_UPNP_NTS_ALIVE "ssdp:alive" + +/** + * Definition for NTS byebye + */ +#define CG_UPNP_NTS_BYEBYE "ssdp:byebye" + +/** + * Definition for NTS property change + */ +#define CG_UPNP_NTS_PROPCHANGE "upnp:propchange" + +/**** ST ****/ + +/** + * Definition for general ST (search target) + */ +#define CG_UPNP_ST_ALL_DEVICE "ssdp:all" + +/** + * Definition for root device ST + */ +#define CG_UPNP_ST_ROOT_DEVICE "upnp:rootdevice" + +/** + * Definition for ST UUID (universally unique identifier) prefix + */ +#define CG_UPNP_ST_UUID_DEVICE "uuid" + + /** + * Definition for URN device + */ +#define CG_UPNP_ST_URN "urn" + +/** + * Definition for URN device + */ +#define CG_UPNP_ST_URN_DEVICE "urn:schemas-upnp-org:device" + +/** + * Definition for URN service + */ +#define CG_UPNP_ST_URN_SERVICE "urn:schemas-upnp-org:service" + +/**** USN ****/ + +/** + * Definition for USN rootdevice + */ +#define CG_UPNP_USN_ROOTDEVICE "upnp:rootdevice" + +/** + * Definition for control name space + */ +#define CG_UPNP_CONTROL_NS "u" + +/** + * Definition for soap action: state variable query + */ +#define CG_UPNP_CONTROL_QUERY_SOAPACTION "\"urn:schemas-upnp-org:control-1-0#QueryStateVariable\"" + +/** + * Definition for control XML name space + */ +#define CG_UPNP_CONTROL_XMLNS "urn:schemas-upnp-org:control-1-0" + +/** + * Definition for query state variable + */ +#define CG_UPNP_CONTROL_QUERY_STATE_VARIABLE "QueryStateVariable" + +/** + * Definition for query state variable response + */ +#define CG_UPNP_CONTROL_QUERY_STATE_VARIABLE_RESPONSE "QueryStateVariableResponse" + +/** + * Definition for control variable name + */ +#define CG_UPNP_CONTROL_VAR_NAME "varName" + +/** + * Definition for control return + */ +#define CG_UPNP_CONTROL_RETURN "return" + +/** + * Definition for control fault code + */ +#define CG_UPNP_CONTROL_FAULT_CODE "Client" + +/** + * Definition for contol fault string + */ +#define CG_UPNP_CONTROL_FAULT_STRING "UPnPError" + +/** + * Definition fro control error code + */ +#define CG_UPNP_CONTROL_ERROR_CODE "errorCode" + +/** + * Definition for control error description + */ +#define CG_UPNP_CONTROL_ERROR_DESCRIPTION "errorDescription" + +/**************************************** +* Data Type +****************************************/ + +/**** Action ****/ + +/** + * Data type definition for action response + */ +typedef struct _CgUpnpActionResponse { + CgSoapResponse *soapRes; + BOOL isSoapResCreated; + CgUpnpArgumentList *argList; +} CgUpnpActionResponse; + +/** + * Data type definition for action request + */ +typedef struct _CgUpnpActionRequest{ + CgSoapRequest *soapReq; + BOOL isSoapReqCreated; + CgUpnpArgumentList *argList; + CgUpnpActionResponse *actionRes; +} CgUpnpActionRequest; + +/**** Query ****/ + +/** + * Data type definition for query response + */ +typedef struct _CgUpnpQueryResponse { + CgSoapResponse *soapRes; + BOOL isSoapResCreated; +} CgUpnpQueryResponse; + +/** + * Data type definition for query request + */ +typedef struct _CgUpnpQueryRequest{ + CgSoapRequest *soapReq; + BOOL isSoapReqCreated; + CgUpnpQueryResponse *queryRes; +} CgUpnpQueryRequest; + +/**************************************** +* Function +****************************************/ + +/* After POST has failed we send M-POST and change the SOAPACTION header into 01-SOAPACTION. + * Next ensures that also in this case query is interpreted as a query. + */ + +/** + * Check if HTTP request query is UPnP query request + * + * @param httpReq HTTP request + * + * @return True if request is UPnP query request, false othewise + */ +#define cg_upnp_control_isqueryrequest(httpReq) ( ((0 <= cg_strstr(cg_soap_request_getsoapaction(httpReq), CG_UPNP_CONTROL_QUERY_SOAPACTION)) ? TRUE : FALSE) || ((0 <= cg_strstr(cg_soap_request_getsoapactionwithns(httpReq), CG_UPNP_CONTROL_QUERY_SOAPACTION)) ? TRUE : FALSE) ) + +/* Check if HTTP request is UPnP action request + * + * @param httpReq HTTP request + * + * @return True if request is UPnP action request, false otherwise + */ +#define cg_upnp_control_isactionrequest(httpReq) ((cg_upnp_control_isqueryrequest(httpReq) == TRUE) ? FALSE : TRUE) + +/** + * Initializes soap requests envelope node + * + * @param soapReq Soap request + */ +void cg_upnp_control_soap_request_initializeenvelopenode(CgSoapRequest *soapReq); + +/** + * Initialize soap responses envelope node + * + * @param soapRes Soap response + */ +void cg_upnp_control_soap_response_initializeenvelopenode(CgSoapResponse *soapRes); +CgXmlNode *cg_upnp_control_soap_response_createfaultresponsenode(int errCode, char *errDescr); + +/** + * Set failed response data + * + * @param soapRes Soap response + * @param errCode Error code + * @param errDescr Error description + */ +void cg_upnp_control_soap_response_setfaultresponse(CgSoapResponse *soapRes, int errCode, char *errDescr); + +/** + * Perform action listener + * + * @param action Action + * @param actionReq Action request + */ +BOOL cg_upnp_action_performlistner(CgUpnpAction *action, CgUpnpActionRequest *actionReq); + +/** + * Perform query listener + * + * @param statVar State variable + * @param queryReq Query request + */ +BOOL cg_upnp_statevariable_performlistner(CgUpnpStateVariable *statVar, CgUpnpQueryRequest *queryReq); + +/** + * Set host from service + * + * @param soapReq Soap request + * @param service UPnP service + */ +void cg_upnp_control_request_sethostfromservice(CgSoapRequest *soapReq, CgUpnpService *service); + +/**************************************** +* Function (ActionRequest) +****************************************/ + +/** + * Create new action request object + */ +CgUpnpActionRequest *cg_upnp_control_action_request_new(); + +/** + * Delete action request object + * + * @param actionReq Action request + */ +void cg_upnp_control_action_request_delete(CgUpnpActionRequest *actionReq); + +/** + * Clear action request + * + * @param actionReq Clear Action request + */ +void cg_upnp_control_action_request_clear(CgUpnpActionRequest *actionReq); + +/** + * Set soap request associated with action request + * + * @param actionReq Action request + * @param soapReq Soap request + */ +void cg_upnp_control_action_request_setsoaprequest(CgUpnpActionRequest *actionReq, CgSoapRequest *soapReq); + +/** + * Get soap request associated with action request + * + * @param actionReq Action request + * + * @return Soap request + */ +#define cg_upnp_control_action_request_getsoaprequest(actionReq) (actionReq->soapReq) + +/** + * Get argument list from action request + * + * @param actionReq Action request + * + * @return Argument list + */ +#define cg_upnp_control_action_request_getargumentlist(actionReq) (actionReq->argList) + +/** + * Get XML action node from action request + * + * @param actionReq + * + * @return Action request XML node + */ +CgXmlNode *cg_upnp_control_action_request_getactionnode(CgUpnpActionRequest *actionReq); + +/** + * Get action name from action request + * + * @param actionReq Action request + * + * @return Action name + */ +char *cg_upnp_control_action_request_getactionname(CgUpnpActionRequest *actionReq); + +/** + * Set action to action request + * + * @param actionReq Action request + * @param action UPnP action + */ +void cg_upnp_control_action_request_setaction(CgUpnpActionRequest *actionReq, CgUpnpAction *action); + +/** + * Get action response from action request + * + * @param actionReq Action request + * + * @return Action response + */ +#define cg_upnp_control_action_request_getactionresponse(actionReq) (actionReq->actionRes) + +/** + * Send action request + * + * @param actionReq Action request + */ +CgUpnpActionResponse *cg_upnp_control_action_request_post(CgUpnpActionRequest *actionReq); + +/**************************************** +* Function (ActionResponse) +****************************************/ + +/** + * Create new action response + */ +CgUpnpActionResponse *cg_upnp_control_action_response_new(); + +/** + * Delete action response + * + * @param actionReq Action response + */ +void cg_upnp_control_action_response_delete(CgUpnpActionResponse *actionReq); + +/** + * Clear action response + * + * @param actionReq Action response + */ +void cg_upnp_control_action_response_clear(CgUpnpActionResponse *actionReq); + +/** + * Set soap response to action response + * + * @param actionRes Action response + * @param soapRes Soap reaponse + */ +void cg_upnp_control_action_response_setsoapresponse(CgUpnpActionResponse *actionRes, CgSoapResponse *soapRes); + +/** + * Get soap response from action response + * + * @param actionRes Action response + * + * @return Soap response + */ +#define cg_upnp_control_action_response_getsoapresponse(actionRes) (actionRes->soapRes) + +/** + * Set action response to action + * + * @param actionRes Action response + * @param action UPnP action + */ +void cg_upnp_control_action_response_setresponse(CgUpnpActionResponse *actionRes, CgUpnpAction *action); + +/** + * Check if action response indicates that action invoke was successfull + * + * @param actionRes Action response + * + * @return True if action has been successful, false otherwise + */ +#define cg_upnp_control_action_response_issuccessful(actionRes) cg_soap_response_issuccessful(actionRes->soapRes) + +/** + * Get action response XML node from action response + * + * @param actionRes Action response + * + * @return Action response XML node + */ +CgXmlNode *cg_upnp_control_action_response_getactionresponsenode(CgUpnpActionResponse *actionRes); + +/** + * Get result from action response + * \todo Check this out more carefully + * + * @param actionRes Action response + * @param action UPnP action + */ +BOOL cg_upnp_control_action_response_getresult(CgUpnpActionResponse *actionRes, CgUpnpAction *action); + +/** + * Get error associated to action response + * \todo Check this out more carefully + * @param actionRes Action response + * @param action UPnP action + */ +BOOL cg_upnp_control_action_response_geterror(CgUpnpActionResponse *actionRes, CgUpnpAction *action); + +/**************************************** +* Function (QueryRequest) +****************************************/ + +/** + * Create new query request object + */ +CgUpnpQueryRequest *cg_upnp_control_query_request_new(); + +/** + * Delete query request + * + * @param queryReq Query request + */ +void cg_upnp_control_query_request_delete(CgUpnpQueryRequest *queryReq); + +/** + * Clear query request + * + * @param queryReq Query request + */ +void cg_upnp_control_query_request_clear(CgUpnpQueryRequest *queryReq); + +/** + * Set soap request for query request + * + * @param queryReq Query request + * @param soapReq Soap request + */ +void cg_upnp_control_query_request_setsoaprequest(CgUpnpQueryRequest *queryReq, CgSoapRequest *soapReq); + +/** + * Get soap request from query request + * + * @param queryReq + * + * @return Soap request + */ +#define cg_upnp_control_query_request_getsoaprequest(queryReq) (queryReq->soapReq) + +/** + * Get state variable XML node + * + * @param queryReq + * + * @return State variable XML node + */ +CgXmlNode *cg_upnp_control_query_request_getvarnamenode(CgUpnpQueryRequest *queryReq); + +/** + * Get state variable name associated with this query request + * + * @param queryReq Query request + * + * @return State variable variable name + */ +char *cg_upnp_control_query_request_getvarname(CgUpnpQueryRequest *queryReq); + +/** + * Set state variable to query request + * + * @param queryReq Query request + * @param statVar State variable + */ +void cg_upnp_control_query_request_setstatevariable(CgUpnpQueryRequest *queryReq, CgUpnpStateVariable *statVar); + +/** + * Get response from query request + * + * @param queryReq Query request + * + * @return Query response + */ +#define cg_upnp_control_query_request_getqueryresponse(queryReq) (queryReq->queryRes) + +/** + * Send query request + * + * @param queryReq Query request + * + * @return Query response + */ +CgUpnpQueryResponse *cg_upnp_control_query_request_post(CgUpnpQueryRequest *queryReq); + +/**************************************** +* Function (QueryResponse) +****************************************/ + +/** + * Create new query response + */ +CgUpnpQueryResponse *cg_upnp_control_query_response_new(); + +/** + * Delete query response + * + * @param queryReq Query request + */ +void cg_upnp_control_query_response_delete(CgUpnpQueryResponse *queryReq); + +/** + * Clear query response + * + * @param queryReq Query request + */ +void cg_upnp_control_query_response_clear(CgUpnpQueryResponse *queryReq); + +/** + * Set soap response for query response + * + * @param queryRes Query response + * @param soapRes Soap response + */ +void cg_upnp_control_query_response_setsoapresponse(CgUpnpQueryResponse *queryRes, CgSoapResponse *soapRes); + +/** + * Get soap response from query response + * + * @param queryRes Query response + * + * @return Soap response + */ +#define cg_upnp_control_query_response_getsoapresponse(queryRes) (queryRes->soapRes) + +/** + * Create and set XML response data into query response + * + * @param queryRes Query response + * @param statVar State variable + */ +void cg_upnp_control_query_response_setresponse(CgUpnpQueryResponse *queryRes, CgUpnpStateVariable *statVar); + +/** + * Check if query response indicates that query request has succeeded + * + * @param queryRes Query response + */ +#define cg_upnp_control_query_response_issuccessful(queryRes) cg_soap_response_issuccessful(queryRes->soapRes) + +/** + * Get XML return node from query response + * + * @param queryRes + * + * @return XML return node + */ +CgXmlNode *cg_upnp_control_query_response_getreturnnode(CgUpnpQueryResponse *queryRes); + +/** + * Get return valuse from query response + * + * @param queryRes Query response + * + * @return UPnP return value + */ +char *cg_upnp_control_query_response_getreturnvalue(CgUpnpQueryResponse *queryRes); + +/**************************************** +* Function (MAN) +****************************************/ + +/** + * Check if string is correct mandatory header value as specified + * in UPnP Device Architecture 1.2.2 + * + * @param str String to be checked + * + * @return True if string is exactly the required one, false otherwise + */ +#define cg_upnp_man_isdiscover(str) ((0 == cg_strstr(str, CG_UPNP_MAN_DISCOVER)) ? TRUE : FALSE) + +/**************************************** +* Function (ST) +****************************************/ + +/** + * Check if device is of type "all" + * + * @param str String to be checked + * + * @return True if device type is "all", false otherwise + */ +#define cg_upnp_st_isalldevice(str) ((0 <= cg_strstr(str, CG_UPNP_ST_ALL_DEVICE)) ? TRUE : FALSE) + +/** + * Check if device string is from root device + * + * @param str String to be checked + * + * @return True if string is from device type "root device", false otherwise + */ +#define cg_upnp_st_isrootdevice(str) ((0 <= cg_strstr(str, CG_UPNP_ST_ROOT_DEVICE)) ? TRUE : FALSE) + +/** + * Check if string is from uuid device + * + * @param str String to be checked + * + * @return True if string is from uuid device, false otherwise + */ +#define cg_upnp_st_isuuiddevice(str) ((0 <= cg_strstr(str, CG_UPNP_ST_UUID_DEVICE)) ? TRUE : FALSE) + +/** + * Check if string is from urn + * + * @param str String to be checked + * + * @return True if string is from urn, false otherwise + */ +#define cg_upnp_st_isurn(str) ((0 <= cg_strstr(str, CG_UPNP_ST_URN)) ? TRUE : FALSE) + +/** + * Check if string is from urn device + * + * @param str String to be checked + * + * @return True if string is from urn device, false otherwise + */ +#define cg_upnp_st_isurndevice(str) ((0 <= cg_strstr(str, CG_UPNP_ST_URN_DEVICE)) ? TRUE : FALSE) + +/** + * Check if string is from urn service + * + * @param str String to be checked + * + * @return True if string is from urn service, false otherwise + */ +#define cg_upnp_st_isurnservice(str) ((0 <= cg_strstr(str, CG_UPNP_ST_URN_SERVICE)) ? TRUE : FALSE) + +/**************************************** +* Function (NT) +****************************************/ + +/** + * Check if NT (notification target) is for root device + * + * @param str String to be checked + * + * @return True if NT is for root device, false otherwise + */ +#define cg_upnp_nt_isrootdevice(str) ((0 <= cg_strstr(str, CG_UPNP_NT_ROOTDEVICE)) ? TRUE : FALSE) + +/**************************************** +* Function (NTS) +****************************************/ + +/** + * Check if NTS (notification sub target) is of type "alive" + * + * @param str String to be checked + * + * @return True if string is of type "alive", false otherwise + */ +#define cg_upnp_nts_isalive(str) ((0 <= cg_strstr(str, CG_UPNP_NTS_ALIVE)) ? TRUE : FALSE) + +/** + * Check if string type is "byebye" + * + * @param str String to be checked + * + * @return True if string is of type "byebye", false othewise + */ +#define cg_upnp_nts_isbyebye(str) ((0 <= cg_strstr(str, CG_UPNP_NTS_BYEBYE)) ? TRUE : FALSE) + +/** + * Check if string type is "property change" + * + * @param str String to be checked + * + * @return True if string type is "property change" + */ +#define cg_upnp_nts_ispropchange(str) ((0 <= cg_strstr(str, CG_UPNP_NTS_PROPCHANGE)) ? TRUE : FALSE) + +/**************************************** +* Function (USN) +****************************************/ + +/** + * Check if usn is from root device + * + * @param str String to be checked + * + * @return True if usn associates to root device, false otherwise + */ +#define cg_upnp_usn_isrootdevice(str) ((0 <= cg_strstr(str, CG_UPNP_USN_ROOTDEVICE)) ? TRUE : FALSE) + +/** + * Get udn from usn + * + * @param usn Universal serial number + * @param udnBuf Buffer where udn is stored after successfull execution + * @param udnBufLen Buffer length for udnBuf + * + * @return Pointer to beginning of udnBuf. + */ +char *cg_upnp_usn_getudn(char *usn, char *udnBuf, int udnBufLen); + +/**************************************** +* Function (Action) +****************************************/ + +/** + * Send action + * + * @param action Action + */ +BOOL cg_upnp_action_post(CgUpnpAction *action); + +/**************************************** +* Function (Query) +****************************************/ + +/** + * Send query + * + * @param statVar State variable + */ +BOOL cg_upnp_statevariable_post(CgUpnpStateVariable *statVar); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/ccontrolpoint.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/ccontrolpoint.h new file mode 100644 index 0000000..b720493 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/ccontrolpoint.h @@ -0,0 +1,716 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: ccontrolpoint.h +* +* Revision: +* +* 05/25/05 +* - first revision +* +* 11-Jan-06 Heikki Junnila +* - Removed cg_upnp_device_isname and _getbyname because +* according to UPnP specs UDN, type or friendlyname is +* not the same as the device's name. +* - Added cg_upnp_controlpoint_getdevicebyudn() +* 04/02/06 Theo Beisch +* - added support for resubscriber +* and device disposer +* - added cg_upnp_controlpoint_getservicebysid +* - added cg_upnp_controlpoint_waitforlock +* 22-Apr-2008 +* - Added cg_upnp_controlpoint_getdevice() to get a device by the index. +* +******************************************************************/ + +#ifndef _CG_UPNP_CCONTROLPOINT_H_ +#define _CG_UPNP_CCONTROLPOINT_H_ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/** Definition for SSDP default search MX */ +#define CG_UPNP_CONTROLPOINT_SSDP_DEFAULT_SEARCH_MX 3 + +/** Definition for control point SSDP minimum delay */ +#define CG_UPNP_CONTROLPOINT_SSDP_MIN_DELAY 20 + +/** Definition for control point default response port */ +#define CG_UPNP_CONTROLPOINT_SSDP_RESPONSE_DEFAULT_PORT 39400 + +/** Definition for numeric constant to specify the max tries to open a SSDP Response Port (rosfran.borges) */ +#define CG_UPNP_CONTROLPOINT_SSDP_RESPONSE_PORT_MAX_TRIES_INDEX 80 + +/** Definition for HTTP event default port */ +#define CG_UPNP_CONTROLPOINT_HTTP_EVENT_DEFAULT_PORT 39500 + +/** Definition for default controlpoint event callback "location" */ +#define CG_UPNP_CONTROLPOINT_HTTP_EVENTSUB_URI "/eventSub" + +/**************************************** +* Data Type +****************************************/ + +/** + * Device listener status parameters. + * + * @ref CgUpnpDeviceStatusAdded means a device has been added to local cache. + * @ref CgUpnpDeviceStatusUpdated means a device description has been updated + * because its IP address or description has changed. The user should renew + * any active subscriptions if this has been received. + * + * @ref CgUpnpDeviceStatusInvalid is basically the same as @ref CgUpnpDeviceStatusRemoved, + * but @ref CgUpnpDeviceStatusRemoved is sent only when a device leaves the + * network in a proper way (i.e. with UPnP ByeBye messages). The user should + * immediately cease using the device, because it will be removed in both cases. + */ +typedef enum _CgUpnpDeviceStatus +{ + CgUpnpDeviceStatusAdded = 0, + CgUpnpDeviceStatusUpdated, + CgUpnpDeviceStatusInvalid, + CgUpnpDeviceStatusRemoved +} CgUpnpDeviceStatus; + +/** + * Prototype for control point's device listener callback. + * + * @param udn The UDN of the device, that the status update concerns + * @param status The new status + */ + +typedef struct _CgUpnpControlPoint { + CgMutex *mutex; + CgXmlNodeList *deviceRootNodeList; + CgUpnpDeviceList *deviceList; + CgUpnpSSDPServerList *ssdpServerList; + CgUpnpSSDPResponseServerList *ssdpResServerList; + CgHttpServerList *httpServerList; + void (*deviceListener)(struct _CgUpnpControlPoint *, char*, CgUpnpDeviceStatus); /* CG_UPNP_DEVICE_LISTENER */ + CG_HTTP_LISTENER httpListener; + CG_UPNP_SSDP_LISTNER ssdpListener; + CG_UPNP_SSDP_RESPONSE_LISTNER ssdpResListener; + CgUpnpEventListenerList* eventListeners; + int ssdpResPort; + CgString *httpEventURI; + int httpEventPort; + int ssdpSearchMx; + void *userData; + + /* Expiration handling */ + CgThread *expThread; + CgMutex *expMutex; + CgCond *expCond; + + /** List of cached interfaces */ + CgNetworkInterfaceList *ifCache; +} CgUpnpControlPoint; + +typedef void (*CG_UPNP_DEVICE_LISTENER)(CgUpnpControlPoint *ctrlPoint, char* udn, CgUpnpDeviceStatus status); + +/**************************************************************************** + * Control Point top-level control + ****************************************************************************/ + +/** + * Create a new control point. Does not start any threads. + * + * @return A newly-created CgUpnpControlPoint + */ +CgUpnpControlPoint *cg_upnp_controlpoint_new(); + +/** + * Destroy the given control point + * + * @param ctrlPoint The control point struct to destroy + */ +void cg_upnp_controlpoint_delete(CgUpnpControlPoint *ctrlPoint); + +/** + * Activate the control point. Starts listening for SSDP messages etc. + * You must call this function before you can actually use a control point. + * + * @param ctrlPoint The control point to start + * + * @return TRUE if successful; otherwise FALSE + * + */ +BOOL cg_upnp_controlpoint_start(CgUpnpControlPoint *ctrlPoint); + +/** + * Stop the control point. Stops sending/receiveing/responding to any messages. + * + * @param ctrlPoint The control point to stop + * + * @return TRUE if successful; otherwise FALSE + * + */ +BOOL cg_upnp_controlpoint_stop(CgUpnpControlPoint *ctrlPoint); + +/** +* Check if the control point is activated. +* +* @param ctrlPoint The control point to stop +* +* @return TRUE if running; otherwise FALSE +* +*/ +BOOL cg_upnp_controlpoint_isrunning(CgUpnpControlPoint *ctrlPoint); + +/**************************************************************************** + * Control Point locking + ****************************************************************************/ + +/** + * Lock the control point's mutex. + * The control point should be ALWAYS locked, when a CgUpnpDevice*, + * CgUpnpService*, CgUpnpAction* or other pointer has been taken into use from + * the stack. This effectively prevents devices/services from being updated/ + * removed or added while the control point is locked. You should release the + * lock as soon as possible with @ref cg_upnp_controlpoint_unlock + * + * @note Do NOT save any CgUpnp* pointers to user-space variables. Use them + * only as local variables (inside one function) after gaining a mutex lock. + * Release the lock as soon as you are done accessing the pointer, and then + * discard the pointer immediately. + * + * @param ctrlPoint The control point in question + */ + +#if defined(WITH_THREAD_LOCK_TRACE) && defined(__USE_ISOC99) +#define cg_upnp_controlpoint_lock(ctrlPoint) cg_mutex_lock_trace(__FILE__, __LINE__, __PRETTY_FUNCTION__, ctrlPoint->mutex) +#else +BOOL cg_upnp_controlpoint_lock(CgUpnpControlPoint *ctrlPoint); +#endif +/** + * Release a previously locked control point mutex. + * See @ref cg_upnp_controlpoint_lock for a more detailed description on + * the control point locking mechanism. + * + * @param ctrlPoint The control point in question + */ +#if defined(WITH_THREAD_LOCK_TRACE) && defined(__USE_ISOC99) +#define cg_upnp_controlpoint_unlock(ctrlPoint) cg_mutex_unlock_trace(__FILE__, __LINE__, __PRETTY_FUNCTION__, ctrlPoint->mutex) +#else +BOOL cg_upnp_controlpoint_unlock(CgUpnpControlPoint *ctrlPoint); +#endif + +/**************************************************************************** + * Device searching + ****************************************************************************/ + +/** + * Find a device from the control point by the exact type of the device. + * This function searches for devices, whose *complete type string* + * matches the given string, including version number. For example: + * "urn:schemas-upnp-org:device:FooDevice:1". If you need to disregard + * the version, use @ref cg_upnp_controlpoint_getdevicebytype + * + * @param ctrlPoint Controlpoint in question + * @param exacttype Type of the device + * + */ +CgUpnpDevice *cg_upnp_controlpoint_getdevicebyexacttype(CgUpnpControlPoint *ctrlPoint, + char *exacttype); + +/** + * Find a device from the controlpoint by the type of the device. + * This function searches for devices, whose *type part* (i.e. not including + * the version) of the device type string matches the given string. + * For example: "urn:schemas-upnp-org:device:FooDevice". If you need + * to know the version of a device, use @ref cg_upnp_devicetype_getversion + * + * @param ctrlPoint Controlpoint in question + * @param type Type of the device + * + */ +CgUpnpDevice *cg_upnp_controlpoint_getdevicebytype(CgUpnpControlPoint *ctrlPoint, + char *type); + +/** + * Find a device from the controlpoint by the UDN of the device. + * + * @param ctrlPoint Controlpoint in question + * @param type Type of the device + * + */ +CgUpnpDevice *cg_upnp_controlpoint_getdevicebyudn(CgUpnpControlPoint *ctrlPoint, + char *udn); + +/**************************************************************************** + * SSDP response + ****************************************************************************/ + +/** + * Get the list of SSDP servers associated to the control point + * + * @param ctrlPoint The control point in question + */ +#define cg_upnp_controlpoint_getssdpserverlist(ctrlPoint) (ctrlPoint->ssdpServerList) + +/** + * Get the list of SSDP response servers associated to the control point + * + * @param ctrlPoint The control point in question + */ +#define cg_upnp_controlpoint_getssdpresponseserverlist(ctrlPoint) (ctrlPoint->ssdpResServerList) + +/** + * Get the list of HTTP servers associated to the control point + * + * @param ctrlPoint The control point in question + */ +#define cg_upnp_controlpoint_gethttpserverlist(ctrlPoint) (ctrlPoint->httpServerList) + +/**************************************************************************** + * SSDP listener + ****************************************************************************/ + +/** + * Set an SSDP message listener for the control point. Use this function to + * get SSDP messages to user-space applications. + * + * @param ctrlPoint The control point in question + * @param func A callback function that is of type @ref CG_UPNP_SSDP_LISTNER + */ +#define cg_upnp_controlpoint_setssdplistener(ctrlPoint, func) (ctrlPoint->ssdpListener = func) + +/** + * Get the SSDP message listener for the control point. + * + * @param ctrlPoint The control point in question + * @return A callback function that is of type @ref CG_UPNP_SSDP_LISTNER or NULL + */ +#define cg_upnp_controlpoint_getssdplistener(ctrlPoint) (ctrlPoint->ssdpListener) + +/** + * Set an SSDP response listener for the control point. Use this function to + * get SSDP responses to user-space applications. + * + * @param ctrlPoint The control point in question + * @param func A callback function that is of type @ref CG_UPNP_SSDP_RESPONSE_LISTNER + */ +#define cg_upnp_controlpoint_setssdpresponselistener(ctrlPoint, func) (ctrlPoint->ssdpResListener = func) + +/** + * Get the SSDP response listener for the control point. + * + * @param ctrlPoint The control point in question + * @return A callback function that is of type @ref CG_UPNP_SSDP_RESPONSE_LISTNER or NULL + */ +#define cg_upnp_controlpoint_getssdpresponselistener(ctrlPoint) (ctrlPoint->ssdpResListener) + +/** + * Set device listener for the control point. + * + * @param ctrlPoint The control point + * @param func A callback function that is type @ref CG_UPNP_DEVICE_LISTENER or NULL + */ +#define cg_upnp_controlpoint_setdevicelistener(ctrlPoint, func) (ctrlPoint->deviceListener = func) + +/** + * Get the device listener for the control point. + * + * @param ctrlPoint The control point in question + * @return A callback function that is of type @ref CG_UPNP_DEVICE_LISTENER or NULL + */ +#define cg_upnp_controlpoint_getdevicelistener(ctrlPoint) (ctrlPoint->deviceListener) + +/**************************************************************************** + * Event listening + ****************************************************************************/ + +/** + * Set an event listener for the control point. Use this function to + * get event notifications to user-space applications. + * + * @param ctrlPoint The control point in question + * @param listener A callback function that is of type @ref CG_UPNP_EVENT_LISTENER + */ +#define cg_upnp_controlpoint_addeventlistener(ctrlPoint, listener) (cg_upnp_eventlistenerlist_add(ctrlPoint->eventListeners, listener)) + +/** + * Remove an event listener from the control point. + * + * @param ctrlPoint The control point in question + * @param listener The callback function to remove, that is of type @ref CG_UPNP_EVENT_LISTENER + */ +#define cg_upnp_controlpoint_removeeventlistener(ctrlPoint, listener) (cg_upnp_eventlistenerlist_remove(ctrlPoint->eventListeners, listener)) + +/** + * Set a single event listener for the control point. Use this function to + * get event notifications to user-space applications if you need only one listener. + * + * @param ctrlPoint The control point in question + * @param evlistener The callback function to set, that is of type @ref CG_UPNP_EVENT_LISTENER, or NULL + */ +#define cg_upnp_controlpoint_seteventlistener(ctrlPoint, evlistener) \ + do {\ + if (evlistener == NULL) \ + cg_upnp_eventlistenerlist_remove(ctrlPoint->eventListeners, ctrlPoint->eventListeners->next->listener); \ + else \ + cg_upnp_eventlistenerlist_add(ctrlPoint->eventListeners, evlistener); \ + } while(0) + +/** + * Get the single event listener for the control point. + * + * @param ctrlPoint The control point in question + * @return The callback function, that is of type @ref CG_UPNP_EVENT_LISTENER, + * or NULL if there is no listener + */ +#define cg_upnp_controlpoint_geteventlistener(ctrlPoint) (ctrlPoint->eventListeners->next->listener) + +/** + * Get the list of event listeners for the control point. + * + * @param ctrlPoint The control point in question + * @return List of @ref CG_UPNP_EVENT_LISTENER functions + */ +#define cg_upnp_controlpoint_geteventlisteners(ctrlPoint) (ctrlPoint->eventListeners) + +/**************************************************************************** + * SSDP Response port + ****************************************************************************/ + +/** + * Set the IP port number used for the control point's SSDP responses + * + * @param ctrlPoint The control point in question + * @param port The IP port number + */ +#define cg_upnp_controlpoint_setssdpresponseport(ctrlPoint, port) (ctrlPoint->ssdpResPort = port) + +/** + * Get the IP port number used for the control point's SSDP responses + * + * @param ctrlPoint The control point in question + */ +#define cg_upnp_controlpoint_getssdpresponseport(ctrlPoint) (ctrlPoint->ssdpResPort) + +/**************************************************************************** + * Eventing + ****************************************************************************/ + +/** + * Set the IP port number for the control point's event reception + * + * @param ctrlPoint The control point in question + * @param port The IP port number + */ +#define cg_upnp_controlpoint_seteventport(ctrlPoint, port) (ctrlPoint->httpEventPort = port) + +/** + * Get the IP port number for the control point's event reception + * + * @param ctrlPoint The control point in question + */ +#define cg_upnp_controlpoint_geteventport(ctrlPoint) (ctrlPoint->httpEventPort) + +/** + * Set the URI used for the control point's event subscription notifications + * + * @param ctrlPoint The control point in question + * @param uri The URI to set + */ +#define cg_upnp_controlpoint_seteventsuburi(ctrlPoint, uri) cg_string_setvalue(ctrlPoint->httpEventURI, uri) + +/** + * Get the URI used for the control point's event subscription notifications + * + * @param ctrlPoint The control point in question + */ +#define cg_upnp_controlpoint_geteventsuburi(ctrlPoint) cg_string_getvalue(ctrlPoint->httpEventURI) + +/**************************************************************************** + * M-SEARCH + ****************************************************************************/ + +/** + * Do an M-SEARCH to look for devices in the network. + * + * @param ctrlPoint The control point in question + * @param target The Search Target parameter (ex. "ssdp:all") + */ +BOOL cg_upnp_controlpoint_search(CgUpnpControlPoint *ctrlPoint, char *target); + +/** + * Set the MX-parameter used for SSDP searches i.e. Set the time to wait + * (in seconds) for device responses to an M-SEARCH + * + * @param ctrlPoint The control point in question + * @param value MX; Time to wait + */ +#define cg_upnp_controlpoint_setssdpsearchmx(ctrlPoint, value) (ctrlPoint->ssdpSearchMx = value) + +/** + * Get the MX-parameter used for SSDP searches + * + * @param ctrlPoint The control point in question + * @return value MX; Time to wait + */ +#define cg_upnp_controlpoint_getssdpsearchmx(ctrlPoint) (ctrlPoint->ssdpSearchMx) + +/**************************************************************************** + * HTTP listener + ****************************************************************************/ + +/** + * Set an HTTP listener function to the control point. Use this function to + * get HTTP requests to user-space applications. + * + * @param ctrlPoint The control point in question + * @param func The listener function, that is of type @ref CG_HTTP_LISTENER + */ +#define cg_upnp_controlpoint_sethttplistener(ctrlPoint, func) (ctrlPoint->httpListener = func) + +/** + * Get the HTTP listener function for the control point. + * + * @param ctrlPoint The control point in question + * @return The listener function, that is of type @ref CG_HTTP_LISTENER + */ +#define cg_upnp_controlpoint_gethttplistener(ctrlPoint) (ctrlPoint->httpListener) + +/** + * The function that calls all HTTP listener callback functions. Do not call + * this from applications. + * + * @param httpReq The received HTTP request + */ +void cg_upnp_controlpoint_httprequestreceived(CgHttpRequest *httpReq); + +/** + * When an event is received, update also the associated service's + * state table to include the evented state variable. + * + * @param service The service, whose state table to update + * @param prop The evented property from which to update + */ +void cg_upnp_controlpoint_updatestatetablefromproperty(CgUpnpService* service, + CgUpnpProperty* prop); + +/**************************************************************************** + * User Data + ****************************************************************************/ + +/** + * Set the user data pointer (arbitrary user data) to the control point. + * + * @param ctrlPoint The control point in question + * @param value Arbitrary user data + */ +#define cg_upnp_controlpoint_setuserdata(ctrlPoint, value) (ctrlPoint->userData = value) + +/** + * Get the user data pointer (arbitrary user data) from the control point. + * + * @param dev The control point in question + * @return Pointer to user data or NULL + */ +#define cg_upnp_controlpoint_getuserdata(ctrlPoint) (ctrlPoint->userData) + +/**************************************************************************** + * Service SCPD + ****************************************************************************/ + +/** + * Parse the service description from the service's SCPD URL. Do not call + * this from user applications. + * + * @param service The service in question + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_parsescservicescpd(CgUpnpService *service); + +/** + * Parse the device's services using the received SSDP packet. Do not call this + * from user applications. + * + * @param dev The device in question + * @param ssdpPkt An SSDP packet + */ +BOOL cg_upnp_controlpoint_parseservicesfordevice(CgUpnpDevice *dev, CgUpnpSSDPPacket *ssdpPkt); + +/**************************************************************************** + * Device adding/removal by SSDP packets + ****************************************************************************/ + +/** + * Add a device on the basis of an SSDP packet. Do not call this from user + * applications. + * + * @param ctrlPoint The control point, whose device list to handle + * @param ssdpPkt The received SSDP packet + */ +void cg_upnp_controlpoint_adddevicebyssdppacket(CgUpnpControlPoint *ctrlPoint, + CgUpnpSSDPPacket *ssdpPkt); + +/** + * Remove a device on the basis of an SSDP packet. Do not call this from user + * applications. + * + * @param ctrlPoint The control point, whose device list to handle + * @param ssdpPkt The received SSDP packet + */ +void cg_upnp_controlpoint_removedevicebyssdppacket(CgUpnpControlPoint *ctrlPoint, + CgUpnpSSDPPacket *ssdpPkt); + +/**************************************** + * Subscription + ****************************************/ + +/** + * Subscribe to a service's events + * + * @param ctrlPoint The control point in use + * @param service The service to subscribe to + * @param timeout Timeout for subscription expiration/renewal + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_subscribe(CgUpnpControlPoint *ctrlPoint, CgUpnpService *service, long timeout); + +/** + * Re-subscribe to a service's events (i.e. renew subscription) + * + * @param ctrlPoint The control point in use + * @param service The service to subscribe to + * @param timeout Timeout for subscription expiration/renewal + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_resubscribe(CgUpnpControlPoint *ctrlPoint, CgUpnpService *service, long timeout); + +/** + * Unsubscribe to a service's events (i.e. cancel subscription) + * + * @param ctrlPoint The control point in use + * @param service The service to unsubscribe to + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_unsubscribe(CgUpnpControlPoint *ctrlPoint, CgUpnpService *service); + +/** + * Subscribe to all of the device's services' events + * + * @param ctrlPoint The control point in use + * @param dev The device to subscribe to + * @param timeout Timeout for subscription expiration/renewal + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_subscribeall(CgUpnpControlPoint *ctrlPoint, CgUpnpDevice *dev, long timeout); + +/** + * Re-subscribe to all of the device's services' events (i.e. renew subscription) + * + * @param ctrlPoint The control point in use + * @param dev The device to subscribe to + * @param timeout Timeout for subscription expiration/renewal + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_resubscribeall(CgUpnpControlPoint *ctrlPoint, CgUpnpDevice *dev, long timeout); + +/** + * Unsubscribe to all of the device's services' events (i.e. cancel subscription) + * + * @param ctrlPoint The control point in use + * @param dev The device to unsubscribe to + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_unsubscribeall(CgUpnpControlPoint *ctrlPoint, CgUpnpDevice *dev); + +/**************************************** + * Function (DeviceList) + ****************************************/ + +/** + * Get the head of the control point's list of devices (use for iteration) + * + * @param ctrlPoint The control point in use + * @return The head of the device list + */ +#define cg_upnp_controlpoint_getdevices(ctrlPoint) cg_upnp_devicelist_gets(ctrlPoint->deviceList) + +/** + * Get the number of devices known by the control point + * + * @param ctrlPoint The control point in use + * @return The number of devices in the control point's device list + */ +#define cg_upnp_controlpoint_getndevices(ctrlPoint) cg_upnp_devicelist_size(ctrlPoint->deviceList) + +/** + * Get the head of the control point's list of devices (use for iteration) + * + * @param ctrlPoint The control point in use + * @param index The index of the device to get + * @return The specified device + */ +#define cg_upnp_controlpoint_getdevice(ctrlPoint, index) cg_upnp_devicelist_get(ctrlPoint->deviceList, index) + +/** + * Add a device to the control point's list of devices. Do not call this from + * user applications. + * + * @param ctrlPoint The control point in use + * @param dev The device to add + */ +#define cg_upnp_controlpoint_adddevice(ctrlPoint, dev) cg_upnp_devicelist_add(ctrlPoint->deviceList, dev) + +/**************************************** + * Environment handling + ****************************************/ + +/** + * Worker thread for handling expirations. + * + * \param thread the thread in question + */ +void cg_upnp_controlpoint_expirationhandler(CgThread *thread); + +/** + * Notify the control point that any IP of the host has been changed. + * + * \param ctrlpoint The control point in use + * \return success of changing used interfaces + */ +BOOL cg_upnp_controlpoint_ipchanged(CgUpnpControlPoint *ctrlpoint); + + +/** + * Get the event subscription callback URI + * + * @param ctrlPoint The control point in question + */ +char *cg_upnp_controlpoint_geteventsubcallbackurl(CgUpnpControlPoint *ctrlPoint, char *ifaddr, char *buf, int bufLen); + +#ifdef __cplusplus +} +#endif + +#endif /* _CG_UPNP_CCONTROLPOINT_H_ */ diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cdevice.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cdevice.h new file mode 100644 index 0000000..e47ca6d --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cdevice.h @@ -0,0 +1,1539 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cdevice.h +* +* Revision: +* +* 02/14/05 +* - first revision +* +* 10/31/05 +* - Added comments to all functions and structs +* +* 01/09/06 Heikki Junnila +* - Added cg_upnp_device_getservicebytype() to enable +* searching for services without version information. +* +* 10-Jan-06 Heikki Junnila +* - Renamed cg_upnp_device_getservicebyname to +* cg_upnp_device_getservicebyexacttype and created a compat +* macro for _getservicebyname +* +* 11-Jan-06 Heikki Junnila +* - Removed cg_upnp_device_isname and _getbyname because +* according to UPnP specs UDN, type or friendlyname is +* not the same as the device's name. +* - Added cg_upnp_device_getdevicebyudn() +* 04/03/06 Theo Beisch +* - Added cg_upnp_device_getservicebysid +* - changed leasetime and timer to type CgSysTime +* - added cg_upnp_device_waitforlock (nonblocking) +* 22-Apr-2008 +* - Added cg_upnp_device_getnservices() and cg_upnp_device_getservice() to get a device by the index. +* +******************************************************************/ + +#ifndef _CG_UPNP_CDEVICE_H_ +#define _CG_UPNP_CDEVICE_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** + * Value macros + ****************************************/ + +/** Definition for device XML element name */ +#define CG_UPNP_DEVICE_ELEM_NAME "device" + +/** Definition for device XML element list name */ +#define CG_UPNP_DEVICELIST_ELEM_NAME "deviceList" + +/** Definition for UPnP rootdevice ID */ +#define CG_UPNP_DEVICE_UPNP_ROOTDEVICE "upnp:rootdevice" + +/** Definition for default device start up wait time */ +#define CG_UPNP_DEVICE_DEFAULT_STARTUP_WAIT_TIME 1000 + +/** Definition for default device discovery wait time */ +#define CG_UPNP_DEVICE_DEFAULT_DISCOVERY_WAIT_TIME 500 + +/** Definition for default device lease time */ +#define CG_UPNP_DEVICE_DEFAULT_LEASE_TIME (30 * 60) + +/** Definition for default device HTTP port */ +#define CG_UPNP_DEVICE_HTTP_DEFAULT_PORT 38400 + +/** Definition for default description file "location" */ +#define CG_UPNP_DEVICE_DEFAULT_DESCRIPTION_URI "/description.xml" + +/** Definition for maximum URL base length */ +#define CG_UPNP_DEVICE_URLBASE_MAXLEN 64 + +/** Definition for M-SEARCH filter interval */ +#define CG_UPNP_DEVICE_M_SEARCH_FILTER_INTERVAL 15 + +/** Definition for urlbase XML element name */ +#define CG_UPNP_DEVICE_URLBASE_NAME "URLBase" + +/** Definition for device type XML element name */ +#define CG_UPNP_DEVICE_DEVICE_TYPE "deviceType" + +/** Definition for device friendly name XML element name */ +#define CG_UPNP_DEVICE_FRIENDLY_NAME "friendlyName" + +/** Definition for device manufacturer XML element name */ +#define CG_UPNP_DEVICE_MANUFACTURER "manufacturer" + +/** Definition for manufacturer URL XML element name */ +#define CG_UPNP_DEVICE_MANUFACTURER_URL "manufacturerURL" + +/** Definition for device model description XML element name */ +#define CG_UPNP_DEVICE_MODEL_DESCRIPTION "modelDescription" + +/** Definition fo device model name XML element name */ +#define CG_UPNP_DEVICE_MODEL_NAME "modelName" + +/** Definition for device model number XML element name */ +#define CG_UPNP_DEVICE_MODEL_NUMBER "modelNumber" + +/** Definition for device model URL XML element name */ +#define CG_UPNP_DEVICE_MODEL_URL "modelURL" + +/** Definition for device serial number XML element name */ +#define CG_UPNP_DEVICE_SERIAL_NUMBER "serialNumber" + +/** Definition for device UDN XML element name */ +#define CG_UPNP_DEVICE_UDN "UDN" + +/** Definition for device UPC XML element name */ +#define CG_UPNP_DEVICE_UPC "UPC" + +/** Definition for device presentation URL XML element name */ +#define CG_UPNP_DEVICE_PRESENTATION_URL "presentationURL" + +/**************************************** + * Data Type + ****************************************/ + +/** + * \brief The generic UPnP device structure + * + * \note This struct can also be cast to a CgList* and used as a node in a + * linked list with cg_list_* functions. + */ +typedef struct _CgUpnpDevice +{ + /** Used by cg_list_* functions to indicate start of list */ + BOOL headFlag; + /** Used by cg_list_* functions to point to the previous item in list */ + struct _CgUpnpDevice *prev; + /** Used by cg_list_* functions to point to the next item in list */ + struct _CgUpnpDevice *next; + + /** List of XML root nodes */ + CgXmlNodeList *rootNodeList; + /** This device's description XML node */ + CgXmlNode *deviceNode; + + /** This device's parent device */ + struct _CgUpnpDevice *parentDevice; + /** List of devices */ + struct _CgUpnpDevice *deviceList; + /** List of services */ + struct _CgUpnpService *serviceList; + /** List of icons */ + struct _CgUpnpIcon *iconList; + + /** Mutex used in multithreading */ + CgMutex *mutex; + /** List of HTTP servers */ + CgHttpServerList *httpServerList; + /** List of SSDP servers */ + CgUpnpSSDPServer *ssdpServerList; + /** Device advertiser thread */ + CgThread *advertiser; + + /** HTTP request listener */ + CG_HTTP_LISTENER httpListener; + + /** URI for this device's description */ + CgString *descriptionURI; + /** Advertisement lease time */ + CgSysTime leaseTime; + /** HTTP Port to listen to */ + int httpPort; + /** This device's SSDP packet */ + CgUpnpSSDPPacket *ssdpPkt; + /** User data used to pass miscellaneous data */ + void *userData; + + /* List of cached interfaces */ + CgNetworkInterfaceList *ifCache; +} CgUpnpDevice, CgUpnpDeviceList; + +/**************************************** + * Function (Device) + ****************************************/ + +/** + * Create a new UPnP device + */ +CgUpnpDevice *cg_upnp_device_new(); + +/** + * Delete a UPnP device + * + * \param dev Device in question + */ +void cg_upnp_device_delete(CgUpnpDevice *dev); + +/** + * Clear a UPnP device structure. This is an internal function and should not be called from outside. + * + * \param dev Device in question + */ +void cg_upnp_device_clear(CgUpnpDevice *dev); + +/** + * Get the next device in the device list. Use as an iterator. + * + * \param dev Current device + */ +#define cg_upnp_device_next(dev) (CgUpnpDevice *)cg_list_next((CgList *)dev) + +/** + * Remove the device from the device list. + * + * \param dev Device in question + */ +#define cg_upnp_device_remove(dev) cg_list_remove((CgList *)dev) + +/** + * Check whether the given node is of type CG_UPNP_DEVICE_ELEM_NAME + * + * \param node CgXmlAttribute + */ +#define cg_upnp_device_isdevicenode(node) cg_xml_node_isname(node, CG_UPNP_DEVICE_ELEM_NAME) + +/** + * Return the device's root node + * \todo Correct explanation... + * + * \param dev Device in question + */ +#define cg_upnp_device_getrootnode(dev) cg_xml_nodelist_gets(dev->rootNodeList) + +/** + * Set the device description node and initialise its child nodes + * + * \param dev Device in question + * \param node The XML structure to be set as the device's description + */ +void cg_upnp_device_setdevicenode(CgUpnpDevice *dev, CgXmlNode *node); + +/** + * Return the device XML description node + * + * \param dev Device in question + */ +#define cg_upnp_device_getdevicenode(dev) (dev->deviceNode) + +/** + * Check whether the given device contains a list of root nodes + * i.e. is it the root device + * + * \param dev Device in question + */ +#define cg_upnp_device_isrootdevice(dev) ((dev->rootNodeList != NULL) ? TRUE : FALSE) + +/** + * Set a parent device for the given child device + * + * \param dev Child device + * \param pDev Parent device + */ +#define cg_upnp_device_setparentdevice(dev, pDev) (dev->parentDevice = pDev) + +/** + * Return the device's parent device + * + * \param dev Device in question + */ +#define cg_upnp_device_getparentdevice(dev) (dev->parentDevice) + +/** + * Return the root (i.e. the topmost) device in the device structure + * + * \param dev Traverses the device tree upwards starting from this device + */ +CgUpnpDevice *cg_upnp_device_getrootdevice(CgUpnpDevice *dev); + +/** + * Parse the device description XML document. + * + * \param dev Device in question + * \param description Buffer containing the device description in XML format + * \param descriptionLen Buffer length + * + * \return TRUE, if the buffer was successfully parsed; otherwise FALSE + */ +BOOL cg_upnp_device_parsedescription(CgUpnpDevice *dev, char *desciption, int descriptionLen); + +/** + * Fetch and parse the device description XML file, located in the given URL. + * + * \param dev Device in question + * \param url An internet resource + * + * \return TRUE, if the buffer was successfully parsed; otherwise FALSE + */ +BOOL cg_upnp_device_parsedescriptionurl(CgUpnpDevice *dev, CgNetURL *url); + + +#if defined(CG_USE_CFILE) +/** + * Load and parse the device description from an XML file. + * Not available for T-Engine, ITron and BTron platforms. + * + * \param dev Device in question + * \param fileName The file name containing the device description XML document + * + * \return TRUE, if the buffer was successfully parsed; otherwise FALSE + */ +BOOL cg_upnp_device_loaddescriptionfile(CgUpnpDevice *dev, char *fileName); +#endif + +/**************************************************************************** + * Description updates + ****************************************************************************/ + +/** + * Update the device's contents from an SSDP packet if necessary. + * + * @param dev The device to potentially update + * @param ssdpPkt The SSDP packet to make decisions on + * @return TRUE if the device was updated; otherwise FALSE + */ +BOOL cg_upnp_device_updatefromssdppacket(CgUpnpDevice* dev, + CgUpnpSSDPPacket* ssdpPkt); + +/***************************************************************************** + * Device Type + *****************************************************************************/ + +/** + * Modify the device type. + * + * \param dev Device in question + * \param value Type to set + */ +#define cg_upnp_device_setdevicetype(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_DEVICE_TYPE, value) + +/** + * Return the device type + * + * \param dev Device in question + * + * \return Device type + */ +#define cg_upnp_device_getdevicetype(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_DEVICE_TYPE) + +/** + * Check, whether the device is of the exact specified type (including version) + * + * \param dev Device in question + * @param value Device type + * + * \return BOOL: TRUE if device matches given type; otherwise FALSE + */ +#define cg_upnp_device_isdevicetype(dev, value) cg_streq(cg_upnp_device_getdevicetype(dev), value) + +/** + * Get the identifier-part of a device type string (usually "urn") + * + * @param deviceType A device type string (usually the result from + * @ref cg_upnp_device_getdevicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_devicetype_getidentifier(char* deviceType); + +/** + * Get the URN part of a device type string (usually "schemas-upnp-org") + * + * @param deviceType A device type string (usually the result from + * @ref cg_upnp_device_getdevicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_devicetype_geturn(char* deviceType); + +/** + * Get the device part of a device type string (usually just "device") + * + * @param deviceType A device type string (usually the result from + * @ref cg_upnp_device_getdevicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_devicetype_getdevice(char* deviceType); + +/** + * Get the type part of a device type string (ex. "ContentDirectory") + * + * @param deviceType A device type string (usually the result from + * @ref cg_upnp_device_getdevicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_devicetype_gettype(char* deviceType); + +/** + * Get the schema type part of a device type string (without last colon) + * (ex. "urn:schemas-upnp-org:device:ContentDirectory") + * + * @param deviceType A device type string (usually the result from + * @ref cg_upnp_device_getdevicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_devicetype_getschematype(char* deviceType); + +/** + * Get the version part of a device type string (ex. "1") + * + * @param deviceType A device type string (usually the result from + * @ref cg_upnp_device_getdevicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_devicetype_getversion(char* deviceType); + +/***************************************************************************** + * Friendly Name + *****************************************************************************/ + +/** + * Modify the device's friendly name. + * + * \param dev Device in question + * \param value The friendly name + * + */ +#define cg_upnp_device_setfriendlyname(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_FRIENDLY_NAME, value) + +/** + * Return the device's friendly name. + * + * \param dev Device in question + * + * \return The device's friendly name + */ +#define cg_upnp_device_getfriendlyname(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_FRIENDLY_NAME) + +/***************************************************************************** + * Manufacturer + *****************************************************************************/ + +/** + * Modify the device's manufacturer. + * + * \param dev Device in question + * \param value The manufacturer's name + * + */ +#define cg_upnp_device_setmanufacturer(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MANUFACTURER, value) + +/** + * Get the device's manufacturer. + * + * \param dev Device in question + * + * \return value The manufacturer's name + */ +#define cg_upnp_device_getmanufacturer(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MANUFACTURER) + +/***************************************************************************** + * Manufacturer URL + *****************************************************************************/ + +/** + * Modify the device's manufacturer URL + * + * \param dev Device in question + * \param value The manufacturer URL + * + */ +#define cg_upnp_device_setmanufacturerurl(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MANUFACTURER_URL, value) + +/** + * Get the device's manufacturer URL + * + * \param dev Device in question + * + * \return The manufacturer URL + */ +#define cg_upnp_device_getmanufacturerurl(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MANUFACTURER_URL) + +/***************************************************************************** + * Model Description + *****************************************************************************/ + +/** + * Modify the device model description + * + * \param dev Device in question + * \param value The device model description + * + */ +#define cg_upnp_device_setmodeldescription(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_DESCRIPTION, value) + +/** + * Get the device model description + * + * \param dev Device in question + * + * \return The device model description + */ +#define cg_upnp_device_getmodeldescription(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_DESCRIPTION) + +/***************************************************************************** + * Model Name + *****************************************************************************/ + +/** + * Modify the device's model name + * + * \param dev Device in question + * \param value The model name + * + */ +#define cg_upnp_device_setmodelname(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_NAME, value) + +/** + * Get the device's model name + * + * \param dev Device in question + * + * \return The model name + */ +#define cg_upnp_device_getmodelname(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_NAME) + +/***************************************************************************** + * Model Number + *****************************************************************************/ + +/** + * Modify the device's model number + * + * \param dev Device in question + * \param value The model number + * + */ +#define cg_upnp_device_setmodelnumber(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_NUMBER, value) + +/** + * Get the device's model number + * + * \param dev Device in question + * + * \return The model number + */ +#define cg_upnp_device_getmodelnumber(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_NUMBER) + +/***************************************************************************** + * Model URL + *****************************************************************************/ + +/** + * Modify the device's model URL + * + * \param dev Device in question + * \param value The model URL + * + */ +#define cg_upnp_device_setmodelurl(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_URL, value) + +/** + * Get the device's model URL + * + * \param dev Device in question + * + * \return The model URL + */ +#define cg_upnp_device_getmodelurl(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_URL) + +/***************************************************************************** + * serialNumber + *****************************************************************************/ + +/** + * Modify the device's serial number + * + * \param dev Device in question + * \param value The serial number + * + */ +#define cg_upnp_device_setserialnumber(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_SERIAL_NUMBER, value) + +/** + * Get the device's model number + * + * \param dev Device in question + * + * \return The serial number + */ +#define cg_upnp_device_getserialnumber(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_SERIAL_NUMBER) + +/***************************************************************************** + * Unique Device Name (UDN) + *****************************************************************************/ + +/** + * Modify the device's Unique Device Name (UDN) + * + * \param dev Device in question + * \param value The Unique Device Name + * + */ +#define cg_upnp_device_setudn(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_UDN, value) + +/** + * Get the device's Unique Device Name (UDN) + * + * \param dev Device in question + * + * \return The Unique Device Name + */ +#define cg_upnp_device_getudn(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_UDN) + +/** + * Check whether the device has a Unique Device Name (UDN) + * + * \param dev Device in question + * + * \return TRUE if the device has a UDN; otherwise FALSE + */ +#define cg_upnp_device_hasudn(dev) ((0 < cg_strlen(cg_upnp_device_getudn(dev))) ? TRUE : FALSE) + +/** + * Update new Unique Device Name (UDN) + * + * \param dev Device in question + * + */ +void cg_upnp_device_updateudn(CgUpnpDevice *dev); + +/***************************************************************************** + * Universal Product Code (UPC) + *****************************************************************************/ + +/** + * Modify the device's Universal Product Code (UPC) + * + * \param dev Device in question + * \param value The Universal Product Code + * + */ +#define cg_upnp_device_setupc(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_UPC, value) + +/** + * Get the device's Universal Product Code (UPC) + * + * \param dev Device in question + * + * \return The Universal Product Code + */ +#define cg_upnp_device_getupc(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_UPC) + +/***************************************************************************** + * Presentation URL + *****************************************************************************/ + +/** + * Modify the device's presentation URL + * + * \param dev Device in question + * \param value The presentation URL + * + */ +#define cg_upnp_device_setpresentationurl(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_PRESENTATION_URL, value) + +/** + * Get the device's presentation URL + * + * \param dev Device in question + * + * \return The presentation URL + */ +#define cg_upnp_device_getpresentationurl(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_PRESENTATION_URL) + +/***************************************************************************** + * URLBase + *****************************************************************************/ + +/** + * Modify the device's URL base + * The base URL is the root for all relative URLs. + * + * \param dev Device in question + * \param value The URL base + * + */ +void cg_upnp_device_seturlbase(CgUpnpDevice *dev, char *value); + +/** + * Get the device's base URL. + * The base URL is the root for all relative URLs. + * + * \param dev Device in question + * \return The URL base + * + */ +#define cg_upnp_device_geturlbase(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getrootnode(cg_upnp_device_getrootdevice(dev)), CG_UPNP_DEVICE_URLBASE_NAME) + +/***************************************************************************** + * Start/Stop + *****************************************************************************/ + +/** + * Start the device. This essentially starts: + * \li The HTTP server + * \li The SSDP server + * \li Advertising the device + * \li Alive notification + * + * \param dev Device in question + * + */ +BOOL cg_upnp_device_start(CgUpnpDevice *dev); + +/** + * Stop the device. This concerns: + * \li The HTTP server + * \li The SSDP server + * \li Advertising the device + * \li Byebye notification + * + * \param dev Device in question + * + */ +BOOL cg_upnp_device_stop(CgUpnpDevice *dev); + +/** + * Check if the device] has been started + * + * \param dev Device that is being advertised + */ +BOOL cg_upnp_device_isrunning(CgUpnpDevice *dev); + +/***************************************************************************** + * URL + *****************************************************************************/ + +/** + * Get device's location URL. Transforms the given address to URL form: + * "http://:/description.xml". Port is usually 80 or 38400. + * If is an IPv6 address, the address is "http://[]:/description.xml". + * + * \param dev Device in question + * \param host The device host + * \param buf Buffer to store the resulting URL + * \param bufSize Buffer length + * + */ +char *cg_upnp_device_getlocationurl(CgUpnpDevice *dev, char *host, char *buf, int bufSize); + +/***************************************************************************** + * Notify + *****************************************************************************/ + +/** + * Broadcast an SSDP:alive to notify control points that the device is available. + * + * \param dev Device in question + * + */ +void cg_upnp_device_announce(CgUpnpDevice *dev); + +/** + * Broadcast an SSDP:byebye message to notify control points that the device is no longer available. + * + * \param dev Device in question + * + */ +void cg_upnp_device_byebye(CgUpnpDevice *dev); + +/***************************************************************************** + * Mutex + *****************************************************************************/ + +/** + * Lock the device's mutex (grant exclusive access to the device) until \ref cg_upnp_device_unlock is called. + * + * \param dev Device in question + * + */ +#define cg_upnp_device_lock(dev) cg_mutex_lock(dev->mutex) + +/** + * Lock the device's mutex with timeout, return TRUE if exclusive access is gained + * Release lock with \ref cg_upnp_device_unlock is called. + * + * \param dev Device in question + * \param t timeout in ms + * + */ +#define cg_upnp_device_waitforlock(dev,t) cg_mutex_waitforlock(dev->mutex,t) + +/** + * Unlock the device's mutex (release exclusive access to the device) locked previously with \ref cg_upnp_device_lock. + * + * \param dev Device in question + * + */ +#define cg_upnp_device_unlock(dev) cg_mutex_unlock(dev->mutex) + +/***************************************************************************** + * Listener + *****************************************************************************/ + +/** + * Set an action listener to the device. Actions are basically commands, that the + * device (service) responds to. + * + * \param dev Device in question + * \param actionListener The action listener + * + */ +void cg_upnp_device_setactionlistener(CgUpnpDevice *dev, CG_UPNP_ACTION_LISTNER actionListner); + +/** + * Set a query listener to the device. Queries are meant for state variables. + * + * \param dev Device in question + * \param actionListener The query listener + * + */ +void cg_upnp_device_setquerylistener(CgUpnpDevice *dev, CG_UPNP_STATEVARIABLE_LISTNER queryListner); + +/***************************************************************************** + * User Data + *****************************************************************************/ + +/** + * Set device's user data pointer + * + * \param dev Device in question + * \param value User data pointer + * + */ +#define cg_upnp_device_setuserdata(dev, value) (dev->userData = value) + +/** + * Get device's user data pointer + * + * \param dev Device in question + * \return pointer to user data + * + */ +#define cg_upnp_device_getuserdata(dev) (dev->userData) + +/***************************************************************************** +* Function +******************************************************************************/ + +/***************************************************************************** + * DescriptionURL + *****************************************************************************/ + +/** + * Set the given URL as the device's description URI + * + * \param dev Device in question + * \param url Description URL + * + */ +#define cg_upnp_device_setdescriptionuri(dev,url) cg_string_setvalue(dev->descriptionURI, url) + +/** + * Get the device's description URI + * + * \param dev Device in question + * + */ +#define cg_upnp_device_getdescriptionuri(dev) cg_string_getvalue(dev->descriptionURI) + +/** + * Check, whether the given URL matches the device's description URI + * + * \param dev Device in question + * \param url Description URL to check + * + */ +#define cg_upnp_device_isdescriptionuri(dev, url) cg_streq(cg_string_getvalue(dev->descriptionURI), url) + +/***************************************************************************** + * Lease Time + *****************************************************************************/ + +/** + * Set the device's lease time. The lease time is basically the maximum amount + * of time that can elapse before an advertisement is broadcast again. It does not + * set the exact advertisement interval, but rather a time window for each advertisement. + * Advertisement actually occurs at (more or less) random intervals inside this time window. + * + * \param dev Device in question + * \param value Lease time in seconds + * + */ +#define cg_upnp_device_setleasetime(dev,value) (dev->leaseTime = value) + +/** + * Get the device's lease time. See \ref cg_upnp_device_setleasetime. + * + * \param dev Device in question + * + */ +#define cg_upnp_device_getleasetime(dev) (dev->leaseTime) + +/***************************************************************************** +* Functions (Embedded) +******************************************************************************/ + +/***************************************************************************** + * Embedded DeviceList + *****************************************************************************/ + +/** + * Get the device's internal device list + * + * \param dev Device in question + * + */ +#define cg_upnp_device_getdevicelist(dev) (dev->deviceList) + +/** + * Find a certain device from the given device list + * + * \param dev Device in question + * \param idx Device index number in list + * \return NULL if not found; otherwise the device pointer + * + */ +//Theo Beisch added missing (CgList*) cast +#define cg_upnp_device_getdevice(dev,idx) ((CgUpnpDevice *)cg_list_get((CgList*)dev->deviceList,idx)) + +/** + * \todo Correct explanation... + * + * \param dev Device in question + * + */ +//Theo Beisch : added missing (CgList*) cast +#define cg_upnp_device_getdevices(dev) ((CgUpnpDevice *)cg_list_gets((CgList *)dev->deviceList)) + +/** + * Find a device from the device's children by the exact type of the device. + * This function searches for devices, whose *complete type string* + * matches the given string, including version number. For example: + * "urn:schemas-upnp-org:device:FooDevice:1". If you need to disregard + * the version, use \ref cg_upnp_device_getdevicebytype + * + * \param ctrlPoint Controlpoint in question + * \param exacttype Type of the device + * + */ +CgUpnpDevice *cg_upnp_device_getdevicebyexacttype(CgUpnpDevice* dev, + char *exacttype); + +/** + * Find a device from the device's children by the type of the device. + * This function searches for devices, whose *type part* (i.e. not including + * the version) of the device type string matches the given string. + * For example: "urn:schemas-upnp-org:device:FooDevice". If you need + * to know the version of a device, use \ref cg_upnp_devicetype_getversion + * + * \param dev Device in question + * \param type Type of the device + * + */ +CgUpnpDevice *cg_upnp_device_getdevicebytype(CgUpnpDevice *dev, char *type); + +/** + * Find a device from the device's children by the UDN of the device. + * + * \param dev Device in question + * \param type Type of the device + * + */ +CgUpnpDevice *cg_upnp_device_getdevicebyudn(CgUpnpDevice *dev, char *udn); + +/** + * Find a child device by its description URI. + * + * \param dev Device in question + * \param url Description URI + * + */ +CgUpnpDevice *cg_upnp_device_getdevicebydescriptionuri(CgUpnpDevice *dev, char *url); + +/***************************************************************************** + * Embedded ServiceList + *****************************************************************************/ + +/** + * Get the device's list of services + * + * \param dev Device in question + * + */ +#define cg_upnp_device_getservicelist(dev) (dev->serviceList) + +/** + * Get the number of services known by the device + * + * \param dev Device in question + * @return The number of devices in the control point's device list + */ +#define cg_upnp_device_getnservices(dev) cg_upnp_servicelist_size(dev->serviceList) + +/** + * Get a service from from the device + * + * \param dev Device in question + * \param idx Device index number + * + */ +//Theo Beisch : added missing (CgList*) cast +#define cg_upnp_device_getservice(dev,idx) ((CgUpnpService *)cg_list_get((CgList *)dev->serviceList,idx)) + +/** + * \todo Correct explanation... + * + * \param dev Device in question + * + */ +#define cg_upnp_device_getservices(dev) ((CgUpnpService *)cg_list_gets((CgList *)dev->serviceList)) + +/** + * Find service from the device by a given serviceId. + * This function searches recursively device and its subdevices + * for a service with a given serviceId + * + * \param dev Device in question + * \param serviceId serviceId of the service + * \return service matching the given serviceId + */ +CgUpnpService *cg_upnp_device_getservicebyserviceid(CgUpnpDevice *dev, + char *serviceId); + +/** + * Find a service from the device by the type of the service. + * This function searches for services, whose *complete type string* + * matches the given string, including version number. For example: + * "urn:schemas-upnp-org:service:ContentDirectory:1". If you need to + * know the version of a service, use \ref cg_upnp_servicetype_getversion + * + * \param dev Device in question + * \param type Type of the service + * + */ +CgUpnpService *cg_upnp_device_getservicebyexacttype(CgUpnpDevice *dev, + char *type); + +/** + * Find a service from the device by the type of the service. + * This function searches for services, whose *type* part of the service type + * string matches the given string. For example: "ContentDirectory". + * If you need to search for an exact service type, use + * \ref cg_upnp_device_getservicebyname + * + * \param dev Device in question + * \param type Type of the service + * + */ +CgUpnpService *cg_upnp_device_getservicebytype(CgUpnpDevice *dev, char *type); + +/** + * Find a service from the device by the subscribtion ID + * + * \param dev Device in question + * \param sid Subscription ID of the service + */ +CgUpnpService *cg_upnp_device_getservicebysid(CgUpnpDevice *dev, char *sid); + +/** + * Find a service from the device by the SCPD (Service Control Protocol Definition) URL of the service. + * + * \param dev Device in question + * \param url SCPD URL + * + */ +CgUpnpService *cg_upnp_device_getservicebyscpdurl(CgUpnpDevice *dev, char *url); + +/** + * Find a service from a device by its control URL + * + * \param dev Device in question + * \param url Control URL + * + */ +CgUpnpService *cg_upnp_device_getservicebycontrolurl(CgUpnpDevice *dev, char *url); + +/** + * Find a service from a device by its event subscription URL + * + * \param dev Device in question + * \param url Event Subscription URL + * + */ +CgUpnpService *cg_upnp_device_getservicebyeventsuburl(CgUpnpDevice *dev, char *url); + +/** + * Find a service from its Subscription ID + * + * \param dev Device in question + * \param char* Subscription-ID (SID) + * + */ +CgUpnpService *cg_upnp_device_getservicebysid(CgUpnpDevice *dev, char *sid); + + +/***************************************************************************** + * Embedded IconList + *****************************************************************************/ + +/** + * Get the device's list of icons + * + * \param dev Device in question + * + */ +#define cg_upnp_device_geticonlist(dev) (dev->iconList) + +/** + * Get an icon by its index from the device's list of icons + * + * \param dev Device in question + * \param idx Icon index number + * + */ +#define cg_upnp_device_geticon(dev,idx) ((CgUpnpIcon *)cg_list_get((CgList *)dev->iconList,idx)) + +/** + * \todo Correct explanation... + * + * \param dev Device in question + * + */ +#define cg_upnp_device_geticons(dev) ((CgUpnpIcon *)cg_list_gets((CgList *)dev->iconList)) + +/** +* Get a smallest icon +* +* \param dev Device in question +* +* \return A smallest icon. +*/ +CgUpnpIcon *cg_upnp_device_getsmallesticon(CgUpnpDevice *dev); + +/** + * Get a smallest icon of a specified mime type + * + * \param dev Device in question + * \param mimeType Mime type to get + * + * \return A smallest icon. +*/ +CgUpnpIcon *cg_upnp_device_getsmallesticonbymimetype(CgUpnpDevice *dev, char *mimeType); + +/** + * Get an icon by its index from the device's list of icons + * + * \param dev Device in question + * \param icon Icon in question + * \param buf Buffer to return the full icon's url + * + * \return TRUE if the absolute url is created, otherwise FALSE. + */ +BOOL cg_upnp_device_getabsoluteiconurl(CgUpnpDevice *dev, CgUpnpIcon *icon, CgString *buf); + +/** +* Get a smallest icon + * + * \param dev Device in question + * \param icon Icon to add + * + */ +BOOL cg_upnp_device_addicon(CgUpnpDevice *dev, CgUpnpIcon *icon); + +/***************************************************************************** + * Embedded Action + *****************************************************************************/ + +/** + * Find an action from a device by its name + * + * \param dev Device in question + * \param name Name of the action + * + */ +CgUpnpAction *cg_upnp_device_getactionbyname(CgUpnpDevice *dev, char *name); + +/***************************************************************************** + * Embedded StateVariable + *****************************************************************************/ + +/** + * Find a state variable from a device by its name + * + * \param dev Device in question + * \param name Name of the state variable + * + */ +CgUpnpStateVariable *cg_upnp_device_getstatevariablebyname(CgUpnpDevice *dev, char *name); + +/***************************************************************************** + * Function (DeviceList) + *****************************************************************************/ + +/** + * Create a new device list + * + */ +CgUpnpDeviceList *cg_upnp_devicelist_new(); + +/** + * Delete a device list completely, freeing all devices and their contents. + * + * \param devList The device list to delete + * + */ +void cg_upnp_devicelist_delete(CgUpnpDeviceList *devList); + +/** + * Clear the contents of a device list. + * Use \ref cg_upnp_devicelist_delete instead of this function. + * + * \param devList The device list to clear + * + */ +#define cg_upnp_devicelist_clear(devList) cg_list_clear((CgList *)devList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_device_delete) + +/** + * Get the size of the device list + * + * \param devList The device list + * + */ +#define cg_upnp_devicelist_size(devList) cg_list_size((CgList *)devList) + +/** + * \todo Correct description + * + * \param devList The device list + * + */ +#define cg_upnp_devicelist_gets(devList) (CgUpnpDevice *)cg_list_next((CgList *)devList) + +/** + * Get an device from the device list by the index + * + * \param devList The device list + * \param index The index of the device to get + * + */ +#define cg_upnp_devicelist_get(devList, index) (CgUpnpDevice *)cg_list_get((CgList *)devList, index) + +/** + * Add a device to the device list + * + * \param devList The device list + * \param dev The device to add + * + */ +#define cg_upnp_devicelist_add(devList, dev) cg_list_add((CgList *)devList, (CgList *)dev) + +/**************************************** +* Function (Service) +****************************************/ + +/** + * Get the device associated to the given service + * + * \param service The service in question + * + */ +//Theo Beisch: namespace conflict - removed duplicate - already defined in cservice.h +//#define cg_upnp_service_getdevice(service) ((CgUpnpDevice *)service->parentDevice) + +/** + * Get the root device of the given service + * + * \param service The service in question + * + */ +//Theo Beisch: namespace conflict - removed duplicate - already defined in cservice.h +//#define cg_upnp_service_getrootdevice(service) cg_upnp_device_getrootdevice((CgUpnpDevice *)service->parentDevice) + +/***************************************************************************** +* Function (HTTP) +******************************************************************************/ + +/***************************************************************************** + * HTTP Port + *****************************************************************************/ + +/** + * Modify the port that the device's HTTP server is listening + * + * \param dev The device in question + * \param value Port number + * + */ +#define cg_upnp_device_sethttpport(dev,value) (dev->httpPort = value) + +/** + * Get the device's HTTP port + * + * \param dev The device in question + * + */ +#define cg_upnp_device_gethttpport(dev) (dev->httpPort) + +/** + * Set an HTTP listener function to the device + * + * \param dev The device in question + * \param func The listener function + * + */ +#define cg_upnp_device_sethttplistener(dev, func) (dev->httpListener = func) + +/** + * Get the device's HTTP listener function + * + * \param dev The device in question + * + */ +#define cg_upnp_device_gethttplistener(dev) (dev->httpListener) + +/** + * Get the HTTP server list + * + * \param dev The device in question + * + */ +#define cg_upnp_device_gethttpserverlist(dev) (dev->httpServerList) + +/** + * Handler function for a received HTTP request. Delegates GET and POST requests + * to their respective handlers, or treats as a BAD REQUEST, when appropriate. + * + * \param httpReq Received HTTP request + * + */ +void cg_upnp_device_httprequestrecieved(CgHttpRequest *httpReq); + +/***************************************************************************** + * Function (SSDP) + *****************************************************************************/ + +/** + * Get the device's list of SSDP servers + * + * \param dev The device in question + * + */ +#define cg_upnp_device_getssdpserverlist(dev) (dev->ssdpServerList) + +/** + * The SSDP message handler function. + * + * \param ssdpPkt SSDP Packet + * + */ +void cg_upnp_device_ssdplistener(CgUpnpSSDPPacket *ssdpPkt); + +/** + * Get the SSDP server list + * + * \param dev The device in question + * + */ +#define cg_upnp_device_getssdpserverlist(dev) (dev->ssdpServerList) + +/** + * Get the device's Notification Type (NT). For the root device this is "upnp:rootdevice", + * otherwise the device's UDN (Unique Device Name). + * + * \param dev The device in question + * \param buf Buffer for the Notification Type + * \param bufSize Buffer length + * + */ +char *cg_upnp_device_getnotifydevicent(CgUpnpDevice *dev, char *buf, int bufSize); + +//Theo Beisch: added reference +/** + * Get the device's USN (Unique Service Name). + * For the root device this is "::upnp:rootdevice", + * otherwise the UDN (Unique Device Name). + * + * \param dev The device in question + * + */ +char *cg_upnp_device_getnotifydeviceusn(CgUpnpDevice *dev, char *buf, int bufSize); + +/** + * Get the device type + * + * \param dev The device in question + * \param buf Buffer for the device type + * \param bufSize Buffer length + * + */ +char *cg_upnp_device_getnotifydevicetypent(CgUpnpDevice *dev, char *buf, int bufSize); + +/** + * Get the device's USN (Unique Service Name). For the root device this is "::upnp:rootdevice", + * otherwise the UDN (Unique Device Name). + * + * \param dev The device in question + * @param buf Buffer where USN is stored after call + * @param bufSize Buffer size + * + * @return Pointer to buf + */ +char *cg_upnp_device_getnotifydevicetypeusn(CgUpnpDevice *dev, char *buf, int bufSize); + +/** + * SSDP message handler + * + * \param dev The device in question + * \param ssdpPkt Received SSDP packet + * + */ +void cg_upnp_device_ssdpmessagereceived(CgUpnpDevice *dev, CgUpnpSSDPPacket *ssdpPkt, int filter); + +/** + * Post a response to an SSDP search message + * + * \param dev The device in question + * \param ssdpPkt Received SSDP packet + * \param st Service Type (ST) + * \param usn Unique Service Name (USN) + * + */ +BOOL cg_upnp_device_postsearchresponse(CgUpnpDevice *dev, CgUpnpSSDPPacket *ssdpPkt, char *st, char *usn); + +/** + * Notify device that IP address of the host has been changed. + * + * \param dev dev The device in question + * \return success of changing used interfaces + */ +BOOL cg_upnp_device_ipchanged(CgUpnpDevice *dev); + +/***************************************************************************** + * Function (SSDPPacket) + *****************************************************************************/ + +/** + * Get the device's SSDP packet + * + * \param dev The device in question + * + */ +#define cg_upnp_device_getssdppacket(dev) (dev->ssdpPkt) + +/** + * Modify the device's SSDP packet (creates a copy of the original) + * + * \param dev The device in question + * \param srcSsdpPkt The SSDP packet + * + */ +#define cg_upnp_device_setssdppacket(dev, srcSsdpPkt) cg_upnp_ssdp_packet_copy(dev->ssdpPkt, srcSsdpPkt) + +/** + * Extract location information from the device's SSDP packet + * + * \param dev The device in question + * + */ +#define cg_upnp_device_getlocationfromssdppacket(dev) cg_upnp_ssdp_packet_getlocation(dev->ssdpPkt) + +/** + * Extract the interface address from the device's SSDP packet + * + * \param dev The device in question + * + */ +#define cg_upnp_device_getinterfaceaddressfromssdppacket(dev) cg_upnp_ssdp_packet_getlocaladdress(dev->ssdpPkt) + +/**************************************** +* Function (Advertiser) +****************************************/ + +/** + * Start the advertiser thread for the given device + * + * \param dev The device in question + */ +BOOL cg_upnp_device_advertiser_start(CgUpnpDevice *dev); + +/** + * Stop the advertiser thread for the given device + * + * \param dev The device in question + */ +BOOL cg_upnp_device_advertiser_stop(CgUpnpDevice *dev); + +/** + * Check if the advertiser has been started + * + * \param dev Device that is being advertised + */ +BOOL cg_upnp_device_advertiser_isrunning(CgUpnpDevice *dev); + +/** + * Get the advertiser thread from the device + * + * \param dev The device in question + */ +#define cg_upnp_device_getadvertiserthead(dev) (dev->advertiser) + +#ifdef __cplusplus + +} /* extern C */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cdictionary.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cdictionary.h new file mode 100644 index 0000000..f7a1cdd --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cdictionary.h @@ -0,0 +1,188 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cdictionary.h +* +* Revision: +* +* 05/26/09 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UTIL_CDICTIONARY_H_ +#define _CG_UTIL_CDICTIONARY_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** + * Define + ****************************************/ + +/**************************************** + * Data Type + ****************************************/ + +/** + * \brief The generic wrapper struct for CyberLinkC's dictionarys. + * + * This wrapper has been created to enable 100% code + * compatibility between different platforms (Linux, Win32 etc..) + */ +typedef struct _CgDictionary { + BOOL headFlag; + struct _CgDictionary *prev; + struct _CgDictionary *next; + CgString *key; + CgString *value; +} CgDictionaryElement, CgDictionary; + +/**************************************** +* Function +****************************************/ + +/** + * Create a new dictionary + */ +CgDictionaryElement *cg_dictionary_element_new(); + +/** + * Destroy a dictionary. + * + * \param dirElem Dictionary to destroy + */ +BOOL cg_dictionary_element_delete(CgDictionaryElement *dirElem); + +/** + * Set a key + * + * \param dirElem Dictionary struct + * \param name String to set + */ +#define cg_dictionary_element_setkey(dirElem, name) cg_string_setvalue(dirElem->key, name) +/** + * Get a key + * + * \param dirElem Dictionary struct + */ +#define cg_dictionary_element_getkey(dirElem) cg_string_getvalue(dirElem->key) + +/** + * Set a value + * + * \param dirElem Dictionary struct + * \param value String to set + */ +#define cg_dictionary_element_setvalue(dirElem, val) cg_string_setvalue(dirElem->value, val) +/** + * Get a value + * + * \param dirElem Dictionary struct + */ +#define cg_dictionary_element_getvalue(dirElem) cg_string_getvalue(dirElem->value) + +#define cg_dictionary_element_next(dirElem) (CgDictionaryElement *)cg_list_next((CgList *)dirElem) +#define cg_dictionary_element_remove(dirElem) cg_list_remove((CgList *)dirElem) + +/**************************************** +* Function (Dictionary List) +****************************************/ + +/** + * Create a new dictionary list + * + * \return Dictionary list + */ +CgDictionary *cg_dictionary_new(); + +/** + * Destroy a dictionary list + * + * \param dir The dictionary list in question + */ +void cg_dictionary_delete(CgDictionary *dir); + +/** + * Clear the contents of a dictionary list + * + * \param dir Dictionary list in question + */ +#define cg_dictionary_clear(dir) cg_list_clear((CgList *)dir, (CG_LIST_DESTRUCTORFUNC)cg_dictionary_element_delete) + +/** + * Get the size of a dictionary list + * + * \param dir The dictionary list in question + */ +#define cg_dictionary_size(dir) cg_list_size((CgList *)dir) + +/** + * Get the first actual item from a dictionary list to use as an iterator + * + * \param dir The dictionary list in question + */ +#define cg_dictionary_gets(dir) (CgDictionaryElement *)cg_list_next((CgList *)dir) + +/** + * Add a dictionary into a dictionary list + * + * \param dir The dictionary list in question + * \param dirElem The dictionary to add to the list + */ +#define cg_dictionary_add(dir, dirElem) cg_list_add((CgList *)dir, (CgList *)dirElem) + +/** + * Remove a dictionary from dictionary list + * + * \param dirElem The dictionary to be removed + */ +#define cg_dictionary_remove(dirElem) cg_list_remove((CgList *)dirElem) + +/** + * Get a element of the specified key + * + * \param dir The dictionary list in question + * \param key Name to search. + * \return Element of the specified key. + */ +CgDictionaryElement *cg_dictionary_get(CgDictionary *dir, char *key); + +/** + * Set a new element into a dictionary + * + * \param dir The dictionary list in question + * \param key Name to set. + * \param value Value to set. + */ +void cg_dictionary_setvalue(CgDictionary *dir, char *key, char *value); + +/** + * Get a value of the specified key + * + * \param dir The dictionary list in question + * \param key Name to search. + * \return Value of the specified key. + */ +char *cg_dictionary_getvalue(CgDictionary *dir, char *key); + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cevent.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cevent.h new file mode 100644 index 0000000..ca40618 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cevent.h @@ -0,0 +1,563 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cevent.h +* +* Revision: +* +* 06/20/05 +* - first revision +* 03/28/06 Theo Beisch +* - modified cg_upnp_eventlistenerlist_clear to use +* default destructor in clist +* - added cg_upnp_event_subscription_request_hasnt +* - changed _subscription function signature to use (service) +* instead of (remoteAddress) +* +******************************************************************/ + +#ifndef _CG_UPNP_CEVENT_H_ +#define _CG_UPNP_CEVENT_H_ + +#include + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/** + * Definition for SID size + */ +#define CG_UPNP_SUBSCRIPTION_SID_SIZE (CG_UPNP_UUID_MAX_LEN + 8) + +/** + * Definition for SID header size + */ +#define CG_UPNP_SUBSCRIPTION_SID_HEADER_SIZE (5 + CG_UPNP_SUBSCRIPTION_SID_SIZE) + +/** + * Definition for subscription xml namespace + */ +#define CG_UPNP_SUBSCRIPTION_XMLNS "urn:schemas-upnp-org:event-1-0" + +/** + * Definition for subscription timeout header prefix + */ +#define CG_UPNP_SUBSCRIPTION_TIMEOUT_HEADER "Second-" + +/** + * Definition for infinite string in subscription + */ +#define CG_UPNP_SUBSCRIPTION_INFINITE_STRING "infinite" + +/** + * Definition for infinite value in subscription + */ +#define CG_UPNP_SUBSCRIPTION_INFINITE_VALUE (-1) + +/** + * Definition for subscription uuid prefix + */ +#define CG_UPNP_SUBSCRIPTION_UUID "uuid:" + +/** + * Definition for subscription callback start tag + */ +#define CG_UPNP_SUBSCRIPTION_CALLBACK_START_WITH "<" + +/** + * Definition for subscription callback end tag + */ +#define CG_UPNP_SUBSCRIPTION_CALLBACK_END_WITH ">" + +/** + * Definition for subscription delay + */ +#define CG_UPNP_SUBSCRIPTION_DELAY 30 + +/** + * Definition for maximum event sequence number + */ +#define CG_UPNP_EVENT_MAX_SEQ 2147483647 + +/** + * Definition for maximum upnp subscription timeout + */ +#define CG_UPNP_SUBSCRIPTION_MAX_TIMEOUT 300 + +/**************************************** +* Data Type +****************************************/ + +/** + * Type definition for subsription request + */ +typedef CgHttpRequest CgUpnpSubscriptionRequest; + +/** + * Type definition for subsrciption response + */ +typedef CgHttpResponse CgUpnpSubscriptionResponse; + +/** + * Type definition for event listener callback + */ +typedef void (*CG_UPNP_EVENT_LISTENER)(CgUpnpProperty *); + +/** + * Type definition for event listener list + */ +typedef struct _CgUpnpEventListenerList { + /** Used by cg_list_* functions to indicate start of list */ + BOOL headFlag; + /** Used by cg_list_* functions to point to the previous item in list */ + struct _CgUpnpEventListenerList *prev; + /** Used by cg_list_* functions to point to the next item in list */ + struct _CgUpnpEventListenerList *next; + + CG_UPNP_EVENT_LISTENER listener; +} CgUpnpEventListenerList; + +/**************************************** +* Function +****************************************/ + +/** + * Create timeout header string + * + * @param time Timeout + * @param buf Buffer used when creating header string + * + * @return Timeout header C string + */ +char *cg_upnp_event_subscription_totimeoutheaderstring(long time, CgString *buf); + +/** + * Get event subscription timeout + * + * @param headerValue Header value + * + * @return Timeout + */ +long cg_upnp_event_subscription_gettimeout(char *headerValue); + +/** + * Create SID for subscription + * + * @param buf Character buffer where SID is created + * @param bufSize Buffer size. + * + * @return Pointer to buffer containing SID + */ +char * cg_upnp_event_subscription_createsid(char *buf, int bufSize); + +/** + * Creates SID header string + * + * @param sid Character array containing the SID + * @param buf A buffer where header string is created + * @param bufSize Size of the used buffer + * + * @return Pointer to buffer containing SID header string + */ +char *cg_upnp_event_subscription_tosidheaderstring(char *sid, char *buf, int bufSize); + +/** + * Get SID + * + * @param headerValue Raw header C string + * + * @return C string containing SID + */ +char *cg_upnp_event_subscription_getsid(char *headerValue); + +/**************************************** +* Function (Request) +****************************************/ + +/** + * Subscription request constructor + * + * @return Pointer to newly created subsription request + */ +#define cg_upnp_event_subscription_request_new() cg_http_request_new(); + +/** + * Subscription request destructor + * + * @param subReq Reference to the subscription request to be deleted + */ +#define cg_upnp_event_subscription_request_delete(subReq) cg_http_request_delete(subReq); + +/** + * Checks if request type is subscription request + * + * @param subReq The request to be checked + * + * @return True if request is subscription request, false otherwise + */ +#define cg_upnp_event_subscription_issubscriberequest(subReq) cg_streq(cg_http_request_getmethod(subReq), CG_HTTP_SUBSCRIBE) + +/** + * Checks if request type is unsubscription request + * + * @param subReq The request to be checked + * + * @return True if request is unsubscription request + */ +#define cg_upnp_event_subscription_isunsubscriberequest(subReq) cg_streq(cg_http_request_getmethod(subReq), CG_HTTP_UNSUBSCRIBE) + +/**** SID ****/ + +/** + * Set sid to subscription request + * + * @param subReq Subscription request + * @param sid SID (Subscription id) + */ +void cg_upnp_event_subscription_request_setsid(CgUpnpSubscriptionRequest *subReq, char *sid); + +/** + * Get sid from subscription request + * + * @param subReq Subscription request + * + * @return Character array containing the requested SID + */ +#define cg_upnp_event_subscription_request_getsid(subReq) cg_upnp_event_subscription_getsid(cg_http_packet_getheadervalue(((CgHttpPacket*)subReq), CG_HTTP_SID)) + +/** + * Checks if subscription object has SID + * + * @param subReq Subscription request + * + * @return True if subscription has SID, false otherwise + */ +#define cg_upnp_event_subscription_request_hassid(subReq) cg_http_packet_hasheader(((CgHttpPacket*)subReq), CG_HTTP_SID) + +/**** NT ****/ + +/** + * Set NT (Notification target) for subscription request + * + * @param subReq Subscription request + * @param value Notification type + */ +#define cg_upnp_event_subscription_request_setnt(subReq, value) cg_http_packet_setheadervalue(((CgHttpPacket*)subReq), CG_HTTP_NT, value) + +/** + * Get NT from subscription request + * + * @param subReq Subscription request + * + * @return Character array containing the NT header value + */ +#define cg_upnp_event_subscription_request_getnt(subReq) cg_http_packet_getheadervalue(((CgHttpPacket*)subReq), CG_HTTP_NT) + +/** + * Checks if subscription request has NT + * + * @param subReq Subscription request + * + * @return True if subscription request contains NT, false otherwise + */ +#define cg_upnp_event_subscription_request_hasnt(subReq) cg_http_packet_hasheader(((CgHttpPacket*)subReq), CG_HTTP_NT) + +/**** Callback ****/ + +/** + * Set subscription request callback URL + * + * @param subReq Subscription request + * @param value Callback URL string + */ +#define cg_upnp_event_subscription_request_setcallback(subReq, value) cg_http_packet_setheadervalue(((CgHttpPacket*)subReq), CG_HTTP_CALLBACK, value) + +/** + * Get subscription callback URL + * + * @param subReq Subscription request + * + * @return Character array containing the callback URL + */ +#define cg_upnp_event_subscription_request_getcallback(subReq) cg_http_packet_getheadervalue(((CgHttpPacket*)subReq), CG_HTTP_CALLBACK) + +/** + * Checks if subscription request has callback URL + * + * @param subReq Subscription request + * + * @return True if subscription request has callback URL, false otherwise + */ +#define cg_upnp_event_subscription_request_hascallback(subReq) cg_http_packet_hasheader(((CgHttpPacket*)subReq), CG_HTTP_CALLBACK) + +/**** Timeout ****/ + +/** + * Set timeout for subscription request + * + * @param subReq Subscription request + * @param timeout Timeout value for subscription request + */ +void cg_upnp_event_subscription_request_settimeout(CgUpnpSubscriptionRequest *subReq, long timeout); + +/** + * Get timeout value from subscription request + * + * @param subReq Subscription request + */ +#define cg_upnp_event_subscription_request_gettimeout(subReq) cg_upnp_event_subscription_gettimeout(cg_http_packet_getheadervalue(((CgHttpPacket*)subReq), CG_HTTP_TIMEOUT)) + +/**** Subscription Content ****/ + +/** + * (Re)initializes subscription request + * + * @param subReq Subscription request + * @param service Service to be subscribed + * @param callback URL to be called when service state changes + * @param timeout Subscription timeout + */ +void cg_upnp_event_subscription_request_setnewsubscription(CgUpnpSubscriptionRequest *subReq, CgUpnpService *service, char *callback, long timeout); + +/** + * (Re)initializes subscription request to be renewal request + * + * @param subReq Subscription request + * @param service Service to be subscribed + * @param uuid Devices unique identification string + * @param timeout Subscription timeout + */ +void cg_upnp_event_subscription_request_setrenewsubscription(CgUpnpSubscriptionRequest *subReq, CgUpnpService *service, char *uuid, long timeout); + +/** + * (Re)initializes subscription request to be unsubscription request + * + * @param subReq Subscription request + * @param service Service where to be unsubscribed + */ +void cg_upnp_event_subscription_request_setunsubscription(CgUpnpSubscriptionRequest *subReq, CgUpnpService *service); + +/**** Host ****/ + +/** + * Set HTTP host header value + * + * @param subReq Subscription request + * @param value HTTP Host: header content + */ +#define cg_upnp_event_subscription_request_sethost(subReq, value) cg_http_packet_setheadervalue(((CgHttpPacket*)subReq), CG_HTTP_HOST, value) + +/** + * Get host header value from subscription request + * + * @param subReq Subscription request + */ +#define cg_upnp_event_subscription_request_gethost(subReq) cg_http_packet_getheadervalue(((CgHttpPacket*)subReq), CG_HTTP_HOST) + +/** + * Send subscription request to device + * + * @param subReq Subscription request + */ +#define cg_upnp_event_subscription_request_post(subReq) cg_http_request_post(subReq, cg_net_url_gethost(cg_http_request_getposturl(subReq)), cg_net_url_getport(cg_http_request_getposturl(subReq))) + +/** + * Send response to subscription request + * + * @param subReq Subscription request + * @param subRes Subscription response + */ +#define cg_upnp_event_subscription_request_postresponse(subReq, subRes) cg_http_request_postresponse(subReq, subRes) + +/**************************************** +* Function (Response) +****************************************/ + +/** + * Constructor for subscription response + */ +#define cg_upnp_event_subscription_response_new() cg_http_response_new(); + +/** + * Destructor for subscription response + * + * @param subRes Subscription response + */ +#define cg_upnp_event_subscription_response_delete(subRes) cg_http_response_delete(subRes); + +/** + * Checks if subscription was successfull by checking status code from subscription response + * + * @param subRes Subscription response + */ +#define cg_upnp_event_subscription_response_issuccessful(subRes) cg_http_response_issuccessful(subRes) + +/**** Status Code ****/ + +/** + * Set status code for subscription response + * + * @param subRes Subscription response + * @param code Status code + */ +#define cg_upnp_event_subscription_response_setstatuscode(subRes, code) cg_http_response_setstatuscode(subRes, code) + +/** + * Get status code from subscription response object + * + * @param subRes Subscription response + * @param code Status code + * + * @return Status code + * + * \bug Status code is not needed here! (It is not even passed to the wrapped function) + */ +#define cg_upnp_event_subscription_response_getstatuscode(subRes, code) cg_http_response_getstatuscode(subRes) + +/**** SID ****/ + +/** + * Set SID (Subscription ID) for response + * + * @param subRes Subscription response + * @param sid Subscription ID + */ +void cg_upnp_event_subscription_response_setsid(CgUpnpSubscriptionResponse *subRes, char *sid); + +/** + * Get SID + * + * @param subRes Subscription request + * + * @return C string containing SID + */ +#define cg_upnp_event_subscription_response_getsid(subRes) cg_upnp_event_subscription_getsid(cg_http_packet_getheadervalue(((CgHttpPacket*)subRes), CG_HTTP_SID)) + +/**** Timeout ****/ + +/** + * Set HTTP timeout for subscription response + * + * @param subRes Subscription response + * @param value Timeout + */ +void cg_upnp_event_subscription_response_settimeout(CgUpnpSubscriptionResponse *subRes, long value); + +/** + * Get timeout value from subscription response + * + * @param subRes Subscription response + * + * @return C string containing the timeout + */ +#define cg_upnp_event_subscription_response_gettimeout(subRes) cg_upnp_event_subscription_gettimeout(cg_http_packet_getheadervalue(((CgHttpPacket*)subRes), CG_HTTP_TIMEOUT)) + +/** + * Set response code for subscription response + * + * @param subRes Subscription response + * @param code Response code + */ +void cg_upnp_event_subscription_subscriberesponse_setresponse(CgUpnpSubscriptionResponse *subRes, int code); +/* TODO getter? */ + +/**************************************** +* Function (Eventlistener list) +****************************************/ + +/** +* Create a new event listener list +* +*/ +CgUpnpEventListenerList *cg_upnp_eventlistenerlist_new(); + +/** +* Delete a event listener list. +* +* \param eventListenerList The event listener list to delete +* +*/ +void cg_upnp_eventlistenerlist_delete(CgUpnpEventListenerList *eventListenerList); + +/** +* Clear the contents of a event listener list. +* +* \param eventListenerList The device list to clear +* +*/ +#define cg_upnp_eventlistenerlist_clear(eventListenerList) cg_list_clear((CgList *)eventListenerList, (CG_LIST_DESTRUCTORFUNC)free) + +/** +* Get the size of the device list +* +* \param eventListenerList The device list +* +*/ +#define cg_upnp_eventlistenerlist_size(eventListenerList) cg_list_size((CgList *)eventListenerList) + +/** +* Fetches next list element from event listener list +* +* @param eventListenerList Event listener list +*/ +#define cg_upnp_eventlistenerlist_gets(eventListenerList) (CgUpnpEventListenerList*)cg_list_next((CgList *)eventListenerList) + +/** +* Fetches next list element from event listener list +* +* @param eventListenerList Event listener list +*/ +#define cg_upnp_eventlistenerlist_next(eventListenerList) (CgUpnpEventListenerList*)cg_list_next((CgList *)eventListenerList) + +/** +* Remove a listener from the event listener list +* +* \param eventListenerList The event listener list +* \param listener The listener to remove +* +*/ +void cg_upnp_eventlistenerlist_remove(CgUpnpEventListenerList* eventListenerList, CG_UPNP_EVENT_LISTENER listener); + +/** +* Add a listener to the event listener list +* +* \param eventListenerList The event listener list +* \param listener The listener to add +* +*/ +void cg_upnp_eventlistenerlist_add(CgUpnpEventListenerList* eventListenerList, CG_UPNP_EVENT_LISTENER listener); + +/** + * Call all event listeners in the list with the given data. + * + * @param eventListenerList The list to iterate thru + * @param property The property that has been evented + */ +void cg_upnp_eventlistenerlist_notify(CgUpnpEventListenerList* eventListenerList, CgUpnpProperty *property); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cfile.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cfile.h new file mode 100644 index 0000000..608eb58 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cfile.h @@ -0,0 +1,189 @@ +/****************************************************************** +* +* CyberIO for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cfile.h +* +* Revision: +* +* 02/1/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_IO_CFILE_H_ +#define _CG_IO_CFILE_H_ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(WIN32) || defined(WINCE) +#define CG_USE_CFILE 1 +#endif + +#if defined(CG_USE_CFILE) + +/**************************************** +* Define +****************************************/ + +#if defined(WIN32) +#define CG_FILE_SEPARATOR_CHAR '\\' +#define CG_FILE_PATH_SEPARATOR_CHAR ';' +#define CG_FILE_SEPARATOR "\\" +#define CG_FILE_PATH_SEPARATOR ";" +#else +#define CG_FILE_SEPARATOR_CHAR '/' +#define CG_FILE_PATH_SEPARATOR_CHAR ':' +#define CG_FILE_SEPARATOR "/" +#define CG_FILE_PATH_SEPARATOR ":" +#endif + +#define CG_FILE_READ_CHUNK_SIZE 1024 + +#define CG_FILE_OPEN_READ 0x01 +#define CG_FILE_OPEN_WRITE 0x02 +#define CG_FILE_OPEN_CREATE 0x04 + +#define CG_FILE_SEEK_SET 0x01 +#define CG_FILE_SEEK_CUR 0x02 +#define CG_FILE_SEEK_END 0x04 + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgFile { + BOOL headFlag; + struct _CgFile *prev; + struct _CgFile *next; + CgString *name; + CgString *path; + char *content; + FILE *fp; +} CgFile, CgFileList; + +/**************************************** +* Function +****************************************/ + +CgFile *cg_file_new(); +void cg_file_delete(CgFile *file); + +#define cg_file_next(file) (CgFile *)cg_list_next((CgList *)file) + +void cg_file_setname(CgFile *file, char *name); + +#define cg_file_setpath(file, value) cg_file_setname(file, value) +void cg_file_setfilename(CgFile *file, char *value); +#define cg_file_addfilename(file, value) cg_file_setfilename(file, value) + +char *cg_file_getname(CgFile *file); +long cg_file_getlength(CgFile *file); + +long cg_file_getlastmodified(CgFile *file); +long cg_file_getlength(CgFile *file); +BOOL cg_file_exists(CgFile *file); +BOOL cg_file_remove(CgFile *file); + +void cg_file_setcontent(CgFile *file, char *content); +char *cg_file_getcontent(CgFile *file); + +char *cg_file_getfilename(CgFile *file); +char *cg_file_getpath(CgFile *file); + +BOOL cg_file_load(CgFile *file); +BOOL cg_file_save(CgFile *file); + +int cg_file_listfiles(CgFile *file, CgFileList *fileList); + +#define cg_file_isseparatorchar(c) ((CG_FILE_SEPARATOR_CHAR == c) ? TRUE : FALSE) +#define cg_file_ispathseparatorchar(c) ((CG_FILE_PATH_SEPARATOR_CHAR == c) ? TRUE : FALSE) + +/* Raw Functions */ +BOOL cg_file_open(CgFile *file, int flag); +BOOL cg_file_close(CgFile *file); +BOOL cg_file_write(CgFile *file, CgByte *buf, int bufLen); +BOOL cg_file_read(CgFile *file, CgByte *buf, int bufLen); +BOOL cg_file_seek(CgFile *file, CgInt64, int whence); + +/**************************************** +* Function (File List) +****************************************/ + +/** + * Create a new file list + * + * \return File list + */ +CgFileList *cg_filelist_new(); + +/** + * Destroy a file list + * + * \param fileList The file list in question + */ +void cg_filelist_delete(CgFileList *fileList); + +/** + * Clear the contents of a file list + * + * \param fileList File list in question + */ +#define cg_filelist_clear(fileList) cg_list_clear((CgList *)fileList, (CG_LIST_DESTRUCTORFUNC)cg_file_delete) + +/** + * Get the size of a file list + * + * \param fileList The file list in question + */ +#define cg_filelist_size(fileList) cg_list_size((CgList *)fileList) + +/** + * Get the first actual item from a file list to use as an iterator + * + * \param fileList The file list in question + */ +#define cg_filelist_gets(fileList) (CgFile *)cg_list_next((CgList *)fileList) + +/** + * Add a file into a file list + * + * \param fileList The file list in question + * \param file The file to add to the list + */ +#define cg_filelist_add(fileList, file) cg_list_add((CgList *)fileList, (CgList *)file) + +/** + * Remove a file from file list + * + * \param fileList The file list in question + * \param file The file to be removed + */ +#define cg_filelist_remove(file) cg_list_remove((CgList *)file) + +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/chttp.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/chttp.h new file mode 100644 index 0000000..52f023a --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/chttp.h @@ -0,0 +1,615 @@ +/****************************************************************** +* +* CyberNet for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: chttp.h +* +* Revision: +* +* 01/25/05 +* - first revision +* +* 10/31/05 +* - Changed CHttpHeader* pointers to CHttpServer* pointers +* in CHttpServer struct. +* +* 16-Jan-06 Aapo Makela +* - Fixed header comparisons to be case-insensitive +* - Fixed iskeepaliveconnection to check "Connection:close" +* - Added M-POST specific stuff +* 04/03/06 Theo Beisch +* - added (CgHttpHeaderList*) cast (see below) +* - added LONGLONG macro for platform independence +* - some re-sorting of get/set macros (see below) +******************************************************************/ + +#ifndef _CG_HTTP_CHTTP_H_ +#define _CG_HTTP_CHTTP_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + + +#define CG_HTTP_READLINE_BUFSIZE 512 +#define CG_HTTP_SEVERNAME_MAXLEN 64 +#define CG_HTTP_DATE_MAXLEN 128 + +#define CG_HTTP_REQUESTLINE_DELIM "\r\n " +#define CG_HTTP_STATUSLINE_DELIM "\r\n " +#define CG_HTTP_HEADERLINE_DELIM "\r\n :" + +#define CG_HTTP_CR "\r" +#define CG_HTTP_LF "\n" +#define CG_HTTP_CRLF "\r\n" +#define CG_HTTP_SP " " +#define CG_HTTP_COLON ":" + +#define CG_HTTP_VER10 "HTTP/1.0" +#define CG_HTTP_VER11 "HTTP/1.1" + +#if !defined(CG_HTTP_CURL) +#define CG_HTTP_USERAGENT_DEFAULT "CyberGarage-HTTP/1.0" +#else +#define CG_HTTP_USERAGENT_DEFAULT "libcurl-agent/1.0 (Cyberlink for C)" +#endif + +#define CG_HTTP_DEFAULT_PORT 80 +#define CG_HTTS_DEFAULT_PORT 443 + +#define CG_HTTP_STATUS_CONTINUE 100 +#define CG_HTTP_STATUS_OK 200 +#define CG_HTTP_STATUS_PARTIAL_CONTENT 206 +#define CG_HTTP_STATUS_BAD_REQUEST 400 +#define CG_HTTP_STATUS_NOT_FOUND 404 +#define CG_HTTP_STATUS_METHOD_NOT_ALLOWED 405 +#define CG_HTTP_STATUS_PRECONDITION_FAILED 412 +#define CG_HTTP_STATUS_INVALID_RANGE 416 +#define CG_HTTP_STATUS_INTERNAL_SERVER_ERROR 500 + +#define CG_HTTP_POST "POST" +#define CG_HTTP_GET "GET" +#define CG_HTTP_HEAD "HEAD" + +#define CG_HTTP_HOST "HOST" +#define CG_HTTP_DATE "Date" +#define CG_HTTP_CACHE_CONTROL "Cache-Control" + #define CG_HTTP_NO_CACHE "no-cache" + #define CG_HTTP_MAX_AGE "max-age" +#define CG_HTTP_CONNECTION "Connection" + #define CG_HTTP_CLOSE "close" + #define CG_HTTP_KEEP_ALIVE "Keep-Alive" +#define CG_HTTP_CONTENT_TYPE "Content-Type" +#define CG_HTTP_CONTENT_LENGTH "Content-Length" +#define CG_HTTP_CONTENT_RANGE "Content-Range" + #define CG_HTTP_CONTENT_RANGE_BYTES "bytes" +#define CG_HTTP_LOCATION "Location" +#define CG_HTTP_SERVER "Server" +#define CG_HTTP_RANGE "Range" +#define CG_HTTP_TRANSFER_ENCODING "Transfer-Encoding" + #define CG_HTTP_CHUNKED "Chunked" +#define CG_HTTP_USERAGENT "User-Agent" + +/**** SOAP Extention ****/ +#define CG_HTTP_SOAP_ACTION "SOAPACTION" +#define CG_HTTP_SOAP_ACTION_WITH_NS "01-SOAPACTION" +#define CG_HTTP_SOAP_MAN_VALUE "\"http://schemas.xmlsoap.org/soap/envelope/\"; ns=01" + +/**** UPnP Extention ****/ +#define CG_HTTP_MPOST "M-POST" +#define CG_HTTP_MSEARCH "M-SEARCH" +#define CG_HTTP_NOTIFY "NOTIFY" +#define CG_HTTP_SUBSCRIBE "SUBSCRIBE" +#define CG_HTTP_UNSUBSCRIBE "UNSUBSCRIBE" + +#define CG_HTTP_ST "ST" +#define CG_HTTP_MX "MX" +#define CG_HTTP_MAN "MAN" +#define CG_HTTP_NT "NT" +#define CG_HTTP_NTS "NTS" +#define CG_HTTP_USN "USN" +#define CG_HTTP_EXT "EXT" +#define CG_HTTP_SID "SID" +#define CG_HTTP_SEQ "SEQ" +#define CG_HTTP_CALLBACK "CALLBACK" +#define CG_HTTP_TIMEOUT "TIMEOUT" + +/**** CURL connection timeout: 2 seconds ****/ +#define CG_HTTP_CURL_CONNECTTIMEOUT 2 + +/**** CURL total timeout: 30 seconds (UPnP DA: whole transfer: 30sec ****/ +#define CG_HTTP_CONN_TIMEOUT 30 + +/* HTTP server - client thread blocking timeout */ +#define CG_HTTP_SERVER_READ_TIMEOUT 120 + +/**** HTTP Status code reason phrases ****/ +#define CG_HTTP_REASON_100 "Continue" +#define CG_HTTP_REASON_101 "Switching Protocols" +#define CG_HTTP_REASON_200 "OK" +#define CG_HTTP_REASON_201 "Created" +#define CG_HTTP_REASON_202 "Accepted" +#define CG_HTTP_REASON_203 "Non-Authoritative Information" +#define CG_HTTP_REASON_204 "No Content" +#define CG_HTTP_REASON_205 "Reset Content" +#define CG_HTTP_REASON_206 "Partial Content" +#define CG_HTTP_REASON_300 "Multiple Choices" +#define CG_HTTP_REASON_301 "Moved Permanently" +#define CG_HTTP_REASON_302 "Found" +#define CG_HTTP_REASON_303 "See Other" +#define CG_HTTP_REASON_304 "Not Modified" +#define CG_HTTP_REASON_305 "Use Proxy" +#define CG_HTTP_REASON_307 "Temporary Redirect" +#define CG_HTTP_REASON_400 "Bad Request" +#define CG_HTTP_REASON_401 "Unauthorized" +#define CG_HTTP_REASON_402 "Payment Required" +#define CG_HTTP_REASON_403 "Forbidden" +#define CG_HTTP_REASON_404 "Not Found" +#define CG_HTTP_REASON_405 "Method Not Allowed" +#define CG_HTTP_REASON_406 "Not Acceptable" +#define CG_HTTP_REASON_407 "Proxy Authentication Required" +#define CG_HTTP_REASON_408 "Request Time-out" +#define CG_HTTP_REASON_409 "Conflict" +#define CG_HTTP_REASON_410 "Gone" +#define CG_HTTP_REASON_411 "Length Required" +#define CG_HTTP_REASON_412 "Precondition Failed" +#define CG_HTTP_REASON_413 "Request Entity Too Large" +#define CG_HTTP_REASON_414 "Request-URI Too Large" +#define CG_HTTP_REASON_415 "Unsupported Media Type" +#define CG_HTTP_REASON_416 "Requested range not satisfiable" +#define CG_HTTP_REASON_417 "Expectation Failed" +#define CG_HTTP_REASON_500 "Internal Server Error" +#define CG_HTTP_REASON_501 "Not Implemented" +#define CG_HTTP_REASON_502 "Bad Gateway" +#define CG_HTTP_REASON_503 "Service Unavailable" +#define CG_HTTP_REASON_504 "Gateway Time-out" +#define CG_HTTP_REASON_505 "HTTP Version not supported" + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgHttpHeader { + BOOL headFlag; + struct _CgHttpHeader *prev; + struct _CgHttpHeader *next; + CgString *name; + CgString *value; +} CgHttpHeader, CgHttpHeaderList; + +typedef struct _CgHttpPacket { + CgHttpHeaderList *headerList; + CgString *content; +} CgHttpPacket; + +typedef struct _CgHttpResponse { + CgHttpHeaderList *headerList; + CgString *content; + CgString *version; + int statusCode; + CgString *reasonPhrase; + void *userData; + int timeout; +} CgHttpResponse; + +typedef struct _CgHttpRequest { + CgHttpHeaderList *headerList; + CgString *content; + CgString *method; + CgString *uri; + CgString *version; + CgString *userAgent; + CgHttpResponse *httpRes; + CgSocket *sock; + CgNetURL *postURL; + void *userData; + int timeout; +} CgHttpRequest; + +typedef void (*CG_HTTP_LISTENER)(CgHttpRequest *); + +typedef struct _CgHttpServer { + BOOL headFlag; + struct _CgHttpServer *prev; + struct _CgHttpServer *next; + CgSocket *sock; + CgThread *acceptThread; + CgThreadList *clientThreads; + CG_HTTP_LISTENER listener; + void *userData; + int timeout; + CgMutex *mutex; +} CgHttpServer, CgHttpServerList; + +/**************************************** +* Function +****************************************/ + +/** + * Convert an HTTP status code to a reason phrase (ex. 200 -> "200 OK") + * + * @param code The HTTP status code to convert + * @return The reason phrase (do not modify the pointer's contents) + */ +const char *cg_http_statuscode2reasonphrase(const int code); + +/**************************************** +* Function (Header) +****************************************/ + +CgHttpHeader *cg_http_header_new(); +void cg_http_header_delete(CgHttpHeader *header); + +#define cg_http_header_next(header) (CgHttpHeader *)cg_list_next((CgList *)header) + +void cg_http_header_setname(CgHttpHeader *header, char *name); +char *cg_http_header_getname(CgHttpHeader *header); +void cg_http_header_setvalue(CgHttpHeader *header, char *value); +char *cg_http_header_getvalue(CgHttpHeader *header); + +/**************************************** +* Function (Header List) +****************************************/ + +CgHttpHeaderList *cg_http_headerlist_new(); +void cg_http_headerlist_delete(CgHttpHeaderList *headerList); + +#define cg_http_headerlist_clear(headerList) cg_list_clear((CgList *)headerList, (CG_LIST_DESTRUCTORFUNC)cg_http_header_delete) +#define cg_http_headerlist_size(headerList) cg_list_size((CgList *)headerList) +#define cg_http_headerlist_gets(headerList) (CgHttpHeader *)cg_list_next((CgList *)headerList) +#define cg_http_headerlist_add(headerList, header) cg_list_add((CgList *)headerList, (CgList *)header) + +CgHttpHeader *cg_http_headerlist_get(CgHttpHeaderList *headerList, char *name); +void cg_http_headerlist_set(CgHttpHeaderList *headerList, char *name, char *value); +char *cg_http_headerlist_getvalue(CgHttpHeaderList *headerList, char *name); + +/**************************************** +* Function (Packet) +****************************************/ + +CgHttpPacket *cg_http_packet_new(); +void cg_http_packet_delete(CgHttpPacket *httpPkt); +void cg_http_packet_init(CgHttpPacket *httpPkt); +void cg_http_packet_clean(CgHttpPacket *httpPkt); +void cg_http_packet_clear(CgHttpPacket *httpPkt); + +#define cg_http_packet_deleteallheaders(httpPkt) cg_http_headerlist_gets(httpPkt->headerList) +#define cg_http_packet_getnheaders(httpPkt) cg_http_headerlist_size(httpPkt->headerList) +#define cg_http_packet_getheaders(httpPkt) cg_http_headerlist_gets(httpPkt->headerList) +//Theo Beisch - added (CgHttpHeaderList*) cast - as _get is function call +#define cg_http_packet_getheader(httpPkt, name) cg_http_headerlist_get((CgHttpHeaderList*)httpPkt->headerList, name) +#define cg_http_packet_hasheader(httpPkt, name) ((cg_http_headerlist_get((CgHttpHeaderList*)httpPkt->headerList, name) != NULL) ? TRUE : FALSE) + +#define cg_http_packet_hasheadervalue(httpPkt, header, value) (cg_streq(cg_http_packet_getheadervalue((CgHttpPacket*)httpPkt, header),value)) + +#define cg_http_packet_addheader(httpPkt, header) cg_http_headerlist_add(httpPkt->headerList, header) + +void cg_http_packet_setheadervalue(CgHttpPacket *httpPkt, char* name, char *value); +void cg_http_packet_setheaderinteger(CgHttpPacket *httpPkt, char* name, int value); +void cg_http_packet_setheaderlong(CgHttpPacket *httpPkt, char* name, long value); +char *cg_http_packet_getheadervalue(CgHttpPacket *httpPkt, char* name); +int cg_http_packet_getheaderinteger(CgHttpPacket *httpPkt, char* name); +long cg_http_packet_getheaderlong(CgHttpPacket *httpPkt, char* name); +int cg_http_packet_getheadersize(CgHttpPacket *httpPkt); + +#if defined(CG_USE_INT64) +void cg_http_packet_setheaderlonglong(CgHttpPacket *httpPkt, char* name, CgInt64 value); +CgInt64 cg_http_packet_getheaderlonglong(CgHttpPacket *httpPkt, char* name); +#endif + +#define cg_http_packet_setcontent(httpPkt, value) cg_string_setvalue(httpPkt->content, value) +#define cg_http_packet_setncontent(httpPkt, value, len) cg_string_setnvalue(httpPkt->content, value, len) +#define cg_http_packet_appendncontent(httpPkt, value, len) cg_string_naddvalue(httpPkt->content, value, len) +#define cg_http_packet_setcontentpointer(httpPkt, value, len) cg_string_setpointervalue(httpPkt->content, value, len) +#define cg_http_packet_getcontent(httpPkt) cg_string_getvalue(httpPkt->content) + +void cg_http_packet_post(CgHttpPacket *httpPkt, CgSocket *sock); +void cg_http_packet_read_headers(CgHttpPacket *httpPkt, CgSocket *sock, char *lineBuf, int lineBufSize); +BOOL cg_http_packet_read_body( + CgHttpPacket *httpPkt, CgSocket *sock, char *lineBuf, int lineBufSize); +BOOL cg_http_packet_read(CgHttpPacket *httpPkt, CgSocket *sock, BOOL onlyHeader, char *lineBuf, int lineBufSize); + +/**** Content-Length ****/ +#if defined(CG_USE_INT64) +#define cg_http_packet_setcontentlength(httpPkt,value) cg_http_packet_setheaderlonglong(httpPkt,CG_HTTP_CONTENT_LENGTH,value) +#define cg_http_packet_getcontentlength(httpPkt) cg_http_packet_getheaderlonglong(httpPkt,CG_HTTP_CONTENT_LENGTH) +#else +#define cg_http_packet_setcontentlength(httpPkt,value) cg_http_packet_setheaderlong(httpPkt,CG_HTTP_CONTENT_LENGTH,value) +#define cg_http_packet_getcontentlength(httpPkt) cg_http_packet_getheaderlong(httpPkt,CG_HTTP_CONTENT_LENGTH) +#endif + +/**** Connection ****/ +#define cg_http_packet_setconnection(httpPkt, value) cg_http_packet_setheadervalue(httpPkt,CG_HTTP_CONNECTION, value) +#define cg_http_packet_getconnection(httpPkt) cg_http_packet_getheadervalue(httpPkt,CG_HTTP_CONNECTION) +#define cg_http_packet_iskeepaliveconnection(httpPkt) (cg_strcaseeq(cg_http_packet_getconnection(httpPkt), CG_HTTP_CLOSE) == FALSE) + +/**** Transfer-Encoding ****/ +#define cg_http_packet_settransferencoding(httpPkt, value) cg_http_packet_setheadervalue(httpPkt,CG_HTTP_TRANSFER_ENCODING, value) +#define cg_http_packet_gettransferencoding(httpPkt) cg_http_packet_getheadervalue(httpPkt,CG_HTTP_TRANSFER_ENCODING) +#define cg_http_packet_ischunked(httpPkt) cg_strcaseeq(cg_http_packet_gettransferencoding(httpPkt), CG_HTTP_CHUNKED) + +/**** Host ****/ +void cg_http_packet_sethost(CgHttpPacket *httpPkt, char *addr, int port); +#define cg_http_packet_gethost(httpPkt) cg_http_packet_getheaderlong(httpPkt,CG_HTTP_HOST) + +/**** Copy ****/ +void cg_http_packet_copy(CgHttpPacket *destHttpPkt, CgHttpPacket *srcHttpPkt); + +/**** Print ****/ +void cg_http_packet_print(CgHttpPacket *httpPkt); + +/**************************************** +* Function (Request) +****************************************/ + +CgHttpRequest *cg_http_request_new(); +void cg_http_request_delete(CgHttpRequest *httpReq); +void cg_http_request_clear(CgHttpRequest *httpReq); +void cg_http_request_setmethod(CgHttpRequest *httpReq, char *method); +char *cg_http_request_getmethod(CgHttpRequest *httpReq); +void cg_http_request_setversion(CgHttpRequest *httpReq, char *version); +char *cg_http_request_getversion(CgHttpRequest *httpReqest); +void cg_http_request_setuseragent(CgHttpRequest *httpReq, char *version); +char *cg_http_request_getuseragent(CgHttpRequest *httpReqest); +void cg_http_request_addtouseragent(CgHttpRequest *httpReq, char *value); +void cg_http_request_seturi(CgHttpRequest *httpReq, char *uri); +char *cg_http_request_geturi(CgHttpRequest *httpReq); +void cg_http_request_setsocket(CgHttpRequest *httpReq, CgSocket *sock); +CgSocket *cg_http_request_getsocket(CgHttpRequest *httpReq); +#define cg_http_request_closesocket(httpReq) cg_socket_close(cg_http_request_getsocket(httpReq)) +CgHttpResponse *cg_http_request_post(CgHttpRequest *httpReq, char *ipaddr, int port); +#if defined(CG_USE_OPENSSL) +CgHttpResponse *cg_https_request_post(CgHttpRequest *httpReq, char *ipaddr, int port); +#endif +BOOL cg_http_request_read(CgHttpRequest *httpReq, CgSocket *sock); +BOOL cg_http_request_postresponse(CgHttpRequest *httpReq, CgHttpResponse *httpRes); +BOOL cg_http_request_poststatuscode(CgHttpRequest *httpReq, int httpStatCode); +BOOL cg_http_request_postdata(CgHttpRequest *httpReq, void *data, int dataLen); +BOOL cg_http_request_postchunkedsize(CgHttpRequest *httpReq, int dataLen); +BOOL cg_http_request_postchunkeddata(CgHttpRequest *httpReq, void *data, int dataLen); +BOOL cg_http_request_postlastchunk(CgHttpRequest *httpReq); +#define cg_http_request_poststring(httpReq, data) cg_http_request_postdata(httpReq, data, cg_strlen(data)) +#define cg_http_request_postchunkedstring(httpReq, data) cg_http_request_postchunkeddata(httpReq, data, cg_strlen(data)) + +#define cg_http_request_postokrequest(httpReq) cg_http_request_poststatuscode(httpReq, CG_HTTP_STATUS_OK) +#define cg_http_request_postbadrequest(httpReq) cg_http_request_poststatuscode(httpReq, CG_HTTP_STATUS_BAD_REQUEST) + +#define cg_http_request_ismethod(httpReq,value) cg_streq(cg_http_request_getmethod(httpReq), value) +#define cg_http_request_isgetrequest(httpReq) cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_GET) +#define cg_http_request_ispostrequest(httpReq) (cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_POST) || cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_MPOST)) +#define cg_http_request_isheadrequest(httpReq) cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_HEAD) +#define cg_http_request_issubscriberequest(httpReq) cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_SUBSCRIBE) +#define cg_http_request_isunsubscriberequest(httpReq) cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_UNSUBSCRIBE) +#define cg_http_request_isnotifyrequest(httpReq) cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_NOTIFY) +#define cg_http_request_issoapaction(httpReq) (cg_http_packet_hasheader(((CgHttpPacket*)httpReq), CG_HTTP_SOAP_ACTION) || cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_MPOST)) + +#define cg_http_request_setcontent(httpReq,value) cg_http_packet_setcontent(((CgHttpPacket*)httpReq),value) +#define cg_http_request_setncontent(httpReq,value,len) cg_http_packet_setcontent(((CgHttpPacket*)httpReq),value,len) +#define cg_http_request_appendncontent(httpPkt, value, len) cg_http_packet_appendncontent(httpPkt, value, len) +#define cg_http_request_setcontentpointer(httpReq,value, len) cg_http_packet_setcontentpointer(((CgHttpPacket*)httpReq),value, len) +#define cg_http_request_getcontent(httpReq) cg_http_packet_getcontent(((CgHttpPacket*)httpReq)) +#define cg_http_request_getheaders(httpReq) cg_http_packet_getheaders((CgHttpPacket*)httpReq) +#define cg_http_request_getheader(httpReq,name) cg_http_packet_getheader((CgHttpPacket*)httpReq,name) +#define cg_http_request_setheadervalue(httpReq,name,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpReq,name,value) +#define cg_http_request_setheaderinteger(httpReq,name,value) cg_http_packet_setheaderinteger((CgHttpPacket*)httpReq,name,value) +#define cg_http_request_setheaderlong(httpReq,name,value) cg_http_packet_setheaderlong((CgHttpPacket*)httpReq,name,value) +#define cg_http_request_getheadervalue(httpReq,name) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,name) +#define cg_http_request_getheaderinteger(httpReq,name) cg_http_packet_getheaderinteger((CgHttpPacket*)httpReq,name) +#define cg_http_request_getheaderlong(httpReq,name) cg_http_packet_getheaderlong((CgHttpPacket*)httpReq,name) + +#define cg_http_request_setuserdata(httpReq, value) (httpReq->userData = value) +#define cg_http_request_getuserdata(httpReq) (httpReq->userData) + +/**** Local Address/Port ****/ +#define cg_http_request_getlocaladdress(httpReq) cg_socket_getaddress(httpReq->sock) +#define cg_http_request_getlocalport(httpReq) cg_socket_getport(httpReq->sock) + +/**** Content-Length ****/ +#define cg_http_request_setcontentlength(httpReq,value) cg_http_packet_setcontentlength((CgHttpPacket*)httpReq, value) +#define cg_http_request_getcontentlength(httpReq) cg_http_packet_getcontentlength((CgHttpPacket*)httpReq) + +/**** Content-Type ****/ +#define cg_http_request_setcontenttype(httpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpReq,CG_HTTP_CONTENT_TYPE,value) +#define cg_http_request_getcontenttype(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_CONTENT_TYPE) + +/**** Connection ****/ +#define cg_http_request_setconnection(httpReq, value) cg_http_packet_setheadervalue((CgHttpPacket*)httpReq,CG_HTTP_CONNECTION, value) +#define cg_http_request_getconnection(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_CONNECTION) +#define cg_http_request_iskeepaliveconnection(httpReq) cg_http_packet_iskeepaliveconnection((CgHttpPacket*)httpReq) + +/**** Transfer-Encoding ****/ +#define cg_http_request_settransferencoding(httpReq, value) cg_http_packet_settransferencoding((CgHttpPacket*)httpReq, value) +#define cg_http_request_gettransferencoding(httpReq) cg_http_packet_gettransferencoding((CgHttpPacket*)httpReq) +#define cg_http_request_ischunked(httpReq) cg_http_packet_ischunked((CgHttpPacket*)httpReq) + +/**** Host ****/ +#define cg_http_request_sethost(httpReq,addr,port) cg_http_packet_sethost((CgHttpPacket*)httpReq,addr,port) +#define cg_http_request_gethost(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_HOST) + +/**** Date ****/ +#define cg_http_request_setdate(httpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpReq,CG_HTTP_DATE,value) +#define cg_http_request_getdate(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_DATE) + +/**** Copy ****/ +void cg_http_request_copy(CgHttpRequest *destHttpReq, CgHttpRequest *srcHttpReq); + +/*** PostURL ****/ +#define cg_http_request_getposturl(httpReq) (httpReq->postURL) + +/**** Print ****/ +void cg_http_request_print(CgHttpRequest *httpReq); + +/**** Timeout ****/ +#define cg_http_request_settimeout(httpReq,value) (httpReq->timeout = value) +#define cg_http_request_gettimeout(httpReq) (httpReq->timeout) + +/**************************************** +* Function (Response) +****************************************/ + +CgHttpResponse *cg_http_response_new(); +void cg_http_response_delete(CgHttpResponse *httpRes); +void cg_http_response_clear(CgHttpResponse *httpRes); +void cg_http_response_setversion(CgHttpResponse *httpRes, char *version); +char *cg_http_response_getversion(CgHttpResponse *httpRes); +void cg_http_response_setreasonphrase(CgHttpResponse *httpRes, char *value); +char *cg_http_response_getreasonphrase(CgHttpResponse *httpRes); +void cg_http_response_setstatuscode(CgHttpResponse *httpRes, int code); +int cg_http_response_getstatuscode(CgHttpResponse *httpRes); +BOOL cg_http_response_read(CgHttpResponse *httpRes, CgSocket *sock, BOOL onlyHeader); + +/*#define cg_http_response_issuccessful(httpRes) ((cg_http_response_getstatuscode(httpRes) == CG_HTTP_STATUS_OK) ? TRUE : FALSE)*/ +#define cg_http_response_issuccessful(httpRes) (cg_http_response_getstatuscode(httpRes) >= 200 && cg_http_response_getstatuscode(httpRes) < 300 ) + +#define cg_http_response_setcontent(httpRes,value) cg_http_packet_setcontent(((CgHttpPacket*)httpRes),value) +#define cg_http_response_setncontent(httpRes,value, len) cg_http_packet_setncontent(((CgHttpPacket*)httpRes),value, len) +#define cg_http_response_appendncontent(httpRes, value, len) cg_http_packet_appendncontent(((CgHttpPacket*) httpRes), value, len) + +#define cg_http_response_setcontentpointer(httpRes,value,len) cg_http_packet_setcontentpointer(((CgHttpPacket*)httpRes),value,len) +#define cg_http_response_getcontent(httpRes) cg_http_packet_getcontent(((CgHttpPacket*)httpRes)) +#define cg_http_response_getheaders(p) cg_http_packet_getheaders((CgHttpPacket*)p) +#define cg_http_response_getheader(p,n) cg_http_packet_getheader((CgHttpPacket*)p,n) +#define cg_http_response_setheadervalue(httpRes,n,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpRes,n,value) +#define cg_http_response_setheaderinteger(httpRes,n,value) cg_http_packet_setheaderinteger((CgHttpPacket*)httpRes,n,value) +#define cg_http_response_setheaderlong(httpRes,n,value) cg_http_packet_setheaderlong((CgHttpPacket*)httpRes,n,value) +#define cg_http_response_getheadervalue(httpRes,n) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,n) +#define cg_http_response_getheaderinteger(httpRes,n) cg_http_packet_getheaderinteger((CgHttpPacket*)httpRes,n) +#define cg_http_response_getheaderlong(httpRes,n) cg_http_packet_getheaderlong((CgHttpPacket*)httpRes,n) + +#define cg_http_response_setuserdata(httpRes, value) (httpRes->userData = value) +#define cg_http_response_getuserdata(httpRes) (httpRes->userData) + +/**** Content-Length ****/ +#define cg_http_response_setcontentlength(httpRes,value) cg_http_packet_setcontentlength((CgHttpPacket*)httpRes, value) +#define cg_http_response_getcontentlength(httpRes) cg_http_packet_getcontentlength((CgHttpPacket*)httpRes) + +/**** Content-Type ****/ +#define cg_http_response_setcontenttype(httpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpRes,CG_HTTP_CONTENT_TYPE,value) +#define cg_http_response_getcontenttype(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_CONTENT_TYPE) + +/**** connection ****/ +#define cg_http_response_setconnection(httpRes, value) cg_http_packet_setheadervalue((CgHttpPacket*)httpRes,CG_HTTP_CONNECTION, value) +#define cg_http_response_getconnection(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes, CG_HTTP_CONNECTION) +#define cg_http_response_iskeepaliveconnection(httpRes) cg_http_packet_iskeepaliveconnection((CgHttpPacket*)httpRes) + +/**** Host ****/ +#define cg_http_response_sethost(httpRes,addr,port) cg_http_packet_sethost((CgHttpPacket*)httpRes,addr,port) +#define cg_http_response_gethost(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_HOST) + +/**** Date ****/ +#define cg_http_response_setdate(httpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpRes,CG_HTTP_DATE,value) +#define cg_http_response_getdate(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_DATE) + +/**** Transfer-Encoding ****/ +#define cg_http_response_settransferencoding(httpReq, value) cg_http_packet_settransferencoding((CgHttpPacket*)httpReq, value) +#define cg_http_response_gettransferencoding(httpReq) cg_http_packet_gettransferencoding((CgHttpPacket*)httpReq) + +/**** Copy ****/ +void cg_http_response_copy(CgHttpResponse *destHttpRes, CgHttpResponse *srcHttpRes); + +/**** Print ****/ +void cg_http_response_print(CgHttpResponse *httpRes); + +/**** Timeout ****/ +#define cg_http_response_settimeout(httpRes,value) (httpRes->timeout = value) +#define cg_http_response_gettimeout(httpRes) (httpRes->timeout) + +/**************************************** +* Function (Server) +****************************************/ + +CgHttpServer *cg_http_server_new(); +void cg_http_server_delete(CgHttpServer *httpServer); +BOOL cg_http_server_open(CgHttpServer *httpServer, int bindPort, char *bindAddr); +BOOL cg_http_server_close(CgHttpServer *httpServer); +BOOL cg_http_server_accept(CgHttpServer *httpServer); +BOOL cg_http_server_start(CgHttpServer *httpServer); +BOOL cg_http_server_stop(CgHttpServer *httpServer); +void cg_http_server_setlistener(CgHttpServer *httpServer, CG_HTTP_LISTENER listener); + +#define cg_http_server_next(httpServer) (CgHttpServer *)cg_list_next((CgList *)httpServer) + +#define cg_http_server_getsocket(httpServer) (httpServer->sock) +#define cg_http_server_isopened(httpServer) ((httpServer->sock != NULL) ? TRUE : FALSE) + +#define cg_http_server_setuserdata(httpServer, value) (httpServer->userData = value) +#define cg_http_server_getuserdata(httpServer) (httpServer->userData) + +char *cg_http_getservername(char *buf, int bufSize); + +/**** Timeout ****/ +#define cg_http_server_settimeout(httpServer,value) (httpServer->timeout = value) +#define cg_http_server_gettimeout(httpServer) (httpServer->timeout) + +/**** Mutex ****/ +#define cg_http_server_lock(httpServer) cg_mutex_lock(httpServer->mutex) +#define cg_http_server_unlock(httpServer) cg_mutex_unlock(httpServer->mutex) + +/**************************************** +* Function (Server List) +****************************************/ + +CgHttpServerList *cg_http_serverlist_new(); +void cg_http_serverlist_delete(CgHttpServerList *httpServerList); + +#define cg_http_serverlist_clear(httpServerList) cg_list_clear((CgList *)httpServerList, (CG_LIST_DESTRUCTORFUNC)cg_http_server_delete) +#define cg_http_serverlist_size(httpServerList) cg_list_size((CgList *)httpServerList) +#define cg_http_serverlist_gets(httpServerList) (CgHttpServer *)cg_list_next((CgList *)httpServerList) +#define cg_http_serverlist_add(httpServerList, httpServer) cg_list_add((CgList *)httpServerList, (CgList *)httpServer) + +BOOL cg_http_serverlist_open(CgHttpServerList *httpServerList, int port); +BOOL cg_http_serverlist_close(CgHttpServerList *httpServerList); +BOOL cg_http_serverlist_start(CgHttpServerList *httpServerList); +BOOL cg_http_serverlist_stop(CgHttpServerList *httpServerList); +void cg_http_serverlist_setlistener(CgHttpServerList *httpServerList, CG_HTTP_LISTENER listener); +void cg_http_serverlist_setuserdata(CgHttpServerList *httpServerList, void *value); + +/**************************************** +* Function (Date) +****************************************/ + +char *cg_http_getdate(CgSysTime sysTime, char *buf, int bufSize); + +/**************************************** +* Persistent connection cache +****************************************/ + +/** Initialize persistent connection cache. Can be called many times */ +BOOL cg_http_persistentconnection_init(void); +/** Clear persistent connection cache and free all memory */ +void cg_http_persistentconnection_clear(void); +/** Lock persistent connection cache. Required for getting, putting and using + persistent connection from cache */ +void cg_http_persistentconnection_lock(void); +/** Unlock persistent connection cache. */ +void cg_http_persistentconnection_unlock(void); +/** Get persistent connection from cache */ +void *cg_http_persistentconnection_get(char *host, int port); +/** Put connection to persistent connection cache */ +BOOL cg_http_persistentconnection_put(char *host, int port, void *data); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cicon.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cicon.h new file mode 100644 index 0000000..3c040d6 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cicon.h @@ -0,0 +1,247 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cicon.h +* +* Revision: +* +* 02/14/05 +* - first revision +* +* 10/31/05 +* - Added comments to all functions and structs +******************************************************************/ + +#ifndef _CG_UPNP_CICON_H_ +#define _CG_UPNP_CICON_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_UPNP_ICON_ELEM_NAME "icon" +#define CG_UPNP_ICONLIST_ELEM_NAME "iconList" + +#define CG_UPNP_ICON_MIME_TYPE "mimetype" +#define CG_UPNP_ICON_WIDTH "width" +#define CG_UPNP_ICON_HEIGHT "height" +#define CG_UPNP_ICON_DEPTH "depth" +#define CG_UPNP_ICON_URL "url" + +/**************************************** +* Data Type +****************************************/ +/** + * The generic icon struct + */ +typedef struct _CgUpnpIcon { + BOOL headFlag; + struct _CgUpnpIcon *prev; + struct _CgUpnpIcon *next; + CgXmlNode *iconNode; +} CgUpnpIcon, CgUpnpIconList; + +/**************************************** +* Function (Icon) +****************************************/ + +/** + * Create a new icon struct + */ +CgUpnpIcon *cg_upnp_icon_new(); + +/** + * Delete an icon struct + * + * \param dev Icon to delete + */ +void cg_upnp_icon_delete(CgUpnpIcon *dev); + +/** + * Get the next icon in list. Use as an iterator. + * + * \param icon Node in a list of icons + */ +#define cg_upnp_icon_next(icon) (CgUpnpIcon *)cg_list_next((CgList *)icon) + +/** + * Check whether the given node is a member of an icon list + * + * \param node List node + */ +#define cg_upnp_icon_isiconnode(node) cg_xml_node_isname(node, CG_UPNP_ICON_ELEM_NAME) + +/** + * Set the XML icon node to an icon struct + * + * \param icon The icon struct + * \param node XML node + */ +#define cg_upnp_icon_seticonnode(icon,node) (icon->iconNode = node) + +/** + * Get the XML icon node from an icon struct + * + * \param icon The icon struct + */ +#define cg_upnp_icon_geticonnode(icon) (icon->iconNode) + +/***************************************************************************** + * mimeType + *****************************************************************************/ + +/** + * Set the icon's MIME type + * + * \param icon Icon in question + * \param value MIME type + */ +#define cg_upnp_icon_setmimetype(icon, value) cg_xml_node_setchildnode(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_MIME_TYPE, value) + +/** + * Get the icon's MIME type + * + */ +#define cg_upnp_icon_getmimetype(icon) cg_xml_node_getchildnodevalue(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_MIME_TYPE) + +/***************************************************************************** + * width + *****************************************************************************/ + +/** + * Set icon width + * + * \param icon Icon in question + * \param value Icon width + */ +#define cg_upnp_icon_setwidth(icon, value) cg_xml_node_setchildnode(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_WIDTH, value) + +/** + * Get icon width + * + */ +#define cg_upnp_icon_getwidth(icon) cg_xml_node_getchildnodeintvalue(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_WIDTH) + +/***************************************************************************** + * height + *****************************************************************************/ + +/** + * Set icon height + * + * \param icon Icon in question + * \param value Icon height + */ +#define cg_upnp_icon_setheight(icon, value) cg_xml_node_setchildnode(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_HEIGHT, value) + +/** + * Get icon height + * + */ +#define cg_upnp_icon_getheight(icon) cg_xml_node_getchildnodeintvalue(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_HEIGHT) + +/***************************************************************************** + * Colour Depth + *****************************************************************************/ + +/** + * Set icon's colour depth + * + * \param icon Icon in question + * \param value Colour depth + */ +#define cg_upnp_icon_setdepth(icon, value) cg_xml_node_setchildnode(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_DEPTH, value) + +/** + * Get icon's colour depth + * + */ +#define cg_upnp_icon_getdepth(icon) cg_xml_node_getchildnodeintvalue(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_DEPTH) + +/***************************************************************************** + * URL + *****************************************************************************/ + +/** + * Set icon's URL + * + * \param icon Icon in question + * \param value Icon's URL + */ +#define cg_upnp_icon_seturl(icon, value) cg_xml_node_setchildnode(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_URL, value) + +/** + * Get icon's URL + * + */ +#define cg_upnp_icon_geturl(icon) cg_xml_node_getchildnodevalue(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_URL) + +/***************************************************************************** + * Function (IconList) + *****************************************************************************/ + +/** + * Create a new list of icons + * + */ +CgUpnpIconList *cg_upnp_iconlist_new(); + +/** + * Delete a list of icons + * + * \param iconList List of icons + */ +void cg_upnp_iconlist_delete(CgUpnpIconList *iconList); + +/** + * Clear the contents of an icon list + * + * \param iconList List of icons + */ +#define cg_upnp_iconlist_clear(iconList) cg_list_clear((CgList *)iconList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_icon_delete) + +/** + * Get the size (number of elements) of an icon list + * + * \param iconList List of icons + */ +#define cg_upnp_iconlist_size(iconList) cg_list_size((CgList *)iconList) + +/** + * \todo Get the first icon from the list for iteration + * + * \param iconList List of icons + */ +#define cg_upnp_iconlist_gets(iconList) (CgUpnpIcon *)cg_list_next((CgList *)iconList) + +/** + * Add an icon to an icon list + * + * \param iconList List of icons + * \param icon Icon to add + */ +#define cg_upnp_iconlist_add(iconList, icon) cg_list_add((CgList *)iconList, (CgList *)icon) + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cinterface.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cinterface.h new file mode 100644 index 0000000..e277d8f --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cinterface.h @@ -0,0 +1,155 @@ +/****************************************************************** +* +* CyberNet for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cinterface.h +* +* Revision: +* +* 02/09/05 +* - first revision +* 03/23/06 Theo Beisch +* - added localhost constants +* 09/12/07 +* - Added the following functions to get MAC address. +* cg_net_interface_setmacaddress(), cg_net_interface_getmacaddress() +* - Changed cg_net_gethostinterfaces() to get the MAC address using GetAdaptersInfo() as default on Windows platform. +* - Changed cg_net_gethostinterfaces() to get the MAC address using getifaddrs() on UNIX platform. +* Note : Other platforms might not support to get this functions yet. +* +******************************************************************/ + +#ifndef _CG_NET_CINTERFACE_H_ +#define _CG_NET_CINTERFACE_H_ + +#include +#include +#include + +#if !defined(WIN32) +#include +#include +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_NET_IPV4_ADDRSTRING_MAXSIZE ((3*4)+(1*3)+1) +#define CG_NET_IPV6_ADDRSTRING_MAXSIZE (1+(8*4)+(1*7)+1+1) + +#define CG_NET_IPV4_LOOPBACK "127.0.0.1" +#define CG_NET_IPV6_LOOPBACK "fixmelater" +#define CG_NET_MACADDR_SIZE 6 + +#if defined(BTRON) || defined(TENGINE) +#define CG_NET_DEFAULT_IFNAME "Neta" +#endif + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgNetworkInterface { + BOOL headFlag; + struct _CgNetworkInterface *prev; + struct _CgNetworkInterface *next; + CgString *name; + CgString *ipaddr; + CgString *netmask; + CgByte macaddr[CG_NET_MACADDR_SIZE]; + int index; +} CgNetworkInterface, CgNetworkInterfaceList; + +/**************************************** +* Function (NetworkInterface) +****************************************/ + +CgNetworkInterface *cg_net_interface_new(); +void cg_net_interface_delete(CgNetworkInterface *netIf); +CgNetworkInterface* cg_net_interface_getany(); + +#define cg_net_interface_next(netIf) (CgNetworkInterface *)cg_list_next((CgList *)netIf) +#define cg_net_interface_remove(netIf) cg_list_remove((CgList *)netIf) + +void cg_net_interface_setname(CgNetworkInterface *netIf, char *name); +char *cg_net_interface_getname(CgNetworkInterface *netIf); +void cg_net_interface_setaddress(CgNetworkInterface *netIf, char *ipaddr); +char *cg_net_interface_getaddress(CgNetworkInterface *netIf); +void cg_net_interface_setnetmask(CgNetworkInterface *netIf, char *ipaddr); +char *cg_net_interface_getnetmask(CgNetworkInterface *netIf); +char *cg_net_selectaddr(struct sockaddr *remoteaddr); + +#define cg_net_interface_setmacaddress(netIf, value) memcpy(netIf->macaddr, value, CG_NET_MACADDR_SIZE) +#define cg_net_interface_getmacaddress(netIf, buf) memcpy(buf, netIf->macaddr, CG_NET_MACADDR_SIZE) + +#define cg_net_interface_setindex(netIf, value) (netIf->index = value) +#define cg_net_interface_getindex(netIf, buf) (netIf->index) + +/** + * Compares two interfaces based on IP-address. + */ +int cg_net_interface_cmp(CgNetworkInterface *netIfA, + CgNetworkInterface *netIfB); + +/**************************************** +* Function (NetworkInterfaceList) +****************************************/ + +CgNetworkInterfaceList *cg_net_interfacelist_new(); +void cg_net_interfacelist_delete(CgNetworkInterfaceList *netIfList); + +#define cg_net_interfacelist_clear(netIfList) cg_list_clear((CgList *)netIfList, (CG_LIST_DESTRUCTORFUNC)cg_net_interface_delete) +#define cg_net_interfacelist_size(netIfList) cg_list_size((CgList *)netIfList) +#define cg_net_interfacelist_gets(netIfList) (CgNetworkInterface *)cg_list_next((CgList *)netIfList) +#define cg_net_interfacelist_add(netIfList,netIf) cg_list_add((CgList *)netIfList, (CgList *)netIf) + +CgNetworkInterface *cg_net_interfacelist_get(CgNetworkInterfaceList *netIfList, char *name); + +/** + * Gets changes in the two given (aka old and new) interface lists. Changes + * are resolved based on IP-addresses. + * + * @param netIfListOld List of the old interfaces. It is changed! + * @param netIfListNew List of the new interfaces. It is changed! + * @param netIfListAdded List to store interfaces, which were in netIfListNew, + * but were not in netIfListOld. May be NULL. + * @param netIfListRemoved List to store interfaces, which were in + * netIfListOld, but were not in netIfListNew. + */ +void cg_net_interfacelist_getchanges(CgNetworkInterfaceList *netIfListOld, + CgNetworkInterfaceList *netIfListNew, + CgNetworkInterfaceList *netIfListAdded, + CgNetworkInterfaceList *netIfListRemoved); + +/**************************************** +* Function +****************************************/ + +#if defined(ITRON) +void cg_net_setinterface(char *ifaddr); +#endif + +int cg_net_gethostinterfaces(CgNetworkInterfaceList *netIfList); + +BOOL cg_net_isipv6address(char *addr); +int cg_net_getipv6scopeid(char *addr); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/clist.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/clist.h new file mode 100644 index 0000000..c1be2cf --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/clist.h @@ -0,0 +1,171 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: clist.h +* +* Revision: +* +* 01/18/05 +* - first revision +* +* 10/31/05 +* - Added comments to all functions and structs +* +******************************************************************/ + +#ifndef _CG_UTIL_CLIST_H_ +#define _CG_UTIL_CLIST_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** + * Define + ****************************************/ + +/** + * Prototype for individual list node destructor functions + * + */ +typedef void (*CG_LIST_DESTRUCTORFUNC)(void *); + +/**************************************** + * Data Type + ****************************************/ + +/** + * \brief The generic list interface in CyberLinkC. + * + * Each struct in CyberLinkC, that is designed to be a part of + * a list, must have these elements in their definition before the + * actual struct definition. The struct pointers are then cast to + * CgList* and operated with cg_list_* functions. + */ +typedef struct _CgList { + + /** Marks the beginning of a list */ + BOOL headFlag; + /** Pointer to the next list node */ + struct _CgList *prev; + /** Pointer to the previous list node */ + struct _CgList *next; + +} CgList; + +/**************************************** + * Functions + ****************************************/ + +/** + * Initialize a list node to act as the first node + * + * \param list List node + */ +void cg_list_header_init(CgList *list); + +/** + * Initialize a list node to act as a regular node, part of a list. + * + * \param list List node + */ +void cg_list_node_init(CgList *list); + +/** + * Insert a list node or a complete list structure after the given node + * + * \param prevList Insert after this node + * \param list List node or list structure to insert + */ +void cg_list_insert(CgList *prevList, CgList *list); + +/** + * \todo This works essentially like insert, although it is more error-prone?! + * \todo There might be a bug in this function. + * + */ +void cg_list_add(CgList *headList, CgList *list); + +/** + * Remove a node from a list. Does not free any memory, but only removes + * the next and previous link associations regarding the given node. + * + * \param list List node to remove + */ +void cg_list_remove(CgList *list); + +/** + * Get the number of nodes in the current list structure. Counts forwards from the given + * node, so if you want to get the complete size, give a header node as the parameter. + * + * \param headList List header + */ +int cg_list_size(CgList *headList); + +/** + * Get an item from the list by the item's index + * + * \param headList List header + * \param index The index of the item to get + */ +CgList *cg_list_get(CgList *headList, int index); + +/** + * Get the previous node. Wrap around if the beginning has been reached. + * + * + * \param list Current node + */ +CgList *cg_list_prev_circular(CgList *list); + +/** + * Get the previous node. Returns NULL if beginning has been reached + * + * \param list Current node + */ +CgList *cg_list_prev(CgList *list); + +/** + * Get the next node. Wrap around if the end has been reached. + * + * \param list Current node + */ +CgList *cg_list_next_circular(CgList *list); + +/** + * Get the next node. Returns NULL if end has been reached. + * + * \param list Current node + */ +CgList *cg_list_next(CgList *list); + +/** + * Clear the list and delete all of its contents with \ref CG_LIST_DESTRUCTORFUNC + * + * \param headList List header + * \param destructorFunc Function pointer that clears the contents of individual nodes + */ +void cg_list_clear(CgList *headList, CG_LIST_DESTRUCTORFUNC destructorFunc); + +/** + * Get the first actual item from a list for iteration + * + * \param headList List header + */ +#define cg_list_gets(headList) cg_list_next(headList) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/clog.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/clog.h new file mode 100644 index 0000000..2e8f557 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/clog.h @@ -0,0 +1,174 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) 2006 Nokia Corporation +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: clog.h +* +* Revision: +* +* 06-Feb-06 +* - first revision +* +******************************************************************/ + +#ifndef __CLOG_H +#define __CLOG_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_LOG_STRING 2048 + +/* Message masks and descriptions */ +#define SEV_UNKNOWN_S "Unknown" + +#define SEV_ERROR 1 +#define SEV_ERROR_S "Error" + +#define SEV_WARNING 2 +#define SEV_WARNING_S "Warning" + +#define SEV_INFO 4 +#define SEV_INFO_S "Info" + +#define SEV_DEBUG_L1 8 +#define SEV_DEBUG_L1_S "Debug (general)" + +#define SEV_DEBUG_L2 16 +#define SEV_DEBUG_L2_S "Debug (stack)" + +#define SEV_DEBUG_L3 32 +#define SEV_DEBUG_L3_S "Debug (application)" + +/* Low level debug messages like when printing out (important) function + * entry/leaving points */ +#define SEV_DEBUG_L4 64 +#define SEV_DEBUG_L4_S "Debug (low level L4)" + +/* Low level debug messages to be used e.g. when printing out less important + * function entry/leaving points */ +#define SEV_DEBUG_L5 128 +#define SEV_DEBUG_L5_S "Debug (low level L5)" + +/* Mask for all message types */ +#define SEV_ALL ( SEV_ERROR | SEV_WARNING | SEV_INFO | SEV_DEBUG_L1 | SEV_DEBUG_L2 | SEV_DEBUG_L3 | SEV_DEBUG_L4 | SEV_DEBUG_L5 ) + +/* Filename, line_n and unique build number can be used to give unique id tag + * to all messages. + */ +void cg_log_print(int severity, const char *file, int line_n, const char *function, const char *format, ...); +void cg_log_set_separator(char *s); + +/* Target defines a file or stdout/stderr, in future it may also + * contain special targets like network addresses etc. + */ +int cg_log_add_target(char *target, int severity_mask); +int cg_log_clear_targets(); + +/* Standard error handling */ +#if defined(__USE_ISOC99) +#define cg_log_error(format, ...) cg_log_print(SEV_ERROR, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +#elif defined(WIN32) || defined(WINCE) +void cg_log_error(const char *format, ...); +#else +#define cg_log_error(format...) cg_log_print(SEV_ERROR, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +#endif + +#if defined(__USE_ISOC99) +#define cg_log_warning(format, ...) cg_log_print(SEV_WARNING, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +#elif defined(WIN32) || defined(WINCE) +void cg_log_warning(const char *format, ...); +#else +#define cg_log_warning(format...) cg_log_print(SEV_WARNING, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +#endif + +#if defined(__USE_ISOC99) +#define cg_log_info(format, ...) cg_log_print(SEV_INFO, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +#elif defined(WIN32) || defined(WINCE) +void cg_log_info(const char *format, ...); +#else +#define cg_log_info(format...) cg_log_print(SEV_INFO, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +#endif + +/* General and low level debug */ +#ifdef CLOG_DEBUG +#if defined(__USE_ISOC99) +# define cg_log_debug(format, ...) cg_log_print(SEV_DEBUG_L1, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +# define cg_log_debug_l4(format, ...) cg_log_print(SEV_DEBUG_L4, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +# define cg_log_debug_l5(format, ...) cg_log_print(SEV_DEBUG_L5, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +#elif defined(WIN32) +void cg_log_debug(const char *format, ...); +void cg_log_debug_l4(const char *format, ...); +void cg_log_debug_l5(const char *format, ...); +#else +# define cg_log_debug(format...) cg_log_print(SEV_DEBUG_L1, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +# define cg_log_debug_l4(format...) cg_log_print(SEV_DEBUG_L4, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +# define cg_log_debug_l5(format...) cg_log_print(SEV_DEBUG_L5, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +#endif +#else +#if defined(__USE_ISOC99) +# define cg_log_debug(format, ...) +# define cg_log_debug_l4(format, ...) +# define cg_log_debug_l5(format, ...) +#elif defined(WIN32) || defined(WINCE) +void cg_log_debug(const char *format, ...); +void cg_log_debug_l4(const char *format, ...); +void cg_log_debug_l5(const char *format, ...); +#else +# define cg_log_debug(format...) +# define cg_log_debug_l4(format...) +# define cg_log_debug_l5(format...) +#endif +#endif + +/* Debug messages coming from stack */ +#ifdef CLOG_DEBUG_STACK +#if defined(__USE_ISOC99) +# define cg_log_debug_s(format, ...) cg_log_print(SEV_DEBUG_L2, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +#elif defined(WIN32) +void cg_log_debug_s(const char *format, ...); +#else +# define cg_log_debug_s(format...) cg_log_print(SEV_DEBUG_L2, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +#endif +#else +#if defined(__USE_ISOC99) +# define cg_log_debug_s(format, ...) +#elif defined(WIN32) || defined(WINCE) +void cg_log_debug_s(const char *format, ...); +#else +# define cg_log_debug_s(format...) +#endif +#endif + +/* Debug messages coming from application */ +#ifdef CLOG_DEBUG_APPLICATION +#if defined(__USE_ISOC99) +# define cg_log_debug_a(format...) cg_log_print(SEV_DEBUG_L3, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +#elif defined(WIN32) +void cg_log_debug_a(const char *format, ...); +#else +# define cg_log_debug_a(format...) cg_log_print(SEV_DEBUG_L3, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +#endif +#else +#if defined(__USE_ISOC99) +# define cg_log_debug_a(format, ...) +#elif defined(WIN32) || defined(WINCE) +void cg_log_debug_a(const char *format, ...); +#else +# define cg_log_debug_a(format...) +#endif +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CLOG_H */ diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cmutex.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cmutex.h new file mode 100644 index 0000000..962a677 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cmutex.h @@ -0,0 +1,131 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cmutex.h +* +* Revision: +* +* 01/17/05 +* - first revision +* +* 10/31/05 +* - Added comments to all functions and structs +* +******************************************************************/ + +#ifndef _CG_UTIL_CMUTEX_H_ +#define _CG_UTIL_CMUTEX_H_ + +#include + +#if defined(WIN32) && !defined(ITRON) +#include +#elif defined(BTRON) +#include +#elif defined(ITRON) +#include +#elif defined(TENGINE) && !defined(PROCESS_BASE) +#include +#elif defined(TENGINE) && defined(PROCESS_BASE) +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** + * Data Types + ****************************************/ + +/** + * \brief The generic wrapper struct for CyberLinkC's mutexes. + * + * This wrapper has been created to enable 100% code + * compatibility for different platforms (Linux, Win32 etc..) + */ +typedef struct _CgMutex { +#if defined(WIN32) && !defined(ITRON) + HANDLE mutexID; +#elif defined(BTRON) + WERR mutexID; +#elif defined(ITRON) + ER_ID mutexID; +#elif defined(TENGINE) && !defined(PROCESS_BASE) + ID mutexID; +#elif defined(TENGINE) && defined(PROCESS_BASE) + WERR mutexID; +#else + /** The mutex entity */ + pthread_mutex_t mutexID; +#endif +} CgMutex; + +#if defined(WITH_THREAD_LOCK_TRACE) && defined(__USE_ISOC99) +#include + +typedef struct _CgLockInfo +{ + struct _CgLockInfo *next; + pthread_t thread_id; + char *file, *function; + int line, mutex_id; +} CgLockInfo; +#endif + +/**************************************** + * Functions + ****************************************/ + +/** + * Create a new mutex + */ +CgMutex *cg_mutex_new(); + +/** + * Destroy a mutex + * + * \param mutex The mutex to destroy + */ +BOOL cg_mutex_delete(CgMutex *mutex); + +/** + * Acquire a mutex lock + * + * \param mutex Mutex to lock + */ + +#if defined(WITH_THREAD_LOCK_TRACE) && defined(__USE_ISOC99) +# define cg_mutex_lock(mutex) cg_mutex_lock_trace(__FILE__, __LINE__, __PRETTY_FUNCTION__, mutex) +#else + BOOL cg_mutex_lock(CgMutex *mutex); +#endif + +/** + * Release a locked mutex + * + * \param mutex Mutex to unlock + */ +#if defined(WITH_THREAD_LOCK_TRACE) && defined(__USE_ISOC99) +# define cg_mutex_unlock(mutex) cg_mutex_unlock_trace(__FILE__, __LINE__, __PRETTY_FUNCTION__, mutex) +#else + BOOL cg_mutex_unlock(CgMutex *mutex); +#endif + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cnotify.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cnotify.h new file mode 100644 index 0000000..ca7fa34 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cnotify.h @@ -0,0 +1,238 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cevent.h +* +* Revision: +* +* 06/20/05 +* - first revision +* +* 03/20/06 Theo Beisch +* - added cg_upnp_event_notify_request_hasnt & _hasnts & _hassid +******************************************************************/ + +#ifndef _CG_UPNP_CNOTIFY_H_ +#define _CG_UPNP_CNOTIFY_H_ + +#include + +#include +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/** Define for XML namespace + */ +#define CG_UPNP_NOTIFY_XMLNS "e" + +/** + * Define for notify property + */ +#define CG_UPNP_NOTIFY_PROPERTY "property" + +/** + * Define for notify property set + */ +#define CG_UPNP_NOTIFY_PROPERTYSET "propertyset" + +/**************************************** +* Data Type +****************************************/ + +/** + * Data type for UPnP Notification request + */ +typedef CgSoapRequest CgUpnpNotifyRequest; + +/** + * Data type for UPnP notify response + */ +typedef CgSoapResponse CgUpnpNotifyResponse; + +/**************************************** +* Function (Request) +****************************************/ + +/** + * Create new Notification request + */ +CgUpnpNotifyRequest *cg_upnp_event_notify_request_new(); + +/** + * Delete Notification request + * + * @param notifyReq Notification request + */ +void cg_upnp_event_notify_request_delete(CgUpnpNotifyRequest *notifyReq); + +/** + * Clear Notification request + * + * @param notifyReq Notification request + */ +void cg_upnp_event_notify_request_clear(CgUpnpNotifyRequest *notifyReq); + +/** + * Set HTTP request for event Notification request + * + * @param notifyReq Notification request + * @param httpReq HTTP request + */ +#define cg_upnp_event_notify_request_sethttprequest(notifyReq, httpReq) cg_soap_request_sethttprequest(notifyReq, httpReq) + +/** + * Sends event Notification request to control point + * + * @param notifyReq Notification request + * @param host Host address + * @param port Host port + * + * @return Notify response + */ +#define cg_upnp_event_notify_request_post(notifyReq, host, port) cg_soap_request_post(notifyReq, host, port) + +/** + * Get root node associated with current Notification request + * + * @param notifyReq Notification request + * + * @return XML node + */ +#define cg_upnp_event_notify_request_getpropertysetnode(notifyReq) cg_soap_request_getrootnoode(notifyReq) + +/** + * Set property list for Notification request + * + * @param notifyReq Notification request + * @param value Property list value + */ +#define cg_upnp_event_notify_request_setpropertylist(notifyReq, value) cg_soap_request_setuserdata(notifyReq, value) + +/** + * Get property list from Notification request + * + * @param nofityReq Notification request + */ +CgUpnpPropertyList *cg_upnp_event_notify_request_getpropertylist(CgUpnpNotifyRequest *nofityReq); + +/**** NT ****/ + +/** + * Set NT (Notificatio type) for Notification request + * + * @param soapReq Notification request + * @param value Notification type + */ +#define cg_upnp_event_notify_request_setnt(soapReq, value) cg_http_packet_setheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NT, value) + +/** + * Get NT from notification request + * + * @param soapReq Notification request + */ +#define cg_upnp_event_notify_request_getnt(soapReq) cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NT) +//Theo Beisch +#define cg_upnp_event_notify_request_hasnt(soapReq) cg_http_packet_hasheader((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NT) + +/**** NTS ****/ + +/** + * Set NTS (Notification sub type) for current Notification request + * + * @param soapReq Notification request + * @param value NTS + */ +#define cg_upnp_event_notify_request_setnts(soapReq, value) cg_http_packet_setheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NTS, value) + +/** + * Get NTS from notification request + * + * @param soapReq Notification request + */ +#define cg_upnp_event_notify_request_getnts(soapReq) cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NTS) +//Theo Beisch +#define cg_upnp_event_notify_request_hasnts(soapReq) cg_http_packet_hasheader(((CgHttpPacket*)soapReq->httpReq), CG_HTTP_NTS) + +/**** SID ****/ + +/** + * Set SID (Subscription ID) for notification request + * + * @param soapReq Notification request + * @param sid SID + */ +void cg_upnp_event_notify_request_setsid(CgUpnpNotifyRequest *soapReq, char *sid); + +/** + * Get SID from notification request + * + * @param soapReq Notification request + */ +#define cg_upnp_event_notify_request_getsid(soapReq) cg_upnp_event_subscription_getsid(cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SID)) +//Theo Beisch +#define cg_upnp_event_notify_request_hassid(soapReq) cg_http_packet_hasheader(((CgHttpPacket*)(soapReq->httpReq)), CG_HTTP_SID) + +/**** SEQ ****/ + +/** + * Set sequence number for notification request + * + * @param soapReq Notification request + * @param value Sequence number + */ +#define cg_upnp_event_notify_request_setseq(soapReq, value) cg_http_packet_setheaderlong((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SEQ, value) + +/** + * Get sequence number from notification request + * + * @param soapReq Notification request + */ +#define cg_upnp_event_notify_request_getseq(soapReq) cg_http_packet_getheaderlong((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SEQ) + +/** + * \todo Check what this does exactly... + */ +BOOL cg_upnp_event_notify_request_setpropertysetnode(CgUpnpNotifyRequest *notifyReq, CgUpnpSubscriber *sub, /* CgUpnpService */void *service, CgUpnpStateVariable *statVar); + +/**************************************** +* Function (Response) +****************************************/ + +/** + * Check if notification response was successfull + * + * @param notifyRes Notification response + */ +#define cg_upnp_event_notify_response_issuccessful(notifyRes) cg_soap_response_issuccessful(notifyRes) + +/** + * Get the status code of the specified response + * + * @param notifyRes Notification response + */ +#define cg_upnp_event_notify_response_getstatuscode(notifyRes) cg_soap_response_getstatuscode(notifyRes) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cproperty.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cproperty.h new file mode 100644 index 0000000..8eb4551 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cproperty.h @@ -0,0 +1,196 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cproperty.h +* +* Revision: +* +* 06/21/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CPROPERTY_H_ +#define _CG_UPNP_CPROPERTY_H_ + +#include + +#include +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Type definition for UPnP property + */ +typedef struct _CgUpnpProperty { + BOOL headFlag; + struct _CgUpnpProperty *prev; + struct _CgUpnpProperty *next; + + CgString *name; + CgString *value; + CgString *sid; + long seq; +} CgUpnpProperty, CgUpnpPropertyList; + +/**************************************** +* Function (Property) +****************************************/ + +/** + * Construct new UPnP property object + */ +CgUpnpProperty *cg_upnp_property_new(); + +/** + * Delete UPnP property object + * + * @param prop UPnP property + */ +void cg_upnp_property_delete(CgUpnpProperty *prop); + +/** + * Clear UPnP property + * + * @param prop UPnP property + */ +void cg_upnp_property_clear(CgUpnpProperty *prop); + +/** + * Fetches next UPnP property from property list + * + * @param prop UPnP property + */ +#define cg_upnp_property_next(prop) (CgUpnpProperty *)cg_list_next((CgList *)prop) + +/**** name ****/ +/** + * Set property name + * + * @param prop UPnP property + * @param value Name + */ +#define cg_upnp_property_setname(prop, value) cg_string_setvalue(prop->name, value) + +/** + * Get property name + * + * @param prop UPnP property + */ +#define cg_upnp_property_getname(prop) cg_string_getvalue(prop->name) + +/**** value ****/ + +/** + * Set value for UPnP property + * + * @param prop UPnP property + * @param nvalue Value + */ +#define cg_upnp_property_setvalue(prop, nvalue) cg_string_setvalue(prop->value, nvalue) + +/** + * Get value from property + * + * @param prop UPnP property + */ +#define cg_upnp_property_getvalue(prop) cg_string_getvalue(prop->value) + +/**** sid ****/ + +/** + * Set SID for UPnP property + * + * @param prop UPnP property + * @param value Value + */ +#define cg_upnp_property_setsid(prop, value) cg_string_setvalue(prop->sid, value) + +/** + * Get SID from UPnP property + * + * @param prop UPnP property + */ +#define cg_upnp_property_getsid(prop) cg_string_getvalue(prop->sid) + +/**** seq ****/ + +/** + * Set sequence number for UPnP property + * + * @param prop UPnP property + * @param value + */ +#define cg_upnp_property_setseq(prop, value) (prop->seq = value) + +/** + * Get sequence number from UPnP property + * + * @param prop UPnP property + */ +#define cg_upnp_property_getseq(prop) (prop->seq) + +/**************************************** +* Function (PropertyList) +****************************************/ + +/** + * Create new UPnP property list + */ +CgUpnpPropertyList *cg_upnp_propertylist_new(); + +/** + * Delete UPnP property list + * + * @param propertylist UPnP property list + */ +void cg_upnp_propertylist_delete(CgUpnpPropertyList *propertylist); + +/** + * Clear UPnP propertylist + * + * @param propList UPnP property list + */ +#define cg_upnp_propertylist_clear(propList) cg_list_clear((CgList *)propList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_property_delete) + +/** + * Get size of property list + * + * @param propList UPnP property list + */ +#define cg_upnp_propertylist_size(propList) cg_list_size((CgList *)propList) + +/** + * Get next list element from property list + * + * @param propList UPnP property list + */ +#define cg_upnp_propertylist_gets(propList) (CgUpnpProperty *)cg_list_next((CgList *)propList) + +/** + * Add new property into property list + * + * @param propList UPnP property list + * @param prop UPnP property + */ +#define cg_upnp_propertylist_add(propList, prop) cg_list_add((CgList *)propList, (CgList *)prop) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cservice.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cservice.h new file mode 100644 index 0000000..603fc01 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cservice.h @@ -0,0 +1,819 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cservice.h +* +* Revision: +* +* 02/14/05 +* - first revision +* +* 09-Jan-06 Heikki Junnila +* - Added service type parsing functions: +* cg_upnp_servicetype_getidentifier +* cg_upnp_servicetype_geturn +* cg_upnp_servicetype_getservice +* cg_upnp_servicetype_gettype +* cg_upnp_servicetype_getversion +* +* 10-Jan-06 Heikki Junnila +* - Added cg_upnp_servicetype_getschematype() and fixed +* existing servicetype functions to accept 1-character strings +* +* 11-Jan-06 Heikki Junnila +* - Removed cg_upnp_service_isname() and _getname() because +* according to UPnP specs, services have only types, not names +* +* 17-Jan-06 Heikki Junnila +* - Added API comments +* 04/05/06 Theo Beisch +* - changed timeout to use subscriber object +* when used by ControlPoint +* modified execution data accordingly +* +******************************************************************/ + +#ifndef _CG_UPNP_CSERVICE_H_ +#define _CG_UPNP_CSERVICE_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************************************************** +* Define +*****************************************************************************/ + +#define CG_UPNP_SERVICE_ELEM_NAME "service" +#define CG_UPNP_SERVICELIST_ELEM_NAME "serviceList" + +#define CG_UPNP_SERVICE_TYPE "serviceType" +#define CG_UPNP_SERVICE_ID "serviceId" +#define CG_UPNP_SERVICE_SCPDURL "SCPDURL" +#define CG_UPNP_SERVICE_CONTROL_URL "controlURL" +#define CG_UPNP_SERVICE_EVENT_SUB_URL "eventSubURL" +#define CG_UPNP_SERVICE_EVENT_KEY_INVALID 0 +#define CG_UPNP_SERVICE_NOTIFY_WAITTIME 1000 + +/**************************************************************************** +* Data Type +*****************************************************************************/ + +typedef struct _CgUpnpService { + BOOL headFlag; + struct _CgUpnpService *prev; + struct _CgUpnpService *next; + CgXmlNodeList *scpdNodeList; + CgXmlNode *serviceNode; + CgUpnpActionList *actionList; + CgUpnpServiceStateTable *serviceStateTable; + void *parentDevice; + CgMutex *mutex; +#if !defined(CG_UPNP_NOUSE_SUBSCRIPTION) + CgUpnpSubscriberList *subscriberList; +#endif + BOOL parsed; + /**** Execution Data ****/ + CgString *subscriptionSid; + long subscriptionTimeout; + + void *userData; + unsigned int eventKey; + CgSysTime subscriptionTimestamp; +} CgUpnpService, CgUpnpServiceList; + +/**************************************** +* Function (Service) +****************************************/ + +/** + * Create a new UPnP service + */ +CgUpnpService *cg_upnp_service_new(); + +/** + * Destroy a UPnP service + * + * @param service The service to destroy + */ +void cg_upnp_service_delete(CgUpnpService *service); + +/** + * Clear the contents of a UPnP service + * + * @param service The service to clear + */ +void cg_upnp_service_clear(CgUpnpService *service); + +/** + * Get the next service in a service list. Use as an iterator. + * + * @param service Current service + */ +#define cg_upnp_service_next(service) (CgUpnpService *)cg_list_next((CgList *)service) + +/** + * Check, whether the given XML node is a service root node + * + * @param node CgXmlNode* + * @return TRUE if the node is a service root node; otherwise FALSE + */ +#define cg_upnp_service_isservicenode(node) cg_xml_node_isname(node, CG_UPNP_SERVICE_ELEM_NAME) + +/** + * Get the service's SCPD node + * + * @param service The service in question + */ +#define cg_upnp_service_getscpdnode(service) cg_xml_nodelist_gets(service->scpdNodeList) + +/** + * Set the root XML node for the service + * + * @param service The service in question + * @param node The node to set + */ +#define cg_upnp_service_setservicenode(service,node) (service->serviceNode = node) + +/** + * Get the root XML node for the service + * + * @param service The service in question + */ +#define cg_upnp_service_getservicenode(service) (service->serviceNode) + +/** + * Get the parent device's XML node for the service + * + * @param service The service in question + */ +#define cg_upnp_service_getdevicenode(service) cg_xml_node_getparentnode(cg_xml_node_getparentnode(service->serviceNode)) + +/** + * Create the service's contents from the given XML document + * + * @param service The service to create + * @param description The XML document to parse + * @param descriptionLen The length of the XML document + */ +BOOL cg_upnp_service_parsedescription(CgUpnpService *service, char *description, int descriptionLen); + +/** + * Create the service's contents from the given URL. Gets the XML document + * from the URL and passes it again to @ref cg_upnp_service_parsedescription + * + * @param service The service to create + * @param url The URL of the document to parse + */ +BOOL cg_upnp_service_parsedescriptionurl(CgUpnpService *service, CgNetURL *url); + +/** + * Get the service's description XML nodes as a string + * + * @param service The service in question + * @param descStr The description string + */ +char *cg_upnp_service_getdescription(CgUpnpService *service, CgString *descStr); + +/** + * Get the service's parsing status (i.e. whether the service has been + * completely constructed). Useful mainly in optimized control point mode. + * + * @param service The service in question + */ +#define cg_upnp_service_isparsed(service) (service->parsed) + +/**************************************************************************** + * serviceType + ****************************************************************************/ + +/** + * Set the service's complete type string + * (ex. "urn:schemas-upnp-org:service:FooService:1") + * + * @param service The service in question + * @param value The type string + */ +#define cg_upnp_service_setservicetype(service, value) cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_TYPE, value) + +/** + * Get the service's complete type string + * (ex. "urn:schemas-upnp-org:service:FooService:1") + * + * @param service The service in question + * @return char* + */ +#define cg_upnp_service_getservicetype(service) cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_TYPE) + +/** + * Get the identifier-part of a service type string (usually "urn") + * + * @param serviceType A service type string (usually the result from + * \ref cg_upnp_service_getservicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_servicetype_getidentifier(char* serviceType); + +/** + * Get the URN part of a service type string (usually "schemas-upnp-org") + * + * @param serviceType A service type string (usually the result from + * \ref cg_upnp_service_getservicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_servicetype_geturn(char* serviceType); + +/** + * Get the service part of a service type string (usually just "service") + * + * @param serviceType A service type string (usually the result from + * \ref cg_upnp_service_getservicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_servicetype_getservice(char* serviceType); + +/** + * Get the type part of a service type string (ex. "ContentDirectory") + * + * @param serviceType A service type string (usually the result from + * \ref cg_upnp_service_getservicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_servicetype_gettype(char* serviceType); + +/** + * Get the schema type part of a service type string (without last colon) + * (ex. "urn:schemas-upnp-org:service:ContentDirectory") + * + * @param serviceType A service type string (usually the result from + * \ref cg_upnp_service_getservicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_servicetype_getschematype(char* serviceType); + +/** + * Get the version part of a service type string (ex. "1") + * + * @param serviceType A service type string (usually the result from + * \ref cg_upnp_service_getservicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_servicetype_getversion(char* serviceType); + +/**************************************************************************** + * serviceID + ****************************************************************************/ + +/** + * Set the service's service ID + * + * @param service The service in question + * @param value Service ID string + */ +#define cg_upnp_service_setserviceid(service, value) cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_ID, value) + +/** + * Get the service's service ID + * + * @param service The service in question + * @return char* + */ +#define cg_upnp_service_getserviceid(service) cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_ID) + +/**************************************************************************** + * SCPDURL + ****************************************************************************/ + +/** + * Set the service's SCPD (service description) URL + * + * @param service The service in question + * @param value The SCPD URL string + */ +#define cg_upnp_service_setscpdurl(service, value) cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_SCPDURL, value) + +/** + * Get the service's SCPD (service description) URL + * + * @param service The service in question + * @return CgNetURL Pointer to URL/URI structure + */ + +CgNetURL *cg_upnp_service_getscpdurl(CgUpnpService *service); + +/** + * Compare the service's SCPD URL and the given location + * + * @param service The service in question + * @param url The URL (location) to compare + * @return TRUE if location is found from URL; otherwise FALSE + */ +BOOL cg_upnp_service_isscpdurl(CgUpnpService *service, char *url); + +/**************************************************************************** + * controlURL + ****************************************************************************/ + +/** + * Set the service's control URL + * + * @param service The service in question + * @param value The control URL string + */ +#define cg_upnp_service_setcontrolurl(service, value) cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_CONTROL_URL, value) + +/** + * Get the service's control URL + * + * @param service The service in question + * @return CgNetURL Pointer to URL/URI structure + */ +CgNetURL *cg_upnp_service_getcontrolurl(CgUpnpService *service); + +/**************************************************************************** + * eventSubURL + ****************************************************************************/ + +/** + * Get the service's event subscription URL + * + * @param service The service in question + * @param value The event subscription URL string + */ +#define cg_upnp_service_seteventsuburl(service, value) cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_EVENT_SUB_URL, value) + +/** + * Get the service's event subscription URL + * + * @param service The service in question + * @return CgNetURL Pointer to URL/URI structure + */ +CgNetURL *cg_upnp_service_geteventsuburl(CgUpnpService *service); + +/**************************************************************************** + * Action + ****************************************************************************/ + +/** + * Get the service's list of actions (head of list) + * + * @param service The service in question + */ +CgUpnpActionList *cg_upnp_service_getactionlist(CgUpnpService *service); + +/** + * Get the first action in the service's list of actions. Use as the + * starting point in iteration loops. + * + * @param service The service in question + */ +CgUpnpAction *cg_upnp_service_getactions(CgUpnpService *service); + +/** + * Get an action from the service by the action's name + * + * @param service The service in question + * @param name The name of the action to look for + * @return CgUpnpAction* or NULL + */ +CgUpnpAction *cg_upnp_service_getactionbyname(CgUpnpService *service, char *name); + +/** + * Check, whether a service has an action by the given name + * + * @param service The service in question + * @param name The name of the action + */ +#define cg_upnp_service_hasactionbyname(service, name) ((cg_upnp_service_getactionbyname(service,name) != NULL) ? TRUE : FALSE) + +/**************************************************************************** + * ServiceStateTable + ****************************************************************************/ + +/** + * Get the service's state table + * + * @param service The service in question + */ +CgUpnpServiceStateTable *cg_upnp_service_getservicestatetable(CgUpnpService *service); + +/** + * Get the first state variable in the service's state table. Use as the + * starting point in iteration loops. + * + * @param service The service in question + */ +CgUpnpStateVariable *cg_upnp_service_getstatevariables(CgUpnpService *service); + +/** + * Get a state variable from the service's state table by the variable's name + * + * @param service The service in question + * @param name the name of the variable + * @return CgUpnpStateVariable* or NULL + */ +CgUpnpStateVariable *cg_upnp_service_getstatevariablebyname(CgUpnpService *service, char *name); + +/** + * Check, whether the service has the given state variable + * + * @param service The service in question + * @param name The name of the state variable + * @return TRUE if found; otherwise FALSE + */ +#define cg_upnp_service_hasstatevariablebyname(service, name) ((cg_upnp_service_getstatevariablebyname(service,name) != NULL) ? TRUE : FALSE) + +/**************************************************************************** + * Advertisement + ****************************************************************************/ + +/** + * Send a service announcement (advertisement) from the given address + * + * @param service The service to advertise + * @param bindAddr The address to attach to the announcement + */ +BOOL cg_upnp_service_announcefrom(CgUpnpService *service, char *bindAddr); + +/** + * Send a byebye announcement (i.e. a cancelling advertisement) from the given + * address + * + * @param service The service to announce from + * @param bindAddr The address to attach to the announcement + */ +BOOL cg_upnp_service_byebyefrom(CgUpnpService *service, char *bindAddr); + +/**************************************************************************** + * Listener + ****************************************************************************/ + +/** + * Set an action listener to the service + * + * @param service The service in question + * @param actionListener A callback function of type CG_UPNP_ACTION_LISTNER + */ +void cg_upnp_service_setactionlistener(CgUpnpService *service, CG_UPNP_ACTION_LISTNER actionListener); + +/** + * Set a query listener to the service + * + * @param service The service in question + * @param queryListener A callback function of type CG_UPNP_STATEVARIABLE_LISTNER + */ +void cg_upnp_service_setquerylistener(CgUpnpService *service, CG_UPNP_STATEVARIABLE_LISTNER queryListener); + +/**************************************************************************** + * Parent Device + ****************************************************************************/ + +/** + * Set the service's parent device + * + * @param service The service in question + * @param dev The parent device + */ +#define cg_upnp_service_setdevice(service, dev) (service->parentDevice = dev) + +/** + * Get the service's parent device + * + * @param service The service in question + * @return CgUpnpDevice* + */ +#define cg_upnp_service_getdevice(service) ((CgUpnpDevice *)service->parentDevice) + +/**************************************************************************** + * Root Device + ****************************************************************************/ + +/** + * Get the service's top-most root device + * + * @param service The service in question + * @return CgUpnpDevice* + */ +#define cg_upnp_service_getrootdevice(service) cg_upnp_device_getrootdevice((CgUpnpDevice *)service->parentDevice) + +/**************************************************************************** + * Subscriber + ****************************************************************************/ + +/** + * Get the first node in the service's list of event subscribers. Use as the + * starting point in iteration loops. + * + * @param service The service in question + */ +#define cg_upnp_service_getsubscribers(service) cg_upnp_subscriberlist_gets(service->subscriberList) + +/** + * Get the number of subscribers for the service + * + * @param service The service in question + * @return int + */ +#define cg_upnp_service_getnsubscribers(service) cg_upnp_subscriberlist_size(service->subscriberList) + +/** + * Add a subscriber to the service + * + * @param service The service in question + * @param sub The subscriber + */ +BOOL cg_upnp_service_addsubscriber(CgUpnpService *service, CgUpnpSubscriber *sub); + +/** + * Remove a subscriber from the service + * + * @param service The service in question + * @param sub The subscriber to remove + */ +BOOL cg_upnp_service_removesubscriber(CgUpnpService *service, CgUpnpSubscriber *sub); + +/** + * Find a subscriber from the service's list of subscribers by its SID + * (Subscription ID) + * + * @param service The service in question + * @param sid The SID + */ +CgUpnpSubscriber *cg_upnp_service_getsubscriberbysid(CgUpnpService *service, char *sid); + +/**************************************************************************** + * Announce + ****************************************************************************/ + +char *cg_upnp_service_getnotifyservicetypent(CgUpnpService *service, char *buf, int bufSize); +char *cg_upnp_service_getnotifyservicetypeusn(CgUpnpService *service, char *buf, int bufSize); + +/**************************************************************************** + * Notify + ****************************************************************************/ + +/** + * Send a notification of a service's changed state variable + * + * @param service The service in question + * @param statVar The changed state variable + */ +BOOL cg_upnp_service_notify(CgUpnpService *service, CgUpnpStateVariable *statVar); + +/** + * Send a notification message to all of the service's subscribers + * + * @param service The service in question + */ +BOOL cg_upnp_service_notifyall(CgUpnpService *service, BOOL doBracket ); + +/** +* Create a new thread to send a notification message to all of the service's subscribers +* + * @param service The service in question +* @param waitTime The wait time to send +*/ +void cg_upnp_service_createnotifyallthread(CgUpnpService *service, CgSysTime waitTime); + +/** + * Send a notification message to all of the service's subscribers + * + * @param service The service in question + * @deprecated Use cg_upnp_service_notifyall(). + */ +#define cg_upnp_service_notifyallstatevariables(service) cg_upnp_service_notifyall(service, FALSE); + +/**************************************************************************** + * Mutex + ****************************************************************************/ + +/** + * Lock the service's mutex + * + * @param service The service in question + */ +#define cg_upnp_service_lock(service) cg_mutex_lock(service->mutex) + +/** + * Unlock the service's mutex + * + * @param service The service in question + */ +#define cg_upnp_service_unlock(service) cg_mutex_unlock(service->mutex) + +/**************************************************************************** + * SID + ****************************************************************************/ + +/** + * Set the service's subscription's SID (subscription ID) + * + * @param service The service in question + * @param value The SID + */ +#define cg_upnp_service_setsubscriptionsid(service, value) cg_string_setvalue(service->subscriptionSid, value) + +/** + * Get the service's SID (subscription ID) + * + * @param service The service in question + * @return char* + */ +#define cg_upnp_service_getsubscriptionsid(service) cg_string_getvalue(service->subscriptionSid) + +/** + * Check, whether the service has any subscribers + * + * @param service The service in question + * @return TRUE if at least one subscriber is found; otherwise FALSE + */ +#define cg_upnp_service_issubscribed(service) ((0 < cg_string_length(service->subscriptionSid)) ? TRUE : FALSE) + +/** + * Clear (i.e. empty) the service's SID (subscription ID) + * + * @param service The service in question + */ +#define cg_upnp_service_clearsubscriptionsid(service) cg_string_setvalue(service->subscriptionSid, "") + +/**************************************************************************** + * Timeout + ****************************************************************************/ + +/** + * Set the service's subscription timeout (expiration) value + * + * @param service The service in question + * @param value The timeout value + */ +#define cg_upnp_service_setsubscriptiontimeout(service, value) (service->subscriptionTimeout = value) + +/** + * Get the service's subscription timeout (expiration) value + * + * @param service The service in question + * @return long + */ +#define cg_upnp_service_getsubscriptiontimeout(service) (service->subscriptionTimeout) + +/**************************************************************************** + * User Data + ****************************************************************************/ + +/** + * Set the service's arbitrary user data pointer + * + * @param service The service in question + * @param value The user data pointer + */ +#define cg_upnp_service_setuserdata(service, value) (service->userData = value) + +/** + * Get the service's arbitrary user data pointer + * + * @param service The service in question + * @return void* + */ +#define cg_upnp_service_getuserdata(service) (service->userData) + +/**************************************************************************** + * Event Key + ****************************************************************************/ + +/** + * Set the service's event key (i.e. the sequential number used in events) + * + * @param service The service in question + * @param value The event key value (uint) + */ +#define cg_upnp_service_seteventkey(service, value) (service->eventKey = value) + +/** + * Get the service's event key + * + * @param service The service in question + * @return uint + */ +#define cg_upnp_service_geteventkey(service) (service->eventKey) + +/**************************************************************************** + * Timestamp + ****************************************************************************/ + +/** + * Set the service's subscription time stamp + * + * @param service The service in question + * @param value The time stamp + */ +#define cg_upnp_service_setsubscriptiontimestamp(service, value) (service->subscriptionTimestamp = value) + +/** + * Get the service's subscription time stamp + * + * @param service The service in question + * @return CgSysTime + */ +#define cg_upnp_service_getsubscriptiontimestamp(service) (service->subscriptionTimestamp) + +/** + * Get the service's subscription expiration time + * + * @param service The service in question + * @return CgSysTime + */ +#define cg_upnp_service_getsubscriptionexpiration(service) (service->subscriptionTimestamp + service->subscriptionTimeout - CG_UPNP_SUBSCRIPTION_DELAY) + + +/**************************************************************************** + * Function (ServiceList) + ****************************************************************************/ + +/** + * Create a new list of services + */ +CgUpnpServiceList *cg_upnp_servicelist_new(); + +/** + * Destroy a list of services + * + * @param serviceList The list of services to destroy + */ +void cg_upnp_servicelist_delete(CgUpnpServiceList *serviceList); + + +/** + * Clear the contents of a list of services + * + * @param serviceList The list of services to clear + */ +#define cg_upnp_servicelist_clear(serviceList) cg_list_clear((CgList *)serviceList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_service_delete) + +/** + * Get the number of services in a list of services + * + * @param serviceList The list of services + * @return int + */ +#define cg_upnp_servicelist_size(serviceList) cg_list_size((CgList *)serviceList) + +/** + * Get the first service in a list of services. Use as the starting point in + * iteration loops. + * + * @param serviceList The service list + */ +#define cg_upnp_servicelist_gets(serviceList) (CgUpnpService *)cg_list_next((CgList *)serviceList) + +/** + * Add a service to a list of services + * + * @param serviceList The list to add the service to + * @param service The service to add to the list + */ +#define cg_upnp_servicelist_add(serviceList, service) cg_list_add((CgList *)serviceList, (CgList *)service) + +/**************************************************************************** + * Function (SSDP) + ****************************************************************************/ + +/** + * The service's handler function that deals with received SSDP messages. + * + * @param service The service in question + * @param ssdpPkt The received SSDP packet + */ +void cg_upnp_service_ssdpmessagereceived(CgUpnpService *service, CgUpnpSSDPPacket *ssdpPkt); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/csoap.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/csoap.h new file mode 100644 index 0000000..dc02410 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/csoap.h @@ -0,0 +1,148 @@ +/****************************************************************** +* +* CyberSOAP for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: csoap.h +* +* Revision: +* +* 02/13/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_SOAP_CSOAP_H_ +#define _CG_SOAP_CSOAP_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_SOAP_VERSION_HEADER "" + +#define CG_HTTP_SOAP_ACTION "SOAPACTION" +#define CG_HTTP_SOAP_URN_DELIM ":" + +#define CG_SOAP_ENVELOPE "Envelope" +#define CG_SOAP_BODY "Body" +#define CG_SOAP_RESPONSE "Response" +#define CG_SOAP_FAULT "Fault" +#define CG_SOAP_FAULT_CODE "faultcode" +#define CG_SOAP_FAULT_STRING "faultstring" +#define CG_SOAP_FAULTACTOR "faultactor" +#define CG_SOAP_DETAIL "detail" + +#define CG_SOAP_ATTRIBUTE_XMLNS "xmlns" + +#define CG_SOAP_XMLNS "s" +#define CG_SOAP_METHODNS "u" +#define CG_SOAP_DELIM ":" + +#define CG_SOAP_XMLNS_URL "http://schemas.xmlsoap.org/soap/envelope/" +#define CG_SOAP_ENCSTYLE_URL "http://schemas.xmlsoap.org/soap/encoding/" + +#define CG_SOAP_CONTENT_TYPE "text/xml; charset=\"utf-8\"" +#define CG_SOAP_ENCORDING "encodingStyle" + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgSoapResponse { + CgHttpResponse *httpRes; + BOOL isHttpResCreated; + CgXmlNodeList *rootNodeList; + void *userData; +} CgSoapResponse; + +typedef struct _CgSoapRequest{ + CgHttpRequest *httpReq; + BOOL isHttpReqCreated; + CgXmlNode *rootNodeList; + CgSoapResponse *soapRes; + void *userData; +} CgSoapRequest; + +/**************************************** +* Function (Request) +****************************************/ + +CgSoapRequest *cg_soap_request_new(); +void cg_soap_request_delete(CgSoapRequest *soapReq); +void cg_soap_request_clear(CgSoapRequest *soapReq); + +BOOL cg_soap_request_sethttprequest(CgSoapRequest *soapReq, CgHttpRequest *httpReq); +#define cg_soap_request_gethttprequest(soapReq) (soapReq->httpReq) + +#define cg_soap_request_setsoapaction(soapReq, name) cg_http_packet_setheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SOAP_ACTION, name) +#define cg_soap_request_getsoapaction(soapReq) cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SOAP_ACTION) +#define cg_soap_request_getsoapactionwithns(soapReq) cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SOAP_ACTION_WITH_NS) + +BOOL cg_soap_request_parsemessage(CgSoapRequest *soapReq, char *msg, int msgLen); +CgSoapResponse *cg_soap_request_post(CgSoapRequest *soapReq, char *ipaddr, int port); +#define cg_soap_request_getsoapresponse(soapReq) (soapReq->soapRes) + +#define cg_soap_request_getrootnoodelist(soapReq) (soapReq->rootNodeList) +#define cg_soap_request_getrootnoode(soapReq) cg_xml_nodelist_gets(soapReq->rootNodeList) +#define cg_soap_request_getenvelopenode(soapReq) cg_xml_nodelist_gets(soapReq->rootNodeList) +CgXmlNode *cg_soap_request_getbodynode(CgSoapRequest *soapReq); + +void cg_soap_request_setcontent(CgSoapRequest *soapReq, CgXmlNode *node); +#define cg_soap_request_createcontent(soapReq) cg_soap_request_setcontent(soapReq, cg_soap_request_getenvelopenode(soapReq)) + +/**** User Data ****/ +#define cg_soap_request_setuserdata(soapReq, value) (soapReq->userData = value) +#define cg_soap_request_getuserdata(soapReq) (soapReq->userData) + +/**************************************** +* Function (Response) +****************************************/ + +CgSoapResponse *cg_soap_response_new(); +void cg_soap_response_delete(CgSoapResponse *soapRes); +void cg_soap_response_clear(CgSoapResponse *soapRes); + +void cg_soap_response_sethttpresponse(CgSoapResponse *soapRes, CgHttpResponse *httpRes); +#define cg_soap_response_gethttpresponse(soapRes) (soapRes->httpRes) + +#define cg_soap_response_getrootnoodelist(soapRes) (soapRes->rootNodeList); +#define cg_soap_response_getrootnoode(soapRes) cg_xml_nodelist_gets(soapRes->rootNodeList); +#define cg_soap_response_getenvelopenode(soapRes) cg_xml_nodelist_gets(soapRes->rootNodeList); +CgXmlNode *cg_soap_response_getbodynode(CgSoapResponse *soapRes); + +void cg_soap_response_setcontent(CgSoapResponse *soapRes, CgXmlNode *node); +#define cg_soap_response_createcontent(soapRes) cg_soap_response_setcontent(soapRes, cg_soap_response_getenvelopenode(soapRes)) + +#define cg_soap_response_getstatuscode(soapRes) cg_http_response_getstatuscode(soapRes->httpRes) +#define cg_soap_response_issuccessful(soapRes) cg_http_response_issuccessful(soapRes->httpRes) + +/**** User Data ****/ +#define cg_soap_response_setuserdata(soapRes, value) (soapRes->userData = value) +#define cg_soap_response_getuserdata(soapRes) (soapRes->userData) + +/**************************************** +* Function +****************************************/ + +CgXmlNode *cg_soap_createenvelopebodynode(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/csocket.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/csocket.h new file mode 100644 index 0000000..1bbe9aa --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/csocket.h @@ -0,0 +1,233 @@ +/****************************************************************** +* +* CyberNet for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: csocket.h +* +* Revision: +* +* 01/17/05 +* - first revision +* 04/03/06 Theo Beisch +* - added WSAGetLastError support +* - changed socket_cleanup to return +* value to enable final Winsock close +******************************************************************/ + +#ifndef _CG_NET_CSOCKET_H_ +#define _CG_NET_CSOCKET_H_ + +#include +#include + +#if defined(CG_USE_OPENSSL) +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_NET_SOCKET_NONE 0 + +#define CG_NET_SOCKET_STREAM 0x01 +#define CG_NET_SOCKET_DGRAM 0x02 + +#define CG_NET_SOCKET_CLIENT 1 +#define CG_NET_SOCKET_SERVER 2 + +#define CG_NET_SOCKET_MAXHOST 32 +#define CG_NET_SOCKET_MAXSERV 32 + +#if defined(BTRON) || defined(TENGINE) +typedef W SOCKET; +#elif defined(ITRON) +typedef ER SOCKET; +#elif !defined(WIN32) && !defined(__CYGWIN__) +typedef int SOCKET; +#endif + +#define CG_SOCKET_LF '\n' + +#define CG_NET_SOCKET_DGRAM_RECV_BUFSIZE 512 +#define CG_NET_SOCKET_DGRAM_ANCILLARY_BUFSIZE 512 +#define CG_NET_SOCKET_MULTICAST_DEFAULT_TTL 4 +#define CG_NET_SOCKET_AUTO_IP_NET 0xa9fe0000 +#define CG_NET_SOCKET_AUTO_IP_MASK 0xffff0000 + +#if defined(ITRON) +#define CG_NET_SOCKET_WINDOW_BUFSIZE 4096 +#endif + +/**************************************** +* Define (SocketList) +****************************************/ + +#if defined(ITRON) +#define CG_NET_USE_SOCKET_LIST 1 +#endif + +/**************************************** +* Data Type +****************************************/ + +#if defined(CG_NET_USE_SOCKET_LIST) +#include +#endif + +typedef struct _CgSocket { +#if defined(CG_NET_USE_SOCKET_LIST) + BOOL headFlag; + struct _CgSocket *prev; + struct _CgSocket *next; +#endif + SOCKET id; + int type; + int direction; + CgString *ipaddr; + int port; +#if defined(ITRON) + UH *sendWinBuf; + UH *recvWinBuf; +#endif +#if defined(CG_USE_OPENSSL) + SSL_CTX* ctx; + SSL* ssl; +#endif +} CgSocket, CgSocketList; + +typedef struct _CgDatagramPacket { + CgString *data; + CgString *localAddress; + int localPort; + CgString *remoteAddress; + int remotePort; +} CgDatagramPacket; + +/**************************************** +* Function (Socket) +****************************************/ + +void cg_socket_startup(); +void cg_socket_cleanup(); + +CgSocket *cg_socket_new(int type); +#define cg_socket_stream_new() cg_socket_new(CG_NET_SOCKET_STREAM) +#define cg_socket_dgram_new() cg_socket_new(CG_NET_SOCKET_DGRAM) +int cg_socket_delete(CgSocket *socket); + +void cg_socket_setid(CgSocket *socket, SOCKET value); +#define cg_socket_getid(socket) (socket->id) + +#define cg_socket_settype(socket, value) (socket->type = value) +#define cg_socket_gettype(socket) (socket->type) +#define cg_socket_issocketstream(socket) ((socket->type & CG_NET_SOCKET_STREAM) ? TRUE : FALSE) +#define cg_socket_isdatagramstream(socket) ((socket->type & CG_NET_SOCKET_DGRAM) ? TRUE : FALSE) + +#define cg_socket_setdirection(socket, value) (socket->direction = value) +#define cg_socket_getdirection(socket) (socket->direction) +#define cg_socket_isclient(socket) ((socket->direction == CG_NET_SOCKET_CLIENT) ? TRUE : FALSE) +#define cg_socket_isserver(socket) ((socket->direction == CG_NET_SOCKET_SERVER) ? TRUE : FALSE) + +#define cg_socket_setaddress(socket, value) cg_string_setvalue(socket->ipaddr, value) +#define cg_socket_setport(socket, value) (socket->port = value) +#define cg_socket_getaddress(socket) cg_string_getvalue(socket->ipaddr) +#define cg_socket_getport(socket) (socket->port) + +BOOL cg_socket_isbound(CgSocket *socket); +BOOL cg_socket_close(CgSocket *socket); + +BOOL cg_socket_listen(CgSocket *socket); + +BOOL cg_socket_bind(CgSocket *sock, int bindPort, char *bindAddr, BOOL bindFlag, BOOL reuseFlag); +BOOL cg_socket_accept(CgSocket *sock, CgSocket *clientSock); +BOOL cg_socket_connect(CgSocket *sock, char *addr, int port); +int cg_socket_read(CgSocket *sock, char *buffer, int bufferLen); +int cg_socket_write(CgSocket *sock, char *buffer, int bufferLen); +int cg_socket_readline(CgSocket *sock, char *buffer, int bufferLen); +long cg_socket_skip(CgSocket *sock, long skipLen); + +int cg_socket_sendto(CgSocket *sock, char *addr, int port, char *data, int dataeLen); +int cg_socket_recv(CgSocket *sock, CgDatagramPacket *dgmPkt); + +int cg_socket_getlasterror(); + +/**************************************** +* Function (Multicast) +****************************************/ + +BOOL cg_socket_joingroup(CgSocket *sock, char *mcastAddr, char *ifAddr); + +/**************************************** +* Function (Option) +****************************************/ + +BOOL cg_socket_setreuseaddress(CgSocket *socket, BOOL flag); +BOOL cg_socket_setmulticastttl(CgSocket *sock, int ttl); +BOOL cg_socket_settimeout(CgSocket *sock, int sec); + +/**************************************** +* Function (DatagramPacket) +****************************************/ + +CgDatagramPacket *cg_socket_datagram_packet_new(); +void cg_socket_datagram_packet_delete(CgDatagramPacket *dgmPkt); + +#define cg_socket_datagram_packet_setdata(dgmPkt, value) cg_string_setvalue(dgmPkt->data, value) +#define cg_socket_datagram_packet_getdata(dgmPkt) cg_string_getvalue(dgmPkt->data) + +#define cg_socket_datagram_packet_setlocaladdress(dgmPkt, addr) cg_string_setvalue(dgmPkt->localAddress, addr) +#define cg_socket_datagram_packet_getlocaladdress(dgmPkt) cg_string_getvalue(dgmPkt->localAddress) +#define cg_socket_datagram_packet_setlocalport(dgmPkt, port) (dgmPkt->localPort = port) +#define cg_socket_datagram_packet_getlocalport(dgmPkt) (dgmPkt->localPort) +#define cg_socket_datagram_packet_setremoteaddress(dgmPkt, addr) cg_string_setvalue(dgmPkt->remoteAddress, addr) +#define cg_socket_datagram_packet_getremoteaddress(dgmPkt) cg_string_getvalue(dgmPkt->remoteAddress) +#define cg_socket_datagram_packet_setremoteport(dgmPkt, port) (dgmPkt->remotePort = port) +#define cg_socket_datagram_packet_getremoteport(dgmPkt) (dgmPkt->remotePort) + +void cg_socket_datagram_packet_copy(CgDatagramPacket *dstDgmPkt, CgDatagramPacket *srcDgmPkt); + +/**************************************** +* Function (SSLSocket) +****************************************/ + +#if defined(CG_USE_OPENSSL) +#define CG_NET_SOCKET_SSL 0x0100 +#define cg_socket_ssl_new() cg_socket_new(CG_NET_SOCKET_STREAM | CG_NET_SOCKET_SSL) +#define cg_socket_isssl(socket) ((socket->type & CG_NET_SOCKET_SSL) ? TRUE : FALSE) +#endif + +/**************************************** +* Function (SocketList) +****************************************/ + +#if defined(CG_NET_USE_SOCKET_LIST) + +#define cg_socket_next(sock) (CgSocket *)cg_list_next((CgList *)sock) + +CgSocketList *cg_socketlist_new(); +void cg_socketlist_delete(CgSocketList *sockList); + +#define cg_socketlist_clear(sockList) cg_list_clear((CgList *)sockList, (CG_LIST_DESTRUCTORFUNC)cg_socket_delete) +#define cg_socketlist_size(sockList) cg_list_size((CgList *)sockList) +#define cg_socketlist_gets(sockList) (CgSocket *)cg_list_next((CgList *)sockList) +#define cg_socketlist_add(sockList, sock) cg_list_add((CgList *)sockList, (CgList *)sock) + +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cssdp.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cssdp.h new file mode 100644 index 0000000..747b873 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cssdp.h @@ -0,0 +1,220 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cssdp.h +* +* Revision: +* +* 02/13/05 +* - first revision +* +* 10/31/05 +* - Added cg_upnp_ssdpresponse_setext and _setserver +* +******************************************************************/ + +#ifndef _CG_UPNP_CSSDP_H_ +#define _CG_UPNP_CSSDP_H_ + +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_UPNP_SSDP_PORT 1900 + +#define CG_UPNP_SSDP_ADDRESS "239.255.255.250" + +#define CG_UPNP_SSDP_MULTICAST_ADDRESS "239.255.255.250:1900" + +#define CG_AUTO_IP_NET 0xa9fe0000 +#define CG_AUTO_IP_MASK 0xffff0000 + +/* Default time to live specified in UPnP DA spec */ +#define CG_UPNP_SSDP_MULTICAST_DEFAULT_TTL 4 + +#define CG_UPNP_SSDP_IPV6_IF_LOCAL_ADDRESS "FF01::C" +#define CG_UPNP_SSDP_IPV6_LINK_LOCAL_ADDRESS "FF02::C" +#define CG_UPNP_SSDP_IPV6_SUBNET_ADDRESS "FF03::C" +#define CG_UPNP_SSDP_IPV6_ADMINISTRATIVE_ADDRESS "FF04::C" +#define CG_UPNP_SSDP_IPV6_SITE_LOCAL_ADDRESS "FF05::C" +#define CG_UPNP_SSDP_IPV6_GLOBAL_ADDRESS "FF0E::C" + +#define CG_UPNP_SSDP_DEFAULT_MSEARCH_MX 3 +#define CG_UPNP_SSDP_DEFAULT_ANNOUNCE_COUNT 3 + +#define CG_UPNP_SSDP_HEADER_LINE_MAXSIZE 128 + +#define CG_UPNP_SSDP_ST "ST" +#define CG_UPNP_SSDP_MX "MX" +#define CG_UPNP_SSDP_MAN "MAN" +#define CG_UPNP_SSDP_NT "NT" +#define CG_UPNP_SSDP_NTS "NTS" + #define CG_UPNP_SSDP_NTS_ALIVE "ssdp:alive" + #define CG_UPNP_SSDP_NTS_BYEBYE "ssdp:byebye" + #define CG_UPNP_SSDP_NTS_PROPCHANGE "upnp:propchange" +#define CG_UPNP_SSDP_USN "USN" +#define CG_UPNP_SSDP_EXT "EXT" +#define CG_UPNP_SSDP_SID "SID" +#define CG_UPNP_SSDP_SEQ "SEQ" +#define CG_UPNP_SSDP_CALBACK "CALLBACK" +#define CG_UPNP_SSDP_TIMEOUT "TIMEOUT" +#define CG_UPNP_SSDP_SERVER "SERVER" + +#define CG_UPNP_SSDP_FILTER_TABLE_SIZE 101 + +/**************************************** +* Data Type +****************************************/ + +typedef CgHttpResponse CgUpnpSSDPResponse; +typedef CgHttpRequest CgUpnpSSDPRequest; + +typedef CgSocket CgUpnpSSDPSocket; + +/**************************************** +* Function +****************************************/ + +void cg_upnp_ssdp_setipv6address(char *addr); +char *cg_upnp_ssdp_getipv6address(); + +void cg_upnp_ssdp_setannouncecount(int count); +int cg_upnp_ssdp_getannouncecount(); + +int cg_upnp_ssdp_getleasetime(char *cacheCont); + +char *cg_upnp_ssdp_gethostaddress(char *ifAddr); + +/**************************************** +* Function (SSDPRequest) +****************************************/ + +CgUpnpSSDPRequest *cg_upnp_ssdprequest_new(); +void cg_upnp_ssdprequest_delete(CgUpnpSSDPRequest *ssdpReq); + +/**** Method ****/ +#define cg_upnp_ssdprequest_setmethod(ssdpReq,value) cg_http_request_setmethod(ssdpReq,value) +#define cg_upnp_ssdprequest_getmethod(ssdpReq) cg_http_request_getmethod(ssdpReq) + +/**** URI ****/ +#define cg_upnp_ssdprequest_seturi(ssdpReq,value) cg_http_request_seturi(ssdpReq,value) +#define cg_upnp_ssdprequest_geturi(ssdpReq) cg_http_request_geturi(ssdpReq) + +/**** HOST ****/ +#define cg_upnp_ssdprequest_sethost(ssdpReq,addr,port) cg_http_packet_sethost((CgHttpPacket*)ssdpReq, addr, port) +#define cg_upnp_ssdprequest_gethost(ssdpReq) cg_http_packet_gethost((CgHttpPacket*)ssdpReq) + +/**** Server ****/ +#define cg_upnp_ssdprequest_setserver(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_HTTP_SERVER, value) +#define cg_upnp_ssdprequest_getserver(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_HTTP_SERVER) + +/**** ST ****/ +#define cg_upnp_ssdprequest_setst(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_UPNP_SSDP_ST, value) +#define cg_upnp_ssdprequest_getst(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_UPNP_SSDP_ST) + +/**** NT ****/ +#define cg_upnp_ssdprequest_setnt(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_UPNP_SSDP_NT, value) +#define cg_upnp_ssdprequest_getnt(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_UPNP_SSDP_NT) + +/**** NTS ****/ +#define cg_upnp_ssdprequest_setnts(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_UPNP_SSDP_NTS, value) +#define cg_upnp_ssdprequest_getnts(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_UPNP_SSDP_NTS) + +/**** Location ****/ +#define cg_upnp_ssdprequest_setlocation(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_HTTP_LOCATION, value) +#define cg_upnp_ssdprequest_getlocation(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_HTTP_LOCATION) + +/**** USN ****/ +#define cg_upnp_ssdprequest_setusn(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_UPNP_SSDP_USN, value) +#define cg_upnp_ssdprequest_getusn(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_UPNP_SSDP_USN) + +/**** MX ****/ +#define cg_upnp_ssdprequest_setmx(ssdpReq,value) cg_http_packet_setheaderinteger((CgHttpPacket*)ssdpReq, CG_UPNP_SSDP_MX, value) +#define cg_upnp_ssdprequest_getmx(ssdpReq) cg_http_packet_getheaderinteger((CgHttpPacket*)ssdpReq,CG_UPNP_SSDP_MX) + +/**** MAN ****/ +#define cg_upnp_ssdprequest_setman(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_UPNP_SSDP_MAN, value) +#define cg_upnp_ssdprequest_getman(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_UPNP_SSDP_MAN) + +/**** CacheControl ****/ +void cg_upnp_ssdprequest_setleasetime(CgUpnpSSDPRequest *ssdpReq, int value); +int cg_upnp_ssdprequest_getleasetime(CgUpnpSSDPRequest *ssdpReq); + +/**** toString ****/ +char *cg_upnp_ssdprequest_tostring(CgUpnpSSDPRequest *ssdpReq, CgString *ssdpMsg); + +/**** Print ****/ +#define cg_upnp_ssdprequest_print(ssdpReq) cg_http_request_print(ssdpReq) + +/**************************************** +* Function (SSDPResponse) +****************************************/ + +CgUpnpSSDPResponse *cg_upnp_ssdpresponse_new(); +void cg_upnp_ssdpresponse_delete(CgUpnpSSDPResponse *ssdpRes); + +/**** ST ****/ +#define cg_upnp_ssdpresponse_setst(ssdpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpRes, CG_UPNP_SSDP_ST, value) +#define cg_upnp_ssdpresponse_getst(ssdpRes) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpRes,CG_UPNP_SSDP_ST) + +/**** EXT ****/ +#define cg_upnp_ssdpresponse_setext(ssdpRes) cg_http_packet_setheadervalue((CgHttpPacket*) ssdpRes, CG_UPNP_SSDP_EXT, "") + +/**** SERVER ****/ +#define cg_upnp_ssdpresponse_setserver(ssdpRes, value) cg_http_packet_setheadervalue((CgHttpPacket*) ssdpRes, CG_UPNP_SSDP_SERVER, value) + +/**** Location ****/ +#define cg_upnp_ssdpresponse_setlocation(ssdpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpRes, CG_HTTP_LOCATION, value) +#define cg_upnp_ssdpresponse_getlocation(ssdpRes) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpRes,CG_HTTP_LOCATION) + +/**** USN ****/ +#define cg_upnp_ssdpresponse_setusn(ssdpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpRes, CG_UPNP_SSDP_USN, value) +#define cg_upnp_ssdpresponse_getusn(ssdpRes) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpRes,CG_UPNP_SSDP_USN) + +/**** CacheControl ****/ +void cg_upnp_ssdpresponse_setleasetime(CgUpnpSSDPResponse *ssdpRes, int value); +int cg_upnp_ssdpresponse_getleasetime(CgUpnpSSDPResponse *ssdpRes); + +/**** Date ****/ +#define cg_upnp_ssdpresponse_setdate(ssdpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpRes, CG_HTTP_DATE, value) +#define cg_upnp_ssdpresponse_getdate(ssdpRes) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpRes,CG_HTTP_DATE) + +/**** toString ****/ +char *cg_upnp_ssdpresponse_tostring(CgUpnpSSDPResponse *ssdpRes, CgString *ssdpMsg); + +/**** Print ****/ +#define cg_upnp_ssdpresponse_print(ssdpReq) cg_http_response_print(ssdpReq) + +/**************************************** +* Function (SSDPSocket) +****************************************/ + +#define cg_upnp_ssdp_socket_new() cg_socket_new(CG_NET_SOCKET_DGRAM) +#define cg_upnp_ssdp_socket_delete(socket) cg_socket_delete(socket) +#define cg_upnp_ssdp_socket_close(socket) cg_socket_close(socket) + +BOOL cg_upnp_ssdp_socket_notifyfrom(CgUpnpSSDPSocket *ssdpSock, CgUpnpSSDPRequest *ssdpReq, char *bindAddr); +BOOL cg_upnp_ssdp_socket_postresponse(CgUpnpSSDPSocket *ssdpSock, CgUpnpSSDPResponse *ssdpReq, char *host, int port); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cssdp_server.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cssdp_server.h new file mode 100644 index 0000000..6eea2c1 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cssdp_server.h @@ -0,0 +1,247 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cssdp_server.h +* +* Revision: +* +* 05/26/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CSSDP_SERVER_H_ +#define _CG_UPNP_CSSDP_SERVER_H_ + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/**************************************** +* Data Type +****************************************/ + +typedef CgSocket CgUpnpHttpMuSocket; +typedef CgSocket CgUpnpHttpUSocket; + +typedef struct _CgUpnpSSDPPacket { + CgDatagramPacket *dgmPkt; + CgHttpHeaderList *headerList; + void *userData; + CgSysTime timeStamp; + + /* These are used when filtering out duplicate + * M-SEARCHes + */ + CgSysTime *timestamps; + int initialized; +} CgUpnpSSDPPacket; + +typedef void (*CG_UPNP_SSDP_LISTNER)(CgUpnpSSDPPacket *); + +typedef struct _CgUpnpSSDPServer { + BOOL headFlag; + struct _CgUpnpSSDPServer *prev; + struct _CgUpnpSSDPServer *next; + CgUpnpHttpMuSocket *httpmuSock; + CgThread *recvThread; + CG_UPNP_SSDP_LISTNER listener; + void *userData; +} CgUpnpSSDPServer, CgUpnpSSDPServerList; + +typedef void (*CG_UPNP_SSDP_RESPONSE_LISTNER)(CgUpnpSSDPPacket *); + +typedef struct _CgUpnpSSDPResponseServer { + BOOL headFlag; + struct _CgUpnpSSDPServer *prev; + struct _CgUpnpSSDPServer *next; + CgUpnpHttpUSocket *httpuSock; + CgThread *recvThread; + CG_UPNP_SSDP_RESPONSE_LISTNER listener; + void *userData; +} CgUpnpSSDPResponseServer, CgUpnpSSDPResponseServerList; + +/**************************************** +* Function (HTTPMU) +****************************************/ + +#define cg_upnp_httpmu_socket_new() cg_socket_dgram_new() +#define cg_upnp_httpmu_socket_delete(sock) cg_socket_delete(sock) +#define cg_upnp_httpmu_socket_close(sock) cg_socket_close(sock) + +BOOL cg_upnp_httpmu_socket_bind(CgUpnpHttpMuSocket *sock, char *mcastAddr, int port, char *bindAddr); +int cg_upnp_httpmu_socket_recv(CgUpnpHttpMuSocket *sock, CgUpnpSSDPPacket *ssdpPkt); + +/**************************************** +* Function (HTTPU) +****************************************/ + +#define cg_upnp_httpu_socket_new() cg_socket_dgram_new() +#define cg_upnp_httpu_socket_delete(sock) cg_socket_delete(sock) +#define cg_upnp_httpu_socket_close(sock) cg_socket_close(sock) +#define cg_upnp_httpu_socket_new() cg_socket_dgram_new() +#define cg_upnp_httpu_socket_bind(sock, bindPort, bindAddr) cg_socket_bind(sock, bindPort, bindAddr, FALSE, FALSE) +int cg_upnp_httpu_socket_recv(CgUpnpHttpUSocket *sock, CgUpnpSSDPPacket *ssdpPkt); + +/**************************************** +* Function (SSDPPacket) +****************************************/ + +CgUpnpSSDPPacket *cg_upnp_ssdp_packet_new(); +void cg_upnp_ssdp_packet_delete(CgUpnpSSDPPacket *ssdpPkt); +void cg_upnp_ssdp_packet_clear(CgUpnpSSDPPacket *ssdpPkt); + +#define cg_upnp_ssdp_packet_setdatagrampacket(ssdpPkt, value) (ssdpPkt->dgmPkt = value) +#define cg_upnp_ssdp_packet_getdatagrampacket(ssdpPkt) (ssdpPkt->dgmPkt) +#define cg_upnp_ssdp_packet_setdata(ssdpPkt, value) cg_string_setvalue(ssdpPkt->dgmPkt->data, value) +#define cg_upnp_ssdp_packet_getdata(ssdpPkt) cg_string_getvalue(ssdpPkt->dgmPkt->data) +#define cg_upnp_ssdp_packet_setuserdata(ssdpPkt, data) (ssdpPkt->userData = data) +#define cg_upnp_ssdp_packet_getuserdata(ssdpPkt) (ssdpPkt->userData) +#define cg_upnp_ssdp_packet_settimestamp(ssdpPkt, value) (ssdpPkt->timeStamp = value) +#define cg_upnp_ssdp_packet_gettimestamp(ssdpPkt) (ssdpPkt->timeStamp) +#define cg_upnp_ssdp_packet_getexpiration(ssdpPkt) (cg_upnp_ssdp_packet_getmaxage(ssdpPkt) == 0 ? 0 : cg_upnp_ssdp_packet_gettimestamp(ssdpPkt) + cg_upnp_ssdp_packet_getmaxage(ssdpPkt)) + +void cg_upnp_ssdp_packet_setheader(CgUpnpSSDPPacket *ssdpPkt, char *ssdpMsg); +#define cg_upnp_ssdp_packet_addheader(ssdpPkt, header) cg_http_headerlist_add(ssdpPkt->headerList, header) +#define cg_upnp_ssdp_packet_getheaders(ssdpPkt) cg_http_headerlist_gets(ssdpPkt->headerList) + +#define cg_upnp_ssdp_packet_gethost(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_HOST) +#define cg_upnp_ssdp_packet_getserver(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_SERVER) +#define cg_upnp_ssdp_packet_getcachecontrol(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_CACHE_CONTROL) +#define cg_upnp_ssdp_packet_getdate(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_DATE) +#define cg_upnp_ssdp_packet_getext(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_EXT) +#define cg_upnp_ssdp_packet_getlocation(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_LOCATION) +#define cg_upnp_ssdp_packet_getst(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_ST) +#define cg_upnp_ssdp_packet_getusn(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_USN) +#define cg_upnp_ssdp_packet_getmx(ssdpPkt) cg_str2int(cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_MX)) +#define cg_upnp_ssdp_packet_getman(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_MAN) +#define cg_upnp_ssdp_packet_getnt(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_NT) +#define cg_upnp_ssdp_packet_getnts(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_NTS) +long cg_upnp_ssdp_packet_getmaxage(CgUpnpSSDPPacket *ssdpPkt); + +#define cg_upnp_ssdp_packet_isdiscover(ssdpPkt) cg_upnp_man_isdiscover(cg_upnp_ssdp_packet_getman(ssdpPkt)) +#define cg_upnp_ssdp_packet_isalive(ssdpPkt) cg_upnp_nts_isalive(cg_upnp_ssdp_packet_getnts(ssdpPkt)) +#define cg_upnp_ssdp_packet_isbyebye(ssdpPkt) cg_upnp_nts_isbyebye(cg_upnp_ssdp_packet_getnts(ssdpPkt)) + +BOOL cg_upnp_ssdp_packet_isrootdevice(CgUpnpSSDPPacket *ssdpPkt); + +#define cg_upnp_ssdp_packet_getlocaladdress(ssdpPkt) cg_socket_datagram_packet_getlocaladdress(ssdpPkt->dgmPkt) +#define cg_upnp_ssdp_packet_getlocalport(ssdpPkt) cg_socket_datagram_packet_getlocalport(ssdpPkt->dgmPkt) +#define cg_upnp_ssdp_packet_getremoteaddress(ssdpPkt) cg_socket_datagram_packet_getremoteaddress(ssdpPkt->dgmPkt) +#define cg_upnp_ssdp_packet_getremoteport(ssdpPkt) cg_socket_datagram_packet_getremoteport(ssdpPkt->dgmPkt) + +void cg_upnp_ssdp_packet_copy(CgUpnpSSDPPacket *destSsdpPkt, CgUpnpSSDPPacket *srcSsdpPkt); +void cg_upnp_ssdp_packet_print(CgUpnpSSDPPacket *ssdpPkt); + +/**************************************** +* Function (SSDPServer) +****************************************/ + +CgUpnpSSDPServer *cg_upnp_ssdp_server_new(); +void cg_upnp_ssdp_server_delete(CgUpnpSSDPServer *server); + +#define cg_upnp_ssdp_server_next(server) (CgUpnpSSDPServer *)cg_list_next((CgList *)server) + +BOOL cg_upnp_ssdp_server_open(CgUpnpSSDPServer *server, char *bindAddr); +BOOL cg_upnp_ssdp_server_close(CgUpnpSSDPServer *server); + +#define cg_upnp_ssdp_server_isopened(server) ((server->httpmuSock != NULL) ? TRUE : FALSE) +#define cg_upnp_ssdp_server_getsocket(server) (server->httpmuSock) + +#define cg_upnp_ssdp_server_setlistener(server, func) (server->listener = func) +#define cg_upnp_ssdp_server_getlistener(server) (server->listener) +void cg_upnp_ssdp_server_performlistener(CgUpnpSSDPServer *server, CgUpnpSSDPPacket *ssdpPkt); + +#define cg_upnp_ssdp_server_setuserdata(server, data) (server->userData = data) +#define cg_upnp_ssdp_server_getuserdata(server) (server->userData) + +BOOL cg_upnp_ssdp_server_start(CgUpnpSSDPServer *server); +BOOL cg_upnp_ssdp_server_stop(CgUpnpSSDPServer *server); + +/**************************************** +* Function (SSDPServerList) +****************************************/ + +CgUpnpSSDPServerList *cg_upnp_ssdp_serverlist_new(); +void cg_upnp_ssdp_serverlist_delete(CgUpnpSSDPServerList *serverList); + +#define cg_upnp_ssdp_serverlist_clear(serverList) cg_list_clear((CgList *)serverList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_ssdp_server_delete) +#define cg_upnp_ssdp_serverlist_size(serverList) cg_list_size((CgList *)serverList) +#define cg_upnp_ssdp_serverlist_gets(serverList) (CgUpnpSSDPServer *)cg_list_next((CgList *)serverList) +#define cg_upnp_ssdp_serverlist_add(serverList, server) cg_list_add((CgList *)serverList, (CgList *)server) + +BOOL cg_upnp_ssdp_serverlist_open(CgUpnpSSDPServerList *ssdpServerList); +BOOL cg_upnp_ssdp_serverlist_close(CgUpnpSSDPServerList *ssdpServerList); +BOOL cg_upnp_ssdp_serverlist_start(CgUpnpSSDPServerList *ssdpServerList); +BOOL cg_upnp_ssdp_serverlist_stop(CgUpnpSSDPServerList *ssdpServerList); +void cg_upnp_ssdp_serverlist_setlistener(CgUpnpSSDPServerList *ssdpServerList, CG_UPNP_SSDP_LISTNER listener); +void cg_upnp_ssdp_serverlist_setuserdata(CgUpnpSSDPServerList *ssdpServerList, void *data); + +/**************************************** +* Function (SSDPResponseServer) +****************************************/ + +CgUpnpSSDPResponseServer *cg_upnp_ssdpresponse_server_new(); +void cg_upnp_ssdpresponse_server_delete(CgUpnpSSDPResponseServer *server); + +#define cg_upnp_ssdpresponse_server_next(server) (CgUpnpSSDPResponseServer *)cg_list_next((CgList *)server) + +BOOL cg_upnp_ssdpresponse_server_open(CgUpnpSSDPResponseServer *server, int bindPort, char *bindAddr); +BOOL cg_upnp_ssdpresponse_server_close(CgUpnpSSDPResponseServer *server); + +#define cg_upnp_ssdpresponse_server_isopened(server) ((server->httpuSock != NULL) ? TRUE : FALSE) +#define cg_upnp_ssdpresponse_server_getsocket(server) (server->httpuSock) + +#define cg_upnp_ssdpresponse_server_setlistener(server, func) (server->listener = func) +#define cg_upnp_ssdpresponse_server_getlistener(server) (server->listener) +void cg_upnp_ssdpresponse_server_performlistener(CgUpnpSSDPResponseServer *server, CgUpnpSSDPPacket *ssdpPkt); + +#define cg_upnp_ssdpresponse_server_setuserdata(server, data) (server->userData = data) +#define cg_upnp_ssdpresponse_server_getuserdata(server) (server->userData) + +BOOL cg_upnp_ssdpresponse_server_start(CgUpnpSSDPResponseServer *server); +BOOL cg_upnp_ssdpresponse_server_stop(CgUpnpSSDPResponseServer *server); + +BOOL cg_upnp_ssdpresponse_server_post(CgUpnpSSDPResponseServer *server, CgUpnpSSDPRequest *ssdpReq); + +/**************************************** +* Function (SSDPResponseServerList) +****************************************/ + +CgUpnpSSDPResponseServerList *cg_upnp_ssdpresponse_serverlist_new(); +void cg_upnp_ssdpresponse_serverlist_delete(CgUpnpSSDPResponseServerList *serverList); + +#define cg_upnp_ssdpresponse_serverlist_clear(serverList) cg_list_clear((CgList *)serverList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_ssdpresponse_server_delete) +#define cg_upnp_ssdpresponse_serverlist_size(serverList) cg_list_size((CgList *)serverList) +#define cg_upnp_ssdpresponse_serverlist_gets(serverList) (CgUpnpSSDPResponseServer *)cg_list_next((CgList *)serverList) +#define cg_upnp_ssdpresponse_serverlist_add(serverList, server) cg_list_add((CgList *)serverList, (CgList *)server) + +BOOL cg_upnp_ssdpresponse_serverlist_open(CgUpnpSSDPResponseServerList *ssdpServerList, int bindPort); +BOOL cg_upnp_ssdpresponse_serverlist_close(CgUpnpSSDPResponseServerList *ssdpServerList); +BOOL cg_upnp_ssdpresponse_serverlist_start(CgUpnpSSDPResponseServerList *ssdpServerList); +BOOL cg_upnp_ssdpresponse_serverlist_stop(CgUpnpSSDPResponseServerList *ssdpServerList); +void cg_upnp_ssdpresponse_serverlist_setlistener(CgUpnpSSDPResponseServerList *ssdpServerList, CG_UPNP_SSDP_LISTNER listener); +void cg_upnp_ssdpresponse_serverlist_setuserdata(CgUpnpSSDPResponseServerList *ssdpServerList, void *data); +BOOL cg_upnp_ssdpresponse_serverlist_post(CgUpnpSSDPResponseServerList *ssdpServerList, CgUpnpSSDPRequest *ssdpReq); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cstatevariable.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cstatevariable.h new file mode 100644 index 0000000..800966e --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cstatevariable.h @@ -0,0 +1,473 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cstatevariable.h +* +* Revision: +* +* 02/23/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CSTATEVARIABLE_H_ +#define _CG_UPNP_CSTATEVARIABLE_H_ + +#include +#include +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/** + * Definition for state variable XML element name + */ +#define CG_UPNP_STATEVARIABLE_ELEM_NAME "stateVariable" + +/** + * Definition for service state table XML element name + */ +#define CG_UPNP_SERVICESTATETALBE_ELEM_NAME "serviceStateTable" + +/** + * Definition for state variable name element + */ +#define CG_UPNP_STATEVARIABLE_NAME "name" + +/** + * Definition for state variable data type element + */ +#define CG_UPNP_STATEVARIABLE_DATATYPE "dataType" + +/** + * Definition for state variable send events element name + */ +#define CG_UPNP_STATEVARIABLE_SENDEVENTS "sendEvents" + +/** + * Definition for state variable send events element value + */ +#define CG_UPNP_STATEVARIABLE_SENDEVENTS_YES "yes" + +/** + * Definition for state variable send events element value + */ +#define CG_UPNP_STATEVARIABLE_SENDEVENTS_NO "no" + +/** + * Definition for state variable allowed values list + */ +#define CG_UPNP_STATEVARIABLE_ALLOWEDVALUELIST "allowedValueList" + + +/**************************************** +* Data Type +****************************************/ + +/** + * Data type for allowed state variables allowed values table + */ +typedef struct _CgUpnpAllowedValuesList { + BOOL headFlag; + struct _CgUpnpAllowedValuesList *prev; + struct _CgUpnpAllowedValuesList *next; + CgString *value; +} CgUpnpAllowedValuesList, CgUpnpAllowedValue; + + +/** + * Data type for state variable and state table + */ +typedef struct _CgUpnpStateVariable { + BOOL headFlag; + struct _CgUpnpStateVariable *prev; + struct _CgUpnpStateVariable *next; + CgUpnpAllowedValuesList* allowedValueList; + //tb: fixmelater verify type CgUpnpService* ??? + void *parentService; + CgXmlNode *stateVarNode; + /* Dummy pointers to maintain ABI, Please remove during the + * appropriate development stage */ + void *dummy1; + void *dummy2; + /**** Execution Data ****/ + CgString *value; + BOOL (*listener)(struct _CgUpnpStateVariable *); + CgUpnpStatus *upnpStatus; + void *userData; + +} CgUpnpStateVariable, CgUpnpServiceStateTable; + + +/** + * Type definition for state variable listener function + */ +typedef BOOL (*CG_UPNP_STATEVARIABLE_LISTNER)(CgUpnpStateVariable *); + +/**************************************** +* Function (StateVariable) +****************************************/ + +/** + * Create new state variable object + */ +CgUpnpStateVariable *cg_upnp_statevariable_new(); + +/** + * Delete state variable object + * + * @param statVar state variable + */ +void cg_upnp_statevariable_delete(CgUpnpStateVariable *statVar); + +/** + * Get next element from state variable list + * + * @param statVar state variable list node + */ +#define cg_upnp_statevariable_next(statVar) (CgUpnpStateVariable *)cg_list_next((CgList *)statVar) + +/** + * Check if XML node is state variable node + * + * @param node XML node + */ +#define cg_upnp_statevariable_isstatevariablenode(node) cg_xml_node_isname(node, CG_UPNP_STATEVARIABLE_ELEM_NAME) + +/**** XML Node ****/ + +/** + * Set XML node for this state variable + * + * @param statVar State variable + * @param node XML node + */ +void cg_upnp_statevariable_setstatevariablenode(CgUpnpStateVariable *statVar, CgXmlNode *node); + +/** + * Get XML node from this state variable + * + * @param statVar State variable + */ +#define cg_upnp_statevariable_getstatevariablenode(statVar) (statVar->stateVarNode) + +/**** Service ****/ + +/** + * Set service for this state variable + * + * @param statVar State variable + * @param service Service + */ +#define cg_upnp_statevariable_setservice(statVar, service) (statVar->parentService = service) + +/** + * Get service from state variable + * + * @param statVar State variable + * + * @return UPnP service + */ +#define cg_upnp_statevariable_getservice(statVar) ((CgUpnpService *)statVar->parentService) + +/**** allowedValueList ****/ + +/** + * Get allowed value list + * + * @param statVar State variable + * + * @return Allowed value list + */ +CgUpnpAllowedValuesList* cg_upnp_statevariable_getallowedvaluelist(CgUpnpStateVariable* statVar); + +/** + * Check if state variable has allowed value list + * + * @param statVar State variable + * + * @return 0 if it does not have allowed value list integer greater than zero otherwise + */ +#define cg_upnp_statevariable_hasallowedvaluelist(statVar) cg_upnp_allowedvaluelist_size(statVar->allowedValueList) + +/** + * Check if state variable allowes to receive value + * + * @parap value value to be checked + * @param statVar State variable + * + * @return 0 if it does allowed to receive value +*/ +int cg_upnp_statevariable_is_allowed_value(CgUpnpStateVariable* statVar, const char* value); + + +/** + * Create new allowed state variable values list + */ +CgUpnpAllowedValuesList* cg_upnp_allowedvaluelist_new(); + +/**** allowedValueRange ****/ + +/** + * Get allowed value range for state variable + * + * @param statVar State variable + * + * @return Allowed value range + */ +#define cg_upnp_statevariable_getallowedvaluerange(statVar) (statVar->allowedValueRange) + +/** + * Checks if state variable has allowed variable range + * + * @param statVar State variable + * + * @return True if allowed value range exists, false otherwise + */ +#define cg_upnp_statevariable_hasallowedvaluerange(statVar) ((statVar->allowedValueRange != NULL) ? TRUE : FALSE) + +/**** name ****/ + +/** + * Set state variable name + * + * @param statVar State variable + * @param value New state variable name + */ +#define cg_upnp_statevariable_setname(statVar, value) cg_xml_node_setchildnode(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_NAME, value) + +/** + * Get state variable name + * + * @param statVar State variable + * + * @return State variable name + */ +#define cg_upnp_statevariable_getname(statVar) cg_xml_node_getchildnodevalue(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_NAME) + +/** + * Checks if state variable has certain name + * + * @param statVar State variable + * @param name Name to be checked + * + * @return True if State variable name is same as provided, false otherwise + */ +#define cg_upnp_statevariable_isname(statVar, name) cg_streq(cg_upnp_statevariable_getname(statVar), name) + +/**** dataType ****/ + +/** + * Set data type for state variable + * + * @param statVar State variable + * @param value Data type + */ +#define cg_upnp_statevariable_setdatatype(statVar, value) cg_xml_node_setchildnode(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_DATATYPE, value) + +/** + * Get data type from state variable + * + * @param statVar State variable + * + * @return Data type + */ +#define cg_upnp_statevariable_getdatatype(statVar) cg_xml_node_getchildnodevalue(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_DATATYPE) + +/**** sendEvents ****/ + +/** + * Set send events option for state variable, can be used to disable eventing + * for certain variables. + * + * @param statVar State variable + * @param value New value + */ +#define cg_upnp_statevariable_setsendevents(statVar, value) cg_xml_node_setattribute(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_SENDEVENTS, value) + +/** + * Get state variable event sending option value + * + * @param statVar State variable + * + * @return Current value associated to state variable + */ +#define cg_upnp_statevariable_getsendevents(statVar) cg_xml_node_getattributevalue(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_SENDEVENTS) + +/** + * Check if events are sent to subscribers when this state variable changes + * + * @param statVar State variable + * + * @return True if events are sent, false otherwise + */ +#define cg_upnp_statevariable_issendevents(statVar) (cg_streq(cg_upnp_statevariable_getsendevents(statVar), CG_UPNP_STATEVARIABLE_SENDEVENTS_YES)) + +/**************************************** +* Function (StateVariable - Execution Data) +****************************************/ + +/**** value ****/ + +/** + * Set state variable value + * + * @param statVar State variable + * @param data New value associated with this state variable, and the value is send to other devices which subscribe the service. + */ +void cg_upnp_statevariable_setvalue(CgUpnpStateVariable *statVar, char *data); + +/** + * Set state variable value + * + * @param statVar State variable + * @param data New value associated with this state variable + */ +void cg_upnp_statevariable_setvaluewithoutnotify(CgUpnpStateVariable *statVar, char *data); + +/** + * Get value associated with this state variable + * + * @param statVar State variable + * + * @return Value associated with this state variable + */ +#define cg_upnp_statevariable_getvalue(statVar) cg_string_getvalue(statVar->value) + +/*** listener ****/ + +/** + * Set listener callback for this state variable + * + * @param statVar State variable + * @param func Listener function + */ +#define cg_upnp_statevariable_setlistener(statVar, func) (statVar->listener = func) + +/** + * Get lister function associated with state variable + * + * @param statVar State variable + */ +#define cg_upnp_statevariable_getlistener(statVar) (statVar->listener) + +/**** UPnPStatus ****/ + +/** + * Set status code for state variable + * + * @param statVar State variable + * @param code Status code + */ +#define cg_upnp_statevariable_setstatuscode(statVar, code) cg_upnp_status_setcode(statVar->upnpStatus, code) + +/** + * Get status code of this state variable + * + * @param statVar Status variable + */ +#define cg_upnp_statevariable_getstatuscode(statVar) cg_upnp_status_getcode(statVar->upnpStatus) + +/** + * Set status description for state variable + * + * @param statVar State variable + * @param value Status description + */ +#define cg_upnp_statevariable_setstatusdescription(statVar, value) cg_upnp_status_setdescription(statVar->upnpStatus, value) + +/** + * Get status description from this state variable + * + * @param statVar State variable + */ +#define cg_upnp_statevariable_getstatusdescription(statVar) cg_upnp_status_getdescription(statVar->upnpStatus) + +/**** User Data****/ + +/** + * Set arbitrary user data associated with this state variable + * + * @param statVar State variable + * @param value Data + */ +#define cg_upnp_statevariable_setuserdata(statVar, value) (statVar->userData = value) + +/** + * Get user data from this state variable + * + * @param statVar State variable + * + * @return User data + */ +#define cg_upnp_statevariable_getuserdata(statVar) (statVar->userData) + +/**************************************** +* Function (ServiceStateTable) +****************************************/ + +/** + * Create service state table object + */ +CgUpnpServiceStateTable *cg_upnp_servicestatetable_new(); + +/** + * Delete service state table object + * + * @param servicestatetable Service state table + */ +void cg_upnp_servicestatetable_delete(CgUpnpServiceStateTable *servicestatetable); + +/** + * Clear service state table + * + * @param stateTable Service state table + */ +#define cg_upnp_servicestatetable_clear(stateTable) cg_list_clear((CgList *)stateTable, (CG_LIST_DESTRUCTORFUNC)cg_upnp_statevariable_delete) + +/** + * Get size of service state table + * + * @param stateTable Service state table + */ +#define cg_upnp_servicestatetable_size(stateTable) cg_list_size((CgList *)stateTable) + +/** + * Get next service state table from service state table list + * + * @param stateTable Service state table + * + * @return Service state table (node) + */ +#define cg_upnp_servicestatetable_gets(stateTable) (CgUpnpStateVariable *)cg_list_next((CgList *)stateTable) + +/** + * Add new service state table into service state table list + * + * @param stateTable Service state table + * @param statVar State variable + */ +#define cg_upnp_servicestatetable_add(stateTable, statVar) cg_list_add((CgList *)stateTable, (CgList *)statVar) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cstring.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cstring.h new file mode 100644 index 0000000..f4cdb24 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cstring.h @@ -0,0 +1,172 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cstring.h +* +* Revision: +* +* 01/25/05 +* - first revision +* 03/01/06 Theo Beisch +* - introduced LONGLONG macro +* - added cg_strtrimwhite() to trim all +* leading and trailing non-printable chars +* +******************************************************************/ + +#ifndef _CG_UTIL_CSTRING_H_ +#define _CG_UTIL_CSTRING_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_STRING_MEMORY_ALLOCATION_UNIT 64 + +/* UINT_MAX : 4294967295U */ +#define CG_STRING_INTEGER_BUFLEN 16 + + /* ULONG_MAX : 4294967295UL */ +#define CG_STRING_LONG_BUFLEN 32 + + /* ULLONG_MAX : 18446744073709551615ULL */ +#define CG_STRING_LONGLONG_BUFLEN 32 + +#define CG_STRING_FLOAT_BUFLEN 64 +#define CG_STRING_DOUBLE_BUFLEN 64 + +/**************************************** +* Function +****************************************/ + +char *cg_strdup(char *str); +int cg_strlen(char *str); +char *cg_strcpy(char *dest, char *src); +char *cg_strcat(char *dest, char *src); +int cg_strcmp(char *str1, char *str2); +int cg_strncmp(char *str1, char *str2, int nchars); +int cg_strcasecmp(char *str1, char *str2); +BOOL cg_streq(char *str1, char *str2); +BOOL cg_strcaseeq(char *str1, char *str2); +int cg_strchr(char *str, char *chars, int nchars); +int cg_strrchr(char *str, char *chars, int nchars); +int cg_strstr(char *haystack, char *needle); +char *cg_strtrimwhite(char *str); +char *cg_strtrim(char *str, char *delim, int ndelim); +char *cg_strltrim(char *str, char *delim, int ndelim); +char *cg_strrtrim(char *str, char *delim, int ndelim); +char *cg_int2str(int value, char *buf, int bufSize); +char *cg_long2str(long value, char *buf, int bufSize); +char *cg_float2str(float value, char *buf, int bufSize); +char *cg_double2str(double value, char *buf, int bufSize); +char *cg_strncpy(char *str1, char *str2, size_t cnt); +char *cg_strncat(char *str1, char *str2, size_t cnt); + +#if defined(CG_USE_INT64) +char *cg_longlong2str(CgInt64 value, char *buf, int bufSize); +#endif + +#define cg_str2int(value) (value ? atoi(value) : 0) +#define cg_str2long(value) (value ? atol(value) : 0) +#define cg_strhex2long(value) (value ? strtol(value, NULL, 16) : 0) +#define cg_strhex2ulong(value) (value ? strtoul(value, NULL, 16) : 0) +#define cg_str2float(value) ((float)(value ? atof(value) : 0.0)) +#define cg_str2double(value) (value ? atof(value) : 0.0) + +#if defined(CG_USE_INT64) +#if defined(__USE_ISOC99) || defined(HAVE_LONGLONG) +#define cg_str2longlong(value) (value ? atoll(value) : 0) +#define cg_strhex2longlong(value) (value ? strtoll(value, NULL, 16) : 0) +#define cg_strhex2ulonglong(value) (value ? strtoull(value, NULL, 16) : 0) +#elif (defined(WIN32) || defined(WINCE)) +#define cg_str2longlong(value) (value ? _atoi64(value) : 0) +#endif +#endif + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgString { + char *value; + int memSize; + int valueSize; +} CgString; + +typedef struct _CgStringTokenizer { + char *value; + char *delim; + int delimCnt; + int nextStartPos; + int lastPos; + char *currToken; + char *nextToken; + char repToken; + BOOL hasNextTokens; +} CgStringTokenizer; + +/**************************************** +* Function (StringTokenizer) +****************************************/ + +CgStringTokenizer *cg_string_tokenizer_new(char *str, char *delim); +void cg_string_tokenizer_delete(CgStringTokenizer *strToken); +BOOL cg_string_tokenizer_hasmoretoken(CgStringTokenizer *strToken); +char *cg_string_tokenizer_nexttoken(CgStringTokenizer *strToken); +char *cg_string_tokenizer_nextalltoken(CgStringTokenizer *strToken); + +void cg_string_tokenizer_print(CgStringTokenizer *strToken); + +/**************************************** +* Function (String) +****************************************/ + +CgString *cg_string_new(); +void cg_string_delete(CgString *str); +void cg_string_clear(CgString *str); + +void cg_string_setvalue(CgString *str, char *value); +void cg_string_setintvalue(CgString *str, int value); +void cg_string_setlongvalue(CgString *str, long value); +void cg_string_setfloatvalue(CgString *str, float value); +void cg_string_setdoublevalue(CgString *str, double value); +void cg_string_setnvalue(CgString *str, char *value, int len); +void cg_string_setpointervalue(CgString *str, char *value, int len); + +char *cg_string_getvalue(CgString *str); +#define cg_string_getintvalue(str) cg_str2int(cg_string_getvalue(str)) +#define cg_string_getlongvalue(str) cg_str2long(cg_string_getvalue(str)) +#define cg_string_getfloatvalue(str) cg_str2float(cg_string_getvalue(str)) +#define cg_string_getdoublevalue(str) cg_str2double(cg_string_getvalue(str)) + +int cg_string_length(CgString *str); + +char *cg_string_addvalue(CgString *str, char *value); +char *cg_string_naddvalue(CgString *str, char *value, int valueLen); +char *cg_string_addrepvalue(CgString *str, char *value, int repeatCnt); +char *cg_string_naddrepvalue(CgString *str, char *value, int valueLen, int repeatCnt); + +char *cg_string_replace(CgString *str, char *fromStr[], char *toStr[], int fromStrCnt); + +int cg_string_getmemorysize(CgString *str); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/csubscriber.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/csubscriber.h new file mode 100644 index 0000000..29856d5 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/csubscriber.h @@ -0,0 +1,311 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: csubscriber.h +* +* Revision: +* +* 06/21/05 +* - first revision +* +* 12-Jan-06 Heikki Junnila +* - Added API comments +* 04/05/06 +* - changed timing values to type CgSysTime +* - added cg_upnp_subscriberlist_get(CgUpnpSubscriberList *subscriberList, char *sid) +******************************************************************/ + +#ifndef _CG_UPNP_CSUBSCRIBER_H_ +#define _CG_UPNP_CSUBSCRIBER_H_ + +#include + +#include +#include +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/**************************************** +* Data Type +****************************************/ + +/** + * The device-side structure for an event subscriber + */ +typedef struct _CgUpnpSubscriber { + BOOL headFlag; + struct _CgUpnpSubscriber *prev; + struct _CgUpnpSubscriber *next; + + CgString *sid; + CgString *ifAddr; + CgNetURL *deliveryURL; + + CgSysTime timeout; + long notifyCount; + CgSysTime subscriptionTime; +} CgUpnpSubscriber, CgUpnpSubscriberList; + +/**************************************** +* Function (Subscriber) +****************************************/ + +/** + * Create a new event subscriber + */ +CgUpnpSubscriber *cg_upnp_subscriber_new(); + +/** + * Destroy an event subscriber + * + * @param sub The event subscriber + */ +void cg_upnp_subscriber_delete(CgUpnpSubscriber *sub); + +/** + * Clear the contents of an event subscriber + * + * @todo Lacks implementation (is it necessary?) + * + * @param sub The event subscriber + */ +void cg_upnp_subscriber_clear(CgUpnpSubscriber *sub); + +/** + * Renew a subscription. Essentially sets subscription time (duration) + * to zero and resets notify count (== event key). + * + * @param sub The event subscriber + */ +void cg_upnp_subscriber_renew(CgUpnpSubscriber *sub); + +/** + * Get the next subscriber in a subscriber list. Use as an iterator. + * + * @param sub The current event subscriber + * @return Next subscriber or NULL + */ +#define cg_upnp_subscriber_next(sub) (CgUpnpSubscriber *)cg_list_next((CgList *)sub) + +/** + * Remove the event subscriber from a subscriber list. + * + * @param sub The event subscriber to remove + */ +#define cg_upnp_subscriber_remove(sub) cg_list_remove((CgList *)sub) + +/**************************************************************************** + * sid + ****************************************************************************/ + +/** + * Set the subscriber's SID (Subscription IDentifier) value + * + * @param sub The event subscriber + * @param value The SID value + */ +#define cg_upnp_subscriber_setsid(sub, value) cg_string_setvalue(sub->sid, value) + +/** + * Get the subscriber's SID (Subscription IDentifier) value + * + * @param sub The current event subscriber + * @return Subscriber's SID + */ +#define cg_upnp_subscriber_getsid(sub) cg_string_getvalue(sub->sid) + +/**************************************************************************** + * timeout + ****************************************************************************/ + +/** + * Set the subscription timeout (expiration time) to a certain value. + * + * @param sub The event subscriber + * @param value Timeout + */ +#define cg_upnp_subscriber_settimeout(sub, value) (sub->timeout = value) + +/** + * Get the subscription timeout (expiration time) + * + * @param sub The event subscriber + * @return Timeout + */ +#define cg_upnp_subscriber_gettimeout(sub) (sub->timeout) + +/**************************************************************************** + * subscriptionTime + ****************************************************************************/ + +/** + * Set the subscription time (duration) to a certain value. + * + * @param sub The event subscriber + * @param value Subscription time + */ +#define cg_upnp_subscriber_setsubscriptiontime(sub, value) (sub->subscriptionTime = value) + +/** + * Get the subscription time (duration) + * + * @param sub The event subscriber + * @return Subscription time + */ +#define cg_upnp_subscriber_getsubscriptiontime(sub) (sub->subscriptionTime) + +/**************************************************************************** + * notifycount + ****************************************************************************/ + +/** + * Set the notify count to a certain value. + * + * @param sub The event subscriber + * @param value Notify count + */ +#define cg_upnp_subscriber_setnotifycount(sub, value) (sub->notifyCount = value) + +/** + * Get the notify count + * + * @param sub The event subscriber + * @return Notify count + */ +#define cg_upnp_subscriber_getnotifycount(sub) (sub->notifyCount) + +/** + * Increment the event notify count by one + * + * @param sub The event subscriber + * @return The new notify count + */ +long cg_upnp_subscriber_incrementnotifycount(CgUpnpSubscriber *sub); + +/**************************************************************************** + * Delivery URL + ****************************************************************************/ + +/** + * Set the subscriber's delivery URL + * + * @param sub The event subscriber + * @param value The delivery URL + */ +#define cg_upnp_subscriber_setdeliveryurl(sub, value) cg_net_url_set(sub->deliveryURL, value) + +/** + * Set the subscriber's delivery host + * + * @param sub The event subscriber + */ +#define cg_upnp_subscriber_getdeliveryhost(sub) cg_net_url_gethost(sub->deliveryURL) + +/** + * Set the subscriber's delivery path + * + * @param sub The event subscriber + */ +#define cg_upnp_subscriber_getdeliverypath(sub) cg_net_url_getpath(sub->deliveryURL) + +/** + * Set the subscriber's delivery port + * + * @param sub The event subscriber + */ +#define cg_upnp_subscriber_getdeliveryport(sub) cg_net_url_getport(sub->deliveryURL) + +/** + * Check, whether a subscriber's event subscription has been expired + * + * @param sub The subscriber + * @return TRUE if the subscription has been expired; otherwise FALSE + */ +BOOL cg_upnp_subscriber_isexpired(CgUpnpSubscriber *sub); + +/** + * Post a notification to an event subscriber. This is called in a device. + * + * @param sub The event subscriber + * @param statVar The evented state variable + * @return TRUE if succesful; otherwise FALSE + */ +BOOL cg_upnp_subscriber_notify(CgUpnpSubscriber *sub, CgUpnpStateVariable *statVar); + +/** + * Post a notification to an event subscriber. This is called in a device. + * + * @param sub The event subscriber + * @param service The evented service + * @return TRUE if succesful; otherwise FALSE + */ +BOOL cg_upnp_subscriber_notifyall(CgUpnpSubscriber *sub, void *service); + +/**************************************** +* Function (SubscriberList) +****************************************/ + +/** + * Create a new event subscriber list + */ +CgUpnpSubscriberList *cg_upnp_subscriberlist_new(); + +/** + * Destroy an event subscriber list + * + * @param subscriberlist The list to destroy + */ +void cg_upnp_subscriberlist_delete(CgUpnpSubscriberList *subscriberlist); + +/** + * Clear the contents of a subscriber list + * + * @param subList The subscriber list to clear + */ +#define cg_upnp_subscriberlist_clear(subList) cg_list_clear((CgList *)subList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_subscriber_delete) + +/** + * Get the size (node count) of a subscriber list + * + * @param subList The subscriber list to evaluate + */ +#define cg_upnp_subscriberlist_size(subList) cg_list_size((CgList *)subList) + +/** + * Get the first item in a subscriber list (use as the first step in iteration). + * + * @param subList The subscriber list to evaluate + */ +#define cg_upnp_subscriberlist_gets(subList) (CgUpnpSubscriber *)cg_list_next((CgList *)subList) + +/** + * Add a new event subscriber to a subscriber list + * + * @param subList The subscriber list to add to + * @param sub The subscriber to add + */ +#define cg_upnp_subscriberlist_add(subList, sub) cg_list_add((CgList *)subList, (CgList *)sub) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/csubscription.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/csubscription.h new file mode 100644 index 0000000..7254350 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/csubscription.h @@ -0,0 +1,166 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: csubscription.h +* +* Revision: +* +* 06/20/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CSUBSCRIPTION_H_ +#define _CG_UPNP_CSUBSCRIPTION_H_ + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + + +/**************************************** +* Data Type +****************************************/ + +/** + * Data type for subscription request + */ +typedef CgHttpRequest CgUpnpSubscriptionRequest; + +/**************************************** +* Function (Request) +****************************************/ + +/** + * Create new subscription request + */ +CgUpnpSubscriptionRequest *cg_upnp_event_subscription_request_new(); + +/** + * Delete subscription request + * + * @param subReq subscription request + */ +#define cg_upnp_event_subscription_request_delete(subReq) cg_http_request_delete(subReq) + +/**** NT ****/ + +/** + * Set host header value into underlying HTTP packet + * + * @param subReq Subscription request + * @param ipaddr Host ip address + * @param port Host port + */ +#define cg_upnp_event_subscription_request_sethost(subReq, ipaddr, port) cg_http_request_sethost(subReq, ipaddr, port) + +/** + * Get host header value from subscription request + * + * @param subReq Subscription request + * @param value Not actually used anywhere + * + * \bug Value not needed here! (It is even processed out from to be compiled code) + */ +#define cg_upnp_event_subscription_request_gethost(subReq, value) cg_http_request_gethost(subReq) + +/**** NT ****/ + +/** + * Set NT (Notification type) for subscription request + * + * @param subReq Subscription request + * @param value Notification type + */ +#define cg_upnp_event_subscription_request_setnt(subReq, value) cg_http_request_setheadervalue(subReq, CG_HTTP_NT, value) + +/** + * Get NT from subscription request + * + * @param subReq Subscription request + * @param value Not actually used anywhere + * + * \bug Value not needed here! + */ +#define cg_upnp_event_subscription_request_getnt(subReq, value) cg_http_request_getheadervalue(subReq, CG_HTTP_NT) + +/**** CALLBACK ****/ + +/** + * Set callback URL for eventing + * + * @param subReq Subscription request + * @value value String which defines the callback URL + */ +#define cg_upnp_event_subscription_request_setcallback(subReq, value) cg_http_request_setheadervalue(subReq, CG_HTTP_CALLBACK, value) + +/** + * Get callback url from subscription request + * + * @subReq Subscription request + * @value Not actually used anywhere + * + * \bug Value not needed here! + */ +#define cg_upnp_event_subscription_request_getcallback(subReq, value) cg_http_request_getheadervalue(subReq, CG_HTTP_CALLBACK) + +/**** SID ****/ + +/** + * Set SID (Subscription ID) for subscription request + * + * @param subReq Subscription request + * @param value SID + */ +#define cg_upnp_event_subscription_request_setsid(subReq, value) cg_http_request_setheadervalue(subReq, CG_HTTP_SID, value) + +/** + * Get SID from subscription request object + * + * @param subReq Subscription request + * @param value Not used + * + * \bug Value not needed here! + */ +#define cg_upnp_event_subscription_request_getsid(subReq, value) cg_http_request_getheadervalue(subReq, CG_HTTP_SID) + +/**** Timeout ****/ + +/** + * Set timeout for subscription request + * + * @param subReq Subscription request + * @param timeout Timeout + */ +void cg_upnp_event_subscription_request_settimeout(CgUpnpSubscriptionRequest *subReq, long timeout); + +/** + * Get timeout value from subscription request + * + * @param subReq Subscription request + * + * @return Timeout + */ +long cg_upnp_event_subscription_request_gettimeout(CgUpnpSubscriptionRequest *subReq); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cthread.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cthread.h new file mode 100644 index 0000000..01e917d --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cthread.h @@ -0,0 +1,298 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cthread.h +* +* Revision: +* +* 02/07/05 +* - first revision +* +* 10/31/05 +* - Modified the thread struct to use the cg_list concept +* 02/13/06 Theo Beisch +* - added WINCE support +* 03/20/06 Theo Beisch +* - added thread->deletePending and thread->selfDelete (WINCE only) +* so that a thread can delete its own cg_thread context when truly +* finished (as cg_thread_stop is not reliable under WINCE) +* - added cg_threadlist_remove +* 06/13/07 Fabrice Fontaine Orange +* - Bug correction : Variable used to wait for thread termination by sleeping instead of joining. +* +******************************************************************/ + +#ifndef _CG_UTIL_CTHREAD_H_ +#define _CG_UTIL_CTHREAD_H_ + +#include +#include +#include + +#include +#if defined(WIN32) && !defined(ITRON) +#include +#elif defined(BTRON) +#include +#elif defined(ITRON) +#include +#elif defined(TENGINE) && !defined(PROCESS_BASE) +#include +#elif defined(TENGINE) && defined(PROCESS_BASE) +#include +#else +#include +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** + * Define + ****************************************/ + +#if defined (WINCE) +#define CG_THREAD_SHUTDOWN_ATTEMPTS 10 +#define CG_THREAD_MIN_SLEEP 1000 +/* ADD Fabrice Fontaine Orange 24/04/2007 */ +/* Bug correction : Variable used to wait for thread termination by sleeping */ +/* instead of joining */ +#else +#define CG_THREAD_MIN_SLEEP 1000 +/* ADD END Fabrice Fontaine Orange 24/04/2007 */ +#endif + +/**************************************** + * Data Type + ****************************************/ + +/** + * \brief The generic wrapper struct for CyberLinkC's threads. + * + * This wrapper has been created to enable 100% code + * compatibility between different platforms (Linux, Win32 etc..) + */ +typedef struct _CgThread { + BOOL headFlag; + struct _CgThread *prev; + struct _CgThread *next; + + /** Indicates whether this thread is ready to run */ + BOOL runnableFlag; +#if defined WINCE + /** serves as look ahead to have the thread manage its own delete(thread) on exit */ + BOOL isRunning; + BOOL deletePending; + CgSysTime sleep; +#endif //WINCE + +#if defined DEBUG + char friendlyName[32]; +#endif + +#if defined(WIN32) && !defined(ITRON) + HANDLE hThread; + DWORD threadID; +#elif defined(BTRON) + W taskID; +#elif defined(ITRON) + ER_ID taskID; +#elif defined(TENGINE) && !defined(PROCESS_BASE) + ID taskID; +#elif defined(TENGINE) && defined(PROCESS_BASE) + WERR taskID; +#else + + /** The POSIX thread handle */ + pthread_t pThread; + +#endif + + /** Thread's worker function */ + void (*action)(struct _CgThread *); + + /** Arbitrary data pointer */ + void *userData; +} CgThread, CgThreadList; + +/** + * Prototype for the threads' worker functions + */ +typedef void (*CG_THREAD_FUNC)(CgThread *); + +/**************************************** +* Function +****************************************/ + +/** + * Create a new thread + */ +CgThread *cg_thread_new(); + +/** + * Get a self reference to thread. + */ + +CgThread *cg_thread_self(); + +/** + * Stop and destroy a thread. + * + * \param thread Thread to destroy + */ +BOOL cg_thread_delete(CgThread *thread); + +/** + * Start a thread (must be created first with ch_thread_new()) + * + * \param thread Thread to start + */ +BOOL cg_thread_start(CgThread *thread); + +/** + * Stop a running thread. + * + * \param thread Thread to stop + */ +BOOL cg_thread_stop(CgThread *thread); + +/** + * Stop the running thread and signal the given CGCond. + */ +BOOL cg_thread_stop_with_cond(CgThread *thread, CgCond *cond); + +/** + * Restart a thread. Essentially calls cg_thread_stop() and cg_thread_start() + * + * \param thread Thread to restart + */ +BOOL cg_thread_restart(CgThread *thread); + +/** + * Check if a thread has been started + * + * \param thread Thread to check + */ +BOOL cg_thread_isrunnable(CgThread *thread); + +/** + * Set the thread's worker function. + * + * \param thread Thread struct + * \param actionFunc Function pointer to set as the worker function + */ +void cg_thread_setaction(CgThread *thread, CG_THREAD_FUNC actionFunc); + +/** + * Set the user data pointer + * + * \param thread Thread struct + * \param data Pointer to user data + */ +void cg_thread_setuserdata(CgThread *thread, void *data); + +/** + * Get the user data pointer + * + * \param thread Thread from which to get the pointer + */ +void *cg_thread_getuserdata(CgThread *thread); + +#if defined (WINCE) +void cg_thread_sleep(CgThread *thread); +void cg_thread_exit(DWORD exitCode); +#if defined DEBUG_MEM +void cg_thread_monitor(CgThread *thread); +#endif //DEBUG_MEM +#endif //WIN32_WCE + +#define cg_thread_next(thread) (CgThread *)cg_list_next((CgList *)thread) +#define cg_thread_remove(thread) cg_list_remove((CgList *)thread) + +/**************************************** +* Function (Thread List) +****************************************/ + +/** + * Create a new thread list + * + * \return Thread list + */ +CgThreadList *cg_threadlist_new(); + +/** + * Destroy a thread list + * + * \param threadList The thread list in question + */ +void cg_threadlist_delete(CgThreadList *threadList); + +/** + * Clear the contents of a thread list + * + * \param threadList Thread list in question + */ +#define cg_threadlist_clear(threadList) cg_list_clear((CgList *)threadList, (CG_LIST_DESTRUCTORFUNC)cg_thread_delete) + +/** + * Get the size of a thread list + * + * \param threadList The thread list in question + */ +#define cg_threadlist_size(threadList) cg_list_size((CgList *)threadList) + +/** + * Get the first actual item from a thread list to use as an iterator + * + * \param threadList The thread list in question + */ +#define cg_threadlist_gets(threadList) (CgThread *)cg_list_next((CgList *)threadList) + +/** + * Add a thread into a thread list + * + * \param threadList The thread list in question + * \param thread The thread to add to the list + */ +#define cg_threadlist_add(threadList, thread) cg_list_add((CgList *)threadList, (CgList *)thread) + +/** + * Remove a thread from thread list + * + * \param threadList The thread list in question + * \param thread The thread to be removed + */ +#define cg_threadlist_remove(thread) cg_list_remove((CgList *)thread) + +/** + + * Start all threads in the thread list + * + * \param threadList The thread list in question + */ +BOOL cg_threadlist_start(CgThreadList *threadList); + +/** + * Stop all threads in the thread list + * + * \param threadList The thread list in question + */ +BOOL cg_threadlist_stop(CgThreadList *threadList); + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/ctime.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/ctime.h new file mode 100644 index 0000000..83b928f --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/ctime.h @@ -0,0 +1,62 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* File: ctime.h +* +* Revision: +* +* 02/07/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UTIL_CTIME_H_ +#define _CG_UTIL_CTIME_H_ + +#include + +#if defined(BTRON) +#include +#include +#elif defined(ITRON) +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#if defined(BTRON) || defined(ITRON) +typedef long CgSysTime; +#else +typedef time_t CgSysTime; +#endif + +/**************************************** +* Function +****************************************/ + +float cg_random(); + +void cg_wait(CgSysTime mtime); +void cg_waitrandom(CgSysTime mtime); + +#define cg_sleep(val) cg_wait(val) +#define cg_sleeprandom(val) cg_waitrandom(val) + +CgSysTime cg_getcurrentsystemtime(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cupnp.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cupnp.h new file mode 100644 index 0000000..4c2b823 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cupnp.h @@ -0,0 +1,47 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cupnp.h +* +* Revision: +* +* 02/14/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CUPNP_H_ +#define _CG_UPNP_CUPNP_H_ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +/**************************************** +* Define +****************************************/ + +#define CG_CLINK_NAME "CyberLinkC" +#define CG_CLINK_VER "2.4" + +#define CG_UPNP_VER "1.0" +#define CG_DLNA_VER "1.50" + +#define CG_UPNP_XML_DECLARATION "" + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cupnp_function.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cupnp_function.h new file mode 100644 index 0000000..23afacc --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cupnp_function.h @@ -0,0 +1,84 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cupnp_function.h +* +* Revision: +* +* 02/21/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_FUNCTION_H_ +#define _CG_UPNP_FUNCTION_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_UPNP_UUID_NAME "uuid" +#define CG_UPNP_UUID_MAX_LEN 128 /*(5 + ((4+1)*4) + 1)*/ +#define CG_UPNP_SEVERNAME_MAXLEN 64 + +/**************************************** +* Data Type +****************************************/ + +/**************************************** +* Function +****************************************/ + +/** + * Create a UUID (Universally Unique IDentifier) based on a semi-random value using current time. + * + * \param uuidBuf The UUID created by this function (must not be NULL) + * \return The UUID created by this function (== \e uuidBuf) + */ +char *cg_upnp_createuuid(char *uuidBuf, int uuidBufSize); + +/** + * Get the server name ("OSname/OSversion/UPnP/ CyberLinkC/") + * + * \param buf Buffer to store the server name + * \param bufSize Buffer length + * \param The server name buffer (== \e buf) + */ +char *cg_upnp_getservername(char *buf, int bufSize); + +/** + * Enable/disable NMPR (Intel Networked Media Product Requirements) mode. + * + * \param onFlag TRUE: enable; FALSE: disable + */ +void cg_upnp_setnmprmode(BOOL onFlag); + +/** + * Check whether NMPR (Intel Networked Media Product Requirements) mode is on. + * + * + * \return TRUE if on; otherwise FALSE + */ +BOOL cg_upnp_isnmprmode(); + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cupnp_limit.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cupnp_limit.h new file mode 100644 index 0000000..78da376 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cupnp_limit.h @@ -0,0 +1,50 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cupnp_limit.h +* +* Revision: +* +* 05/17/05 +* - first revision +* 04/04/06 Theo Beisch +* - changed max notifycount to 32bit (per UPnP spec) +* +******************************************************************/ + +#ifndef _CG_UPNP_CUPNPLIMIT_H_ +#define _CG_UPNP_CUPNPLIMIT_H_ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#if defined(HAVE_STDINT_H) +#include +#else +#include +#endif + +#define CG_UPNP_ACTOINNAME_LEN_MAX 128 + +/* DLNA specifies (7.2.26.6) max UDN length to 68 bytes, + * we just play safe here and use 128 byte buffer. */ +#define CG_UPNP_UDN_LEN_MAX 128 +#define CG_UPNP_LOCATION_URL_MAX 512 +#define CG_UPNP_CONTROLPOINT_EVENTSUBURL_MAX 512 + +#if defined(HAVE_STDINT_H) +#define CG_UPNP_NOTIFY_COUNT_MAX UINT32_MAX +#else +#define CG_UPNP_NOTIFY_COUNT_MAX UINT_MAX +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cupnp_status.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cupnp_status.h new file mode 100644 index 0000000..73178cd --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cupnp_status.h @@ -0,0 +1,120 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: upnp_status.h +* +* Revision: +* +* 02/13/05 +* - first revision +* +* 10/31/05 +* - Added comments to all functions and structs +* +******************************************************************/ + +#ifndef _CG_UPNP_CUPNPSTATUS_H_ +#define _CG_UPNP_CUPNPSTATUS_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/******************************************************************************** + * Defines + ********************************************************************************/ + +#define CG_UPNP_STATUS_INVALID_ACTION 401 +#define CG_UPNP_STATUS_INVALID_ARGS 402 +#define CG_UPNP_STATUS_OUT_OF_SYNC 403 +#define CG_UPNP_STATUS_INVALID_VAR 404 +#define CG_UPNP_STATUS_ACTION_FAILED 501 + +/**************************************** + * Data Type + ****************************************/ + +/** + * UPnP status struct used in action and state operations + */ +typedef struct _CgUpnpStatus { + /** Status code */ + int code; + + /** Status description */ + CgString *description; +} CgUpnpStatus; + +/****************************************************************************** + * Function + ******************************************************************************/ + +/** + * Create a new status struct + * + */ +CgUpnpStatus *cg_upnp_status_new(); + +/** + * Delete a status struct + * + * \param upnpStat Status struct to delete + */ +void cg_upnp_status_delete(CgUpnpStatus *upnpStat); + +/** + * Set status code for status struct + * + * \param upnpStat Status struct + * \param value Status code + */ +#define cg_upnp_status_setcode(upnpStat, value) (upnpStat->code = value) + +/** + * Get Status code from a status struct + * + * \param upnpStat Status structure + */ +#define cg_upnp_status_getcode(upnpStat) (upnpStat->code) + +/** + * Set status description for a status struct + * + * \param upnpStat Status struct + * \param value Status description + */ +#define cg_upnp_status_setdescription(upnpStat, value) cg_string_setvalue(upnpStat->description, value) + +/** + * Get status description from a status struct + * + * \param upnpStat Status struct + */ +#define cg_upnp_status_getdescription(upnpStat) cg_string_getvalue(upnpStat->description) + +/** + * Helper function that converts a status code into a status description + * + * \param code Code to convert into a description + * \return Status description + */ +char *cg_upnp_status_code2string(int code); + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/curi.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/curi.h new file mode 100644 index 0000000..b4b9484 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/curi.h @@ -0,0 +1,146 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: curl.h +* +* Revision: +* +* 03/09/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_NET_CURI_H_ +#define _CG_NET_CURI_H_ + +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_NET_URI_KNKOWN_PORT (-1) +#define CG_NET_URI_DEFAULT_HTTP_PORT 80 +#define CG_NET_URI_DEFAULT_FTP_PORT 21 +#define CG_NET_URI_DEFAULT_PATH "/" +#define CG_NET_URI_MAXLEN 256 + +#define CG_NET_URI_PROTOCOL_DELIM "://" +#define CG_NET_URI_USER_DELIM "@" +#define CG_NET_URI_COLON_DELIM ":" +#define CG_NET_URI_SLASH_DELIM "/" +#define CG_NET_URI_SBLACET_DELIM "[" +#define CG_NET_URI_EBLACET_DELIM "]" +#define CG_NET_URI_SHARP_DELIM "#" +#define CG_NET_URI_QUESTION_DELIM "?" +#define CG_NET_URI_ESCAPING_CHAR "%" +#define CG_NET_URI_AMP_DELIM "&" +#define CG_NET_URI_EQ_DELIM "=" + +#define CG_NET_URI_PROTOCOL_HTTP "http" +#define CG_NET_URI_PROTOCOL_FTP "ftp" + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgNetURI { + CgString *uri; + CgString *protocol; + CgString *user; + CgString *password; + CgString *host; + int port; + CgString *path; + CgString *query; + CgString *fragment; + CgString *request; + CgDictionary *queryDictionary; +} CgNetURI; + +/**************************************** +* Function +****************************************/ + +CgNetURI *cg_net_uri_new(); +void cg_net_uri_delete(CgNetURI *uri); +void cg_net_uri_clear(CgNetURI *uri); +void cg_net_uri_setvalue(CgNetURI *uri, char *value); +void cg_net_uri_rebuild(CgNetURI *uri); +char *cg_net_uri_getvalue(CgNetURI *uri); + +#define cg_net_uri_set(urip, value) cg_net_uri_setvalue(urip, value) + +#define cg_net_uri_seturi(urip, value) cg_string_setvalue(urip->uri, value) +#define cg_net_uri_setprotocol(urip, value) cg_string_setvalue(urip->protocol, value) +#define cg_net_uri_setuser(urip, value) cg_string_setvalue(urip->user, value) +#define cg_net_uri_setpassword(urip, value) cg_string_setvalue(urip->password, value) +#define cg_net_uri_sethost(urip, value) cg_string_setvalue(urip->host, value) +#define cg_net_uri_setport(urip, value) (urip->port = value) +#define cg_net_uri_setpath(urip, value) cg_string_setvalue(urip->path, value) +#define cg_net_uri_addpath(urip, value) cg_string_addvalue(urip->path, value) +#define cg_net_uri_setquery(urip, value) cg_string_setvalue(urip->query, value) +#define cg_net_uri_setfragment(urip, value) cg_string_setvalue(urip->fragment, value) + +#define cg_net_uri_geturi(urip) cg_string_getvalue(urip->uri) +#define cg_net_uri_getprotocol(urip) cg_string_getvalue(urip->protocol) +#define cg_net_uri_getuser(urip) cg_string_getvalue(urip->user) +#define cg_net_uri_getpassword(urip) cg_string_getvalue(urip->password) +#define cg_net_uri_gethost(urip) cg_string_getvalue(urip->host) +#define cg_net_uri_getport(urip) (urip->port) +#define cg_net_uri_getpath(urip) cg_string_getvalue(urip->path) +#define cg_net_uri_getquery(urip) cg_string_getvalue(urip->query) +#define cg_net_uri_getfragment(urip) cg_string_getvalue(urip->fragment) + +char *cg_net_uri_getrequest(CgNetURI *uri); +char *cg_net_uri_getupnpbasepath(CgNetURI *locationURL); + +#define cg_net_uri_hasuri(urip) ((0 < cg_string_length(urip->uri)) ? TRUE : FALSE) +#define cg_net_uri_hasprotocol(urip) ((0 < cg_string_length(urip->protocol)) ? TRUE : FALSE) +#define cg_net_uri_hasuser(urip) ((0 < cg_string_length(urip->user)) ? TRUE : FALSE) +#define cg_net_uri_haspassword(urip) ((0 < cg_string_length(urip->password)) ? TRUE : FALSE) +#define cg_net_uri_hashost(urip) ((0 < cg_string_length(urip->host)) ? TRUE : FALSE) +#define cg_net_uri_hasport(urip) ((0 < urip->port) ? TRUE : FALSE) +#define cg_net_uri_haspath(urip) ((0 < cg_string_length(urip->path)) ? TRUE : FALSE) +#define cg_net_uri_hasquery(urip) ((0 < cg_string_length(urip->query)) ? TRUE : FALSE) +#define cg_net_uri_hasfragment(urip) ((0 < cg_string_length(urip->fragment)) ? TRUE : FALSE) +#define cg_net_uri_hasrequest(urip) cg_net_uri_haspath(urip) + +#define cg_net_uri_ishttpprotocol(urip) cg_streq(cg_string_getvalue(urip->protocol), CG_NET_URI_PROTOCOL_HTTP) + +#define cg_net_uri_isabsolute(urip) cg_net_uri_hasprotocol(urip) +#define cg_net_uri_isabsolutepath(uripath) (( *uripath == '/' ) ? TRUE : FALSE ) +#define cg_net_uri_isrelative(urip) ((cg_net_uri_hasprotocol(urip) == TRUE) ? FALSE : TRUE) + +BOOL cg_net_uri_isreservedchar(char c); +BOOL cg_net_uri_isunreservedchar(char c); +BOOL cg_net_uri_isescapechar(char c); +BOOL cg_net_uri_isalphanumchar(char c); + +BOOL cg_net_uri_isescapedstring(char *buf, int bufSize); +char *cg_net_uri_escapestring(char *buf, int bufSize, CgString *retBuf); +char *cg_net_uri_unescapestring(char *buf, int bufSize, CgString *retBuf); +BOOL cg_net_uri_isequivalent(char *url, char *relative_url); + +CgDictionary *cg_net_uri_getquerydictionary(CgNetURI *uri); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/curl.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/curl.h new file mode 100644 index 0000000..2da3f37 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/curl.h @@ -0,0 +1,106 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: curl.h +* +* Revision: +* +* 03/09/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_NET_CURL_H_ +#define _CG_NET_CURL_H_ + +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgNetURI CgNetURL; + +/**************************************** +* Function +****************************************/ + +#define cg_net_url_new() cg_net_uri_new() +#define cg_net_url_delete(urip) cg_net_uri_delete(urip); +#define cg_net_url_clear(urip) cg_net_uri_clear(urip); + +#define cg_net_url_set(urip, value) cg_net_uri_set(urip, value) +#define cg_net_url_setvalue(urip, value) cg_net_uri_setvalue(urip, value) +#define cg_net_url_rebuild(urip) cg_net_uri_rebuild(urip) +#define cg_net_url_getvalue(urip) cg_net_uri_getvalue(urip) + +#define cg_net_url_seturi(urip, value) cg_string_setvalue(urip->uri, value) +#define cg_net_url_setprotocol(urip, value) cg_string_setvalue(urip->protocol, value) +#define cg_net_url_setuser(urip, value) cg_string_setvalue(urip->user, value) +#define cg_net_url_setpassword(urip, value) cg_string_setvalue(urip->password, value) +#define cg_net_url_sethost(urip, value) cg_string_setvalue(urip->host, value) +#define cg_net_url_setport(urip, value) (urip->port = value) +#define cg_net_url_setpath(urip, value) cg_string_setvalue(urip->path, value) +#define cg_net_url_addpath(urip, value) cg_net_uri_addpath(urip, value) +#define cg_net_url_setquery(urip, value) cg_string_setvalue(urip->query, value) +#define cg_net_url_setfragment(urip, value) cg_string_setvalue(urip->fragment, value) + +#define cg_net_url_geturi(urip) cg_string_getvalue(urip->uri) +#define cg_net_url_getprotocol(urip) cg_string_getvalue(urip->protocol) +#define cg_net_url_getuser(urip) cg_string_getvalue(urip->user) +#define cg_net_url_getpassword(urip) cg_string_getvalue(urip->password) +#define cg_net_url_gethost(urip) cg_string_getvalue(urip->host) +#define cg_net_url_getport(urip) (urip->port) +#define cg_net_url_getpath(urip) cg_string_getvalue(urip->path) +#define cg_net_url_getquery(urip) cg_string_getvalue(urip->query) +#define cg_net_url_getfragment(urip) cg_string_getvalue(urip->fragment) +#define cg_net_url_getrequest(urip) cg_net_uri_getrequest(urip) + +#define cg_net_url_hasuri(urip) ((0 < cg_string_length(urip->uri)) ? TRUE : FALSE) +#define cg_net_url_hasprotocol(urip) ((0 < cg_string_length(urip->protocol)) ? TRUE : FALSE) +#define cg_net_url_hasuser(urip) ((0 < cg_string_length(urip->user)) ? TRUE : FALSE) +#define cg_net_url_haspassword(urip) ((0 < cg_string_length(urip->password)) ? TRUE : FALSE) +#define cg_net_url_hashost(urip) ((0 < cg_string_length(urip->host)) ? TRUE : FALSE) +#define cg_net_url_hasport(urip) ((0 < urip->port) ? TRUE : FALSE) +#define cg_net_url_haspath(urip) ((0 < cg_string_length(urip->path)) ? TRUE : FALSE) +#define cg_net_url_hasquery(urip) ((0 < cg_string_length(urip->query)) ? TRUE : FALSE) +#define cg_net_url_hasfragment(urip) ((0 < cg_string_length(urip->fragment)) ? TRUE : FALSE) +#define cg_net_url_hasrequest(urip) cg_net_uri_hasrequest(urip) + +#define cg_net_url_ishttpprotocol(urip) cg_streq(cg_string_getvalue(urip->protocol), CG_NET_URI_PROTOCOL_HTTP) + +#define cg_net_url_isabsolute(uripath) cg_net_uri_hasprotocol(uripath) +#define cg_net_url_isrelative(urip) ((cg_net_uri_hasprotocol(urip) == TRUE) ? FALSE : TRUE) +#define cg_net_url_isabsolutepath(uripath) cg_net_uri_isabsolutepath(uripath) + +#define cg_net_url_getupnpbasepath(urip) cg_net_uri_getupnpbasepath(urip); + +char *cg_net_gethosturl(char *host, int port, char *uri, char *buf, int bufSize); +char *cg_net_getmodifierhosturl(char *host, int port, char *uri, char *buf, int bufSize, char *begin, char *end); + +#define cg_net_url_getquerydictionary(urip) cg_net_uri_getquerydictionary(urip); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cxml.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cxml.h new file mode 100644 index 0000000..02eb2ef --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/cxml.h @@ -0,0 +1,208 @@ +/****************************************************************** +* +* CyberNet for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006-2007 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cxml.h +* +* Revision: +* +* 02/07/05 +* - first revision +* 10/22/07 Aapo Makela +* - Added NULL check to cg_xml_node_getchildnode() macro +* +******************************************************************/ + +#ifndef _CG_XML_CXML_H_ +#define _CG_XML_CXML_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_XML_INDENT_STRING " " +#define CG_XML_VERSION_HEADER "" +#define CG_XML_CONTENT_TYPE "text/xml; charset=\"utf-8\"" +#define CG_XML_CONTENT_LF "\n" + +typedef void (*CG_XML_NODE_USERDATA_DESTRUCTORFUNC)(void *); + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgXmlAttribute { + BOOL headFlag; + struct _CgXmlAttribute *prev; + struct _CgXmlAttribute *next; + CgString *name; + CgString *value; +} CgXmlAttribute, CgXmlAttributeList; + +typedef struct _CgXmlNode { + BOOL headFlag; + struct _CgXmlNode *prev; + struct _CgXmlNode *next; + CgString *name; + CgString *value; + struct _CgXmlAttribute *attrList; + struct _CgXmlNode *nodeList; + struct _CgXmlNode *parentNode; + void *userData; + CG_XML_NODE_USERDATA_DESTRUCTORFUNC userDataDestructorFunc; +} CgXmlNode, CgXmlNodeList; + +typedef struct _CgXmlParser { + BOOL parseResult; +} CgXmlParser; + +/**************************************** +* Function (AttribureList) +****************************************/ + +CgXmlAttributeList *cg_xml_attributelist_new(); +void cg_xml_attributelist_delete(CgXmlAttributeList *attrList); + +#define cg_xml_attributelist_clear(attrList) cg_list_clear((CgList *)attrList, (CG_LIST_DESTRUCTORFUNC)cg_xml_attribute_delete) +#define cg_xml_attributelist_size(attrList) cg_list_size((CgList *)attrList) +#define cg_xml_attributelist_gets(attrList) (CgXmlAttribute *)cg_list_next((CgList *)attrList) +#define cg_xml_attributelist_add(attrList, attr) cg_list_add((CgList *)attrList, (CgList *)attr) + +void cg_xml_attributelist_set(CgXmlAttributeList *attrList, char *name, char *value); +CgXmlAttribute *cg_xml_attributelist_get(CgXmlAttributeList *attrList, char *name); +char *cg_xml_attributelist_getvalue(CgXmlAttributeList *attrList, char *name); + +/**************************************** +* Function (Attributes) +****************************************/ + +CgXmlAttribute *cg_xml_attribute_new(); +void cg_xml_attribute_delete(CgXmlAttribute *attr); + +#define cg_xml_attribute_next(attr) (CgXmlAttribute *)cg_list_next((CgList *)attr) +#define cg_xml_attribute_remove(attr) cg_list_remove((CgList *)attr) + +void cg_xml_attribute_setname(CgXmlAttribute *attr, char *name); +char *cg_xml_attribute_getname(CgXmlAttribute *attr); +BOOL cg_xml_attribute_isname(CgXmlAttribute *attr, char *name); + +void cg_xml_attribute_setvalue(CgXmlAttribute *attr, char *value); +char *cg_xml_attribute_getvalue(CgXmlAttribute *attr); + +/**************************************** +* Function (NodeList) +****************************************/ + +CgXmlNodeList *cg_xml_nodelist_new(); +void cg_xml_nodelist_delete(CgXmlNodeList *nodeList); + +#define cg_xml_nodelist_clear(nodeList) cg_list_clear((CgList *)(nodeList), (CG_LIST_DESTRUCTORFUNC)cg_xml_node_delete) +#define cg_xml_nodelist_size(nodeList) cg_list_size((CgList *)(nodeList)) +#define cg_xml_nodelist_gets(nodeList) (CgXmlNode *)cg_list_next((CgList *)(nodeList)) +#define cg_xml_nodelist_add(nodeList, node) cg_list_add((CgList *)(nodeList), (CgList *)(node)) + +/* Deprecated : Use cg_xml_nodelist_getbyname */ +#define cg_xml_nodelist_get(nodeList, name) cg_xml_nodelist_getbyname(nodeList, name) +CgXmlNode *cg_xml_nodelist_getbyname(CgXmlNodeList *nodeList, char *name); +CgXmlNode *cg_xml_nodelist_getbyxpath(CgXmlNodeList *nodeList, char *xpath); + +/**************************************** +* Function (Node) +****************************************/ + +CgXmlNode *cg_xml_node_new(); +void cg_xml_node_delete(CgXmlNode *node); + +#define cg_xml_node_next(node) (CgXmlNode *)cg_list_next((CgList *)node) +#define cg_xml_node_remove(node) cg_list_remove((CgList *)node) + +#define cg_xml_node_setname(node, nodename) cg_string_setvalue(node->name, nodename) +#define cg_xml_node_getname(node) cg_string_getvalue(node->name) +#define cg_xml_node_isname(node, nodename) (cg_strcmp(cg_xml_node_getname(node), nodename) == 0 ? TRUE : FALSE) + +#define cg_xml_node_setvalue(node, nodevalue) cg_string_setvalue(node->value, nodevalue) +#define cg_xml_node_setintvalue(node, nodevalue) cg_string_setintvalue(node->value, nodevalue) +#define cg_xml_node_setlongvalue(node, nodevalue) cg_string_setlongvalue(node->value, nodevalue) +#define cg_xml_node_setnvalue(node, nodevalue, nodevaluelen) cg_string_setnvalue(node->value, nodevalue, nodevaluelen) +#define cg_xml_node_addvalue(node, nodevalue) cg_string_addvalue(node->value, nodevalue) +#define cg_xml_node_naddvalue(node, nodevalue, len) cg_string_naddvalue(node->value, nodevalue, len) +#define cg_xml_node_getvalue(node) cg_string_getvalue(node->value) +#define cg_xml_node_getintvalue(node) cg_string_getintvalue(node->value) +#define cg_xml_node_getlongvalue(node) cg_string_getlongvalue(node->value) + +#define cg_xml_node_setparentnode(node, pnode) (node->parentNode = pnode) +#define cg_xml_node_getparentnode(node) (node->parentNode) +CgXmlNode *cg_xml_node_getrootnode(CgXmlNode *node); + +#define cg_xml_node_getchildnodelist(node) (node->nodeList) +void cg_xml_node_addchildnode(CgXmlNode *node, CgXmlNode *cnode); +void cg_xml_node_setchildnode(CgXmlNode *node, char *name, char *value); +char *cg_xml_node_getchildnodevalue(CgXmlNode *node, char *name); +#define cg_xml_node_getchildnodeintvalue(node, name) cg_str2int(cg_xml_node_getchildnodevalue(node, name)) +#define cg_xml_node_getchildnodelongvalue(node, name) cg_str2long(cg_xml_node_getchildnodevalue(node, name)) + +#define cg_xml_node_setuserdata(node, data) (node->userData = data) +#define cg_xml_node_getuserdata(node) (node->userData) +#define cg_xml_node_setuserdatadestructor(node, func) (node->userDataDestructorFunc = func) + +#define cg_xml_node_getchildnodes(node) cg_xml_nodelist_gets(node->nodeList) +#define cg_xml_node_haschildnodes(node) ((cg_xml_node_getchildnodes(node) != NULL) ? TRUE : FALSE) +/* Deprecated : Use cg_xml_node_getchildnodebyname */ +#define cg_xml_node_getchildnode(node,name) ((node != NULL) ? cg_xml_nodelist_getbyname(node->nodeList,name) : NULL) +#define cg_xml_node_getchildnodebyname(node,name) ((node != NULL) ? cg_xml_nodelist_getbyname(node->nodeList,name) : NULL) +#define cg_xml_node_getchildnodebyxpath(node,xpath) ((node != NULL) ? cg_xml_nodelist_getbyxpath(node->nodeList,xpath) : NULL) + +/* Get childnode with some specific namespace prefix, or ignore namespace prefix. + If ns is NULL, name string must match completely */ +CgXmlNode *cg_xml_node_getchildnodewithnamespace(CgXmlNode *node, char *name, char *ns, BOOL ignoreNs); + +#define cg_xml_node_getattributes(node) cg_xml_attributelist_gets(node->attrList) +#define cg_xml_node_getattribute(node, name) cg_xml_attributelist_get(node->attrList,name) +#define cg_xml_node_addattribute(node, attr) cg_xml_attributelist_add(node->attrList,attr) +#define cg_xml_node_setattribute(node, name, value) cg_xml_attributelist_set(node->attrList,name,value) +#define cg_xml_node_getattributevalue(node, name) cg_xml_attributelist_getvalue(node->attrList, name) +void cg_xml_node_removeattribute(CgXmlNode *node, char *name); + +#define cg_xml_node_setnamespace(node, ns, value) cg_xml_node_setattribute(node, "xmlns:" ns , value) + +char *cg_xml_node_tostring(CgXmlNode *node, BOOL withChildNode, CgString *str); +void cg_xml_node_print(CgXmlNode *node); + +void cg_xml_node_copy(CgXmlNode *dstNode, CgXmlNode *srcNode); + +/**************************************** +* Function (Parser) +****************************************/ + +CgXmlParser *cg_xml_parser_new(); +void cg_xml_parser_delete(CgXmlParser *parser); +BOOL cg_xml_parse(CgXmlParser *parser, CgXmlNodeList *nodeList, char *data, int len); + +/**************************************** +* Function (Other) +****************************************/ + +char *cg_xml_escapechars(CgString *str); +char *cg_xml_unescapechars(CgString *str); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/typedef.h b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/typedef.h new file mode 100644 index 0000000..2f28713 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Headers/typedef.h @@ -0,0 +1,102 @@ +/****************************************************************** +* +* CyberGarage for C +* +* Copyright (C) Satoshi Konno 2005 +* +* File: typedef.h +* +* Revision: +* +* 01/17/05 +* - first revision +* 08/16/05 +* - Thanks for Theo Beisch +* - Added support for WindowsCE platform. +* 03/18/07 +* - Added CgInt64 to +* 06/24/07 +* - Added CgByte to +* 03/18/08 +* - Changed not to define BOOL type using XCode. +* 09/03/08 +* - Changed to include in on XCode as default. +* +******************************************************************/ + +#ifndef _CG_TYPEDEF_H_ +#define _CG_TYPEDEF_H_ + +#include +#include + +#if defined(WINCE) && !defined(WIN32) +#define WIN32 1 +#endif + +#if (defined(WIN32) || defined(__CYGWIN__)) && !defined (ITRON) +#include +#include +#elif defined(BTRON) || defined(TENGINE) +#include +#elif defined(ITRON) +#include +#endif + +#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) ) +#include +#endif + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Data Type +****************************************/ + +#if !defined(BOOL) && !defined(BTRON) && !defined(TENGINE) && !defined(__OBJC__) +typedef int BOOL; +#endif + +#if !defined(TRUE) +#if defined(__OBJC__) +#define TRUE YES +#else +#define TRUE (1) +#endif +#endif + +#if !defined(FALSE) +#if defined(__OBJC__) +#define FALSE NO +#else +#define FALSE (0) +#endif +#endif + +typedef unsigned char CgByte; + +#if defined(__USE_ISOC99) || defined(__GCC__) +typedef long long int CgInt64; +#define CG_USE_INT64 1 +#elif defined(HAVE_LONGLONG) +typedef long long CgInt64; +#define CG_USE_INT64 1 +#elif (defined(WIN32) || defined(WINCE)) +typedef __int64 CgInt64; +#define CG_USE_INT64 1 +#else +typedef long CgInt64; +#undef CG_USE_INT64 +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Resources/Info.plist b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..6f14b67 Binary files /dev/null and b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Resources/Info.plist differ diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Resources/cupnp.h.in b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Resources/cupnp.h.in new file mode 100644 index 0000000..8eabab0 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/A/Resources/cupnp.h.in @@ -0,0 +1,47 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cupnp.h +* +* Revision: +* +* 02/14/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CUPNP_H_ +#define _CG_UPNP_CUPNP_H_ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +/**************************************** +* Define +****************************************/ + +#define CG_CLINK_NAME "CyberLinkC" +#define CG_CLINK_VER + +#define CG_UPNP_VER "1.0" +#define CG_DLNA_VER "1.50" + +#define CG_UPNP_XML_DECLARATION "" + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/Current b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/CyberLink.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/http/chttp.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/http/chttp.h new file mode 100644 index 0000000..52f023a --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/http/chttp.h @@ -0,0 +1,615 @@ +/****************************************************************** +* +* CyberNet for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: chttp.h +* +* Revision: +* +* 01/25/05 +* - first revision +* +* 10/31/05 +* - Changed CHttpHeader* pointers to CHttpServer* pointers +* in CHttpServer struct. +* +* 16-Jan-06 Aapo Makela +* - Fixed header comparisons to be case-insensitive +* - Fixed iskeepaliveconnection to check "Connection:close" +* - Added M-POST specific stuff +* 04/03/06 Theo Beisch +* - added (CgHttpHeaderList*) cast (see below) +* - added LONGLONG macro for platform independence +* - some re-sorting of get/set macros (see below) +******************************************************************/ + +#ifndef _CG_HTTP_CHTTP_H_ +#define _CG_HTTP_CHTTP_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + + +#define CG_HTTP_READLINE_BUFSIZE 512 +#define CG_HTTP_SEVERNAME_MAXLEN 64 +#define CG_HTTP_DATE_MAXLEN 128 + +#define CG_HTTP_REQUESTLINE_DELIM "\r\n " +#define CG_HTTP_STATUSLINE_DELIM "\r\n " +#define CG_HTTP_HEADERLINE_DELIM "\r\n :" + +#define CG_HTTP_CR "\r" +#define CG_HTTP_LF "\n" +#define CG_HTTP_CRLF "\r\n" +#define CG_HTTP_SP " " +#define CG_HTTP_COLON ":" + +#define CG_HTTP_VER10 "HTTP/1.0" +#define CG_HTTP_VER11 "HTTP/1.1" + +#if !defined(CG_HTTP_CURL) +#define CG_HTTP_USERAGENT_DEFAULT "CyberGarage-HTTP/1.0" +#else +#define CG_HTTP_USERAGENT_DEFAULT "libcurl-agent/1.0 (Cyberlink for C)" +#endif + +#define CG_HTTP_DEFAULT_PORT 80 +#define CG_HTTS_DEFAULT_PORT 443 + +#define CG_HTTP_STATUS_CONTINUE 100 +#define CG_HTTP_STATUS_OK 200 +#define CG_HTTP_STATUS_PARTIAL_CONTENT 206 +#define CG_HTTP_STATUS_BAD_REQUEST 400 +#define CG_HTTP_STATUS_NOT_FOUND 404 +#define CG_HTTP_STATUS_METHOD_NOT_ALLOWED 405 +#define CG_HTTP_STATUS_PRECONDITION_FAILED 412 +#define CG_HTTP_STATUS_INVALID_RANGE 416 +#define CG_HTTP_STATUS_INTERNAL_SERVER_ERROR 500 + +#define CG_HTTP_POST "POST" +#define CG_HTTP_GET "GET" +#define CG_HTTP_HEAD "HEAD" + +#define CG_HTTP_HOST "HOST" +#define CG_HTTP_DATE "Date" +#define CG_HTTP_CACHE_CONTROL "Cache-Control" + #define CG_HTTP_NO_CACHE "no-cache" + #define CG_HTTP_MAX_AGE "max-age" +#define CG_HTTP_CONNECTION "Connection" + #define CG_HTTP_CLOSE "close" + #define CG_HTTP_KEEP_ALIVE "Keep-Alive" +#define CG_HTTP_CONTENT_TYPE "Content-Type" +#define CG_HTTP_CONTENT_LENGTH "Content-Length" +#define CG_HTTP_CONTENT_RANGE "Content-Range" + #define CG_HTTP_CONTENT_RANGE_BYTES "bytes" +#define CG_HTTP_LOCATION "Location" +#define CG_HTTP_SERVER "Server" +#define CG_HTTP_RANGE "Range" +#define CG_HTTP_TRANSFER_ENCODING "Transfer-Encoding" + #define CG_HTTP_CHUNKED "Chunked" +#define CG_HTTP_USERAGENT "User-Agent" + +/**** SOAP Extention ****/ +#define CG_HTTP_SOAP_ACTION "SOAPACTION" +#define CG_HTTP_SOAP_ACTION_WITH_NS "01-SOAPACTION" +#define CG_HTTP_SOAP_MAN_VALUE "\"http://schemas.xmlsoap.org/soap/envelope/\"; ns=01" + +/**** UPnP Extention ****/ +#define CG_HTTP_MPOST "M-POST" +#define CG_HTTP_MSEARCH "M-SEARCH" +#define CG_HTTP_NOTIFY "NOTIFY" +#define CG_HTTP_SUBSCRIBE "SUBSCRIBE" +#define CG_HTTP_UNSUBSCRIBE "UNSUBSCRIBE" + +#define CG_HTTP_ST "ST" +#define CG_HTTP_MX "MX" +#define CG_HTTP_MAN "MAN" +#define CG_HTTP_NT "NT" +#define CG_HTTP_NTS "NTS" +#define CG_HTTP_USN "USN" +#define CG_HTTP_EXT "EXT" +#define CG_HTTP_SID "SID" +#define CG_HTTP_SEQ "SEQ" +#define CG_HTTP_CALLBACK "CALLBACK" +#define CG_HTTP_TIMEOUT "TIMEOUT" + +/**** CURL connection timeout: 2 seconds ****/ +#define CG_HTTP_CURL_CONNECTTIMEOUT 2 + +/**** CURL total timeout: 30 seconds (UPnP DA: whole transfer: 30sec ****/ +#define CG_HTTP_CONN_TIMEOUT 30 + +/* HTTP server - client thread blocking timeout */ +#define CG_HTTP_SERVER_READ_TIMEOUT 120 + +/**** HTTP Status code reason phrases ****/ +#define CG_HTTP_REASON_100 "Continue" +#define CG_HTTP_REASON_101 "Switching Protocols" +#define CG_HTTP_REASON_200 "OK" +#define CG_HTTP_REASON_201 "Created" +#define CG_HTTP_REASON_202 "Accepted" +#define CG_HTTP_REASON_203 "Non-Authoritative Information" +#define CG_HTTP_REASON_204 "No Content" +#define CG_HTTP_REASON_205 "Reset Content" +#define CG_HTTP_REASON_206 "Partial Content" +#define CG_HTTP_REASON_300 "Multiple Choices" +#define CG_HTTP_REASON_301 "Moved Permanently" +#define CG_HTTP_REASON_302 "Found" +#define CG_HTTP_REASON_303 "See Other" +#define CG_HTTP_REASON_304 "Not Modified" +#define CG_HTTP_REASON_305 "Use Proxy" +#define CG_HTTP_REASON_307 "Temporary Redirect" +#define CG_HTTP_REASON_400 "Bad Request" +#define CG_HTTP_REASON_401 "Unauthorized" +#define CG_HTTP_REASON_402 "Payment Required" +#define CG_HTTP_REASON_403 "Forbidden" +#define CG_HTTP_REASON_404 "Not Found" +#define CG_HTTP_REASON_405 "Method Not Allowed" +#define CG_HTTP_REASON_406 "Not Acceptable" +#define CG_HTTP_REASON_407 "Proxy Authentication Required" +#define CG_HTTP_REASON_408 "Request Time-out" +#define CG_HTTP_REASON_409 "Conflict" +#define CG_HTTP_REASON_410 "Gone" +#define CG_HTTP_REASON_411 "Length Required" +#define CG_HTTP_REASON_412 "Precondition Failed" +#define CG_HTTP_REASON_413 "Request Entity Too Large" +#define CG_HTTP_REASON_414 "Request-URI Too Large" +#define CG_HTTP_REASON_415 "Unsupported Media Type" +#define CG_HTTP_REASON_416 "Requested range not satisfiable" +#define CG_HTTP_REASON_417 "Expectation Failed" +#define CG_HTTP_REASON_500 "Internal Server Error" +#define CG_HTTP_REASON_501 "Not Implemented" +#define CG_HTTP_REASON_502 "Bad Gateway" +#define CG_HTTP_REASON_503 "Service Unavailable" +#define CG_HTTP_REASON_504 "Gateway Time-out" +#define CG_HTTP_REASON_505 "HTTP Version not supported" + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgHttpHeader { + BOOL headFlag; + struct _CgHttpHeader *prev; + struct _CgHttpHeader *next; + CgString *name; + CgString *value; +} CgHttpHeader, CgHttpHeaderList; + +typedef struct _CgHttpPacket { + CgHttpHeaderList *headerList; + CgString *content; +} CgHttpPacket; + +typedef struct _CgHttpResponse { + CgHttpHeaderList *headerList; + CgString *content; + CgString *version; + int statusCode; + CgString *reasonPhrase; + void *userData; + int timeout; +} CgHttpResponse; + +typedef struct _CgHttpRequest { + CgHttpHeaderList *headerList; + CgString *content; + CgString *method; + CgString *uri; + CgString *version; + CgString *userAgent; + CgHttpResponse *httpRes; + CgSocket *sock; + CgNetURL *postURL; + void *userData; + int timeout; +} CgHttpRequest; + +typedef void (*CG_HTTP_LISTENER)(CgHttpRequest *); + +typedef struct _CgHttpServer { + BOOL headFlag; + struct _CgHttpServer *prev; + struct _CgHttpServer *next; + CgSocket *sock; + CgThread *acceptThread; + CgThreadList *clientThreads; + CG_HTTP_LISTENER listener; + void *userData; + int timeout; + CgMutex *mutex; +} CgHttpServer, CgHttpServerList; + +/**************************************** +* Function +****************************************/ + +/** + * Convert an HTTP status code to a reason phrase (ex. 200 -> "200 OK") + * + * @param code The HTTP status code to convert + * @return The reason phrase (do not modify the pointer's contents) + */ +const char *cg_http_statuscode2reasonphrase(const int code); + +/**************************************** +* Function (Header) +****************************************/ + +CgHttpHeader *cg_http_header_new(); +void cg_http_header_delete(CgHttpHeader *header); + +#define cg_http_header_next(header) (CgHttpHeader *)cg_list_next((CgList *)header) + +void cg_http_header_setname(CgHttpHeader *header, char *name); +char *cg_http_header_getname(CgHttpHeader *header); +void cg_http_header_setvalue(CgHttpHeader *header, char *value); +char *cg_http_header_getvalue(CgHttpHeader *header); + +/**************************************** +* Function (Header List) +****************************************/ + +CgHttpHeaderList *cg_http_headerlist_new(); +void cg_http_headerlist_delete(CgHttpHeaderList *headerList); + +#define cg_http_headerlist_clear(headerList) cg_list_clear((CgList *)headerList, (CG_LIST_DESTRUCTORFUNC)cg_http_header_delete) +#define cg_http_headerlist_size(headerList) cg_list_size((CgList *)headerList) +#define cg_http_headerlist_gets(headerList) (CgHttpHeader *)cg_list_next((CgList *)headerList) +#define cg_http_headerlist_add(headerList, header) cg_list_add((CgList *)headerList, (CgList *)header) + +CgHttpHeader *cg_http_headerlist_get(CgHttpHeaderList *headerList, char *name); +void cg_http_headerlist_set(CgHttpHeaderList *headerList, char *name, char *value); +char *cg_http_headerlist_getvalue(CgHttpHeaderList *headerList, char *name); + +/**************************************** +* Function (Packet) +****************************************/ + +CgHttpPacket *cg_http_packet_new(); +void cg_http_packet_delete(CgHttpPacket *httpPkt); +void cg_http_packet_init(CgHttpPacket *httpPkt); +void cg_http_packet_clean(CgHttpPacket *httpPkt); +void cg_http_packet_clear(CgHttpPacket *httpPkt); + +#define cg_http_packet_deleteallheaders(httpPkt) cg_http_headerlist_gets(httpPkt->headerList) +#define cg_http_packet_getnheaders(httpPkt) cg_http_headerlist_size(httpPkt->headerList) +#define cg_http_packet_getheaders(httpPkt) cg_http_headerlist_gets(httpPkt->headerList) +//Theo Beisch - added (CgHttpHeaderList*) cast - as _get is function call +#define cg_http_packet_getheader(httpPkt, name) cg_http_headerlist_get((CgHttpHeaderList*)httpPkt->headerList, name) +#define cg_http_packet_hasheader(httpPkt, name) ((cg_http_headerlist_get((CgHttpHeaderList*)httpPkt->headerList, name) != NULL) ? TRUE : FALSE) + +#define cg_http_packet_hasheadervalue(httpPkt, header, value) (cg_streq(cg_http_packet_getheadervalue((CgHttpPacket*)httpPkt, header),value)) + +#define cg_http_packet_addheader(httpPkt, header) cg_http_headerlist_add(httpPkt->headerList, header) + +void cg_http_packet_setheadervalue(CgHttpPacket *httpPkt, char* name, char *value); +void cg_http_packet_setheaderinteger(CgHttpPacket *httpPkt, char* name, int value); +void cg_http_packet_setheaderlong(CgHttpPacket *httpPkt, char* name, long value); +char *cg_http_packet_getheadervalue(CgHttpPacket *httpPkt, char* name); +int cg_http_packet_getheaderinteger(CgHttpPacket *httpPkt, char* name); +long cg_http_packet_getheaderlong(CgHttpPacket *httpPkt, char* name); +int cg_http_packet_getheadersize(CgHttpPacket *httpPkt); + +#if defined(CG_USE_INT64) +void cg_http_packet_setheaderlonglong(CgHttpPacket *httpPkt, char* name, CgInt64 value); +CgInt64 cg_http_packet_getheaderlonglong(CgHttpPacket *httpPkt, char* name); +#endif + +#define cg_http_packet_setcontent(httpPkt, value) cg_string_setvalue(httpPkt->content, value) +#define cg_http_packet_setncontent(httpPkt, value, len) cg_string_setnvalue(httpPkt->content, value, len) +#define cg_http_packet_appendncontent(httpPkt, value, len) cg_string_naddvalue(httpPkt->content, value, len) +#define cg_http_packet_setcontentpointer(httpPkt, value, len) cg_string_setpointervalue(httpPkt->content, value, len) +#define cg_http_packet_getcontent(httpPkt) cg_string_getvalue(httpPkt->content) + +void cg_http_packet_post(CgHttpPacket *httpPkt, CgSocket *sock); +void cg_http_packet_read_headers(CgHttpPacket *httpPkt, CgSocket *sock, char *lineBuf, int lineBufSize); +BOOL cg_http_packet_read_body( + CgHttpPacket *httpPkt, CgSocket *sock, char *lineBuf, int lineBufSize); +BOOL cg_http_packet_read(CgHttpPacket *httpPkt, CgSocket *sock, BOOL onlyHeader, char *lineBuf, int lineBufSize); + +/**** Content-Length ****/ +#if defined(CG_USE_INT64) +#define cg_http_packet_setcontentlength(httpPkt,value) cg_http_packet_setheaderlonglong(httpPkt,CG_HTTP_CONTENT_LENGTH,value) +#define cg_http_packet_getcontentlength(httpPkt) cg_http_packet_getheaderlonglong(httpPkt,CG_HTTP_CONTENT_LENGTH) +#else +#define cg_http_packet_setcontentlength(httpPkt,value) cg_http_packet_setheaderlong(httpPkt,CG_HTTP_CONTENT_LENGTH,value) +#define cg_http_packet_getcontentlength(httpPkt) cg_http_packet_getheaderlong(httpPkt,CG_HTTP_CONTENT_LENGTH) +#endif + +/**** Connection ****/ +#define cg_http_packet_setconnection(httpPkt, value) cg_http_packet_setheadervalue(httpPkt,CG_HTTP_CONNECTION, value) +#define cg_http_packet_getconnection(httpPkt) cg_http_packet_getheadervalue(httpPkt,CG_HTTP_CONNECTION) +#define cg_http_packet_iskeepaliveconnection(httpPkt) (cg_strcaseeq(cg_http_packet_getconnection(httpPkt), CG_HTTP_CLOSE) == FALSE) + +/**** Transfer-Encoding ****/ +#define cg_http_packet_settransferencoding(httpPkt, value) cg_http_packet_setheadervalue(httpPkt,CG_HTTP_TRANSFER_ENCODING, value) +#define cg_http_packet_gettransferencoding(httpPkt) cg_http_packet_getheadervalue(httpPkt,CG_HTTP_TRANSFER_ENCODING) +#define cg_http_packet_ischunked(httpPkt) cg_strcaseeq(cg_http_packet_gettransferencoding(httpPkt), CG_HTTP_CHUNKED) + +/**** Host ****/ +void cg_http_packet_sethost(CgHttpPacket *httpPkt, char *addr, int port); +#define cg_http_packet_gethost(httpPkt) cg_http_packet_getheaderlong(httpPkt,CG_HTTP_HOST) + +/**** Copy ****/ +void cg_http_packet_copy(CgHttpPacket *destHttpPkt, CgHttpPacket *srcHttpPkt); + +/**** Print ****/ +void cg_http_packet_print(CgHttpPacket *httpPkt); + +/**************************************** +* Function (Request) +****************************************/ + +CgHttpRequest *cg_http_request_new(); +void cg_http_request_delete(CgHttpRequest *httpReq); +void cg_http_request_clear(CgHttpRequest *httpReq); +void cg_http_request_setmethod(CgHttpRequest *httpReq, char *method); +char *cg_http_request_getmethod(CgHttpRequest *httpReq); +void cg_http_request_setversion(CgHttpRequest *httpReq, char *version); +char *cg_http_request_getversion(CgHttpRequest *httpReqest); +void cg_http_request_setuseragent(CgHttpRequest *httpReq, char *version); +char *cg_http_request_getuseragent(CgHttpRequest *httpReqest); +void cg_http_request_addtouseragent(CgHttpRequest *httpReq, char *value); +void cg_http_request_seturi(CgHttpRequest *httpReq, char *uri); +char *cg_http_request_geturi(CgHttpRequest *httpReq); +void cg_http_request_setsocket(CgHttpRequest *httpReq, CgSocket *sock); +CgSocket *cg_http_request_getsocket(CgHttpRequest *httpReq); +#define cg_http_request_closesocket(httpReq) cg_socket_close(cg_http_request_getsocket(httpReq)) +CgHttpResponse *cg_http_request_post(CgHttpRequest *httpReq, char *ipaddr, int port); +#if defined(CG_USE_OPENSSL) +CgHttpResponse *cg_https_request_post(CgHttpRequest *httpReq, char *ipaddr, int port); +#endif +BOOL cg_http_request_read(CgHttpRequest *httpReq, CgSocket *sock); +BOOL cg_http_request_postresponse(CgHttpRequest *httpReq, CgHttpResponse *httpRes); +BOOL cg_http_request_poststatuscode(CgHttpRequest *httpReq, int httpStatCode); +BOOL cg_http_request_postdata(CgHttpRequest *httpReq, void *data, int dataLen); +BOOL cg_http_request_postchunkedsize(CgHttpRequest *httpReq, int dataLen); +BOOL cg_http_request_postchunkeddata(CgHttpRequest *httpReq, void *data, int dataLen); +BOOL cg_http_request_postlastchunk(CgHttpRequest *httpReq); +#define cg_http_request_poststring(httpReq, data) cg_http_request_postdata(httpReq, data, cg_strlen(data)) +#define cg_http_request_postchunkedstring(httpReq, data) cg_http_request_postchunkeddata(httpReq, data, cg_strlen(data)) + +#define cg_http_request_postokrequest(httpReq) cg_http_request_poststatuscode(httpReq, CG_HTTP_STATUS_OK) +#define cg_http_request_postbadrequest(httpReq) cg_http_request_poststatuscode(httpReq, CG_HTTP_STATUS_BAD_REQUEST) + +#define cg_http_request_ismethod(httpReq,value) cg_streq(cg_http_request_getmethod(httpReq), value) +#define cg_http_request_isgetrequest(httpReq) cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_GET) +#define cg_http_request_ispostrequest(httpReq) (cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_POST) || cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_MPOST)) +#define cg_http_request_isheadrequest(httpReq) cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_HEAD) +#define cg_http_request_issubscriberequest(httpReq) cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_SUBSCRIBE) +#define cg_http_request_isunsubscriberequest(httpReq) cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_UNSUBSCRIBE) +#define cg_http_request_isnotifyrequest(httpReq) cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_NOTIFY) +#define cg_http_request_issoapaction(httpReq) (cg_http_packet_hasheader(((CgHttpPacket*)httpReq), CG_HTTP_SOAP_ACTION) || cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_MPOST)) + +#define cg_http_request_setcontent(httpReq,value) cg_http_packet_setcontent(((CgHttpPacket*)httpReq),value) +#define cg_http_request_setncontent(httpReq,value,len) cg_http_packet_setcontent(((CgHttpPacket*)httpReq),value,len) +#define cg_http_request_appendncontent(httpPkt, value, len) cg_http_packet_appendncontent(httpPkt, value, len) +#define cg_http_request_setcontentpointer(httpReq,value, len) cg_http_packet_setcontentpointer(((CgHttpPacket*)httpReq),value, len) +#define cg_http_request_getcontent(httpReq) cg_http_packet_getcontent(((CgHttpPacket*)httpReq)) +#define cg_http_request_getheaders(httpReq) cg_http_packet_getheaders((CgHttpPacket*)httpReq) +#define cg_http_request_getheader(httpReq,name) cg_http_packet_getheader((CgHttpPacket*)httpReq,name) +#define cg_http_request_setheadervalue(httpReq,name,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpReq,name,value) +#define cg_http_request_setheaderinteger(httpReq,name,value) cg_http_packet_setheaderinteger((CgHttpPacket*)httpReq,name,value) +#define cg_http_request_setheaderlong(httpReq,name,value) cg_http_packet_setheaderlong((CgHttpPacket*)httpReq,name,value) +#define cg_http_request_getheadervalue(httpReq,name) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,name) +#define cg_http_request_getheaderinteger(httpReq,name) cg_http_packet_getheaderinteger((CgHttpPacket*)httpReq,name) +#define cg_http_request_getheaderlong(httpReq,name) cg_http_packet_getheaderlong((CgHttpPacket*)httpReq,name) + +#define cg_http_request_setuserdata(httpReq, value) (httpReq->userData = value) +#define cg_http_request_getuserdata(httpReq) (httpReq->userData) + +/**** Local Address/Port ****/ +#define cg_http_request_getlocaladdress(httpReq) cg_socket_getaddress(httpReq->sock) +#define cg_http_request_getlocalport(httpReq) cg_socket_getport(httpReq->sock) + +/**** Content-Length ****/ +#define cg_http_request_setcontentlength(httpReq,value) cg_http_packet_setcontentlength((CgHttpPacket*)httpReq, value) +#define cg_http_request_getcontentlength(httpReq) cg_http_packet_getcontentlength((CgHttpPacket*)httpReq) + +/**** Content-Type ****/ +#define cg_http_request_setcontenttype(httpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpReq,CG_HTTP_CONTENT_TYPE,value) +#define cg_http_request_getcontenttype(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_CONTENT_TYPE) + +/**** Connection ****/ +#define cg_http_request_setconnection(httpReq, value) cg_http_packet_setheadervalue((CgHttpPacket*)httpReq,CG_HTTP_CONNECTION, value) +#define cg_http_request_getconnection(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_CONNECTION) +#define cg_http_request_iskeepaliveconnection(httpReq) cg_http_packet_iskeepaliveconnection((CgHttpPacket*)httpReq) + +/**** Transfer-Encoding ****/ +#define cg_http_request_settransferencoding(httpReq, value) cg_http_packet_settransferencoding((CgHttpPacket*)httpReq, value) +#define cg_http_request_gettransferencoding(httpReq) cg_http_packet_gettransferencoding((CgHttpPacket*)httpReq) +#define cg_http_request_ischunked(httpReq) cg_http_packet_ischunked((CgHttpPacket*)httpReq) + +/**** Host ****/ +#define cg_http_request_sethost(httpReq,addr,port) cg_http_packet_sethost((CgHttpPacket*)httpReq,addr,port) +#define cg_http_request_gethost(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_HOST) + +/**** Date ****/ +#define cg_http_request_setdate(httpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpReq,CG_HTTP_DATE,value) +#define cg_http_request_getdate(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_DATE) + +/**** Copy ****/ +void cg_http_request_copy(CgHttpRequest *destHttpReq, CgHttpRequest *srcHttpReq); + +/*** PostURL ****/ +#define cg_http_request_getposturl(httpReq) (httpReq->postURL) + +/**** Print ****/ +void cg_http_request_print(CgHttpRequest *httpReq); + +/**** Timeout ****/ +#define cg_http_request_settimeout(httpReq,value) (httpReq->timeout = value) +#define cg_http_request_gettimeout(httpReq) (httpReq->timeout) + +/**************************************** +* Function (Response) +****************************************/ + +CgHttpResponse *cg_http_response_new(); +void cg_http_response_delete(CgHttpResponse *httpRes); +void cg_http_response_clear(CgHttpResponse *httpRes); +void cg_http_response_setversion(CgHttpResponse *httpRes, char *version); +char *cg_http_response_getversion(CgHttpResponse *httpRes); +void cg_http_response_setreasonphrase(CgHttpResponse *httpRes, char *value); +char *cg_http_response_getreasonphrase(CgHttpResponse *httpRes); +void cg_http_response_setstatuscode(CgHttpResponse *httpRes, int code); +int cg_http_response_getstatuscode(CgHttpResponse *httpRes); +BOOL cg_http_response_read(CgHttpResponse *httpRes, CgSocket *sock, BOOL onlyHeader); + +/*#define cg_http_response_issuccessful(httpRes) ((cg_http_response_getstatuscode(httpRes) == CG_HTTP_STATUS_OK) ? TRUE : FALSE)*/ +#define cg_http_response_issuccessful(httpRes) (cg_http_response_getstatuscode(httpRes) >= 200 && cg_http_response_getstatuscode(httpRes) < 300 ) + +#define cg_http_response_setcontent(httpRes,value) cg_http_packet_setcontent(((CgHttpPacket*)httpRes),value) +#define cg_http_response_setncontent(httpRes,value, len) cg_http_packet_setncontent(((CgHttpPacket*)httpRes),value, len) +#define cg_http_response_appendncontent(httpRes, value, len) cg_http_packet_appendncontent(((CgHttpPacket*) httpRes), value, len) + +#define cg_http_response_setcontentpointer(httpRes,value,len) cg_http_packet_setcontentpointer(((CgHttpPacket*)httpRes),value,len) +#define cg_http_response_getcontent(httpRes) cg_http_packet_getcontent(((CgHttpPacket*)httpRes)) +#define cg_http_response_getheaders(p) cg_http_packet_getheaders((CgHttpPacket*)p) +#define cg_http_response_getheader(p,n) cg_http_packet_getheader((CgHttpPacket*)p,n) +#define cg_http_response_setheadervalue(httpRes,n,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpRes,n,value) +#define cg_http_response_setheaderinteger(httpRes,n,value) cg_http_packet_setheaderinteger((CgHttpPacket*)httpRes,n,value) +#define cg_http_response_setheaderlong(httpRes,n,value) cg_http_packet_setheaderlong((CgHttpPacket*)httpRes,n,value) +#define cg_http_response_getheadervalue(httpRes,n) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,n) +#define cg_http_response_getheaderinteger(httpRes,n) cg_http_packet_getheaderinteger((CgHttpPacket*)httpRes,n) +#define cg_http_response_getheaderlong(httpRes,n) cg_http_packet_getheaderlong((CgHttpPacket*)httpRes,n) + +#define cg_http_response_setuserdata(httpRes, value) (httpRes->userData = value) +#define cg_http_response_getuserdata(httpRes) (httpRes->userData) + +/**** Content-Length ****/ +#define cg_http_response_setcontentlength(httpRes,value) cg_http_packet_setcontentlength((CgHttpPacket*)httpRes, value) +#define cg_http_response_getcontentlength(httpRes) cg_http_packet_getcontentlength((CgHttpPacket*)httpRes) + +/**** Content-Type ****/ +#define cg_http_response_setcontenttype(httpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpRes,CG_HTTP_CONTENT_TYPE,value) +#define cg_http_response_getcontenttype(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_CONTENT_TYPE) + +/**** connection ****/ +#define cg_http_response_setconnection(httpRes, value) cg_http_packet_setheadervalue((CgHttpPacket*)httpRes,CG_HTTP_CONNECTION, value) +#define cg_http_response_getconnection(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes, CG_HTTP_CONNECTION) +#define cg_http_response_iskeepaliveconnection(httpRes) cg_http_packet_iskeepaliveconnection((CgHttpPacket*)httpRes) + +/**** Host ****/ +#define cg_http_response_sethost(httpRes,addr,port) cg_http_packet_sethost((CgHttpPacket*)httpRes,addr,port) +#define cg_http_response_gethost(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_HOST) + +/**** Date ****/ +#define cg_http_response_setdate(httpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpRes,CG_HTTP_DATE,value) +#define cg_http_response_getdate(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_DATE) + +/**** Transfer-Encoding ****/ +#define cg_http_response_settransferencoding(httpReq, value) cg_http_packet_settransferencoding((CgHttpPacket*)httpReq, value) +#define cg_http_response_gettransferencoding(httpReq) cg_http_packet_gettransferencoding((CgHttpPacket*)httpReq) + +/**** Copy ****/ +void cg_http_response_copy(CgHttpResponse *destHttpRes, CgHttpResponse *srcHttpRes); + +/**** Print ****/ +void cg_http_response_print(CgHttpResponse *httpRes); + +/**** Timeout ****/ +#define cg_http_response_settimeout(httpRes,value) (httpRes->timeout = value) +#define cg_http_response_gettimeout(httpRes) (httpRes->timeout) + +/**************************************** +* Function (Server) +****************************************/ + +CgHttpServer *cg_http_server_new(); +void cg_http_server_delete(CgHttpServer *httpServer); +BOOL cg_http_server_open(CgHttpServer *httpServer, int bindPort, char *bindAddr); +BOOL cg_http_server_close(CgHttpServer *httpServer); +BOOL cg_http_server_accept(CgHttpServer *httpServer); +BOOL cg_http_server_start(CgHttpServer *httpServer); +BOOL cg_http_server_stop(CgHttpServer *httpServer); +void cg_http_server_setlistener(CgHttpServer *httpServer, CG_HTTP_LISTENER listener); + +#define cg_http_server_next(httpServer) (CgHttpServer *)cg_list_next((CgList *)httpServer) + +#define cg_http_server_getsocket(httpServer) (httpServer->sock) +#define cg_http_server_isopened(httpServer) ((httpServer->sock != NULL) ? TRUE : FALSE) + +#define cg_http_server_setuserdata(httpServer, value) (httpServer->userData = value) +#define cg_http_server_getuserdata(httpServer) (httpServer->userData) + +char *cg_http_getservername(char *buf, int bufSize); + +/**** Timeout ****/ +#define cg_http_server_settimeout(httpServer,value) (httpServer->timeout = value) +#define cg_http_server_gettimeout(httpServer) (httpServer->timeout) + +/**** Mutex ****/ +#define cg_http_server_lock(httpServer) cg_mutex_lock(httpServer->mutex) +#define cg_http_server_unlock(httpServer) cg_mutex_unlock(httpServer->mutex) + +/**************************************** +* Function (Server List) +****************************************/ + +CgHttpServerList *cg_http_serverlist_new(); +void cg_http_serverlist_delete(CgHttpServerList *httpServerList); + +#define cg_http_serverlist_clear(httpServerList) cg_list_clear((CgList *)httpServerList, (CG_LIST_DESTRUCTORFUNC)cg_http_server_delete) +#define cg_http_serverlist_size(httpServerList) cg_list_size((CgList *)httpServerList) +#define cg_http_serverlist_gets(httpServerList) (CgHttpServer *)cg_list_next((CgList *)httpServerList) +#define cg_http_serverlist_add(httpServerList, httpServer) cg_list_add((CgList *)httpServerList, (CgList *)httpServer) + +BOOL cg_http_serverlist_open(CgHttpServerList *httpServerList, int port); +BOOL cg_http_serverlist_close(CgHttpServerList *httpServerList); +BOOL cg_http_serverlist_start(CgHttpServerList *httpServerList); +BOOL cg_http_serverlist_stop(CgHttpServerList *httpServerList); +void cg_http_serverlist_setlistener(CgHttpServerList *httpServerList, CG_HTTP_LISTENER listener); +void cg_http_serverlist_setuserdata(CgHttpServerList *httpServerList, void *value); + +/**************************************** +* Function (Date) +****************************************/ + +char *cg_http_getdate(CgSysTime sysTime, char *buf, int bufSize); + +/**************************************** +* Persistent connection cache +****************************************/ + +/** Initialize persistent connection cache. Can be called many times */ +BOOL cg_http_persistentconnection_init(void); +/** Clear persistent connection cache and free all memory */ +void cg_http_persistentconnection_clear(void); +/** Lock persistent connection cache. Required for getting, putting and using + persistent connection from cache */ +void cg_http_persistentconnection_lock(void); +/** Unlock persistent connection cache. */ +void cg_http_persistentconnection_unlock(void); +/** Get persistent connection from cache */ +void *cg_http_persistentconnection_get(char *host, int port); +/** Put connection to persistent connection cache */ +BOOL cg_http_persistentconnection_put(char *host, int port, void *data); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/io/cfile.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/io/cfile.h new file mode 100644 index 0000000..608eb58 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/io/cfile.h @@ -0,0 +1,189 @@ +/****************************************************************** +* +* CyberIO for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cfile.h +* +* Revision: +* +* 02/1/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_IO_CFILE_H_ +#define _CG_IO_CFILE_H_ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(WIN32) || defined(WINCE) +#define CG_USE_CFILE 1 +#endif + +#if defined(CG_USE_CFILE) + +/**************************************** +* Define +****************************************/ + +#if defined(WIN32) +#define CG_FILE_SEPARATOR_CHAR '\\' +#define CG_FILE_PATH_SEPARATOR_CHAR ';' +#define CG_FILE_SEPARATOR "\\" +#define CG_FILE_PATH_SEPARATOR ";" +#else +#define CG_FILE_SEPARATOR_CHAR '/' +#define CG_FILE_PATH_SEPARATOR_CHAR ':' +#define CG_FILE_SEPARATOR "/" +#define CG_FILE_PATH_SEPARATOR ":" +#endif + +#define CG_FILE_READ_CHUNK_SIZE 1024 + +#define CG_FILE_OPEN_READ 0x01 +#define CG_FILE_OPEN_WRITE 0x02 +#define CG_FILE_OPEN_CREATE 0x04 + +#define CG_FILE_SEEK_SET 0x01 +#define CG_FILE_SEEK_CUR 0x02 +#define CG_FILE_SEEK_END 0x04 + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgFile { + BOOL headFlag; + struct _CgFile *prev; + struct _CgFile *next; + CgString *name; + CgString *path; + char *content; + FILE *fp; +} CgFile, CgFileList; + +/**************************************** +* Function +****************************************/ + +CgFile *cg_file_new(); +void cg_file_delete(CgFile *file); + +#define cg_file_next(file) (CgFile *)cg_list_next((CgList *)file) + +void cg_file_setname(CgFile *file, char *name); + +#define cg_file_setpath(file, value) cg_file_setname(file, value) +void cg_file_setfilename(CgFile *file, char *value); +#define cg_file_addfilename(file, value) cg_file_setfilename(file, value) + +char *cg_file_getname(CgFile *file); +long cg_file_getlength(CgFile *file); + +long cg_file_getlastmodified(CgFile *file); +long cg_file_getlength(CgFile *file); +BOOL cg_file_exists(CgFile *file); +BOOL cg_file_remove(CgFile *file); + +void cg_file_setcontent(CgFile *file, char *content); +char *cg_file_getcontent(CgFile *file); + +char *cg_file_getfilename(CgFile *file); +char *cg_file_getpath(CgFile *file); + +BOOL cg_file_load(CgFile *file); +BOOL cg_file_save(CgFile *file); + +int cg_file_listfiles(CgFile *file, CgFileList *fileList); + +#define cg_file_isseparatorchar(c) ((CG_FILE_SEPARATOR_CHAR == c) ? TRUE : FALSE) +#define cg_file_ispathseparatorchar(c) ((CG_FILE_PATH_SEPARATOR_CHAR == c) ? TRUE : FALSE) + +/* Raw Functions */ +BOOL cg_file_open(CgFile *file, int flag); +BOOL cg_file_close(CgFile *file); +BOOL cg_file_write(CgFile *file, CgByte *buf, int bufLen); +BOOL cg_file_read(CgFile *file, CgByte *buf, int bufLen); +BOOL cg_file_seek(CgFile *file, CgInt64, int whence); + +/**************************************** +* Function (File List) +****************************************/ + +/** + * Create a new file list + * + * \return File list + */ +CgFileList *cg_filelist_new(); + +/** + * Destroy a file list + * + * \param fileList The file list in question + */ +void cg_filelist_delete(CgFileList *fileList); + +/** + * Clear the contents of a file list + * + * \param fileList File list in question + */ +#define cg_filelist_clear(fileList) cg_list_clear((CgList *)fileList, (CG_LIST_DESTRUCTORFUNC)cg_file_delete) + +/** + * Get the size of a file list + * + * \param fileList The file list in question + */ +#define cg_filelist_size(fileList) cg_list_size((CgList *)fileList) + +/** + * Get the first actual item from a file list to use as an iterator + * + * \param fileList The file list in question + */ +#define cg_filelist_gets(fileList) (CgFile *)cg_list_next((CgList *)fileList) + +/** + * Add a file into a file list + * + * \param fileList The file list in question + * \param file The file to add to the list + */ +#define cg_filelist_add(fileList, file) cg_list_add((CgList *)fileList, (CgList *)file) + +/** + * Remove a file from file list + * + * \param fileList The file list in question + * \param file The file to be removed + */ +#define cg_filelist_remove(file) cg_list_remove((CgList *)file) + +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/net/cinterface.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/net/cinterface.h new file mode 100644 index 0000000..e277d8f --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/net/cinterface.h @@ -0,0 +1,155 @@ +/****************************************************************** +* +* CyberNet for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cinterface.h +* +* Revision: +* +* 02/09/05 +* - first revision +* 03/23/06 Theo Beisch +* - added localhost constants +* 09/12/07 +* - Added the following functions to get MAC address. +* cg_net_interface_setmacaddress(), cg_net_interface_getmacaddress() +* - Changed cg_net_gethostinterfaces() to get the MAC address using GetAdaptersInfo() as default on Windows platform. +* - Changed cg_net_gethostinterfaces() to get the MAC address using getifaddrs() on UNIX platform. +* Note : Other platforms might not support to get this functions yet. +* +******************************************************************/ + +#ifndef _CG_NET_CINTERFACE_H_ +#define _CG_NET_CINTERFACE_H_ + +#include +#include +#include + +#if !defined(WIN32) +#include +#include +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_NET_IPV4_ADDRSTRING_MAXSIZE ((3*4)+(1*3)+1) +#define CG_NET_IPV6_ADDRSTRING_MAXSIZE (1+(8*4)+(1*7)+1+1) + +#define CG_NET_IPV4_LOOPBACK "127.0.0.1" +#define CG_NET_IPV6_LOOPBACK "fixmelater" +#define CG_NET_MACADDR_SIZE 6 + +#if defined(BTRON) || defined(TENGINE) +#define CG_NET_DEFAULT_IFNAME "Neta" +#endif + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgNetworkInterface { + BOOL headFlag; + struct _CgNetworkInterface *prev; + struct _CgNetworkInterface *next; + CgString *name; + CgString *ipaddr; + CgString *netmask; + CgByte macaddr[CG_NET_MACADDR_SIZE]; + int index; +} CgNetworkInterface, CgNetworkInterfaceList; + +/**************************************** +* Function (NetworkInterface) +****************************************/ + +CgNetworkInterface *cg_net_interface_new(); +void cg_net_interface_delete(CgNetworkInterface *netIf); +CgNetworkInterface* cg_net_interface_getany(); + +#define cg_net_interface_next(netIf) (CgNetworkInterface *)cg_list_next((CgList *)netIf) +#define cg_net_interface_remove(netIf) cg_list_remove((CgList *)netIf) + +void cg_net_interface_setname(CgNetworkInterface *netIf, char *name); +char *cg_net_interface_getname(CgNetworkInterface *netIf); +void cg_net_interface_setaddress(CgNetworkInterface *netIf, char *ipaddr); +char *cg_net_interface_getaddress(CgNetworkInterface *netIf); +void cg_net_interface_setnetmask(CgNetworkInterface *netIf, char *ipaddr); +char *cg_net_interface_getnetmask(CgNetworkInterface *netIf); +char *cg_net_selectaddr(struct sockaddr *remoteaddr); + +#define cg_net_interface_setmacaddress(netIf, value) memcpy(netIf->macaddr, value, CG_NET_MACADDR_SIZE) +#define cg_net_interface_getmacaddress(netIf, buf) memcpy(buf, netIf->macaddr, CG_NET_MACADDR_SIZE) + +#define cg_net_interface_setindex(netIf, value) (netIf->index = value) +#define cg_net_interface_getindex(netIf, buf) (netIf->index) + +/** + * Compares two interfaces based on IP-address. + */ +int cg_net_interface_cmp(CgNetworkInterface *netIfA, + CgNetworkInterface *netIfB); + +/**************************************** +* Function (NetworkInterfaceList) +****************************************/ + +CgNetworkInterfaceList *cg_net_interfacelist_new(); +void cg_net_interfacelist_delete(CgNetworkInterfaceList *netIfList); + +#define cg_net_interfacelist_clear(netIfList) cg_list_clear((CgList *)netIfList, (CG_LIST_DESTRUCTORFUNC)cg_net_interface_delete) +#define cg_net_interfacelist_size(netIfList) cg_list_size((CgList *)netIfList) +#define cg_net_interfacelist_gets(netIfList) (CgNetworkInterface *)cg_list_next((CgList *)netIfList) +#define cg_net_interfacelist_add(netIfList,netIf) cg_list_add((CgList *)netIfList, (CgList *)netIf) + +CgNetworkInterface *cg_net_interfacelist_get(CgNetworkInterfaceList *netIfList, char *name); + +/** + * Gets changes in the two given (aka old and new) interface lists. Changes + * are resolved based on IP-addresses. + * + * @param netIfListOld List of the old interfaces. It is changed! + * @param netIfListNew List of the new interfaces. It is changed! + * @param netIfListAdded List to store interfaces, which were in netIfListNew, + * but were not in netIfListOld. May be NULL. + * @param netIfListRemoved List to store interfaces, which were in + * netIfListOld, but were not in netIfListNew. + */ +void cg_net_interfacelist_getchanges(CgNetworkInterfaceList *netIfListOld, + CgNetworkInterfaceList *netIfListNew, + CgNetworkInterfaceList *netIfListAdded, + CgNetworkInterfaceList *netIfListRemoved); + +/**************************************** +* Function +****************************************/ + +#if defined(ITRON) +void cg_net_setinterface(char *ifaddr); +#endif + +int cg_net_gethostinterfaces(CgNetworkInterfaceList *netIfList); + +BOOL cg_net_isipv6address(char *addr); +int cg_net_getipv6scopeid(char *addr); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/net/csocket.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/net/csocket.h new file mode 100644 index 0000000..1bbe9aa --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/net/csocket.h @@ -0,0 +1,233 @@ +/****************************************************************** +* +* CyberNet for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: csocket.h +* +* Revision: +* +* 01/17/05 +* - first revision +* 04/03/06 Theo Beisch +* - added WSAGetLastError support +* - changed socket_cleanup to return +* value to enable final Winsock close +******************************************************************/ + +#ifndef _CG_NET_CSOCKET_H_ +#define _CG_NET_CSOCKET_H_ + +#include +#include + +#if defined(CG_USE_OPENSSL) +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_NET_SOCKET_NONE 0 + +#define CG_NET_SOCKET_STREAM 0x01 +#define CG_NET_SOCKET_DGRAM 0x02 + +#define CG_NET_SOCKET_CLIENT 1 +#define CG_NET_SOCKET_SERVER 2 + +#define CG_NET_SOCKET_MAXHOST 32 +#define CG_NET_SOCKET_MAXSERV 32 + +#if defined(BTRON) || defined(TENGINE) +typedef W SOCKET; +#elif defined(ITRON) +typedef ER SOCKET; +#elif !defined(WIN32) && !defined(__CYGWIN__) +typedef int SOCKET; +#endif + +#define CG_SOCKET_LF '\n' + +#define CG_NET_SOCKET_DGRAM_RECV_BUFSIZE 512 +#define CG_NET_SOCKET_DGRAM_ANCILLARY_BUFSIZE 512 +#define CG_NET_SOCKET_MULTICAST_DEFAULT_TTL 4 +#define CG_NET_SOCKET_AUTO_IP_NET 0xa9fe0000 +#define CG_NET_SOCKET_AUTO_IP_MASK 0xffff0000 + +#if defined(ITRON) +#define CG_NET_SOCKET_WINDOW_BUFSIZE 4096 +#endif + +/**************************************** +* Define (SocketList) +****************************************/ + +#if defined(ITRON) +#define CG_NET_USE_SOCKET_LIST 1 +#endif + +/**************************************** +* Data Type +****************************************/ + +#if defined(CG_NET_USE_SOCKET_LIST) +#include +#endif + +typedef struct _CgSocket { +#if defined(CG_NET_USE_SOCKET_LIST) + BOOL headFlag; + struct _CgSocket *prev; + struct _CgSocket *next; +#endif + SOCKET id; + int type; + int direction; + CgString *ipaddr; + int port; +#if defined(ITRON) + UH *sendWinBuf; + UH *recvWinBuf; +#endif +#if defined(CG_USE_OPENSSL) + SSL_CTX* ctx; + SSL* ssl; +#endif +} CgSocket, CgSocketList; + +typedef struct _CgDatagramPacket { + CgString *data; + CgString *localAddress; + int localPort; + CgString *remoteAddress; + int remotePort; +} CgDatagramPacket; + +/**************************************** +* Function (Socket) +****************************************/ + +void cg_socket_startup(); +void cg_socket_cleanup(); + +CgSocket *cg_socket_new(int type); +#define cg_socket_stream_new() cg_socket_new(CG_NET_SOCKET_STREAM) +#define cg_socket_dgram_new() cg_socket_new(CG_NET_SOCKET_DGRAM) +int cg_socket_delete(CgSocket *socket); + +void cg_socket_setid(CgSocket *socket, SOCKET value); +#define cg_socket_getid(socket) (socket->id) + +#define cg_socket_settype(socket, value) (socket->type = value) +#define cg_socket_gettype(socket) (socket->type) +#define cg_socket_issocketstream(socket) ((socket->type & CG_NET_SOCKET_STREAM) ? TRUE : FALSE) +#define cg_socket_isdatagramstream(socket) ((socket->type & CG_NET_SOCKET_DGRAM) ? TRUE : FALSE) + +#define cg_socket_setdirection(socket, value) (socket->direction = value) +#define cg_socket_getdirection(socket) (socket->direction) +#define cg_socket_isclient(socket) ((socket->direction == CG_NET_SOCKET_CLIENT) ? TRUE : FALSE) +#define cg_socket_isserver(socket) ((socket->direction == CG_NET_SOCKET_SERVER) ? TRUE : FALSE) + +#define cg_socket_setaddress(socket, value) cg_string_setvalue(socket->ipaddr, value) +#define cg_socket_setport(socket, value) (socket->port = value) +#define cg_socket_getaddress(socket) cg_string_getvalue(socket->ipaddr) +#define cg_socket_getport(socket) (socket->port) + +BOOL cg_socket_isbound(CgSocket *socket); +BOOL cg_socket_close(CgSocket *socket); + +BOOL cg_socket_listen(CgSocket *socket); + +BOOL cg_socket_bind(CgSocket *sock, int bindPort, char *bindAddr, BOOL bindFlag, BOOL reuseFlag); +BOOL cg_socket_accept(CgSocket *sock, CgSocket *clientSock); +BOOL cg_socket_connect(CgSocket *sock, char *addr, int port); +int cg_socket_read(CgSocket *sock, char *buffer, int bufferLen); +int cg_socket_write(CgSocket *sock, char *buffer, int bufferLen); +int cg_socket_readline(CgSocket *sock, char *buffer, int bufferLen); +long cg_socket_skip(CgSocket *sock, long skipLen); + +int cg_socket_sendto(CgSocket *sock, char *addr, int port, char *data, int dataeLen); +int cg_socket_recv(CgSocket *sock, CgDatagramPacket *dgmPkt); + +int cg_socket_getlasterror(); + +/**************************************** +* Function (Multicast) +****************************************/ + +BOOL cg_socket_joingroup(CgSocket *sock, char *mcastAddr, char *ifAddr); + +/**************************************** +* Function (Option) +****************************************/ + +BOOL cg_socket_setreuseaddress(CgSocket *socket, BOOL flag); +BOOL cg_socket_setmulticastttl(CgSocket *sock, int ttl); +BOOL cg_socket_settimeout(CgSocket *sock, int sec); + +/**************************************** +* Function (DatagramPacket) +****************************************/ + +CgDatagramPacket *cg_socket_datagram_packet_new(); +void cg_socket_datagram_packet_delete(CgDatagramPacket *dgmPkt); + +#define cg_socket_datagram_packet_setdata(dgmPkt, value) cg_string_setvalue(dgmPkt->data, value) +#define cg_socket_datagram_packet_getdata(dgmPkt) cg_string_getvalue(dgmPkt->data) + +#define cg_socket_datagram_packet_setlocaladdress(dgmPkt, addr) cg_string_setvalue(dgmPkt->localAddress, addr) +#define cg_socket_datagram_packet_getlocaladdress(dgmPkt) cg_string_getvalue(dgmPkt->localAddress) +#define cg_socket_datagram_packet_setlocalport(dgmPkt, port) (dgmPkt->localPort = port) +#define cg_socket_datagram_packet_getlocalport(dgmPkt) (dgmPkt->localPort) +#define cg_socket_datagram_packet_setremoteaddress(dgmPkt, addr) cg_string_setvalue(dgmPkt->remoteAddress, addr) +#define cg_socket_datagram_packet_getremoteaddress(dgmPkt) cg_string_getvalue(dgmPkt->remoteAddress) +#define cg_socket_datagram_packet_setremoteport(dgmPkt, port) (dgmPkt->remotePort = port) +#define cg_socket_datagram_packet_getremoteport(dgmPkt) (dgmPkt->remotePort) + +void cg_socket_datagram_packet_copy(CgDatagramPacket *dstDgmPkt, CgDatagramPacket *srcDgmPkt); + +/**************************************** +* Function (SSLSocket) +****************************************/ + +#if defined(CG_USE_OPENSSL) +#define CG_NET_SOCKET_SSL 0x0100 +#define cg_socket_ssl_new() cg_socket_new(CG_NET_SOCKET_STREAM | CG_NET_SOCKET_SSL) +#define cg_socket_isssl(socket) ((socket->type & CG_NET_SOCKET_SSL) ? TRUE : FALSE) +#endif + +/**************************************** +* Function (SocketList) +****************************************/ + +#if defined(CG_NET_USE_SOCKET_LIST) + +#define cg_socket_next(sock) (CgSocket *)cg_list_next((CgList *)sock) + +CgSocketList *cg_socketlist_new(); +void cg_socketlist_delete(CgSocketList *sockList); + +#define cg_socketlist_clear(sockList) cg_list_clear((CgList *)sockList, (CG_LIST_DESTRUCTORFUNC)cg_socket_delete) +#define cg_socketlist_size(sockList) cg_list_size((CgList *)sockList) +#define cg_socketlist_gets(sockList) (CgSocket *)cg_list_next((CgList *)sockList) +#define cg_socketlist_add(sockList, sock) cg_list_add((CgList *)sockList, (CgList *)sock) + +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/net/curi.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/net/curi.h new file mode 100644 index 0000000..b4b9484 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/net/curi.h @@ -0,0 +1,146 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: curl.h +* +* Revision: +* +* 03/09/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_NET_CURI_H_ +#define _CG_NET_CURI_H_ + +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_NET_URI_KNKOWN_PORT (-1) +#define CG_NET_URI_DEFAULT_HTTP_PORT 80 +#define CG_NET_URI_DEFAULT_FTP_PORT 21 +#define CG_NET_URI_DEFAULT_PATH "/" +#define CG_NET_URI_MAXLEN 256 + +#define CG_NET_URI_PROTOCOL_DELIM "://" +#define CG_NET_URI_USER_DELIM "@" +#define CG_NET_URI_COLON_DELIM ":" +#define CG_NET_URI_SLASH_DELIM "/" +#define CG_NET_URI_SBLACET_DELIM "[" +#define CG_NET_URI_EBLACET_DELIM "]" +#define CG_NET_URI_SHARP_DELIM "#" +#define CG_NET_URI_QUESTION_DELIM "?" +#define CG_NET_URI_ESCAPING_CHAR "%" +#define CG_NET_URI_AMP_DELIM "&" +#define CG_NET_URI_EQ_DELIM "=" + +#define CG_NET_URI_PROTOCOL_HTTP "http" +#define CG_NET_URI_PROTOCOL_FTP "ftp" + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgNetURI { + CgString *uri; + CgString *protocol; + CgString *user; + CgString *password; + CgString *host; + int port; + CgString *path; + CgString *query; + CgString *fragment; + CgString *request; + CgDictionary *queryDictionary; +} CgNetURI; + +/**************************************** +* Function +****************************************/ + +CgNetURI *cg_net_uri_new(); +void cg_net_uri_delete(CgNetURI *uri); +void cg_net_uri_clear(CgNetURI *uri); +void cg_net_uri_setvalue(CgNetURI *uri, char *value); +void cg_net_uri_rebuild(CgNetURI *uri); +char *cg_net_uri_getvalue(CgNetURI *uri); + +#define cg_net_uri_set(urip, value) cg_net_uri_setvalue(urip, value) + +#define cg_net_uri_seturi(urip, value) cg_string_setvalue(urip->uri, value) +#define cg_net_uri_setprotocol(urip, value) cg_string_setvalue(urip->protocol, value) +#define cg_net_uri_setuser(urip, value) cg_string_setvalue(urip->user, value) +#define cg_net_uri_setpassword(urip, value) cg_string_setvalue(urip->password, value) +#define cg_net_uri_sethost(urip, value) cg_string_setvalue(urip->host, value) +#define cg_net_uri_setport(urip, value) (urip->port = value) +#define cg_net_uri_setpath(urip, value) cg_string_setvalue(urip->path, value) +#define cg_net_uri_addpath(urip, value) cg_string_addvalue(urip->path, value) +#define cg_net_uri_setquery(urip, value) cg_string_setvalue(urip->query, value) +#define cg_net_uri_setfragment(urip, value) cg_string_setvalue(urip->fragment, value) + +#define cg_net_uri_geturi(urip) cg_string_getvalue(urip->uri) +#define cg_net_uri_getprotocol(urip) cg_string_getvalue(urip->protocol) +#define cg_net_uri_getuser(urip) cg_string_getvalue(urip->user) +#define cg_net_uri_getpassword(urip) cg_string_getvalue(urip->password) +#define cg_net_uri_gethost(urip) cg_string_getvalue(urip->host) +#define cg_net_uri_getport(urip) (urip->port) +#define cg_net_uri_getpath(urip) cg_string_getvalue(urip->path) +#define cg_net_uri_getquery(urip) cg_string_getvalue(urip->query) +#define cg_net_uri_getfragment(urip) cg_string_getvalue(urip->fragment) + +char *cg_net_uri_getrequest(CgNetURI *uri); +char *cg_net_uri_getupnpbasepath(CgNetURI *locationURL); + +#define cg_net_uri_hasuri(urip) ((0 < cg_string_length(urip->uri)) ? TRUE : FALSE) +#define cg_net_uri_hasprotocol(urip) ((0 < cg_string_length(urip->protocol)) ? TRUE : FALSE) +#define cg_net_uri_hasuser(urip) ((0 < cg_string_length(urip->user)) ? TRUE : FALSE) +#define cg_net_uri_haspassword(urip) ((0 < cg_string_length(urip->password)) ? TRUE : FALSE) +#define cg_net_uri_hashost(urip) ((0 < cg_string_length(urip->host)) ? TRUE : FALSE) +#define cg_net_uri_hasport(urip) ((0 < urip->port) ? TRUE : FALSE) +#define cg_net_uri_haspath(urip) ((0 < cg_string_length(urip->path)) ? TRUE : FALSE) +#define cg_net_uri_hasquery(urip) ((0 < cg_string_length(urip->query)) ? TRUE : FALSE) +#define cg_net_uri_hasfragment(urip) ((0 < cg_string_length(urip->fragment)) ? TRUE : FALSE) +#define cg_net_uri_hasrequest(urip) cg_net_uri_haspath(urip) + +#define cg_net_uri_ishttpprotocol(urip) cg_streq(cg_string_getvalue(urip->protocol), CG_NET_URI_PROTOCOL_HTTP) + +#define cg_net_uri_isabsolute(urip) cg_net_uri_hasprotocol(urip) +#define cg_net_uri_isabsolutepath(uripath) (( *uripath == '/' ) ? TRUE : FALSE ) +#define cg_net_uri_isrelative(urip) ((cg_net_uri_hasprotocol(urip) == TRUE) ? FALSE : TRUE) + +BOOL cg_net_uri_isreservedchar(char c); +BOOL cg_net_uri_isunreservedchar(char c); +BOOL cg_net_uri_isescapechar(char c); +BOOL cg_net_uri_isalphanumchar(char c); + +BOOL cg_net_uri_isescapedstring(char *buf, int bufSize); +char *cg_net_uri_escapestring(char *buf, int bufSize, CgString *retBuf); +char *cg_net_uri_unescapestring(char *buf, int bufSize, CgString *retBuf); +BOOL cg_net_uri_isequivalent(char *url, char *relative_url); + +CgDictionary *cg_net_uri_getquerydictionary(CgNetURI *uri); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/net/curl.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/net/curl.h new file mode 100644 index 0000000..2da3f37 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/net/curl.h @@ -0,0 +1,106 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: curl.h +* +* Revision: +* +* 03/09/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_NET_CURL_H_ +#define _CG_NET_CURL_H_ + +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgNetURI CgNetURL; + +/**************************************** +* Function +****************************************/ + +#define cg_net_url_new() cg_net_uri_new() +#define cg_net_url_delete(urip) cg_net_uri_delete(urip); +#define cg_net_url_clear(urip) cg_net_uri_clear(urip); + +#define cg_net_url_set(urip, value) cg_net_uri_set(urip, value) +#define cg_net_url_setvalue(urip, value) cg_net_uri_setvalue(urip, value) +#define cg_net_url_rebuild(urip) cg_net_uri_rebuild(urip) +#define cg_net_url_getvalue(urip) cg_net_uri_getvalue(urip) + +#define cg_net_url_seturi(urip, value) cg_string_setvalue(urip->uri, value) +#define cg_net_url_setprotocol(urip, value) cg_string_setvalue(urip->protocol, value) +#define cg_net_url_setuser(urip, value) cg_string_setvalue(urip->user, value) +#define cg_net_url_setpassword(urip, value) cg_string_setvalue(urip->password, value) +#define cg_net_url_sethost(urip, value) cg_string_setvalue(urip->host, value) +#define cg_net_url_setport(urip, value) (urip->port = value) +#define cg_net_url_setpath(urip, value) cg_string_setvalue(urip->path, value) +#define cg_net_url_addpath(urip, value) cg_net_uri_addpath(urip, value) +#define cg_net_url_setquery(urip, value) cg_string_setvalue(urip->query, value) +#define cg_net_url_setfragment(urip, value) cg_string_setvalue(urip->fragment, value) + +#define cg_net_url_geturi(urip) cg_string_getvalue(urip->uri) +#define cg_net_url_getprotocol(urip) cg_string_getvalue(urip->protocol) +#define cg_net_url_getuser(urip) cg_string_getvalue(urip->user) +#define cg_net_url_getpassword(urip) cg_string_getvalue(urip->password) +#define cg_net_url_gethost(urip) cg_string_getvalue(urip->host) +#define cg_net_url_getport(urip) (urip->port) +#define cg_net_url_getpath(urip) cg_string_getvalue(urip->path) +#define cg_net_url_getquery(urip) cg_string_getvalue(urip->query) +#define cg_net_url_getfragment(urip) cg_string_getvalue(urip->fragment) +#define cg_net_url_getrequest(urip) cg_net_uri_getrequest(urip) + +#define cg_net_url_hasuri(urip) ((0 < cg_string_length(urip->uri)) ? TRUE : FALSE) +#define cg_net_url_hasprotocol(urip) ((0 < cg_string_length(urip->protocol)) ? TRUE : FALSE) +#define cg_net_url_hasuser(urip) ((0 < cg_string_length(urip->user)) ? TRUE : FALSE) +#define cg_net_url_haspassword(urip) ((0 < cg_string_length(urip->password)) ? TRUE : FALSE) +#define cg_net_url_hashost(urip) ((0 < cg_string_length(urip->host)) ? TRUE : FALSE) +#define cg_net_url_hasport(urip) ((0 < urip->port) ? TRUE : FALSE) +#define cg_net_url_haspath(urip) ((0 < cg_string_length(urip->path)) ? TRUE : FALSE) +#define cg_net_url_hasquery(urip) ((0 < cg_string_length(urip->query)) ? TRUE : FALSE) +#define cg_net_url_hasfragment(urip) ((0 < cg_string_length(urip->fragment)) ? TRUE : FALSE) +#define cg_net_url_hasrequest(urip) cg_net_uri_hasrequest(urip) + +#define cg_net_url_ishttpprotocol(urip) cg_streq(cg_string_getvalue(urip->protocol), CG_NET_URI_PROTOCOL_HTTP) + +#define cg_net_url_isabsolute(uripath) cg_net_uri_hasprotocol(uripath) +#define cg_net_url_isrelative(urip) ((cg_net_uri_hasprotocol(urip) == TRUE) ? FALSE : TRUE) +#define cg_net_url_isabsolutepath(uripath) cg_net_uri_isabsolutepath(uripath) + +#define cg_net_url_getupnpbasepath(urip) cg_net_uri_getupnpbasepath(urip); + +char *cg_net_gethosturl(char *host, int port, char *uri, char *buf, int bufSize); +char *cg_net_getmodifierhosturl(char *host, int port, char *uri, char *buf, int bufSize, char *begin, char *end); + +#define cg_net_url_getquerydictionary(urip) cg_net_uri_getquerydictionary(urip); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/soap/csoap.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/soap/csoap.h new file mode 100644 index 0000000..dc02410 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/soap/csoap.h @@ -0,0 +1,148 @@ +/****************************************************************** +* +* CyberSOAP for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: csoap.h +* +* Revision: +* +* 02/13/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_SOAP_CSOAP_H_ +#define _CG_SOAP_CSOAP_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_SOAP_VERSION_HEADER "" + +#define CG_HTTP_SOAP_ACTION "SOAPACTION" +#define CG_HTTP_SOAP_URN_DELIM ":" + +#define CG_SOAP_ENVELOPE "Envelope" +#define CG_SOAP_BODY "Body" +#define CG_SOAP_RESPONSE "Response" +#define CG_SOAP_FAULT "Fault" +#define CG_SOAP_FAULT_CODE "faultcode" +#define CG_SOAP_FAULT_STRING "faultstring" +#define CG_SOAP_FAULTACTOR "faultactor" +#define CG_SOAP_DETAIL "detail" + +#define CG_SOAP_ATTRIBUTE_XMLNS "xmlns" + +#define CG_SOAP_XMLNS "s" +#define CG_SOAP_METHODNS "u" +#define CG_SOAP_DELIM ":" + +#define CG_SOAP_XMLNS_URL "http://schemas.xmlsoap.org/soap/envelope/" +#define CG_SOAP_ENCSTYLE_URL "http://schemas.xmlsoap.org/soap/encoding/" + +#define CG_SOAP_CONTENT_TYPE "text/xml; charset=\"utf-8\"" +#define CG_SOAP_ENCORDING "encodingStyle" + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgSoapResponse { + CgHttpResponse *httpRes; + BOOL isHttpResCreated; + CgXmlNodeList *rootNodeList; + void *userData; +} CgSoapResponse; + +typedef struct _CgSoapRequest{ + CgHttpRequest *httpReq; + BOOL isHttpReqCreated; + CgXmlNode *rootNodeList; + CgSoapResponse *soapRes; + void *userData; +} CgSoapRequest; + +/**************************************** +* Function (Request) +****************************************/ + +CgSoapRequest *cg_soap_request_new(); +void cg_soap_request_delete(CgSoapRequest *soapReq); +void cg_soap_request_clear(CgSoapRequest *soapReq); + +BOOL cg_soap_request_sethttprequest(CgSoapRequest *soapReq, CgHttpRequest *httpReq); +#define cg_soap_request_gethttprequest(soapReq) (soapReq->httpReq) + +#define cg_soap_request_setsoapaction(soapReq, name) cg_http_packet_setheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SOAP_ACTION, name) +#define cg_soap_request_getsoapaction(soapReq) cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SOAP_ACTION) +#define cg_soap_request_getsoapactionwithns(soapReq) cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SOAP_ACTION_WITH_NS) + +BOOL cg_soap_request_parsemessage(CgSoapRequest *soapReq, char *msg, int msgLen); +CgSoapResponse *cg_soap_request_post(CgSoapRequest *soapReq, char *ipaddr, int port); +#define cg_soap_request_getsoapresponse(soapReq) (soapReq->soapRes) + +#define cg_soap_request_getrootnoodelist(soapReq) (soapReq->rootNodeList) +#define cg_soap_request_getrootnoode(soapReq) cg_xml_nodelist_gets(soapReq->rootNodeList) +#define cg_soap_request_getenvelopenode(soapReq) cg_xml_nodelist_gets(soapReq->rootNodeList) +CgXmlNode *cg_soap_request_getbodynode(CgSoapRequest *soapReq); + +void cg_soap_request_setcontent(CgSoapRequest *soapReq, CgXmlNode *node); +#define cg_soap_request_createcontent(soapReq) cg_soap_request_setcontent(soapReq, cg_soap_request_getenvelopenode(soapReq)) + +/**** User Data ****/ +#define cg_soap_request_setuserdata(soapReq, value) (soapReq->userData = value) +#define cg_soap_request_getuserdata(soapReq) (soapReq->userData) + +/**************************************** +* Function (Response) +****************************************/ + +CgSoapResponse *cg_soap_response_new(); +void cg_soap_response_delete(CgSoapResponse *soapRes); +void cg_soap_response_clear(CgSoapResponse *soapRes); + +void cg_soap_response_sethttpresponse(CgSoapResponse *soapRes, CgHttpResponse *httpRes); +#define cg_soap_response_gethttpresponse(soapRes) (soapRes->httpRes) + +#define cg_soap_response_getrootnoodelist(soapRes) (soapRes->rootNodeList); +#define cg_soap_response_getrootnoode(soapRes) cg_xml_nodelist_gets(soapRes->rootNodeList); +#define cg_soap_response_getenvelopenode(soapRes) cg_xml_nodelist_gets(soapRes->rootNodeList); +CgXmlNode *cg_soap_response_getbodynode(CgSoapResponse *soapRes); + +void cg_soap_response_setcontent(CgSoapResponse *soapRes, CgXmlNode *node); +#define cg_soap_response_createcontent(soapRes) cg_soap_response_setcontent(soapRes, cg_soap_response_getenvelopenode(soapRes)) + +#define cg_soap_response_getstatuscode(soapRes) cg_http_response_getstatuscode(soapRes->httpRes) +#define cg_soap_response_issuccessful(soapRes) cg_http_response_issuccessful(soapRes->httpRes) + +/**** User Data ****/ +#define cg_soap_response_setuserdata(soapRes, value) (soapRes->userData = value) +#define cg_soap_response_getuserdata(soapRes) (soapRes->userData) + +/**************************************** +* Function +****************************************/ + +CgXmlNode *cg_soap_createenvelopebodynode(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/typedef.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/typedef.h new file mode 100644 index 0000000..2f28713 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/typedef.h @@ -0,0 +1,102 @@ +/****************************************************************** +* +* CyberGarage for C +* +* Copyright (C) Satoshi Konno 2005 +* +* File: typedef.h +* +* Revision: +* +* 01/17/05 +* - first revision +* 08/16/05 +* - Thanks for Theo Beisch +* - Added support for WindowsCE platform. +* 03/18/07 +* - Added CgInt64 to +* 06/24/07 +* - Added CgByte to +* 03/18/08 +* - Changed not to define BOOL type using XCode. +* 09/03/08 +* - Changed to include in on XCode as default. +* +******************************************************************/ + +#ifndef _CG_TYPEDEF_H_ +#define _CG_TYPEDEF_H_ + +#include +#include + +#if defined(WINCE) && !defined(WIN32) +#define WIN32 1 +#endif + +#if (defined(WIN32) || defined(__CYGWIN__)) && !defined (ITRON) +#include +#include +#elif defined(BTRON) || defined(TENGINE) +#include +#elif defined(ITRON) +#include +#endif + +#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) ) +#include +#endif + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Data Type +****************************************/ + +#if !defined(BOOL) && !defined(BTRON) && !defined(TENGINE) && !defined(__OBJC__) +typedef int BOOL; +#endif + +#if !defined(TRUE) +#if defined(__OBJC__) +#define TRUE YES +#else +#define TRUE (1) +#endif +#endif + +#if !defined(FALSE) +#if defined(__OBJC__) +#define FALSE NO +#else +#define FALSE (0) +#endif +#endif + +typedef unsigned char CgByte; + +#if defined(__USE_ISOC99) || defined(__GCC__) +typedef long long int CgInt64; +#define CG_USE_INT64 1 +#elif defined(HAVE_LONGLONG) +typedef long long CgInt64; +#define CG_USE_INT64 1 +#elif (defined(WIN32) || defined(WINCE)) +typedef __int64 CgInt64; +#define CG_USE_INT64 1 +#else +typedef long CgInt64; +#undef CG_USE_INT64 +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/caction.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/caction.h new file mode 100644 index 0000000..edce1be --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/caction.h @@ -0,0 +1,369 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: caction.h +* +* Revision: +* +* 02/23/05 +* - first revision +* +* 18-Jan-06 Heikki Junnila +* - Added API comments +* +******************************************************************/ + +#ifndef _CG_UPNP_CACTION_H_ +#define _CG_UPNP_CACTION_H_ + +#include +#include +#include +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_UPNP_ACTION_ELEM_NAME "action" +#define CG_UPNP_ACTIONLIST_ELEM_NAME "actionList" + +#define CG_UPNP_ACTION_NAME "name" + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgUpnpAction { + BOOL headFlag; + struct _CgUpnpAction *prev; + struct _CgUpnpAction *next; + void *parentService; + CgXmlNode *actionNode; + CgUpnpArgumentList *argumentList; + /**** Execution Data ****/ + BOOL (*listener)(struct _CgUpnpAction *); + CgUpnpStatus *upnpStatus; + void *userData; +} CgUpnpAction, CgUpnpActionList; + +typedef BOOL (*CG_UPNP_ACTION_LISTNER)(CgUpnpAction *); + +/**************************************************************************** + * Function (Action) + ****************************************************************************/ + +/** + * Create a new action + * + * @return CgUpnpAction* + */ +CgUpnpAction *cg_upnp_action_new(); + +/** + * Destroy an action + * + * @param action The action to destroy + */ +void cg_upnp_action_delete(CgUpnpAction *action); + +/** + * Get the next action in a list of actions. Use as an iterator. + * + * @param action The current action + */ +#define cg_upnp_action_next(action) (CgUpnpAction *)cg_list_next((CgList *)action) + +/** + * Check, whether the given XML node is an action node + * + * @param node The CgXmlNode* + */ +#define cg_upnp_action_isactionnode(node) cg_xml_node_isname(node, CG_UPNP_ACTION_ELEM_NAME) + +/**************************************************************************** + * XML Node + ****************************************************************************/ + +/** + * Set the action's XML node (i.e. the XML representation of the action) + * + * @param action The action in question + * @param node The CgXmlNode* + */ +void cg_upnp_action_setactionnode(CgUpnpAction *action, CgXmlNode *node); + +/** + * Get the action's XML node (i.e. the XML representation of the action) + * + * @param action The action in question + * @return CgXmlNode* + */ +#define cg_upnp_action_getactionnode(action) (action->actionNode) + +/**************************************************************************** + * Service + ****************************************************************************/ + +/** + * Set the action's parent service + * + * @param action The action in question + * @param service The action's parent service + */ +#define cg_upnp_action_setservice(action, service) (action->parentService = service) + +/** + * Get the action's parent service + * + * @param action The action in question + * @return CgUpnpService* + */ +#define cg_upnp_action_getservice(action) ((CgUpnpService *)action->parentService) + +/**************************************************************************** + * Name + ****************************************************************************/ + +/** + * Set the action's name + * + * @param action The action in question + * @param value The action's name + */ +#define cg_upnp_action_setname(action, value) cg_xml_node_setchildnode(cg_upnp_action_getactionnode(action), CG_UPNP_ACTION_NAME, value) + +/** + * Get the action's name + * + * @param action The action in question + * @return char* + */ +#define cg_upnp_action_getname(action) cg_xml_node_getchildnodevalue(cg_upnp_action_getactionnode(action), CG_UPNP_ACTION_NAME) + +/** + * Check, whether the action's name matches the one given as parameter. + * + * @param action The action in question + * @param name The name string to compare + */ +#define cg_upnp_action_isname(action, name) cg_streq(cg_upnp_action_getname(action), name) + +/**************************************************************************** + * Argument + ****************************************************************************/ + +/** + * Get the action's list of arguments + * + * @param action The action in question + * @return CgUpnpArgumentList* + */ +#define cg_upnp_action_getargumentlist(action) (action->argumentList) + +/** + * Get the first argument from the action's list of arguments. Use as the + * starting point in iteration loops. + * + * @param action The action in question + * @return CgUpnpArgument* + */ +#define cg_upnp_action_getarguments(action) ((CgUpnpArgument *)cg_list_next((CgList *)action->argumentList)) + +/** + * Find an argument from the action by the argument's name. + * + * @param action The action in question + * @param name The name of the argument to look for + * @return CgUpnpArgument* if successfull; otherwise NULL + */ +CgUpnpArgument *cg_upnp_action_getargumentbyname(CgUpnpAction *action, char *name); + +/** + * Find out, whether the action has an argument by the given name + * + * @param action The action in question + * @param name The name to look for + * @return TRUE if the action has the argument; otherwise FALSE + */ +#define cg_upnp_action_hasargumentbyname(action,name) ((cg_upnp_action_getargumentbyname(action,name) != NULL) ? TRUE : FALSE) + +/** + * Get a value of the specified argument from the action by the argument's name directly. + * + * @param action The action in question + * @param name The name of the argument to look for + * @return char* if successfull; otherwise NULL + */ +char *cg_upnp_action_getargumentvaluebyname(CgUpnpAction *action, char *name); + +/** + * Set a value of the specified argument from the action by the argument's name directly. + * + * @param action The action in question + * @param name The name of the argument to look for + * @param value The value to set + * @return TRUE if successfull; otherwise NO + */ +BOOL cg_upnp_action_setargumentvaluebyname(CgUpnpAction *action, char *name, char *value); + +/**************************************************************************** + * Function (Action - Execution Data) + ****************************************************************************/ + +/**************************************************************************** + * UPnPStatus + ****************************************************************************/ + +/** + * Set the action's latest status code + * + * @param action The action in question + * @param code The status code (int) + */ +#define cg_upnp_action_setstatuscode(action, code) cg_upnp_status_setcode(action->upnpStatus, code) + +/** + * Get the action's latest status code + * + * @param action The action in question + * @return int + */ +#define cg_upnp_action_getstatuscode(action) cg_upnp_status_getcode(action->upnpStatus) + +/** + * Set the action's latest status description + * + * @param action The action in question + * @param value The status description string + */ +#define cg_upnp_action_setstatusdescription(action, value) cg_upnp_status_setdescription(action->upnpStatus, value) + +/** + * Get the action's latest status description + * + * @param action The action in question + * @return char* + */ +#define cg_upnp_action_getstatusdescription(action) cg_upnp_status_getdescription(action->upnpStatus) + +/**************************************************************************** + * Listener + ****************************************************************************/ + +/** + * Set the action's listener function + * + * @param action The action in question + * @param func The listener function of type: BOOL (*CG_UPNP_ACTION_LISTNER)(CgUpnpAction *) + */ +#define cg_upnp_action_setlistener(action, func) (action->listener = func) + +/** + * Get the action's listener function + * + * @param action The action in question + * @return BOOL (*CG_UPNP_ACTION_LISTNER)(CgUpnpAction *) + */ +#define cg_upnp_action_getlistener(action) (action->listener) + +/** + * @deprecated Compatibility macro for typo correction + */ +#define cg_upnp_action_setlistner cg_upnp_action_setlistener + +/** + * @deprecated Compatibility macro for typo correction + */ +#define cg_upnp_action_getlistner cg_upnp_action_getlistener + +/**************************************************************************** + * User Data + ****************************************************************************/ + +/** + * Set the action's arbitrary user data pointer + * + * @param action The action in question + * @param value The user data pointer (void*) + */ +#define cg_upnp_action_setuserdata(action, value) (action->userData = value) + +/** + * Get the action's arbitrary user data pointer + * + * @param action The action in question + * @return void* + */ +#define cg_upnp_action_getuserdata(action) (action->userData) + +/**************************************************************************** + * Function (ActionList) + ****************************************************************************/ + +/** + * Create a new list of actions + * + * @return CgUpnpActionList* + */ +CgUpnpActionList *cg_upnp_actionlist_new(); + +/** + * Destroy a list of actions + * + * @param actionList The list of actions to destroy + */ +void cg_upnp_actionlist_delete(CgUpnpActionList *actionList); + +/** + * Clear the contents of a list of actions + * + * @param actionList The list of actions to clear + */ +#define cg_upnp_actionlist_clear(actionList) cg_list_clear((CgList *)actionList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_action_delete) + +/** + * Get the number of actions in a list of actions + * + * @param actionList The list in question + * @return int + */ +#define cg_upnp_actionlist_size(actionList) cg_list_size((CgList *)actionList) + +/** + * Get the first action in a list of actions. Use as the starting point in + * iteration loops. + * + * @param actionList The list in question + * @return CgUpnpAction* + */ +#define cg_upnp_actionlist_gets(actionList) (CgUpnpAction *)cg_list_next((CgList *)actionList) + +/** + * Add an action to a list of actions + * + * @param actionList The list in question + * @param action The action to add to the list + */ +#define cg_upnp_actionlist_add(actionList, action) cg_list_add((CgList *)actionList, (CgList *)action) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cargument.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cargument.h new file mode 100644 index 0000000..ef694f5 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cargument.h @@ -0,0 +1,362 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cargument.h +* +* Revision: +* +* 02/23/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CARGUMENT_H_ +#define _CG_UPNP_CARGUMENT_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/** Definition for argument element name */ +#define CG_UPNP_ARGUMENT_ELEM_NAME "argument" + +/** Definition for argument list element name */ +#define CG_UPNP_ARGUMENTLIST_ELEM_NAME "argumentList" + +/** Definition for argument passing direction (in) */ +#define CG_UPNP_ARGUMENT_IN_DIR "in" + +/** Definition for argument passing direction (out) */ +#define CG_UPNP_ARGUMENT_OUT_DIR "out" + +/** Definition for argument element name */ +#define CG_UPNP_ARGUMENT_NAME "name" + +/** Definition for argument element "direction" */ +#define CG_UPNP_ARGUMENT_DIRECTION "direction" + +/** Definition for argument related state variable */ +#define CG_UPNP_ARGUMENT_RELATED_STATE_VARIABLE "relatedStateVariable" + +/**************************************** +* Data Type +****************************************/ + +/** + * Data type definition for UPnP argument and UPnP argument list + */ +typedef struct _CgUpnpArgument { + BOOL headFlag; + struct _CgUpnpArgument *prev; + struct _CgUpnpArgument *next; + CgXmlNode *serviceNode; + CgXmlNode *argumentNode; + /**** Execution Data ****/ + CgString *value; +} CgUpnpArgument, CgUpnpArgumentList; + +/**************************************** +* Function (Argument) +****************************************/ + +/** + * Create new argument + */ +CgUpnpArgument *cg_upnp_argument_new(); + +/** + * Delete argument + * + * @param dev Argument + */ +void cg_upnp_argument_delete(CgUpnpArgument *dev); + +/** + * Get next argument using argument as iterator + * + * @param arg Argument node + */ +#define cg_upnp_argument_next(arg) (CgUpnpArgument *)cg_list_next((CgList *)arg) + +/** + * Check if XML node is argument node + * + * @param node XML node + * + * @return True if node is argument node, false otherwise + */ +#define cg_upnp_argument_isargumentnode(node) cg_xml_node_isname(node, CG_UPNP_ARGUMENT_ELEM_NAME) + +/** + * Set XML service node for argument + * + * @param arg Argument + * @param node XML service node + */ +#define cg_upnp_argument_setservicenode(arg,node) (arg->serviceNode = node) + +/** + * Get service node from argument + * + * @param arg Argument + */ +#define cg_upnp_argument_getservicenode(arg) (arg->serviceNode) + +/** + * Set XML argument node for argument + * + * @param arg Argument + * @param node XML argument node + */ +#define cg_upnp_argument_setargumentnode(arg,node) (arg->argumentNode = node) + +/** + * Get XML argument node from argument + * + * @param arg Argument + */ +#define cg_upnp_argument_getargumentnode(arg) (arg->argumentNode) + +/**** name ****/ + +/** + * Set name for argument + * + * @param arg Argument + * @param value Argument name + */ +#define cg_upnp_argument_setname(arg, value) cg_xml_node_setchildnode(cg_upnp_argument_getargumentnode(arg), CG_UPNP_ARGUMENT_NAME, value) + +/** + * Get argument name + * + * @param arg Argument + */ +#define cg_upnp_argument_getname(arg) cg_xml_node_getchildnodevalue(cg_upnp_argument_getargumentnode(arg), CG_UPNP_ARGUMENT_NAME) + +/** + * Check if current argument name matches with the provided name + * + * @param arg Argument + * @param name Name matched with argument name + * + * @return True if argument name equals with the provided name, false otherwise + */ +#define cg_upnp_argument_isname(arg, name) cg_streq(cg_upnp_argument_getname(arg), name) + +/**** direction ****/ + +/** + * Set direction for argument + * + * @param arg Argument + * @param value New direction value + */ +#define cg_upnp_argument_setdirection(arg, value) cg_xml_node_setchildnode(cg_upnp_argument_getargumentnode(arg), CG_UPNP_ARGUMENT_DIRECTION, value) + +/** + * Get argument direction + * + * @param arg Argument + * + * @return Argument direction + */ +#define cg_upnp_argument_getdirection(arg) cg_xml_node_getchildnodevalue(cg_upnp_argument_getargumentnode(arg), CG_UPNP_ARGUMENT_DIRECTION) + +/** + * Check if argument direction is "in" + * + * @param arg Argument + * + * @return True if argument directon is "in" + */ +#define cg_upnp_argument_isindirection(arg) cg_streq(cg_upnp_argument_getdirection(arg), CG_UPNP_ARGUMENT_IN_DIR) + +/** + * Check if argument direction is "out" + * + * @param arg Argument + * + * @return True if argument direction is "out" + */ +#define cg_upnp_argument_isoutdirection(arg) cg_streq(cg_upnp_argument_getdirection(arg), CG_UPNP_ARGUMENT_OUT_DIR) + +/**** relatedStateVariable ****/ + +/** + * Set related state variable + * + * @param arg Argument + * @param value Related state variable name + */ +#define cg_upnp_argument_setrelatedstatevariable(arg, value) cg_xml_node_setchildnode(cg_upnp_argument_getargumentnode(arg), CG_UPNP_ARGUMENT_RELATED_STATE_VARIABLE, value) + +/** + * Get related state variable + * + * @param arg Argument + * + * @return String representing the related state variable + */ +#define cg_upnp_argument_getrelatedstatevariable(arg) cg_xml_node_getchildnodevalue(cg_upnp_argument_getargumentnode(arg), CG_UPNP_ARGUMENT_RELATED_STATE_VARIABLE) + +/**************************************** +* Function (Argument - Execution Data) +****************************************/ + +/**** value ****/ + +/** + * Set argument value + * + * @param arg Argument + * @param data Argument value + */ +#define cg_upnp_argument_setvalue(arg,data) cg_string_setvalue(arg->value, data) + +/** + * Get argument value + * + * @param arg Argument + * + * @return Argument value + */ +#define cg_upnp_argument_getvalue(arg) cg_string_getvalue(arg->value) + +/** + * Set argument value + * + * @param arg Argument + * @param data Argument value + */ +#define cg_upnp_argument_setintvalue(arg,data) cg_string_setintvalue(arg->value, data) + +/** + * Get argument value + * + * @param arg Argument + * + * @return Argument value + */ +#define cg_upnp_argument_getintvalue(arg) cg_string_getintvalue(arg->value) + +/** + * Set argument value + * + * @param arg Argument + * @param data Argument value + */ +#define cg_upnp_argument_setfloatvalue(arg,data) cg_string_setfloatvalue(arg->value, data) + +/** + * Get argument value + * + * @param arg Argument + * + * @return Argument value + */ +#define cg_upnp_argument_getfloatvalue(arg) cg_string_getfloatvalue(arg->value) + +/** + * Set argument value + * + * @param arg Argument + * @param data Argument value + */ +#define cg_upnp_argument_setdoublevalue(arg,data) cg_string_setdoublevalue(arg->value, data) + +/** + * Get argument value + * + * @param arg Argument + * + * @return Argument value + */ +#define cg_upnp_argument_getdoublevalue(arg) cg_string_getdoublevalue(arg->value) + +/**************************************** +* Function (ArgumentList) +****************************************/ + +/** + * Create new argument list + */ +CgUpnpArgumentList *cg_upnp_argumentlist_new(); + +/** + * Delete argument list + * + * @param argumentList Argument list + */ +void cg_upnp_argumentlist_delete(CgUpnpArgumentList *argumentList); + +/** + * Clear argument list + * + * @param argList Argument list + */ +#define cg_upnp_argumentlist_clear(argList) cg_list_clear((CgList *)argList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_argument_delete) + +/** + * Get argument list size + * + * @param argList Argument list + */ +#define cg_upnp_argumentlist_size(argList) cg_list_size((CgList *)argList) + +/** + * Get next argument from argument list + * + * @param argList Argument list + */ +#define cg_upnp_argumentlist_gets(argList) (CgUpnpArgument *)cg_list_next((CgList *)argList) + +/** + * Add argument into argument list + * + * @param argList Argument list + * @param arg Argument + */ +#define cg_upnp_argumentlist_add(argList, arg) cg_list_add((CgList *)argList, (CgList *)arg) + +/** + * Get argument from argument list based on argument name + * + * @param argumentList argumentList + * @param name Argument name + * + * @return Argument + */ +CgUpnpArgument *cg_upnp_argumentlist_get(CgUpnpArgumentList *argumentList, char *name); + +/** + * Set argument values by using source argument list. If there is an argument with the + * name in argument list and source argument list argument data is set from source + * argument list to the matching argument list. + * + * @param argumentList Argument list + * @param srcArgumentList Source argument list + */ +void cg_upnp_argumentlist_set(CgUpnpArgumentList *argumentList, CgUpnpArgumentList *srcArgumentList); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/ccontrolpoint.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/ccontrolpoint.h new file mode 100644 index 0000000..b720493 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/ccontrolpoint.h @@ -0,0 +1,716 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: ccontrolpoint.h +* +* Revision: +* +* 05/25/05 +* - first revision +* +* 11-Jan-06 Heikki Junnila +* - Removed cg_upnp_device_isname and _getbyname because +* according to UPnP specs UDN, type or friendlyname is +* not the same as the device's name. +* - Added cg_upnp_controlpoint_getdevicebyudn() +* 04/02/06 Theo Beisch +* - added support for resubscriber +* and device disposer +* - added cg_upnp_controlpoint_getservicebysid +* - added cg_upnp_controlpoint_waitforlock +* 22-Apr-2008 +* - Added cg_upnp_controlpoint_getdevice() to get a device by the index. +* +******************************************************************/ + +#ifndef _CG_UPNP_CCONTROLPOINT_H_ +#define _CG_UPNP_CCONTROLPOINT_H_ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/** Definition for SSDP default search MX */ +#define CG_UPNP_CONTROLPOINT_SSDP_DEFAULT_SEARCH_MX 3 + +/** Definition for control point SSDP minimum delay */ +#define CG_UPNP_CONTROLPOINT_SSDP_MIN_DELAY 20 + +/** Definition for control point default response port */ +#define CG_UPNP_CONTROLPOINT_SSDP_RESPONSE_DEFAULT_PORT 39400 + +/** Definition for numeric constant to specify the max tries to open a SSDP Response Port (rosfran.borges) */ +#define CG_UPNP_CONTROLPOINT_SSDP_RESPONSE_PORT_MAX_TRIES_INDEX 80 + +/** Definition for HTTP event default port */ +#define CG_UPNP_CONTROLPOINT_HTTP_EVENT_DEFAULT_PORT 39500 + +/** Definition for default controlpoint event callback "location" */ +#define CG_UPNP_CONTROLPOINT_HTTP_EVENTSUB_URI "/eventSub" + +/**************************************** +* Data Type +****************************************/ + +/** + * Device listener status parameters. + * + * @ref CgUpnpDeviceStatusAdded means a device has been added to local cache. + * @ref CgUpnpDeviceStatusUpdated means a device description has been updated + * because its IP address or description has changed. The user should renew + * any active subscriptions if this has been received. + * + * @ref CgUpnpDeviceStatusInvalid is basically the same as @ref CgUpnpDeviceStatusRemoved, + * but @ref CgUpnpDeviceStatusRemoved is sent only when a device leaves the + * network in a proper way (i.e. with UPnP ByeBye messages). The user should + * immediately cease using the device, because it will be removed in both cases. + */ +typedef enum _CgUpnpDeviceStatus +{ + CgUpnpDeviceStatusAdded = 0, + CgUpnpDeviceStatusUpdated, + CgUpnpDeviceStatusInvalid, + CgUpnpDeviceStatusRemoved +} CgUpnpDeviceStatus; + +/** + * Prototype for control point's device listener callback. + * + * @param udn The UDN of the device, that the status update concerns + * @param status The new status + */ + +typedef struct _CgUpnpControlPoint { + CgMutex *mutex; + CgXmlNodeList *deviceRootNodeList; + CgUpnpDeviceList *deviceList; + CgUpnpSSDPServerList *ssdpServerList; + CgUpnpSSDPResponseServerList *ssdpResServerList; + CgHttpServerList *httpServerList; + void (*deviceListener)(struct _CgUpnpControlPoint *, char*, CgUpnpDeviceStatus); /* CG_UPNP_DEVICE_LISTENER */ + CG_HTTP_LISTENER httpListener; + CG_UPNP_SSDP_LISTNER ssdpListener; + CG_UPNP_SSDP_RESPONSE_LISTNER ssdpResListener; + CgUpnpEventListenerList* eventListeners; + int ssdpResPort; + CgString *httpEventURI; + int httpEventPort; + int ssdpSearchMx; + void *userData; + + /* Expiration handling */ + CgThread *expThread; + CgMutex *expMutex; + CgCond *expCond; + + /** List of cached interfaces */ + CgNetworkInterfaceList *ifCache; +} CgUpnpControlPoint; + +typedef void (*CG_UPNP_DEVICE_LISTENER)(CgUpnpControlPoint *ctrlPoint, char* udn, CgUpnpDeviceStatus status); + +/**************************************************************************** + * Control Point top-level control + ****************************************************************************/ + +/** + * Create a new control point. Does not start any threads. + * + * @return A newly-created CgUpnpControlPoint + */ +CgUpnpControlPoint *cg_upnp_controlpoint_new(); + +/** + * Destroy the given control point + * + * @param ctrlPoint The control point struct to destroy + */ +void cg_upnp_controlpoint_delete(CgUpnpControlPoint *ctrlPoint); + +/** + * Activate the control point. Starts listening for SSDP messages etc. + * You must call this function before you can actually use a control point. + * + * @param ctrlPoint The control point to start + * + * @return TRUE if successful; otherwise FALSE + * + */ +BOOL cg_upnp_controlpoint_start(CgUpnpControlPoint *ctrlPoint); + +/** + * Stop the control point. Stops sending/receiveing/responding to any messages. + * + * @param ctrlPoint The control point to stop + * + * @return TRUE if successful; otherwise FALSE + * + */ +BOOL cg_upnp_controlpoint_stop(CgUpnpControlPoint *ctrlPoint); + +/** +* Check if the control point is activated. +* +* @param ctrlPoint The control point to stop +* +* @return TRUE if running; otherwise FALSE +* +*/ +BOOL cg_upnp_controlpoint_isrunning(CgUpnpControlPoint *ctrlPoint); + +/**************************************************************************** + * Control Point locking + ****************************************************************************/ + +/** + * Lock the control point's mutex. + * The control point should be ALWAYS locked, when a CgUpnpDevice*, + * CgUpnpService*, CgUpnpAction* or other pointer has been taken into use from + * the stack. This effectively prevents devices/services from being updated/ + * removed or added while the control point is locked. You should release the + * lock as soon as possible with @ref cg_upnp_controlpoint_unlock + * + * @note Do NOT save any CgUpnp* pointers to user-space variables. Use them + * only as local variables (inside one function) after gaining a mutex lock. + * Release the lock as soon as you are done accessing the pointer, and then + * discard the pointer immediately. + * + * @param ctrlPoint The control point in question + */ + +#if defined(WITH_THREAD_LOCK_TRACE) && defined(__USE_ISOC99) +#define cg_upnp_controlpoint_lock(ctrlPoint) cg_mutex_lock_trace(__FILE__, __LINE__, __PRETTY_FUNCTION__, ctrlPoint->mutex) +#else +BOOL cg_upnp_controlpoint_lock(CgUpnpControlPoint *ctrlPoint); +#endif +/** + * Release a previously locked control point mutex. + * See @ref cg_upnp_controlpoint_lock for a more detailed description on + * the control point locking mechanism. + * + * @param ctrlPoint The control point in question + */ +#if defined(WITH_THREAD_LOCK_TRACE) && defined(__USE_ISOC99) +#define cg_upnp_controlpoint_unlock(ctrlPoint) cg_mutex_unlock_trace(__FILE__, __LINE__, __PRETTY_FUNCTION__, ctrlPoint->mutex) +#else +BOOL cg_upnp_controlpoint_unlock(CgUpnpControlPoint *ctrlPoint); +#endif + +/**************************************************************************** + * Device searching + ****************************************************************************/ + +/** + * Find a device from the control point by the exact type of the device. + * This function searches for devices, whose *complete type string* + * matches the given string, including version number. For example: + * "urn:schemas-upnp-org:device:FooDevice:1". If you need to disregard + * the version, use @ref cg_upnp_controlpoint_getdevicebytype + * + * @param ctrlPoint Controlpoint in question + * @param exacttype Type of the device + * + */ +CgUpnpDevice *cg_upnp_controlpoint_getdevicebyexacttype(CgUpnpControlPoint *ctrlPoint, + char *exacttype); + +/** + * Find a device from the controlpoint by the type of the device. + * This function searches for devices, whose *type part* (i.e. not including + * the version) of the device type string matches the given string. + * For example: "urn:schemas-upnp-org:device:FooDevice". If you need + * to know the version of a device, use @ref cg_upnp_devicetype_getversion + * + * @param ctrlPoint Controlpoint in question + * @param type Type of the device + * + */ +CgUpnpDevice *cg_upnp_controlpoint_getdevicebytype(CgUpnpControlPoint *ctrlPoint, + char *type); + +/** + * Find a device from the controlpoint by the UDN of the device. + * + * @param ctrlPoint Controlpoint in question + * @param type Type of the device + * + */ +CgUpnpDevice *cg_upnp_controlpoint_getdevicebyudn(CgUpnpControlPoint *ctrlPoint, + char *udn); + +/**************************************************************************** + * SSDP response + ****************************************************************************/ + +/** + * Get the list of SSDP servers associated to the control point + * + * @param ctrlPoint The control point in question + */ +#define cg_upnp_controlpoint_getssdpserverlist(ctrlPoint) (ctrlPoint->ssdpServerList) + +/** + * Get the list of SSDP response servers associated to the control point + * + * @param ctrlPoint The control point in question + */ +#define cg_upnp_controlpoint_getssdpresponseserverlist(ctrlPoint) (ctrlPoint->ssdpResServerList) + +/** + * Get the list of HTTP servers associated to the control point + * + * @param ctrlPoint The control point in question + */ +#define cg_upnp_controlpoint_gethttpserverlist(ctrlPoint) (ctrlPoint->httpServerList) + +/**************************************************************************** + * SSDP listener + ****************************************************************************/ + +/** + * Set an SSDP message listener for the control point. Use this function to + * get SSDP messages to user-space applications. + * + * @param ctrlPoint The control point in question + * @param func A callback function that is of type @ref CG_UPNP_SSDP_LISTNER + */ +#define cg_upnp_controlpoint_setssdplistener(ctrlPoint, func) (ctrlPoint->ssdpListener = func) + +/** + * Get the SSDP message listener for the control point. + * + * @param ctrlPoint The control point in question + * @return A callback function that is of type @ref CG_UPNP_SSDP_LISTNER or NULL + */ +#define cg_upnp_controlpoint_getssdplistener(ctrlPoint) (ctrlPoint->ssdpListener) + +/** + * Set an SSDP response listener for the control point. Use this function to + * get SSDP responses to user-space applications. + * + * @param ctrlPoint The control point in question + * @param func A callback function that is of type @ref CG_UPNP_SSDP_RESPONSE_LISTNER + */ +#define cg_upnp_controlpoint_setssdpresponselistener(ctrlPoint, func) (ctrlPoint->ssdpResListener = func) + +/** + * Get the SSDP response listener for the control point. + * + * @param ctrlPoint The control point in question + * @return A callback function that is of type @ref CG_UPNP_SSDP_RESPONSE_LISTNER or NULL + */ +#define cg_upnp_controlpoint_getssdpresponselistener(ctrlPoint) (ctrlPoint->ssdpResListener) + +/** + * Set device listener for the control point. + * + * @param ctrlPoint The control point + * @param func A callback function that is type @ref CG_UPNP_DEVICE_LISTENER or NULL + */ +#define cg_upnp_controlpoint_setdevicelistener(ctrlPoint, func) (ctrlPoint->deviceListener = func) + +/** + * Get the device listener for the control point. + * + * @param ctrlPoint The control point in question + * @return A callback function that is of type @ref CG_UPNP_DEVICE_LISTENER or NULL + */ +#define cg_upnp_controlpoint_getdevicelistener(ctrlPoint) (ctrlPoint->deviceListener) + +/**************************************************************************** + * Event listening + ****************************************************************************/ + +/** + * Set an event listener for the control point. Use this function to + * get event notifications to user-space applications. + * + * @param ctrlPoint The control point in question + * @param listener A callback function that is of type @ref CG_UPNP_EVENT_LISTENER + */ +#define cg_upnp_controlpoint_addeventlistener(ctrlPoint, listener) (cg_upnp_eventlistenerlist_add(ctrlPoint->eventListeners, listener)) + +/** + * Remove an event listener from the control point. + * + * @param ctrlPoint The control point in question + * @param listener The callback function to remove, that is of type @ref CG_UPNP_EVENT_LISTENER + */ +#define cg_upnp_controlpoint_removeeventlistener(ctrlPoint, listener) (cg_upnp_eventlistenerlist_remove(ctrlPoint->eventListeners, listener)) + +/** + * Set a single event listener for the control point. Use this function to + * get event notifications to user-space applications if you need only one listener. + * + * @param ctrlPoint The control point in question + * @param evlistener The callback function to set, that is of type @ref CG_UPNP_EVENT_LISTENER, or NULL + */ +#define cg_upnp_controlpoint_seteventlistener(ctrlPoint, evlistener) \ + do {\ + if (evlistener == NULL) \ + cg_upnp_eventlistenerlist_remove(ctrlPoint->eventListeners, ctrlPoint->eventListeners->next->listener); \ + else \ + cg_upnp_eventlistenerlist_add(ctrlPoint->eventListeners, evlistener); \ + } while(0) + +/** + * Get the single event listener for the control point. + * + * @param ctrlPoint The control point in question + * @return The callback function, that is of type @ref CG_UPNP_EVENT_LISTENER, + * or NULL if there is no listener + */ +#define cg_upnp_controlpoint_geteventlistener(ctrlPoint) (ctrlPoint->eventListeners->next->listener) + +/** + * Get the list of event listeners for the control point. + * + * @param ctrlPoint The control point in question + * @return List of @ref CG_UPNP_EVENT_LISTENER functions + */ +#define cg_upnp_controlpoint_geteventlisteners(ctrlPoint) (ctrlPoint->eventListeners) + +/**************************************************************************** + * SSDP Response port + ****************************************************************************/ + +/** + * Set the IP port number used for the control point's SSDP responses + * + * @param ctrlPoint The control point in question + * @param port The IP port number + */ +#define cg_upnp_controlpoint_setssdpresponseport(ctrlPoint, port) (ctrlPoint->ssdpResPort = port) + +/** + * Get the IP port number used for the control point's SSDP responses + * + * @param ctrlPoint The control point in question + */ +#define cg_upnp_controlpoint_getssdpresponseport(ctrlPoint) (ctrlPoint->ssdpResPort) + +/**************************************************************************** + * Eventing + ****************************************************************************/ + +/** + * Set the IP port number for the control point's event reception + * + * @param ctrlPoint The control point in question + * @param port The IP port number + */ +#define cg_upnp_controlpoint_seteventport(ctrlPoint, port) (ctrlPoint->httpEventPort = port) + +/** + * Get the IP port number for the control point's event reception + * + * @param ctrlPoint The control point in question + */ +#define cg_upnp_controlpoint_geteventport(ctrlPoint) (ctrlPoint->httpEventPort) + +/** + * Set the URI used for the control point's event subscription notifications + * + * @param ctrlPoint The control point in question + * @param uri The URI to set + */ +#define cg_upnp_controlpoint_seteventsuburi(ctrlPoint, uri) cg_string_setvalue(ctrlPoint->httpEventURI, uri) + +/** + * Get the URI used for the control point's event subscription notifications + * + * @param ctrlPoint The control point in question + */ +#define cg_upnp_controlpoint_geteventsuburi(ctrlPoint) cg_string_getvalue(ctrlPoint->httpEventURI) + +/**************************************************************************** + * M-SEARCH + ****************************************************************************/ + +/** + * Do an M-SEARCH to look for devices in the network. + * + * @param ctrlPoint The control point in question + * @param target The Search Target parameter (ex. "ssdp:all") + */ +BOOL cg_upnp_controlpoint_search(CgUpnpControlPoint *ctrlPoint, char *target); + +/** + * Set the MX-parameter used for SSDP searches i.e. Set the time to wait + * (in seconds) for device responses to an M-SEARCH + * + * @param ctrlPoint The control point in question + * @param value MX; Time to wait + */ +#define cg_upnp_controlpoint_setssdpsearchmx(ctrlPoint, value) (ctrlPoint->ssdpSearchMx = value) + +/** + * Get the MX-parameter used for SSDP searches + * + * @param ctrlPoint The control point in question + * @return value MX; Time to wait + */ +#define cg_upnp_controlpoint_getssdpsearchmx(ctrlPoint) (ctrlPoint->ssdpSearchMx) + +/**************************************************************************** + * HTTP listener + ****************************************************************************/ + +/** + * Set an HTTP listener function to the control point. Use this function to + * get HTTP requests to user-space applications. + * + * @param ctrlPoint The control point in question + * @param func The listener function, that is of type @ref CG_HTTP_LISTENER + */ +#define cg_upnp_controlpoint_sethttplistener(ctrlPoint, func) (ctrlPoint->httpListener = func) + +/** + * Get the HTTP listener function for the control point. + * + * @param ctrlPoint The control point in question + * @return The listener function, that is of type @ref CG_HTTP_LISTENER + */ +#define cg_upnp_controlpoint_gethttplistener(ctrlPoint) (ctrlPoint->httpListener) + +/** + * The function that calls all HTTP listener callback functions. Do not call + * this from applications. + * + * @param httpReq The received HTTP request + */ +void cg_upnp_controlpoint_httprequestreceived(CgHttpRequest *httpReq); + +/** + * When an event is received, update also the associated service's + * state table to include the evented state variable. + * + * @param service The service, whose state table to update + * @param prop The evented property from which to update + */ +void cg_upnp_controlpoint_updatestatetablefromproperty(CgUpnpService* service, + CgUpnpProperty* prop); + +/**************************************************************************** + * User Data + ****************************************************************************/ + +/** + * Set the user data pointer (arbitrary user data) to the control point. + * + * @param ctrlPoint The control point in question + * @param value Arbitrary user data + */ +#define cg_upnp_controlpoint_setuserdata(ctrlPoint, value) (ctrlPoint->userData = value) + +/** + * Get the user data pointer (arbitrary user data) from the control point. + * + * @param dev The control point in question + * @return Pointer to user data or NULL + */ +#define cg_upnp_controlpoint_getuserdata(ctrlPoint) (ctrlPoint->userData) + +/**************************************************************************** + * Service SCPD + ****************************************************************************/ + +/** + * Parse the service description from the service's SCPD URL. Do not call + * this from user applications. + * + * @param service The service in question + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_parsescservicescpd(CgUpnpService *service); + +/** + * Parse the device's services using the received SSDP packet. Do not call this + * from user applications. + * + * @param dev The device in question + * @param ssdpPkt An SSDP packet + */ +BOOL cg_upnp_controlpoint_parseservicesfordevice(CgUpnpDevice *dev, CgUpnpSSDPPacket *ssdpPkt); + +/**************************************************************************** + * Device adding/removal by SSDP packets + ****************************************************************************/ + +/** + * Add a device on the basis of an SSDP packet. Do not call this from user + * applications. + * + * @param ctrlPoint The control point, whose device list to handle + * @param ssdpPkt The received SSDP packet + */ +void cg_upnp_controlpoint_adddevicebyssdppacket(CgUpnpControlPoint *ctrlPoint, + CgUpnpSSDPPacket *ssdpPkt); + +/** + * Remove a device on the basis of an SSDP packet. Do not call this from user + * applications. + * + * @param ctrlPoint The control point, whose device list to handle + * @param ssdpPkt The received SSDP packet + */ +void cg_upnp_controlpoint_removedevicebyssdppacket(CgUpnpControlPoint *ctrlPoint, + CgUpnpSSDPPacket *ssdpPkt); + +/**************************************** + * Subscription + ****************************************/ + +/** + * Subscribe to a service's events + * + * @param ctrlPoint The control point in use + * @param service The service to subscribe to + * @param timeout Timeout for subscription expiration/renewal + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_subscribe(CgUpnpControlPoint *ctrlPoint, CgUpnpService *service, long timeout); + +/** + * Re-subscribe to a service's events (i.e. renew subscription) + * + * @param ctrlPoint The control point in use + * @param service The service to subscribe to + * @param timeout Timeout for subscription expiration/renewal + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_resubscribe(CgUpnpControlPoint *ctrlPoint, CgUpnpService *service, long timeout); + +/** + * Unsubscribe to a service's events (i.e. cancel subscription) + * + * @param ctrlPoint The control point in use + * @param service The service to unsubscribe to + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_unsubscribe(CgUpnpControlPoint *ctrlPoint, CgUpnpService *service); + +/** + * Subscribe to all of the device's services' events + * + * @param ctrlPoint The control point in use + * @param dev The device to subscribe to + * @param timeout Timeout for subscription expiration/renewal + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_subscribeall(CgUpnpControlPoint *ctrlPoint, CgUpnpDevice *dev, long timeout); + +/** + * Re-subscribe to all of the device's services' events (i.e. renew subscription) + * + * @param ctrlPoint The control point in use + * @param dev The device to subscribe to + * @param timeout Timeout for subscription expiration/renewal + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_resubscribeall(CgUpnpControlPoint *ctrlPoint, CgUpnpDevice *dev, long timeout); + +/** + * Unsubscribe to all of the device's services' events (i.e. cancel subscription) + * + * @param ctrlPoint The control point in use + * @param dev The device to unsubscribe to + * @return TRUE if successful; otherwise FALSE + */ +BOOL cg_upnp_controlpoint_unsubscribeall(CgUpnpControlPoint *ctrlPoint, CgUpnpDevice *dev); + +/**************************************** + * Function (DeviceList) + ****************************************/ + +/** + * Get the head of the control point's list of devices (use for iteration) + * + * @param ctrlPoint The control point in use + * @return The head of the device list + */ +#define cg_upnp_controlpoint_getdevices(ctrlPoint) cg_upnp_devicelist_gets(ctrlPoint->deviceList) + +/** + * Get the number of devices known by the control point + * + * @param ctrlPoint The control point in use + * @return The number of devices in the control point's device list + */ +#define cg_upnp_controlpoint_getndevices(ctrlPoint) cg_upnp_devicelist_size(ctrlPoint->deviceList) + +/** + * Get the head of the control point's list of devices (use for iteration) + * + * @param ctrlPoint The control point in use + * @param index The index of the device to get + * @return The specified device + */ +#define cg_upnp_controlpoint_getdevice(ctrlPoint, index) cg_upnp_devicelist_get(ctrlPoint->deviceList, index) + +/** + * Add a device to the control point's list of devices. Do not call this from + * user applications. + * + * @param ctrlPoint The control point in use + * @param dev The device to add + */ +#define cg_upnp_controlpoint_adddevice(ctrlPoint, dev) cg_upnp_devicelist_add(ctrlPoint->deviceList, dev) + +/**************************************** + * Environment handling + ****************************************/ + +/** + * Worker thread for handling expirations. + * + * \param thread the thread in question + */ +void cg_upnp_controlpoint_expirationhandler(CgThread *thread); + +/** + * Notify the control point that any IP of the host has been changed. + * + * \param ctrlpoint The control point in use + * \return success of changing used interfaces + */ +BOOL cg_upnp_controlpoint_ipchanged(CgUpnpControlPoint *ctrlpoint); + + +/** + * Get the event subscription callback URI + * + * @param ctrlPoint The control point in question + */ +char *cg_upnp_controlpoint_geteventsubcallbackurl(CgUpnpControlPoint *ctrlPoint, char *ifaddr, char *buf, int bufLen); + +#ifdef __cplusplus +} +#endif + +#endif /* _CG_UPNP_CCONTROLPOINT_H_ */ diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cdevice.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cdevice.h new file mode 100644 index 0000000..e47ca6d --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cdevice.h @@ -0,0 +1,1539 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cdevice.h +* +* Revision: +* +* 02/14/05 +* - first revision +* +* 10/31/05 +* - Added comments to all functions and structs +* +* 01/09/06 Heikki Junnila +* - Added cg_upnp_device_getservicebytype() to enable +* searching for services without version information. +* +* 10-Jan-06 Heikki Junnila +* - Renamed cg_upnp_device_getservicebyname to +* cg_upnp_device_getservicebyexacttype and created a compat +* macro for _getservicebyname +* +* 11-Jan-06 Heikki Junnila +* - Removed cg_upnp_device_isname and _getbyname because +* according to UPnP specs UDN, type or friendlyname is +* not the same as the device's name. +* - Added cg_upnp_device_getdevicebyudn() +* 04/03/06 Theo Beisch +* - Added cg_upnp_device_getservicebysid +* - changed leasetime and timer to type CgSysTime +* - added cg_upnp_device_waitforlock (nonblocking) +* 22-Apr-2008 +* - Added cg_upnp_device_getnservices() and cg_upnp_device_getservice() to get a device by the index. +* +******************************************************************/ + +#ifndef _CG_UPNP_CDEVICE_H_ +#define _CG_UPNP_CDEVICE_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** + * Value macros + ****************************************/ + +/** Definition for device XML element name */ +#define CG_UPNP_DEVICE_ELEM_NAME "device" + +/** Definition for device XML element list name */ +#define CG_UPNP_DEVICELIST_ELEM_NAME "deviceList" + +/** Definition for UPnP rootdevice ID */ +#define CG_UPNP_DEVICE_UPNP_ROOTDEVICE "upnp:rootdevice" + +/** Definition for default device start up wait time */ +#define CG_UPNP_DEVICE_DEFAULT_STARTUP_WAIT_TIME 1000 + +/** Definition for default device discovery wait time */ +#define CG_UPNP_DEVICE_DEFAULT_DISCOVERY_WAIT_TIME 500 + +/** Definition for default device lease time */ +#define CG_UPNP_DEVICE_DEFAULT_LEASE_TIME (30 * 60) + +/** Definition for default device HTTP port */ +#define CG_UPNP_DEVICE_HTTP_DEFAULT_PORT 38400 + +/** Definition for default description file "location" */ +#define CG_UPNP_DEVICE_DEFAULT_DESCRIPTION_URI "/description.xml" + +/** Definition for maximum URL base length */ +#define CG_UPNP_DEVICE_URLBASE_MAXLEN 64 + +/** Definition for M-SEARCH filter interval */ +#define CG_UPNP_DEVICE_M_SEARCH_FILTER_INTERVAL 15 + +/** Definition for urlbase XML element name */ +#define CG_UPNP_DEVICE_URLBASE_NAME "URLBase" + +/** Definition for device type XML element name */ +#define CG_UPNP_DEVICE_DEVICE_TYPE "deviceType" + +/** Definition for device friendly name XML element name */ +#define CG_UPNP_DEVICE_FRIENDLY_NAME "friendlyName" + +/** Definition for device manufacturer XML element name */ +#define CG_UPNP_DEVICE_MANUFACTURER "manufacturer" + +/** Definition for manufacturer URL XML element name */ +#define CG_UPNP_DEVICE_MANUFACTURER_URL "manufacturerURL" + +/** Definition for device model description XML element name */ +#define CG_UPNP_DEVICE_MODEL_DESCRIPTION "modelDescription" + +/** Definition fo device model name XML element name */ +#define CG_UPNP_DEVICE_MODEL_NAME "modelName" + +/** Definition for device model number XML element name */ +#define CG_UPNP_DEVICE_MODEL_NUMBER "modelNumber" + +/** Definition for device model URL XML element name */ +#define CG_UPNP_DEVICE_MODEL_URL "modelURL" + +/** Definition for device serial number XML element name */ +#define CG_UPNP_DEVICE_SERIAL_NUMBER "serialNumber" + +/** Definition for device UDN XML element name */ +#define CG_UPNP_DEVICE_UDN "UDN" + +/** Definition for device UPC XML element name */ +#define CG_UPNP_DEVICE_UPC "UPC" + +/** Definition for device presentation URL XML element name */ +#define CG_UPNP_DEVICE_PRESENTATION_URL "presentationURL" + +/**************************************** + * Data Type + ****************************************/ + +/** + * \brief The generic UPnP device structure + * + * \note This struct can also be cast to a CgList* and used as a node in a + * linked list with cg_list_* functions. + */ +typedef struct _CgUpnpDevice +{ + /** Used by cg_list_* functions to indicate start of list */ + BOOL headFlag; + /** Used by cg_list_* functions to point to the previous item in list */ + struct _CgUpnpDevice *prev; + /** Used by cg_list_* functions to point to the next item in list */ + struct _CgUpnpDevice *next; + + /** List of XML root nodes */ + CgXmlNodeList *rootNodeList; + /** This device's description XML node */ + CgXmlNode *deviceNode; + + /** This device's parent device */ + struct _CgUpnpDevice *parentDevice; + /** List of devices */ + struct _CgUpnpDevice *deviceList; + /** List of services */ + struct _CgUpnpService *serviceList; + /** List of icons */ + struct _CgUpnpIcon *iconList; + + /** Mutex used in multithreading */ + CgMutex *mutex; + /** List of HTTP servers */ + CgHttpServerList *httpServerList; + /** List of SSDP servers */ + CgUpnpSSDPServer *ssdpServerList; + /** Device advertiser thread */ + CgThread *advertiser; + + /** HTTP request listener */ + CG_HTTP_LISTENER httpListener; + + /** URI for this device's description */ + CgString *descriptionURI; + /** Advertisement lease time */ + CgSysTime leaseTime; + /** HTTP Port to listen to */ + int httpPort; + /** This device's SSDP packet */ + CgUpnpSSDPPacket *ssdpPkt; + /** User data used to pass miscellaneous data */ + void *userData; + + /* List of cached interfaces */ + CgNetworkInterfaceList *ifCache; +} CgUpnpDevice, CgUpnpDeviceList; + +/**************************************** + * Function (Device) + ****************************************/ + +/** + * Create a new UPnP device + */ +CgUpnpDevice *cg_upnp_device_new(); + +/** + * Delete a UPnP device + * + * \param dev Device in question + */ +void cg_upnp_device_delete(CgUpnpDevice *dev); + +/** + * Clear a UPnP device structure. This is an internal function and should not be called from outside. + * + * \param dev Device in question + */ +void cg_upnp_device_clear(CgUpnpDevice *dev); + +/** + * Get the next device in the device list. Use as an iterator. + * + * \param dev Current device + */ +#define cg_upnp_device_next(dev) (CgUpnpDevice *)cg_list_next((CgList *)dev) + +/** + * Remove the device from the device list. + * + * \param dev Device in question + */ +#define cg_upnp_device_remove(dev) cg_list_remove((CgList *)dev) + +/** + * Check whether the given node is of type CG_UPNP_DEVICE_ELEM_NAME + * + * \param node CgXmlAttribute + */ +#define cg_upnp_device_isdevicenode(node) cg_xml_node_isname(node, CG_UPNP_DEVICE_ELEM_NAME) + +/** + * Return the device's root node + * \todo Correct explanation... + * + * \param dev Device in question + */ +#define cg_upnp_device_getrootnode(dev) cg_xml_nodelist_gets(dev->rootNodeList) + +/** + * Set the device description node and initialise its child nodes + * + * \param dev Device in question + * \param node The XML structure to be set as the device's description + */ +void cg_upnp_device_setdevicenode(CgUpnpDevice *dev, CgXmlNode *node); + +/** + * Return the device XML description node + * + * \param dev Device in question + */ +#define cg_upnp_device_getdevicenode(dev) (dev->deviceNode) + +/** + * Check whether the given device contains a list of root nodes + * i.e. is it the root device + * + * \param dev Device in question + */ +#define cg_upnp_device_isrootdevice(dev) ((dev->rootNodeList != NULL) ? TRUE : FALSE) + +/** + * Set a parent device for the given child device + * + * \param dev Child device + * \param pDev Parent device + */ +#define cg_upnp_device_setparentdevice(dev, pDev) (dev->parentDevice = pDev) + +/** + * Return the device's parent device + * + * \param dev Device in question + */ +#define cg_upnp_device_getparentdevice(dev) (dev->parentDevice) + +/** + * Return the root (i.e. the topmost) device in the device structure + * + * \param dev Traverses the device tree upwards starting from this device + */ +CgUpnpDevice *cg_upnp_device_getrootdevice(CgUpnpDevice *dev); + +/** + * Parse the device description XML document. + * + * \param dev Device in question + * \param description Buffer containing the device description in XML format + * \param descriptionLen Buffer length + * + * \return TRUE, if the buffer was successfully parsed; otherwise FALSE + */ +BOOL cg_upnp_device_parsedescription(CgUpnpDevice *dev, char *desciption, int descriptionLen); + +/** + * Fetch and parse the device description XML file, located in the given URL. + * + * \param dev Device in question + * \param url An internet resource + * + * \return TRUE, if the buffer was successfully parsed; otherwise FALSE + */ +BOOL cg_upnp_device_parsedescriptionurl(CgUpnpDevice *dev, CgNetURL *url); + + +#if defined(CG_USE_CFILE) +/** + * Load and parse the device description from an XML file. + * Not available for T-Engine, ITron and BTron platforms. + * + * \param dev Device in question + * \param fileName The file name containing the device description XML document + * + * \return TRUE, if the buffer was successfully parsed; otherwise FALSE + */ +BOOL cg_upnp_device_loaddescriptionfile(CgUpnpDevice *dev, char *fileName); +#endif + +/**************************************************************************** + * Description updates + ****************************************************************************/ + +/** + * Update the device's contents from an SSDP packet if necessary. + * + * @param dev The device to potentially update + * @param ssdpPkt The SSDP packet to make decisions on + * @return TRUE if the device was updated; otherwise FALSE + */ +BOOL cg_upnp_device_updatefromssdppacket(CgUpnpDevice* dev, + CgUpnpSSDPPacket* ssdpPkt); + +/***************************************************************************** + * Device Type + *****************************************************************************/ + +/** + * Modify the device type. + * + * \param dev Device in question + * \param value Type to set + */ +#define cg_upnp_device_setdevicetype(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_DEVICE_TYPE, value) + +/** + * Return the device type + * + * \param dev Device in question + * + * \return Device type + */ +#define cg_upnp_device_getdevicetype(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_DEVICE_TYPE) + +/** + * Check, whether the device is of the exact specified type (including version) + * + * \param dev Device in question + * @param value Device type + * + * \return BOOL: TRUE if device matches given type; otherwise FALSE + */ +#define cg_upnp_device_isdevicetype(dev, value) cg_streq(cg_upnp_device_getdevicetype(dev), value) + +/** + * Get the identifier-part of a device type string (usually "urn") + * + * @param deviceType A device type string (usually the result from + * @ref cg_upnp_device_getdevicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_devicetype_getidentifier(char* deviceType); + +/** + * Get the URN part of a device type string (usually "schemas-upnp-org") + * + * @param deviceType A device type string (usually the result from + * @ref cg_upnp_device_getdevicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_devicetype_geturn(char* deviceType); + +/** + * Get the device part of a device type string (usually just "device") + * + * @param deviceType A device type string (usually the result from + * @ref cg_upnp_device_getdevicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_devicetype_getdevice(char* deviceType); + +/** + * Get the type part of a device type string (ex. "ContentDirectory") + * + * @param deviceType A device type string (usually the result from + * @ref cg_upnp_device_getdevicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_devicetype_gettype(char* deviceType); + +/** + * Get the schema type part of a device type string (without last colon) + * (ex. "urn:schemas-upnp-org:device:ContentDirectory") + * + * @param deviceType A device type string (usually the result from + * @ref cg_upnp_device_getdevicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_devicetype_getschematype(char* deviceType); + +/** + * Get the version part of a device type string (ex. "1") + * + * @param deviceType A device type string (usually the result from + * @ref cg_upnp_device_getdevicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_devicetype_getversion(char* deviceType); + +/***************************************************************************** + * Friendly Name + *****************************************************************************/ + +/** + * Modify the device's friendly name. + * + * \param dev Device in question + * \param value The friendly name + * + */ +#define cg_upnp_device_setfriendlyname(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_FRIENDLY_NAME, value) + +/** + * Return the device's friendly name. + * + * \param dev Device in question + * + * \return The device's friendly name + */ +#define cg_upnp_device_getfriendlyname(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_FRIENDLY_NAME) + +/***************************************************************************** + * Manufacturer + *****************************************************************************/ + +/** + * Modify the device's manufacturer. + * + * \param dev Device in question + * \param value The manufacturer's name + * + */ +#define cg_upnp_device_setmanufacturer(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MANUFACTURER, value) + +/** + * Get the device's manufacturer. + * + * \param dev Device in question + * + * \return value The manufacturer's name + */ +#define cg_upnp_device_getmanufacturer(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MANUFACTURER) + +/***************************************************************************** + * Manufacturer URL + *****************************************************************************/ + +/** + * Modify the device's manufacturer URL + * + * \param dev Device in question + * \param value The manufacturer URL + * + */ +#define cg_upnp_device_setmanufacturerurl(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MANUFACTURER_URL, value) + +/** + * Get the device's manufacturer URL + * + * \param dev Device in question + * + * \return The manufacturer URL + */ +#define cg_upnp_device_getmanufacturerurl(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MANUFACTURER_URL) + +/***************************************************************************** + * Model Description + *****************************************************************************/ + +/** + * Modify the device model description + * + * \param dev Device in question + * \param value The device model description + * + */ +#define cg_upnp_device_setmodeldescription(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_DESCRIPTION, value) + +/** + * Get the device model description + * + * \param dev Device in question + * + * \return The device model description + */ +#define cg_upnp_device_getmodeldescription(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_DESCRIPTION) + +/***************************************************************************** + * Model Name + *****************************************************************************/ + +/** + * Modify the device's model name + * + * \param dev Device in question + * \param value The model name + * + */ +#define cg_upnp_device_setmodelname(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_NAME, value) + +/** + * Get the device's model name + * + * \param dev Device in question + * + * \return The model name + */ +#define cg_upnp_device_getmodelname(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_NAME) + +/***************************************************************************** + * Model Number + *****************************************************************************/ + +/** + * Modify the device's model number + * + * \param dev Device in question + * \param value The model number + * + */ +#define cg_upnp_device_setmodelnumber(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_NUMBER, value) + +/** + * Get the device's model number + * + * \param dev Device in question + * + * \return The model number + */ +#define cg_upnp_device_getmodelnumber(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_NUMBER) + +/***************************************************************************** + * Model URL + *****************************************************************************/ + +/** + * Modify the device's model URL + * + * \param dev Device in question + * \param value The model URL + * + */ +#define cg_upnp_device_setmodelurl(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_URL, value) + +/** + * Get the device's model URL + * + * \param dev Device in question + * + * \return The model URL + */ +#define cg_upnp_device_getmodelurl(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_MODEL_URL) + +/***************************************************************************** + * serialNumber + *****************************************************************************/ + +/** + * Modify the device's serial number + * + * \param dev Device in question + * \param value The serial number + * + */ +#define cg_upnp_device_setserialnumber(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_SERIAL_NUMBER, value) + +/** + * Get the device's model number + * + * \param dev Device in question + * + * \return The serial number + */ +#define cg_upnp_device_getserialnumber(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_SERIAL_NUMBER) + +/***************************************************************************** + * Unique Device Name (UDN) + *****************************************************************************/ + +/** + * Modify the device's Unique Device Name (UDN) + * + * \param dev Device in question + * \param value The Unique Device Name + * + */ +#define cg_upnp_device_setudn(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_UDN, value) + +/** + * Get the device's Unique Device Name (UDN) + * + * \param dev Device in question + * + * \return The Unique Device Name + */ +#define cg_upnp_device_getudn(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_UDN) + +/** + * Check whether the device has a Unique Device Name (UDN) + * + * \param dev Device in question + * + * \return TRUE if the device has a UDN; otherwise FALSE + */ +#define cg_upnp_device_hasudn(dev) ((0 < cg_strlen(cg_upnp_device_getudn(dev))) ? TRUE : FALSE) + +/** + * Update new Unique Device Name (UDN) + * + * \param dev Device in question + * + */ +void cg_upnp_device_updateudn(CgUpnpDevice *dev); + +/***************************************************************************** + * Universal Product Code (UPC) + *****************************************************************************/ + +/** + * Modify the device's Universal Product Code (UPC) + * + * \param dev Device in question + * \param value The Universal Product Code + * + */ +#define cg_upnp_device_setupc(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_UPC, value) + +/** + * Get the device's Universal Product Code (UPC) + * + * \param dev Device in question + * + * \return The Universal Product Code + */ +#define cg_upnp_device_getupc(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_UPC) + +/***************************************************************************** + * Presentation URL + *****************************************************************************/ + +/** + * Modify the device's presentation URL + * + * \param dev Device in question + * \param value The presentation URL + * + */ +#define cg_upnp_device_setpresentationurl(dev, value) cg_xml_node_setchildnode(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_PRESENTATION_URL, value) + +/** + * Get the device's presentation URL + * + * \param dev Device in question + * + * \return The presentation URL + */ +#define cg_upnp_device_getpresentationurl(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getdevicenode(dev), CG_UPNP_DEVICE_PRESENTATION_URL) + +/***************************************************************************** + * URLBase + *****************************************************************************/ + +/** + * Modify the device's URL base + * The base URL is the root for all relative URLs. + * + * \param dev Device in question + * \param value The URL base + * + */ +void cg_upnp_device_seturlbase(CgUpnpDevice *dev, char *value); + +/** + * Get the device's base URL. + * The base URL is the root for all relative URLs. + * + * \param dev Device in question + * \return The URL base + * + */ +#define cg_upnp_device_geturlbase(dev) cg_xml_node_getchildnodevalue(cg_upnp_device_getrootnode(cg_upnp_device_getrootdevice(dev)), CG_UPNP_DEVICE_URLBASE_NAME) + +/***************************************************************************** + * Start/Stop + *****************************************************************************/ + +/** + * Start the device. This essentially starts: + * \li The HTTP server + * \li The SSDP server + * \li Advertising the device + * \li Alive notification + * + * \param dev Device in question + * + */ +BOOL cg_upnp_device_start(CgUpnpDevice *dev); + +/** + * Stop the device. This concerns: + * \li The HTTP server + * \li The SSDP server + * \li Advertising the device + * \li Byebye notification + * + * \param dev Device in question + * + */ +BOOL cg_upnp_device_stop(CgUpnpDevice *dev); + +/** + * Check if the device] has been started + * + * \param dev Device that is being advertised + */ +BOOL cg_upnp_device_isrunning(CgUpnpDevice *dev); + +/***************************************************************************** + * URL + *****************************************************************************/ + +/** + * Get device's location URL. Transforms the given address to URL form: + * "http://:/description.xml". Port is usually 80 or 38400. + * If is an IPv6 address, the address is "http://[]:/description.xml". + * + * \param dev Device in question + * \param host The device host + * \param buf Buffer to store the resulting URL + * \param bufSize Buffer length + * + */ +char *cg_upnp_device_getlocationurl(CgUpnpDevice *dev, char *host, char *buf, int bufSize); + +/***************************************************************************** + * Notify + *****************************************************************************/ + +/** + * Broadcast an SSDP:alive to notify control points that the device is available. + * + * \param dev Device in question + * + */ +void cg_upnp_device_announce(CgUpnpDevice *dev); + +/** + * Broadcast an SSDP:byebye message to notify control points that the device is no longer available. + * + * \param dev Device in question + * + */ +void cg_upnp_device_byebye(CgUpnpDevice *dev); + +/***************************************************************************** + * Mutex + *****************************************************************************/ + +/** + * Lock the device's mutex (grant exclusive access to the device) until \ref cg_upnp_device_unlock is called. + * + * \param dev Device in question + * + */ +#define cg_upnp_device_lock(dev) cg_mutex_lock(dev->mutex) + +/** + * Lock the device's mutex with timeout, return TRUE if exclusive access is gained + * Release lock with \ref cg_upnp_device_unlock is called. + * + * \param dev Device in question + * \param t timeout in ms + * + */ +#define cg_upnp_device_waitforlock(dev,t) cg_mutex_waitforlock(dev->mutex,t) + +/** + * Unlock the device's mutex (release exclusive access to the device) locked previously with \ref cg_upnp_device_lock. + * + * \param dev Device in question + * + */ +#define cg_upnp_device_unlock(dev) cg_mutex_unlock(dev->mutex) + +/***************************************************************************** + * Listener + *****************************************************************************/ + +/** + * Set an action listener to the device. Actions are basically commands, that the + * device (service) responds to. + * + * \param dev Device in question + * \param actionListener The action listener + * + */ +void cg_upnp_device_setactionlistener(CgUpnpDevice *dev, CG_UPNP_ACTION_LISTNER actionListner); + +/** + * Set a query listener to the device. Queries are meant for state variables. + * + * \param dev Device in question + * \param actionListener The query listener + * + */ +void cg_upnp_device_setquerylistener(CgUpnpDevice *dev, CG_UPNP_STATEVARIABLE_LISTNER queryListner); + +/***************************************************************************** + * User Data + *****************************************************************************/ + +/** + * Set device's user data pointer + * + * \param dev Device in question + * \param value User data pointer + * + */ +#define cg_upnp_device_setuserdata(dev, value) (dev->userData = value) + +/** + * Get device's user data pointer + * + * \param dev Device in question + * \return pointer to user data + * + */ +#define cg_upnp_device_getuserdata(dev) (dev->userData) + +/***************************************************************************** +* Function +******************************************************************************/ + +/***************************************************************************** + * DescriptionURL + *****************************************************************************/ + +/** + * Set the given URL as the device's description URI + * + * \param dev Device in question + * \param url Description URL + * + */ +#define cg_upnp_device_setdescriptionuri(dev,url) cg_string_setvalue(dev->descriptionURI, url) + +/** + * Get the device's description URI + * + * \param dev Device in question + * + */ +#define cg_upnp_device_getdescriptionuri(dev) cg_string_getvalue(dev->descriptionURI) + +/** + * Check, whether the given URL matches the device's description URI + * + * \param dev Device in question + * \param url Description URL to check + * + */ +#define cg_upnp_device_isdescriptionuri(dev, url) cg_streq(cg_string_getvalue(dev->descriptionURI), url) + +/***************************************************************************** + * Lease Time + *****************************************************************************/ + +/** + * Set the device's lease time. The lease time is basically the maximum amount + * of time that can elapse before an advertisement is broadcast again. It does not + * set the exact advertisement interval, but rather a time window for each advertisement. + * Advertisement actually occurs at (more or less) random intervals inside this time window. + * + * \param dev Device in question + * \param value Lease time in seconds + * + */ +#define cg_upnp_device_setleasetime(dev,value) (dev->leaseTime = value) + +/** + * Get the device's lease time. See \ref cg_upnp_device_setleasetime. + * + * \param dev Device in question + * + */ +#define cg_upnp_device_getleasetime(dev) (dev->leaseTime) + +/***************************************************************************** +* Functions (Embedded) +******************************************************************************/ + +/***************************************************************************** + * Embedded DeviceList + *****************************************************************************/ + +/** + * Get the device's internal device list + * + * \param dev Device in question + * + */ +#define cg_upnp_device_getdevicelist(dev) (dev->deviceList) + +/** + * Find a certain device from the given device list + * + * \param dev Device in question + * \param idx Device index number in list + * \return NULL if not found; otherwise the device pointer + * + */ +//Theo Beisch added missing (CgList*) cast +#define cg_upnp_device_getdevice(dev,idx) ((CgUpnpDevice *)cg_list_get((CgList*)dev->deviceList,idx)) + +/** + * \todo Correct explanation... + * + * \param dev Device in question + * + */ +//Theo Beisch : added missing (CgList*) cast +#define cg_upnp_device_getdevices(dev) ((CgUpnpDevice *)cg_list_gets((CgList *)dev->deviceList)) + +/** + * Find a device from the device's children by the exact type of the device. + * This function searches for devices, whose *complete type string* + * matches the given string, including version number. For example: + * "urn:schemas-upnp-org:device:FooDevice:1". If you need to disregard + * the version, use \ref cg_upnp_device_getdevicebytype + * + * \param ctrlPoint Controlpoint in question + * \param exacttype Type of the device + * + */ +CgUpnpDevice *cg_upnp_device_getdevicebyexacttype(CgUpnpDevice* dev, + char *exacttype); + +/** + * Find a device from the device's children by the type of the device. + * This function searches for devices, whose *type part* (i.e. not including + * the version) of the device type string matches the given string. + * For example: "urn:schemas-upnp-org:device:FooDevice". If you need + * to know the version of a device, use \ref cg_upnp_devicetype_getversion + * + * \param dev Device in question + * \param type Type of the device + * + */ +CgUpnpDevice *cg_upnp_device_getdevicebytype(CgUpnpDevice *dev, char *type); + +/** + * Find a device from the device's children by the UDN of the device. + * + * \param dev Device in question + * \param type Type of the device + * + */ +CgUpnpDevice *cg_upnp_device_getdevicebyudn(CgUpnpDevice *dev, char *udn); + +/** + * Find a child device by its description URI. + * + * \param dev Device in question + * \param url Description URI + * + */ +CgUpnpDevice *cg_upnp_device_getdevicebydescriptionuri(CgUpnpDevice *dev, char *url); + +/***************************************************************************** + * Embedded ServiceList + *****************************************************************************/ + +/** + * Get the device's list of services + * + * \param dev Device in question + * + */ +#define cg_upnp_device_getservicelist(dev) (dev->serviceList) + +/** + * Get the number of services known by the device + * + * \param dev Device in question + * @return The number of devices in the control point's device list + */ +#define cg_upnp_device_getnservices(dev) cg_upnp_servicelist_size(dev->serviceList) + +/** + * Get a service from from the device + * + * \param dev Device in question + * \param idx Device index number + * + */ +//Theo Beisch : added missing (CgList*) cast +#define cg_upnp_device_getservice(dev,idx) ((CgUpnpService *)cg_list_get((CgList *)dev->serviceList,idx)) + +/** + * \todo Correct explanation... + * + * \param dev Device in question + * + */ +#define cg_upnp_device_getservices(dev) ((CgUpnpService *)cg_list_gets((CgList *)dev->serviceList)) + +/** + * Find service from the device by a given serviceId. + * This function searches recursively device and its subdevices + * for a service with a given serviceId + * + * \param dev Device in question + * \param serviceId serviceId of the service + * \return service matching the given serviceId + */ +CgUpnpService *cg_upnp_device_getservicebyserviceid(CgUpnpDevice *dev, + char *serviceId); + +/** + * Find a service from the device by the type of the service. + * This function searches for services, whose *complete type string* + * matches the given string, including version number. For example: + * "urn:schemas-upnp-org:service:ContentDirectory:1". If you need to + * know the version of a service, use \ref cg_upnp_servicetype_getversion + * + * \param dev Device in question + * \param type Type of the service + * + */ +CgUpnpService *cg_upnp_device_getservicebyexacttype(CgUpnpDevice *dev, + char *type); + +/** + * Find a service from the device by the type of the service. + * This function searches for services, whose *type* part of the service type + * string matches the given string. For example: "ContentDirectory". + * If you need to search for an exact service type, use + * \ref cg_upnp_device_getservicebyname + * + * \param dev Device in question + * \param type Type of the service + * + */ +CgUpnpService *cg_upnp_device_getservicebytype(CgUpnpDevice *dev, char *type); + +/** + * Find a service from the device by the subscribtion ID + * + * \param dev Device in question + * \param sid Subscription ID of the service + */ +CgUpnpService *cg_upnp_device_getservicebysid(CgUpnpDevice *dev, char *sid); + +/** + * Find a service from the device by the SCPD (Service Control Protocol Definition) URL of the service. + * + * \param dev Device in question + * \param url SCPD URL + * + */ +CgUpnpService *cg_upnp_device_getservicebyscpdurl(CgUpnpDevice *dev, char *url); + +/** + * Find a service from a device by its control URL + * + * \param dev Device in question + * \param url Control URL + * + */ +CgUpnpService *cg_upnp_device_getservicebycontrolurl(CgUpnpDevice *dev, char *url); + +/** + * Find a service from a device by its event subscription URL + * + * \param dev Device in question + * \param url Event Subscription URL + * + */ +CgUpnpService *cg_upnp_device_getservicebyeventsuburl(CgUpnpDevice *dev, char *url); + +/** + * Find a service from its Subscription ID + * + * \param dev Device in question + * \param char* Subscription-ID (SID) + * + */ +CgUpnpService *cg_upnp_device_getservicebysid(CgUpnpDevice *dev, char *sid); + + +/***************************************************************************** + * Embedded IconList + *****************************************************************************/ + +/** + * Get the device's list of icons + * + * \param dev Device in question + * + */ +#define cg_upnp_device_geticonlist(dev) (dev->iconList) + +/** + * Get an icon by its index from the device's list of icons + * + * \param dev Device in question + * \param idx Icon index number + * + */ +#define cg_upnp_device_geticon(dev,idx) ((CgUpnpIcon *)cg_list_get((CgList *)dev->iconList,idx)) + +/** + * \todo Correct explanation... + * + * \param dev Device in question + * + */ +#define cg_upnp_device_geticons(dev) ((CgUpnpIcon *)cg_list_gets((CgList *)dev->iconList)) + +/** +* Get a smallest icon +* +* \param dev Device in question +* +* \return A smallest icon. +*/ +CgUpnpIcon *cg_upnp_device_getsmallesticon(CgUpnpDevice *dev); + +/** + * Get a smallest icon of a specified mime type + * + * \param dev Device in question + * \param mimeType Mime type to get + * + * \return A smallest icon. +*/ +CgUpnpIcon *cg_upnp_device_getsmallesticonbymimetype(CgUpnpDevice *dev, char *mimeType); + +/** + * Get an icon by its index from the device's list of icons + * + * \param dev Device in question + * \param icon Icon in question + * \param buf Buffer to return the full icon's url + * + * \return TRUE if the absolute url is created, otherwise FALSE. + */ +BOOL cg_upnp_device_getabsoluteiconurl(CgUpnpDevice *dev, CgUpnpIcon *icon, CgString *buf); + +/** +* Get a smallest icon + * + * \param dev Device in question + * \param icon Icon to add + * + */ +BOOL cg_upnp_device_addicon(CgUpnpDevice *dev, CgUpnpIcon *icon); + +/***************************************************************************** + * Embedded Action + *****************************************************************************/ + +/** + * Find an action from a device by its name + * + * \param dev Device in question + * \param name Name of the action + * + */ +CgUpnpAction *cg_upnp_device_getactionbyname(CgUpnpDevice *dev, char *name); + +/***************************************************************************** + * Embedded StateVariable + *****************************************************************************/ + +/** + * Find a state variable from a device by its name + * + * \param dev Device in question + * \param name Name of the state variable + * + */ +CgUpnpStateVariable *cg_upnp_device_getstatevariablebyname(CgUpnpDevice *dev, char *name); + +/***************************************************************************** + * Function (DeviceList) + *****************************************************************************/ + +/** + * Create a new device list + * + */ +CgUpnpDeviceList *cg_upnp_devicelist_new(); + +/** + * Delete a device list completely, freeing all devices and their contents. + * + * \param devList The device list to delete + * + */ +void cg_upnp_devicelist_delete(CgUpnpDeviceList *devList); + +/** + * Clear the contents of a device list. + * Use \ref cg_upnp_devicelist_delete instead of this function. + * + * \param devList The device list to clear + * + */ +#define cg_upnp_devicelist_clear(devList) cg_list_clear((CgList *)devList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_device_delete) + +/** + * Get the size of the device list + * + * \param devList The device list + * + */ +#define cg_upnp_devicelist_size(devList) cg_list_size((CgList *)devList) + +/** + * \todo Correct description + * + * \param devList The device list + * + */ +#define cg_upnp_devicelist_gets(devList) (CgUpnpDevice *)cg_list_next((CgList *)devList) + +/** + * Get an device from the device list by the index + * + * \param devList The device list + * \param index The index of the device to get + * + */ +#define cg_upnp_devicelist_get(devList, index) (CgUpnpDevice *)cg_list_get((CgList *)devList, index) + +/** + * Add a device to the device list + * + * \param devList The device list + * \param dev The device to add + * + */ +#define cg_upnp_devicelist_add(devList, dev) cg_list_add((CgList *)devList, (CgList *)dev) + +/**************************************** +* Function (Service) +****************************************/ + +/** + * Get the device associated to the given service + * + * \param service The service in question + * + */ +//Theo Beisch: namespace conflict - removed duplicate - already defined in cservice.h +//#define cg_upnp_service_getdevice(service) ((CgUpnpDevice *)service->parentDevice) + +/** + * Get the root device of the given service + * + * \param service The service in question + * + */ +//Theo Beisch: namespace conflict - removed duplicate - already defined in cservice.h +//#define cg_upnp_service_getrootdevice(service) cg_upnp_device_getrootdevice((CgUpnpDevice *)service->parentDevice) + +/***************************************************************************** +* Function (HTTP) +******************************************************************************/ + +/***************************************************************************** + * HTTP Port + *****************************************************************************/ + +/** + * Modify the port that the device's HTTP server is listening + * + * \param dev The device in question + * \param value Port number + * + */ +#define cg_upnp_device_sethttpport(dev,value) (dev->httpPort = value) + +/** + * Get the device's HTTP port + * + * \param dev The device in question + * + */ +#define cg_upnp_device_gethttpport(dev) (dev->httpPort) + +/** + * Set an HTTP listener function to the device + * + * \param dev The device in question + * \param func The listener function + * + */ +#define cg_upnp_device_sethttplistener(dev, func) (dev->httpListener = func) + +/** + * Get the device's HTTP listener function + * + * \param dev The device in question + * + */ +#define cg_upnp_device_gethttplistener(dev) (dev->httpListener) + +/** + * Get the HTTP server list + * + * \param dev The device in question + * + */ +#define cg_upnp_device_gethttpserverlist(dev) (dev->httpServerList) + +/** + * Handler function for a received HTTP request. Delegates GET and POST requests + * to their respective handlers, or treats as a BAD REQUEST, when appropriate. + * + * \param httpReq Received HTTP request + * + */ +void cg_upnp_device_httprequestrecieved(CgHttpRequest *httpReq); + +/***************************************************************************** + * Function (SSDP) + *****************************************************************************/ + +/** + * Get the device's list of SSDP servers + * + * \param dev The device in question + * + */ +#define cg_upnp_device_getssdpserverlist(dev) (dev->ssdpServerList) + +/** + * The SSDP message handler function. + * + * \param ssdpPkt SSDP Packet + * + */ +void cg_upnp_device_ssdplistener(CgUpnpSSDPPacket *ssdpPkt); + +/** + * Get the SSDP server list + * + * \param dev The device in question + * + */ +#define cg_upnp_device_getssdpserverlist(dev) (dev->ssdpServerList) + +/** + * Get the device's Notification Type (NT). For the root device this is "upnp:rootdevice", + * otherwise the device's UDN (Unique Device Name). + * + * \param dev The device in question + * \param buf Buffer for the Notification Type + * \param bufSize Buffer length + * + */ +char *cg_upnp_device_getnotifydevicent(CgUpnpDevice *dev, char *buf, int bufSize); + +//Theo Beisch: added reference +/** + * Get the device's USN (Unique Service Name). + * For the root device this is "::upnp:rootdevice", + * otherwise the UDN (Unique Device Name). + * + * \param dev The device in question + * + */ +char *cg_upnp_device_getnotifydeviceusn(CgUpnpDevice *dev, char *buf, int bufSize); + +/** + * Get the device type + * + * \param dev The device in question + * \param buf Buffer for the device type + * \param bufSize Buffer length + * + */ +char *cg_upnp_device_getnotifydevicetypent(CgUpnpDevice *dev, char *buf, int bufSize); + +/** + * Get the device's USN (Unique Service Name). For the root device this is "::upnp:rootdevice", + * otherwise the UDN (Unique Device Name). + * + * \param dev The device in question + * @param buf Buffer where USN is stored after call + * @param bufSize Buffer size + * + * @return Pointer to buf + */ +char *cg_upnp_device_getnotifydevicetypeusn(CgUpnpDevice *dev, char *buf, int bufSize); + +/** + * SSDP message handler + * + * \param dev The device in question + * \param ssdpPkt Received SSDP packet + * + */ +void cg_upnp_device_ssdpmessagereceived(CgUpnpDevice *dev, CgUpnpSSDPPacket *ssdpPkt, int filter); + +/** + * Post a response to an SSDP search message + * + * \param dev The device in question + * \param ssdpPkt Received SSDP packet + * \param st Service Type (ST) + * \param usn Unique Service Name (USN) + * + */ +BOOL cg_upnp_device_postsearchresponse(CgUpnpDevice *dev, CgUpnpSSDPPacket *ssdpPkt, char *st, char *usn); + +/** + * Notify device that IP address of the host has been changed. + * + * \param dev dev The device in question + * \return success of changing used interfaces + */ +BOOL cg_upnp_device_ipchanged(CgUpnpDevice *dev); + +/***************************************************************************** + * Function (SSDPPacket) + *****************************************************************************/ + +/** + * Get the device's SSDP packet + * + * \param dev The device in question + * + */ +#define cg_upnp_device_getssdppacket(dev) (dev->ssdpPkt) + +/** + * Modify the device's SSDP packet (creates a copy of the original) + * + * \param dev The device in question + * \param srcSsdpPkt The SSDP packet + * + */ +#define cg_upnp_device_setssdppacket(dev, srcSsdpPkt) cg_upnp_ssdp_packet_copy(dev->ssdpPkt, srcSsdpPkt) + +/** + * Extract location information from the device's SSDP packet + * + * \param dev The device in question + * + */ +#define cg_upnp_device_getlocationfromssdppacket(dev) cg_upnp_ssdp_packet_getlocation(dev->ssdpPkt) + +/** + * Extract the interface address from the device's SSDP packet + * + * \param dev The device in question + * + */ +#define cg_upnp_device_getinterfaceaddressfromssdppacket(dev) cg_upnp_ssdp_packet_getlocaladdress(dev->ssdpPkt) + +/**************************************** +* Function (Advertiser) +****************************************/ + +/** + * Start the advertiser thread for the given device + * + * \param dev The device in question + */ +BOOL cg_upnp_device_advertiser_start(CgUpnpDevice *dev); + +/** + * Stop the advertiser thread for the given device + * + * \param dev The device in question + */ +BOOL cg_upnp_device_advertiser_stop(CgUpnpDevice *dev); + +/** + * Check if the advertiser has been started + * + * \param dev Device that is being advertised + */ +BOOL cg_upnp_device_advertiser_isrunning(CgUpnpDevice *dev); + +/** + * Get the advertiser thread from the device + * + * \param dev The device in question + */ +#define cg_upnp_device_getadvertiserthead(dev) (dev->advertiser) + +#ifdef __cplusplus + +} /* extern C */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cicon.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cicon.h new file mode 100644 index 0000000..3c040d6 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cicon.h @@ -0,0 +1,247 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cicon.h +* +* Revision: +* +* 02/14/05 +* - first revision +* +* 10/31/05 +* - Added comments to all functions and structs +******************************************************************/ + +#ifndef _CG_UPNP_CICON_H_ +#define _CG_UPNP_CICON_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_UPNP_ICON_ELEM_NAME "icon" +#define CG_UPNP_ICONLIST_ELEM_NAME "iconList" + +#define CG_UPNP_ICON_MIME_TYPE "mimetype" +#define CG_UPNP_ICON_WIDTH "width" +#define CG_UPNP_ICON_HEIGHT "height" +#define CG_UPNP_ICON_DEPTH "depth" +#define CG_UPNP_ICON_URL "url" + +/**************************************** +* Data Type +****************************************/ +/** + * The generic icon struct + */ +typedef struct _CgUpnpIcon { + BOOL headFlag; + struct _CgUpnpIcon *prev; + struct _CgUpnpIcon *next; + CgXmlNode *iconNode; +} CgUpnpIcon, CgUpnpIconList; + +/**************************************** +* Function (Icon) +****************************************/ + +/** + * Create a new icon struct + */ +CgUpnpIcon *cg_upnp_icon_new(); + +/** + * Delete an icon struct + * + * \param dev Icon to delete + */ +void cg_upnp_icon_delete(CgUpnpIcon *dev); + +/** + * Get the next icon in list. Use as an iterator. + * + * \param icon Node in a list of icons + */ +#define cg_upnp_icon_next(icon) (CgUpnpIcon *)cg_list_next((CgList *)icon) + +/** + * Check whether the given node is a member of an icon list + * + * \param node List node + */ +#define cg_upnp_icon_isiconnode(node) cg_xml_node_isname(node, CG_UPNP_ICON_ELEM_NAME) + +/** + * Set the XML icon node to an icon struct + * + * \param icon The icon struct + * \param node XML node + */ +#define cg_upnp_icon_seticonnode(icon,node) (icon->iconNode = node) + +/** + * Get the XML icon node from an icon struct + * + * \param icon The icon struct + */ +#define cg_upnp_icon_geticonnode(icon) (icon->iconNode) + +/***************************************************************************** + * mimeType + *****************************************************************************/ + +/** + * Set the icon's MIME type + * + * \param icon Icon in question + * \param value MIME type + */ +#define cg_upnp_icon_setmimetype(icon, value) cg_xml_node_setchildnode(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_MIME_TYPE, value) + +/** + * Get the icon's MIME type + * + */ +#define cg_upnp_icon_getmimetype(icon) cg_xml_node_getchildnodevalue(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_MIME_TYPE) + +/***************************************************************************** + * width + *****************************************************************************/ + +/** + * Set icon width + * + * \param icon Icon in question + * \param value Icon width + */ +#define cg_upnp_icon_setwidth(icon, value) cg_xml_node_setchildnode(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_WIDTH, value) + +/** + * Get icon width + * + */ +#define cg_upnp_icon_getwidth(icon) cg_xml_node_getchildnodeintvalue(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_WIDTH) + +/***************************************************************************** + * height + *****************************************************************************/ + +/** + * Set icon height + * + * \param icon Icon in question + * \param value Icon height + */ +#define cg_upnp_icon_setheight(icon, value) cg_xml_node_setchildnode(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_HEIGHT, value) + +/** + * Get icon height + * + */ +#define cg_upnp_icon_getheight(icon) cg_xml_node_getchildnodeintvalue(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_HEIGHT) + +/***************************************************************************** + * Colour Depth + *****************************************************************************/ + +/** + * Set icon's colour depth + * + * \param icon Icon in question + * \param value Colour depth + */ +#define cg_upnp_icon_setdepth(icon, value) cg_xml_node_setchildnode(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_DEPTH, value) + +/** + * Get icon's colour depth + * + */ +#define cg_upnp_icon_getdepth(icon) cg_xml_node_getchildnodeintvalue(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_DEPTH) + +/***************************************************************************** + * URL + *****************************************************************************/ + +/** + * Set icon's URL + * + * \param icon Icon in question + * \param value Icon's URL + */ +#define cg_upnp_icon_seturl(icon, value) cg_xml_node_setchildnode(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_URL, value) + +/** + * Get icon's URL + * + */ +#define cg_upnp_icon_geturl(icon) cg_xml_node_getchildnodevalue(cg_upnp_icon_geticonnode(icon), CG_UPNP_ICON_URL) + +/***************************************************************************** + * Function (IconList) + *****************************************************************************/ + +/** + * Create a new list of icons + * + */ +CgUpnpIconList *cg_upnp_iconlist_new(); + +/** + * Delete a list of icons + * + * \param iconList List of icons + */ +void cg_upnp_iconlist_delete(CgUpnpIconList *iconList); + +/** + * Clear the contents of an icon list + * + * \param iconList List of icons + */ +#define cg_upnp_iconlist_clear(iconList) cg_list_clear((CgList *)iconList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_icon_delete) + +/** + * Get the size (number of elements) of an icon list + * + * \param iconList List of icons + */ +#define cg_upnp_iconlist_size(iconList) cg_list_size((CgList *)iconList) + +/** + * \todo Get the first icon from the list for iteration + * + * \param iconList List of icons + */ +#define cg_upnp_iconlist_gets(iconList) (CgUpnpIcon *)cg_list_next((CgList *)iconList) + +/** + * Add an icon to an icon list + * + * \param iconList List of icons + * \param icon Icon to add + */ +#define cg_upnp_iconlist_add(iconList, icon) cg_list_add((CgList *)iconList, (CgList *)icon) + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/control/ccontrol.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/control/ccontrol.h new file mode 100644 index 0000000..4c8f429 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/control/ccontrol.h @@ -0,0 +1,785 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: ccontrol.h +* +* Re1vision: +* +* 04/19/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CCONTROL_H_ +#define _CG_UPNP_CCONTROL_H_ + +#include + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/**** MAN ****/ + +/** + * Definition for mandatory discover header + */ +#define CG_UPNP_MAN_DISCOVER "\"ssdp:discover\"" + +/**** NT ****/ + +/** + * Definition for NT (Notification type) root device + */ +#define CG_UPNP_NT_ROOTDEVICE "upnp:rootdevice" + +/** + * Definition for NT event + */ +#define CG_UPNP_NT_EVENT "upnp:event" + +/**** NTS ****/ + +/** + * Definition for NTS alive + */ +#define CG_UPNP_NTS_ALIVE "ssdp:alive" + +/** + * Definition for NTS byebye + */ +#define CG_UPNP_NTS_BYEBYE "ssdp:byebye" + +/** + * Definition for NTS property change + */ +#define CG_UPNP_NTS_PROPCHANGE "upnp:propchange" + +/**** ST ****/ + +/** + * Definition for general ST (search target) + */ +#define CG_UPNP_ST_ALL_DEVICE "ssdp:all" + +/** + * Definition for root device ST + */ +#define CG_UPNP_ST_ROOT_DEVICE "upnp:rootdevice" + +/** + * Definition for ST UUID (universally unique identifier) prefix + */ +#define CG_UPNP_ST_UUID_DEVICE "uuid" + + /** + * Definition for URN device + */ +#define CG_UPNP_ST_URN "urn" + +/** + * Definition for URN device + */ +#define CG_UPNP_ST_URN_DEVICE "urn:schemas-upnp-org:device" + +/** + * Definition for URN service + */ +#define CG_UPNP_ST_URN_SERVICE "urn:schemas-upnp-org:service" + +/**** USN ****/ + +/** + * Definition for USN rootdevice + */ +#define CG_UPNP_USN_ROOTDEVICE "upnp:rootdevice" + +/** + * Definition for control name space + */ +#define CG_UPNP_CONTROL_NS "u" + +/** + * Definition for soap action: state variable query + */ +#define CG_UPNP_CONTROL_QUERY_SOAPACTION "\"urn:schemas-upnp-org:control-1-0#QueryStateVariable\"" + +/** + * Definition for control XML name space + */ +#define CG_UPNP_CONTROL_XMLNS "urn:schemas-upnp-org:control-1-0" + +/** + * Definition for query state variable + */ +#define CG_UPNP_CONTROL_QUERY_STATE_VARIABLE "QueryStateVariable" + +/** + * Definition for query state variable response + */ +#define CG_UPNP_CONTROL_QUERY_STATE_VARIABLE_RESPONSE "QueryStateVariableResponse" + +/** + * Definition for control variable name + */ +#define CG_UPNP_CONTROL_VAR_NAME "varName" + +/** + * Definition for control return + */ +#define CG_UPNP_CONTROL_RETURN "return" + +/** + * Definition for control fault code + */ +#define CG_UPNP_CONTROL_FAULT_CODE "Client" + +/** + * Definition for contol fault string + */ +#define CG_UPNP_CONTROL_FAULT_STRING "UPnPError" + +/** + * Definition fro control error code + */ +#define CG_UPNP_CONTROL_ERROR_CODE "errorCode" + +/** + * Definition for control error description + */ +#define CG_UPNP_CONTROL_ERROR_DESCRIPTION "errorDescription" + +/**************************************** +* Data Type +****************************************/ + +/**** Action ****/ + +/** + * Data type definition for action response + */ +typedef struct _CgUpnpActionResponse { + CgSoapResponse *soapRes; + BOOL isSoapResCreated; + CgUpnpArgumentList *argList; +} CgUpnpActionResponse; + +/** + * Data type definition for action request + */ +typedef struct _CgUpnpActionRequest{ + CgSoapRequest *soapReq; + BOOL isSoapReqCreated; + CgUpnpArgumentList *argList; + CgUpnpActionResponse *actionRes; +} CgUpnpActionRequest; + +/**** Query ****/ + +/** + * Data type definition for query response + */ +typedef struct _CgUpnpQueryResponse { + CgSoapResponse *soapRes; + BOOL isSoapResCreated; +} CgUpnpQueryResponse; + +/** + * Data type definition for query request + */ +typedef struct _CgUpnpQueryRequest{ + CgSoapRequest *soapReq; + BOOL isSoapReqCreated; + CgUpnpQueryResponse *queryRes; +} CgUpnpQueryRequest; + +/**************************************** +* Function +****************************************/ + +/* After POST has failed we send M-POST and change the SOAPACTION header into 01-SOAPACTION. + * Next ensures that also in this case query is interpreted as a query. + */ + +/** + * Check if HTTP request query is UPnP query request + * + * @param httpReq HTTP request + * + * @return True if request is UPnP query request, false othewise + */ +#define cg_upnp_control_isqueryrequest(httpReq) ( ((0 <= cg_strstr(cg_soap_request_getsoapaction(httpReq), CG_UPNP_CONTROL_QUERY_SOAPACTION)) ? TRUE : FALSE) || ((0 <= cg_strstr(cg_soap_request_getsoapactionwithns(httpReq), CG_UPNP_CONTROL_QUERY_SOAPACTION)) ? TRUE : FALSE) ) + +/* Check if HTTP request is UPnP action request + * + * @param httpReq HTTP request + * + * @return True if request is UPnP action request, false otherwise + */ +#define cg_upnp_control_isactionrequest(httpReq) ((cg_upnp_control_isqueryrequest(httpReq) == TRUE) ? FALSE : TRUE) + +/** + * Initializes soap requests envelope node + * + * @param soapReq Soap request + */ +void cg_upnp_control_soap_request_initializeenvelopenode(CgSoapRequest *soapReq); + +/** + * Initialize soap responses envelope node + * + * @param soapRes Soap response + */ +void cg_upnp_control_soap_response_initializeenvelopenode(CgSoapResponse *soapRes); +CgXmlNode *cg_upnp_control_soap_response_createfaultresponsenode(int errCode, char *errDescr); + +/** + * Set failed response data + * + * @param soapRes Soap response + * @param errCode Error code + * @param errDescr Error description + */ +void cg_upnp_control_soap_response_setfaultresponse(CgSoapResponse *soapRes, int errCode, char *errDescr); + +/** + * Perform action listener + * + * @param action Action + * @param actionReq Action request + */ +BOOL cg_upnp_action_performlistner(CgUpnpAction *action, CgUpnpActionRequest *actionReq); + +/** + * Perform query listener + * + * @param statVar State variable + * @param queryReq Query request + */ +BOOL cg_upnp_statevariable_performlistner(CgUpnpStateVariable *statVar, CgUpnpQueryRequest *queryReq); + +/** + * Set host from service + * + * @param soapReq Soap request + * @param service UPnP service + */ +void cg_upnp_control_request_sethostfromservice(CgSoapRequest *soapReq, CgUpnpService *service); + +/**************************************** +* Function (ActionRequest) +****************************************/ + +/** + * Create new action request object + */ +CgUpnpActionRequest *cg_upnp_control_action_request_new(); + +/** + * Delete action request object + * + * @param actionReq Action request + */ +void cg_upnp_control_action_request_delete(CgUpnpActionRequest *actionReq); + +/** + * Clear action request + * + * @param actionReq Clear Action request + */ +void cg_upnp_control_action_request_clear(CgUpnpActionRequest *actionReq); + +/** + * Set soap request associated with action request + * + * @param actionReq Action request + * @param soapReq Soap request + */ +void cg_upnp_control_action_request_setsoaprequest(CgUpnpActionRequest *actionReq, CgSoapRequest *soapReq); + +/** + * Get soap request associated with action request + * + * @param actionReq Action request + * + * @return Soap request + */ +#define cg_upnp_control_action_request_getsoaprequest(actionReq) (actionReq->soapReq) + +/** + * Get argument list from action request + * + * @param actionReq Action request + * + * @return Argument list + */ +#define cg_upnp_control_action_request_getargumentlist(actionReq) (actionReq->argList) + +/** + * Get XML action node from action request + * + * @param actionReq + * + * @return Action request XML node + */ +CgXmlNode *cg_upnp_control_action_request_getactionnode(CgUpnpActionRequest *actionReq); + +/** + * Get action name from action request + * + * @param actionReq Action request + * + * @return Action name + */ +char *cg_upnp_control_action_request_getactionname(CgUpnpActionRequest *actionReq); + +/** + * Set action to action request + * + * @param actionReq Action request + * @param action UPnP action + */ +void cg_upnp_control_action_request_setaction(CgUpnpActionRequest *actionReq, CgUpnpAction *action); + +/** + * Get action response from action request + * + * @param actionReq Action request + * + * @return Action response + */ +#define cg_upnp_control_action_request_getactionresponse(actionReq) (actionReq->actionRes) + +/** + * Send action request + * + * @param actionReq Action request + */ +CgUpnpActionResponse *cg_upnp_control_action_request_post(CgUpnpActionRequest *actionReq); + +/**************************************** +* Function (ActionResponse) +****************************************/ + +/** + * Create new action response + */ +CgUpnpActionResponse *cg_upnp_control_action_response_new(); + +/** + * Delete action response + * + * @param actionReq Action response + */ +void cg_upnp_control_action_response_delete(CgUpnpActionResponse *actionReq); + +/** + * Clear action response + * + * @param actionReq Action response + */ +void cg_upnp_control_action_response_clear(CgUpnpActionResponse *actionReq); + +/** + * Set soap response to action response + * + * @param actionRes Action response + * @param soapRes Soap reaponse + */ +void cg_upnp_control_action_response_setsoapresponse(CgUpnpActionResponse *actionRes, CgSoapResponse *soapRes); + +/** + * Get soap response from action response + * + * @param actionRes Action response + * + * @return Soap response + */ +#define cg_upnp_control_action_response_getsoapresponse(actionRes) (actionRes->soapRes) + +/** + * Set action response to action + * + * @param actionRes Action response + * @param action UPnP action + */ +void cg_upnp_control_action_response_setresponse(CgUpnpActionResponse *actionRes, CgUpnpAction *action); + +/** + * Check if action response indicates that action invoke was successfull + * + * @param actionRes Action response + * + * @return True if action has been successful, false otherwise + */ +#define cg_upnp_control_action_response_issuccessful(actionRes) cg_soap_response_issuccessful(actionRes->soapRes) + +/** + * Get action response XML node from action response + * + * @param actionRes Action response + * + * @return Action response XML node + */ +CgXmlNode *cg_upnp_control_action_response_getactionresponsenode(CgUpnpActionResponse *actionRes); + +/** + * Get result from action response + * \todo Check this out more carefully + * + * @param actionRes Action response + * @param action UPnP action + */ +BOOL cg_upnp_control_action_response_getresult(CgUpnpActionResponse *actionRes, CgUpnpAction *action); + +/** + * Get error associated to action response + * \todo Check this out more carefully + * @param actionRes Action response + * @param action UPnP action + */ +BOOL cg_upnp_control_action_response_geterror(CgUpnpActionResponse *actionRes, CgUpnpAction *action); + +/**************************************** +* Function (QueryRequest) +****************************************/ + +/** + * Create new query request object + */ +CgUpnpQueryRequest *cg_upnp_control_query_request_new(); + +/** + * Delete query request + * + * @param queryReq Query request + */ +void cg_upnp_control_query_request_delete(CgUpnpQueryRequest *queryReq); + +/** + * Clear query request + * + * @param queryReq Query request + */ +void cg_upnp_control_query_request_clear(CgUpnpQueryRequest *queryReq); + +/** + * Set soap request for query request + * + * @param queryReq Query request + * @param soapReq Soap request + */ +void cg_upnp_control_query_request_setsoaprequest(CgUpnpQueryRequest *queryReq, CgSoapRequest *soapReq); + +/** + * Get soap request from query request + * + * @param queryReq + * + * @return Soap request + */ +#define cg_upnp_control_query_request_getsoaprequest(queryReq) (queryReq->soapReq) + +/** + * Get state variable XML node + * + * @param queryReq + * + * @return State variable XML node + */ +CgXmlNode *cg_upnp_control_query_request_getvarnamenode(CgUpnpQueryRequest *queryReq); + +/** + * Get state variable name associated with this query request + * + * @param queryReq Query request + * + * @return State variable variable name + */ +char *cg_upnp_control_query_request_getvarname(CgUpnpQueryRequest *queryReq); + +/** + * Set state variable to query request + * + * @param queryReq Query request + * @param statVar State variable + */ +void cg_upnp_control_query_request_setstatevariable(CgUpnpQueryRequest *queryReq, CgUpnpStateVariable *statVar); + +/** + * Get response from query request + * + * @param queryReq Query request + * + * @return Query response + */ +#define cg_upnp_control_query_request_getqueryresponse(queryReq) (queryReq->queryRes) + +/** + * Send query request + * + * @param queryReq Query request + * + * @return Query response + */ +CgUpnpQueryResponse *cg_upnp_control_query_request_post(CgUpnpQueryRequest *queryReq); + +/**************************************** +* Function (QueryResponse) +****************************************/ + +/** + * Create new query response + */ +CgUpnpQueryResponse *cg_upnp_control_query_response_new(); + +/** + * Delete query response + * + * @param queryReq Query request + */ +void cg_upnp_control_query_response_delete(CgUpnpQueryResponse *queryReq); + +/** + * Clear query response + * + * @param queryReq Query request + */ +void cg_upnp_control_query_response_clear(CgUpnpQueryResponse *queryReq); + +/** + * Set soap response for query response + * + * @param queryRes Query response + * @param soapRes Soap response + */ +void cg_upnp_control_query_response_setsoapresponse(CgUpnpQueryResponse *queryRes, CgSoapResponse *soapRes); + +/** + * Get soap response from query response + * + * @param queryRes Query response + * + * @return Soap response + */ +#define cg_upnp_control_query_response_getsoapresponse(queryRes) (queryRes->soapRes) + +/** + * Create and set XML response data into query response + * + * @param queryRes Query response + * @param statVar State variable + */ +void cg_upnp_control_query_response_setresponse(CgUpnpQueryResponse *queryRes, CgUpnpStateVariable *statVar); + +/** + * Check if query response indicates that query request has succeeded + * + * @param queryRes Query response + */ +#define cg_upnp_control_query_response_issuccessful(queryRes) cg_soap_response_issuccessful(queryRes->soapRes) + +/** + * Get XML return node from query response + * + * @param queryRes + * + * @return XML return node + */ +CgXmlNode *cg_upnp_control_query_response_getreturnnode(CgUpnpQueryResponse *queryRes); + +/** + * Get return valuse from query response + * + * @param queryRes Query response + * + * @return UPnP return value + */ +char *cg_upnp_control_query_response_getreturnvalue(CgUpnpQueryResponse *queryRes); + +/**************************************** +* Function (MAN) +****************************************/ + +/** + * Check if string is correct mandatory header value as specified + * in UPnP Device Architecture 1.2.2 + * + * @param str String to be checked + * + * @return True if string is exactly the required one, false otherwise + */ +#define cg_upnp_man_isdiscover(str) ((0 == cg_strstr(str, CG_UPNP_MAN_DISCOVER)) ? TRUE : FALSE) + +/**************************************** +* Function (ST) +****************************************/ + +/** + * Check if device is of type "all" + * + * @param str String to be checked + * + * @return True if device type is "all", false otherwise + */ +#define cg_upnp_st_isalldevice(str) ((0 <= cg_strstr(str, CG_UPNP_ST_ALL_DEVICE)) ? TRUE : FALSE) + +/** + * Check if device string is from root device + * + * @param str String to be checked + * + * @return True if string is from device type "root device", false otherwise + */ +#define cg_upnp_st_isrootdevice(str) ((0 <= cg_strstr(str, CG_UPNP_ST_ROOT_DEVICE)) ? TRUE : FALSE) + +/** + * Check if string is from uuid device + * + * @param str String to be checked + * + * @return True if string is from uuid device, false otherwise + */ +#define cg_upnp_st_isuuiddevice(str) ((0 <= cg_strstr(str, CG_UPNP_ST_UUID_DEVICE)) ? TRUE : FALSE) + +/** + * Check if string is from urn + * + * @param str String to be checked + * + * @return True if string is from urn, false otherwise + */ +#define cg_upnp_st_isurn(str) ((0 <= cg_strstr(str, CG_UPNP_ST_URN)) ? TRUE : FALSE) + +/** + * Check if string is from urn device + * + * @param str String to be checked + * + * @return True if string is from urn device, false otherwise + */ +#define cg_upnp_st_isurndevice(str) ((0 <= cg_strstr(str, CG_UPNP_ST_URN_DEVICE)) ? TRUE : FALSE) + +/** + * Check if string is from urn service + * + * @param str String to be checked + * + * @return True if string is from urn service, false otherwise + */ +#define cg_upnp_st_isurnservice(str) ((0 <= cg_strstr(str, CG_UPNP_ST_URN_SERVICE)) ? TRUE : FALSE) + +/**************************************** +* Function (NT) +****************************************/ + +/** + * Check if NT (notification target) is for root device + * + * @param str String to be checked + * + * @return True if NT is for root device, false otherwise + */ +#define cg_upnp_nt_isrootdevice(str) ((0 <= cg_strstr(str, CG_UPNP_NT_ROOTDEVICE)) ? TRUE : FALSE) + +/**************************************** +* Function (NTS) +****************************************/ + +/** + * Check if NTS (notification sub target) is of type "alive" + * + * @param str String to be checked + * + * @return True if string is of type "alive", false otherwise + */ +#define cg_upnp_nts_isalive(str) ((0 <= cg_strstr(str, CG_UPNP_NTS_ALIVE)) ? TRUE : FALSE) + +/** + * Check if string type is "byebye" + * + * @param str String to be checked + * + * @return True if string is of type "byebye", false othewise + */ +#define cg_upnp_nts_isbyebye(str) ((0 <= cg_strstr(str, CG_UPNP_NTS_BYEBYE)) ? TRUE : FALSE) + +/** + * Check if string type is "property change" + * + * @param str String to be checked + * + * @return True if string type is "property change" + */ +#define cg_upnp_nts_ispropchange(str) ((0 <= cg_strstr(str, CG_UPNP_NTS_PROPCHANGE)) ? TRUE : FALSE) + +/**************************************** +* Function (USN) +****************************************/ + +/** + * Check if usn is from root device + * + * @param str String to be checked + * + * @return True if usn associates to root device, false otherwise + */ +#define cg_upnp_usn_isrootdevice(str) ((0 <= cg_strstr(str, CG_UPNP_USN_ROOTDEVICE)) ? TRUE : FALSE) + +/** + * Get udn from usn + * + * @param usn Universal serial number + * @param udnBuf Buffer where udn is stored after successfull execution + * @param udnBufLen Buffer length for udnBuf + * + * @return Pointer to beginning of udnBuf. + */ +char *cg_upnp_usn_getudn(char *usn, char *udnBuf, int udnBufLen); + +/**************************************** +* Function (Action) +****************************************/ + +/** + * Send action + * + * @param action Action + */ +BOOL cg_upnp_action_post(CgUpnpAction *action); + +/**************************************** +* Function (Query) +****************************************/ + +/** + * Send query + * + * @param statVar State variable + */ +BOOL cg_upnp_statevariable_post(CgUpnpStateVariable *statVar); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cservice.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cservice.h new file mode 100644 index 0000000..603fc01 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cservice.h @@ -0,0 +1,819 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cservice.h +* +* Revision: +* +* 02/14/05 +* - first revision +* +* 09-Jan-06 Heikki Junnila +* - Added service type parsing functions: +* cg_upnp_servicetype_getidentifier +* cg_upnp_servicetype_geturn +* cg_upnp_servicetype_getservice +* cg_upnp_servicetype_gettype +* cg_upnp_servicetype_getversion +* +* 10-Jan-06 Heikki Junnila +* - Added cg_upnp_servicetype_getschematype() and fixed +* existing servicetype functions to accept 1-character strings +* +* 11-Jan-06 Heikki Junnila +* - Removed cg_upnp_service_isname() and _getname() because +* according to UPnP specs, services have only types, not names +* +* 17-Jan-06 Heikki Junnila +* - Added API comments +* 04/05/06 Theo Beisch +* - changed timeout to use subscriber object +* when used by ControlPoint +* modified execution data accordingly +* +******************************************************************/ + +#ifndef _CG_UPNP_CSERVICE_H_ +#define _CG_UPNP_CSERVICE_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************************************************** +* Define +*****************************************************************************/ + +#define CG_UPNP_SERVICE_ELEM_NAME "service" +#define CG_UPNP_SERVICELIST_ELEM_NAME "serviceList" + +#define CG_UPNP_SERVICE_TYPE "serviceType" +#define CG_UPNP_SERVICE_ID "serviceId" +#define CG_UPNP_SERVICE_SCPDURL "SCPDURL" +#define CG_UPNP_SERVICE_CONTROL_URL "controlURL" +#define CG_UPNP_SERVICE_EVENT_SUB_URL "eventSubURL" +#define CG_UPNP_SERVICE_EVENT_KEY_INVALID 0 +#define CG_UPNP_SERVICE_NOTIFY_WAITTIME 1000 + +/**************************************************************************** +* Data Type +*****************************************************************************/ + +typedef struct _CgUpnpService { + BOOL headFlag; + struct _CgUpnpService *prev; + struct _CgUpnpService *next; + CgXmlNodeList *scpdNodeList; + CgXmlNode *serviceNode; + CgUpnpActionList *actionList; + CgUpnpServiceStateTable *serviceStateTable; + void *parentDevice; + CgMutex *mutex; +#if !defined(CG_UPNP_NOUSE_SUBSCRIPTION) + CgUpnpSubscriberList *subscriberList; +#endif + BOOL parsed; + /**** Execution Data ****/ + CgString *subscriptionSid; + long subscriptionTimeout; + + void *userData; + unsigned int eventKey; + CgSysTime subscriptionTimestamp; +} CgUpnpService, CgUpnpServiceList; + +/**************************************** +* Function (Service) +****************************************/ + +/** + * Create a new UPnP service + */ +CgUpnpService *cg_upnp_service_new(); + +/** + * Destroy a UPnP service + * + * @param service The service to destroy + */ +void cg_upnp_service_delete(CgUpnpService *service); + +/** + * Clear the contents of a UPnP service + * + * @param service The service to clear + */ +void cg_upnp_service_clear(CgUpnpService *service); + +/** + * Get the next service in a service list. Use as an iterator. + * + * @param service Current service + */ +#define cg_upnp_service_next(service) (CgUpnpService *)cg_list_next((CgList *)service) + +/** + * Check, whether the given XML node is a service root node + * + * @param node CgXmlNode* + * @return TRUE if the node is a service root node; otherwise FALSE + */ +#define cg_upnp_service_isservicenode(node) cg_xml_node_isname(node, CG_UPNP_SERVICE_ELEM_NAME) + +/** + * Get the service's SCPD node + * + * @param service The service in question + */ +#define cg_upnp_service_getscpdnode(service) cg_xml_nodelist_gets(service->scpdNodeList) + +/** + * Set the root XML node for the service + * + * @param service The service in question + * @param node The node to set + */ +#define cg_upnp_service_setservicenode(service,node) (service->serviceNode = node) + +/** + * Get the root XML node for the service + * + * @param service The service in question + */ +#define cg_upnp_service_getservicenode(service) (service->serviceNode) + +/** + * Get the parent device's XML node for the service + * + * @param service The service in question + */ +#define cg_upnp_service_getdevicenode(service) cg_xml_node_getparentnode(cg_xml_node_getparentnode(service->serviceNode)) + +/** + * Create the service's contents from the given XML document + * + * @param service The service to create + * @param description The XML document to parse + * @param descriptionLen The length of the XML document + */ +BOOL cg_upnp_service_parsedescription(CgUpnpService *service, char *description, int descriptionLen); + +/** + * Create the service's contents from the given URL. Gets the XML document + * from the URL and passes it again to @ref cg_upnp_service_parsedescription + * + * @param service The service to create + * @param url The URL of the document to parse + */ +BOOL cg_upnp_service_parsedescriptionurl(CgUpnpService *service, CgNetURL *url); + +/** + * Get the service's description XML nodes as a string + * + * @param service The service in question + * @param descStr The description string + */ +char *cg_upnp_service_getdescription(CgUpnpService *service, CgString *descStr); + +/** + * Get the service's parsing status (i.e. whether the service has been + * completely constructed). Useful mainly in optimized control point mode. + * + * @param service The service in question + */ +#define cg_upnp_service_isparsed(service) (service->parsed) + +/**************************************************************************** + * serviceType + ****************************************************************************/ + +/** + * Set the service's complete type string + * (ex. "urn:schemas-upnp-org:service:FooService:1") + * + * @param service The service in question + * @param value The type string + */ +#define cg_upnp_service_setservicetype(service, value) cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_TYPE, value) + +/** + * Get the service's complete type string + * (ex. "urn:schemas-upnp-org:service:FooService:1") + * + * @param service The service in question + * @return char* + */ +#define cg_upnp_service_getservicetype(service) cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_TYPE) + +/** + * Get the identifier-part of a service type string (usually "urn") + * + * @param serviceType A service type string (usually the result from + * \ref cg_upnp_service_getservicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_servicetype_getidentifier(char* serviceType); + +/** + * Get the URN part of a service type string (usually "schemas-upnp-org") + * + * @param serviceType A service type string (usually the result from + * \ref cg_upnp_service_getservicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_servicetype_geturn(char* serviceType); + +/** + * Get the service part of a service type string (usually just "service") + * + * @param serviceType A service type string (usually the result from + * \ref cg_upnp_service_getservicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_servicetype_getservice(char* serviceType); + +/** + * Get the type part of a service type string (ex. "ContentDirectory") + * + * @param serviceType A service type string (usually the result from + * \ref cg_upnp_service_getservicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_servicetype_gettype(char* serviceType); + +/** + * Get the schema type part of a service type string (without last colon) + * (ex. "urn:schemas-upnp-org:service:ContentDirectory") + * + * @param serviceType A service type string (usually the result from + * \ref cg_upnp_service_getservicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_servicetype_getschematype(char* serviceType); + +/** + * Get the version part of a service type string (ex. "1") + * + * @param serviceType A service type string (usually the result from + * \ref cg_upnp_service_getservicetype) + * + * @return A newly-created char* if successful; otherwise NULL + */ +char* cg_upnp_servicetype_getversion(char* serviceType); + +/**************************************************************************** + * serviceID + ****************************************************************************/ + +/** + * Set the service's service ID + * + * @param service The service in question + * @param value Service ID string + */ +#define cg_upnp_service_setserviceid(service, value) cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_ID, value) + +/** + * Get the service's service ID + * + * @param service The service in question + * @return char* + */ +#define cg_upnp_service_getserviceid(service) cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_ID) + +/**************************************************************************** + * SCPDURL + ****************************************************************************/ + +/** + * Set the service's SCPD (service description) URL + * + * @param service The service in question + * @param value The SCPD URL string + */ +#define cg_upnp_service_setscpdurl(service, value) cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_SCPDURL, value) + +/** + * Get the service's SCPD (service description) URL + * + * @param service The service in question + * @return CgNetURL Pointer to URL/URI structure + */ + +CgNetURL *cg_upnp_service_getscpdurl(CgUpnpService *service); + +/** + * Compare the service's SCPD URL and the given location + * + * @param service The service in question + * @param url The URL (location) to compare + * @return TRUE if location is found from URL; otherwise FALSE + */ +BOOL cg_upnp_service_isscpdurl(CgUpnpService *service, char *url); + +/**************************************************************************** + * controlURL + ****************************************************************************/ + +/** + * Set the service's control URL + * + * @param service The service in question + * @param value The control URL string + */ +#define cg_upnp_service_setcontrolurl(service, value) cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_CONTROL_URL, value) + +/** + * Get the service's control URL + * + * @param service The service in question + * @return CgNetURL Pointer to URL/URI structure + */ +CgNetURL *cg_upnp_service_getcontrolurl(CgUpnpService *service); + +/**************************************************************************** + * eventSubURL + ****************************************************************************/ + +/** + * Get the service's event subscription URL + * + * @param service The service in question + * @param value The event subscription URL string + */ +#define cg_upnp_service_seteventsuburl(service, value) cg_xml_node_setchildnode(cg_upnp_service_getservicenode(service), CG_UPNP_SERVICE_EVENT_SUB_URL, value) + +/** + * Get the service's event subscription URL + * + * @param service The service in question + * @return CgNetURL Pointer to URL/URI structure + */ +CgNetURL *cg_upnp_service_geteventsuburl(CgUpnpService *service); + +/**************************************************************************** + * Action + ****************************************************************************/ + +/** + * Get the service's list of actions (head of list) + * + * @param service The service in question + */ +CgUpnpActionList *cg_upnp_service_getactionlist(CgUpnpService *service); + +/** + * Get the first action in the service's list of actions. Use as the + * starting point in iteration loops. + * + * @param service The service in question + */ +CgUpnpAction *cg_upnp_service_getactions(CgUpnpService *service); + +/** + * Get an action from the service by the action's name + * + * @param service The service in question + * @param name The name of the action to look for + * @return CgUpnpAction* or NULL + */ +CgUpnpAction *cg_upnp_service_getactionbyname(CgUpnpService *service, char *name); + +/** + * Check, whether a service has an action by the given name + * + * @param service The service in question + * @param name The name of the action + */ +#define cg_upnp_service_hasactionbyname(service, name) ((cg_upnp_service_getactionbyname(service,name) != NULL) ? TRUE : FALSE) + +/**************************************************************************** + * ServiceStateTable + ****************************************************************************/ + +/** + * Get the service's state table + * + * @param service The service in question + */ +CgUpnpServiceStateTable *cg_upnp_service_getservicestatetable(CgUpnpService *service); + +/** + * Get the first state variable in the service's state table. Use as the + * starting point in iteration loops. + * + * @param service The service in question + */ +CgUpnpStateVariable *cg_upnp_service_getstatevariables(CgUpnpService *service); + +/** + * Get a state variable from the service's state table by the variable's name + * + * @param service The service in question + * @param name the name of the variable + * @return CgUpnpStateVariable* or NULL + */ +CgUpnpStateVariable *cg_upnp_service_getstatevariablebyname(CgUpnpService *service, char *name); + +/** + * Check, whether the service has the given state variable + * + * @param service The service in question + * @param name The name of the state variable + * @return TRUE if found; otherwise FALSE + */ +#define cg_upnp_service_hasstatevariablebyname(service, name) ((cg_upnp_service_getstatevariablebyname(service,name) != NULL) ? TRUE : FALSE) + +/**************************************************************************** + * Advertisement + ****************************************************************************/ + +/** + * Send a service announcement (advertisement) from the given address + * + * @param service The service to advertise + * @param bindAddr The address to attach to the announcement + */ +BOOL cg_upnp_service_announcefrom(CgUpnpService *service, char *bindAddr); + +/** + * Send a byebye announcement (i.e. a cancelling advertisement) from the given + * address + * + * @param service The service to announce from + * @param bindAddr The address to attach to the announcement + */ +BOOL cg_upnp_service_byebyefrom(CgUpnpService *service, char *bindAddr); + +/**************************************************************************** + * Listener + ****************************************************************************/ + +/** + * Set an action listener to the service + * + * @param service The service in question + * @param actionListener A callback function of type CG_UPNP_ACTION_LISTNER + */ +void cg_upnp_service_setactionlistener(CgUpnpService *service, CG_UPNP_ACTION_LISTNER actionListener); + +/** + * Set a query listener to the service + * + * @param service The service in question + * @param queryListener A callback function of type CG_UPNP_STATEVARIABLE_LISTNER + */ +void cg_upnp_service_setquerylistener(CgUpnpService *service, CG_UPNP_STATEVARIABLE_LISTNER queryListener); + +/**************************************************************************** + * Parent Device + ****************************************************************************/ + +/** + * Set the service's parent device + * + * @param service The service in question + * @param dev The parent device + */ +#define cg_upnp_service_setdevice(service, dev) (service->parentDevice = dev) + +/** + * Get the service's parent device + * + * @param service The service in question + * @return CgUpnpDevice* + */ +#define cg_upnp_service_getdevice(service) ((CgUpnpDevice *)service->parentDevice) + +/**************************************************************************** + * Root Device + ****************************************************************************/ + +/** + * Get the service's top-most root device + * + * @param service The service in question + * @return CgUpnpDevice* + */ +#define cg_upnp_service_getrootdevice(service) cg_upnp_device_getrootdevice((CgUpnpDevice *)service->parentDevice) + +/**************************************************************************** + * Subscriber + ****************************************************************************/ + +/** + * Get the first node in the service's list of event subscribers. Use as the + * starting point in iteration loops. + * + * @param service The service in question + */ +#define cg_upnp_service_getsubscribers(service) cg_upnp_subscriberlist_gets(service->subscriberList) + +/** + * Get the number of subscribers for the service + * + * @param service The service in question + * @return int + */ +#define cg_upnp_service_getnsubscribers(service) cg_upnp_subscriberlist_size(service->subscriberList) + +/** + * Add a subscriber to the service + * + * @param service The service in question + * @param sub The subscriber + */ +BOOL cg_upnp_service_addsubscriber(CgUpnpService *service, CgUpnpSubscriber *sub); + +/** + * Remove a subscriber from the service + * + * @param service The service in question + * @param sub The subscriber to remove + */ +BOOL cg_upnp_service_removesubscriber(CgUpnpService *service, CgUpnpSubscriber *sub); + +/** + * Find a subscriber from the service's list of subscribers by its SID + * (Subscription ID) + * + * @param service The service in question + * @param sid The SID + */ +CgUpnpSubscriber *cg_upnp_service_getsubscriberbysid(CgUpnpService *service, char *sid); + +/**************************************************************************** + * Announce + ****************************************************************************/ + +char *cg_upnp_service_getnotifyservicetypent(CgUpnpService *service, char *buf, int bufSize); +char *cg_upnp_service_getnotifyservicetypeusn(CgUpnpService *service, char *buf, int bufSize); + +/**************************************************************************** + * Notify + ****************************************************************************/ + +/** + * Send a notification of a service's changed state variable + * + * @param service The service in question + * @param statVar The changed state variable + */ +BOOL cg_upnp_service_notify(CgUpnpService *service, CgUpnpStateVariable *statVar); + +/** + * Send a notification message to all of the service's subscribers + * + * @param service The service in question + */ +BOOL cg_upnp_service_notifyall(CgUpnpService *service, BOOL doBracket ); + +/** +* Create a new thread to send a notification message to all of the service's subscribers +* + * @param service The service in question +* @param waitTime The wait time to send +*/ +void cg_upnp_service_createnotifyallthread(CgUpnpService *service, CgSysTime waitTime); + +/** + * Send a notification message to all of the service's subscribers + * + * @param service The service in question + * @deprecated Use cg_upnp_service_notifyall(). + */ +#define cg_upnp_service_notifyallstatevariables(service) cg_upnp_service_notifyall(service, FALSE); + +/**************************************************************************** + * Mutex + ****************************************************************************/ + +/** + * Lock the service's mutex + * + * @param service The service in question + */ +#define cg_upnp_service_lock(service) cg_mutex_lock(service->mutex) + +/** + * Unlock the service's mutex + * + * @param service The service in question + */ +#define cg_upnp_service_unlock(service) cg_mutex_unlock(service->mutex) + +/**************************************************************************** + * SID + ****************************************************************************/ + +/** + * Set the service's subscription's SID (subscription ID) + * + * @param service The service in question + * @param value The SID + */ +#define cg_upnp_service_setsubscriptionsid(service, value) cg_string_setvalue(service->subscriptionSid, value) + +/** + * Get the service's SID (subscription ID) + * + * @param service The service in question + * @return char* + */ +#define cg_upnp_service_getsubscriptionsid(service) cg_string_getvalue(service->subscriptionSid) + +/** + * Check, whether the service has any subscribers + * + * @param service The service in question + * @return TRUE if at least one subscriber is found; otherwise FALSE + */ +#define cg_upnp_service_issubscribed(service) ((0 < cg_string_length(service->subscriptionSid)) ? TRUE : FALSE) + +/** + * Clear (i.e. empty) the service's SID (subscription ID) + * + * @param service The service in question + */ +#define cg_upnp_service_clearsubscriptionsid(service) cg_string_setvalue(service->subscriptionSid, "") + +/**************************************************************************** + * Timeout + ****************************************************************************/ + +/** + * Set the service's subscription timeout (expiration) value + * + * @param service The service in question + * @param value The timeout value + */ +#define cg_upnp_service_setsubscriptiontimeout(service, value) (service->subscriptionTimeout = value) + +/** + * Get the service's subscription timeout (expiration) value + * + * @param service The service in question + * @return long + */ +#define cg_upnp_service_getsubscriptiontimeout(service) (service->subscriptionTimeout) + +/**************************************************************************** + * User Data + ****************************************************************************/ + +/** + * Set the service's arbitrary user data pointer + * + * @param service The service in question + * @param value The user data pointer + */ +#define cg_upnp_service_setuserdata(service, value) (service->userData = value) + +/** + * Get the service's arbitrary user data pointer + * + * @param service The service in question + * @return void* + */ +#define cg_upnp_service_getuserdata(service) (service->userData) + +/**************************************************************************** + * Event Key + ****************************************************************************/ + +/** + * Set the service's event key (i.e. the sequential number used in events) + * + * @param service The service in question + * @param value The event key value (uint) + */ +#define cg_upnp_service_seteventkey(service, value) (service->eventKey = value) + +/** + * Get the service's event key + * + * @param service The service in question + * @return uint + */ +#define cg_upnp_service_geteventkey(service) (service->eventKey) + +/**************************************************************************** + * Timestamp + ****************************************************************************/ + +/** + * Set the service's subscription time stamp + * + * @param service The service in question + * @param value The time stamp + */ +#define cg_upnp_service_setsubscriptiontimestamp(service, value) (service->subscriptionTimestamp = value) + +/** + * Get the service's subscription time stamp + * + * @param service The service in question + * @return CgSysTime + */ +#define cg_upnp_service_getsubscriptiontimestamp(service) (service->subscriptionTimestamp) + +/** + * Get the service's subscription expiration time + * + * @param service The service in question + * @return CgSysTime + */ +#define cg_upnp_service_getsubscriptionexpiration(service) (service->subscriptionTimestamp + service->subscriptionTimeout - CG_UPNP_SUBSCRIPTION_DELAY) + + +/**************************************************************************** + * Function (ServiceList) + ****************************************************************************/ + +/** + * Create a new list of services + */ +CgUpnpServiceList *cg_upnp_servicelist_new(); + +/** + * Destroy a list of services + * + * @param serviceList The list of services to destroy + */ +void cg_upnp_servicelist_delete(CgUpnpServiceList *serviceList); + + +/** + * Clear the contents of a list of services + * + * @param serviceList The list of services to clear + */ +#define cg_upnp_servicelist_clear(serviceList) cg_list_clear((CgList *)serviceList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_service_delete) + +/** + * Get the number of services in a list of services + * + * @param serviceList The list of services + * @return int + */ +#define cg_upnp_servicelist_size(serviceList) cg_list_size((CgList *)serviceList) + +/** + * Get the first service in a list of services. Use as the starting point in + * iteration loops. + * + * @param serviceList The service list + */ +#define cg_upnp_servicelist_gets(serviceList) (CgUpnpService *)cg_list_next((CgList *)serviceList) + +/** + * Add a service to a list of services + * + * @param serviceList The list to add the service to + * @param service The service to add to the list + */ +#define cg_upnp_servicelist_add(serviceList, service) cg_list_add((CgList *)serviceList, (CgList *)service) + +/**************************************************************************** + * Function (SSDP) + ****************************************************************************/ + +/** + * The service's handler function that deals with received SSDP messages. + * + * @param service The service in question + * @param ssdpPkt The received SSDP packet + */ +void cg_upnp_service_ssdpmessagereceived(CgUpnpService *service, CgUpnpSSDPPacket *ssdpPkt); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cstatevariable.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cstatevariable.h new file mode 100644 index 0000000..800966e --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cstatevariable.h @@ -0,0 +1,473 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cstatevariable.h +* +* Revision: +* +* 02/23/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CSTATEVARIABLE_H_ +#define _CG_UPNP_CSTATEVARIABLE_H_ + +#include +#include +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/** + * Definition for state variable XML element name + */ +#define CG_UPNP_STATEVARIABLE_ELEM_NAME "stateVariable" + +/** + * Definition for service state table XML element name + */ +#define CG_UPNP_SERVICESTATETALBE_ELEM_NAME "serviceStateTable" + +/** + * Definition for state variable name element + */ +#define CG_UPNP_STATEVARIABLE_NAME "name" + +/** + * Definition for state variable data type element + */ +#define CG_UPNP_STATEVARIABLE_DATATYPE "dataType" + +/** + * Definition for state variable send events element name + */ +#define CG_UPNP_STATEVARIABLE_SENDEVENTS "sendEvents" + +/** + * Definition for state variable send events element value + */ +#define CG_UPNP_STATEVARIABLE_SENDEVENTS_YES "yes" + +/** + * Definition for state variable send events element value + */ +#define CG_UPNP_STATEVARIABLE_SENDEVENTS_NO "no" + +/** + * Definition for state variable allowed values list + */ +#define CG_UPNP_STATEVARIABLE_ALLOWEDVALUELIST "allowedValueList" + + +/**************************************** +* Data Type +****************************************/ + +/** + * Data type for allowed state variables allowed values table + */ +typedef struct _CgUpnpAllowedValuesList { + BOOL headFlag; + struct _CgUpnpAllowedValuesList *prev; + struct _CgUpnpAllowedValuesList *next; + CgString *value; +} CgUpnpAllowedValuesList, CgUpnpAllowedValue; + + +/** + * Data type for state variable and state table + */ +typedef struct _CgUpnpStateVariable { + BOOL headFlag; + struct _CgUpnpStateVariable *prev; + struct _CgUpnpStateVariable *next; + CgUpnpAllowedValuesList* allowedValueList; + //tb: fixmelater verify type CgUpnpService* ??? + void *parentService; + CgXmlNode *stateVarNode; + /* Dummy pointers to maintain ABI, Please remove during the + * appropriate development stage */ + void *dummy1; + void *dummy2; + /**** Execution Data ****/ + CgString *value; + BOOL (*listener)(struct _CgUpnpStateVariable *); + CgUpnpStatus *upnpStatus; + void *userData; + +} CgUpnpStateVariable, CgUpnpServiceStateTable; + + +/** + * Type definition for state variable listener function + */ +typedef BOOL (*CG_UPNP_STATEVARIABLE_LISTNER)(CgUpnpStateVariable *); + +/**************************************** +* Function (StateVariable) +****************************************/ + +/** + * Create new state variable object + */ +CgUpnpStateVariable *cg_upnp_statevariable_new(); + +/** + * Delete state variable object + * + * @param statVar state variable + */ +void cg_upnp_statevariable_delete(CgUpnpStateVariable *statVar); + +/** + * Get next element from state variable list + * + * @param statVar state variable list node + */ +#define cg_upnp_statevariable_next(statVar) (CgUpnpStateVariable *)cg_list_next((CgList *)statVar) + +/** + * Check if XML node is state variable node + * + * @param node XML node + */ +#define cg_upnp_statevariable_isstatevariablenode(node) cg_xml_node_isname(node, CG_UPNP_STATEVARIABLE_ELEM_NAME) + +/**** XML Node ****/ + +/** + * Set XML node for this state variable + * + * @param statVar State variable + * @param node XML node + */ +void cg_upnp_statevariable_setstatevariablenode(CgUpnpStateVariable *statVar, CgXmlNode *node); + +/** + * Get XML node from this state variable + * + * @param statVar State variable + */ +#define cg_upnp_statevariable_getstatevariablenode(statVar) (statVar->stateVarNode) + +/**** Service ****/ + +/** + * Set service for this state variable + * + * @param statVar State variable + * @param service Service + */ +#define cg_upnp_statevariable_setservice(statVar, service) (statVar->parentService = service) + +/** + * Get service from state variable + * + * @param statVar State variable + * + * @return UPnP service + */ +#define cg_upnp_statevariable_getservice(statVar) ((CgUpnpService *)statVar->parentService) + +/**** allowedValueList ****/ + +/** + * Get allowed value list + * + * @param statVar State variable + * + * @return Allowed value list + */ +CgUpnpAllowedValuesList* cg_upnp_statevariable_getallowedvaluelist(CgUpnpStateVariable* statVar); + +/** + * Check if state variable has allowed value list + * + * @param statVar State variable + * + * @return 0 if it does not have allowed value list integer greater than zero otherwise + */ +#define cg_upnp_statevariable_hasallowedvaluelist(statVar) cg_upnp_allowedvaluelist_size(statVar->allowedValueList) + +/** + * Check if state variable allowes to receive value + * + * @parap value value to be checked + * @param statVar State variable + * + * @return 0 if it does allowed to receive value +*/ +int cg_upnp_statevariable_is_allowed_value(CgUpnpStateVariable* statVar, const char* value); + + +/** + * Create new allowed state variable values list + */ +CgUpnpAllowedValuesList* cg_upnp_allowedvaluelist_new(); + +/**** allowedValueRange ****/ + +/** + * Get allowed value range for state variable + * + * @param statVar State variable + * + * @return Allowed value range + */ +#define cg_upnp_statevariable_getallowedvaluerange(statVar) (statVar->allowedValueRange) + +/** + * Checks if state variable has allowed variable range + * + * @param statVar State variable + * + * @return True if allowed value range exists, false otherwise + */ +#define cg_upnp_statevariable_hasallowedvaluerange(statVar) ((statVar->allowedValueRange != NULL) ? TRUE : FALSE) + +/**** name ****/ + +/** + * Set state variable name + * + * @param statVar State variable + * @param value New state variable name + */ +#define cg_upnp_statevariable_setname(statVar, value) cg_xml_node_setchildnode(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_NAME, value) + +/** + * Get state variable name + * + * @param statVar State variable + * + * @return State variable name + */ +#define cg_upnp_statevariable_getname(statVar) cg_xml_node_getchildnodevalue(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_NAME) + +/** + * Checks if state variable has certain name + * + * @param statVar State variable + * @param name Name to be checked + * + * @return True if State variable name is same as provided, false otherwise + */ +#define cg_upnp_statevariable_isname(statVar, name) cg_streq(cg_upnp_statevariable_getname(statVar), name) + +/**** dataType ****/ + +/** + * Set data type for state variable + * + * @param statVar State variable + * @param value Data type + */ +#define cg_upnp_statevariable_setdatatype(statVar, value) cg_xml_node_setchildnode(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_DATATYPE, value) + +/** + * Get data type from state variable + * + * @param statVar State variable + * + * @return Data type + */ +#define cg_upnp_statevariable_getdatatype(statVar) cg_xml_node_getchildnodevalue(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_DATATYPE) + +/**** sendEvents ****/ + +/** + * Set send events option for state variable, can be used to disable eventing + * for certain variables. + * + * @param statVar State variable + * @param value New value + */ +#define cg_upnp_statevariable_setsendevents(statVar, value) cg_xml_node_setattribute(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_SENDEVENTS, value) + +/** + * Get state variable event sending option value + * + * @param statVar State variable + * + * @return Current value associated to state variable + */ +#define cg_upnp_statevariable_getsendevents(statVar) cg_xml_node_getattributevalue(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_SENDEVENTS) + +/** + * Check if events are sent to subscribers when this state variable changes + * + * @param statVar State variable + * + * @return True if events are sent, false otherwise + */ +#define cg_upnp_statevariable_issendevents(statVar) (cg_streq(cg_upnp_statevariable_getsendevents(statVar), CG_UPNP_STATEVARIABLE_SENDEVENTS_YES)) + +/**************************************** +* Function (StateVariable - Execution Data) +****************************************/ + +/**** value ****/ + +/** + * Set state variable value + * + * @param statVar State variable + * @param data New value associated with this state variable, and the value is send to other devices which subscribe the service. + */ +void cg_upnp_statevariable_setvalue(CgUpnpStateVariable *statVar, char *data); + +/** + * Set state variable value + * + * @param statVar State variable + * @param data New value associated with this state variable + */ +void cg_upnp_statevariable_setvaluewithoutnotify(CgUpnpStateVariable *statVar, char *data); + +/** + * Get value associated with this state variable + * + * @param statVar State variable + * + * @return Value associated with this state variable + */ +#define cg_upnp_statevariable_getvalue(statVar) cg_string_getvalue(statVar->value) + +/*** listener ****/ + +/** + * Set listener callback for this state variable + * + * @param statVar State variable + * @param func Listener function + */ +#define cg_upnp_statevariable_setlistener(statVar, func) (statVar->listener = func) + +/** + * Get lister function associated with state variable + * + * @param statVar State variable + */ +#define cg_upnp_statevariable_getlistener(statVar) (statVar->listener) + +/**** UPnPStatus ****/ + +/** + * Set status code for state variable + * + * @param statVar State variable + * @param code Status code + */ +#define cg_upnp_statevariable_setstatuscode(statVar, code) cg_upnp_status_setcode(statVar->upnpStatus, code) + +/** + * Get status code of this state variable + * + * @param statVar Status variable + */ +#define cg_upnp_statevariable_getstatuscode(statVar) cg_upnp_status_getcode(statVar->upnpStatus) + +/** + * Set status description for state variable + * + * @param statVar State variable + * @param value Status description + */ +#define cg_upnp_statevariable_setstatusdescription(statVar, value) cg_upnp_status_setdescription(statVar->upnpStatus, value) + +/** + * Get status description from this state variable + * + * @param statVar State variable + */ +#define cg_upnp_statevariable_getstatusdescription(statVar) cg_upnp_status_getdescription(statVar->upnpStatus) + +/**** User Data****/ + +/** + * Set arbitrary user data associated with this state variable + * + * @param statVar State variable + * @param value Data + */ +#define cg_upnp_statevariable_setuserdata(statVar, value) (statVar->userData = value) + +/** + * Get user data from this state variable + * + * @param statVar State variable + * + * @return User data + */ +#define cg_upnp_statevariable_getuserdata(statVar) (statVar->userData) + +/**************************************** +* Function (ServiceStateTable) +****************************************/ + +/** + * Create service state table object + */ +CgUpnpServiceStateTable *cg_upnp_servicestatetable_new(); + +/** + * Delete service state table object + * + * @param servicestatetable Service state table + */ +void cg_upnp_servicestatetable_delete(CgUpnpServiceStateTable *servicestatetable); + +/** + * Clear service state table + * + * @param stateTable Service state table + */ +#define cg_upnp_servicestatetable_clear(stateTable) cg_list_clear((CgList *)stateTable, (CG_LIST_DESTRUCTORFUNC)cg_upnp_statevariable_delete) + +/** + * Get size of service state table + * + * @param stateTable Service state table + */ +#define cg_upnp_servicestatetable_size(stateTable) cg_list_size((CgList *)stateTable) + +/** + * Get next service state table from service state table list + * + * @param stateTable Service state table + * + * @return Service state table (node) + */ +#define cg_upnp_servicestatetable_gets(stateTable) (CgUpnpStateVariable *)cg_list_next((CgList *)stateTable) + +/** + * Add new service state table into service state table list + * + * @param stateTable Service state table + * @param statVar State variable + */ +#define cg_upnp_servicestatetable_add(stateTable, statVar) cg_list_add((CgList *)stateTable, (CgList *)statVar) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp.h new file mode 100644 index 0000000..4c2b823 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp.h @@ -0,0 +1,47 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cupnp.h +* +* Revision: +* +* 02/14/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CUPNP_H_ +#define _CG_UPNP_CUPNP_H_ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +/**************************************** +* Define +****************************************/ + +#define CG_CLINK_NAME "CyberLinkC" +#define CG_CLINK_VER "2.4" + +#define CG_UPNP_VER "1.0" +#define CG_DLNA_VER "1.50" + +#define CG_UPNP_XML_DECLARATION "" + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp.h.in b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp.h.in new file mode 100644 index 0000000..8eabab0 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp.h.in @@ -0,0 +1,47 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cupnp.h +* +* Revision: +* +* 02/14/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CUPNP_H_ +#define _CG_UPNP_CUPNP_H_ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +/**************************************** +* Define +****************************************/ + +#define CG_CLINK_NAME "CyberLinkC" +#define CG_CLINK_VER + +#define CG_UPNP_VER "1.0" +#define CG_DLNA_VER "1.50" + +#define CG_UPNP_XML_DECLARATION "" + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp_function.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp_function.h new file mode 100644 index 0000000..23afacc --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp_function.h @@ -0,0 +1,84 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cupnp_function.h +* +* Revision: +* +* 02/21/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_FUNCTION_H_ +#define _CG_UPNP_FUNCTION_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_UPNP_UUID_NAME "uuid" +#define CG_UPNP_UUID_MAX_LEN 128 /*(5 + ((4+1)*4) + 1)*/ +#define CG_UPNP_SEVERNAME_MAXLEN 64 + +/**************************************** +* Data Type +****************************************/ + +/**************************************** +* Function +****************************************/ + +/** + * Create a UUID (Universally Unique IDentifier) based on a semi-random value using current time. + * + * \param uuidBuf The UUID created by this function (must not be NULL) + * \return The UUID created by this function (== \e uuidBuf) + */ +char *cg_upnp_createuuid(char *uuidBuf, int uuidBufSize); + +/** + * Get the server name ("OSname/OSversion/UPnP/ CyberLinkC/") + * + * \param buf Buffer to store the server name + * \param bufSize Buffer length + * \param The server name buffer (== \e buf) + */ +char *cg_upnp_getservername(char *buf, int bufSize); + +/** + * Enable/disable NMPR (Intel Networked Media Product Requirements) mode. + * + * \param onFlag TRUE: enable; FALSE: disable + */ +void cg_upnp_setnmprmode(BOOL onFlag); + +/** + * Check whether NMPR (Intel Networked Media Product Requirements) mode is on. + * + * + * \return TRUE if on; otherwise FALSE + */ +BOOL cg_upnp_isnmprmode(); + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp_limit.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp_limit.h new file mode 100644 index 0000000..78da376 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp_limit.h @@ -0,0 +1,50 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cupnp_limit.h +* +* Revision: +* +* 05/17/05 +* - first revision +* 04/04/06 Theo Beisch +* - changed max notifycount to 32bit (per UPnP spec) +* +******************************************************************/ + +#ifndef _CG_UPNP_CUPNPLIMIT_H_ +#define _CG_UPNP_CUPNPLIMIT_H_ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#if defined(HAVE_STDINT_H) +#include +#else +#include +#endif + +#define CG_UPNP_ACTOINNAME_LEN_MAX 128 + +/* DLNA specifies (7.2.26.6) max UDN length to 68 bytes, + * we just play safe here and use 128 byte buffer. */ +#define CG_UPNP_UDN_LEN_MAX 128 +#define CG_UPNP_LOCATION_URL_MAX 512 +#define CG_UPNP_CONTROLPOINT_EVENTSUBURL_MAX 512 + +#if defined(HAVE_STDINT_H) +#define CG_UPNP_NOTIFY_COUNT_MAX UINT32_MAX +#else +#define CG_UPNP_NOTIFY_COUNT_MAX UINT_MAX +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp_status.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp_status.h new file mode 100644 index 0000000..73178cd --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/cupnp_status.h @@ -0,0 +1,120 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: upnp_status.h +* +* Revision: +* +* 02/13/05 +* - first revision +* +* 10/31/05 +* - Added comments to all functions and structs +* +******************************************************************/ + +#ifndef _CG_UPNP_CUPNPSTATUS_H_ +#define _CG_UPNP_CUPNPSTATUS_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/******************************************************************************** + * Defines + ********************************************************************************/ + +#define CG_UPNP_STATUS_INVALID_ACTION 401 +#define CG_UPNP_STATUS_INVALID_ARGS 402 +#define CG_UPNP_STATUS_OUT_OF_SYNC 403 +#define CG_UPNP_STATUS_INVALID_VAR 404 +#define CG_UPNP_STATUS_ACTION_FAILED 501 + +/**************************************** + * Data Type + ****************************************/ + +/** + * UPnP status struct used in action and state operations + */ +typedef struct _CgUpnpStatus { + /** Status code */ + int code; + + /** Status description */ + CgString *description; +} CgUpnpStatus; + +/****************************************************************************** + * Function + ******************************************************************************/ + +/** + * Create a new status struct + * + */ +CgUpnpStatus *cg_upnp_status_new(); + +/** + * Delete a status struct + * + * \param upnpStat Status struct to delete + */ +void cg_upnp_status_delete(CgUpnpStatus *upnpStat); + +/** + * Set status code for status struct + * + * \param upnpStat Status struct + * \param value Status code + */ +#define cg_upnp_status_setcode(upnpStat, value) (upnpStat->code = value) + +/** + * Get Status code from a status struct + * + * \param upnpStat Status structure + */ +#define cg_upnp_status_getcode(upnpStat) (upnpStat->code) + +/** + * Set status description for a status struct + * + * \param upnpStat Status struct + * \param value Status description + */ +#define cg_upnp_status_setdescription(upnpStat, value) cg_string_setvalue(upnpStat->description, value) + +/** + * Get status description from a status struct + * + * \param upnpStat Status struct + */ +#define cg_upnp_status_getdescription(upnpStat) cg_string_getvalue(upnpStat->description) + +/** + * Helper function that converts a status code into a status description + * + * \param code Code to convert into a description + * \return Status description + */ +char *cg_upnp_status_code2string(int code); + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/cevent.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/cevent.h new file mode 100644 index 0000000..ca40618 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/cevent.h @@ -0,0 +1,563 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cevent.h +* +* Revision: +* +* 06/20/05 +* - first revision +* 03/28/06 Theo Beisch +* - modified cg_upnp_eventlistenerlist_clear to use +* default destructor in clist +* - added cg_upnp_event_subscription_request_hasnt +* - changed _subscription function signature to use (service) +* instead of (remoteAddress) +* +******************************************************************/ + +#ifndef _CG_UPNP_CEVENT_H_ +#define _CG_UPNP_CEVENT_H_ + +#include + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/** + * Definition for SID size + */ +#define CG_UPNP_SUBSCRIPTION_SID_SIZE (CG_UPNP_UUID_MAX_LEN + 8) + +/** + * Definition for SID header size + */ +#define CG_UPNP_SUBSCRIPTION_SID_HEADER_SIZE (5 + CG_UPNP_SUBSCRIPTION_SID_SIZE) + +/** + * Definition for subscription xml namespace + */ +#define CG_UPNP_SUBSCRIPTION_XMLNS "urn:schemas-upnp-org:event-1-0" + +/** + * Definition for subscription timeout header prefix + */ +#define CG_UPNP_SUBSCRIPTION_TIMEOUT_HEADER "Second-" + +/** + * Definition for infinite string in subscription + */ +#define CG_UPNP_SUBSCRIPTION_INFINITE_STRING "infinite" + +/** + * Definition for infinite value in subscription + */ +#define CG_UPNP_SUBSCRIPTION_INFINITE_VALUE (-1) + +/** + * Definition for subscription uuid prefix + */ +#define CG_UPNP_SUBSCRIPTION_UUID "uuid:" + +/** + * Definition for subscription callback start tag + */ +#define CG_UPNP_SUBSCRIPTION_CALLBACK_START_WITH "<" + +/** + * Definition for subscription callback end tag + */ +#define CG_UPNP_SUBSCRIPTION_CALLBACK_END_WITH ">" + +/** + * Definition for subscription delay + */ +#define CG_UPNP_SUBSCRIPTION_DELAY 30 + +/** + * Definition for maximum event sequence number + */ +#define CG_UPNP_EVENT_MAX_SEQ 2147483647 + +/** + * Definition for maximum upnp subscription timeout + */ +#define CG_UPNP_SUBSCRIPTION_MAX_TIMEOUT 300 + +/**************************************** +* Data Type +****************************************/ + +/** + * Type definition for subsription request + */ +typedef CgHttpRequest CgUpnpSubscriptionRequest; + +/** + * Type definition for subsrciption response + */ +typedef CgHttpResponse CgUpnpSubscriptionResponse; + +/** + * Type definition for event listener callback + */ +typedef void (*CG_UPNP_EVENT_LISTENER)(CgUpnpProperty *); + +/** + * Type definition for event listener list + */ +typedef struct _CgUpnpEventListenerList { + /** Used by cg_list_* functions to indicate start of list */ + BOOL headFlag; + /** Used by cg_list_* functions to point to the previous item in list */ + struct _CgUpnpEventListenerList *prev; + /** Used by cg_list_* functions to point to the next item in list */ + struct _CgUpnpEventListenerList *next; + + CG_UPNP_EVENT_LISTENER listener; +} CgUpnpEventListenerList; + +/**************************************** +* Function +****************************************/ + +/** + * Create timeout header string + * + * @param time Timeout + * @param buf Buffer used when creating header string + * + * @return Timeout header C string + */ +char *cg_upnp_event_subscription_totimeoutheaderstring(long time, CgString *buf); + +/** + * Get event subscription timeout + * + * @param headerValue Header value + * + * @return Timeout + */ +long cg_upnp_event_subscription_gettimeout(char *headerValue); + +/** + * Create SID for subscription + * + * @param buf Character buffer where SID is created + * @param bufSize Buffer size. + * + * @return Pointer to buffer containing SID + */ +char * cg_upnp_event_subscription_createsid(char *buf, int bufSize); + +/** + * Creates SID header string + * + * @param sid Character array containing the SID + * @param buf A buffer where header string is created + * @param bufSize Size of the used buffer + * + * @return Pointer to buffer containing SID header string + */ +char *cg_upnp_event_subscription_tosidheaderstring(char *sid, char *buf, int bufSize); + +/** + * Get SID + * + * @param headerValue Raw header C string + * + * @return C string containing SID + */ +char *cg_upnp_event_subscription_getsid(char *headerValue); + +/**************************************** +* Function (Request) +****************************************/ + +/** + * Subscription request constructor + * + * @return Pointer to newly created subsription request + */ +#define cg_upnp_event_subscription_request_new() cg_http_request_new(); + +/** + * Subscription request destructor + * + * @param subReq Reference to the subscription request to be deleted + */ +#define cg_upnp_event_subscription_request_delete(subReq) cg_http_request_delete(subReq); + +/** + * Checks if request type is subscription request + * + * @param subReq The request to be checked + * + * @return True if request is subscription request, false otherwise + */ +#define cg_upnp_event_subscription_issubscriberequest(subReq) cg_streq(cg_http_request_getmethod(subReq), CG_HTTP_SUBSCRIBE) + +/** + * Checks if request type is unsubscription request + * + * @param subReq The request to be checked + * + * @return True if request is unsubscription request + */ +#define cg_upnp_event_subscription_isunsubscriberequest(subReq) cg_streq(cg_http_request_getmethod(subReq), CG_HTTP_UNSUBSCRIBE) + +/**** SID ****/ + +/** + * Set sid to subscription request + * + * @param subReq Subscription request + * @param sid SID (Subscription id) + */ +void cg_upnp_event_subscription_request_setsid(CgUpnpSubscriptionRequest *subReq, char *sid); + +/** + * Get sid from subscription request + * + * @param subReq Subscription request + * + * @return Character array containing the requested SID + */ +#define cg_upnp_event_subscription_request_getsid(subReq) cg_upnp_event_subscription_getsid(cg_http_packet_getheadervalue(((CgHttpPacket*)subReq), CG_HTTP_SID)) + +/** + * Checks if subscription object has SID + * + * @param subReq Subscription request + * + * @return True if subscription has SID, false otherwise + */ +#define cg_upnp_event_subscription_request_hassid(subReq) cg_http_packet_hasheader(((CgHttpPacket*)subReq), CG_HTTP_SID) + +/**** NT ****/ + +/** + * Set NT (Notification target) for subscription request + * + * @param subReq Subscription request + * @param value Notification type + */ +#define cg_upnp_event_subscription_request_setnt(subReq, value) cg_http_packet_setheadervalue(((CgHttpPacket*)subReq), CG_HTTP_NT, value) + +/** + * Get NT from subscription request + * + * @param subReq Subscription request + * + * @return Character array containing the NT header value + */ +#define cg_upnp_event_subscription_request_getnt(subReq) cg_http_packet_getheadervalue(((CgHttpPacket*)subReq), CG_HTTP_NT) + +/** + * Checks if subscription request has NT + * + * @param subReq Subscription request + * + * @return True if subscription request contains NT, false otherwise + */ +#define cg_upnp_event_subscription_request_hasnt(subReq) cg_http_packet_hasheader(((CgHttpPacket*)subReq), CG_HTTP_NT) + +/**** Callback ****/ + +/** + * Set subscription request callback URL + * + * @param subReq Subscription request + * @param value Callback URL string + */ +#define cg_upnp_event_subscription_request_setcallback(subReq, value) cg_http_packet_setheadervalue(((CgHttpPacket*)subReq), CG_HTTP_CALLBACK, value) + +/** + * Get subscription callback URL + * + * @param subReq Subscription request + * + * @return Character array containing the callback URL + */ +#define cg_upnp_event_subscription_request_getcallback(subReq) cg_http_packet_getheadervalue(((CgHttpPacket*)subReq), CG_HTTP_CALLBACK) + +/** + * Checks if subscription request has callback URL + * + * @param subReq Subscription request + * + * @return True if subscription request has callback URL, false otherwise + */ +#define cg_upnp_event_subscription_request_hascallback(subReq) cg_http_packet_hasheader(((CgHttpPacket*)subReq), CG_HTTP_CALLBACK) + +/**** Timeout ****/ + +/** + * Set timeout for subscription request + * + * @param subReq Subscription request + * @param timeout Timeout value for subscription request + */ +void cg_upnp_event_subscription_request_settimeout(CgUpnpSubscriptionRequest *subReq, long timeout); + +/** + * Get timeout value from subscription request + * + * @param subReq Subscription request + */ +#define cg_upnp_event_subscription_request_gettimeout(subReq) cg_upnp_event_subscription_gettimeout(cg_http_packet_getheadervalue(((CgHttpPacket*)subReq), CG_HTTP_TIMEOUT)) + +/**** Subscription Content ****/ + +/** + * (Re)initializes subscription request + * + * @param subReq Subscription request + * @param service Service to be subscribed + * @param callback URL to be called when service state changes + * @param timeout Subscription timeout + */ +void cg_upnp_event_subscription_request_setnewsubscription(CgUpnpSubscriptionRequest *subReq, CgUpnpService *service, char *callback, long timeout); + +/** + * (Re)initializes subscription request to be renewal request + * + * @param subReq Subscription request + * @param service Service to be subscribed + * @param uuid Devices unique identification string + * @param timeout Subscription timeout + */ +void cg_upnp_event_subscription_request_setrenewsubscription(CgUpnpSubscriptionRequest *subReq, CgUpnpService *service, char *uuid, long timeout); + +/** + * (Re)initializes subscription request to be unsubscription request + * + * @param subReq Subscription request + * @param service Service where to be unsubscribed + */ +void cg_upnp_event_subscription_request_setunsubscription(CgUpnpSubscriptionRequest *subReq, CgUpnpService *service); + +/**** Host ****/ + +/** + * Set HTTP host header value + * + * @param subReq Subscription request + * @param value HTTP Host: header content + */ +#define cg_upnp_event_subscription_request_sethost(subReq, value) cg_http_packet_setheadervalue(((CgHttpPacket*)subReq), CG_HTTP_HOST, value) + +/** + * Get host header value from subscription request + * + * @param subReq Subscription request + */ +#define cg_upnp_event_subscription_request_gethost(subReq) cg_http_packet_getheadervalue(((CgHttpPacket*)subReq), CG_HTTP_HOST) + +/** + * Send subscription request to device + * + * @param subReq Subscription request + */ +#define cg_upnp_event_subscription_request_post(subReq) cg_http_request_post(subReq, cg_net_url_gethost(cg_http_request_getposturl(subReq)), cg_net_url_getport(cg_http_request_getposturl(subReq))) + +/** + * Send response to subscription request + * + * @param subReq Subscription request + * @param subRes Subscription response + */ +#define cg_upnp_event_subscription_request_postresponse(subReq, subRes) cg_http_request_postresponse(subReq, subRes) + +/**************************************** +* Function (Response) +****************************************/ + +/** + * Constructor for subscription response + */ +#define cg_upnp_event_subscription_response_new() cg_http_response_new(); + +/** + * Destructor for subscription response + * + * @param subRes Subscription response + */ +#define cg_upnp_event_subscription_response_delete(subRes) cg_http_response_delete(subRes); + +/** + * Checks if subscription was successfull by checking status code from subscription response + * + * @param subRes Subscription response + */ +#define cg_upnp_event_subscription_response_issuccessful(subRes) cg_http_response_issuccessful(subRes) + +/**** Status Code ****/ + +/** + * Set status code for subscription response + * + * @param subRes Subscription response + * @param code Status code + */ +#define cg_upnp_event_subscription_response_setstatuscode(subRes, code) cg_http_response_setstatuscode(subRes, code) + +/** + * Get status code from subscription response object + * + * @param subRes Subscription response + * @param code Status code + * + * @return Status code + * + * \bug Status code is not needed here! (It is not even passed to the wrapped function) + */ +#define cg_upnp_event_subscription_response_getstatuscode(subRes, code) cg_http_response_getstatuscode(subRes) + +/**** SID ****/ + +/** + * Set SID (Subscription ID) for response + * + * @param subRes Subscription response + * @param sid Subscription ID + */ +void cg_upnp_event_subscription_response_setsid(CgUpnpSubscriptionResponse *subRes, char *sid); + +/** + * Get SID + * + * @param subRes Subscription request + * + * @return C string containing SID + */ +#define cg_upnp_event_subscription_response_getsid(subRes) cg_upnp_event_subscription_getsid(cg_http_packet_getheadervalue(((CgHttpPacket*)subRes), CG_HTTP_SID)) + +/**** Timeout ****/ + +/** + * Set HTTP timeout for subscription response + * + * @param subRes Subscription response + * @param value Timeout + */ +void cg_upnp_event_subscription_response_settimeout(CgUpnpSubscriptionResponse *subRes, long value); + +/** + * Get timeout value from subscription response + * + * @param subRes Subscription response + * + * @return C string containing the timeout + */ +#define cg_upnp_event_subscription_response_gettimeout(subRes) cg_upnp_event_subscription_gettimeout(cg_http_packet_getheadervalue(((CgHttpPacket*)subRes), CG_HTTP_TIMEOUT)) + +/** + * Set response code for subscription response + * + * @param subRes Subscription response + * @param code Response code + */ +void cg_upnp_event_subscription_subscriberesponse_setresponse(CgUpnpSubscriptionResponse *subRes, int code); +/* TODO getter? */ + +/**************************************** +* Function (Eventlistener list) +****************************************/ + +/** +* Create a new event listener list +* +*/ +CgUpnpEventListenerList *cg_upnp_eventlistenerlist_new(); + +/** +* Delete a event listener list. +* +* \param eventListenerList The event listener list to delete +* +*/ +void cg_upnp_eventlistenerlist_delete(CgUpnpEventListenerList *eventListenerList); + +/** +* Clear the contents of a event listener list. +* +* \param eventListenerList The device list to clear +* +*/ +#define cg_upnp_eventlistenerlist_clear(eventListenerList) cg_list_clear((CgList *)eventListenerList, (CG_LIST_DESTRUCTORFUNC)free) + +/** +* Get the size of the device list +* +* \param eventListenerList The device list +* +*/ +#define cg_upnp_eventlistenerlist_size(eventListenerList) cg_list_size((CgList *)eventListenerList) + +/** +* Fetches next list element from event listener list +* +* @param eventListenerList Event listener list +*/ +#define cg_upnp_eventlistenerlist_gets(eventListenerList) (CgUpnpEventListenerList*)cg_list_next((CgList *)eventListenerList) + +/** +* Fetches next list element from event listener list +* +* @param eventListenerList Event listener list +*/ +#define cg_upnp_eventlistenerlist_next(eventListenerList) (CgUpnpEventListenerList*)cg_list_next((CgList *)eventListenerList) + +/** +* Remove a listener from the event listener list +* +* \param eventListenerList The event listener list +* \param listener The listener to remove +* +*/ +void cg_upnp_eventlistenerlist_remove(CgUpnpEventListenerList* eventListenerList, CG_UPNP_EVENT_LISTENER listener); + +/** +* Add a listener to the event listener list +* +* \param eventListenerList The event listener list +* \param listener The listener to add +* +*/ +void cg_upnp_eventlistenerlist_add(CgUpnpEventListenerList* eventListenerList, CG_UPNP_EVENT_LISTENER listener); + +/** + * Call all event listeners in the list with the given data. + * + * @param eventListenerList The list to iterate thru + * @param property The property that has been evented + */ +void cg_upnp_eventlistenerlist_notify(CgUpnpEventListenerList* eventListenerList, CgUpnpProperty *property); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/cnotify.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/cnotify.h new file mode 100644 index 0000000..ca7fa34 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/cnotify.h @@ -0,0 +1,238 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cevent.h +* +* Revision: +* +* 06/20/05 +* - first revision +* +* 03/20/06 Theo Beisch +* - added cg_upnp_event_notify_request_hasnt & _hasnts & _hassid +******************************************************************/ + +#ifndef _CG_UPNP_CNOTIFY_H_ +#define _CG_UPNP_CNOTIFY_H_ + +#include + +#include +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/** Define for XML namespace + */ +#define CG_UPNP_NOTIFY_XMLNS "e" + +/** + * Define for notify property + */ +#define CG_UPNP_NOTIFY_PROPERTY "property" + +/** + * Define for notify property set + */ +#define CG_UPNP_NOTIFY_PROPERTYSET "propertyset" + +/**************************************** +* Data Type +****************************************/ + +/** + * Data type for UPnP Notification request + */ +typedef CgSoapRequest CgUpnpNotifyRequest; + +/** + * Data type for UPnP notify response + */ +typedef CgSoapResponse CgUpnpNotifyResponse; + +/**************************************** +* Function (Request) +****************************************/ + +/** + * Create new Notification request + */ +CgUpnpNotifyRequest *cg_upnp_event_notify_request_new(); + +/** + * Delete Notification request + * + * @param notifyReq Notification request + */ +void cg_upnp_event_notify_request_delete(CgUpnpNotifyRequest *notifyReq); + +/** + * Clear Notification request + * + * @param notifyReq Notification request + */ +void cg_upnp_event_notify_request_clear(CgUpnpNotifyRequest *notifyReq); + +/** + * Set HTTP request for event Notification request + * + * @param notifyReq Notification request + * @param httpReq HTTP request + */ +#define cg_upnp_event_notify_request_sethttprequest(notifyReq, httpReq) cg_soap_request_sethttprequest(notifyReq, httpReq) + +/** + * Sends event Notification request to control point + * + * @param notifyReq Notification request + * @param host Host address + * @param port Host port + * + * @return Notify response + */ +#define cg_upnp_event_notify_request_post(notifyReq, host, port) cg_soap_request_post(notifyReq, host, port) + +/** + * Get root node associated with current Notification request + * + * @param notifyReq Notification request + * + * @return XML node + */ +#define cg_upnp_event_notify_request_getpropertysetnode(notifyReq) cg_soap_request_getrootnoode(notifyReq) + +/** + * Set property list for Notification request + * + * @param notifyReq Notification request + * @param value Property list value + */ +#define cg_upnp_event_notify_request_setpropertylist(notifyReq, value) cg_soap_request_setuserdata(notifyReq, value) + +/** + * Get property list from Notification request + * + * @param nofityReq Notification request + */ +CgUpnpPropertyList *cg_upnp_event_notify_request_getpropertylist(CgUpnpNotifyRequest *nofityReq); + +/**** NT ****/ + +/** + * Set NT (Notificatio type) for Notification request + * + * @param soapReq Notification request + * @param value Notification type + */ +#define cg_upnp_event_notify_request_setnt(soapReq, value) cg_http_packet_setheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NT, value) + +/** + * Get NT from notification request + * + * @param soapReq Notification request + */ +#define cg_upnp_event_notify_request_getnt(soapReq) cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NT) +//Theo Beisch +#define cg_upnp_event_notify_request_hasnt(soapReq) cg_http_packet_hasheader((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NT) + +/**** NTS ****/ + +/** + * Set NTS (Notification sub type) for current Notification request + * + * @param soapReq Notification request + * @param value NTS + */ +#define cg_upnp_event_notify_request_setnts(soapReq, value) cg_http_packet_setheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NTS, value) + +/** + * Get NTS from notification request + * + * @param soapReq Notification request + */ +#define cg_upnp_event_notify_request_getnts(soapReq) cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NTS) +//Theo Beisch +#define cg_upnp_event_notify_request_hasnts(soapReq) cg_http_packet_hasheader(((CgHttpPacket*)soapReq->httpReq), CG_HTTP_NTS) + +/**** SID ****/ + +/** + * Set SID (Subscription ID) for notification request + * + * @param soapReq Notification request + * @param sid SID + */ +void cg_upnp_event_notify_request_setsid(CgUpnpNotifyRequest *soapReq, char *sid); + +/** + * Get SID from notification request + * + * @param soapReq Notification request + */ +#define cg_upnp_event_notify_request_getsid(soapReq) cg_upnp_event_subscription_getsid(cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SID)) +//Theo Beisch +#define cg_upnp_event_notify_request_hassid(soapReq) cg_http_packet_hasheader(((CgHttpPacket*)(soapReq->httpReq)), CG_HTTP_SID) + +/**** SEQ ****/ + +/** + * Set sequence number for notification request + * + * @param soapReq Notification request + * @param value Sequence number + */ +#define cg_upnp_event_notify_request_setseq(soapReq, value) cg_http_packet_setheaderlong((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SEQ, value) + +/** + * Get sequence number from notification request + * + * @param soapReq Notification request + */ +#define cg_upnp_event_notify_request_getseq(soapReq) cg_http_packet_getheaderlong((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SEQ) + +/** + * \todo Check what this does exactly... + */ +BOOL cg_upnp_event_notify_request_setpropertysetnode(CgUpnpNotifyRequest *notifyReq, CgUpnpSubscriber *sub, /* CgUpnpService */void *service, CgUpnpStateVariable *statVar); + +/**************************************** +* Function (Response) +****************************************/ + +/** + * Check if notification response was successfull + * + * @param notifyRes Notification response + */ +#define cg_upnp_event_notify_response_issuccessful(notifyRes) cg_soap_response_issuccessful(notifyRes) + +/** + * Get the status code of the specified response + * + * @param notifyRes Notification response + */ +#define cg_upnp_event_notify_response_getstatuscode(notifyRes) cg_soap_response_getstatuscode(notifyRes) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/cproperty.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/cproperty.h new file mode 100644 index 0000000..8eb4551 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/cproperty.h @@ -0,0 +1,196 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cproperty.h +* +* Revision: +* +* 06/21/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CPROPERTY_H_ +#define _CG_UPNP_CPROPERTY_H_ + +#include + +#include +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Type definition for UPnP property + */ +typedef struct _CgUpnpProperty { + BOOL headFlag; + struct _CgUpnpProperty *prev; + struct _CgUpnpProperty *next; + + CgString *name; + CgString *value; + CgString *sid; + long seq; +} CgUpnpProperty, CgUpnpPropertyList; + +/**************************************** +* Function (Property) +****************************************/ + +/** + * Construct new UPnP property object + */ +CgUpnpProperty *cg_upnp_property_new(); + +/** + * Delete UPnP property object + * + * @param prop UPnP property + */ +void cg_upnp_property_delete(CgUpnpProperty *prop); + +/** + * Clear UPnP property + * + * @param prop UPnP property + */ +void cg_upnp_property_clear(CgUpnpProperty *prop); + +/** + * Fetches next UPnP property from property list + * + * @param prop UPnP property + */ +#define cg_upnp_property_next(prop) (CgUpnpProperty *)cg_list_next((CgList *)prop) + +/**** name ****/ +/** + * Set property name + * + * @param prop UPnP property + * @param value Name + */ +#define cg_upnp_property_setname(prop, value) cg_string_setvalue(prop->name, value) + +/** + * Get property name + * + * @param prop UPnP property + */ +#define cg_upnp_property_getname(prop) cg_string_getvalue(prop->name) + +/**** value ****/ + +/** + * Set value for UPnP property + * + * @param prop UPnP property + * @param nvalue Value + */ +#define cg_upnp_property_setvalue(prop, nvalue) cg_string_setvalue(prop->value, nvalue) + +/** + * Get value from property + * + * @param prop UPnP property + */ +#define cg_upnp_property_getvalue(prop) cg_string_getvalue(prop->value) + +/**** sid ****/ + +/** + * Set SID for UPnP property + * + * @param prop UPnP property + * @param value Value + */ +#define cg_upnp_property_setsid(prop, value) cg_string_setvalue(prop->sid, value) + +/** + * Get SID from UPnP property + * + * @param prop UPnP property + */ +#define cg_upnp_property_getsid(prop) cg_string_getvalue(prop->sid) + +/**** seq ****/ + +/** + * Set sequence number for UPnP property + * + * @param prop UPnP property + * @param value + */ +#define cg_upnp_property_setseq(prop, value) (prop->seq = value) + +/** + * Get sequence number from UPnP property + * + * @param prop UPnP property + */ +#define cg_upnp_property_getseq(prop) (prop->seq) + +/**************************************** +* Function (PropertyList) +****************************************/ + +/** + * Create new UPnP property list + */ +CgUpnpPropertyList *cg_upnp_propertylist_new(); + +/** + * Delete UPnP property list + * + * @param propertylist UPnP property list + */ +void cg_upnp_propertylist_delete(CgUpnpPropertyList *propertylist); + +/** + * Clear UPnP propertylist + * + * @param propList UPnP property list + */ +#define cg_upnp_propertylist_clear(propList) cg_list_clear((CgList *)propList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_property_delete) + +/** + * Get size of property list + * + * @param propList UPnP property list + */ +#define cg_upnp_propertylist_size(propList) cg_list_size((CgList *)propList) + +/** + * Get next list element from property list + * + * @param propList UPnP property list + */ +#define cg_upnp_propertylist_gets(propList) (CgUpnpProperty *)cg_list_next((CgList *)propList) + +/** + * Add new property into property list + * + * @param propList UPnP property list + * @param prop UPnP property + */ +#define cg_upnp_propertylist_add(propList, prop) cg_list_add((CgList *)propList, (CgList *)prop) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/csubscriber.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/csubscriber.h new file mode 100644 index 0000000..29856d5 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/csubscriber.h @@ -0,0 +1,311 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: csubscriber.h +* +* Revision: +* +* 06/21/05 +* - first revision +* +* 12-Jan-06 Heikki Junnila +* - Added API comments +* 04/05/06 +* - changed timing values to type CgSysTime +* - added cg_upnp_subscriberlist_get(CgUpnpSubscriberList *subscriberList, char *sid) +******************************************************************/ + +#ifndef _CG_UPNP_CSUBSCRIBER_H_ +#define _CG_UPNP_CSUBSCRIBER_H_ + +#include + +#include +#include +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/**************************************** +* Data Type +****************************************/ + +/** + * The device-side structure for an event subscriber + */ +typedef struct _CgUpnpSubscriber { + BOOL headFlag; + struct _CgUpnpSubscriber *prev; + struct _CgUpnpSubscriber *next; + + CgString *sid; + CgString *ifAddr; + CgNetURL *deliveryURL; + + CgSysTime timeout; + long notifyCount; + CgSysTime subscriptionTime; +} CgUpnpSubscriber, CgUpnpSubscriberList; + +/**************************************** +* Function (Subscriber) +****************************************/ + +/** + * Create a new event subscriber + */ +CgUpnpSubscriber *cg_upnp_subscriber_new(); + +/** + * Destroy an event subscriber + * + * @param sub The event subscriber + */ +void cg_upnp_subscriber_delete(CgUpnpSubscriber *sub); + +/** + * Clear the contents of an event subscriber + * + * @todo Lacks implementation (is it necessary?) + * + * @param sub The event subscriber + */ +void cg_upnp_subscriber_clear(CgUpnpSubscriber *sub); + +/** + * Renew a subscription. Essentially sets subscription time (duration) + * to zero and resets notify count (== event key). + * + * @param sub The event subscriber + */ +void cg_upnp_subscriber_renew(CgUpnpSubscriber *sub); + +/** + * Get the next subscriber in a subscriber list. Use as an iterator. + * + * @param sub The current event subscriber + * @return Next subscriber or NULL + */ +#define cg_upnp_subscriber_next(sub) (CgUpnpSubscriber *)cg_list_next((CgList *)sub) + +/** + * Remove the event subscriber from a subscriber list. + * + * @param sub The event subscriber to remove + */ +#define cg_upnp_subscriber_remove(sub) cg_list_remove((CgList *)sub) + +/**************************************************************************** + * sid + ****************************************************************************/ + +/** + * Set the subscriber's SID (Subscription IDentifier) value + * + * @param sub The event subscriber + * @param value The SID value + */ +#define cg_upnp_subscriber_setsid(sub, value) cg_string_setvalue(sub->sid, value) + +/** + * Get the subscriber's SID (Subscription IDentifier) value + * + * @param sub The current event subscriber + * @return Subscriber's SID + */ +#define cg_upnp_subscriber_getsid(sub) cg_string_getvalue(sub->sid) + +/**************************************************************************** + * timeout + ****************************************************************************/ + +/** + * Set the subscription timeout (expiration time) to a certain value. + * + * @param sub The event subscriber + * @param value Timeout + */ +#define cg_upnp_subscriber_settimeout(sub, value) (sub->timeout = value) + +/** + * Get the subscription timeout (expiration time) + * + * @param sub The event subscriber + * @return Timeout + */ +#define cg_upnp_subscriber_gettimeout(sub) (sub->timeout) + +/**************************************************************************** + * subscriptionTime + ****************************************************************************/ + +/** + * Set the subscription time (duration) to a certain value. + * + * @param sub The event subscriber + * @param value Subscription time + */ +#define cg_upnp_subscriber_setsubscriptiontime(sub, value) (sub->subscriptionTime = value) + +/** + * Get the subscription time (duration) + * + * @param sub The event subscriber + * @return Subscription time + */ +#define cg_upnp_subscriber_getsubscriptiontime(sub) (sub->subscriptionTime) + +/**************************************************************************** + * notifycount + ****************************************************************************/ + +/** + * Set the notify count to a certain value. + * + * @param sub The event subscriber + * @param value Notify count + */ +#define cg_upnp_subscriber_setnotifycount(sub, value) (sub->notifyCount = value) + +/** + * Get the notify count + * + * @param sub The event subscriber + * @return Notify count + */ +#define cg_upnp_subscriber_getnotifycount(sub) (sub->notifyCount) + +/** + * Increment the event notify count by one + * + * @param sub The event subscriber + * @return The new notify count + */ +long cg_upnp_subscriber_incrementnotifycount(CgUpnpSubscriber *sub); + +/**************************************************************************** + * Delivery URL + ****************************************************************************/ + +/** + * Set the subscriber's delivery URL + * + * @param sub The event subscriber + * @param value The delivery URL + */ +#define cg_upnp_subscriber_setdeliveryurl(sub, value) cg_net_url_set(sub->deliveryURL, value) + +/** + * Set the subscriber's delivery host + * + * @param sub The event subscriber + */ +#define cg_upnp_subscriber_getdeliveryhost(sub) cg_net_url_gethost(sub->deliveryURL) + +/** + * Set the subscriber's delivery path + * + * @param sub The event subscriber + */ +#define cg_upnp_subscriber_getdeliverypath(sub) cg_net_url_getpath(sub->deliveryURL) + +/** + * Set the subscriber's delivery port + * + * @param sub The event subscriber + */ +#define cg_upnp_subscriber_getdeliveryport(sub) cg_net_url_getport(sub->deliveryURL) + +/** + * Check, whether a subscriber's event subscription has been expired + * + * @param sub The subscriber + * @return TRUE if the subscription has been expired; otherwise FALSE + */ +BOOL cg_upnp_subscriber_isexpired(CgUpnpSubscriber *sub); + +/** + * Post a notification to an event subscriber. This is called in a device. + * + * @param sub The event subscriber + * @param statVar The evented state variable + * @return TRUE if succesful; otherwise FALSE + */ +BOOL cg_upnp_subscriber_notify(CgUpnpSubscriber *sub, CgUpnpStateVariable *statVar); + +/** + * Post a notification to an event subscriber. This is called in a device. + * + * @param sub The event subscriber + * @param service The evented service + * @return TRUE if succesful; otherwise FALSE + */ +BOOL cg_upnp_subscriber_notifyall(CgUpnpSubscriber *sub, void *service); + +/**************************************** +* Function (SubscriberList) +****************************************/ + +/** + * Create a new event subscriber list + */ +CgUpnpSubscriberList *cg_upnp_subscriberlist_new(); + +/** + * Destroy an event subscriber list + * + * @param subscriberlist The list to destroy + */ +void cg_upnp_subscriberlist_delete(CgUpnpSubscriberList *subscriberlist); + +/** + * Clear the contents of a subscriber list + * + * @param subList The subscriber list to clear + */ +#define cg_upnp_subscriberlist_clear(subList) cg_list_clear((CgList *)subList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_subscriber_delete) + +/** + * Get the size (node count) of a subscriber list + * + * @param subList The subscriber list to evaluate + */ +#define cg_upnp_subscriberlist_size(subList) cg_list_size((CgList *)subList) + +/** + * Get the first item in a subscriber list (use as the first step in iteration). + * + * @param subList The subscriber list to evaluate + */ +#define cg_upnp_subscriberlist_gets(subList) (CgUpnpSubscriber *)cg_list_next((CgList *)subList) + +/** + * Add a new event subscriber to a subscriber list + * + * @param subList The subscriber list to add to + * @param sub The subscriber to add + */ +#define cg_upnp_subscriberlist_add(subList, sub) cg_list_add((CgList *)subList, (CgList *)sub) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/csubscription.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/csubscription.h new file mode 100644 index 0000000..7254350 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/event/csubscription.h @@ -0,0 +1,166 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: csubscription.h +* +* Revision: +* +* 06/20/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CSUBSCRIPTION_H_ +#define _CG_UPNP_CSUBSCRIPTION_H_ + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + + +/**************************************** +* Data Type +****************************************/ + +/** + * Data type for subscription request + */ +typedef CgHttpRequest CgUpnpSubscriptionRequest; + +/**************************************** +* Function (Request) +****************************************/ + +/** + * Create new subscription request + */ +CgUpnpSubscriptionRequest *cg_upnp_event_subscription_request_new(); + +/** + * Delete subscription request + * + * @param subReq subscription request + */ +#define cg_upnp_event_subscription_request_delete(subReq) cg_http_request_delete(subReq) + +/**** NT ****/ + +/** + * Set host header value into underlying HTTP packet + * + * @param subReq Subscription request + * @param ipaddr Host ip address + * @param port Host port + */ +#define cg_upnp_event_subscription_request_sethost(subReq, ipaddr, port) cg_http_request_sethost(subReq, ipaddr, port) + +/** + * Get host header value from subscription request + * + * @param subReq Subscription request + * @param value Not actually used anywhere + * + * \bug Value not needed here! (It is even processed out from to be compiled code) + */ +#define cg_upnp_event_subscription_request_gethost(subReq, value) cg_http_request_gethost(subReq) + +/**** NT ****/ + +/** + * Set NT (Notification type) for subscription request + * + * @param subReq Subscription request + * @param value Notification type + */ +#define cg_upnp_event_subscription_request_setnt(subReq, value) cg_http_request_setheadervalue(subReq, CG_HTTP_NT, value) + +/** + * Get NT from subscription request + * + * @param subReq Subscription request + * @param value Not actually used anywhere + * + * \bug Value not needed here! + */ +#define cg_upnp_event_subscription_request_getnt(subReq, value) cg_http_request_getheadervalue(subReq, CG_HTTP_NT) + +/**** CALLBACK ****/ + +/** + * Set callback URL for eventing + * + * @param subReq Subscription request + * @value value String which defines the callback URL + */ +#define cg_upnp_event_subscription_request_setcallback(subReq, value) cg_http_request_setheadervalue(subReq, CG_HTTP_CALLBACK, value) + +/** + * Get callback url from subscription request + * + * @subReq Subscription request + * @value Not actually used anywhere + * + * \bug Value not needed here! + */ +#define cg_upnp_event_subscription_request_getcallback(subReq, value) cg_http_request_getheadervalue(subReq, CG_HTTP_CALLBACK) + +/**** SID ****/ + +/** + * Set SID (Subscription ID) for subscription request + * + * @param subReq Subscription request + * @param value SID + */ +#define cg_upnp_event_subscription_request_setsid(subReq, value) cg_http_request_setheadervalue(subReq, CG_HTTP_SID, value) + +/** + * Get SID from subscription request object + * + * @param subReq Subscription request + * @param value Not used + * + * \bug Value not needed here! + */ +#define cg_upnp_event_subscription_request_getsid(subReq, value) cg_http_request_getheadervalue(subReq, CG_HTTP_SID) + +/**** Timeout ****/ + +/** + * Set timeout for subscription request + * + * @param subReq Subscription request + * @param timeout Timeout + */ +void cg_upnp_event_subscription_request_settimeout(CgUpnpSubscriptionRequest *subReq, long timeout); + +/** + * Get timeout value from subscription request + * + * @param subReq Subscription request + * + * @return Timeout + */ +long cg_upnp_event_subscription_request_gettimeout(CgUpnpSubscriptionRequest *subReq); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/ssdp/cssdp.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/ssdp/cssdp.h new file mode 100644 index 0000000..747b873 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/ssdp/cssdp.h @@ -0,0 +1,220 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cssdp.h +* +* Revision: +* +* 02/13/05 +* - first revision +* +* 10/31/05 +* - Added cg_upnp_ssdpresponse_setext and _setserver +* +******************************************************************/ + +#ifndef _CG_UPNP_CSSDP_H_ +#define _CG_UPNP_CSSDP_H_ + +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_UPNP_SSDP_PORT 1900 + +#define CG_UPNP_SSDP_ADDRESS "239.255.255.250" + +#define CG_UPNP_SSDP_MULTICAST_ADDRESS "239.255.255.250:1900" + +#define CG_AUTO_IP_NET 0xa9fe0000 +#define CG_AUTO_IP_MASK 0xffff0000 + +/* Default time to live specified in UPnP DA spec */ +#define CG_UPNP_SSDP_MULTICAST_DEFAULT_TTL 4 + +#define CG_UPNP_SSDP_IPV6_IF_LOCAL_ADDRESS "FF01::C" +#define CG_UPNP_SSDP_IPV6_LINK_LOCAL_ADDRESS "FF02::C" +#define CG_UPNP_SSDP_IPV6_SUBNET_ADDRESS "FF03::C" +#define CG_UPNP_SSDP_IPV6_ADMINISTRATIVE_ADDRESS "FF04::C" +#define CG_UPNP_SSDP_IPV6_SITE_LOCAL_ADDRESS "FF05::C" +#define CG_UPNP_SSDP_IPV6_GLOBAL_ADDRESS "FF0E::C" + +#define CG_UPNP_SSDP_DEFAULT_MSEARCH_MX 3 +#define CG_UPNP_SSDP_DEFAULT_ANNOUNCE_COUNT 3 + +#define CG_UPNP_SSDP_HEADER_LINE_MAXSIZE 128 + +#define CG_UPNP_SSDP_ST "ST" +#define CG_UPNP_SSDP_MX "MX" +#define CG_UPNP_SSDP_MAN "MAN" +#define CG_UPNP_SSDP_NT "NT" +#define CG_UPNP_SSDP_NTS "NTS" + #define CG_UPNP_SSDP_NTS_ALIVE "ssdp:alive" + #define CG_UPNP_SSDP_NTS_BYEBYE "ssdp:byebye" + #define CG_UPNP_SSDP_NTS_PROPCHANGE "upnp:propchange" +#define CG_UPNP_SSDP_USN "USN" +#define CG_UPNP_SSDP_EXT "EXT" +#define CG_UPNP_SSDP_SID "SID" +#define CG_UPNP_SSDP_SEQ "SEQ" +#define CG_UPNP_SSDP_CALBACK "CALLBACK" +#define CG_UPNP_SSDP_TIMEOUT "TIMEOUT" +#define CG_UPNP_SSDP_SERVER "SERVER" + +#define CG_UPNP_SSDP_FILTER_TABLE_SIZE 101 + +/**************************************** +* Data Type +****************************************/ + +typedef CgHttpResponse CgUpnpSSDPResponse; +typedef CgHttpRequest CgUpnpSSDPRequest; + +typedef CgSocket CgUpnpSSDPSocket; + +/**************************************** +* Function +****************************************/ + +void cg_upnp_ssdp_setipv6address(char *addr); +char *cg_upnp_ssdp_getipv6address(); + +void cg_upnp_ssdp_setannouncecount(int count); +int cg_upnp_ssdp_getannouncecount(); + +int cg_upnp_ssdp_getleasetime(char *cacheCont); + +char *cg_upnp_ssdp_gethostaddress(char *ifAddr); + +/**************************************** +* Function (SSDPRequest) +****************************************/ + +CgUpnpSSDPRequest *cg_upnp_ssdprequest_new(); +void cg_upnp_ssdprequest_delete(CgUpnpSSDPRequest *ssdpReq); + +/**** Method ****/ +#define cg_upnp_ssdprequest_setmethod(ssdpReq,value) cg_http_request_setmethod(ssdpReq,value) +#define cg_upnp_ssdprequest_getmethod(ssdpReq) cg_http_request_getmethod(ssdpReq) + +/**** URI ****/ +#define cg_upnp_ssdprequest_seturi(ssdpReq,value) cg_http_request_seturi(ssdpReq,value) +#define cg_upnp_ssdprequest_geturi(ssdpReq) cg_http_request_geturi(ssdpReq) + +/**** HOST ****/ +#define cg_upnp_ssdprequest_sethost(ssdpReq,addr,port) cg_http_packet_sethost((CgHttpPacket*)ssdpReq, addr, port) +#define cg_upnp_ssdprequest_gethost(ssdpReq) cg_http_packet_gethost((CgHttpPacket*)ssdpReq) + +/**** Server ****/ +#define cg_upnp_ssdprequest_setserver(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_HTTP_SERVER, value) +#define cg_upnp_ssdprequest_getserver(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_HTTP_SERVER) + +/**** ST ****/ +#define cg_upnp_ssdprequest_setst(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_UPNP_SSDP_ST, value) +#define cg_upnp_ssdprequest_getst(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_UPNP_SSDP_ST) + +/**** NT ****/ +#define cg_upnp_ssdprequest_setnt(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_UPNP_SSDP_NT, value) +#define cg_upnp_ssdprequest_getnt(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_UPNP_SSDP_NT) + +/**** NTS ****/ +#define cg_upnp_ssdprequest_setnts(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_UPNP_SSDP_NTS, value) +#define cg_upnp_ssdprequest_getnts(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_UPNP_SSDP_NTS) + +/**** Location ****/ +#define cg_upnp_ssdprequest_setlocation(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_HTTP_LOCATION, value) +#define cg_upnp_ssdprequest_getlocation(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_HTTP_LOCATION) + +/**** USN ****/ +#define cg_upnp_ssdprequest_setusn(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_UPNP_SSDP_USN, value) +#define cg_upnp_ssdprequest_getusn(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_UPNP_SSDP_USN) + +/**** MX ****/ +#define cg_upnp_ssdprequest_setmx(ssdpReq,value) cg_http_packet_setheaderinteger((CgHttpPacket*)ssdpReq, CG_UPNP_SSDP_MX, value) +#define cg_upnp_ssdprequest_getmx(ssdpReq) cg_http_packet_getheaderinteger((CgHttpPacket*)ssdpReq,CG_UPNP_SSDP_MX) + +/**** MAN ****/ +#define cg_upnp_ssdprequest_setman(ssdpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpReq, CG_UPNP_SSDP_MAN, value) +#define cg_upnp_ssdprequest_getman(ssdpReq) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpReq,CG_UPNP_SSDP_MAN) + +/**** CacheControl ****/ +void cg_upnp_ssdprequest_setleasetime(CgUpnpSSDPRequest *ssdpReq, int value); +int cg_upnp_ssdprequest_getleasetime(CgUpnpSSDPRequest *ssdpReq); + +/**** toString ****/ +char *cg_upnp_ssdprequest_tostring(CgUpnpSSDPRequest *ssdpReq, CgString *ssdpMsg); + +/**** Print ****/ +#define cg_upnp_ssdprequest_print(ssdpReq) cg_http_request_print(ssdpReq) + +/**************************************** +* Function (SSDPResponse) +****************************************/ + +CgUpnpSSDPResponse *cg_upnp_ssdpresponse_new(); +void cg_upnp_ssdpresponse_delete(CgUpnpSSDPResponse *ssdpRes); + +/**** ST ****/ +#define cg_upnp_ssdpresponse_setst(ssdpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpRes, CG_UPNP_SSDP_ST, value) +#define cg_upnp_ssdpresponse_getst(ssdpRes) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpRes,CG_UPNP_SSDP_ST) + +/**** EXT ****/ +#define cg_upnp_ssdpresponse_setext(ssdpRes) cg_http_packet_setheadervalue((CgHttpPacket*) ssdpRes, CG_UPNP_SSDP_EXT, "") + +/**** SERVER ****/ +#define cg_upnp_ssdpresponse_setserver(ssdpRes, value) cg_http_packet_setheadervalue((CgHttpPacket*) ssdpRes, CG_UPNP_SSDP_SERVER, value) + +/**** Location ****/ +#define cg_upnp_ssdpresponse_setlocation(ssdpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpRes, CG_HTTP_LOCATION, value) +#define cg_upnp_ssdpresponse_getlocation(ssdpRes) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpRes,CG_HTTP_LOCATION) + +/**** USN ****/ +#define cg_upnp_ssdpresponse_setusn(ssdpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpRes, CG_UPNP_SSDP_USN, value) +#define cg_upnp_ssdpresponse_getusn(ssdpRes) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpRes,CG_UPNP_SSDP_USN) + +/**** CacheControl ****/ +void cg_upnp_ssdpresponse_setleasetime(CgUpnpSSDPResponse *ssdpRes, int value); +int cg_upnp_ssdpresponse_getleasetime(CgUpnpSSDPResponse *ssdpRes); + +/**** Date ****/ +#define cg_upnp_ssdpresponse_setdate(ssdpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)ssdpRes, CG_HTTP_DATE, value) +#define cg_upnp_ssdpresponse_getdate(ssdpRes) cg_http_packet_getheadervalue((CgHttpPacket*)ssdpRes,CG_HTTP_DATE) + +/**** toString ****/ +char *cg_upnp_ssdpresponse_tostring(CgUpnpSSDPResponse *ssdpRes, CgString *ssdpMsg); + +/**** Print ****/ +#define cg_upnp_ssdpresponse_print(ssdpReq) cg_http_response_print(ssdpReq) + +/**************************************** +* Function (SSDPSocket) +****************************************/ + +#define cg_upnp_ssdp_socket_new() cg_socket_new(CG_NET_SOCKET_DGRAM) +#define cg_upnp_ssdp_socket_delete(socket) cg_socket_delete(socket) +#define cg_upnp_ssdp_socket_close(socket) cg_socket_close(socket) + +BOOL cg_upnp_ssdp_socket_notifyfrom(CgUpnpSSDPSocket *ssdpSock, CgUpnpSSDPRequest *ssdpReq, char *bindAddr); +BOOL cg_upnp_ssdp_socket_postresponse(CgUpnpSSDPSocket *ssdpSock, CgUpnpSSDPResponse *ssdpReq, char *host, int port); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/ssdp/cssdp_server.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/ssdp/cssdp_server.h new file mode 100644 index 0000000..6eea2c1 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/upnp/ssdp/cssdp_server.h @@ -0,0 +1,247 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cssdp_server.h +* +* Revision: +* +* 05/26/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UPNP_CSSDP_SERVER_H_ +#define _CG_UPNP_CSSDP_SERVER_H_ + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +/**************************************** +* Data Type +****************************************/ + +typedef CgSocket CgUpnpHttpMuSocket; +typedef CgSocket CgUpnpHttpUSocket; + +typedef struct _CgUpnpSSDPPacket { + CgDatagramPacket *dgmPkt; + CgHttpHeaderList *headerList; + void *userData; + CgSysTime timeStamp; + + /* These are used when filtering out duplicate + * M-SEARCHes + */ + CgSysTime *timestamps; + int initialized; +} CgUpnpSSDPPacket; + +typedef void (*CG_UPNP_SSDP_LISTNER)(CgUpnpSSDPPacket *); + +typedef struct _CgUpnpSSDPServer { + BOOL headFlag; + struct _CgUpnpSSDPServer *prev; + struct _CgUpnpSSDPServer *next; + CgUpnpHttpMuSocket *httpmuSock; + CgThread *recvThread; + CG_UPNP_SSDP_LISTNER listener; + void *userData; +} CgUpnpSSDPServer, CgUpnpSSDPServerList; + +typedef void (*CG_UPNP_SSDP_RESPONSE_LISTNER)(CgUpnpSSDPPacket *); + +typedef struct _CgUpnpSSDPResponseServer { + BOOL headFlag; + struct _CgUpnpSSDPServer *prev; + struct _CgUpnpSSDPServer *next; + CgUpnpHttpUSocket *httpuSock; + CgThread *recvThread; + CG_UPNP_SSDP_RESPONSE_LISTNER listener; + void *userData; +} CgUpnpSSDPResponseServer, CgUpnpSSDPResponseServerList; + +/**************************************** +* Function (HTTPMU) +****************************************/ + +#define cg_upnp_httpmu_socket_new() cg_socket_dgram_new() +#define cg_upnp_httpmu_socket_delete(sock) cg_socket_delete(sock) +#define cg_upnp_httpmu_socket_close(sock) cg_socket_close(sock) + +BOOL cg_upnp_httpmu_socket_bind(CgUpnpHttpMuSocket *sock, char *mcastAddr, int port, char *bindAddr); +int cg_upnp_httpmu_socket_recv(CgUpnpHttpMuSocket *sock, CgUpnpSSDPPacket *ssdpPkt); + +/**************************************** +* Function (HTTPU) +****************************************/ + +#define cg_upnp_httpu_socket_new() cg_socket_dgram_new() +#define cg_upnp_httpu_socket_delete(sock) cg_socket_delete(sock) +#define cg_upnp_httpu_socket_close(sock) cg_socket_close(sock) +#define cg_upnp_httpu_socket_new() cg_socket_dgram_new() +#define cg_upnp_httpu_socket_bind(sock, bindPort, bindAddr) cg_socket_bind(sock, bindPort, bindAddr, FALSE, FALSE) +int cg_upnp_httpu_socket_recv(CgUpnpHttpUSocket *sock, CgUpnpSSDPPacket *ssdpPkt); + +/**************************************** +* Function (SSDPPacket) +****************************************/ + +CgUpnpSSDPPacket *cg_upnp_ssdp_packet_new(); +void cg_upnp_ssdp_packet_delete(CgUpnpSSDPPacket *ssdpPkt); +void cg_upnp_ssdp_packet_clear(CgUpnpSSDPPacket *ssdpPkt); + +#define cg_upnp_ssdp_packet_setdatagrampacket(ssdpPkt, value) (ssdpPkt->dgmPkt = value) +#define cg_upnp_ssdp_packet_getdatagrampacket(ssdpPkt) (ssdpPkt->dgmPkt) +#define cg_upnp_ssdp_packet_setdata(ssdpPkt, value) cg_string_setvalue(ssdpPkt->dgmPkt->data, value) +#define cg_upnp_ssdp_packet_getdata(ssdpPkt) cg_string_getvalue(ssdpPkt->dgmPkt->data) +#define cg_upnp_ssdp_packet_setuserdata(ssdpPkt, data) (ssdpPkt->userData = data) +#define cg_upnp_ssdp_packet_getuserdata(ssdpPkt) (ssdpPkt->userData) +#define cg_upnp_ssdp_packet_settimestamp(ssdpPkt, value) (ssdpPkt->timeStamp = value) +#define cg_upnp_ssdp_packet_gettimestamp(ssdpPkt) (ssdpPkt->timeStamp) +#define cg_upnp_ssdp_packet_getexpiration(ssdpPkt) (cg_upnp_ssdp_packet_getmaxage(ssdpPkt) == 0 ? 0 : cg_upnp_ssdp_packet_gettimestamp(ssdpPkt) + cg_upnp_ssdp_packet_getmaxage(ssdpPkt)) + +void cg_upnp_ssdp_packet_setheader(CgUpnpSSDPPacket *ssdpPkt, char *ssdpMsg); +#define cg_upnp_ssdp_packet_addheader(ssdpPkt, header) cg_http_headerlist_add(ssdpPkt->headerList, header) +#define cg_upnp_ssdp_packet_getheaders(ssdpPkt) cg_http_headerlist_gets(ssdpPkt->headerList) + +#define cg_upnp_ssdp_packet_gethost(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_HOST) +#define cg_upnp_ssdp_packet_getserver(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_SERVER) +#define cg_upnp_ssdp_packet_getcachecontrol(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_CACHE_CONTROL) +#define cg_upnp_ssdp_packet_getdate(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_DATE) +#define cg_upnp_ssdp_packet_getext(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_EXT) +#define cg_upnp_ssdp_packet_getlocation(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_LOCATION) +#define cg_upnp_ssdp_packet_getst(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_ST) +#define cg_upnp_ssdp_packet_getusn(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_USN) +#define cg_upnp_ssdp_packet_getmx(ssdpPkt) cg_str2int(cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_MX)) +#define cg_upnp_ssdp_packet_getman(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_MAN) +#define cg_upnp_ssdp_packet_getnt(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_NT) +#define cg_upnp_ssdp_packet_getnts(ssdpPkt) cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_NTS) +long cg_upnp_ssdp_packet_getmaxage(CgUpnpSSDPPacket *ssdpPkt); + +#define cg_upnp_ssdp_packet_isdiscover(ssdpPkt) cg_upnp_man_isdiscover(cg_upnp_ssdp_packet_getman(ssdpPkt)) +#define cg_upnp_ssdp_packet_isalive(ssdpPkt) cg_upnp_nts_isalive(cg_upnp_ssdp_packet_getnts(ssdpPkt)) +#define cg_upnp_ssdp_packet_isbyebye(ssdpPkt) cg_upnp_nts_isbyebye(cg_upnp_ssdp_packet_getnts(ssdpPkt)) + +BOOL cg_upnp_ssdp_packet_isrootdevice(CgUpnpSSDPPacket *ssdpPkt); + +#define cg_upnp_ssdp_packet_getlocaladdress(ssdpPkt) cg_socket_datagram_packet_getlocaladdress(ssdpPkt->dgmPkt) +#define cg_upnp_ssdp_packet_getlocalport(ssdpPkt) cg_socket_datagram_packet_getlocalport(ssdpPkt->dgmPkt) +#define cg_upnp_ssdp_packet_getremoteaddress(ssdpPkt) cg_socket_datagram_packet_getremoteaddress(ssdpPkt->dgmPkt) +#define cg_upnp_ssdp_packet_getremoteport(ssdpPkt) cg_socket_datagram_packet_getremoteport(ssdpPkt->dgmPkt) + +void cg_upnp_ssdp_packet_copy(CgUpnpSSDPPacket *destSsdpPkt, CgUpnpSSDPPacket *srcSsdpPkt); +void cg_upnp_ssdp_packet_print(CgUpnpSSDPPacket *ssdpPkt); + +/**************************************** +* Function (SSDPServer) +****************************************/ + +CgUpnpSSDPServer *cg_upnp_ssdp_server_new(); +void cg_upnp_ssdp_server_delete(CgUpnpSSDPServer *server); + +#define cg_upnp_ssdp_server_next(server) (CgUpnpSSDPServer *)cg_list_next((CgList *)server) + +BOOL cg_upnp_ssdp_server_open(CgUpnpSSDPServer *server, char *bindAddr); +BOOL cg_upnp_ssdp_server_close(CgUpnpSSDPServer *server); + +#define cg_upnp_ssdp_server_isopened(server) ((server->httpmuSock != NULL) ? TRUE : FALSE) +#define cg_upnp_ssdp_server_getsocket(server) (server->httpmuSock) + +#define cg_upnp_ssdp_server_setlistener(server, func) (server->listener = func) +#define cg_upnp_ssdp_server_getlistener(server) (server->listener) +void cg_upnp_ssdp_server_performlistener(CgUpnpSSDPServer *server, CgUpnpSSDPPacket *ssdpPkt); + +#define cg_upnp_ssdp_server_setuserdata(server, data) (server->userData = data) +#define cg_upnp_ssdp_server_getuserdata(server) (server->userData) + +BOOL cg_upnp_ssdp_server_start(CgUpnpSSDPServer *server); +BOOL cg_upnp_ssdp_server_stop(CgUpnpSSDPServer *server); + +/**************************************** +* Function (SSDPServerList) +****************************************/ + +CgUpnpSSDPServerList *cg_upnp_ssdp_serverlist_new(); +void cg_upnp_ssdp_serverlist_delete(CgUpnpSSDPServerList *serverList); + +#define cg_upnp_ssdp_serverlist_clear(serverList) cg_list_clear((CgList *)serverList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_ssdp_server_delete) +#define cg_upnp_ssdp_serverlist_size(serverList) cg_list_size((CgList *)serverList) +#define cg_upnp_ssdp_serverlist_gets(serverList) (CgUpnpSSDPServer *)cg_list_next((CgList *)serverList) +#define cg_upnp_ssdp_serverlist_add(serverList, server) cg_list_add((CgList *)serverList, (CgList *)server) + +BOOL cg_upnp_ssdp_serverlist_open(CgUpnpSSDPServerList *ssdpServerList); +BOOL cg_upnp_ssdp_serverlist_close(CgUpnpSSDPServerList *ssdpServerList); +BOOL cg_upnp_ssdp_serverlist_start(CgUpnpSSDPServerList *ssdpServerList); +BOOL cg_upnp_ssdp_serverlist_stop(CgUpnpSSDPServerList *ssdpServerList); +void cg_upnp_ssdp_serverlist_setlistener(CgUpnpSSDPServerList *ssdpServerList, CG_UPNP_SSDP_LISTNER listener); +void cg_upnp_ssdp_serverlist_setuserdata(CgUpnpSSDPServerList *ssdpServerList, void *data); + +/**************************************** +* Function (SSDPResponseServer) +****************************************/ + +CgUpnpSSDPResponseServer *cg_upnp_ssdpresponse_server_new(); +void cg_upnp_ssdpresponse_server_delete(CgUpnpSSDPResponseServer *server); + +#define cg_upnp_ssdpresponse_server_next(server) (CgUpnpSSDPResponseServer *)cg_list_next((CgList *)server) + +BOOL cg_upnp_ssdpresponse_server_open(CgUpnpSSDPResponseServer *server, int bindPort, char *bindAddr); +BOOL cg_upnp_ssdpresponse_server_close(CgUpnpSSDPResponseServer *server); + +#define cg_upnp_ssdpresponse_server_isopened(server) ((server->httpuSock != NULL) ? TRUE : FALSE) +#define cg_upnp_ssdpresponse_server_getsocket(server) (server->httpuSock) + +#define cg_upnp_ssdpresponse_server_setlistener(server, func) (server->listener = func) +#define cg_upnp_ssdpresponse_server_getlistener(server) (server->listener) +void cg_upnp_ssdpresponse_server_performlistener(CgUpnpSSDPResponseServer *server, CgUpnpSSDPPacket *ssdpPkt); + +#define cg_upnp_ssdpresponse_server_setuserdata(server, data) (server->userData = data) +#define cg_upnp_ssdpresponse_server_getuserdata(server) (server->userData) + +BOOL cg_upnp_ssdpresponse_server_start(CgUpnpSSDPResponseServer *server); +BOOL cg_upnp_ssdpresponse_server_stop(CgUpnpSSDPResponseServer *server); + +BOOL cg_upnp_ssdpresponse_server_post(CgUpnpSSDPResponseServer *server, CgUpnpSSDPRequest *ssdpReq); + +/**************************************** +* Function (SSDPResponseServerList) +****************************************/ + +CgUpnpSSDPResponseServerList *cg_upnp_ssdpresponse_serverlist_new(); +void cg_upnp_ssdpresponse_serverlist_delete(CgUpnpSSDPResponseServerList *serverList); + +#define cg_upnp_ssdpresponse_serverlist_clear(serverList) cg_list_clear((CgList *)serverList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_ssdpresponse_server_delete) +#define cg_upnp_ssdpresponse_serverlist_size(serverList) cg_list_size((CgList *)serverList) +#define cg_upnp_ssdpresponse_serverlist_gets(serverList) (CgUpnpSSDPResponseServer *)cg_list_next((CgList *)serverList) +#define cg_upnp_ssdpresponse_serverlist_add(serverList, server) cg_list_add((CgList *)serverList, (CgList *)server) + +BOOL cg_upnp_ssdpresponse_serverlist_open(CgUpnpSSDPResponseServerList *ssdpServerList, int bindPort); +BOOL cg_upnp_ssdpresponse_serverlist_close(CgUpnpSSDPResponseServerList *ssdpServerList); +BOOL cg_upnp_ssdpresponse_serverlist_start(CgUpnpSSDPResponseServerList *ssdpServerList); +BOOL cg_upnp_ssdpresponse_serverlist_stop(CgUpnpSSDPResponseServerList *ssdpServerList); +void cg_upnp_ssdpresponse_serverlist_setlistener(CgUpnpSSDPResponseServerList *ssdpServerList, CG_UPNP_SSDP_LISTNER listener); +void cg_upnp_ssdpresponse_serverlist_setuserdata(CgUpnpSSDPResponseServerList *ssdpServerList, void *data); +BOOL cg_upnp_ssdpresponse_serverlist_post(CgUpnpSSDPResponseServerList *ssdpServerList, CgUpnpSSDPRequest *ssdpReq); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/ccond.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/ccond.h new file mode 100644 index 0000000..ef425fd --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/ccond.h @@ -0,0 +1,110 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) 2006 Nokia Corporation +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: ccond.h +* +* Revision: +* +* 16-Jan-06 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UTIL_CCOND_H_ +#define _CG_UTIL_CCOND_H_ + +#include +#include + +#if defined(WIN32) && !defined(ITRON) +#include +#elif defined(BTRON) +#include +#elif defined(ITRON) +#include +#elif defined(TENGINE) && !defined(PROCESS_BASE) +#include +#elif defined(TENGINE) && defined(PROCESS_BASE) +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** + * Data Types + ****************************************/ + +/** + * \brief The generic wrapper struct for CyberLinkC's conds. + * + * This wrapper has been created to enable 100% code + * compatibility for different platforms (Linux, Win32 etc..) + */ +typedef struct _CgCond { +#if defined(WIN32) && !defined(ITRON) + HANDLE condID; +#elif defined(BTRON) + WERR condID; +#elif defined(ITRON) + ER_ID condID; +#elif defined(TENGINE) && !defined(PROCESS_BASE) + ID condID; +#elif defined(TENGINE) && defined(PROCESS_BASE) + WERR condID; +#else + /** The cond entity */ + pthread_cond_t condID; +#endif +} CgCond; + +/**************************************** + * Functions + ****************************************/ + +/** + * Create a new condition variable + */ +CgCond *cg_cond_new(); + +/** + * Destroy a condition variable + * + * \param cond The cond to destroy + */ +BOOL cg_cond_delete(CgCond *cond); + +/** + * Wait for condition variable to be signalled. + * + * \param cond Cond to be waited + * \param mutex Mutex used for synchronization + * \param timeout Maximum time in seconds to wait, 0 to wait forever + */ +BOOL cg_cond_wait(CgCond *cond, CgMutex *mutex, unsigned long timeout); + +/** + * Signal a condition variable + * + * \param cond Cond to be signalled + */ +BOOL cg_cond_signal(CgCond *cond); + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/cdictionary.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/cdictionary.h new file mode 100644 index 0000000..f7a1cdd --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/cdictionary.h @@ -0,0 +1,188 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cdictionary.h +* +* Revision: +* +* 05/26/09 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UTIL_CDICTIONARY_H_ +#define _CG_UTIL_CDICTIONARY_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** + * Define + ****************************************/ + +/**************************************** + * Data Type + ****************************************/ + +/** + * \brief The generic wrapper struct for CyberLinkC's dictionarys. + * + * This wrapper has been created to enable 100% code + * compatibility between different platforms (Linux, Win32 etc..) + */ +typedef struct _CgDictionary { + BOOL headFlag; + struct _CgDictionary *prev; + struct _CgDictionary *next; + CgString *key; + CgString *value; +} CgDictionaryElement, CgDictionary; + +/**************************************** +* Function +****************************************/ + +/** + * Create a new dictionary + */ +CgDictionaryElement *cg_dictionary_element_new(); + +/** + * Destroy a dictionary. + * + * \param dirElem Dictionary to destroy + */ +BOOL cg_dictionary_element_delete(CgDictionaryElement *dirElem); + +/** + * Set a key + * + * \param dirElem Dictionary struct + * \param name String to set + */ +#define cg_dictionary_element_setkey(dirElem, name) cg_string_setvalue(dirElem->key, name) +/** + * Get a key + * + * \param dirElem Dictionary struct + */ +#define cg_dictionary_element_getkey(dirElem) cg_string_getvalue(dirElem->key) + +/** + * Set a value + * + * \param dirElem Dictionary struct + * \param value String to set + */ +#define cg_dictionary_element_setvalue(dirElem, val) cg_string_setvalue(dirElem->value, val) +/** + * Get a value + * + * \param dirElem Dictionary struct + */ +#define cg_dictionary_element_getvalue(dirElem) cg_string_getvalue(dirElem->value) + +#define cg_dictionary_element_next(dirElem) (CgDictionaryElement *)cg_list_next((CgList *)dirElem) +#define cg_dictionary_element_remove(dirElem) cg_list_remove((CgList *)dirElem) + +/**************************************** +* Function (Dictionary List) +****************************************/ + +/** + * Create a new dictionary list + * + * \return Dictionary list + */ +CgDictionary *cg_dictionary_new(); + +/** + * Destroy a dictionary list + * + * \param dir The dictionary list in question + */ +void cg_dictionary_delete(CgDictionary *dir); + +/** + * Clear the contents of a dictionary list + * + * \param dir Dictionary list in question + */ +#define cg_dictionary_clear(dir) cg_list_clear((CgList *)dir, (CG_LIST_DESTRUCTORFUNC)cg_dictionary_element_delete) + +/** + * Get the size of a dictionary list + * + * \param dir The dictionary list in question + */ +#define cg_dictionary_size(dir) cg_list_size((CgList *)dir) + +/** + * Get the first actual item from a dictionary list to use as an iterator + * + * \param dir The dictionary list in question + */ +#define cg_dictionary_gets(dir) (CgDictionaryElement *)cg_list_next((CgList *)dir) + +/** + * Add a dictionary into a dictionary list + * + * \param dir The dictionary list in question + * \param dirElem The dictionary to add to the list + */ +#define cg_dictionary_add(dir, dirElem) cg_list_add((CgList *)dir, (CgList *)dirElem) + +/** + * Remove a dictionary from dictionary list + * + * \param dirElem The dictionary to be removed + */ +#define cg_dictionary_remove(dirElem) cg_list_remove((CgList *)dirElem) + +/** + * Get a element of the specified key + * + * \param dir The dictionary list in question + * \param key Name to search. + * \return Element of the specified key. + */ +CgDictionaryElement *cg_dictionary_get(CgDictionary *dir, char *key); + +/** + * Set a new element into a dictionary + * + * \param dir The dictionary list in question + * \param key Name to set. + * \param value Value to set. + */ +void cg_dictionary_setvalue(CgDictionary *dir, char *key, char *value); + +/** + * Get a value of the specified key + * + * \param dir The dictionary list in question + * \param key Name to search. + * \return Value of the specified key. + */ +char *cg_dictionary_getvalue(CgDictionary *dir, char *key); + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/clist.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/clist.h new file mode 100644 index 0000000..c1be2cf --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/clist.h @@ -0,0 +1,171 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: clist.h +* +* Revision: +* +* 01/18/05 +* - first revision +* +* 10/31/05 +* - Added comments to all functions and structs +* +******************************************************************/ + +#ifndef _CG_UTIL_CLIST_H_ +#define _CG_UTIL_CLIST_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** + * Define + ****************************************/ + +/** + * Prototype for individual list node destructor functions + * + */ +typedef void (*CG_LIST_DESTRUCTORFUNC)(void *); + +/**************************************** + * Data Type + ****************************************/ + +/** + * \brief The generic list interface in CyberLinkC. + * + * Each struct in CyberLinkC, that is designed to be a part of + * a list, must have these elements in their definition before the + * actual struct definition. The struct pointers are then cast to + * CgList* and operated with cg_list_* functions. + */ +typedef struct _CgList { + + /** Marks the beginning of a list */ + BOOL headFlag; + /** Pointer to the next list node */ + struct _CgList *prev; + /** Pointer to the previous list node */ + struct _CgList *next; + +} CgList; + +/**************************************** + * Functions + ****************************************/ + +/** + * Initialize a list node to act as the first node + * + * \param list List node + */ +void cg_list_header_init(CgList *list); + +/** + * Initialize a list node to act as a regular node, part of a list. + * + * \param list List node + */ +void cg_list_node_init(CgList *list); + +/** + * Insert a list node or a complete list structure after the given node + * + * \param prevList Insert after this node + * \param list List node or list structure to insert + */ +void cg_list_insert(CgList *prevList, CgList *list); + +/** + * \todo This works essentially like insert, although it is more error-prone?! + * \todo There might be a bug in this function. + * + */ +void cg_list_add(CgList *headList, CgList *list); + +/** + * Remove a node from a list. Does not free any memory, but only removes + * the next and previous link associations regarding the given node. + * + * \param list List node to remove + */ +void cg_list_remove(CgList *list); + +/** + * Get the number of nodes in the current list structure. Counts forwards from the given + * node, so if you want to get the complete size, give a header node as the parameter. + * + * \param headList List header + */ +int cg_list_size(CgList *headList); + +/** + * Get an item from the list by the item's index + * + * \param headList List header + * \param index The index of the item to get + */ +CgList *cg_list_get(CgList *headList, int index); + +/** + * Get the previous node. Wrap around if the beginning has been reached. + * + * + * \param list Current node + */ +CgList *cg_list_prev_circular(CgList *list); + +/** + * Get the previous node. Returns NULL if beginning has been reached + * + * \param list Current node + */ +CgList *cg_list_prev(CgList *list); + +/** + * Get the next node. Wrap around if the end has been reached. + * + * \param list Current node + */ +CgList *cg_list_next_circular(CgList *list); + +/** + * Get the next node. Returns NULL if end has been reached. + * + * \param list Current node + */ +CgList *cg_list_next(CgList *list); + +/** + * Clear the list and delete all of its contents with \ref CG_LIST_DESTRUCTORFUNC + * + * \param headList List header + * \param destructorFunc Function pointer that clears the contents of individual nodes + */ +void cg_list_clear(CgList *headList, CG_LIST_DESTRUCTORFUNC destructorFunc); + +/** + * Get the first actual item from a list for iteration + * + * \param headList List header + */ +#define cg_list_gets(headList) cg_list_next(headList) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/clog.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/clog.h new file mode 100644 index 0000000..2e8f557 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/clog.h @@ -0,0 +1,174 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) 2006 Nokia Corporation +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: clog.h +* +* Revision: +* +* 06-Feb-06 +* - first revision +* +******************************************************************/ + +#ifndef __CLOG_H +#define __CLOG_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_LOG_STRING 2048 + +/* Message masks and descriptions */ +#define SEV_UNKNOWN_S "Unknown" + +#define SEV_ERROR 1 +#define SEV_ERROR_S "Error" + +#define SEV_WARNING 2 +#define SEV_WARNING_S "Warning" + +#define SEV_INFO 4 +#define SEV_INFO_S "Info" + +#define SEV_DEBUG_L1 8 +#define SEV_DEBUG_L1_S "Debug (general)" + +#define SEV_DEBUG_L2 16 +#define SEV_DEBUG_L2_S "Debug (stack)" + +#define SEV_DEBUG_L3 32 +#define SEV_DEBUG_L3_S "Debug (application)" + +/* Low level debug messages like when printing out (important) function + * entry/leaving points */ +#define SEV_DEBUG_L4 64 +#define SEV_DEBUG_L4_S "Debug (low level L4)" + +/* Low level debug messages to be used e.g. when printing out less important + * function entry/leaving points */ +#define SEV_DEBUG_L5 128 +#define SEV_DEBUG_L5_S "Debug (low level L5)" + +/* Mask for all message types */ +#define SEV_ALL ( SEV_ERROR | SEV_WARNING | SEV_INFO | SEV_DEBUG_L1 | SEV_DEBUG_L2 | SEV_DEBUG_L3 | SEV_DEBUG_L4 | SEV_DEBUG_L5 ) + +/* Filename, line_n and unique build number can be used to give unique id tag + * to all messages. + */ +void cg_log_print(int severity, const char *file, int line_n, const char *function, const char *format, ...); +void cg_log_set_separator(char *s); + +/* Target defines a file or stdout/stderr, in future it may also + * contain special targets like network addresses etc. + */ +int cg_log_add_target(char *target, int severity_mask); +int cg_log_clear_targets(); + +/* Standard error handling */ +#if defined(__USE_ISOC99) +#define cg_log_error(format, ...) cg_log_print(SEV_ERROR, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +#elif defined(WIN32) || defined(WINCE) +void cg_log_error(const char *format, ...); +#else +#define cg_log_error(format...) cg_log_print(SEV_ERROR, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +#endif + +#if defined(__USE_ISOC99) +#define cg_log_warning(format, ...) cg_log_print(SEV_WARNING, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +#elif defined(WIN32) || defined(WINCE) +void cg_log_warning(const char *format, ...); +#else +#define cg_log_warning(format...) cg_log_print(SEV_WARNING, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +#endif + +#if defined(__USE_ISOC99) +#define cg_log_info(format, ...) cg_log_print(SEV_INFO, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +#elif defined(WIN32) || defined(WINCE) +void cg_log_info(const char *format, ...); +#else +#define cg_log_info(format...) cg_log_print(SEV_INFO, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +#endif + +/* General and low level debug */ +#ifdef CLOG_DEBUG +#if defined(__USE_ISOC99) +# define cg_log_debug(format, ...) cg_log_print(SEV_DEBUG_L1, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +# define cg_log_debug_l4(format, ...) cg_log_print(SEV_DEBUG_L4, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +# define cg_log_debug_l5(format, ...) cg_log_print(SEV_DEBUG_L5, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +#elif defined(WIN32) +void cg_log_debug(const char *format, ...); +void cg_log_debug_l4(const char *format, ...); +void cg_log_debug_l5(const char *format, ...); +#else +# define cg_log_debug(format...) cg_log_print(SEV_DEBUG_L1, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +# define cg_log_debug_l4(format...) cg_log_print(SEV_DEBUG_L4, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +# define cg_log_debug_l5(format...) cg_log_print(SEV_DEBUG_L5, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +#endif +#else +#if defined(__USE_ISOC99) +# define cg_log_debug(format, ...) +# define cg_log_debug_l4(format, ...) +# define cg_log_debug_l5(format, ...) +#elif defined(WIN32) || defined(WINCE) +void cg_log_debug(const char *format, ...); +void cg_log_debug_l4(const char *format, ...); +void cg_log_debug_l5(const char *format, ...); +#else +# define cg_log_debug(format...) +# define cg_log_debug_l4(format...) +# define cg_log_debug_l5(format...) +#endif +#endif + +/* Debug messages coming from stack */ +#ifdef CLOG_DEBUG_STACK +#if defined(__USE_ISOC99) +# define cg_log_debug_s(format, ...) cg_log_print(SEV_DEBUG_L2, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +#elif defined(WIN32) +void cg_log_debug_s(const char *format, ...); +#else +# define cg_log_debug_s(format...) cg_log_print(SEV_DEBUG_L2, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +#endif +#else +#if defined(__USE_ISOC99) +# define cg_log_debug_s(format, ...) +#elif defined(WIN32) || defined(WINCE) +void cg_log_debug_s(const char *format, ...); +#else +# define cg_log_debug_s(format...) +#endif +#endif + +/* Debug messages coming from application */ +#ifdef CLOG_DEBUG_APPLICATION +#if defined(__USE_ISOC99) +# define cg_log_debug_a(format...) cg_log_print(SEV_DEBUG_L3, __FILE__, __LINE__, __PRETTY_FUNCTION__, format, __VA_ARGS__) +#elif defined(WIN32) +void cg_log_debug_a(const char *format, ...); +#else +# define cg_log_debug_a(format...) cg_log_print(SEV_DEBUG_L3, __FILE__, __LINE__, __PRETTY_FUNCTION__, format) +#endif +#else +#if defined(__USE_ISOC99) +# define cg_log_debug_a(format, ...) +#elif defined(WIN32) || defined(WINCE) +void cg_log_debug_a(const char *format, ...); +#else +# define cg_log_debug_a(format...) +#endif +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CLOG_H */ diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/cmutex.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/cmutex.h new file mode 100644 index 0000000..962a677 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/cmutex.h @@ -0,0 +1,131 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cmutex.h +* +* Revision: +* +* 01/17/05 +* - first revision +* +* 10/31/05 +* - Added comments to all functions and structs +* +******************************************************************/ + +#ifndef _CG_UTIL_CMUTEX_H_ +#define _CG_UTIL_CMUTEX_H_ + +#include + +#if defined(WIN32) && !defined(ITRON) +#include +#elif defined(BTRON) +#include +#elif defined(ITRON) +#include +#elif defined(TENGINE) && !defined(PROCESS_BASE) +#include +#elif defined(TENGINE) && defined(PROCESS_BASE) +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** + * Data Types + ****************************************/ + +/** + * \brief The generic wrapper struct for CyberLinkC's mutexes. + * + * This wrapper has been created to enable 100% code + * compatibility for different platforms (Linux, Win32 etc..) + */ +typedef struct _CgMutex { +#if defined(WIN32) && !defined(ITRON) + HANDLE mutexID; +#elif defined(BTRON) + WERR mutexID; +#elif defined(ITRON) + ER_ID mutexID; +#elif defined(TENGINE) && !defined(PROCESS_BASE) + ID mutexID; +#elif defined(TENGINE) && defined(PROCESS_BASE) + WERR mutexID; +#else + /** The mutex entity */ + pthread_mutex_t mutexID; +#endif +} CgMutex; + +#if defined(WITH_THREAD_LOCK_TRACE) && defined(__USE_ISOC99) +#include + +typedef struct _CgLockInfo +{ + struct _CgLockInfo *next; + pthread_t thread_id; + char *file, *function; + int line, mutex_id; +} CgLockInfo; +#endif + +/**************************************** + * Functions + ****************************************/ + +/** + * Create a new mutex + */ +CgMutex *cg_mutex_new(); + +/** + * Destroy a mutex + * + * \param mutex The mutex to destroy + */ +BOOL cg_mutex_delete(CgMutex *mutex); + +/** + * Acquire a mutex lock + * + * \param mutex Mutex to lock + */ + +#if defined(WITH_THREAD_LOCK_TRACE) && defined(__USE_ISOC99) +# define cg_mutex_lock(mutex) cg_mutex_lock_trace(__FILE__, __LINE__, __PRETTY_FUNCTION__, mutex) +#else + BOOL cg_mutex_lock(CgMutex *mutex); +#endif + +/** + * Release a locked mutex + * + * \param mutex Mutex to unlock + */ +#if defined(WITH_THREAD_LOCK_TRACE) && defined(__USE_ISOC99) +# define cg_mutex_unlock(mutex) cg_mutex_unlock_trace(__FILE__, __LINE__, __PRETTY_FUNCTION__, mutex) +#else + BOOL cg_mutex_unlock(CgMutex *mutex); +#endif + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/cstring.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/cstring.h new file mode 100644 index 0000000..f4cdb24 --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/cstring.h @@ -0,0 +1,172 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cstring.h +* +* Revision: +* +* 01/25/05 +* - first revision +* 03/01/06 Theo Beisch +* - introduced LONGLONG macro +* - added cg_strtrimwhite() to trim all +* leading and trailing non-printable chars +* +******************************************************************/ + +#ifndef _CG_UTIL_CSTRING_H_ +#define _CG_UTIL_CSTRING_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_STRING_MEMORY_ALLOCATION_UNIT 64 + +/* UINT_MAX : 4294967295U */ +#define CG_STRING_INTEGER_BUFLEN 16 + + /* ULONG_MAX : 4294967295UL */ +#define CG_STRING_LONG_BUFLEN 32 + + /* ULLONG_MAX : 18446744073709551615ULL */ +#define CG_STRING_LONGLONG_BUFLEN 32 + +#define CG_STRING_FLOAT_BUFLEN 64 +#define CG_STRING_DOUBLE_BUFLEN 64 + +/**************************************** +* Function +****************************************/ + +char *cg_strdup(char *str); +int cg_strlen(char *str); +char *cg_strcpy(char *dest, char *src); +char *cg_strcat(char *dest, char *src); +int cg_strcmp(char *str1, char *str2); +int cg_strncmp(char *str1, char *str2, int nchars); +int cg_strcasecmp(char *str1, char *str2); +BOOL cg_streq(char *str1, char *str2); +BOOL cg_strcaseeq(char *str1, char *str2); +int cg_strchr(char *str, char *chars, int nchars); +int cg_strrchr(char *str, char *chars, int nchars); +int cg_strstr(char *haystack, char *needle); +char *cg_strtrimwhite(char *str); +char *cg_strtrim(char *str, char *delim, int ndelim); +char *cg_strltrim(char *str, char *delim, int ndelim); +char *cg_strrtrim(char *str, char *delim, int ndelim); +char *cg_int2str(int value, char *buf, int bufSize); +char *cg_long2str(long value, char *buf, int bufSize); +char *cg_float2str(float value, char *buf, int bufSize); +char *cg_double2str(double value, char *buf, int bufSize); +char *cg_strncpy(char *str1, char *str2, size_t cnt); +char *cg_strncat(char *str1, char *str2, size_t cnt); + +#if defined(CG_USE_INT64) +char *cg_longlong2str(CgInt64 value, char *buf, int bufSize); +#endif + +#define cg_str2int(value) (value ? atoi(value) : 0) +#define cg_str2long(value) (value ? atol(value) : 0) +#define cg_strhex2long(value) (value ? strtol(value, NULL, 16) : 0) +#define cg_strhex2ulong(value) (value ? strtoul(value, NULL, 16) : 0) +#define cg_str2float(value) ((float)(value ? atof(value) : 0.0)) +#define cg_str2double(value) (value ? atof(value) : 0.0) + +#if defined(CG_USE_INT64) +#if defined(__USE_ISOC99) || defined(HAVE_LONGLONG) +#define cg_str2longlong(value) (value ? atoll(value) : 0) +#define cg_strhex2longlong(value) (value ? strtoll(value, NULL, 16) : 0) +#define cg_strhex2ulonglong(value) (value ? strtoull(value, NULL, 16) : 0) +#elif (defined(WIN32) || defined(WINCE)) +#define cg_str2longlong(value) (value ? _atoi64(value) : 0) +#endif +#endif + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgString { + char *value; + int memSize; + int valueSize; +} CgString; + +typedef struct _CgStringTokenizer { + char *value; + char *delim; + int delimCnt; + int nextStartPos; + int lastPos; + char *currToken; + char *nextToken; + char repToken; + BOOL hasNextTokens; +} CgStringTokenizer; + +/**************************************** +* Function (StringTokenizer) +****************************************/ + +CgStringTokenizer *cg_string_tokenizer_new(char *str, char *delim); +void cg_string_tokenizer_delete(CgStringTokenizer *strToken); +BOOL cg_string_tokenizer_hasmoretoken(CgStringTokenizer *strToken); +char *cg_string_tokenizer_nexttoken(CgStringTokenizer *strToken); +char *cg_string_tokenizer_nextalltoken(CgStringTokenizer *strToken); + +void cg_string_tokenizer_print(CgStringTokenizer *strToken); + +/**************************************** +* Function (String) +****************************************/ + +CgString *cg_string_new(); +void cg_string_delete(CgString *str); +void cg_string_clear(CgString *str); + +void cg_string_setvalue(CgString *str, char *value); +void cg_string_setintvalue(CgString *str, int value); +void cg_string_setlongvalue(CgString *str, long value); +void cg_string_setfloatvalue(CgString *str, float value); +void cg_string_setdoublevalue(CgString *str, double value); +void cg_string_setnvalue(CgString *str, char *value, int len); +void cg_string_setpointervalue(CgString *str, char *value, int len); + +char *cg_string_getvalue(CgString *str); +#define cg_string_getintvalue(str) cg_str2int(cg_string_getvalue(str)) +#define cg_string_getlongvalue(str) cg_str2long(cg_string_getvalue(str)) +#define cg_string_getfloatvalue(str) cg_str2float(cg_string_getvalue(str)) +#define cg_string_getdoublevalue(str) cg_str2double(cg_string_getvalue(str)) + +int cg_string_length(CgString *str); + +char *cg_string_addvalue(CgString *str, char *value); +char *cg_string_naddvalue(CgString *str, char *value, int valueLen); +char *cg_string_addrepvalue(CgString *str, char *value, int repeatCnt); +char *cg_string_naddrepvalue(CgString *str, char *value, int valueLen, int repeatCnt); + +char *cg_string_replace(CgString *str, char *fromStr[], char *toStr[], int fromStrCnt); + +int cg_string_getmemorysize(CgString *str); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/cthread.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/cthread.h new file mode 100644 index 0000000..01e917d --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/cthread.h @@ -0,0 +1,298 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cthread.h +* +* Revision: +* +* 02/07/05 +* - first revision +* +* 10/31/05 +* - Modified the thread struct to use the cg_list concept +* 02/13/06 Theo Beisch +* - added WINCE support +* 03/20/06 Theo Beisch +* - added thread->deletePending and thread->selfDelete (WINCE only) +* so that a thread can delete its own cg_thread context when truly +* finished (as cg_thread_stop is not reliable under WINCE) +* - added cg_threadlist_remove +* 06/13/07 Fabrice Fontaine Orange +* - Bug correction : Variable used to wait for thread termination by sleeping instead of joining. +* +******************************************************************/ + +#ifndef _CG_UTIL_CTHREAD_H_ +#define _CG_UTIL_CTHREAD_H_ + +#include +#include +#include + +#include +#if defined(WIN32) && !defined(ITRON) +#include +#elif defined(BTRON) +#include +#elif defined(ITRON) +#include +#elif defined(TENGINE) && !defined(PROCESS_BASE) +#include +#elif defined(TENGINE) && defined(PROCESS_BASE) +#include +#else +#include +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** + * Define + ****************************************/ + +#if defined (WINCE) +#define CG_THREAD_SHUTDOWN_ATTEMPTS 10 +#define CG_THREAD_MIN_SLEEP 1000 +/* ADD Fabrice Fontaine Orange 24/04/2007 */ +/* Bug correction : Variable used to wait for thread termination by sleeping */ +/* instead of joining */ +#else +#define CG_THREAD_MIN_SLEEP 1000 +/* ADD END Fabrice Fontaine Orange 24/04/2007 */ +#endif + +/**************************************** + * Data Type + ****************************************/ + +/** + * \brief The generic wrapper struct for CyberLinkC's threads. + * + * This wrapper has been created to enable 100% code + * compatibility between different platforms (Linux, Win32 etc..) + */ +typedef struct _CgThread { + BOOL headFlag; + struct _CgThread *prev; + struct _CgThread *next; + + /** Indicates whether this thread is ready to run */ + BOOL runnableFlag; +#if defined WINCE + /** serves as look ahead to have the thread manage its own delete(thread) on exit */ + BOOL isRunning; + BOOL deletePending; + CgSysTime sleep; +#endif //WINCE + +#if defined DEBUG + char friendlyName[32]; +#endif + +#if defined(WIN32) && !defined(ITRON) + HANDLE hThread; + DWORD threadID; +#elif defined(BTRON) + W taskID; +#elif defined(ITRON) + ER_ID taskID; +#elif defined(TENGINE) && !defined(PROCESS_BASE) + ID taskID; +#elif defined(TENGINE) && defined(PROCESS_BASE) + WERR taskID; +#else + + /** The POSIX thread handle */ + pthread_t pThread; + +#endif + + /** Thread's worker function */ + void (*action)(struct _CgThread *); + + /** Arbitrary data pointer */ + void *userData; +} CgThread, CgThreadList; + +/** + * Prototype for the threads' worker functions + */ +typedef void (*CG_THREAD_FUNC)(CgThread *); + +/**************************************** +* Function +****************************************/ + +/** + * Create a new thread + */ +CgThread *cg_thread_new(); + +/** + * Get a self reference to thread. + */ + +CgThread *cg_thread_self(); + +/** + * Stop and destroy a thread. + * + * \param thread Thread to destroy + */ +BOOL cg_thread_delete(CgThread *thread); + +/** + * Start a thread (must be created first with ch_thread_new()) + * + * \param thread Thread to start + */ +BOOL cg_thread_start(CgThread *thread); + +/** + * Stop a running thread. + * + * \param thread Thread to stop + */ +BOOL cg_thread_stop(CgThread *thread); + +/** + * Stop the running thread and signal the given CGCond. + */ +BOOL cg_thread_stop_with_cond(CgThread *thread, CgCond *cond); + +/** + * Restart a thread. Essentially calls cg_thread_stop() and cg_thread_start() + * + * \param thread Thread to restart + */ +BOOL cg_thread_restart(CgThread *thread); + +/** + * Check if a thread has been started + * + * \param thread Thread to check + */ +BOOL cg_thread_isrunnable(CgThread *thread); + +/** + * Set the thread's worker function. + * + * \param thread Thread struct + * \param actionFunc Function pointer to set as the worker function + */ +void cg_thread_setaction(CgThread *thread, CG_THREAD_FUNC actionFunc); + +/** + * Set the user data pointer + * + * \param thread Thread struct + * \param data Pointer to user data + */ +void cg_thread_setuserdata(CgThread *thread, void *data); + +/** + * Get the user data pointer + * + * \param thread Thread from which to get the pointer + */ +void *cg_thread_getuserdata(CgThread *thread); + +#if defined (WINCE) +void cg_thread_sleep(CgThread *thread); +void cg_thread_exit(DWORD exitCode); +#if defined DEBUG_MEM +void cg_thread_monitor(CgThread *thread); +#endif //DEBUG_MEM +#endif //WIN32_WCE + +#define cg_thread_next(thread) (CgThread *)cg_list_next((CgList *)thread) +#define cg_thread_remove(thread) cg_list_remove((CgList *)thread) + +/**************************************** +* Function (Thread List) +****************************************/ + +/** + * Create a new thread list + * + * \return Thread list + */ +CgThreadList *cg_threadlist_new(); + +/** + * Destroy a thread list + * + * \param threadList The thread list in question + */ +void cg_threadlist_delete(CgThreadList *threadList); + +/** + * Clear the contents of a thread list + * + * \param threadList Thread list in question + */ +#define cg_threadlist_clear(threadList) cg_list_clear((CgList *)threadList, (CG_LIST_DESTRUCTORFUNC)cg_thread_delete) + +/** + * Get the size of a thread list + * + * \param threadList The thread list in question + */ +#define cg_threadlist_size(threadList) cg_list_size((CgList *)threadList) + +/** + * Get the first actual item from a thread list to use as an iterator + * + * \param threadList The thread list in question + */ +#define cg_threadlist_gets(threadList) (CgThread *)cg_list_next((CgList *)threadList) + +/** + * Add a thread into a thread list + * + * \param threadList The thread list in question + * \param thread The thread to add to the list + */ +#define cg_threadlist_add(threadList, thread) cg_list_add((CgList *)threadList, (CgList *)thread) + +/** + * Remove a thread from thread list + * + * \param threadList The thread list in question + * \param thread The thread to be removed + */ +#define cg_threadlist_remove(thread) cg_list_remove((CgList *)thread) + +/** + + * Start all threads in the thread list + * + * \param threadList The thread list in question + */ +BOOL cg_threadlist_start(CgThreadList *threadList); + +/** + * Stop all threads in the thread list + * + * \param threadList The thread list in question + */ +BOOL cg_threadlist_stop(CgThreadList *threadList); + +#ifdef __cplusplus + +} /* extern "C" */ + +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/ctime.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/ctime.h new file mode 100644 index 0000000..83b928f --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/util/ctime.h @@ -0,0 +1,62 @@ +/****************************************************************** +* +* CyberUtil for C +* +* Copyright (C) Satoshi Konno 2005 +* +* File: ctime.h +* +* Revision: +* +* 02/07/05 +* - first revision +* +******************************************************************/ + +#ifndef _CG_UTIL_CTIME_H_ +#define _CG_UTIL_CTIME_H_ + +#include + +#if defined(BTRON) +#include +#include +#elif defined(ITRON) +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#if defined(BTRON) || defined(ITRON) +typedef long CgSysTime; +#else +typedef time_t CgSysTime; +#endif + +/**************************************** +* Function +****************************************/ + +float cg_random(); + +void cg_wait(CgSysTime mtime); +void cg_waitrandom(CgSysTime mtime); + +#define cg_sleep(val) cg_wait(val) +#define cg_sleeprandom(val) cg_waitrandom(val) + +CgSysTime cg_getcurrentsystemtime(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/headers/cybergarage/xml/cxml.h b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/xml/cxml.h new file mode 100644 index 0000000..02eb2ef --- /dev/null +++ b/Audio-Frameworks/bin/cyberlink/headers/cybergarage/xml/cxml.h @@ -0,0 +1,208 @@ +/****************************************************************** +* +* CyberNet for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006-2007 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: cxml.h +* +* Revision: +* +* 02/07/05 +* - first revision +* 10/22/07 Aapo Makela +* - Added NULL check to cg_xml_node_getchildnode() macro +* +******************************************************************/ + +#ifndef _CG_XML_CXML_H_ +#define _CG_XML_CXML_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************** +* Define +****************************************/ + +#define CG_XML_INDENT_STRING " " +#define CG_XML_VERSION_HEADER "" +#define CG_XML_CONTENT_TYPE "text/xml; charset=\"utf-8\"" +#define CG_XML_CONTENT_LF "\n" + +typedef void (*CG_XML_NODE_USERDATA_DESTRUCTORFUNC)(void *); + +/**************************************** +* Data Type +****************************************/ + +typedef struct _CgXmlAttribute { + BOOL headFlag; + struct _CgXmlAttribute *prev; + struct _CgXmlAttribute *next; + CgString *name; + CgString *value; +} CgXmlAttribute, CgXmlAttributeList; + +typedef struct _CgXmlNode { + BOOL headFlag; + struct _CgXmlNode *prev; + struct _CgXmlNode *next; + CgString *name; + CgString *value; + struct _CgXmlAttribute *attrList; + struct _CgXmlNode *nodeList; + struct _CgXmlNode *parentNode; + void *userData; + CG_XML_NODE_USERDATA_DESTRUCTORFUNC userDataDestructorFunc; +} CgXmlNode, CgXmlNodeList; + +typedef struct _CgXmlParser { + BOOL parseResult; +} CgXmlParser; + +/**************************************** +* Function (AttribureList) +****************************************/ + +CgXmlAttributeList *cg_xml_attributelist_new(); +void cg_xml_attributelist_delete(CgXmlAttributeList *attrList); + +#define cg_xml_attributelist_clear(attrList) cg_list_clear((CgList *)attrList, (CG_LIST_DESTRUCTORFUNC)cg_xml_attribute_delete) +#define cg_xml_attributelist_size(attrList) cg_list_size((CgList *)attrList) +#define cg_xml_attributelist_gets(attrList) (CgXmlAttribute *)cg_list_next((CgList *)attrList) +#define cg_xml_attributelist_add(attrList, attr) cg_list_add((CgList *)attrList, (CgList *)attr) + +void cg_xml_attributelist_set(CgXmlAttributeList *attrList, char *name, char *value); +CgXmlAttribute *cg_xml_attributelist_get(CgXmlAttributeList *attrList, char *name); +char *cg_xml_attributelist_getvalue(CgXmlAttributeList *attrList, char *name); + +/**************************************** +* Function (Attributes) +****************************************/ + +CgXmlAttribute *cg_xml_attribute_new(); +void cg_xml_attribute_delete(CgXmlAttribute *attr); + +#define cg_xml_attribute_next(attr) (CgXmlAttribute *)cg_list_next((CgList *)attr) +#define cg_xml_attribute_remove(attr) cg_list_remove((CgList *)attr) + +void cg_xml_attribute_setname(CgXmlAttribute *attr, char *name); +char *cg_xml_attribute_getname(CgXmlAttribute *attr); +BOOL cg_xml_attribute_isname(CgXmlAttribute *attr, char *name); + +void cg_xml_attribute_setvalue(CgXmlAttribute *attr, char *value); +char *cg_xml_attribute_getvalue(CgXmlAttribute *attr); + +/**************************************** +* Function (NodeList) +****************************************/ + +CgXmlNodeList *cg_xml_nodelist_new(); +void cg_xml_nodelist_delete(CgXmlNodeList *nodeList); + +#define cg_xml_nodelist_clear(nodeList) cg_list_clear((CgList *)(nodeList), (CG_LIST_DESTRUCTORFUNC)cg_xml_node_delete) +#define cg_xml_nodelist_size(nodeList) cg_list_size((CgList *)(nodeList)) +#define cg_xml_nodelist_gets(nodeList) (CgXmlNode *)cg_list_next((CgList *)(nodeList)) +#define cg_xml_nodelist_add(nodeList, node) cg_list_add((CgList *)(nodeList), (CgList *)(node)) + +/* Deprecated : Use cg_xml_nodelist_getbyname */ +#define cg_xml_nodelist_get(nodeList, name) cg_xml_nodelist_getbyname(nodeList, name) +CgXmlNode *cg_xml_nodelist_getbyname(CgXmlNodeList *nodeList, char *name); +CgXmlNode *cg_xml_nodelist_getbyxpath(CgXmlNodeList *nodeList, char *xpath); + +/**************************************** +* Function (Node) +****************************************/ + +CgXmlNode *cg_xml_node_new(); +void cg_xml_node_delete(CgXmlNode *node); + +#define cg_xml_node_next(node) (CgXmlNode *)cg_list_next((CgList *)node) +#define cg_xml_node_remove(node) cg_list_remove((CgList *)node) + +#define cg_xml_node_setname(node, nodename) cg_string_setvalue(node->name, nodename) +#define cg_xml_node_getname(node) cg_string_getvalue(node->name) +#define cg_xml_node_isname(node, nodename) (cg_strcmp(cg_xml_node_getname(node), nodename) == 0 ? TRUE : FALSE) + +#define cg_xml_node_setvalue(node, nodevalue) cg_string_setvalue(node->value, nodevalue) +#define cg_xml_node_setintvalue(node, nodevalue) cg_string_setintvalue(node->value, nodevalue) +#define cg_xml_node_setlongvalue(node, nodevalue) cg_string_setlongvalue(node->value, nodevalue) +#define cg_xml_node_setnvalue(node, nodevalue, nodevaluelen) cg_string_setnvalue(node->value, nodevalue, nodevaluelen) +#define cg_xml_node_addvalue(node, nodevalue) cg_string_addvalue(node->value, nodevalue) +#define cg_xml_node_naddvalue(node, nodevalue, len) cg_string_naddvalue(node->value, nodevalue, len) +#define cg_xml_node_getvalue(node) cg_string_getvalue(node->value) +#define cg_xml_node_getintvalue(node) cg_string_getintvalue(node->value) +#define cg_xml_node_getlongvalue(node) cg_string_getlongvalue(node->value) + +#define cg_xml_node_setparentnode(node, pnode) (node->parentNode = pnode) +#define cg_xml_node_getparentnode(node) (node->parentNode) +CgXmlNode *cg_xml_node_getrootnode(CgXmlNode *node); + +#define cg_xml_node_getchildnodelist(node) (node->nodeList) +void cg_xml_node_addchildnode(CgXmlNode *node, CgXmlNode *cnode); +void cg_xml_node_setchildnode(CgXmlNode *node, char *name, char *value); +char *cg_xml_node_getchildnodevalue(CgXmlNode *node, char *name); +#define cg_xml_node_getchildnodeintvalue(node, name) cg_str2int(cg_xml_node_getchildnodevalue(node, name)) +#define cg_xml_node_getchildnodelongvalue(node, name) cg_str2long(cg_xml_node_getchildnodevalue(node, name)) + +#define cg_xml_node_setuserdata(node, data) (node->userData = data) +#define cg_xml_node_getuserdata(node) (node->userData) +#define cg_xml_node_setuserdatadestructor(node, func) (node->userDataDestructorFunc = func) + +#define cg_xml_node_getchildnodes(node) cg_xml_nodelist_gets(node->nodeList) +#define cg_xml_node_haschildnodes(node) ((cg_xml_node_getchildnodes(node) != NULL) ? TRUE : FALSE) +/* Deprecated : Use cg_xml_node_getchildnodebyname */ +#define cg_xml_node_getchildnode(node,name) ((node != NULL) ? cg_xml_nodelist_getbyname(node->nodeList,name) : NULL) +#define cg_xml_node_getchildnodebyname(node,name) ((node != NULL) ? cg_xml_nodelist_getbyname(node->nodeList,name) : NULL) +#define cg_xml_node_getchildnodebyxpath(node,xpath) ((node != NULL) ? cg_xml_nodelist_getbyxpath(node->nodeList,xpath) : NULL) + +/* Get childnode with some specific namespace prefix, or ignore namespace prefix. + If ns is NULL, name string must match completely */ +CgXmlNode *cg_xml_node_getchildnodewithnamespace(CgXmlNode *node, char *name, char *ns, BOOL ignoreNs); + +#define cg_xml_node_getattributes(node) cg_xml_attributelist_gets(node->attrList) +#define cg_xml_node_getattribute(node, name) cg_xml_attributelist_get(node->attrList,name) +#define cg_xml_node_addattribute(node, attr) cg_xml_attributelist_add(node->attrList,attr) +#define cg_xml_node_setattribute(node, name, value) cg_xml_attributelist_set(node->attrList,name,value) +#define cg_xml_node_getattributevalue(node, name) cg_xml_attributelist_getvalue(node->attrList, name) +void cg_xml_node_removeattribute(CgXmlNode *node, char *name); + +#define cg_xml_node_setnamespace(node, ns, value) cg_xml_node_setattribute(node, "xmlns:" ns , value) + +char *cg_xml_node_tostring(CgXmlNode *node, BOOL withChildNode, CgString *str); +void cg_xml_node_print(CgXmlNode *node); + +void cg_xml_node_copy(CgXmlNode *dstNode, CgXmlNode *srcNode); + +/**************************************** +* Function (Parser) +****************************************/ + +CgXmlParser *cg_xml_parser_new(); +void cg_xml_parser_delete(CgXmlParser *parser); +BOOL cg_xml_parse(CgXmlParser *parser, CgXmlNodeList *nodeList, char *data, int len); + +/**************************************** +* Function (Other) +****************************************/ + +char *cg_xml_escapechars(CgString *str); +char *cg_xml_unescapechars(CgString *str); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/cyberlink/libCyberLink.a b/Audio-Frameworks/bin/cyberlink/libCyberLink.a new file mode 100644 index 0000000..db307d9 Binary files /dev/null and b/Audio-Frameworks/bin/cyberlink/libCyberLink.a differ diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/FLAC b/Audio-Frameworks/bin/flac/FLAC.framework/FLAC new file mode 120000 index 0000000..c29cdc3 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/FLAC @@ -0,0 +1 @@ +Versions/Current/FLAC \ No newline at end of file diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Headers b/Audio-Frameworks/bin/flac/FLAC.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Resources b/Audio-Frameworks/bin/flac/FLAC.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/FLAC b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/FLAC new file mode 100644 index 0000000..4f10935 Binary files /dev/null and b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/FLAC differ diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/all.h b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/all.h new file mode 100644 index 0000000..c542c0d --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/all.h @@ -0,0 +1,370 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__ALL_H +#define FLAC__ALL_H + +#include "export.h" + +#include "assert.h" +#include "callback.h" +#include "format.h" +#include "metadata.h" +#include "ordinals.h" +#include "stream_decoder.h" +#include "stream_encoder.h" + +/** \mainpage + * + * \section intro Introduction + * + * This is the documentation for the FLAC C and C++ APIs. It is + * highly interconnected; this introduction should give you a top + * level idea of the structure and how to find the information you + * need. As a prerequisite you should have at least a basic + * knowledge of the FLAC format, documented + * here. + * + * \section c_api FLAC C API + * + * The FLAC C API is the interface to libFLAC, a set of structures + * describing the components of FLAC streams, and functions for + * encoding and decoding streams, as well as manipulating FLAC + * metadata in files. The public include files will be installed + * in your include area (for example /usr/include/FLAC/...). + * + * By writing a little code and linking against libFLAC, it is + * relatively easy to add FLAC support to another program. The + * library is licensed under Xiph's BSD license. + * Complete source code of libFLAC as well as the command-line + * encoder and plugins is available and is a useful source of + * examples. + * + * Aside from encoders and decoders, libFLAC provides a powerful + * metadata interface for manipulating metadata in FLAC files. It + * allows the user to add, delete, and modify FLAC metadata blocks + * and it can automatically take advantage of PADDING blocks to avoid + * rewriting the entire FLAC file when changing the size of the + * metadata. + * + * libFLAC usually only requires the standard C library and C math + * library. In particular, threading is not used so there is no + * dependency on a thread library. However, libFLAC does not use + * global variables and should be thread-safe. + * + * libFLAC also supports encoding to and decoding from Ogg FLAC. + * However the metadata editing interfaces currently have limited + * read-only support for Ogg FLAC files. + * + * \section cpp_api FLAC C++ API + * + * The FLAC C++ API is a set of classes that encapsulate the + * structures and functions in libFLAC. They provide slightly more + * functionality with respect to metadata but are otherwise + * equivalent. For the most part, they share the same usage as + * their counterparts in libFLAC, and the FLAC C API documentation + * can be used as a supplement. The public include files + * for the C++ API will be installed in your include area (for + * example /usr/include/FLAC++/...). + * + * libFLAC++ is also licensed under + * Xiph's BSD license. + * + * \section getting_started Getting Started + * + * A good starting point for learning the API is to browse through + * the modules. Modules are logical + * groupings of related functions or classes, which correspond roughly + * to header files or sections of header files. Each module includes a + * detailed description of the general usage of its functions or + * classes. + * + * From there you can go on to look at the documentation of + * individual functions. You can see different views of the individual + * functions through the links in top bar across this page. + * + * If you prefer a more hands-on approach, you can jump right to some + * example code. + * + * \section porting_guide Porting Guide + * + * Starting with FLAC 1.1.3 a \link porting Porting Guide \endlink + * has been introduced which gives detailed instructions on how to + * port your code to newer versions of FLAC. + * + * \section embedded_developers Embedded Developers + * + * libFLAC has grown larger over time as more functionality has been + * included, but much of it may be unnecessary for a particular embedded + * implementation. Unused parts may be pruned by some simple editing of + * src/libFLAC/Makefile.am. In general, the decoders, encoders, and + * metadata interface are all independent from each other. + * + * It is easiest to just describe the dependencies: + * + * - All modules depend on the \link flac_format Format \endlink module. + * - The decoders and encoders depend on the bitbuffer. + * - The decoder is independent of the encoder. The encoder uses the + * decoder because of the verify feature, but this can be removed if + * not needed. + * - Parts of the metadata interface require the stream decoder (but not + * the encoder). + * - Ogg support is selectable through the compile time macro + * \c FLAC__HAS_OGG. + * + * For example, if your application only requires the stream decoder, no + * encoder, and no metadata interface, you can remove the stream encoder + * and the metadata interface, which will greatly reduce the size of the + * library. + * + * Also, there are several places in the libFLAC code with comments marked + * with "OPT:" where a #define can be changed to enable code that might be + * faster on a specific platform. Experimenting with these can yield faster + * binaries. + */ + +/** \defgroup porting Porting Guide for New Versions + * + * This module describes differences in the library interfaces from + * version to version. It assists in the porting of code that uses + * the libraries to newer versions of FLAC. + * + * One simple facility for making porting easier that has been added + * in FLAC 1.1.3 is a set of \c #defines in \c export.h of each + * library's includes (e.g. \c include/FLAC/export.h). The + * \c #defines mirror the libraries' + * libtool version numbers, + * e.g. in libFLAC there are \c FLAC_API_VERSION_CURRENT, + * \c FLAC_API_VERSION_REVISION, and \c FLAC_API_VERSION_AGE. + * These can be used to support multiple versions of an API during the + * transition phase, e.g. + * + * \code + * #if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7 + * legacy code + * #else + * new code + * #endif + * \endcode + * + * The the source will work for multiple versions and the legacy code can + * easily be removed when the transition is complete. + * + * Another available symbol is FLAC_API_SUPPORTS_OGG_FLAC (defined in + * include/FLAC/export.h), which can be used to determine whether or not + * the library has been compiled with support for Ogg FLAC. This is + * simpler than trying to call an Ogg init function and catching the + * error. + */ + +/** \defgroup porting_1_1_2_to_1_1_3 Porting from FLAC 1.1.2 to 1.1.3 + * \ingroup porting + * + * \brief + * This module describes porting from FLAC 1.1.2 to FLAC 1.1.3. + * + * The main change between the APIs in 1.1.2 and 1.1.3 is that they have + * been simplified. First, libOggFLAC has been merged into libFLAC and + * libOggFLAC++ has been merged into libFLAC++. Second, both the three + * decoding layers and three encoding layers have been merged into a + * single stream decoder and stream encoder. That is, the functionality + * of FLAC__SeekableStreamDecoder and FLAC__FileDecoder has been merged + * into FLAC__StreamDecoder, and FLAC__SeekableStreamEncoder and + * FLAC__FileEncoder into FLAC__StreamEncoder. Only the + * FLAC__StreamDecoder and FLAC__StreamEncoder remain. What this means + * is there is now a single API that can be used to encode or decode + * streams to/from native FLAC or Ogg FLAC and the single API can work + * on both seekable and non-seekable streams. + * + * Instead of creating an encoder or decoder of a certain layer, now the + * client will always create a FLAC__StreamEncoder or + * FLAC__StreamDecoder. The old layers are now differentiated by the + * initialization function. For example, for the decoder, + * FLAC__stream_decoder_init() has been replaced by + * FLAC__stream_decoder_init_stream(). This init function takes + * callbacks for the I/O, and the seeking callbacks are optional. This + * allows the client to use the same object for seekable and + * non-seekable streams. For decoding a FLAC file directly, the client + * can use FLAC__stream_decoder_init_file() and pass just a filename + * and fewer callbacks; most of the other callbacks are supplied + * internally. For situations where fopen()ing by filename is not + * possible (e.g. Unicode filenames on Windows) the client can instead + * open the file itself and supply the FILE* to + * FLAC__stream_decoder_init_FILE(). The init functions now returns a + * FLAC__StreamDecoderInitStatus instead of FLAC__StreamDecoderState. + * Since the callbacks and client data are now passed to the init + * function, the FLAC__stream_decoder_set_*_callback() functions and + * FLAC__stream_decoder_set_client_data() are no longer needed. The + * rest of the calls to the decoder are the same as before. + * + * There are counterpart init functions for Ogg FLAC, e.g. + * FLAC__stream_decoder_init_ogg_stream(). All the rest of the calls + * and callbacks are the same as for native FLAC. + * + * As an example, in FLAC 1.1.2 a seekable stream decoder would have + * been set up like so: + * + * \code + * FLAC__SeekableStreamDecoder *decoder = FLAC__seekable_stream_decoder_new(); + * if(decoder == NULL) do_something; + * FLAC__seekable_stream_decoder_set_md5_checking(decoder, true); + * [... other settings ...] + * FLAC__seekable_stream_decoder_set_read_callback(decoder, my_read_callback); + * FLAC__seekable_stream_decoder_set_seek_callback(decoder, my_seek_callback); + * FLAC__seekable_stream_decoder_set_tell_callback(decoder, my_tell_callback); + * FLAC__seekable_stream_decoder_set_length_callback(decoder, my_length_callback); + * FLAC__seekable_stream_decoder_set_eof_callback(decoder, my_eof_callback); + * FLAC__seekable_stream_decoder_set_write_callback(decoder, my_write_callback); + * FLAC__seekable_stream_decoder_set_metadata_callback(decoder, my_metadata_callback); + * FLAC__seekable_stream_decoder_set_error_callback(decoder, my_error_callback); + * FLAC__seekable_stream_decoder_set_client_data(decoder, my_client_data); + * if(FLAC__seekable_stream_decoder_init(decoder) != FLAC__SEEKABLE_STREAM_DECODER_OK) do_something; + * \endcode + * + * In FLAC 1.1.3 it is like this: + * + * \code + * FLAC__StreamDecoder *decoder = FLAC__stream_decoder_new(); + * if(decoder == NULL) do_something; + * FLAC__stream_decoder_set_md5_checking(decoder, true); + * [... other settings ...] + * if(FLAC__stream_decoder_init_stream( + * decoder, + * my_read_callback, + * my_seek_callback, // or NULL + * my_tell_callback, // or NULL + * my_length_callback, // or NULL + * my_eof_callback, // or NULL + * my_write_callback, + * my_metadata_callback, // or NULL + * my_error_callback, + * my_client_data + * ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something; + * \endcode + * + * or you could do; + * + * \code + * [...] + * FILE *file = fopen("somefile.flac","rb"); + * if(file == NULL) do_somthing; + * if(FLAC__stream_decoder_init_FILE( + * decoder, + * file, + * my_write_callback, + * my_metadata_callback, // or NULL + * my_error_callback, + * my_client_data + * ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something; + * \endcode + * + * or just: + * + * \code + * [...] + * if(FLAC__stream_decoder_init_file( + * decoder, + * "somefile.flac", + * my_write_callback, + * my_metadata_callback, // or NULL + * my_error_callback, + * my_client_data + * ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something; + * \endcode + * + * Another small change to the decoder is in how it handles unparseable + * streams. Before, when the decoder found an unparseable stream + * (reserved for when the decoder encounters a stream from a future + * encoder that it can't parse), it changed the state to + * \c FLAC__STREAM_DECODER_UNPARSEABLE_STREAM. Now the decoder instead + * drops sync and calls the error callback with a new error code + * \c FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM. This is + * more robust. If your error callback does not discriminate on the the + * error state, your code does not need to be changed. + * + * The encoder now has a new setting: + * FLAC__stream_encoder_set_apodization(). This is for setting the + * method used to window the data before LPC analysis. You only need to + * add a call to this function if the default is not suitable. There + * are also two new convenience functions that may be useful: + * FLAC__metadata_object_cuesheet_calculate_cddb_id() and + * FLAC__metadata_get_cuesheet(). + * + * The \a bytes parameter to FLAC__StreamDecoderReadCallback, + * FLAC__StreamEncoderReadCallback, and FLAC__StreamEncoderWriteCallback + * is now \c size_t instead of \c unsigned. + */ + +/** \defgroup porting_1_1_3_to_1_1_4 Porting from FLAC 1.1.3 to 1.1.4 + * \ingroup porting + * + * \brief + * This module describes porting from FLAC 1.1.3 to FLAC 1.1.4. + * + * There were no changes to any of the interfaces from 1.1.3 to 1.1.4. + * There was a slight change in the implementation of + * FLAC__stream_encoder_set_metadata(); the function now makes a copy + * of the \a metadata array of pointers so the client no longer needs + * to maintain it after the call. The objects themselves that are + * pointed to by the array are still not copied though and must be + * maintained until the call to FLAC__stream_encoder_finish(). + */ + +/** \defgroup porting_1_1_4_to_1_2_0 Porting from FLAC 1.1.4 to 1.2.0 + * \ingroup porting + * + * \brief + * This module describes porting from FLAC 1.1.4 to FLAC 1.2.0. + * + * There were only very minor changes to the interfaces from 1.1.4 to 1.2.0. + * In libFLAC, \c FLAC__format_sample_rate_is_subset() was added. + * In libFLAC++, \c FLAC::Decoder::Stream::get_decode_position() was added. + * + * Finally, value of the constant \c FLAC__FRAME_HEADER_RESERVED_LEN + * has changed to reflect the conversion of one of the reserved bits + * into active use. It used to be \c 2 and now is \c 1. However the + * FLAC frame header length has not changed, so to skip the proper + * number of bits, use \c FLAC__FRAME_HEADER_RESERVED_LEN + + * \c FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN + */ + +/** \defgroup flac FLAC C API + * + * The FLAC C API is the interface to libFLAC, a set of structures + * describing the components of FLAC streams, and functions for + * encoding and decoding streams, as well as manipulating FLAC + * metadata in files. + * + * You should start with the format components as all other modules + * are dependent on it. + */ + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/assert.h b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/assert.h new file mode 100644 index 0000000..3fc03f3 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/assert.h @@ -0,0 +1,45 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__ASSERT_H +#define FLAC__ASSERT_H + +/* we need this since some compilers (like MSVC) leave assert()s on release code (and we don't want to use their ASSERT) */ +#ifdef DEBUG +#include +#define FLAC__ASSERT(x) assert(x) +#define FLAC__ASSERT_DECLARATION(x) x +#else +#define FLAC__ASSERT(x) +#define FLAC__ASSERT_DECLARATION(x) +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/callback.h b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/callback.h new file mode 100644 index 0000000..c954121 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/callback.h @@ -0,0 +1,184 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__CALLBACK_H +#define FLAC__CALLBACK_H + +#include "ordinals.h" +#include /* for size_t */ + +/** \file include/FLAC/callback.h + * + * \brief + * This module defines the structures for describing I/O callbacks + * to the other FLAC interfaces. + * + * See the detailed documentation for callbacks in the + * \link flac_callbacks callbacks \endlink module. + */ + +/** \defgroup flac_callbacks FLAC/callback.h: I/O callback structures + * \ingroup flac + * + * \brief + * This module defines the structures for describing I/O callbacks + * to the other FLAC interfaces. + * + * The purpose of the I/O callback functions is to create a common way + * for the metadata interfaces to handle I/O. + * + * Originally the metadata interfaces required filenames as the way of + * specifying FLAC files to operate on. This is problematic in some + * environments so there is an additional option to specify a set of + * callbacks for doing I/O on the FLAC file, instead of the filename. + * + * In addition to the callbacks, a FLAC__IOHandle type is defined as an + * opaque structure for a data source. + * + * The callback function prototypes are similar (but not identical) to the + * stdio functions fread, fwrite, fseek, ftell, feof, and fclose. If you use + * stdio streams to implement the callbacks, you can pass fread, fwrite, and + * fclose anywhere a FLAC__IOCallback_Read, FLAC__IOCallback_Write, or + * FLAC__IOCallback_Close is required, and a FILE* anywhere a FLAC__IOHandle + * is required. \warning You generally CANNOT directly use fseek or ftell + * for FLAC__IOCallback_Seek or FLAC__IOCallback_Tell since on most systems + * these use 32-bit offsets and FLAC requires 64-bit offsets to deal with + * large files. You will have to find an equivalent function (e.g. ftello), + * or write a wrapper. The same is true for feof() since this is usually + * implemented as a macro, not as a function whose address can be taken. + * + * \{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the opaque handle type used by the callbacks. Typically + * this is a \c FILE* or address of a file descriptor. + */ +typedef void* FLAC__IOHandle; + +/** Signature for the read callback. + * The signature and semantics match POSIX fread() implementations + * and can generally be used interchangeably. + * + * \param ptr The address of the read buffer. + * \param size The size of the records to be read. + * \param nmemb The number of records to be read. + * \param handle The handle to the data source. + * \retval size_t + * The number of records read. + */ +typedef size_t (*FLAC__IOCallback_Read) (void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle); + +/** Signature for the write callback. + * The signature and semantics match POSIX fwrite() implementations + * and can generally be used interchangeably. + * + * \param ptr The address of the write buffer. + * \param size The size of the records to be written. + * \param nmemb The number of records to be written. + * \param handle The handle to the data source. + * \retval size_t + * The number of records written. + */ +typedef size_t (*FLAC__IOCallback_Write) (const void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle); + +/** Signature for the seek callback. + * The signature and semantics mostly match POSIX fseek() WITH ONE IMPORTANT + * EXCEPTION: the offset is a 64-bit type whereas fseek() is generally 'long' + * and 32-bits wide. + * + * \param handle The handle to the data source. + * \param offset The new position, relative to \a whence + * \param whence \c SEEK_SET, \c SEEK_CUR, or \c SEEK_END + * \retval int + * \c 0 on success, \c -1 on error. + */ +typedef int (*FLAC__IOCallback_Seek) (FLAC__IOHandle handle, FLAC__int64 offset, int whence); + +/** Signature for the tell callback. + * The signature and semantics mostly match POSIX ftell() WITH ONE IMPORTANT + * EXCEPTION: the offset is a 64-bit type whereas ftell() is generally 'long' + * and 32-bits wide. + * + * \param handle The handle to the data source. + * \retval FLAC__int64 + * The current position on success, \c -1 on error. + */ +typedef FLAC__int64 (*FLAC__IOCallback_Tell) (FLAC__IOHandle handle); + +/** Signature for the EOF callback. + * The signature and semantics mostly match POSIX feof() but WATCHOUT: + * on many systems, feof() is a macro, so in this case a wrapper function + * must be provided instead. + * + * \param handle The handle to the data source. + * \retval int + * \c 0 if not at end of file, nonzero if at end of file. + */ +typedef int (*FLAC__IOCallback_Eof) (FLAC__IOHandle handle); + +/** Signature for the close callback. + * The signature and semantics match POSIX fclose() implementations + * and can generally be used interchangeably. + * + * \param handle The handle to the data source. + * \retval int + * \c 0 on success, \c EOF on error. + */ +typedef int (*FLAC__IOCallback_Close) (FLAC__IOHandle handle); + +/** A structure for holding a set of callbacks. + * Each FLAC interface that requires a FLAC__IOCallbacks structure will + * describe which of the callbacks are required. The ones that are not + * required may be set to NULL. + * + * If the seek requirement for an interface is optional, you can signify that + * a data sorce is not seekable by setting the \a seek field to \c NULL. + */ +typedef struct { + FLAC__IOCallback_Read read; + FLAC__IOCallback_Write write; + FLAC__IOCallback_Seek seek; + FLAC__IOCallback_Tell tell; + FLAC__IOCallback_Eof eof; + FLAC__IOCallback_Close close; +} FLAC__IOCallbacks; + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/export.h b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/export.h new file mode 100644 index 0000000..a525f29 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/export.h @@ -0,0 +1,91 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__EXPORT_H +#define FLAC__EXPORT_H + +/** \file include/FLAC/export.h + * + * \brief + * This module contains #defines and symbols for exporting function + * calls, and providing version information and compiled-in features. + * + * See the \link flac_export export \endlink module. + */ + +/** \defgroup flac_export FLAC/export.h: export symbols + * \ingroup flac + * + * \brief + * This module contains #defines and symbols for exporting function + * calls, and providing version information and compiled-in features. + * + * If you are compiling with MSVC and will link to the static library + * (libFLAC.lib) you should define FLAC__NO_DLL in your project to + * make sure the symbols are exported properly. + * + * \{ + */ + +#if defined(FLAC__NO_DLL) || !defined(_MSC_VER) +#define FLAC_API + +#else + +#ifdef FLAC_API_EXPORTS +#define FLAC_API _declspec(dllexport) +#else +#define FLAC_API _declspec(dllimport) + +#endif +#endif + +/** These #defines will mirror the libtool-based library version number, see + * http://www.gnu.org/software/libtool/manual.html#Libtool-versioning + */ +#define FLAC_API_VERSION_CURRENT 10 +#define FLAC_API_VERSION_REVISION 0 /**< see above */ +#define FLAC_API_VERSION_AGE 2 /**< see above */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \c 1 if the library has been compiled with support for Ogg FLAC, else \c 0. */ +extern FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC; + +#ifdef __cplusplus +} +#endif + +/* \} */ + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/format.h b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/format.h new file mode 100644 index 0000000..77e2d01 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/format.h @@ -0,0 +1,1010 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__FORMAT_H +#define FLAC__FORMAT_H + +#include "export.h" +#include "ordinals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** \file include/FLAC/format.h + * + * \brief + * This module contains structure definitions for the representation + * of FLAC format components in memory. These are the basic + * structures used by the rest of the interfaces. + * + * See the detailed documentation in the + * \link flac_format format \endlink module. + */ + +/** \defgroup flac_format FLAC/format.h: format components + * \ingroup flac + * + * \brief + * This module contains structure definitions for the representation + * of FLAC format components in memory. These are the basic + * structures used by the rest of the interfaces. + * + * First, you should be familiar with the + * FLAC format. Many of the values here + * follow directly from the specification. As a user of libFLAC, the + * interesting parts really are the structures that describe the frame + * header and metadata blocks. + * + * The format structures here are very primitive, designed to store + * information in an efficient way. Reading information from the + * structures is easy but creating or modifying them directly is + * more complex. For the most part, as a user of a library, editing + * is not necessary; however, for metadata blocks it is, so there are + * convenience functions provided in the \link flac_metadata metadata + * module \endlink to simplify the manipulation of metadata blocks. + * + * \note + * It's not the best convention, but symbols ending in _LEN are in bits + * and _LENGTH are in bytes. _LENGTH symbols are \#defines instead of + * global variables because they are usually used when declaring byte + * arrays and some compilers require compile-time knowledge of array + * sizes when declared on the stack. + * + * \{ + */ + + +/* + Most of the values described in this file are defined by the FLAC + format specification. There is nothing to tune here. +*/ + +/** The largest legal metadata type code. */ +#define FLAC__MAX_METADATA_TYPE_CODE (126u) + +/** The minimum block size, in samples, permitted by the format. */ +#define FLAC__MIN_BLOCK_SIZE (16u) + +/** The maximum block size, in samples, permitted by the format. */ +#define FLAC__MAX_BLOCK_SIZE (65535u) + +/** The maximum block size, in samples, permitted by the FLAC subset for + * sample rates up to 48kHz. */ +#define FLAC__SUBSET_MAX_BLOCK_SIZE_48000HZ (4608u) + +/** The maximum number of channels permitted by the format. */ +#define FLAC__MAX_CHANNELS (8u) + +/** The minimum sample resolution permitted by the format. */ +#define FLAC__MIN_BITS_PER_SAMPLE (4u) + +/** The maximum sample resolution permitted by the format. */ +#define FLAC__MAX_BITS_PER_SAMPLE (32u) + +/** The maximum sample resolution permitted by libFLAC. + * + * \warning + * FLAC__MAX_BITS_PER_SAMPLE is the limit of the FLAC format. However, + * the reference encoder/decoder is currently limited to 24 bits because + * of prevalent 32-bit math, so make sure and use this value when + * appropriate. + */ +#define FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE (24u) + +/** The maximum sample rate permitted by the format. The value is + * ((2 ^ 16) - 1) * 10; see FLAC format + * as to why. + */ +#define FLAC__MAX_SAMPLE_RATE (655350u) + +/** The maximum LPC order permitted by the format. */ +#define FLAC__MAX_LPC_ORDER (32u) + +/** The maximum LPC order permitted by the FLAC subset for sample rates + * up to 48kHz. */ +#define FLAC__SUBSET_MAX_LPC_ORDER_48000HZ (12u) + +/** The minimum quantized linear predictor coefficient precision + * permitted by the format. + */ +#define FLAC__MIN_QLP_COEFF_PRECISION (5u) + +/** The maximum quantized linear predictor coefficient precision + * permitted by the format. + */ +#define FLAC__MAX_QLP_COEFF_PRECISION (15u) + +/** The maximum order of the fixed predictors permitted by the format. */ +#define FLAC__MAX_FIXED_ORDER (4u) + +/** The maximum Rice partition order permitted by the format. */ +#define FLAC__MAX_RICE_PARTITION_ORDER (15u) + +/** The maximum Rice partition order permitted by the FLAC Subset. */ +#define FLAC__SUBSET_MAX_RICE_PARTITION_ORDER (8u) + +/** The version string of the release, stamped onto the libraries and binaries. + * + * \note + * This does not correspond to the shared library version number, which + * is used to determine binary compatibility. + */ +extern FLAC_API const char *FLAC__VERSION_STRING; + +/** The vendor string inserted by the encoder into the VORBIS_COMMENT block. + * This is a NUL-terminated ASCII string; when inserted into the + * VORBIS_COMMENT the trailing null is stripped. + */ +extern FLAC_API const char *FLAC__VENDOR_STRING; + +/** The byte string representation of the beginning of a FLAC stream. */ +extern FLAC_API const FLAC__byte FLAC__STREAM_SYNC_STRING[4]; /* = "fLaC" */ + +/** The 32-bit integer big-endian representation of the beginning of + * a FLAC stream. + */ +extern FLAC_API const unsigned FLAC__STREAM_SYNC; /* = 0x664C6143 */ + +/** The length of the FLAC signature in bits. */ +extern FLAC_API const unsigned FLAC__STREAM_SYNC_LEN; /* = 32 bits */ + +/** The length of the FLAC signature in bytes. */ +#define FLAC__STREAM_SYNC_LENGTH (4u) + + +/***************************************************************************** + * + * Subframe structures + * + *****************************************************************************/ + +/*****************************************************************************/ + +/** An enumeration of the available entropy coding methods. */ +typedef enum { + FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0, + /**< Residual is coded by partitioning into contexts, each with it's own + * 4-bit Rice parameter. */ + + FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 = 1 + /**< Residual is coded by partitioning into contexts, each with it's own + * 5-bit Rice parameter. */ +} FLAC__EntropyCodingMethodType; + +/** Maps a FLAC__EntropyCodingMethodType to a C string. + * + * Using a FLAC__EntropyCodingMethodType as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__EntropyCodingMethodTypeString[]; + + +/** Contents of a Rice partitioned residual + */ +typedef struct { + + unsigned *parameters; + /**< The Rice parameters for each context. */ + + unsigned *raw_bits; + /**< Widths for escape-coded partitions. Will be non-zero for escaped + * partitions and zero for unescaped partitions. + */ + + unsigned capacity_by_order; + /**< The capacity of the \a parameters and \a raw_bits arrays + * specified as an order, i.e. the number of array elements + * allocated is 2 ^ \a capacity_by_order. + */ +} FLAC__EntropyCodingMethod_PartitionedRiceContents; + +/** Header for a Rice partitioned residual. (c.f. format specification) + */ +typedef struct { + + unsigned order; + /**< The partition order, i.e. # of contexts = 2 ^ \a order. */ + + const FLAC__EntropyCodingMethod_PartitionedRiceContents *contents; + /**< The context's Rice parameters and/or raw bits. */ + +} FLAC__EntropyCodingMethod_PartitionedRice; + +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN; /**< == 5 (bits) */ +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN; /**< == 5 (bits) */ + +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER; +/**< == (1<format specification) + */ +typedef struct { + FLAC__EntropyCodingMethodType type; + union { + FLAC__EntropyCodingMethod_PartitionedRice partitioned_rice; + } data; +} FLAC__EntropyCodingMethod; + +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_TYPE_LEN; /**< == 2 (bits) */ + +/*****************************************************************************/ + +/** An enumeration of the available subframe types. */ +typedef enum { + FLAC__SUBFRAME_TYPE_CONSTANT = 0, /**< constant signal */ + FLAC__SUBFRAME_TYPE_VERBATIM = 1, /**< uncompressed signal */ + FLAC__SUBFRAME_TYPE_FIXED = 2, /**< fixed polynomial prediction */ + FLAC__SUBFRAME_TYPE_LPC = 3 /**< linear prediction */ +} FLAC__SubframeType; + +/** Maps a FLAC__SubframeType to a C string. + * + * Using a FLAC__SubframeType as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__SubframeTypeString[]; + + +/** CONSTANT subframe. (c.f. format specification) + */ +typedef struct { + FLAC__int32 value; /**< The constant signal value. */ +} FLAC__Subframe_Constant; + + +/** VERBATIM subframe. (c.f. format specification) + */ +typedef struct { + const FLAC__int32 *data; /**< A pointer to verbatim signal. */ +} FLAC__Subframe_Verbatim; + + +/** FIXED subframe. (c.f. format specification) + */ +typedef struct { + FLAC__EntropyCodingMethod entropy_coding_method; + /**< The residual coding method. */ + + unsigned order; + /**< The polynomial order. */ + + FLAC__int32 warmup[FLAC__MAX_FIXED_ORDER]; + /**< Warmup samples to prime the predictor, length == order. */ + + const FLAC__int32 *residual; + /**< The residual signal, length == (blocksize minus order) samples. */ +} FLAC__Subframe_Fixed; + + +/** LPC subframe. (c.f. format specification) + */ +typedef struct { + FLAC__EntropyCodingMethod entropy_coding_method; + /**< The residual coding method. */ + + unsigned order; + /**< The FIR order. */ + + unsigned qlp_coeff_precision; + /**< Quantized FIR filter coefficient precision in bits. */ + + int quantization_level; + /**< The qlp coeff shift needed. */ + + FLAC__int32 qlp_coeff[FLAC__MAX_LPC_ORDER]; + /**< FIR filter coefficients. */ + + FLAC__int32 warmup[FLAC__MAX_LPC_ORDER]; + /**< Warmup samples to prime the predictor, length == order. */ + + const FLAC__int32 *residual; + /**< The residual signal, length == (blocksize minus order) samples. */ +} FLAC__Subframe_LPC; + +extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN; /**< == 5 (bits) */ + + +/** FLAC subframe structure. (c.f. format specification) + */ +typedef struct { + FLAC__SubframeType type; + union { + FLAC__Subframe_Constant constant; + FLAC__Subframe_Fixed fixed; + FLAC__Subframe_LPC lpc; + FLAC__Subframe_Verbatim verbatim; + } data; + unsigned wasted_bits; +} FLAC__Subframe; + +/** == 1 (bit) + * + * This used to be a zero-padding bit (hence the name + * FLAC__SUBFRAME_ZERO_PAD_LEN) but is now a reserved bit. It still has a + * mandatory value of \c 0 but in the future may take on the value \c 0 or \c 1 + * to mean something else. + */ +extern FLAC_API const unsigned FLAC__SUBFRAME_ZERO_PAD_LEN; +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LEN; /**< == 6 (bits) */ +extern FLAC_API const unsigned FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN; /**< == 1 (bit) */ + +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK; /**< = 0x00 */ +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK; /**< = 0x02 */ +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_FIXED_BYTE_ALIGNED_MASK; /**< = 0x10 */ +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK; /**< = 0x40 */ + +/*****************************************************************************/ + + +/***************************************************************************** + * + * Frame structures + * + *****************************************************************************/ + +/** An enumeration of the available channel assignments. */ +typedef enum { + FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT = 0, /**< independent channels */ + FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE = 1, /**< left+side stereo */ + FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE = 2, /**< right+side stereo */ + FLAC__CHANNEL_ASSIGNMENT_MID_SIDE = 3 /**< mid+side stereo */ +} FLAC__ChannelAssignment; + +/** Maps a FLAC__ChannelAssignment to a C string. + * + * Using a FLAC__ChannelAssignment as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__ChannelAssignmentString[]; + +/** An enumeration of the possible frame numbering methods. */ +typedef enum { + FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER, /**< number contains the frame number */ + FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER /**< number contains the sample number of first sample in frame */ +} FLAC__FrameNumberType; + +/** Maps a FLAC__FrameNumberType to a C string. + * + * Using a FLAC__FrameNumberType as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__FrameNumberTypeString[]; + + +/** FLAC frame header structure. (c.f. format specification) + */ +typedef struct { + unsigned blocksize; + /**< The number of samples per subframe. */ + + unsigned sample_rate; + /**< The sample rate in Hz. */ + + unsigned channels; + /**< The number of channels (== number of subframes). */ + + FLAC__ChannelAssignment channel_assignment; + /**< The channel assignment for the frame. */ + + unsigned bits_per_sample; + /**< The sample resolution. */ + + FLAC__FrameNumberType number_type; + /**< The numbering scheme used for the frame. As a convenience, the + * decoder will always convert a frame number to a sample number because + * the rules are complex. */ + + union { + FLAC__uint32 frame_number; + FLAC__uint64 sample_number; + } number; + /**< The frame number or sample number of first sample in frame; + * use the \a number_type value to determine which to use. */ + + FLAC__uint8 crc; + /**< CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0) + * of the raw frame header bytes, meaning everything before the CRC byte + * including the sync code. + */ +} FLAC__FrameHeader; + +extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC; /**< == 0x3ffe; the frame header sync code */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC_LEN; /**< == 14 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_RESERVED_LEN; /**< == 1 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN; /**< == 1 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCK_SIZE_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_SAMPLE_RATE_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN; /**< == 3 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_ZERO_PAD_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_CRC_LEN; /**< == 8 (bits) */ + + +/** FLAC frame footer structure. (c.f. format specification) + */ +typedef struct { + FLAC__uint16 crc; + /**< CRC-16 (polynomial = x^16 + x^15 + x^2 + x^0, initialized with + * 0) of the bytes before the crc, back to and including the frame header + * sync code. + */ +} FLAC__FrameFooter; + +extern FLAC_API const unsigned FLAC__FRAME_FOOTER_CRC_LEN; /**< == 16 (bits) */ + + +/** FLAC frame structure. (c.f. format specification) + */ +typedef struct { + FLAC__FrameHeader header; + FLAC__Subframe subframes[FLAC__MAX_CHANNELS]; + FLAC__FrameFooter footer; +} FLAC__Frame; + +/*****************************************************************************/ + + +/***************************************************************************** + * + * Meta-data structures + * + *****************************************************************************/ + +/** An enumeration of the available metadata block types. */ +typedef enum { + + FLAC__METADATA_TYPE_STREAMINFO = 0, + /**< STREAMINFO block */ + + FLAC__METADATA_TYPE_PADDING = 1, + /**< PADDING block */ + + FLAC__METADATA_TYPE_APPLICATION = 2, + /**< APPLICATION block */ + + FLAC__METADATA_TYPE_SEEKTABLE = 3, + /**< SEEKTABLE block */ + + FLAC__METADATA_TYPE_VORBIS_COMMENT = 4, + /**< VORBISCOMMENT block (a.k.a. FLAC tags) */ + + FLAC__METADATA_TYPE_CUESHEET = 5, + /**< CUESHEET block */ + + FLAC__METADATA_TYPE_PICTURE = 6, + /**< PICTURE block */ + + FLAC__METADATA_TYPE_UNDEFINED = 7 + /**< marker to denote beginning of undefined type range; this number will increase as new metadata types are added */ + +} FLAC__MetadataType; + +/** Maps a FLAC__MetadataType to a C string. + * + * Using a FLAC__MetadataType as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__MetadataTypeString[]; + + +/** FLAC STREAMINFO structure. (c.f. format specification) + */ +typedef struct { + unsigned min_blocksize, max_blocksize; + unsigned min_framesize, max_framesize; + unsigned sample_rate; + unsigned channels; + unsigned bits_per_sample; + FLAC__uint64 total_samples; + FLAC__byte md5sum[16]; +} FLAC__StreamMetadata_StreamInfo; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN; /**< == 16 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN; /**< == 16 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN; /**< == 24 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN; /**< == 24 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN; /**< == 20 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN; /**< == 3 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN; /**< == 5 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN; /**< == 36 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; /**< == 128 (bits) */ + +/** The total stream length of the STREAMINFO block in bytes. */ +#define FLAC__STREAM_METADATA_STREAMINFO_LENGTH (34u) + +/** FLAC PADDING structure. (c.f. format specification) + */ +typedef struct { + int dummy; + /**< Conceptually this is an empty struct since we don't store the + * padding bytes. Empty structs are not allowed by some C compilers, + * hence the dummy. + */ +} FLAC__StreamMetadata_Padding; + + +/** FLAC APPLICATION structure. (c.f. format specification) + */ +typedef struct { + FLAC__byte id[4]; + FLAC__byte *data; +} FLAC__StreamMetadata_Application; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_APPLICATION_ID_LEN; /**< == 32 (bits) */ + +/** SeekPoint structure used in SEEKTABLE blocks. (c.f. format specification) + */ +typedef struct { + FLAC__uint64 sample_number; + /**< The sample number of the target frame. */ + + FLAC__uint64 stream_offset; + /**< The offset, in bytes, of the target frame with respect to + * beginning of the first frame. */ + + unsigned frame_samples; + /**< The number of samples in the target frame. */ +} FLAC__StreamMetadata_SeekPoint; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN; /**< == 16 (bits) */ + +/** The total stream length of a seek point in bytes. */ +#define FLAC__STREAM_METADATA_SEEKPOINT_LENGTH (18u) + +/** The value used in the \a sample_number field of + * FLAC__StreamMetadataSeekPoint used to indicate a placeholder + * point (== 0xffffffffffffffff). + */ +extern FLAC_API const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; + + +/** FLAC SEEKTABLE structure. (c.f. format specification) + * + * \note From the format specification: + * - The seek points must be sorted by ascending sample number. + * - Each seek point's sample number must be the first sample of the + * target frame. + * - Each seek point's sample number must be unique within the table. + * - Existence of a SEEKTABLE block implies a correct setting of + * total_samples in the stream_info block. + * - Behavior is undefined when more than one SEEKTABLE block is + * present in a stream. + */ +typedef struct { + unsigned num_points; + FLAC__StreamMetadata_SeekPoint *points; +} FLAC__StreamMetadata_SeekTable; + + +/** Vorbis comment entry structure used in VORBIS_COMMENT blocks. (c.f. format specification) + * + * For convenience, the APIs maintain a trailing NUL character at the end of + * \a entry which is not counted toward \a length, i.e. + * \code strlen(entry) == length \endcode + */ +typedef struct { + FLAC__uint32 length; + FLAC__byte *entry; +} FLAC__StreamMetadata_VorbisComment_Entry; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN; /**< == 32 (bits) */ + + +/** FLAC VORBIS_COMMENT structure. (c.f. format specification) + */ +typedef struct { + FLAC__StreamMetadata_VorbisComment_Entry vendor_string; + FLAC__uint32 num_comments; + FLAC__StreamMetadata_VorbisComment_Entry *comments; +} FLAC__StreamMetadata_VorbisComment; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN; /**< == 32 (bits) */ + + +/** FLAC CUESHEET track index structure. (See the + * format specification for + * the full description of each field.) + */ +typedef struct { + FLAC__uint64 offset; + /**< Offset in samples, relative to the track offset, of the index + * point. + */ + + FLAC__byte number; + /**< The index point number. */ +} FLAC__StreamMetadata_CueSheet_Index; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN; /**< == 8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN; /**< == 3*8 (bits) */ + + +/** FLAC CUESHEET track structure. (See the + * format specification for + * the full description of each field.) + */ +typedef struct { + FLAC__uint64 offset; + /**< Track offset in samples, relative to the beginning of the FLAC audio stream. */ + + FLAC__byte number; + /**< The track number. */ + + char isrc[13]; + /**< Track ISRC. This is a 12-digit alphanumeric code plus a trailing \c NUL byte */ + + unsigned type:1; + /**< The track type: 0 for audio, 1 for non-audio. */ + + unsigned pre_emphasis:1; + /**< The pre-emphasis flag: 0 for no pre-emphasis, 1 for pre-emphasis. */ + + FLAC__byte num_indices; + /**< The number of track index points. */ + + FLAC__StreamMetadata_CueSheet_Index *indices; + /**< NULL if num_indices == 0, else pointer to array of index points. */ + +} FLAC__StreamMetadata_CueSheet_Track; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN; /**< == 8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN; /**< == 12*8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN; /**< == 6+13*8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN; /**< == 8 (bits) */ + + +/** FLAC CUESHEET structure. (See the + * format specification + * for the full description of each field.) + */ +typedef struct { + char media_catalog_number[129]; + /**< Media catalog number, in ASCII printable characters 0x20-0x7e. In + * general, the media catalog number may be 0 to 128 bytes long; any + * unused characters should be right-padded with NUL characters. + */ + + FLAC__uint64 lead_in; + /**< The number of lead-in samples. */ + + FLAC__bool is_cd; + /**< \c true if CUESHEET corresponds to a Compact Disc, else \c false. */ + + unsigned num_tracks; + /**< The number of tracks. */ + + FLAC__StreamMetadata_CueSheet_Track *tracks; + /**< NULL if num_tracks == 0, else pointer to array of tracks. */ + +} FLAC__StreamMetadata_CueSheet; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN; /**< == 128*8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN; /**< == 7+258*8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN; /**< == 8 (bits) */ + + +/** An enumeration of the PICTURE types (see FLAC__StreamMetadataPicture and id3 v2.4 APIC tag). */ +typedef enum { + FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER = 0, /**< Other */ + FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD = 1, /**< 32x32 pixels 'file icon' (PNG only) */ + FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON = 2, /**< Other file icon */ + FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER = 3, /**< Cover (front) */ + FLAC__STREAM_METADATA_PICTURE_TYPE_BACK_COVER = 4, /**< Cover (back) */ + FLAC__STREAM_METADATA_PICTURE_TYPE_LEAFLET_PAGE = 5, /**< Leaflet page */ + FLAC__STREAM_METADATA_PICTURE_TYPE_MEDIA = 6, /**< Media (e.g. label side of CD) */ + FLAC__STREAM_METADATA_PICTURE_TYPE_LEAD_ARTIST = 7, /**< Lead artist/lead performer/soloist */ + FLAC__STREAM_METADATA_PICTURE_TYPE_ARTIST = 8, /**< Artist/performer */ + FLAC__STREAM_METADATA_PICTURE_TYPE_CONDUCTOR = 9, /**< Conductor */ + FLAC__STREAM_METADATA_PICTURE_TYPE_BAND = 10, /**< Band/Orchestra */ + FLAC__STREAM_METADATA_PICTURE_TYPE_COMPOSER = 11, /**< Composer */ + FLAC__STREAM_METADATA_PICTURE_TYPE_LYRICIST = 12, /**< Lyricist/text writer */ + FLAC__STREAM_METADATA_PICTURE_TYPE_RECORDING_LOCATION = 13, /**< Recording Location */ + FLAC__STREAM_METADATA_PICTURE_TYPE_DURING_RECORDING = 14, /**< During recording */ + FLAC__STREAM_METADATA_PICTURE_TYPE_DURING_PERFORMANCE = 15, /**< During performance */ + FLAC__STREAM_METADATA_PICTURE_TYPE_VIDEO_SCREEN_CAPTURE = 16, /**< Movie/video screen capture */ + FLAC__STREAM_METADATA_PICTURE_TYPE_FISH = 17, /**< A bright coloured fish */ + FLAC__STREAM_METADATA_PICTURE_TYPE_ILLUSTRATION = 18, /**< Illustration */ + FLAC__STREAM_METADATA_PICTURE_TYPE_BAND_LOGOTYPE = 19, /**< Band/artist logotype */ + FLAC__STREAM_METADATA_PICTURE_TYPE_PUBLISHER_LOGOTYPE = 20, /**< Publisher/Studio logotype */ + FLAC__STREAM_METADATA_PICTURE_TYPE_UNDEFINED +} FLAC__StreamMetadata_Picture_Type; + +/** Maps a FLAC__StreamMetadata_Picture_Type to a C string. + * + * Using a FLAC__StreamMetadata_Picture_Type as the index to this array + * will give the string equivalent. The contents should not be + * modified. + */ +extern FLAC_API const char * const FLAC__StreamMetadata_Picture_TypeString[]; + +/** FLAC PICTURE structure. (See the + * format specification + * for the full description of each field.) + */ +typedef struct { + FLAC__StreamMetadata_Picture_Type type; + /**< The kind of picture stored. */ + + char *mime_type; + /**< Picture data's MIME type, in ASCII printable characters + * 0x20-0x7e, NUL terminated. For best compatibility with players, + * use picture data of MIME type \c image/jpeg or \c image/png. A + * MIME type of '-->' is also allowed, in which case the picture + * data should be a complete URL. In file storage, the MIME type is + * stored as a 32-bit length followed by the ASCII string with no NUL + * terminator, but is converted to a plain C string in this structure + * for convenience. + */ + + FLAC__byte *description; + /**< Picture's description in UTF-8, NUL terminated. In file storage, + * the description is stored as a 32-bit length followed by the UTF-8 + * string with no NUL terminator, but is converted to a plain C string + * in this structure for convenience. + */ + + FLAC__uint32 width; + /**< Picture's width in pixels. */ + + FLAC__uint32 height; + /**< Picture's height in pixels. */ + + FLAC__uint32 depth; + /**< Picture's color depth in bits-per-pixel. */ + + FLAC__uint32 colors; + /**< For indexed palettes (like GIF), picture's number of colors (the + * number of palette entries), or \c 0 for non-indexed (i.e. 2^depth). + */ + + FLAC__uint32 data_length; + /**< Length of binary picture data in bytes. */ + + FLAC__byte *data; + /**< Binary picture data. */ + +} FLAC__StreamMetadata_Picture; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_TYPE_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_COLORS_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN; /**< == 32 (bits) */ + + +/** Structure that is used when a metadata block of unknown type is loaded. + * The contents are opaque. The structure is used only internally to + * correctly handle unknown metadata. + */ +typedef struct { + FLAC__byte *data; +} FLAC__StreamMetadata_Unknown; + + +/** FLAC metadata block structure. (c.f. format specification) + */ +typedef struct { + FLAC__MetadataType type; + /**< The type of the metadata block; used determine which member of the + * \a data union to dereference. If type >= FLAC__METADATA_TYPE_UNDEFINED + * then \a data.unknown must be used. */ + + FLAC__bool is_last; + /**< \c true if this metadata block is the last, else \a false */ + + unsigned length; + /**< Length, in bytes, of the block data as it appears in the stream. */ + + union { + FLAC__StreamMetadata_StreamInfo stream_info; + FLAC__StreamMetadata_Padding padding; + FLAC__StreamMetadata_Application application; + FLAC__StreamMetadata_SeekTable seek_table; + FLAC__StreamMetadata_VorbisComment vorbis_comment; + FLAC__StreamMetadata_CueSheet cue_sheet; + FLAC__StreamMetadata_Picture picture; + FLAC__StreamMetadata_Unknown unknown; + } data; + /**< Polymorphic block data; use the \a type value to determine which + * to use. */ +} FLAC__StreamMetadata; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_IS_LAST_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_TYPE_LEN; /**< == 7 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_LENGTH_LEN; /**< == 24 (bits) */ + +/** The total stream length of a metadata block header in bytes. */ +#define FLAC__STREAM_METADATA_HEADER_LENGTH (4u) + +/*****************************************************************************/ + + +/***************************************************************************** + * + * Utility functions + * + *****************************************************************************/ + +/** Tests that a sample rate is valid for FLAC. + * + * \param sample_rate The sample rate to test for compliance. + * \retval FLAC__bool + * \c true if the given sample rate conforms to the specification, else + * \c false. + */ +FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(unsigned sample_rate); + +/** Tests that a sample rate is valid for the FLAC subset. The subset rules + * for valid sample rates are slightly more complex since the rate has to + * be expressible completely in the frame header. + * + * \param sample_rate The sample rate to test for compliance. + * \retval FLAC__bool + * \c true if the given sample rate conforms to the specification for the + * subset, else \c false. + */ +FLAC_API FLAC__bool FLAC__format_sample_rate_is_subset(unsigned sample_rate); + +/** Check a Vorbis comment entry name to see if it conforms to the Vorbis + * comment specification. + * + * Vorbis comment names must be composed only of characters from + * [0x20-0x3C,0x3E-0x7D]. + * + * \param name A NUL-terminated string to be checked. + * \assert + * \code name != NULL \endcode + * \retval FLAC__bool + * \c false if entry name is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_name_is_legal(const char *name); + +/** Check a Vorbis comment entry value to see if it conforms to the Vorbis + * comment specification. + * + * Vorbis comment values must be valid UTF-8 sequences. + * + * \param value A string to be checked. + * \param length A the length of \a value in bytes. May be + * \c (unsigned)(-1) to indicate that \a value is a plain + * UTF-8 NUL-terminated string. + * \assert + * \code value != NULL \endcode + * \retval FLAC__bool + * \c false if entry name is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_value_is_legal(const FLAC__byte *value, unsigned length); + +/** Check a Vorbis comment entry to see if it conforms to the Vorbis + * comment specification. + * + * Vorbis comment entries must be of the form 'name=value', and 'name' and + * 'value' must be legal according to + * FLAC__format_vorbiscomment_entry_name_is_legal() and + * FLAC__format_vorbiscomment_entry_value_is_legal() respectively. + * + * \param entry An entry to be checked. + * \param length The length of \a entry in bytes. + * \assert + * \code value != NULL \endcode + * \retval FLAC__bool + * \c false if entry name is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_is_legal(const FLAC__byte *entry, unsigned length); + +/** Check a seek table to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * seek table. + * + * \param seek_table A pointer to a seek table to be checked. + * \assert + * \code seek_table != NULL \endcode + * \retval FLAC__bool + * \c false if seek table is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_seektable_is_legal(const FLAC__StreamMetadata_SeekTable *seek_table); + +/** Sort a seek table's seek points according to the format specification. + * This includes a "unique-ification" step to remove duplicates, i.e. + * seek points with identical \a sample_number values. Duplicate seek + * points are converted into placeholder points and sorted to the end of + * the table. + * + * \param seek_table A pointer to a seek table to be sorted. + * \assert + * \code seek_table != NULL \endcode + * \retval unsigned + * The number of duplicate seek points converted into placeholders. + */ +FLAC_API unsigned FLAC__format_seektable_sort(FLAC__StreamMetadata_SeekTable *seek_table); + +/** Check a cue sheet to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * cue sheet. + * + * \param cue_sheet A pointer to an existing cue sheet to be checked. + * \param check_cd_da_subset If \c true, check CUESHEET against more + * stringent requirements for a CD-DA (audio) disc. + * \param violation Address of a pointer to a string. If there is a + * violation, a pointer to a string explanation of the + * violation will be returned here. \a violation may be + * \c NULL if you don't need the returned string. Do not + * free the returned string; it will always point to static + * data. + * \assert + * \code cue_sheet != NULL \endcode + * \retval FLAC__bool + * \c false if cue sheet is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_cuesheet_is_legal(const FLAC__StreamMetadata_CueSheet *cue_sheet, FLAC__bool check_cd_da_subset, const char **violation); + +/** Check picture data to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * PICTURE block. + * + * \param picture A pointer to existing picture data to be checked. + * \param violation Address of a pointer to a string. If there is a + * violation, a pointer to a string explanation of the + * violation will be returned here. \a violation may be + * \c NULL if you don't need the returned string. Do not + * free the returned string; it will always point to static + * data. + * \assert + * \code picture != NULL \endcode + * \retval FLAC__bool + * \c false if picture data is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_picture_is_legal(const FLAC__StreamMetadata_Picture *picture, const char **violation); + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/metadata.h b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/metadata.h new file mode 100644 index 0000000..fff90b0 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/metadata.h @@ -0,0 +1,2181 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__METADATA_H +#define FLAC__METADATA_H + +#include /* for off_t */ +#include "export.h" +#include "callback.h" +#include "format.h" + +/* -------------------------------------------------------------------- + (For an example of how all these routines are used, see the source + code for the unit tests in src/test_libFLAC/metadata_*.c, or + metaflac in src/metaflac/) + ------------------------------------------------------------------*/ + +/** \file include/FLAC/metadata.h + * + * \brief + * This module provides functions for creating and manipulating FLAC + * metadata blocks in memory, and three progressively more powerful + * interfaces for traversing and editing metadata in FLAC files. + * + * See the detailed documentation for each interface in the + * \link flac_metadata metadata \endlink module. + */ + +/** \defgroup flac_metadata FLAC/metadata.h: metadata interfaces + * \ingroup flac + * + * \brief + * This module provides functions for creating and manipulating FLAC + * metadata blocks in memory, and three progressively more powerful + * interfaces for traversing and editing metadata in native FLAC files. + * Note that currently only the Chain interface (level 2) supports Ogg + * FLAC files, and it is read-only i.e. no writing back changed + * metadata to file. + * + * There are three metadata interfaces of increasing complexity: + * + * Level 0: + * Read-only access to the STREAMINFO, VORBIS_COMMENT, CUESHEET, and + * PICTURE blocks. + * + * Level 1: + * Read-write access to all metadata blocks. This level is write- + * efficient in most cases (more on this below), and uses less memory + * than level 2. + * + * Level 2: + * Read-write access to all metadata blocks. This level is write- + * efficient in all cases, but uses more memory since all metadata for + * the whole file is read into memory and manipulated before writing + * out again. + * + * What do we mean by efficient? Since FLAC metadata appears at the + * beginning of the file, when writing metadata back to a FLAC file + * it is possible to grow or shrink the metadata such that the entire + * file must be rewritten. However, if the size remains the same during + * changes or PADDING blocks are utilized, only the metadata needs to be + * overwritten, which is much faster. + * + * Efficient means the whole file is rewritten at most one time, and only + * when necessary. Level 1 is not efficient only in the case that you + * cause more than one metadata block to grow or shrink beyond what can + * be accomodated by padding. In this case you should probably use level + * 2, which allows you to edit all the metadata for a file in memory and + * write it out all at once. + * + * All levels know how to skip over and not disturb an ID3v2 tag at the + * front of the file. + * + * All levels access files via their filenames. In addition, level 2 + * has additional alternative read and write functions that take an I/O + * handle and callbacks, for situations where access by filename is not + * possible. + * + * In addition to the three interfaces, this module defines functions for + * creating and manipulating various metadata objects in memory. As we see + * from the Format module, FLAC metadata blocks in memory are very primitive + * structures for storing information in an efficient way. Reading + * information from the structures is easy but creating or modifying them + * directly is more complex. The metadata object routines here facilitate + * this by taking care of the consistency and memory management drudgery. + * + * Unless you will be using the level 1 or 2 interfaces to modify existing + * metadata however, you will not probably not need these. + * + * From a dependency standpoint, none of the encoders or decoders require + * the metadata module. This is so that embedded users can strip out the + * metadata module from libFLAC to reduce the size and complexity. + */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/** \defgroup flac_metadata_level0 FLAC/metadata.h: metadata level 0 interface + * \ingroup flac_metadata + * + * \brief + * The level 0 interface consists of individual routines to read the + * STREAMINFO, VORBIS_COMMENT, CUESHEET, and PICTURE blocks, requiring + * only a filename. + * + * They try to skip any ID3v2 tag at the head of the file. + * + * \{ + */ + +/** Read the STREAMINFO metadata block of the given FLAC file. This function + * will try to skip any ID3v2 tag at the head of the file. + * + * \param filename The path to the FLAC file to read. + * \param streaminfo A pointer to space for the STREAMINFO block. Since + * FLAC__StreamMetadata is a simple structure with no + * memory allocation involved, you pass the address of + * an existing structure. It need not be initialized. + * \assert + * \code filename != NULL \endcode + * \code streaminfo != NULL \endcode + * \retval FLAC__bool + * \c true if a valid STREAMINFO block was read from \a filename. Returns + * \c false if there was a memory allocation error, a file decoder error, + * or the file contained no STREAMINFO block. (A memory allocation error + * is possible because this function must set up a file decoder.) + */ +FLAC_API FLAC__bool FLAC__metadata_get_streaminfo(const char *filename, FLAC__StreamMetadata *streaminfo); + +/** Read the VORBIS_COMMENT metadata block of the given FLAC file. This + * function will try to skip any ID3v2 tag at the head of the file. + * + * \param filename The path to the FLAC file to read. + * \param tags The address where the returned pointer will be + * stored. The \a tags object must be deleted by + * the caller using FLAC__metadata_object_delete(). + * \assert + * \code filename != NULL \endcode + * \code tags != NULL \endcode + * \retval FLAC__bool + * \c true if a valid VORBIS_COMMENT block was read from \a filename, + * and \a *tags will be set to the address of the metadata structure. + * Returns \c false if there was a memory allocation error, a file + * decoder error, or the file contained no VORBIS_COMMENT block, and + * \a *tags will be set to \c NULL. + */ +FLAC_API FLAC__bool FLAC__metadata_get_tags(const char *filename, FLAC__StreamMetadata **tags); + +/** Read the CUESHEET metadata block of the given FLAC file. This + * function will try to skip any ID3v2 tag at the head of the file. + * + * \param filename The path to the FLAC file to read. + * \param cuesheet The address where the returned pointer will be + * stored. The \a cuesheet object must be deleted by + * the caller using FLAC__metadata_object_delete(). + * \assert + * \code filename != NULL \endcode + * \code cuesheet != NULL \endcode + * \retval FLAC__bool + * \c true if a valid CUESHEET block was read from \a filename, + * and \a *cuesheet will be set to the address of the metadata + * structure. Returns \c false if there was a memory allocation + * error, a file decoder error, or the file contained no CUESHEET + * block, and \a *cuesheet will be set to \c NULL. + */ +FLAC_API FLAC__bool FLAC__metadata_get_cuesheet(const char *filename, FLAC__StreamMetadata **cuesheet); + +/** Read a PICTURE metadata block of the given FLAC file. This + * function will try to skip any ID3v2 tag at the head of the file. + * Since there can be more than one PICTURE block in a file, this + * function takes a number of parameters that act as constraints to + * the search. The PICTURE block with the largest area matching all + * the constraints will be returned, or \a *picture will be set to + * \c NULL if there was no such block. + * + * \param filename The path to the FLAC file to read. + * \param picture The address where the returned pointer will be + * stored. The \a picture object must be deleted by + * the caller using FLAC__metadata_object_delete(). + * \param type The desired picture type. Use \c -1 to mean + * "any type". + * \param mime_type The desired MIME type, e.g. "image/jpeg". The + * string will be matched exactly. Use \c NULL to + * mean "any MIME type". + * \param description The desired description. The string will be + * matched exactly. Use \c NULL to mean "any + * description". + * \param max_width The maximum width in pixels desired. Use + * \c (unsigned)(-1) to mean "any width". + * \param max_height The maximum height in pixels desired. Use + * \c (unsigned)(-1) to mean "any height". + * \param max_depth The maximum color depth in bits-per-pixel desired. + * Use \c (unsigned)(-1) to mean "any depth". + * \param max_colors The maximum number of colors desired. Use + * \c (unsigned)(-1) to mean "any number of colors". + * \assert + * \code filename != NULL \endcode + * \code picture != NULL \endcode + * \retval FLAC__bool + * \c true if a valid PICTURE block was read from \a filename, + * and \a *picture will be set to the address of the metadata + * structure. Returns \c false if there was a memory allocation + * error, a file decoder error, or the file contained no PICTURE + * block, and \a *picture will be set to \c NULL. + */ +FLAC_API FLAC__bool FLAC__metadata_get_picture(const char *filename, FLAC__StreamMetadata **picture, FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, unsigned max_width, unsigned max_height, unsigned max_depth, unsigned max_colors); + +/* \} */ + + +/** \defgroup flac_metadata_level1 FLAC/metadata.h: metadata level 1 interface + * \ingroup flac_metadata + * + * \brief + * The level 1 interface provides read-write access to FLAC file metadata and + * operates directly on the FLAC file. + * + * The general usage of this interface is: + * + * - Create an iterator using FLAC__metadata_simple_iterator_new() + * - Attach it to a file using FLAC__metadata_simple_iterator_init() and check + * the exit code. Call FLAC__metadata_simple_iterator_is_writable() to + * see if the file is writable, or only read access is allowed. + * - Use FLAC__metadata_simple_iterator_next() and + * FLAC__metadata_simple_iterator_prev() to traverse the blocks. + * This is does not read the actual blocks themselves. + * FLAC__metadata_simple_iterator_next() is relatively fast. + * FLAC__metadata_simple_iterator_prev() is slower since it needs to search + * forward from the front of the file. + * - Use FLAC__metadata_simple_iterator_get_block_type() or + * FLAC__metadata_simple_iterator_get_block() to access the actual data at + * the current iterator position. The returned object is yours to modify + * and free. + * - Use FLAC__metadata_simple_iterator_set_block() to write a modified block + * back. You must have write permission to the original file. Make sure to + * read the whole comment to FLAC__metadata_simple_iterator_set_block() + * below. + * - Use FLAC__metadata_simple_iterator_insert_block_after() to add new blocks. + * Use the object creation functions from + * \link flac_metadata_object here \endlink to generate new objects. + * - Use FLAC__metadata_simple_iterator_delete_block() to remove the block + * currently referred to by the iterator, or replace it with padding. + * - Destroy the iterator with FLAC__metadata_simple_iterator_delete() when + * finished. + * + * \note + * The FLAC file remains open the whole time between + * FLAC__metadata_simple_iterator_init() and + * FLAC__metadata_simple_iterator_delete(), so make sure you are not altering + * the file during this time. + * + * \note + * Do not modify the \a is_last, \a length, or \a type fields of returned + * FLAC__StreamMetadata objects. These are managed automatically. + * + * \note + * If any of the modification functions + * (FLAC__metadata_simple_iterator_set_block(), + * FLAC__metadata_simple_iterator_delete_block(), + * FLAC__metadata_simple_iterator_insert_block_after(), etc.) return \c false, + * you should delete the iterator as it may no longer be valid. + * + * \{ + */ + +struct FLAC__Metadata_SimpleIterator; +/** The opaque structure definition for the level 1 iterator type. + * See the + * \link flac_metadata_level1 metadata level 1 module \endlink + * for a detailed description. + */ +typedef struct FLAC__Metadata_SimpleIterator FLAC__Metadata_SimpleIterator; + +/** Status type for FLAC__Metadata_SimpleIterator. + * + * The iterator's current status can be obtained by calling FLAC__metadata_simple_iterator_status(). + */ +typedef enum { + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK = 0, + /**< The iterator is in the normal OK state */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT, + /**< The data passed into a function violated the function's usage criteria */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE, + /**< The iterator could not open the target file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE, + /**< The iterator could not find the FLAC signature at the start of the file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE, + /**< The iterator tried to write to a file that was not writable */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_BAD_METADATA, + /**< The iterator encountered input that does not conform to the FLAC metadata specification */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR, + /**< The iterator encountered an error while reading the FLAC file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR, + /**< The iterator encountered an error while seeking in the FLAC file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR, + /**< The iterator encountered an error while writing the FLAC file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_RENAME_ERROR, + /**< The iterator encountered an error renaming the FLAC file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_UNLINK_ERROR, + /**< The iterator encountered an error removing the temporary file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR, + /**< Memory allocation failed */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_INTERNAL_ERROR + /**< The caller violated an assertion or an unexpected error occurred */ + +} FLAC__Metadata_SimpleIteratorStatus; + +/** Maps a FLAC__Metadata_SimpleIteratorStatus to a C string. + * + * Using a FLAC__Metadata_SimpleIteratorStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__Metadata_SimpleIteratorStatusString[]; + + +/** Create a new iterator instance. + * + * \retval FLAC__Metadata_SimpleIterator* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__Metadata_SimpleIterator *FLAC__metadata_simple_iterator_new(void); + +/** Free an iterator instance. Deletes the object pointed to by \a iterator. + * + * \param iterator A pointer to an existing iterator. + * \assert + * \code iterator != NULL \endcode + */ +FLAC_API void FLAC__metadata_simple_iterator_delete(FLAC__Metadata_SimpleIterator *iterator); + +/** Get the current status of the iterator. Call this after a function + * returns \c false to get the reason for the error. Also resets the status + * to FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK. + * + * \param iterator A pointer to an existing iterator. + * \assert + * \code iterator != NULL \endcode + * \retval FLAC__Metadata_SimpleIteratorStatus + * The current status of the iterator. + */ +FLAC_API FLAC__Metadata_SimpleIteratorStatus FLAC__metadata_simple_iterator_status(FLAC__Metadata_SimpleIterator *iterator); + +/** Initialize the iterator to point to the first metadata block in the + * given FLAC file. + * + * \param iterator A pointer to an existing iterator. + * \param filename The path to the FLAC file. + * \param read_only If \c true, the FLAC file will be opened + * in read-only mode; if \c false, the FLAC + * file will be opened for edit even if no + * edits are performed. + * \param preserve_file_stats If \c true, the owner and modification + * time will be preserved even if the FLAC + * file is written to. + * \assert + * \code iterator != NULL \endcode + * \code filename != NULL \endcode + * \retval FLAC__bool + * \c false if a memory allocation error occurs, the file can't be + * opened, or another error occurs, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_init(FLAC__Metadata_SimpleIterator *iterator, const char *filename, FLAC__bool read_only, FLAC__bool preserve_file_stats); + +/** Returns \c true if the FLAC file is writable. If \c false, calls to + * FLAC__metadata_simple_iterator_set_block() and + * FLAC__metadata_simple_iterator_insert_block_after() will fail. + * + * \param iterator A pointer to an existing iterator. + * \assert + * \code iterator != NULL \endcode + * \retval FLAC__bool + * See above. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_is_writable(const FLAC__Metadata_SimpleIterator *iterator); + +/** Moves the iterator forward one metadata block, returning \c false if + * already at the end. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c false if already at the last metadata block of the chain, else + * \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_next(FLAC__Metadata_SimpleIterator *iterator); + +/** Moves the iterator backward one metadata block, returning \c false if + * already at the beginning. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c false if already at the first metadata block of the chain, else + * \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_prev(FLAC__Metadata_SimpleIterator *iterator); + +/** Returns a flag telling if the current metadata block is the last. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c true if the current metadata block is the last in the file, + * else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_is_last(const FLAC__Metadata_SimpleIterator *iterator); + +/** Get the offset of the metadata block at the current position. This + * avoids reading the actual block data which can save time for large + * blocks. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval off_t + * The offset of the metadata block at the current iterator position. + * This is the byte offset relative to the beginning of the file of + * the current metadata block's header. + */ +FLAC_API off_t FLAC__metadata_simple_iterator_get_block_offset(const FLAC__Metadata_SimpleIterator *iterator); + +/** Get the type of the metadata block at the current position. This + * avoids reading the actual block data which can save time for large + * blocks. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__MetadataType + * The type of the metadata block at the current iterator position. + */ +FLAC_API FLAC__MetadataType FLAC__metadata_simple_iterator_get_block_type(const FLAC__Metadata_SimpleIterator *iterator); + +/** Get the length of the metadata block at the current position. This + * avoids reading the actual block data which can save time for large + * blocks. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval unsigned + * The length of the metadata block at the current iterator position. + * The is same length as that in the + * metadata block header, + * i.e. the length of the metadata body that follows the header. + */ +FLAC_API unsigned FLAC__metadata_simple_iterator_get_block_length(const FLAC__Metadata_SimpleIterator *iterator); + +/** Get the application ID of the \c APPLICATION block at the current + * position. This avoids reading the actual block data which can save + * time for large blocks. + * + * \param iterator A pointer to an existing initialized iterator. + * \param id A pointer to a buffer of at least \c 4 bytes where + * the ID will be stored. + * \assert + * \code iterator != NULL \endcode + * \code id != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c true if the ID was successfully read, else \c false, in which + * case you should check FLAC__metadata_simple_iterator_status() to + * find out why. If the status is + * \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT, then the + * current metadata block is not an \c APPLICATION block. Otherwise + * if the status is + * \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR or + * \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR, an I/O error + * occurred and the iterator can no longer be used. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_get_application_id(FLAC__Metadata_SimpleIterator *iterator, FLAC__byte *id); + +/** Get the metadata block at the current position. You can modify the + * block but must use FLAC__metadata_simple_iterator_set_block() to + * write it back to the FLAC file. + * + * You must call FLAC__metadata_object_delete() on the returned object + * when you are finished with it. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__StreamMetadata* + * The current metadata block, or \c NULL if there was a memory + * allocation error. + */ +FLAC_API FLAC__StreamMetadata *FLAC__metadata_simple_iterator_get_block(FLAC__Metadata_SimpleIterator *iterator); + +/** Write a block back to the FLAC file. This function tries to be + * as efficient as possible; how the block is actually written is + * shown by the following: + * + * Existing block is a STREAMINFO block and the new block is a + * STREAMINFO block: the new block is written in place. Make sure + * you know what you're doing when changing the values of a + * STREAMINFO block. + * + * Existing block is a STREAMINFO block and the new block is a + * not a STREAMINFO block: this is an error since the first block + * must be a STREAMINFO block. Returns \c false without altering the + * file. + * + * Existing block is not a STREAMINFO block and the new block is a + * STREAMINFO block: this is an error since there may be only one + * STREAMINFO block. Returns \c false without altering the file. + * + * Existing block and new block are the same length: the existing + * block will be replaced by the new block, written in place. + * + * Existing block is longer than new block: if use_padding is \c true, + * the existing block will be overwritten in place with the new + * block followed by a PADDING block, if possible, to make the total + * size the same as the existing block. Remember that a padding + * block requires at least four bytes so if the difference in size + * between the new block and existing block is less than that, the + * entire file will have to be rewritten, using the new block's + * exact size. If use_padding is \c false, the entire file will be + * rewritten, replacing the existing block by the new block. + * + * Existing block is shorter than new block: if use_padding is \c true, + * the function will try and expand the new block into the following + * PADDING block, if it exists and doing so won't shrink the PADDING + * block to less than 4 bytes. If there is no following PADDING + * block, or it will shrink to less than 4 bytes, or use_padding is + * \c false, the entire file is rewritten, replacing the existing block + * with the new block. Note that in this case any following PADDING + * block is preserved as is. + * + * After writing the block, the iterator will remain in the same + * place, i.e. pointing to the new block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block The block to set. + * \param use_padding See above. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \code block != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_set_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding); + +/** This is similar to FLAC__metadata_simple_iterator_set_block() + * except that instead of writing over an existing block, it appends + * a block after the existing block. \a use_padding is again used to + * tell the function to try an expand into following padding in an + * attempt to avoid rewriting the entire file. + * + * This function will fail and return \c false if given a STREAMINFO + * block. + * + * After writing the block, the iterator will be pointing to the + * new block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block The block to set. + * \param use_padding See above. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \code block != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_insert_block_after(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding); + +/** Deletes the block at the current position. This will cause the + * entire FLAC file to be rewritten, unless \a use_padding is \c true, + * in which case the block will be replaced by an equal-sized PADDING + * block. The iterator will be left pointing to the block before the + * one just deleted. + * + * You may not delete the STREAMINFO block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param use_padding See above. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c true if successful, else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_delete_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__bool use_padding); + +/* \} */ + + +/** \defgroup flac_metadata_level2 FLAC/metadata.h: metadata level 2 interface + * \ingroup flac_metadata + * + * \brief + * The level 2 interface provides read-write access to FLAC file metadata; + * all metadata is read into memory, operated on in memory, and then written + * to file, which is more efficient than level 1 when editing multiple blocks. + * + * Currently Ogg FLAC is supported for read only, via + * FLAC__metadata_chain_read_ogg() but a subsequent + * FLAC__metadata_chain_write() will fail. + * + * The general usage of this interface is: + * + * - Create a new chain using FLAC__metadata_chain_new(). A chain is a + * linked list of FLAC metadata blocks. + * - Read all metadata into the the chain from a FLAC file using + * FLAC__metadata_chain_read() or FLAC__metadata_chain_read_ogg() and + * check the status. + * - Optionally, consolidate the padding using + * FLAC__metadata_chain_merge_padding() or + * FLAC__metadata_chain_sort_padding(). + * - Create a new iterator using FLAC__metadata_iterator_new() + * - Initialize the iterator to point to the first element in the chain + * using FLAC__metadata_iterator_init() + * - Traverse the chain using FLAC__metadata_iterator_next and + * FLAC__metadata_iterator_prev(). + * - Get a block for reading or modification using + * FLAC__metadata_iterator_get_block(). The pointer to the object + * inside the chain is returned, so the block is yours to modify. + * Changes will be reflected in the FLAC file when you write the + * chain. You can also add and delete blocks (see functions below). + * - When done, write out the chain using FLAC__metadata_chain_write(). + * Make sure to read the whole comment to the function below. + * - Delete the chain using FLAC__metadata_chain_delete(). + * + * \note + * Even though the FLAC file is not open while the chain is being + * manipulated, you must not alter the file externally during + * this time. The chain assumes the FLAC file will not change + * between the time of FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg() + * and FLAC__metadata_chain_write(). + * + * \note + * Do not modify the is_last, length, or type fields of returned + * FLAC__StreamMetadata objects. These are managed automatically. + * + * \note + * The metadata objects returned by FLAC__metadata_iterator_get_block() + * are owned by the chain; do not FLAC__metadata_object_delete() them. + * In the same way, blocks passed to FLAC__metadata_iterator_set_block() + * become owned by the chain and they will be deleted when the chain is + * deleted. + * + * \{ + */ + +struct FLAC__Metadata_Chain; +/** The opaque structure definition for the level 2 chain type. + */ +typedef struct FLAC__Metadata_Chain FLAC__Metadata_Chain; + +struct FLAC__Metadata_Iterator; +/** The opaque structure definition for the level 2 iterator type. + */ +typedef struct FLAC__Metadata_Iterator FLAC__Metadata_Iterator; + +typedef enum { + FLAC__METADATA_CHAIN_STATUS_OK = 0, + /**< The chain is in the normal OK state */ + + FLAC__METADATA_CHAIN_STATUS_ILLEGAL_INPUT, + /**< The data passed into a function violated the function's usage criteria */ + + FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE, + /**< The chain could not open the target file */ + + FLAC__METADATA_CHAIN_STATUS_NOT_A_FLAC_FILE, + /**< The chain could not find the FLAC signature at the start of the file */ + + FLAC__METADATA_CHAIN_STATUS_NOT_WRITABLE, + /**< The chain tried to write to a file that was not writable */ + + FLAC__METADATA_CHAIN_STATUS_BAD_METADATA, + /**< The chain encountered input that does not conform to the FLAC metadata specification */ + + FLAC__METADATA_CHAIN_STATUS_READ_ERROR, + /**< The chain encountered an error while reading the FLAC file */ + + FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR, + /**< The chain encountered an error while seeking in the FLAC file */ + + FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR, + /**< The chain encountered an error while writing the FLAC file */ + + FLAC__METADATA_CHAIN_STATUS_RENAME_ERROR, + /**< The chain encountered an error renaming the FLAC file */ + + FLAC__METADATA_CHAIN_STATUS_UNLINK_ERROR, + /**< The chain encountered an error removing the temporary file */ + + FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR, + /**< Memory allocation failed */ + + FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR, + /**< The caller violated an assertion or an unexpected error occurred */ + + FLAC__METADATA_CHAIN_STATUS_INVALID_CALLBACKS, + /**< One or more of the required callbacks was NULL */ + + FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH, + /**< FLAC__metadata_chain_write() was called on a chain read by + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), + * or + * FLAC__metadata_chain_write_with_callbacks()/FLAC__metadata_chain_write_with_callbacks_and_tempfile() + * was called on a chain read by + * FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). + * Matching read/write methods must always be used. */ + + FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL + /**< FLAC__metadata_chain_write_with_callbacks() was called when the + * chain write requires a tempfile; use + * FLAC__metadata_chain_write_with_callbacks_and_tempfile() instead. + * Or, FLAC__metadata_chain_write_with_callbacks_and_tempfile() was + * called when the chain write does not require a tempfile; use + * FLAC__metadata_chain_write_with_callbacks() instead. + * Always check FLAC__metadata_chain_check_if_tempfile_needed() + * before writing via callbacks. */ + +} FLAC__Metadata_ChainStatus; + +/** Maps a FLAC__Metadata_ChainStatus to a C string. + * + * Using a FLAC__Metadata_ChainStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__Metadata_ChainStatusString[]; + +/*********** FLAC__Metadata_Chain ***********/ + +/** Create a new chain instance. + * + * \retval FLAC__Metadata_Chain* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__Metadata_Chain *FLAC__metadata_chain_new(void); + +/** Free a chain instance. Deletes the object pointed to by \a chain. + * + * \param chain A pointer to an existing chain. + * \assert + * \code chain != NULL \endcode + */ +FLAC_API void FLAC__metadata_chain_delete(FLAC__Metadata_Chain *chain); + +/** Get the current status of the chain. Call this after a function + * returns \c false to get the reason for the error. Also resets the + * status to FLAC__METADATA_CHAIN_STATUS_OK. + * + * \param chain A pointer to an existing chain. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__Metadata_ChainStatus + * The current status of the chain. + */ +FLAC_API FLAC__Metadata_ChainStatus FLAC__metadata_chain_status(FLAC__Metadata_Chain *chain); + +/** Read all metadata from a FLAC file into the chain. + * + * \param chain A pointer to an existing chain. + * \param filename The path to the FLAC file to read. + * \assert + * \code chain != NULL \endcode + * \code filename != NULL \endcode + * \retval FLAC__bool + * \c true if a valid list of metadata blocks was read from + * \a filename, else \c false. On failure, check the status with + * FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_read(FLAC__Metadata_Chain *chain, const char *filename); + +/** Read all metadata from an Ogg FLAC file into the chain. + * + * \note Ogg FLAC metadata data writing is not supported yet and + * FLAC__metadata_chain_write() will fail. + * + * \param chain A pointer to an existing chain. + * \param filename The path to the Ogg FLAC file to read. + * \assert + * \code chain != NULL \endcode + * \code filename != NULL \endcode + * \retval FLAC__bool + * \c true if a valid list of metadata blocks was read from + * \a filename, else \c false. On failure, check the status with + * FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg(FLAC__Metadata_Chain *chain, const char *filename); + +/** Read all metadata from a FLAC stream into the chain via I/O callbacks. + * + * The \a handle need only be open for reading, but must be seekable. + * The equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" + * for Windows). + * + * \param chain A pointer to an existing chain. + * \param handle The I/O handle of the FLAC stream to read. The + * handle will NOT be closed after the metadata is read; + * that is the duty of the caller. + * \param callbacks + * A set of callbacks to use for I/O. The mandatory + * callbacks are \a read, \a seek, and \a tell. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if a valid list of metadata blocks was read from + * \a handle, else \c false. On failure, check the status with + * FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_read_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks); + +/** Read all metadata from an Ogg FLAC stream into the chain via I/O callbacks. + * + * The \a handle need only be open for reading, but must be seekable. + * The equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" + * for Windows). + * + * \note Ogg FLAC metadata data writing is not supported yet and + * FLAC__metadata_chain_write() will fail. + * + * \param chain A pointer to an existing chain. + * \param handle The I/O handle of the Ogg FLAC stream to read. The + * handle will NOT be closed after the metadata is read; + * that is the duty of the caller. + * \param callbacks + * A set of callbacks to use for I/O. The mandatory + * callbacks are \a read, \a seek, and \a tell. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if a valid list of metadata blocks was read from + * \a handle, else \c false. On failure, check the status with + * FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks); + +/** Checks if writing the given chain would require the use of a + * temporary file, or if it could be written in place. + * + * Under certain conditions, padding can be utilized so that writing + * edited metadata back to the FLAC file does not require rewriting the + * entire file. If rewriting is required, then a temporary workfile is + * required. When writing metadata using callbacks, you must check + * this function to know whether to call + * FLAC__metadata_chain_write_with_callbacks() or + * FLAC__metadata_chain_write_with_callbacks_and_tempfile(). When + * writing with FLAC__metadata_chain_write(), the temporary file is + * handled internally. + * + * \param chain A pointer to an existing chain. + * \param use_padding + * Whether or not padding will be allowed to be used + * during the write. The value of \a use_padding given + * here must match the value later passed to + * FLAC__metadata_chain_write_with_callbacks() or + * FLAC__metadata_chain_write_with_callbacks_with_tempfile(). + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if writing the current chain would require a tempfile, or + * \c false if metadata can be written in place. + */ +FLAC_API FLAC__bool FLAC__metadata_chain_check_if_tempfile_needed(FLAC__Metadata_Chain *chain, FLAC__bool use_padding); + +/** Write all metadata out to the FLAC file. This function tries to be as + * efficient as possible; how the metadata is actually written is shown by + * the following: + * + * If the current chain is the same size as the existing metadata, the new + * data is written in place. + * + * If the current chain is longer than the existing metadata, and + * \a use_padding is \c true, and the last block is a PADDING block of + * sufficient length, the function will truncate the final padding block + * so that the overall size of the metadata is the same as the existing + * metadata, and then just rewrite the metadata. Otherwise, if not all of + * the above conditions are met, the entire FLAC file must be rewritten. + * If you want to use padding this way it is a good idea to call + * FLAC__metadata_chain_sort_padding() first so that you have the maximum + * amount of padding to work with, unless you need to preserve ordering + * of the PADDING blocks for some reason. + * + * If the current chain is shorter than the existing metadata, and + * \a use_padding is \c true, and the final block is a PADDING block, the padding + * is extended to make the overall size the same as the existing data. If + * \a use_padding is \c true and the last block is not a PADDING block, a new + * PADDING block is added to the end of the new data to make it the same + * size as the existing data (if possible, see the note to + * FLAC__metadata_simple_iterator_set_block() about the four byte limit) + * and the new data is written in place. If none of the above apply or + * \a use_padding is \c false, the entire FLAC file is rewritten. + * + * If \a preserve_file_stats is \c true, the owner and modification time will + * be preserved even if the FLAC file is written. + * + * For this write function to be used, the chain must have been read with + * FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(), not + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(). + * + * \param chain A pointer to an existing chain. + * \param use_padding See above. + * \param preserve_file_stats See above. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if the write succeeded, else \c false. On failure, + * check the status with FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_write(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__bool preserve_file_stats); + +/** Write all metadata out to a FLAC stream via callbacks. + * + * (See FLAC__metadata_chain_write() for the details on how padding is + * used to write metadata in place if possible.) + * + * The \a handle must be open for updating and be seekable. The + * equivalent minimum stdio fopen() file mode is \c "r+" (or \c "r+b" + * for Windows). + * + * For this write function to be used, the chain must have been read with + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), + * not FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). + * Also, FLAC__metadata_chain_check_if_tempfile_needed() must have returned + * \c false. + * + * \param chain A pointer to an existing chain. + * \param use_padding See FLAC__metadata_chain_write() + * \param handle The I/O handle of the FLAC stream to write. The + * handle will NOT be closed after the metadata is + * written; that is the duty of the caller. + * \param callbacks A set of callbacks to use for I/O. The mandatory + * callbacks are \a write and \a seek. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if the write succeeded, else \c false. On failure, + * check the status with FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_write_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks); + +/** Write all metadata out to a FLAC stream via callbacks. + * + * (See FLAC__metadata_chain_write() for the details on how padding is + * used to write metadata in place if possible.) + * + * This version of the write-with-callbacks function must be used when + * FLAC__metadata_chain_check_if_tempfile_needed() returns true. In + * this function, you must supply an I/O handle corresponding to the + * FLAC file to edit, and a temporary handle to which the new FLAC + * file will be written. It is the caller's job to move this temporary + * FLAC file on top of the original FLAC file to complete the metadata + * edit. + * + * The \a handle must be open for reading and be seekable. The + * equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" + * for Windows). + * + * The \a temp_handle must be open for writing. The + * equivalent minimum stdio fopen() file mode is \c "w" (or \c "wb" + * for Windows). It should be an empty stream, or at least positioned + * at the start-of-file (in which case it is the caller's duty to + * truncate it on return). + * + * For this write function to be used, the chain must have been read with + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), + * not FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). + * Also, FLAC__metadata_chain_check_if_tempfile_needed() must have returned + * \c true. + * + * \param chain A pointer to an existing chain. + * \param use_padding See FLAC__metadata_chain_write() + * \param handle The I/O handle of the original FLAC stream to read. + * The handle will NOT be closed after the metadata is + * written; that is the duty of the caller. + * \param callbacks A set of callbacks to use for I/O on \a handle. + * The mandatory callbacks are \a read, \a seek, and + * \a eof. + * \param temp_handle The I/O handle of the FLAC stream to write. The + * handle will NOT be closed after the metadata is + * written; that is the duty of the caller. + * \param temp_callbacks + * A set of callbacks to use for I/O on temp_handle. + * The only mandatory callback is \a write. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if the write succeeded, else \c false. On failure, + * check the status with FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_write_with_callbacks_and_tempfile(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks, FLAC__IOHandle temp_handle, FLAC__IOCallbacks temp_callbacks); + +/** Merge adjacent PADDING blocks into a single block. + * + * \note This function does not write to the FLAC file, it only + * modifies the chain. + * + * \warning Any iterator on the current chain will become invalid after this + * call. You should delete the iterator and get a new one. + * + * \param chain A pointer to an existing chain. + * \assert + * \code chain != NULL \endcode + */ +FLAC_API void FLAC__metadata_chain_merge_padding(FLAC__Metadata_Chain *chain); + +/** This function will move all PADDING blocks to the end on the metadata, + * then merge them into a single block. + * + * \note This function does not write to the FLAC file, it only + * modifies the chain. + * + * \warning Any iterator on the current chain will become invalid after this + * call. You should delete the iterator and get a new one. + * + * \param chain A pointer to an existing chain. + * \assert + * \code chain != NULL \endcode + */ +FLAC_API void FLAC__metadata_chain_sort_padding(FLAC__Metadata_Chain *chain); + + +/*********** FLAC__Metadata_Iterator ***********/ + +/** Create a new iterator instance. + * + * \retval FLAC__Metadata_Iterator* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__Metadata_Iterator *FLAC__metadata_iterator_new(void); + +/** Free an iterator instance. Deletes the object pointed to by \a iterator. + * + * \param iterator A pointer to an existing iterator. + * \assert + * \code iterator != NULL \endcode + */ +FLAC_API void FLAC__metadata_iterator_delete(FLAC__Metadata_Iterator *iterator); + +/** Initialize the iterator to point to the first metadata block in the + * given chain. + * + * \param iterator A pointer to an existing iterator. + * \param chain A pointer to an existing and initialized (read) chain. + * \assert + * \code iterator != NULL \endcode + * \code chain != NULL \endcode + */ +FLAC_API void FLAC__metadata_iterator_init(FLAC__Metadata_Iterator *iterator, FLAC__Metadata_Chain *chain); + +/** Moves the iterator forward one metadata block, returning \c false if + * already at the end. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if already at the last metadata block of the chain, else + * \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_next(FLAC__Metadata_Iterator *iterator); + +/** Moves the iterator backward one metadata block, returning \c false if + * already at the beginning. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if already at the first metadata block of the chain, else + * \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_prev(FLAC__Metadata_Iterator *iterator); + +/** Get the type of the metadata block at the current position. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__MetadataType + * The type of the metadata block at the current iterator position. + */ +FLAC_API FLAC__MetadataType FLAC__metadata_iterator_get_block_type(const FLAC__Metadata_Iterator *iterator); + +/** Get the metadata block at the current position. You can modify + * the block in place but must write the chain before the changes + * are reflected to the FLAC file. You do not need to call + * FLAC__metadata_iterator_set_block() to reflect the changes; + * the pointer returned by FLAC__metadata_iterator_get_block() + * points directly into the chain. + * + * \warning + * Do not call FLAC__metadata_object_delete() on the returned object; + * to delete a block use FLAC__metadata_iterator_delete_block(). + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__StreamMetadata* + * The current metadata block. + */ +FLAC_API FLAC__StreamMetadata *FLAC__metadata_iterator_get_block(FLAC__Metadata_Iterator *iterator); + +/** Set the metadata block at the current position, replacing the existing + * block. The new block passed in becomes owned by the chain and it will be + * deleted when the chain is deleted. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block A pointer to a metadata block. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \code block != NULL \endcode + * \retval FLAC__bool + * \c false if the conditions in the above description are not met, or + * a memory allocation error occurs, otherwise \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_set_block(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block); + +/** Removes the current block from the chain. If \a replace_with_padding is + * \c true, the block will instead be replaced with a padding block of equal + * size. You can not delete the STREAMINFO block. The iterator will be + * left pointing to the block before the one just "deleted", even if + * \a replace_with_padding is \c true. + * + * \param iterator A pointer to an existing initialized iterator. + * \param replace_with_padding See above. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if the conditions in the above description are not met, + * otherwise \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_delete_block(FLAC__Metadata_Iterator *iterator, FLAC__bool replace_with_padding); + +/** Insert a new block before the current block. You cannot insert a block + * before the first STREAMINFO block. You cannot insert a STREAMINFO block + * as there can be only one, the one that already exists at the head when you + * read in a chain. The chain takes ownership of the new block and it will be + * deleted when the chain is deleted. The iterator will be left pointing to + * the new block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block A pointer to a metadata block to insert. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if the conditions in the above description are not met, or + * a memory allocation error occurs, otherwise \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_insert_block_before(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block); + +/** Insert a new block after the current block. You cannot insert a STREAMINFO + * block as there can be only one, the one that already exists at the head when + * you read in a chain. The chain takes ownership of the new block and it will + * be deleted when the chain is deleted. The iterator will be left pointing to + * the new block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block A pointer to a metadata block to insert. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if the conditions in the above description are not met, or + * a memory allocation error occurs, otherwise \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_insert_block_after(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block); + +/* \} */ + + +/** \defgroup flac_metadata_object FLAC/metadata.h: metadata object methods + * \ingroup flac_metadata + * + * \brief + * This module contains methods for manipulating FLAC metadata objects. + * + * Since many are variable length we have to be careful about the memory + * management. We decree that all pointers to data in the object are + * owned by the object and memory-managed by the object. + * + * Use the FLAC__metadata_object_new() and FLAC__metadata_object_delete() + * functions to create all instances. When using the + * FLAC__metadata_object_set_*() functions to set pointers to data, set + * \a copy to \c true to have the function make it's own copy of the data, or + * to \c false to give the object ownership of your data. In the latter case + * your pointer must be freeable by free() and will be free()d when the object + * is FLAC__metadata_object_delete()d. It is legal to pass a null pointer as + * the data pointer to a FLAC__metadata_object_set_*() function as long as + * the length argument is 0 and the \a copy argument is \c false. + * + * The FLAC__metadata_object_new() and FLAC__metadata_object_clone() function + * will return \c NULL in the case of a memory allocation error, otherwise a new + * object. The FLAC__metadata_object_set_*() functions return \c false in the + * case of a memory allocation error. + * + * We don't have the convenience of C++ here, so note that the library relies + * on you to keep the types straight. In other words, if you pass, for + * example, a FLAC__StreamMetadata* that represents a STREAMINFO block to + * FLAC__metadata_object_application_set_data(), you will get an assertion + * failure. + * + * For convenience the FLAC__metadata_object_vorbiscomment_*() functions + * maintain a trailing NUL on each Vorbis comment entry. This is not counted + * toward the length or stored in the stream, but it can make working with plain + * comments (those that don't contain embedded-NULs in the value) easier. + * Entries passed into these functions have trailing NULs added if missing, and + * returned entries are guaranteed to have a trailing NUL. + * + * The FLAC__metadata_object_vorbiscomment_*() functions that take a Vorbis + * comment entry/name/value will first validate that it complies with the Vorbis + * comment specification and return false if it does not. + * + * There is no need to recalculate the length field on metadata blocks you + * have modified. They will be calculated automatically before they are + * written back to a file. + * + * \{ + */ + + +/** Create a new metadata object instance of the given type. + * + * The object will be "empty"; i.e. values and data pointers will be \c 0, + * with the exception of FLAC__METADATA_TYPE_VORBIS_COMMENT, which will have + * the vendor string set (but zero comments). + * + * Do not pass in a value greater than or equal to + * \a FLAC__METADATA_TYPE_UNDEFINED unless you really know what you're + * doing. + * + * \param type Type of object to create + * \retval FLAC__StreamMetadata* + * \c NULL if there was an error allocating memory or the type code is + * greater than FLAC__MAX_METADATA_TYPE_CODE, else the new instance. + */ +FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type); + +/** Create a copy of an existing metadata object. + * + * The copy is a "deep" copy, i.e. dynamically allocated data within the + * object is also copied. The caller takes ownership of the new block and + * is responsible for freeing it with FLAC__metadata_object_delete(). + * + * \param object Pointer to object to copy. + * \assert + * \code object != NULL \endcode + * \retval FLAC__StreamMetadata* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_clone(const FLAC__StreamMetadata *object); + +/** Free a metadata object. Deletes the object pointed to by \a object. + * + * The delete is a "deep" delete, i.e. dynamically allocated data within the + * object is also deleted. + * + * \param object A pointer to an existing object. + * \assert + * \code object != NULL \endcode + */ +FLAC_API void FLAC__metadata_object_delete(FLAC__StreamMetadata *object); + +/** Compares two metadata objects. + * + * The compare is "deep", i.e. dynamically allocated data within the + * object is also compared. + * + * \param block1 A pointer to an existing object. + * \param block2 A pointer to an existing object. + * \assert + * \code block1 != NULL \endcode + * \code block2 != NULL \endcode + * \retval FLAC__bool + * \c true if objects are identical, else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_object_is_equal(const FLAC__StreamMetadata *block1, const FLAC__StreamMetadata *block2); + +/** Sets the application data of an APPLICATION block. + * + * If \a copy is \c true, a copy of the data is stored; otherwise, the object + * takes ownership of the pointer. The existing data will be freed if this + * function is successful, otherwise the original data will remain if \a copy + * is \c true and malloc() fails. + * + * \note It is safe to pass a const pointer to \a data if \a copy is \c true. + * + * \param object A pointer to an existing APPLICATION object. + * \param data A pointer to the data to set. + * \param length The length of \a data in bytes. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_APPLICATION \endcode + * \code (data != NULL && length > 0) || + * (data == NULL && length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_application_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, unsigned length, FLAC__bool copy); + +/** Resize the seekpoint array. + * + * If the size shrinks, elements will truncated; if it grows, new placeholder + * points will be added to the end. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param new_num_points The desired length of the array; may be \c 0. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code (object->data.seek_table.points == NULL && object->data.seek_table.num_points == 0) || + * (object->data.seek_table.points != NULL && object->data.seek_table.num_points > 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_resize_points(FLAC__StreamMetadata *object, unsigned new_num_points); + +/** Set a seekpoint in a seektable. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param point_num Index into seekpoint array to set. + * \param point The point to set. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code object->data.seek_table.num_points > point_num \endcode + */ +FLAC_API void FLAC__metadata_object_seektable_set_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point); + +/** Insert a seekpoint into a seektable. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param point_num Index into seekpoint array to set. + * \param point The point to set. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code object->data.seek_table.num_points >= point_num \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_insert_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point); + +/** Delete a seekpoint from a seektable. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param point_num Index into seekpoint array to set. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code object->data.seek_table.num_points > point_num \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_delete_point(FLAC__StreamMetadata *object, unsigned point_num); + +/** Check a seektable to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * seektable. + * + * \param object A pointer to an existing SEEKTABLE object. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if seek table is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_is_legal(const FLAC__StreamMetadata *object); + +/** Append a number of placeholder points to the end of a seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param num The number of placeholder points to append. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_placeholders(FLAC__StreamMetadata *object, unsigned num); + +/** Append a specific seek point template to the end of a seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param sample_number The sample number of the seek point template. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_point(FLAC__StreamMetadata *object, FLAC__uint64 sample_number); + +/** Append specific seek point templates to the end of a seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param sample_numbers An array of sample numbers for the seek points. + * \param num The number of seek point templates to append. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_points(FLAC__StreamMetadata *object, FLAC__uint64 sample_numbers[], unsigned num); + +/** Append a set of evenly-spaced seek point templates to the end of a + * seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param num The number of placeholder points to append. + * \param total_samples The total number of samples to be encoded; + * the seekpoints will be spaced approximately + * \a total_samples / \a num samples apart. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code total_samples > 0 \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_spaced_points(FLAC__StreamMetadata *object, unsigned num, FLAC__uint64 total_samples); + +/** Append a set of evenly-spaced seek point templates to the end of a + * seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param samples The number of samples apart to space the placeholder + * points. The first point will be at sample \c 0, the + * second at sample \a samples, then 2*\a samples, and + * so on. As long as \a samples and \a total_samples + * are greater than \c 0, there will always be at least + * one seekpoint at sample \c 0. + * \param total_samples The total number of samples to be encoded; + * the seekpoints will be spaced + * \a samples samples apart. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code samples > 0 \endcode + * \code total_samples > 0 \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_spaced_points_by_samples(FLAC__StreamMetadata *object, unsigned samples, FLAC__uint64 total_samples); + +/** Sort a seek table's seek points according to the format specification, + * removing duplicates. + * + * \param object A pointer to a seek table to be sorted. + * \param compact If \c false, behaves like FLAC__format_seektable_sort(). + * If \c true, duplicates are deleted and the seek table is + * shrunk appropriately; the number of placeholder points + * present in the seek table will be the same after the call + * as before. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_sort(FLAC__StreamMetadata *object, FLAC__bool compact); + +/** Sets the vendor string in a VORBIS_COMMENT block. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param entry The entry to set the vendor string to. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_vendor_string(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); + +/** Resize the comment array. + * + * If the size shrinks, elements will truncated; if it grows, new empty + * fields will be added to the end. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param new_num_comments The desired length of the array; may be \c 0. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code (object->data.vorbis_comment.comments == NULL && object->data.vorbis_comment.num_comments == 0) || + * (object->data.vorbis_comment.comments != NULL && object->data.vorbis_comment.num_comments > 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_resize_comments(FLAC__StreamMetadata *object, unsigned new_num_comments); + +/** Sets a comment in a VORBIS_COMMENT block. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param comment_num Index into comment array to set. + * \param entry The entry to set the comment to. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code comment_num < object->data.vorbis_comment.num_comments \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); + +/** Insert a comment in a VORBIS_COMMENT block at the given index. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param comment_num The index at which to insert the comment. The comments + * at and after \a comment_num move right one position. + * To append a comment to the end, set \a comment_num to + * \c object->data.vorbis_comment.num_comments . + * \param entry The comment to insert. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code object->data.vorbis_comment.num_comments >= comment_num \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_insert_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); + +/** Appends a comment to a VORBIS_COMMENT block. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param entry The comment to insert. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_append_comment(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); + +/** Replaces comments in a VORBIS_COMMENT block with a new one. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * Depending on the the value of \a all, either all or just the first comment + * whose field name(s) match the given entry's name will be replaced by the + * given entry. If no comments match, \a entry will simply be appended. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param entry The comment to insert. + * \param all If \c true, all comments whose field name matches + * \a entry's field name will be removed, and \a entry will + * be inserted at the position of the first matching + * comment. If \c false, only the first comment whose + * field name matches \a entry's field name will be + * replaced with \a entry. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_replace_comment(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool all, FLAC__bool copy); + +/** Delete a comment in a VORBIS_COMMENT block at the given index. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param comment_num The index of the comment to delete. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code object->data.vorbis_comment.num_comments > comment_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_delete_comment(FLAC__StreamMetadata *object, unsigned comment_num); + +/** Creates a Vorbis comment entry from NUL-terminated name and value strings. + * + * On return, the filled-in \a entry->entry pointer will point to malloc()ed + * memory and shall be owned by the caller. For convenience the entry will + * have a terminating NUL. + * + * \param entry A pointer to a Vorbis comment entry. The entry's + * \c entry pointer should not point to allocated + * memory as it will be overwritten. + * \param field_name The field name in ASCII, \c NUL terminated. + * \param field_value The field value in UTF-8, \c NUL terminated. + * \assert + * \code entry != NULL \endcode + * \code field_name != NULL \endcode + * \code field_value != NULL \endcode + * \retval FLAC__bool + * \c false if malloc() fails, or if \a field_name or \a field_value does + * not comply with the Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(FLAC__StreamMetadata_VorbisComment_Entry *entry, const char *field_name, const char *field_value); + +/** Splits a Vorbis comment entry into NUL-terminated name and value strings. + * + * The returned pointers to name and value will be allocated by malloc() + * and shall be owned by the caller. + * + * \param entry An existing Vorbis comment entry. + * \param field_name The address of where the returned pointer to the + * field name will be stored. + * \param field_value The address of where the returned pointer to the + * field value will be stored. + * \assert + * \code (entry.entry != NULL && entry.length > 0) \endcode + * \code memchr(entry.entry, '=', entry.length) != NULL \endcode + * \code field_name != NULL \endcode + * \code field_value != NULL \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_to_name_value_pair(const FLAC__StreamMetadata_VorbisComment_Entry entry, char **field_name, char **field_value); + +/** Check if the given Vorbis comment entry's field name matches the given + * field name. + * + * \param entry An existing Vorbis comment entry. + * \param field_name The field name to check. + * \param field_name_length The length of \a field_name, not including the + * terminating \c NUL. + * \assert + * \code (entry.entry != NULL && entry.length > 0) \endcode + * \retval FLAC__bool + * \c true if the field names match, else \c false + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_matches(const FLAC__StreamMetadata_VorbisComment_Entry entry, const char *field_name, unsigned field_name_length); + +/** Find a Vorbis comment with the given field name. + * + * The search begins at entry number \a offset; use an offset of 0 to + * search from the beginning of the comment array. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param offset The offset into the comment array from where to start + * the search. + * \param field_name The field name of the comment to find. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code field_name != NULL \endcode + * \retval int + * The offset in the comment array of the first comment whose field + * name matches \a field_name, or \c -1 if no match was found. + */ +FLAC_API int FLAC__metadata_object_vorbiscomment_find_entry_from(const FLAC__StreamMetadata *object, unsigned offset, const char *field_name); + +/** Remove first Vorbis comment matching the given field name. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param field_name The field name of comment to delete. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \retval int + * \c -1 for memory allocation error, \c 0 for no matching entries, + * \c 1 for one matching entry deleted. + */ +FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entry_matching(FLAC__StreamMetadata *object, const char *field_name); + +/** Remove all Vorbis comments matching the given field name. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param field_name The field name of comments to delete. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \retval int + * \c -1 for memory allocation error, \c 0 for no matching entries, + * else the number of matching entries deleted. + */ +FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entries_matching(FLAC__StreamMetadata *object, const char *field_name); + +/** Create a new CUESHEET track instance. + * + * The object will be "empty"; i.e. values and data pointers will be \c 0. + * + * \retval FLAC__StreamMetadata_CueSheet_Track* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_new(void); + +/** Create a copy of an existing CUESHEET track object. + * + * The copy is a "deep" copy, i.e. dynamically allocated data within the + * object is also copied. The caller takes ownership of the new object and + * is responsible for freeing it with + * FLAC__metadata_object_cuesheet_track_delete(). + * + * \param object Pointer to object to copy. + * \assert + * \code object != NULL \endcode + * \retval FLAC__StreamMetadata_CueSheet_Track* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_clone(const FLAC__StreamMetadata_CueSheet_Track *object); + +/** Delete a CUESHEET track object + * + * \param object A pointer to an existing CUESHEET track object. + * \assert + * \code object != NULL \endcode + */ +FLAC_API void FLAC__metadata_object_cuesheet_track_delete(FLAC__StreamMetadata_CueSheet_Track *object); + +/** Resize a track's index point array. + * + * If the size shrinks, elements will truncated; if it grows, new blank + * indices will be added to the end. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index of the track to modify. NOTE: this is not + * necessarily the same as the track's \a number field. + * \param new_num_indices The desired length of the array; may be \c 0. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \code (object->data.cue_sheet.tracks[track_num].indices == NULL && object->data.cue_sheet.tracks[track_num].num_indices == 0) || + * (object->data.cue_sheet.tracks[track_num].indices != NULL && object->data.cue_sheet.tracks[track_num].num_indices > 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_resize_indices(FLAC__StreamMetadata *object, unsigned track_num, unsigned new_num_indices); + +/** Insert an index point in a CUESHEET track at the given index. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index of the track to modify. NOTE: this is not + * necessarily the same as the track's \a number field. + * \param index_num The index into the track's index array at which to + * insert the index point. NOTE: this is not necessarily + * the same as the index point's \a number field. The + * indices at and after \a index_num move right one + * position. To append an index point to the end, set + * \a index_num to + * \c object->data.cue_sheet.tracks[track_num].num_indices . + * \param index The index point to insert. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \code object->data.cue_sheet.tracks[track_num].num_indices >= index_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num, FLAC__StreamMetadata_CueSheet_Index index); + +/** Insert a blank index point in a CUESHEET track at the given index. + * + * A blank index point is one in which all field values are zero. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index of the track to modify. NOTE: this is not + * necessarily the same as the track's \a number field. + * \param index_num The index into the track's index array at which to + * insert the index point. NOTE: this is not necessarily + * the same as the index point's \a number field. The + * indices at and after \a index_num move right one + * position. To append an index point to the end, set + * \a index_num to + * \c object->data.cue_sheet.tracks[track_num].num_indices . + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \code object->data.cue_sheet.tracks[track_num].num_indices >= index_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_blank_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num); + +/** Delete an index point in a CUESHEET track at the given index. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index into the track array of the track to + * modify. NOTE: this is not necessarily the same + * as the track's \a number field. + * \param index_num The index into the track's index array of the index + * to delete. NOTE: this is not necessarily the same + * as the index's \a number field. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \code object->data.cue_sheet.tracks[track_num].num_indices > index_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_delete_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num); + +/** Resize the track array. + * + * If the size shrinks, elements will truncated; if it grows, new blank + * tracks will be added to the end. + * + * \param object A pointer to an existing CUESHEET object. + * \param new_num_tracks The desired length of the array; may be \c 0. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code (object->data.cue_sheet.tracks == NULL && object->data.cue_sheet.num_tracks == 0) || + * (object->data.cue_sheet.tracks != NULL && object->data.cue_sheet.num_tracks > 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_resize_tracks(FLAC__StreamMetadata *object, unsigned new_num_tracks); + +/** Sets a track in a CUESHEET block. + * + * If \a copy is \c true, a copy of the track is stored; otherwise, the object + * takes ownership of the \a track pointer. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num Index into track array to set. NOTE: this is not + * necessarily the same as the track's \a number field. + * \param track The track to set the track to. You may safely pass in + * a const pointer if \a copy is \c true. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code track_num < object->data.cue_sheet.num_tracks \endcode + * \code (track->indices != NULL && track->num_indices > 0) || + * (track->indices == NULL && track->num_indices == 0) + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_set_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy); + +/** Insert a track in a CUESHEET block at the given index. + * + * If \a copy is \c true, a copy of the track is stored; otherwise, the object + * takes ownership of the \a track pointer. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index at which to insert the track. NOTE: this + * is not necessarily the same as the track's \a number + * field. The tracks at and after \a track_num move right + * one position. To append a track to the end, set + * \a track_num to \c object->data.cue_sheet.num_tracks . + * \param track The track to insert. You may safely pass in a const + * pointer if \a copy is \c true. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks >= track_num \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy); + +/** Insert a blank track in a CUESHEET block at the given index. + * + * A blank track is one in which all field values are zero. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index at which to insert the track. NOTE: this + * is not necessarily the same as the track's \a number + * field. The tracks at and after \a track_num move right + * one position. To append a track to the end, set + * \a track_num to \c object->data.cue_sheet.num_tracks . + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks >= track_num \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_blank_track(FLAC__StreamMetadata *object, unsigned track_num); + +/** Delete a track in a CUESHEET block at the given index. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index into the track array of the track to + * delete. NOTE: this is not necessarily the same + * as the track's \a number field. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_delete_track(FLAC__StreamMetadata *object, unsigned track_num); + +/** Check a cue sheet to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * cue sheet. + * + * \param object A pointer to an existing CUESHEET object. + * \param check_cd_da_subset If \c true, check CUESHEET against more + * stringent requirements for a CD-DA (audio) disc. + * \param violation Address of a pointer to a string. If there is a + * violation, a pointer to a string explanation of the + * violation will be returned here. \a violation may be + * \c NULL if you don't need the returned string. Do not + * free the returned string; it will always point to static + * data. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \retval FLAC__bool + * \c false if cue sheet is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_is_legal(const FLAC__StreamMetadata *object, FLAC__bool check_cd_da_subset, const char **violation); + +/** Calculate and return the CDDB/freedb ID for a cue sheet. The function + * assumes the cue sheet corresponds to a CD; the result is undefined + * if the cuesheet's is_cd bit is not set. + * + * \param object A pointer to an existing CUESHEET object. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \retval FLAC__uint32 + * The unsigned integer representation of the CDDB/freedb ID + */ +FLAC_API FLAC__uint32 FLAC__metadata_object_cuesheet_calculate_cddb_id(const FLAC__StreamMetadata *object); + +/** Sets the MIME type of a PICTURE block. + * + * If \a copy is \c true, a copy of the string is stored; otherwise, the object + * takes ownership of the pointer. The existing string will be freed if this + * function is successful, otherwise the original string will remain if \a copy + * is \c true and malloc() fails. + * + * \note It is safe to pass a const pointer to \a mime_type if \a copy is \c true. + * + * \param object A pointer to an existing PICTURE object. + * \param mime_type A pointer to the MIME type string. The string must be + * ASCII characters 0x20-0x7e, NUL-terminated. No validation + * is done. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode + * \code (mime_type != NULL) \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_picture_set_mime_type(FLAC__StreamMetadata *object, char *mime_type, FLAC__bool copy); + +/** Sets the description of a PICTURE block. + * + * If \a copy is \c true, a copy of the string is stored; otherwise, the object + * takes ownership of the pointer. The existing string will be freed if this + * function is successful, otherwise the original string will remain if \a copy + * is \c true and malloc() fails. + * + * \note It is safe to pass a const pointer to \a description if \a copy is \c true. + * + * \param object A pointer to an existing PICTURE object. + * \param description A pointer to the description string. The string must be + * valid UTF-8, NUL-terminated. No validation is done. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode + * \code (description != NULL) \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_picture_set_description(FLAC__StreamMetadata *object, FLAC__byte *description, FLAC__bool copy); + +/** Sets the picture data of a PICTURE block. + * + * If \a copy is \c true, a copy of the data is stored; otherwise, the object + * takes ownership of the pointer. Also sets the \a data_length field of the + * metadata object to what is passed in as the \a length parameter. The + * existing data will be freed if this function is successful, otherwise the + * original data and data_length will remain if \a copy is \c true and + * malloc() fails. + * + * \note It is safe to pass a const pointer to \a data if \a copy is \c true. + * + * \param object A pointer to an existing PICTURE object. + * \param data A pointer to the data to set. + * \param length The length of \a data in bytes. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode + * \code (data != NULL && length > 0) || + * (data == NULL && length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_picture_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, FLAC__uint32 length, FLAC__bool copy); + +/** Check a PICTURE block to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * PICTURE block. + * + * \param object A pointer to existing PICTURE block to be checked. + * \param violation Address of a pointer to a string. If there is a + * violation, a pointer to a string explanation of the + * violation will be returned here. \a violation may be + * \c NULL if you don't need the returned string. Do not + * free the returned string; it will always point to static + * data. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode + * \retval FLAC__bool + * \c false if PICTURE block is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_picture_is_legal(const FLAC__StreamMetadata *object, const char **violation); + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/ordinals.h b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/ordinals.h new file mode 100644 index 0000000..a7a5cd9 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/ordinals.h @@ -0,0 +1,80 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__ORDINALS_H +#define FLAC__ORDINALS_H + +#if !(defined(_MSC_VER) || defined(__BORLANDC__) || defined(__EMX__)) +#include +#endif + +typedef signed char FLAC__int8; +typedef unsigned char FLAC__uint8; + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef __int16 FLAC__int16; +typedef __int32 FLAC__int32; +typedef __int64 FLAC__int64; +typedef unsigned __int16 FLAC__uint16; +typedef unsigned __int32 FLAC__uint32; +typedef unsigned __int64 FLAC__uint64; +#elif defined(__EMX__) +typedef short FLAC__int16; +typedef long FLAC__int32; +typedef long long FLAC__int64; +typedef unsigned short FLAC__uint16; +typedef unsigned long FLAC__uint32; +typedef unsigned long long FLAC__uint64; +#else +typedef int16_t FLAC__int16; +typedef int32_t FLAC__int32; +typedef int64_t FLAC__int64; +typedef uint16_t FLAC__uint16; +typedef uint32_t FLAC__uint32; +typedef uint64_t FLAC__uint64; +#endif + +typedef int FLAC__bool; + +typedef FLAC__uint8 FLAC__byte; + +#ifdef true +#undef true +#endif +#ifdef false +#undef false +#endif +#ifndef __cplusplus +#define true 1 +#define false 0 +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/stream_decoder.h b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/stream_decoder.h new file mode 100644 index 0000000..9ac1594 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/stream_decoder.h @@ -0,0 +1,1559 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__STREAM_DECODER_H +#define FLAC__STREAM_DECODER_H + +#include /* for FILE */ +#include "export.h" +#include "format.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/** \file include/FLAC/stream_decoder.h + * + * \brief + * This module contains the functions which implement the stream + * decoder. + * + * See the detailed documentation in the + * \link flac_stream_decoder stream decoder \endlink module. + */ + +/** \defgroup flac_decoder FLAC/ \*_decoder.h: decoder interfaces + * \ingroup flac + * + * \brief + * This module describes the decoder layers provided by libFLAC. + * + * The stream decoder can be used to decode complete streams either from + * the client via callbacks, or directly from a file, depending on how + * it is initialized. When decoding via callbacks, the client provides + * callbacks for reading FLAC data and writing decoded samples, and + * handling metadata and errors. If the client also supplies seek-related + * callback, the decoder function for sample-accurate seeking within the + * FLAC input is also available. When decoding from a file, the client + * needs only supply a filename or open \c FILE* and write/metadata/error + * callbacks; the rest of the callbacks are supplied internally. For more + * info see the \link flac_stream_decoder stream decoder \endlink module. + */ + +/** \defgroup flac_stream_decoder FLAC/stream_decoder.h: stream decoder interface + * \ingroup flac_decoder + * + * \brief + * This module contains the functions which implement the stream + * decoder. + * + * The stream decoder can decode native FLAC, and optionally Ogg FLAC + * (check FLAC_API_SUPPORTS_OGG_FLAC) streams and files. + * + * The basic usage of this decoder is as follows: + * - The program creates an instance of a decoder using + * FLAC__stream_decoder_new(). + * - The program overrides the default settings using + * FLAC__stream_decoder_set_*() functions. + * - The program initializes the instance to validate the settings and + * prepare for decoding using + * - FLAC__stream_decoder_init_stream() or FLAC__stream_decoder_init_FILE() + * or FLAC__stream_decoder_init_file() for native FLAC, + * - FLAC__stream_decoder_init_ogg_stream() or FLAC__stream_decoder_init_ogg_FILE() + * or FLAC__stream_decoder_init_ogg_file() for Ogg FLAC + * - The program calls the FLAC__stream_decoder_process_*() functions + * to decode data, which subsequently calls the callbacks. + * - The program finishes the decoding with FLAC__stream_decoder_finish(), + * which flushes the input and output and resets the decoder to the + * uninitialized state. + * - The instance may be used again or deleted with + * FLAC__stream_decoder_delete(). + * + * In more detail, the program will create a new instance by calling + * FLAC__stream_decoder_new(), then call FLAC__stream_decoder_set_*() + * functions to override the default decoder options, and call + * one of the FLAC__stream_decoder_init_*() functions. + * + * There are three initialization functions for native FLAC, one for + * setting up the decoder to decode FLAC data from the client via + * callbacks, and two for decoding directly from a FLAC file. + * + * For decoding via callbacks, use FLAC__stream_decoder_init_stream(). + * You must also supply several callbacks for handling I/O. Some (like + * seeking) are optional, depending on the capabilities of the input. + * + * For decoding directly from a file, use FLAC__stream_decoder_init_FILE() + * or FLAC__stream_decoder_init_file(). Then you must only supply an open + * \c FILE* or filename and fewer callbacks; the decoder will handle + * the other callbacks internally. + * + * There are three similarly-named init functions for decoding from Ogg + * FLAC streams. Check \c FLAC_API_SUPPORTS_OGG_FLAC to find out if the + * library has been built with Ogg support. + * + * Once the decoder is initialized, your program will call one of several + * functions to start the decoding process: + * + * - FLAC__stream_decoder_process_single() - Tells the decoder to process at + * most one metadata block or audio frame and return, calling either the + * metadata callback or write callback, respectively, once. If the decoder + * loses sync it will return with only the error callback being called. + * - FLAC__stream_decoder_process_until_end_of_metadata() - Tells the decoder + * to process the stream from the current location and stop upon reaching + * the first audio frame. The client will get one metadata, write, or error + * callback per metadata block, audio frame, or sync error, respectively. + * - FLAC__stream_decoder_process_until_end_of_stream() - Tells the decoder + * to process the stream from the current location until the read callback + * returns FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM or + * FLAC__STREAM_DECODER_READ_STATUS_ABORT. The client will get one metadata, + * write, or error callback per metadata block, audio frame, or sync error, + * respectively. + * + * When the decoder has finished decoding (normally or through an abort), + * the instance is finished by calling FLAC__stream_decoder_finish(), which + * ensures the decoder is in the correct state and frees memory. Then the + * instance may be deleted with FLAC__stream_decoder_delete() or initialized + * again to decode another stream. + * + * Seeking is exposed through the FLAC__stream_decoder_seek_absolute() method. + * At any point after the stream decoder has been initialized, the client can + * call this function to seek to an exact sample within the stream. + * Subsequently, the first time the write callback is called it will be + * passed a (possibly partial) block starting at that sample. + * + * If the client cannot seek via the callback interface provided, but still + * has another way of seeking, it can flush the decoder using + * FLAC__stream_decoder_flush() and start feeding data from the new position + * through the read callback. + * + * The stream decoder also provides MD5 signature checking. If this is + * turned on before initialization, FLAC__stream_decoder_finish() will + * report when the decoded MD5 signature does not match the one stored + * in the STREAMINFO block. MD5 checking is automatically turned off + * (until the next FLAC__stream_decoder_reset()) if there is no signature + * in the STREAMINFO block or when a seek is attempted. + * + * The FLAC__stream_decoder_set_metadata_*() functions deserve special + * attention. By default, the decoder only calls the metadata_callback for + * the STREAMINFO block. These functions allow you to tell the decoder + * explicitly which blocks to parse and return via the metadata_callback + * and/or which to skip. Use a FLAC__stream_decoder_set_metadata_respond_all(), + * FLAC__stream_decoder_set_metadata_ignore() ... or FLAC__stream_decoder_set_metadata_ignore_all(), + * FLAC__stream_decoder_set_metadata_respond() ... sequence to exactly specify + * which blocks to return. Remember that metadata blocks can potentially + * be big (for example, cover art) so filtering out the ones you don't + * use can reduce the memory requirements of the decoder. Also note the + * special forms FLAC__stream_decoder_set_metadata_respond_application(id) + * and FLAC__stream_decoder_set_metadata_ignore_application(id) for + * filtering APPLICATION blocks based on the application ID. + * + * STREAMINFO and SEEKTABLE blocks are always parsed and used internally, but + * they still can legally be filtered from the metadata_callback. + * + * \note + * The "set" functions may only be called when the decoder is in the + * state FLAC__STREAM_DECODER_UNINITIALIZED, i.e. after + * FLAC__stream_decoder_new() or FLAC__stream_decoder_finish(), but + * before FLAC__stream_decoder_init_*(). If this is the case they will + * return \c true, otherwise \c false. + * + * \note + * FLAC__stream_decoder_finish() resets all settings to the constructor + * defaults, including the callbacks. + * + * \{ + */ + + +/** State values for a FLAC__StreamDecoder + * + * The decoder's state can be obtained by calling FLAC__stream_decoder_get_state(). + */ +typedef enum { + + FLAC__STREAM_DECODER_SEARCH_FOR_METADATA = 0, + /**< The decoder is ready to search for metadata. */ + + FLAC__STREAM_DECODER_READ_METADATA, + /**< The decoder is ready to or is in the process of reading metadata. */ + + FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC, + /**< The decoder is ready to or is in the process of searching for the + * frame sync code. + */ + + FLAC__STREAM_DECODER_READ_FRAME, + /**< The decoder is ready to or is in the process of reading a frame. */ + + FLAC__STREAM_DECODER_END_OF_STREAM, + /**< The decoder has reached the end of the stream. */ + + FLAC__STREAM_DECODER_OGG_ERROR, + /**< An error occurred in the underlying Ogg layer. */ + + FLAC__STREAM_DECODER_SEEK_ERROR, + /**< An error occurred while seeking. The decoder must be flushed + * with FLAC__stream_decoder_flush() or reset with + * FLAC__stream_decoder_reset() before decoding can continue. + */ + + FLAC__STREAM_DECODER_ABORTED, + /**< The decoder was aborted by the read callback. */ + + FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR, + /**< An error occurred allocating memory. The decoder is in an invalid + * state and can no longer be used. + */ + + FLAC__STREAM_DECODER_UNINITIALIZED + /**< The decoder is in the uninitialized state; one of the + * FLAC__stream_decoder_init_*() functions must be called before samples + * can be processed. + */ + +} FLAC__StreamDecoderState; + +/** Maps a FLAC__StreamDecoderState to a C string. + * + * Using a FLAC__StreamDecoderState as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderStateString[]; + + +/** Possible return values for the FLAC__stream_decoder_init_*() functions. + */ +typedef enum { + + FLAC__STREAM_DECODER_INIT_STATUS_OK = 0, + /**< Initialization was successful. */ + + FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER, + /**< The library was not compiled with support for the given container + * format. + */ + + FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS, + /**< A required callback was not supplied. */ + + FLAC__STREAM_DECODER_INIT_STATUS_MEMORY_ALLOCATION_ERROR, + /**< An error occurred allocating memory. */ + + FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE, + /**< fopen() failed in FLAC__stream_decoder_init_file() or + * FLAC__stream_decoder_init_ogg_file(). */ + + FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED + /**< FLAC__stream_decoder_init_*() was called when the decoder was + * already initialized, usually because + * FLAC__stream_decoder_finish() was not called. + */ + +} FLAC__StreamDecoderInitStatus; + +/** Maps a FLAC__StreamDecoderInitStatus to a C string. + * + * Using a FLAC__StreamDecoderInitStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderInitStatusString[]; + + +/** Return values for the FLAC__StreamDecoder read callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, + /**< The read was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM, + /**< The read was attempted while at the end of the stream. Note that + * the client must only return this value when the read callback was + * called when already at the end of the stream. Otherwise, if the read + * itself moves to the end of the stream, the client should still return + * the data and \c FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, and then on + * the next read callback it should return + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM with a byte count + * of \c 0. + */ + + FLAC__STREAM_DECODER_READ_STATUS_ABORT + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + +} FLAC__StreamDecoderReadStatus; + +/** Maps a FLAC__StreamDecoderReadStatus to a C string. + * + * Using a FLAC__StreamDecoderReadStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderReadStatusString[]; + + +/** Return values for the FLAC__StreamDecoder seek callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_SEEK_STATUS_OK, + /**< The seek was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_SEEK_STATUS_ERROR, + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + + FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED + /**< Client does not support seeking. */ + +} FLAC__StreamDecoderSeekStatus; + +/** Maps a FLAC__StreamDecoderSeekStatus to a C string. + * + * Using a FLAC__StreamDecoderSeekStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderSeekStatusString[]; + + +/** Return values for the FLAC__StreamDecoder tell callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_TELL_STATUS_OK, + /**< The tell was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_TELL_STATUS_ERROR, + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + + FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED + /**< Client does not support telling the position. */ + +} FLAC__StreamDecoderTellStatus; + +/** Maps a FLAC__StreamDecoderTellStatus to a C string. + * + * Using a FLAC__StreamDecoderTellStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderTellStatusString[]; + + +/** Return values for the FLAC__StreamDecoder length callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_LENGTH_STATUS_OK, + /**< The length call was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR, + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + + FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED + /**< Client does not support reporting the length. */ + +} FLAC__StreamDecoderLengthStatus; + +/** Maps a FLAC__StreamDecoderLengthStatus to a C string. + * + * Using a FLAC__StreamDecoderLengthStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderLengthStatusString[]; + + +/** Return values for the FLAC__StreamDecoder write callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE, + /**< The write was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_WRITE_STATUS_ABORT + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + +} FLAC__StreamDecoderWriteStatus; + +/** Maps a FLAC__StreamDecoderWriteStatus to a C string. + * + * Using a FLAC__StreamDecoderWriteStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderWriteStatusString[]; + + +/** Possible values passed back to the FLAC__StreamDecoder error callback. + * \c FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC is the generic catch- + * all. The rest could be caused by bad sync (false synchronization on + * data that is not the start of a frame) or corrupted data. The error + * itself is the decoder's best guess at what happened assuming a correct + * sync. For example \c FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER + * could be caused by a correct sync on the start of a frame, but some + * data in the frame header was corrupted. Or it could be the result of + * syncing on a point the stream that looked like the starting of a frame + * but was not. \c FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM + * could be because the decoder encountered a valid frame made by a future + * version of the encoder which it cannot parse, or because of a false + * sync making it appear as though an encountered frame was generated by + * a future encoder. + */ +typedef enum { + + FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC, + /**< An error in the stream caused the decoder to lose synchronization. */ + + FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER, + /**< The decoder encountered a corrupted frame header. */ + + FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH, + /**< The frame's data did not match the CRC in the footer. */ + + FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM + /**< The decoder encountered reserved fields in use in the stream. */ + +} FLAC__StreamDecoderErrorStatus; + +/** Maps a FLAC__StreamDecoderErrorStatus to a C string. + * + * Using a FLAC__StreamDecoderErrorStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderErrorStatusString[]; + + +/*********************************************************************** + * + * class FLAC__StreamDecoder + * + ***********************************************************************/ + +struct FLAC__StreamDecoderProtected; +struct FLAC__StreamDecoderPrivate; +/** The opaque structure definition for the stream decoder type. + * See the \link flac_stream_decoder stream decoder module \endlink + * for a detailed description. + */ +typedef struct { + struct FLAC__StreamDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */ + struct FLAC__StreamDecoderPrivate *private_; /* avoid the C++ keyword 'private' */ +} FLAC__StreamDecoder; + +/** Signature for the read callback. + * + * A function pointer matching this signature must be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder needs more input data. The address of the + * buffer to be filled is supplied, along with the number of bytes the + * buffer can hold. The callback may choose to supply less data and + * modify the byte count but must be careful not to overflow the buffer. + * The callback then returns a status code chosen from + * FLAC__StreamDecoderReadStatus. + * + * Here is an example of a read callback for stdio streams: + * \code + * FLAC__StreamDecoderReadStatus read_cb(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * if(*bytes > 0) { + * *bytes = fread(buffer, sizeof(FLAC__byte), *bytes, file); + * if(ferror(file)) + * return FLAC__STREAM_DECODER_READ_STATUS_ABORT; + * else if(*bytes == 0) + * return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; + * else + * return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; + * } + * else + * return FLAC__STREAM_DECODER_READ_STATUS_ABORT; + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param buffer A pointer to a location for the callee to store + * data to be decoded. + * \param bytes A pointer to the size of the buffer. On entry + * to the callback, it contains the maximum number + * of bytes that may be stored in \a buffer. The + * callee must set it to the actual number of bytes + * stored (0 in case of error or end-of-stream) before + * returning. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderReadStatus + * The callee's return status. Note that the callback should return + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM if and only if + * zero bytes were read and there is no more data to be read. + */ +typedef FLAC__StreamDecoderReadStatus (*FLAC__StreamDecoderReadCallback)(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data); + +/** Signature for the seek callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder needs to seek the input stream. The decoder + * will pass the absolute byte offset to seek to, 0 meaning the + * beginning of the stream. + * + * Here is an example of a seek callback for stdio streams: + * \code + * FLAC__StreamDecoderSeekStatus seek_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * if(file == stdin) + * return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED; + * else if(fseeko(file, (off_t)absolute_byte_offset, SEEK_SET) < 0) + * return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; + * else + * return FLAC__STREAM_DECODER_SEEK_STATUS_OK; + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param absolute_byte_offset The offset from the beginning of the stream + * to seek to. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderSeekStatus + * The callee's return status. + */ +typedef FLAC__StreamDecoderSeekStatus (*FLAC__StreamDecoderSeekCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data); + +/** Signature for the tell callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder wants to know the current position of the + * stream. The callback should return the byte offset from the + * beginning of the stream. + * + * Here is an example of a tell callback for stdio streams: + * \code + * FLAC__StreamDecoderTellStatus tell_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * off_t pos; + * if(file == stdin) + * return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED; + * else if((pos = ftello(file)) < 0) + * return FLAC__STREAM_DECODER_TELL_STATUS_ERROR; + * else { + * *absolute_byte_offset = (FLAC__uint64)pos; + * return FLAC__STREAM_DECODER_TELL_STATUS_OK; + * } + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param absolute_byte_offset A pointer to storage for the current offset + * from the beginning of the stream. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderTellStatus + * The callee's return status. + */ +typedef FLAC__StreamDecoderTellStatus (*FLAC__StreamDecoderTellCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data); + +/** Signature for the length callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder wants to know the total length of the stream + * in bytes. + * + * Here is an example of a length callback for stdio streams: + * \code + * FLAC__StreamDecoderLengthStatus length_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * struct stat filestats; + * + * if(file == stdin) + * return FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED; + * else if(fstat(fileno(file), &filestats) != 0) + * return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; + * else { + * *stream_length = (FLAC__uint64)filestats.st_size; + * return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; + * } + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param stream_length A pointer to storage for the length of the stream + * in bytes. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderLengthStatus + * The callee's return status. + */ +typedef FLAC__StreamDecoderLengthStatus (*FLAC__StreamDecoderLengthCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data); + +/** Signature for the EOF callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder needs to know if the end of the stream has + * been reached. + * + * Here is an example of a EOF callback for stdio streams: + * FLAC__bool eof_cb(const FLAC__StreamDecoder *decoder, void *client_data) + * \code + * { + * FILE *file = ((MyClientData*)client_data)->file; + * return feof(file)? true : false; + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__bool + * \c true if the currently at the end of the stream, else \c false. + */ +typedef FLAC__bool (*FLAC__StreamDecoderEofCallback)(const FLAC__StreamDecoder *decoder, void *client_data); + +/** Signature for the write callback. + * + * A function pointer matching this signature must be passed to one of + * the FLAC__stream_decoder_init_*() functions. + * The supplied function will be called when the decoder has decoded a + * single audio frame. The decoder will pass the frame metadata as well + * as an array of pointers (one for each channel) pointing to the + * decoded audio. + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param frame The description of the decoded frame. See + * FLAC__Frame. + * \param buffer An array of pointers to decoded channels of data. + * Each pointer will point to an array of signed + * samples of length \a frame->header.blocksize. + * Channels will be ordered according to the FLAC + * specification; see the documentation for the + * frame header. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderWriteStatus + * The callee's return status. + */ +typedef FLAC__StreamDecoderWriteStatus (*FLAC__StreamDecoderWriteCallback)(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); + +/** Signature for the metadata callback. + * + * A function pointer matching this signature must be passed to one of + * the FLAC__stream_decoder_init_*() functions. + * The supplied function will be called when the decoder has decoded a + * metadata block. In a valid FLAC file there will always be one + * \c STREAMINFO block, followed by zero or more other metadata blocks. + * These will be supplied by the decoder in the same order as they + * appear in the stream and always before the first audio frame (i.e. + * write callback). The metadata block that is passed in must not be + * modified, and it doesn't live beyond the callback, so you should make + * a copy of it with FLAC__metadata_object_clone() if you will need it + * elsewhere. Since metadata blocks can potentially be large, by + * default the decoder only calls the metadata callback for the + * \c STREAMINFO block; you can instruct the decoder to pass or filter + * other blocks with FLAC__stream_decoder_set_metadata_*() calls. + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param metadata The decoded metadata block. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + */ +typedef void (*FLAC__StreamDecoderMetadataCallback)(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); + +/** Signature for the error callback. + * + * A function pointer matching this signature must be passed to one of + * the FLAC__stream_decoder_init_*() functions. + * The supplied function will be called whenever an error occurs during + * decoding. + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param status The error encountered by the decoder. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + */ +typedef void (*FLAC__StreamDecoderErrorCallback)(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); + + +/*********************************************************************** + * + * Class constructor/destructor + * + ***********************************************************************/ + +/** Create a new stream decoder instance. The instance is created with + * default settings; see the individual FLAC__stream_decoder_set_*() + * functions for each setting's default. + * + * \retval FLAC__StreamDecoder* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamDecoder *FLAC__stream_decoder_new(void); + +/** Free a decoder instance. Deletes the object pointed to by \a decoder. + * + * \param decoder A pointer to an existing decoder. + * \assert + * \code decoder != NULL \endcode + */ +FLAC_API void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder); + + +/*********************************************************************** + * + * Public class method prototypes + * + ***********************************************************************/ + +/** Set the serial number for the FLAC stream within the Ogg container. + * The default behavior is to use the serial number of the first Ogg + * page. Setting a serial number here will explicitly specify which + * stream is to be decoded. + * + * \note + * This does not need to be set for native FLAC decoding. + * + * \default \c use serial number of first page + * \param decoder A decoder instance to set. + * \param serial_number See above. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_ogg_serial_number(FLAC__StreamDecoder *decoder, long serial_number); + +/** Set the "MD5 signature checking" flag. If \c true, the decoder will + * compute the MD5 signature of the unencoded audio data while decoding + * and compare it to the signature from the STREAMINFO block, if it + * exists, during FLAC__stream_decoder_finish(). + * + * MD5 signature checking will be turned off (until the next + * FLAC__stream_decoder_reset()) if there is no signature in the + * STREAMINFO block or when a seek is attempted. + * + * Clients that do not use the MD5 check should leave this off to speed + * up decoding. + * + * \default \c false + * \param decoder A decoder instance to set. + * \param value Flag value (see above). + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_md5_checking(FLAC__StreamDecoder *decoder, FLAC__bool value); + +/** Direct the decoder to pass on all metadata blocks of type \a type. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \param type See above. + * \assert + * \code decoder != NULL \endcode + * \a type is valid + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecoder *decoder, FLAC__MetadataType type); + +/** Direct the decoder to pass on all APPLICATION metadata blocks of the + * given \a id. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \param id See above. + * \assert + * \code decoder != NULL \endcode + * \code id != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]); + +/** Direct the decoder to pass on all metadata blocks of any type. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_all(FLAC__StreamDecoder *decoder); + +/** Direct the decoder to filter out all metadata blocks of type \a type. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \param type See above. + * \assert + * \code decoder != NULL \endcode + * \a type is valid + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder *decoder, FLAC__MetadataType type); + +/** Direct the decoder to filter out all APPLICATION metadata blocks of + * the given \a id. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \param id See above. + * \assert + * \code decoder != NULL \endcode + * \code id != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]); + +/** Direct the decoder to filter out all metadata blocks of any type. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all(FLAC__StreamDecoder *decoder); + +/** Get the current decoder state. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderState + * The current decoder state. + */ +FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_get_state(const FLAC__StreamDecoder *decoder); + +/** Get the current decoder state as a C string. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval const char * + * The decoder state as a C string. Do not modify the contents. + */ +FLAC_API const char *FLAC__stream_decoder_get_resolved_state_string(const FLAC__StreamDecoder *decoder); + +/** Get the "MD5 signature checking" flag. + * This is the value of the setting, not whether or not the decoder is + * currently checking the MD5 (remember, it can be turned off automatically + * by a seek). When the decoder is reset the flag will be restored to the + * value returned by this function. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * See above. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_get_md5_checking(const FLAC__StreamDecoder *decoder); + +/** Get the total number of samples in the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the \c STREAMINFO block. A value of \c 0 means "unknown". + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API FLAC__uint64 FLAC__stream_decoder_get_total_samples(const FLAC__StreamDecoder *decoder); + +/** Get the current number of channels in the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API unsigned FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder); + +/** Get the current channel assignment in the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__ChannelAssignment + * See above. + */ +FLAC_API FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment(const FLAC__StreamDecoder *decoder); + +/** Get the current sample resolution in the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder); + +/** Get the current sample rate in Hz of the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder); + +/** Get the current blocksize of the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder); + +/** Returns the decoder's current read position within the stream. + * The position is the byte offset from the start of the stream. + * Bytes before this position have been fully decoded. Note that + * there may still be undecoded bytes in the decoder's read FIFO. + * The returned position is correct even after a seek. + * + * \warning This function currently only works for native FLAC, + * not Ogg FLAC streams. + * + * \param decoder A decoder instance to query. + * \param position Address at which to return the desired position. + * \assert + * \code decoder != NULL \endcode + * \code position != NULL \endcode + * \retval FLAC__bool + * \c true if successful, \c false if the stream is not native FLAC, + * or there was an error from the 'tell' callback or it returned + * \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position(const FLAC__StreamDecoder *decoder, FLAC__uint64 *position); + +/** Initialize the decoder instance to decode native FLAC streams. + * + * This flavor of initialization sets up the decoder to decode from a + * native FLAC stream. I/O is performed via callbacks to the client. + * For decoding from a plain file via filename or open FILE*, + * FLAC__stream_decoder_init_file() and FLAC__stream_decoder_init_FILE() + * provide a simpler interface. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \param decoder An uninitialized decoder instance. + * \param read_callback See FLAC__StreamDecoderReadCallback. This + * pointer must not be \c NULL. + * \param seek_callback See FLAC__StreamDecoderSeekCallback. This + * pointer may be \c NULL if seeking is not + * supported. If \a seek_callback is not \c NULL then a + * \a tell_callback, \a length_callback, and \a eof_callback must also be supplied. + * Alternatively, a dummy seek callback that just + * returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param tell_callback See FLAC__StreamDecoderTellCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a tell_callback must also be supplied. + * Alternatively, a dummy tell callback that just + * returns \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param length_callback See FLAC__StreamDecoderLengthCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a length_callback must also be supplied. + * Alternatively, a dummy length callback that just + * returns \c FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param eof_callback See FLAC__StreamDecoderEofCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a eof_callback must also be supplied. + * Alternatively, a dummy length callback that just + * returns \c false + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_stream( + FLAC__StreamDecoder *decoder, + FLAC__StreamDecoderReadCallback read_callback, + FLAC__StreamDecoderSeekCallback seek_callback, + FLAC__StreamDecoderTellCallback tell_callback, + FLAC__StreamDecoderLengthCallback length_callback, + FLAC__StreamDecoderEofCallback eof_callback, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode Ogg FLAC streams. + * + * This flavor of initialization sets up the decoder to decode from a + * FLAC stream in an Ogg container. I/O is performed via callbacks to the + * client. For decoding from a plain file via filename or open FILE*, + * FLAC__stream_decoder_init_ogg_file() and FLAC__stream_decoder_init_ogg_FILE() + * provide a simpler interface. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \note Support for Ogg FLAC in the library is optional. If this + * library has been built without support for Ogg FLAC, this function + * will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER. + * + * \param decoder An uninitialized decoder instance. + * \param read_callback See FLAC__StreamDecoderReadCallback. This + * pointer must not be \c NULL. + * \param seek_callback See FLAC__StreamDecoderSeekCallback. This + * pointer may be \c NULL if seeking is not + * supported. If \a seek_callback is not \c NULL then a + * \a tell_callback, \a length_callback, and \a eof_callback must also be supplied. + * Alternatively, a dummy seek callback that just + * returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param tell_callback See FLAC__StreamDecoderTellCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a tell_callback must also be supplied. + * Alternatively, a dummy tell callback that just + * returns \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param length_callback See FLAC__StreamDecoderLengthCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a length_callback must also be supplied. + * Alternatively, a dummy length callback that just + * returns \c FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param eof_callback See FLAC__StreamDecoderEofCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a eof_callback must also be supplied. + * Alternatively, a dummy length callback that just + * returns \c false + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_stream( + FLAC__StreamDecoder *decoder, + FLAC__StreamDecoderReadCallback read_callback, + FLAC__StreamDecoderSeekCallback seek_callback, + FLAC__StreamDecoderTellCallback tell_callback, + FLAC__StreamDecoderLengthCallback length_callback, + FLAC__StreamDecoderEofCallback eof_callback, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode native FLAC files. + * + * This flavor of initialization sets up the decoder to decode from a + * plain native FLAC file. For non-stdio streams, you must use + * FLAC__stream_decoder_init_stream() and provide callbacks for the I/O. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \param decoder An uninitialized decoder instance. + * \param file An open FLAC file. The file should have been + * opened with mode \c "rb" and rewound. The file + * becomes owned by the decoder and should not be + * manipulated by the client while decoding. + * Unless \a file is \c stdin, it will be closed + * when FLAC__stream_decoder_finish() is called. + * Note however that seeking will not work when + * decoding from \c stdout since it is not seekable. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \code file != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_FILE( + FLAC__StreamDecoder *decoder, + FILE *file, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode Ogg FLAC files. + * + * This flavor of initialization sets up the decoder to decode from a + * plain Ogg FLAC file. For non-stdio streams, you must use + * FLAC__stream_decoder_init_ogg_stream() and provide callbacks for the I/O. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \note Support for Ogg FLAC in the library is optional. If this + * library has been built without support for Ogg FLAC, this function + * will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER. + * + * \param decoder An uninitialized decoder instance. + * \param file An open FLAC file. The file should have been + * opened with mode \c "rb" and rewound. The file + * becomes owned by the decoder and should not be + * manipulated by the client while decoding. + * Unless \a file is \c stdin, it will be closed + * when FLAC__stream_decoder_finish() is called. + * Note however that seeking will not work when + * decoding from \c stdout since it is not seekable. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \code file != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_FILE( + FLAC__StreamDecoder *decoder, + FILE *file, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode native FLAC files. + * + * This flavor of initialization sets up the decoder to decode from a plain + * native FLAC file. If POSIX fopen() semantics are not sufficient, (for + * example, with Unicode filenames on Windows), you must use + * FLAC__stream_decoder_init_FILE(), or FLAC__stream_decoder_init_stream() + * and provide callbacks for the I/O. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \param decoder An uninitialized decoder instance. + * \param filename The name of the file to decode from. The file will + * be opened with fopen(). Use \c NULL to decode from + * \c stdin. Note that \c stdin is not seekable. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_file( + FLAC__StreamDecoder *decoder, + const char *filename, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode Ogg FLAC files. + * + * This flavor of initialization sets up the decoder to decode from a plain + * Ogg FLAC file. If POSIX fopen() semantics are not sufficient, (for + * example, with Unicode filenames on Windows), you must use + * FLAC__stream_decoder_init_ogg_FILE(), or FLAC__stream_decoder_init_ogg_stream() + * and provide callbacks for the I/O. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \note Support for Ogg FLAC in the library is optional. If this + * library has been built without support for Ogg FLAC, this function + * will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER. + * + * \param decoder An uninitialized decoder instance. + * \param filename The name of the file to decode from. The file will + * be opened with fopen(). Use \c NULL to decode from + * \c stdin. Note that \c stdin is not seekable. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_file( + FLAC__StreamDecoder *decoder, + const char *filename, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Finish the decoding process. + * Flushes the decoding buffer, releases resources, resets the decoder + * settings to their defaults, and returns the decoder state to + * FLAC__STREAM_DECODER_UNINITIALIZED. + * + * In the event of a prematurely-terminated decode, it is not strictly + * necessary to call this immediately before FLAC__stream_decoder_delete() + * but it is good practice to match every FLAC__stream_decoder_init_*() + * with a FLAC__stream_decoder_finish(). + * + * \param decoder An uninitialized decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if MD5 checking is on AND a STREAMINFO block was available + * AND the MD5 signature in the STREAMINFO block was non-zero AND the + * signature does not match the one computed by the decoder; else + * \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder); + +/** Flush the stream input. + * The decoder's input buffer will be cleared and the state set to + * \c FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC. This will also turn + * off MD5 checking. + * + * \param decoder A decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false if a memory allocation + * error occurs (in which case the state will be set to + * \c FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder); + +/** Reset the decoding process. + * The decoder's input buffer will be cleared and the state set to + * \c FLAC__STREAM_DECODER_SEARCH_FOR_METADATA. This is similar to + * FLAC__stream_decoder_finish() except that the settings are + * preserved; there is no need to call FLAC__stream_decoder_init_*() + * before decoding again. MD5 checking will be restored to its original + * setting. + * + * If the decoder is seekable, or was initialized with + * FLAC__stream_decoder_init*_FILE() or FLAC__stream_decoder_init*_file(), + * the decoder will also attempt to seek to the beginning of the file. + * If this rewind fails, this function will return \c false. It follows + * that FLAC__stream_decoder_reset() cannot be used when decoding from + * \c stdin. + * + * If the decoder was initialized with FLAC__stream_encoder_init*_stream() + * and is not seekable (i.e. no seek callback was provided or the seek + * callback returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED), it + * is the duty of the client to start feeding data from the beginning of + * the stream on the next FLAC__stream_decoder_process() or + * FLAC__stream_decoder_process_interleaved() call. + * + * \param decoder A decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false if a memory allocation occurs + * (in which case the state will be set to + * \c FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR) or a seek error + * occurs (the state will be unchanged). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder); + +/** Decode one metadata block or audio frame. + * This version instructs the decoder to decode a either a single metadata + * block or a single frame and stop, unless the callbacks return a fatal + * error or the read callback returns + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM. + * + * As the decoder needs more input it will call the read callback. + * Depending on what was decoded, the metadata or write callback will be + * called with the decoded metadata block or audio frame. + * + * Unless there is a fatal read error or end of stream, this function + * will return once one whole frame is decoded. In other words, if the + * stream is not synchronized or points to a corrupt frame header, the + * decoder will continue to try and resync until it gets to a valid + * frame, then decode one frame, then return. If the decoder points to + * a frame whose frame CRC in the frame footer does not match the + * computed frame CRC, this function will issue a + * FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH error to the + * error callback, and return, having decoded one complete, although + * corrupt, frame. (Such corrupted frames are sent as silence of the + * correct length to the write callback.) + * + * \param decoder An initialized decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if any fatal read, write, or memory allocation error + * occurred (meaning decoding must stop), else \c true; for more + * information about the decoder, check the decoder state with + * FLAC__stream_decoder_get_state(). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_process_single(FLAC__StreamDecoder *decoder); + +/** Decode until the end of the metadata. + * This version instructs the decoder to decode from the current position + * and continue until all the metadata has been read, or until the + * callbacks return a fatal error or the read callback returns + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM. + * + * As the decoder needs more input it will call the read callback. + * As each metadata block is decoded, the metadata callback will be called + * with the decoded metadata. + * + * \param decoder An initialized decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if any fatal read, write, or memory allocation error + * occurred (meaning decoding must stop), else \c true; for more + * information about the decoder, check the decoder state with + * FLAC__stream_decoder_get_state(). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata(FLAC__StreamDecoder *decoder); + +/** Decode until the end of the stream. + * This version instructs the decoder to decode from the current position + * and continue until the end of stream (the read callback returns + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM), or until the + * callbacks return a fatal error. + * + * As the decoder needs more input it will call the read callback. + * As each metadata block and frame is decoded, the metadata or write + * callback will be called with the decoded metadata or frame. + * + * \param decoder An initialized decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if any fatal read, write, or memory allocation error + * occurred (meaning decoding must stop), else \c true; for more + * information about the decoder, check the decoder state with + * FLAC__stream_decoder_get_state(). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_stream(FLAC__StreamDecoder *decoder); + +/** Skip one audio frame. + * This version instructs the decoder to 'skip' a single frame and stop, + * unless the callbacks return a fatal error or the read callback returns + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM. + * + * The decoding flow is the same as what occurs when + * FLAC__stream_decoder_process_single() is called to process an audio + * frame, except that this function does not decode the parsed data into + * PCM or call the write callback. The integrity of the frame is still + * checked the same way as in the other process functions. + * + * This function will return once one whole frame is skipped, in the + * same way that FLAC__stream_decoder_process_single() will return once + * one whole frame is decoded. + * + * This function can be used in more quickly determining FLAC frame + * boundaries when decoding of the actual data is not needed, for + * example when an application is separating a FLAC stream into frames + * for editing or storing in a container. To do this, the application + * can use FLAC__stream_decoder_skip_single_frame() to quickly advance + * to the next frame, then use + * FLAC__stream_decoder_get_decode_position() to find the new frame + * boundary. + * + * This function should only be called when the stream has advanced + * past all the metadata, otherwise it will return \c false. + * + * \param decoder An initialized decoder instance not in a metadata + * state. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if any fatal read, write, or memory allocation error + * occurred (meaning decoding must stop), or if the decoder + * is in the FLAC__STREAM_DECODER_SEARCH_FOR_METADATA or + * FLAC__STREAM_DECODER_READ_METADATA state, else \c true; for more + * information about the decoder, check the decoder state with + * FLAC__stream_decoder_get_state(). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_frame(FLAC__StreamDecoder *decoder); + +/** Flush the input and seek to an absolute sample. + * Decoding will resume at the given sample. Note that because of + * this, the next write callback may contain a partial block. The + * client must support seeking the input or this function will fail + * and return \c false. Furthermore, if the decoder state is + * \c FLAC__STREAM_DECODER_SEEK_ERROR, then the decoder must be flushed + * with FLAC__stream_decoder_flush() or reset with + * FLAC__stream_decoder_reset() before decoding can continue. + * + * \param decoder A decoder instance. + * \param sample The target sample number to seek to. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_seek_absolute(FLAC__StreamDecoder *decoder, FLAC__uint64 sample); + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/stream_encoder.h b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/stream_encoder.h new file mode 100644 index 0000000..dbbbb23 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Headers/stream_encoder.h @@ -0,0 +1,1768 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__STREAM_ENCODER_H +#define FLAC__STREAM_ENCODER_H + +#include /* for FILE */ +#include "export.h" +#include "format.h" +#include "stream_decoder.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/** \file include/FLAC/stream_encoder.h + * + * \brief + * This module contains the functions which implement the stream + * encoder. + * + * See the detailed documentation in the + * \link flac_stream_encoder stream encoder \endlink module. + */ + +/** \defgroup flac_encoder FLAC/ \*_encoder.h: encoder interfaces + * \ingroup flac + * + * \brief + * This module describes the encoder layers provided by libFLAC. + * + * The stream encoder can be used to encode complete streams either to the + * client via callbacks, or directly to a file, depending on how it is + * initialized. When encoding via callbacks, the client provides a write + * callback which will be called whenever FLAC data is ready to be written. + * If the client also supplies a seek callback, the encoder will also + * automatically handle the writing back of metadata discovered while + * encoding, like stream info, seek points offsets, etc. When encoding to + * a file, the client needs only supply a filename or open \c FILE* and an + * optional progress callback for periodic notification of progress; the + * write and seek callbacks are supplied internally. For more info see the + * \link flac_stream_encoder stream encoder \endlink module. + */ + +/** \defgroup flac_stream_encoder FLAC/stream_encoder.h: stream encoder interface + * \ingroup flac_encoder + * + * \brief + * This module contains the functions which implement the stream + * encoder. + * + * The stream encoder can encode to native FLAC, and optionally Ogg FLAC + * (check FLAC_API_SUPPORTS_OGG_FLAC) streams and files. + * + * The basic usage of this encoder is as follows: + * - The program creates an instance of an encoder using + * FLAC__stream_encoder_new(). + * - The program overrides the default settings using + * FLAC__stream_encoder_set_*() functions. At a minimum, the following + * functions should be called: + * - FLAC__stream_encoder_set_channels() + * - FLAC__stream_encoder_set_bits_per_sample() + * - FLAC__stream_encoder_set_sample_rate() + * - FLAC__stream_encoder_set_ogg_serial_number() (if encoding to Ogg FLAC) + * - FLAC__stream_encoder_set_total_samples_estimate() (if known) + * - If the application wants to control the compression level or set its own + * metadata, then the following should also be called: + * - FLAC__stream_encoder_set_compression_level() + * - FLAC__stream_encoder_set_verify() + * - FLAC__stream_encoder_set_metadata() + * - The rest of the set functions should only be called if the client needs + * exact control over how the audio is compressed; thorough understanding + * of the FLAC format is necessary to achieve good results. + * - The program initializes the instance to validate the settings and + * prepare for encoding using + * - FLAC__stream_encoder_init_stream() or FLAC__stream_encoder_init_FILE() + * or FLAC__stream_encoder_init_file() for native FLAC + * - FLAC__stream_encoder_init_ogg_stream() or FLAC__stream_encoder_init_ogg_FILE() + * or FLAC__stream_encoder_init_ogg_file() for Ogg FLAC + * - The program calls FLAC__stream_encoder_process() or + * FLAC__stream_encoder_process_interleaved() to encode data, which + * subsequently calls the callbacks when there is encoder data ready + * to be written. + * - The program finishes the encoding with FLAC__stream_encoder_finish(), + * which causes the encoder to encode any data still in its input pipe, + * update the metadata with the final encoding statistics if output + * seeking is possible, and finally reset the encoder to the + * uninitialized state. + * - The instance may be used again or deleted with + * FLAC__stream_encoder_delete(). + * + * In more detail, the stream encoder functions similarly to the + * \link flac_stream_decoder stream decoder \endlink, but has fewer + * callbacks and more options. Typically the client will create a new + * instance by calling FLAC__stream_encoder_new(), then set the necessary + * parameters with FLAC__stream_encoder_set_*(), and initialize it by + * calling one of the FLAC__stream_encoder_init_*() functions. + * + * Unlike the decoders, the stream encoder has many options that can + * affect the speed and compression ratio. When setting these parameters + * you should have some basic knowledge of the format (see the + * user-level documentation + * or the formal description). The + * FLAC__stream_encoder_set_*() functions themselves do not validate the + * values as many are interdependent. The FLAC__stream_encoder_init_*() + * functions will do this, so make sure to pay attention to the state + * returned by FLAC__stream_encoder_init_*() to make sure that it is + * FLAC__STREAM_ENCODER_INIT_STATUS_OK. Any parameters that are not set + * before FLAC__stream_encoder_init_*() will take on the defaults from + * the constructor. + * + * There are three initialization functions for native FLAC, one for + * setting up the encoder to encode FLAC data to the client via + * callbacks, and two for encoding directly to a file. + * + * For encoding via callbacks, use FLAC__stream_encoder_init_stream(). + * You must also supply a write callback which will be called anytime + * there is raw encoded data to write. If the client can seek the output + * it is best to also supply seek and tell callbacks, as this allows the + * encoder to go back after encoding is finished to write back + * information that was collected while encoding, like seek point offsets, + * frame sizes, etc. + * + * For encoding directly to a file, use FLAC__stream_encoder_init_FILE() + * or FLAC__stream_encoder_init_file(). Then you must only supply a + * filename or open \c FILE*; the encoder will handle all the callbacks + * internally. You may also supply a progress callback for periodic + * notification of the encoding progress. + * + * There are three similarly-named init functions for encoding to Ogg + * FLAC streams. Check \c FLAC_API_SUPPORTS_OGG_FLAC to find out if the + * library has been built with Ogg support. + * + * The call to FLAC__stream_encoder_init_*() currently will also immediately + * call the write callback several times, once with the \c fLaC signature, + * and once for each encoded metadata block. Note that for Ogg FLAC + * encoding you will usually get at least twice the number of callbacks than + * with native FLAC, one for the Ogg page header and one for the page body. + * + * After initializing the instance, the client may feed audio data to the + * encoder in one of two ways: + * + * - Channel separate, through FLAC__stream_encoder_process() - The client + * will pass an array of pointers to buffers, one for each channel, to + * the encoder, each of the same length. The samples need not be + * block-aligned, but each channel should have the same number of samples. + * - Channel interleaved, through + * FLAC__stream_encoder_process_interleaved() - The client will pass a single + * pointer to data that is channel-interleaved (i.e. channel0_sample0, + * channel1_sample0, ... , channelN_sample0, channel0_sample1, ...). + * Again, the samples need not be block-aligned but they must be + * sample-aligned, i.e. the first value should be channel0_sample0 and + * the last value channelN_sampleM. + * + * Note that for either process call, each sample in the buffers should be a + * signed integer, right-justified to the resolution set by + * FLAC__stream_encoder_set_bits_per_sample(). For example, if the resolution + * is 16 bits per sample, the samples should all be in the range [-32768,32767]. + * + * When the client is finished encoding data, it calls + * FLAC__stream_encoder_finish(), which causes the encoder to encode any + * data still in its input pipe, and call the metadata callback with the + * final encoding statistics. Then the instance may be deleted with + * FLAC__stream_encoder_delete() or initialized again to encode another + * stream. + * + * For programs that write their own metadata, but that do not know the + * actual metadata until after encoding, it is advantageous to instruct + * the encoder to write a PADDING block of the correct size, so that + * instead of rewriting the whole stream after encoding, the program can + * just overwrite the PADDING block. If only the maximum size of the + * metadata is known, the program can write a slightly larger padding + * block, then split it after encoding. + * + * Make sure you understand how lengths are calculated. All FLAC metadata + * blocks have a 4 byte header which contains the type and length. This + * length does not include the 4 bytes of the header. See the format page + * for the specification of metadata blocks and their lengths. + * + * \note + * If you are writing the FLAC data to a file via callbacks, make sure it + * is open for update (e.g. mode "w+" for stdio streams). This is because + * after the first encoding pass, the encoder will try to seek back to the + * beginning of the stream, to the STREAMINFO block, to write some data + * there. (If using FLAC__stream_encoder_init*_file() or + * FLAC__stream_encoder_init*_FILE(), the file is managed internally.) + * + * \note + * The "set" functions may only be called when the encoder is in the + * state FLAC__STREAM_ENCODER_UNINITIALIZED, i.e. after + * FLAC__stream_encoder_new() or FLAC__stream_encoder_finish(), but + * before FLAC__stream_encoder_init_*(). If this is the case they will + * return \c true, otherwise \c false. + * + * \note + * FLAC__stream_encoder_finish() resets all settings to the constructor + * defaults. + * + * \{ + */ + + +/** State values for a FLAC__StreamEncoder. + * + * The encoder's state can be obtained by calling FLAC__stream_encoder_get_state(). + * + * If the encoder gets into any other state besides \c FLAC__STREAM_ENCODER_OK + * or \c FLAC__STREAM_ENCODER_UNINITIALIZED, it becomes invalid for encoding and + * must be deleted with FLAC__stream_encoder_delete(). + */ +typedef enum { + + FLAC__STREAM_ENCODER_OK = 0, + /**< The encoder is in the normal OK state and samples can be processed. */ + + FLAC__STREAM_ENCODER_UNINITIALIZED, + /**< The encoder is in the uninitialized state; one of the + * FLAC__stream_encoder_init_*() functions must be called before samples + * can be processed. + */ + + FLAC__STREAM_ENCODER_OGG_ERROR, + /**< An error occurred in the underlying Ogg layer. */ + + FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR, + /**< An error occurred in the underlying verify stream decoder; + * check FLAC__stream_encoder_get_verify_decoder_state(). + */ + + FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA, + /**< The verify decoder detected a mismatch between the original + * audio signal and the decoded audio signal. + */ + + FLAC__STREAM_ENCODER_CLIENT_ERROR, + /**< One of the callbacks returned a fatal error. */ + + FLAC__STREAM_ENCODER_IO_ERROR, + /**< An I/O error occurred while opening/reading/writing a file. + * Check \c errno. + */ + + FLAC__STREAM_ENCODER_FRAMING_ERROR, + /**< An error occurred while writing the stream; usually, the + * write_callback returned an error. + */ + + FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR + /**< Memory allocation failed. */ + +} FLAC__StreamEncoderState; + +/** Maps a FLAC__StreamEncoderState to a C string. + * + * Using a FLAC__StreamEncoderState as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderStateString[]; + + +/** Possible return values for the FLAC__stream_encoder_init_*() functions. + */ +typedef enum { + + FLAC__STREAM_ENCODER_INIT_STATUS_OK = 0, + /**< Initialization was successful. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR, + /**< General failure to set up encoder; call FLAC__stream_encoder_get_state() for cause. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_UNSUPPORTED_CONTAINER, + /**< The library was not compiled with support for the given container + * format. + */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_CALLBACKS, + /**< A required callback was not supplied. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_NUMBER_OF_CHANNELS, + /**< The encoder has an invalid setting for number of channels. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BITS_PER_SAMPLE, + /**< The encoder has an invalid setting for bits-per-sample. + * FLAC supports 4-32 bps but the reference encoder currently supports + * only up to 24 bps. + */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_SAMPLE_RATE, + /**< The encoder has an invalid setting for the input sample rate. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BLOCK_SIZE, + /**< The encoder has an invalid setting for the block size. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_MAX_LPC_ORDER, + /**< The encoder has an invalid setting for the maximum LPC order. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_QLP_COEFF_PRECISION, + /**< The encoder has an invalid setting for the precision of the quantized linear predictor coefficients. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_BLOCK_SIZE_TOO_SMALL_FOR_LPC_ORDER, + /**< The specified block size is less than the maximum LPC order. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE, + /**< The encoder is bound to the Subset but other settings violate it. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA, + /**< The metadata input to the encoder is invalid, in one of the following ways: + * - FLAC__stream_encoder_set_metadata() was called with a null pointer but a block count > 0 + * - One of the metadata blocks contains an undefined type + * - It contains an illegal CUESHEET as checked by FLAC__format_cuesheet_is_legal() + * - It contains an illegal SEEKTABLE as checked by FLAC__format_seektable_is_legal() + * - It contains more than one SEEKTABLE block or more than one VORBIS_COMMENT block + */ + + FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED + /**< FLAC__stream_encoder_init_*() was called when the encoder was + * already initialized, usually because + * FLAC__stream_encoder_finish() was not called. + */ + +} FLAC__StreamEncoderInitStatus; + +/** Maps a FLAC__StreamEncoderInitStatus to a C string. + * + * Using a FLAC__StreamEncoderInitStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderInitStatusString[]; + + +/** Return values for the FLAC__StreamEncoder read callback. + */ +typedef enum { + + FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE, + /**< The read was OK and decoding can continue. */ + + FLAC__STREAM_ENCODER_READ_STATUS_END_OF_STREAM, + /**< The read was attempted at the end of the stream. */ + + FLAC__STREAM_ENCODER_READ_STATUS_ABORT, + /**< An unrecoverable error occurred. */ + + FLAC__STREAM_ENCODER_READ_STATUS_UNSUPPORTED + /**< Client does not support reading back from the output. */ + +} FLAC__StreamEncoderReadStatus; + +/** Maps a FLAC__StreamEncoderReadStatus to a C string. + * + * Using a FLAC__StreamEncoderReadStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderReadStatusString[]; + + +/** Return values for the FLAC__StreamEncoder write callback. + */ +typedef enum { + + FLAC__STREAM_ENCODER_WRITE_STATUS_OK = 0, + /**< The write was OK and encoding can continue. */ + + FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR + /**< An unrecoverable error occurred. The encoder will return from the process call. */ + +} FLAC__StreamEncoderWriteStatus; + +/** Maps a FLAC__StreamEncoderWriteStatus to a C string. + * + * Using a FLAC__StreamEncoderWriteStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderWriteStatusString[]; + + +/** Return values for the FLAC__StreamEncoder seek callback. + */ +typedef enum { + + FLAC__STREAM_ENCODER_SEEK_STATUS_OK, + /**< The seek was OK and encoding can continue. */ + + FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR, + /**< An unrecoverable error occurred. */ + + FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED + /**< Client does not support seeking. */ + +} FLAC__StreamEncoderSeekStatus; + +/** Maps a FLAC__StreamEncoderSeekStatus to a C string. + * + * Using a FLAC__StreamEncoderSeekStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderSeekStatusString[]; + + +/** Return values for the FLAC__StreamEncoder tell callback. + */ +typedef enum { + + FLAC__STREAM_ENCODER_TELL_STATUS_OK, + /**< The tell was OK and encoding can continue. */ + + FLAC__STREAM_ENCODER_TELL_STATUS_ERROR, + /**< An unrecoverable error occurred. */ + + FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED + /**< Client does not support seeking. */ + +} FLAC__StreamEncoderTellStatus; + +/** Maps a FLAC__StreamEncoderTellStatus to a C string. + * + * Using a FLAC__StreamEncoderTellStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderTellStatusString[]; + + +/*********************************************************************** + * + * class FLAC__StreamEncoder + * + ***********************************************************************/ + +struct FLAC__StreamEncoderProtected; +struct FLAC__StreamEncoderPrivate; +/** The opaque structure definition for the stream encoder type. + * See the \link flac_stream_encoder stream encoder module \endlink + * for a detailed description. + */ +typedef struct { + struct FLAC__StreamEncoderProtected *protected_; /* avoid the C++ keyword 'protected' */ + struct FLAC__StreamEncoderPrivate *private_; /* avoid the C++ keyword 'private' */ +} FLAC__StreamEncoder; + +/** Signature for the read callback. + * + * A function pointer matching this signature must be passed to + * FLAC__stream_encoder_init_ogg_stream() if seeking is supported. + * The supplied function will be called when the encoder needs to read back + * encoded data. This happens during the metadata callback, when the encoder + * has to read, modify, and rewrite the metadata (e.g. seekpoints) gathered + * while encoding. The address of the buffer to be filled is supplied, along + * with the number of bytes the buffer can hold. The callback may choose to + * supply less data and modify the byte count but must be careful not to + * overflow the buffer. The callback then returns a status code chosen from + * FLAC__StreamEncoderReadStatus. + * + * Here is an example of a read callback for stdio streams: + * \code + * FLAC__StreamEncoderReadStatus read_cb(const FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * if(*bytes > 0) { + * *bytes = fread(buffer, sizeof(FLAC__byte), *bytes, file); + * if(ferror(file)) + * return FLAC__STREAM_ENCODER_READ_STATUS_ABORT; + * else if(*bytes == 0) + * return FLAC__STREAM_ENCODER_READ_STATUS_END_OF_STREAM; + * else + * return FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE; + * } + * else + * return FLAC__STREAM_ENCODER_READ_STATUS_ABORT; + * } + * \endcode + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param buffer A pointer to a location for the callee to store + * data to be encoded. + * \param bytes A pointer to the size of the buffer. On entry + * to the callback, it contains the maximum number + * of bytes that may be stored in \a buffer. The + * callee must set it to the actual number of bytes + * stored (0 in case of error or end-of-stream) before + * returning. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_set_client_data(). + * \retval FLAC__StreamEncoderReadStatus + * The callee's return status. + */ +typedef FLAC__StreamEncoderReadStatus (*FLAC__StreamEncoderReadCallback)(const FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data); + +/** Signature for the write callback. + * + * A function pointer matching this signature must be passed to + * FLAC__stream_encoder_init*_stream(). The supplied function will be called + * by the encoder anytime there is raw encoded data ready to write. It may + * include metadata mixed with encoded audio frames and the data is not + * guaranteed to be aligned on frame or metadata block boundaries. + * + * The only duty of the callback is to write out the \a bytes worth of data + * in \a buffer to the current position in the output stream. The arguments + * \a samples and \a current_frame are purely informational. If \a samples + * is greater than \c 0, then \a current_frame will hold the current frame + * number that is being written; otherwise it indicates that the write + * callback is being called to write metadata. + * + * \note + * Unlike when writing to native FLAC, when writing to Ogg FLAC the + * write callback will be called twice when writing each audio + * frame; once for the page header, and once for the page body. + * When writing the page header, the \a samples argument to the + * write callback will be \c 0. + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param buffer An array of encoded data of length \a bytes. + * \param bytes The byte length of \a buffer. + * \param samples The number of samples encoded by \a buffer. + * \c 0 has a special meaning; see above. + * \param current_frame The number of the current frame being encoded. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + * \retval FLAC__StreamEncoderWriteStatus + * The callee's return status. + */ +typedef FLAC__StreamEncoderWriteStatus (*FLAC__StreamEncoderWriteCallback)(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data); + +/** Signature for the seek callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_encoder_init*_stream(). The supplied function will be called + * when the encoder needs to seek the output stream. The encoder will pass + * the absolute byte offset to seek to, 0 meaning the beginning of the stream. + * + * Here is an example of a seek callback for stdio streams: + * \code + * FLAC__StreamEncoderSeekStatus seek_cb(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * if(file == stdin) + * return FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED; + * else if(fseeko(file, (off_t)absolute_byte_offset, SEEK_SET) < 0) + * return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR; + * else + * return FLAC__STREAM_ENCODER_SEEK_STATUS_OK; + * } + * \endcode + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param absolute_byte_offset The offset from the beginning of the stream + * to seek to. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + * \retval FLAC__StreamEncoderSeekStatus + * The callee's return status. + */ +typedef FLAC__StreamEncoderSeekStatus (*FLAC__StreamEncoderSeekCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data); + +/** Signature for the tell callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_encoder_init*_stream(). The supplied function will be called + * when the encoder needs to know the current position of the output stream. + * + * \warning + * The callback must return the true current byte offset of the output to + * which the encoder is writing. If you are buffering the output, make + * sure and take this into account. If you are writing directly to a + * FILE* from your write callback, ftell() is sufficient. If you are + * writing directly to a file descriptor from your write callback, you + * can use lseek(fd, SEEK_CUR, 0). The encoder may later seek back to + * these points to rewrite metadata after encoding. + * + * Here is an example of a tell callback for stdio streams: + * \code + * FLAC__StreamEncoderTellStatus tell_cb(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * off_t pos; + * if(file == stdin) + * return FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED; + * else if((pos = ftello(file)) < 0) + * return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR; + * else { + * *absolute_byte_offset = (FLAC__uint64)pos; + * return FLAC__STREAM_ENCODER_TELL_STATUS_OK; + * } + * } + * \endcode + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param absolute_byte_offset The address at which to store the current + * position of the output. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + * \retval FLAC__StreamEncoderTellStatus + * The callee's return status. + */ +typedef FLAC__StreamEncoderTellStatus (*FLAC__StreamEncoderTellCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data); + +/** Signature for the metadata callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_encoder_init*_stream(). The supplied function will be called + * once at the end of encoding with the populated STREAMINFO structure. This + * is so the client can seek back to the beginning of the file and write the + * STREAMINFO block with the correct statistics after encoding (like + * minimum/maximum frame size and total samples). + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param metadata The final populated STREAMINFO block. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + */ +typedef void (*FLAC__StreamEncoderMetadataCallback)(const FLAC__StreamEncoder *encoder, const FLAC__StreamMetadata *metadata, void *client_data); + +/** Signature for the progress callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_encoder_init*_file() or FLAC__stream_encoder_init*_FILE(). + * The supplied function will be called when the encoder has finished + * writing a frame. The \c total_frames_estimate argument to the + * callback will be based on the value from + * FLAC__stream_encoder_set_total_samples_estimate(). + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param bytes_written Bytes written so far. + * \param samples_written Samples written so far. + * \param frames_written Frames written so far. + * \param total_frames_estimate The estimate of the total number of + * frames to be written. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + */ +typedef void (*FLAC__StreamEncoderProgressCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data); + + +/*********************************************************************** + * + * Class constructor/destructor + * + ***********************************************************************/ + +/** Create a new stream encoder instance. The instance is created with + * default settings; see the individual FLAC__stream_encoder_set_*() + * functions for each setting's default. + * + * \retval FLAC__StreamEncoder* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamEncoder *FLAC__stream_encoder_new(void); + +/** Free an encoder instance. Deletes the object pointed to by \a encoder. + * + * \param encoder A pointer to an existing encoder. + * \assert + * \code encoder != NULL \endcode + */ +FLAC_API void FLAC__stream_encoder_delete(FLAC__StreamEncoder *encoder); + + +/*********************************************************************** + * + * Public class method prototypes + * + ***********************************************************************/ + +/** Set the serial number for the FLAC stream to use in the Ogg container. + * + * \note + * This does not need to be set for native FLAC encoding. + * + * \note + * It is recommended to set a serial number explicitly as the default of '0' + * may collide with other streams. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param serial_number See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_ogg_serial_number(FLAC__StreamEncoder *encoder, long serial_number); + +/** Set the "verify" flag. If \c true, the encoder will verify it's own + * encoded output by feeding it through an internal decoder and comparing + * the original signal against the decoded signal. If a mismatch occurs, + * the process call will return \c false. Note that this will slow the + * encoding process by the extra time required for decoding and comparison. + * + * \default \c false + * \param encoder An encoder instance to set. + * \param value Flag value (see above). + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_verify(FLAC__StreamEncoder *encoder, FLAC__bool value); + +/** Set the Subset flag. If \c true, + * the encoder will comply with the Subset and will check the + * settings during FLAC__stream_encoder_init_*() to see if all settings + * comply. If \c false, the settings may take advantage of the full + * range that the format allows. + * + * Make sure you know what it entails before setting this to \c false. + * + * \default \c true + * \param encoder An encoder instance to set. + * \param value Flag value (see above). + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_streamable_subset(FLAC__StreamEncoder *encoder, FLAC__bool value); + +/** Set the number of channels to be encoded. + * + * \default \c 2 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_channels(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the sample resolution of the input to be encoded. + * + * \warning + * Do not feed the encoder data that is wider than the value you + * set here or you will generate an invalid stream. + * + * \default \c 16 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_bits_per_sample(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the sample rate (in Hz) of the input to be encoded. + * + * \default \c 44100 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the compression level + * + * The compression level is roughly proportional to the amount of effort + * the encoder expends to compress the file. A higher level usually + * means more computation but higher compression. The default level is + * suitable for most applications. + * + * Currently the levels range from \c 0 (fastest, least compression) to + * \c 8 (slowest, most compression). A value larger than \c 8 will be + * treated as \c 8. + * + * This function automatically calls the following other \c _set_ + * functions with appropriate values, so the client does not need to + * unless it specifically wants to override them: + * - FLAC__stream_encoder_set_do_mid_side_stereo() + * - FLAC__stream_encoder_set_loose_mid_side_stereo() + * - FLAC__stream_encoder_set_apodization() + * - FLAC__stream_encoder_set_max_lpc_order() + * - FLAC__stream_encoder_set_qlp_coeff_precision() + * - FLAC__stream_encoder_set_do_qlp_coeff_prec_search() + * - FLAC__stream_encoder_set_do_escape_coding() + * - FLAC__stream_encoder_set_do_exhaustive_model_search() + * - FLAC__stream_encoder_set_min_residual_partition_order() + * - FLAC__stream_encoder_set_max_residual_partition_order() + * - FLAC__stream_encoder_set_rice_parameter_search_dist() + * + * The actual values set for each level are: + * + * + * + * + * + * + * + * + * + * + * + * + *
level + * do mid-side stereo + * loose mid-side stereo + * apodization + * max lpc order + * qlp coeff precision + * qlp coeff prec search + * escape coding + * exhaustive model search + * min residual partition order + * max residual partition order + * rice parameter search dist + *
0 false false tukey(0.5) 0 0 false false false 0 3 0
1 true true tukey(0.5) 0 0 false false false 0 3 0
2 true false tukey(0.5) 0 0 false false false 0 3 0
3 false false tukey(0.5) 6 0 false false false 0 4 0
4 true true tukey(0.5) 8 0 false false false 0 4 0
5 true false tukey(0.5) 8 0 false false false 0 5 0
6 true false tukey(0.5) 8 0 false false false 0 6 0
7 true false tukey(0.5) 8 0 false false true 0 6 0
8 true false tukey(0.5) 12 0 false false true 0 6 0
+ * + * \default \c 5 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_compression_level(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the blocksize to use while encoding. + * + * The number of samples to use per frame. Use \c 0 to let the encoder + * estimate a blocksize; this is usually best. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_blocksize(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set to \c true to enable mid-side encoding on stereo input. The + * number of channels must be 2 for this to have any effect. Set to + * \c false to use only independent channel coding. + * + * \default \c false + * \param encoder An encoder instance to set. + * \param value Flag value (see above). + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_do_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value); + +/** Set to \c true to enable adaptive switching between mid-side and + * left-right encoding on stereo input. Set to \c false to use + * exhaustive searching. Setting this to \c true requires + * FLAC__stream_encoder_set_do_mid_side_stereo() to also be set to + * \c true in order to have any effect. + * + * \default \c false + * \param encoder An encoder instance to set. + * \param value Flag value (see above). + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_loose_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value); + +/** Sets the apodization function(s) the encoder will use when windowing + * audio data for LPC analysis. + * + * The \a specification is a plain ASCII string which specifies exactly + * which functions to use. There may be more than one (up to 32), + * separated by \c ';' characters. Some functions take one or more + * comma-separated arguments in parentheses. + * + * The available functions are \c bartlett, \c bartlett_hann, + * \c blackman, \c blackman_harris_4term_92db, \c connes, \c flattop, + * \c gauss(STDDEV), \c hamming, \c hann, \c kaiser_bessel, \c nuttall, + * \c rectangle, \c triangle, \c tukey(P), \c welch. + * + * For \c gauss(STDDEV), STDDEV specifies the standard deviation + * (0blocksize / (2 ^ order). + * + * Set both min and max values to \c 0 to force a single context, + * whose Rice parameter is based on the residual signal variance. + * Otherwise, set a min and max order, and the encoder will search + * all orders, using the mean of each context for its Rice parameter, + * and use the best. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_min_residual_partition_order(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the maximum partition order to search when coding the residual. + * This is used in tandem with + * FLAC__stream_encoder_set_min_residual_partition_order(). + * + * The partition order determines the context size in the residual. + * The context size will be approximately blocksize / (2 ^ order). + * + * Set both min and max values to \c 0 to force a single context, + * whose Rice parameter is based on the residual signal variance. + * Otherwise, set a min and max order, and the encoder will search + * all orders, using the mean of each context for its Rice parameter, + * and use the best. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_max_residual_partition_order(FLAC__StreamEncoder *encoder, unsigned value); + +/** Deprecated. Setting this value has no effect. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_rice_parameter_search_dist(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set an estimate of the total samples that will be encoded. + * This is merely an estimate and may be set to \c 0 if unknown. + * This value will be written to the STREAMINFO block before encoding, + * and can remove the need for the caller to rewrite the value later + * if the value is known before encoding. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_total_samples_estimate(FLAC__StreamEncoder *encoder, FLAC__uint64 value); + +/** Set the metadata blocks to be emitted to the stream before encoding. + * A value of \c NULL, \c 0 implies no metadata; otherwise, supply an + * array of pointers to metadata blocks. The array is non-const since + * the encoder may need to change the \a is_last flag inside them, and + * in some cases update seek point offsets. Otherwise, the encoder will + * not modify or free the blocks. It is up to the caller to free the + * metadata blocks after encoding finishes. + * + * \note + * The encoder stores only copies of the pointers in the \a metadata array; + * the metadata blocks themselves must survive at least until after + * FLAC__stream_encoder_finish() returns. Do not free the blocks until then. + * + * \note + * The STREAMINFO block is always written and no STREAMINFO block may + * occur in the supplied array. + * + * \note + * By default the encoder does not create a SEEKTABLE. If one is supplied + * in the \a metadata array, but the client has specified that it does not + * support seeking, then the SEEKTABLE will be written verbatim. However + * by itself this is not very useful as the client will not know the stream + * offsets for the seekpoints ahead of time. In order to get a proper + * seektable the client must support seeking. See next note. + * + * \note + * SEEKTABLE blocks are handled specially. Since you will not know + * the values for the seek point stream offsets, you should pass in + * a SEEKTABLE 'template', that is, a SEEKTABLE object with the + * required sample numbers (or placeholder points), with \c 0 for the + * \a frame_samples and \a stream_offset fields for each point. If the + * client has specified that it supports seeking by providing a seek + * callback to FLAC__stream_encoder_init_stream() or both seek AND read + * callback to FLAC__stream_encoder_init_ogg_stream() (or by using + * FLAC__stream_encoder_init*_file() or FLAC__stream_encoder_init*_FILE()), + * then while it is encoding the encoder will fill the stream offsets in + * for you and when encoding is finished, it will seek back and write the + * real values into the SEEKTABLE block in the stream. There are helper + * routines for manipulating seektable template blocks; see metadata.h: + * FLAC__metadata_object_seektable_template_*(). If the client does + * not support seeking, the SEEKTABLE will have inaccurate offsets which + * will slow down or remove the ability to seek in the FLAC stream. + * + * \note + * The encoder instance \b will modify the first \c SEEKTABLE block + * as it transforms the template to a valid seektable while encoding, + * but it is still up to the caller to free all metadata blocks after + * encoding. + * + * \note + * A VORBIS_COMMENT block may be supplied. The vendor string in it + * will be ignored. libFLAC will use it's own vendor string. libFLAC + * will not modify the passed-in VORBIS_COMMENT's vendor string, it + * will simply write it's own into the stream. If no VORBIS_COMMENT + * block is present in the \a metadata array, libFLAC will write an + * empty one, containing only the vendor string. + * + * \note The Ogg FLAC mapping requires that the VORBIS_COMMENT block be + * the second metadata block of the stream. The encoder already supplies + * the STREAMINFO block automatically. If \a metadata does not contain a + * VORBIS_COMMENT block, the encoder will supply that too. Otherwise, if + * \a metadata does contain a VORBIS_COMMENT block and it is not the + * first, the init function will reorder \a metadata by moving the + * VORBIS_COMMENT block to the front; the relative ordering of the other + * blocks will remain as they were. + * + * \note The Ogg FLAC mapping limits the number of metadata blocks per + * stream to \c 65535. If \a num_blocks exceeds this the function will + * return \c false. + * + * \default \c NULL, 0 + * \param encoder An encoder instance to set. + * \param metadata See above. + * \param num_blocks See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + * \c false if the encoder is already initialized, or if + * \a num_blocks > 65535 if encoding to Ogg FLAC, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_metadata(FLAC__StreamEncoder *encoder, FLAC__StreamMetadata **metadata, unsigned num_blocks); + +/** Get the current encoder state. + * + * \param encoder An encoder instance to query. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__StreamEncoderState + * The current encoder state. + */ +FLAC_API FLAC__StreamEncoderState FLAC__stream_encoder_get_state(const FLAC__StreamEncoder *encoder); + +/** Get the state of the verify stream decoder. + * Useful when the stream encoder state is + * \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR. + * + * \param encoder An encoder instance to query. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__StreamDecoderState + * The verify stream decoder state. + */ +FLAC_API FLAC__StreamDecoderState FLAC__stream_encoder_get_verify_decoder_state(const FLAC__StreamEncoder *encoder); + +/** Get the current encoder state as a C string. + * This version automatically resolves + * \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR by getting the + * verify decoder's state. + * + * \param encoder A encoder instance to query. + * \assert + * \code encoder != NULL \endcode + * \retval const char * + * The encoder state as a C string. Do not modify the contents. + */ +FLAC_API const char *FLAC__stream_encoder_get_resolved_state_string(const FLAC__StreamEncoder *encoder); + +/** Get relevant values about the nature of a verify decoder error. + * Useful when the stream encoder state is + * \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR. The arguments should + * be addresses in which the stats will be returned, or NULL if value + * is not desired. + * + * \param encoder An encoder instance to query. + * \param absolute_sample The absolute sample number of the mismatch. + * \param frame_number The number of the frame in which the mismatch occurred. + * \param channel The channel in which the mismatch occurred. + * \param sample The number of the sample (relative to the frame) in + * which the mismatch occurred. + * \param expected The expected value for the sample in question. + * \param got The actual value returned by the decoder. + * \assert + * \code encoder != NULL \endcode + */ +FLAC_API void FLAC__stream_encoder_get_verify_decoder_error_stats(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got); + +/** Get the "verify" flag. + * + * \param encoder An encoder instance to query. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * See FLAC__stream_encoder_set_verify(). + */ +FLAC_API FLAC__bool FLAC__stream_encoder_get_verify(const FLAC__StreamEncoder *encoder); + +/** Get the frame header. + * + * \param encoder An initialized encoder instance in the OK state. + * \param buffer An array of pointers to each channel's signal. + * \param samples The number of samples in one channel. + * \assert + * \code encoder != NULL \endcode + * \code FLAC__stream_encoder_get_state(encoder) == FLAC__STREAM_ENCODER_OK \endcode + * \retval FLAC__bool + * \c true if successful, else \c false; in this case, check the + * encoder state with FLAC__stream_encoder_get_state() to see what + * went wrong. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples); + +/** Submit data for encoding. + * This version allows you to supply the input data where the channels + * are interleaved into a single array (i.e. channel0_sample0, + * channel1_sample0, ... , channelN_sample0, channel0_sample1, ...). + * The samples need not be block-aligned but they must be + * sample-aligned, i.e. the first value should be channel0_sample0 + * and the last value channelN_sampleM. Each sample should be a signed + * integer, right-justified to the resolution set by + * FLAC__stream_encoder_set_bits_per_sample(). For example, if the + * resolution is 16 bits per sample, the samples should all be in the + * range [-32768,32767]. + * + * For applications where channel order is important, channels must + * follow the order as described in the + * frame header. + * + * \param encoder An initialized encoder instance in the OK state. + * \param buffer An array of channel-interleaved data (see above). + * \param samples The number of samples in one channel, the same as for + * FLAC__stream_encoder_process(). For example, if + * encoding two channels, \c 1000 \a samples corresponds + * to a \a buffer of 2000 values. + * \assert + * \code encoder != NULL \endcode + * \code FLAC__stream_encoder_get_state(encoder) == FLAC__STREAM_ENCODER_OK \endcode + * \retval FLAC__bool + * \c true if successful, else \c false; in this case, check the + * encoder state with FLAC__stream_encoder_get_state() to see what + * went wrong. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder *encoder, const FLAC__int32 buffer[], unsigned samples); + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Resources/Info.plist b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..10be6df Binary files /dev/null and b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/A/Resources/Info.plist differ diff --git a/Audio-Frameworks/bin/flac/FLAC.framework/Versions/Current b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/FLAC b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/FLAC new file mode 120000 index 0000000..c29cdc3 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/FLAC @@ -0,0 +1 @@ +Versions/Current/FLAC \ No newline at end of file diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Headers b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Resources b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/FLAC b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/FLAC new file mode 100755 index 0000000..bea4a6e Binary files /dev/null and b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/FLAC differ diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/all.h b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/all.h new file mode 100644 index 0000000..c542c0d --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/all.h @@ -0,0 +1,370 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__ALL_H +#define FLAC__ALL_H + +#include "export.h" + +#include "assert.h" +#include "callback.h" +#include "format.h" +#include "metadata.h" +#include "ordinals.h" +#include "stream_decoder.h" +#include "stream_encoder.h" + +/** \mainpage + * + * \section intro Introduction + * + * This is the documentation for the FLAC C and C++ APIs. It is + * highly interconnected; this introduction should give you a top + * level idea of the structure and how to find the information you + * need. As a prerequisite you should have at least a basic + * knowledge of the FLAC format, documented + * here. + * + * \section c_api FLAC C API + * + * The FLAC C API is the interface to libFLAC, a set of structures + * describing the components of FLAC streams, and functions for + * encoding and decoding streams, as well as manipulating FLAC + * metadata in files. The public include files will be installed + * in your include area (for example /usr/include/FLAC/...). + * + * By writing a little code and linking against libFLAC, it is + * relatively easy to add FLAC support to another program. The + * library is licensed under Xiph's BSD license. + * Complete source code of libFLAC as well as the command-line + * encoder and plugins is available and is a useful source of + * examples. + * + * Aside from encoders and decoders, libFLAC provides a powerful + * metadata interface for manipulating metadata in FLAC files. It + * allows the user to add, delete, and modify FLAC metadata blocks + * and it can automatically take advantage of PADDING blocks to avoid + * rewriting the entire FLAC file when changing the size of the + * metadata. + * + * libFLAC usually only requires the standard C library and C math + * library. In particular, threading is not used so there is no + * dependency on a thread library. However, libFLAC does not use + * global variables and should be thread-safe. + * + * libFLAC also supports encoding to and decoding from Ogg FLAC. + * However the metadata editing interfaces currently have limited + * read-only support for Ogg FLAC files. + * + * \section cpp_api FLAC C++ API + * + * The FLAC C++ API is a set of classes that encapsulate the + * structures and functions in libFLAC. They provide slightly more + * functionality with respect to metadata but are otherwise + * equivalent. For the most part, they share the same usage as + * their counterparts in libFLAC, and the FLAC C API documentation + * can be used as a supplement. The public include files + * for the C++ API will be installed in your include area (for + * example /usr/include/FLAC++/...). + * + * libFLAC++ is also licensed under + * Xiph's BSD license. + * + * \section getting_started Getting Started + * + * A good starting point for learning the API is to browse through + * the modules. Modules are logical + * groupings of related functions or classes, which correspond roughly + * to header files or sections of header files. Each module includes a + * detailed description of the general usage of its functions or + * classes. + * + * From there you can go on to look at the documentation of + * individual functions. You can see different views of the individual + * functions through the links in top bar across this page. + * + * If you prefer a more hands-on approach, you can jump right to some + * example code. + * + * \section porting_guide Porting Guide + * + * Starting with FLAC 1.1.3 a \link porting Porting Guide \endlink + * has been introduced which gives detailed instructions on how to + * port your code to newer versions of FLAC. + * + * \section embedded_developers Embedded Developers + * + * libFLAC has grown larger over time as more functionality has been + * included, but much of it may be unnecessary for a particular embedded + * implementation. Unused parts may be pruned by some simple editing of + * src/libFLAC/Makefile.am. In general, the decoders, encoders, and + * metadata interface are all independent from each other. + * + * It is easiest to just describe the dependencies: + * + * - All modules depend on the \link flac_format Format \endlink module. + * - The decoders and encoders depend on the bitbuffer. + * - The decoder is independent of the encoder. The encoder uses the + * decoder because of the verify feature, but this can be removed if + * not needed. + * - Parts of the metadata interface require the stream decoder (but not + * the encoder). + * - Ogg support is selectable through the compile time macro + * \c FLAC__HAS_OGG. + * + * For example, if your application only requires the stream decoder, no + * encoder, and no metadata interface, you can remove the stream encoder + * and the metadata interface, which will greatly reduce the size of the + * library. + * + * Also, there are several places in the libFLAC code with comments marked + * with "OPT:" where a #define can be changed to enable code that might be + * faster on a specific platform. Experimenting with these can yield faster + * binaries. + */ + +/** \defgroup porting Porting Guide for New Versions + * + * This module describes differences in the library interfaces from + * version to version. It assists in the porting of code that uses + * the libraries to newer versions of FLAC. + * + * One simple facility for making porting easier that has been added + * in FLAC 1.1.3 is a set of \c #defines in \c export.h of each + * library's includes (e.g. \c include/FLAC/export.h). The + * \c #defines mirror the libraries' + * libtool version numbers, + * e.g. in libFLAC there are \c FLAC_API_VERSION_CURRENT, + * \c FLAC_API_VERSION_REVISION, and \c FLAC_API_VERSION_AGE. + * These can be used to support multiple versions of an API during the + * transition phase, e.g. + * + * \code + * #if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7 + * legacy code + * #else + * new code + * #endif + * \endcode + * + * The the source will work for multiple versions and the legacy code can + * easily be removed when the transition is complete. + * + * Another available symbol is FLAC_API_SUPPORTS_OGG_FLAC (defined in + * include/FLAC/export.h), which can be used to determine whether or not + * the library has been compiled with support for Ogg FLAC. This is + * simpler than trying to call an Ogg init function and catching the + * error. + */ + +/** \defgroup porting_1_1_2_to_1_1_3 Porting from FLAC 1.1.2 to 1.1.3 + * \ingroup porting + * + * \brief + * This module describes porting from FLAC 1.1.2 to FLAC 1.1.3. + * + * The main change between the APIs in 1.1.2 and 1.1.3 is that they have + * been simplified. First, libOggFLAC has been merged into libFLAC and + * libOggFLAC++ has been merged into libFLAC++. Second, both the three + * decoding layers and three encoding layers have been merged into a + * single stream decoder and stream encoder. That is, the functionality + * of FLAC__SeekableStreamDecoder and FLAC__FileDecoder has been merged + * into FLAC__StreamDecoder, and FLAC__SeekableStreamEncoder and + * FLAC__FileEncoder into FLAC__StreamEncoder. Only the + * FLAC__StreamDecoder and FLAC__StreamEncoder remain. What this means + * is there is now a single API that can be used to encode or decode + * streams to/from native FLAC or Ogg FLAC and the single API can work + * on both seekable and non-seekable streams. + * + * Instead of creating an encoder or decoder of a certain layer, now the + * client will always create a FLAC__StreamEncoder or + * FLAC__StreamDecoder. The old layers are now differentiated by the + * initialization function. For example, for the decoder, + * FLAC__stream_decoder_init() has been replaced by + * FLAC__stream_decoder_init_stream(). This init function takes + * callbacks for the I/O, and the seeking callbacks are optional. This + * allows the client to use the same object for seekable and + * non-seekable streams. For decoding a FLAC file directly, the client + * can use FLAC__stream_decoder_init_file() and pass just a filename + * and fewer callbacks; most of the other callbacks are supplied + * internally. For situations where fopen()ing by filename is not + * possible (e.g. Unicode filenames on Windows) the client can instead + * open the file itself and supply the FILE* to + * FLAC__stream_decoder_init_FILE(). The init functions now returns a + * FLAC__StreamDecoderInitStatus instead of FLAC__StreamDecoderState. + * Since the callbacks and client data are now passed to the init + * function, the FLAC__stream_decoder_set_*_callback() functions and + * FLAC__stream_decoder_set_client_data() are no longer needed. The + * rest of the calls to the decoder are the same as before. + * + * There are counterpart init functions for Ogg FLAC, e.g. + * FLAC__stream_decoder_init_ogg_stream(). All the rest of the calls + * and callbacks are the same as for native FLAC. + * + * As an example, in FLAC 1.1.2 a seekable stream decoder would have + * been set up like so: + * + * \code + * FLAC__SeekableStreamDecoder *decoder = FLAC__seekable_stream_decoder_new(); + * if(decoder == NULL) do_something; + * FLAC__seekable_stream_decoder_set_md5_checking(decoder, true); + * [... other settings ...] + * FLAC__seekable_stream_decoder_set_read_callback(decoder, my_read_callback); + * FLAC__seekable_stream_decoder_set_seek_callback(decoder, my_seek_callback); + * FLAC__seekable_stream_decoder_set_tell_callback(decoder, my_tell_callback); + * FLAC__seekable_stream_decoder_set_length_callback(decoder, my_length_callback); + * FLAC__seekable_stream_decoder_set_eof_callback(decoder, my_eof_callback); + * FLAC__seekable_stream_decoder_set_write_callback(decoder, my_write_callback); + * FLAC__seekable_stream_decoder_set_metadata_callback(decoder, my_metadata_callback); + * FLAC__seekable_stream_decoder_set_error_callback(decoder, my_error_callback); + * FLAC__seekable_stream_decoder_set_client_data(decoder, my_client_data); + * if(FLAC__seekable_stream_decoder_init(decoder) != FLAC__SEEKABLE_STREAM_DECODER_OK) do_something; + * \endcode + * + * In FLAC 1.1.3 it is like this: + * + * \code + * FLAC__StreamDecoder *decoder = FLAC__stream_decoder_new(); + * if(decoder == NULL) do_something; + * FLAC__stream_decoder_set_md5_checking(decoder, true); + * [... other settings ...] + * if(FLAC__stream_decoder_init_stream( + * decoder, + * my_read_callback, + * my_seek_callback, // or NULL + * my_tell_callback, // or NULL + * my_length_callback, // or NULL + * my_eof_callback, // or NULL + * my_write_callback, + * my_metadata_callback, // or NULL + * my_error_callback, + * my_client_data + * ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something; + * \endcode + * + * or you could do; + * + * \code + * [...] + * FILE *file = fopen("somefile.flac","rb"); + * if(file == NULL) do_somthing; + * if(FLAC__stream_decoder_init_FILE( + * decoder, + * file, + * my_write_callback, + * my_metadata_callback, // or NULL + * my_error_callback, + * my_client_data + * ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something; + * \endcode + * + * or just: + * + * \code + * [...] + * if(FLAC__stream_decoder_init_file( + * decoder, + * "somefile.flac", + * my_write_callback, + * my_metadata_callback, // or NULL + * my_error_callback, + * my_client_data + * ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something; + * \endcode + * + * Another small change to the decoder is in how it handles unparseable + * streams. Before, when the decoder found an unparseable stream + * (reserved for when the decoder encounters a stream from a future + * encoder that it can't parse), it changed the state to + * \c FLAC__STREAM_DECODER_UNPARSEABLE_STREAM. Now the decoder instead + * drops sync and calls the error callback with a new error code + * \c FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM. This is + * more robust. If your error callback does not discriminate on the the + * error state, your code does not need to be changed. + * + * The encoder now has a new setting: + * FLAC__stream_encoder_set_apodization(). This is for setting the + * method used to window the data before LPC analysis. You only need to + * add a call to this function if the default is not suitable. There + * are also two new convenience functions that may be useful: + * FLAC__metadata_object_cuesheet_calculate_cddb_id() and + * FLAC__metadata_get_cuesheet(). + * + * The \a bytes parameter to FLAC__StreamDecoderReadCallback, + * FLAC__StreamEncoderReadCallback, and FLAC__StreamEncoderWriteCallback + * is now \c size_t instead of \c unsigned. + */ + +/** \defgroup porting_1_1_3_to_1_1_4 Porting from FLAC 1.1.3 to 1.1.4 + * \ingroup porting + * + * \brief + * This module describes porting from FLAC 1.1.3 to FLAC 1.1.4. + * + * There were no changes to any of the interfaces from 1.1.3 to 1.1.4. + * There was a slight change in the implementation of + * FLAC__stream_encoder_set_metadata(); the function now makes a copy + * of the \a metadata array of pointers so the client no longer needs + * to maintain it after the call. The objects themselves that are + * pointed to by the array are still not copied though and must be + * maintained until the call to FLAC__stream_encoder_finish(). + */ + +/** \defgroup porting_1_1_4_to_1_2_0 Porting from FLAC 1.1.4 to 1.2.0 + * \ingroup porting + * + * \brief + * This module describes porting from FLAC 1.1.4 to FLAC 1.2.0. + * + * There were only very minor changes to the interfaces from 1.1.4 to 1.2.0. + * In libFLAC, \c FLAC__format_sample_rate_is_subset() was added. + * In libFLAC++, \c FLAC::Decoder::Stream::get_decode_position() was added. + * + * Finally, value of the constant \c FLAC__FRAME_HEADER_RESERVED_LEN + * has changed to reflect the conversion of one of the reserved bits + * into active use. It used to be \c 2 and now is \c 1. However the + * FLAC frame header length has not changed, so to skip the proper + * number of bits, use \c FLAC__FRAME_HEADER_RESERVED_LEN + + * \c FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN + */ + +/** \defgroup flac FLAC C API + * + * The FLAC C API is the interface to libFLAC, a set of structures + * describing the components of FLAC streams, and functions for + * encoding and decoding streams, as well as manipulating FLAC + * metadata in files. + * + * You should start with the format components as all other modules + * are dependent on it. + */ + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/assert.h b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/assert.h new file mode 100644 index 0000000..3fc03f3 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/assert.h @@ -0,0 +1,45 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__ASSERT_H +#define FLAC__ASSERT_H + +/* we need this since some compilers (like MSVC) leave assert()s on release code (and we don't want to use their ASSERT) */ +#ifdef DEBUG +#include +#define FLAC__ASSERT(x) assert(x) +#define FLAC__ASSERT_DECLARATION(x) x +#else +#define FLAC__ASSERT(x) +#define FLAC__ASSERT_DECLARATION(x) +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/callback.h b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/callback.h new file mode 100644 index 0000000..c954121 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/callback.h @@ -0,0 +1,184 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__CALLBACK_H +#define FLAC__CALLBACK_H + +#include "ordinals.h" +#include /* for size_t */ + +/** \file include/FLAC/callback.h + * + * \brief + * This module defines the structures for describing I/O callbacks + * to the other FLAC interfaces. + * + * See the detailed documentation for callbacks in the + * \link flac_callbacks callbacks \endlink module. + */ + +/** \defgroup flac_callbacks FLAC/callback.h: I/O callback structures + * \ingroup flac + * + * \brief + * This module defines the structures for describing I/O callbacks + * to the other FLAC interfaces. + * + * The purpose of the I/O callback functions is to create a common way + * for the metadata interfaces to handle I/O. + * + * Originally the metadata interfaces required filenames as the way of + * specifying FLAC files to operate on. This is problematic in some + * environments so there is an additional option to specify a set of + * callbacks for doing I/O on the FLAC file, instead of the filename. + * + * In addition to the callbacks, a FLAC__IOHandle type is defined as an + * opaque structure for a data source. + * + * The callback function prototypes are similar (but not identical) to the + * stdio functions fread, fwrite, fseek, ftell, feof, and fclose. If you use + * stdio streams to implement the callbacks, you can pass fread, fwrite, and + * fclose anywhere a FLAC__IOCallback_Read, FLAC__IOCallback_Write, or + * FLAC__IOCallback_Close is required, and a FILE* anywhere a FLAC__IOHandle + * is required. \warning You generally CANNOT directly use fseek or ftell + * for FLAC__IOCallback_Seek or FLAC__IOCallback_Tell since on most systems + * these use 32-bit offsets and FLAC requires 64-bit offsets to deal with + * large files. You will have to find an equivalent function (e.g. ftello), + * or write a wrapper. The same is true for feof() since this is usually + * implemented as a macro, not as a function whose address can be taken. + * + * \{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the opaque handle type used by the callbacks. Typically + * this is a \c FILE* or address of a file descriptor. + */ +typedef void* FLAC__IOHandle; + +/** Signature for the read callback. + * The signature and semantics match POSIX fread() implementations + * and can generally be used interchangeably. + * + * \param ptr The address of the read buffer. + * \param size The size of the records to be read. + * \param nmemb The number of records to be read. + * \param handle The handle to the data source. + * \retval size_t + * The number of records read. + */ +typedef size_t (*FLAC__IOCallback_Read) (void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle); + +/** Signature for the write callback. + * The signature and semantics match POSIX fwrite() implementations + * and can generally be used interchangeably. + * + * \param ptr The address of the write buffer. + * \param size The size of the records to be written. + * \param nmemb The number of records to be written. + * \param handle The handle to the data source. + * \retval size_t + * The number of records written. + */ +typedef size_t (*FLAC__IOCallback_Write) (const void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle); + +/** Signature for the seek callback. + * The signature and semantics mostly match POSIX fseek() WITH ONE IMPORTANT + * EXCEPTION: the offset is a 64-bit type whereas fseek() is generally 'long' + * and 32-bits wide. + * + * \param handle The handle to the data source. + * \param offset The new position, relative to \a whence + * \param whence \c SEEK_SET, \c SEEK_CUR, or \c SEEK_END + * \retval int + * \c 0 on success, \c -1 on error. + */ +typedef int (*FLAC__IOCallback_Seek) (FLAC__IOHandle handle, FLAC__int64 offset, int whence); + +/** Signature for the tell callback. + * The signature and semantics mostly match POSIX ftell() WITH ONE IMPORTANT + * EXCEPTION: the offset is a 64-bit type whereas ftell() is generally 'long' + * and 32-bits wide. + * + * \param handle The handle to the data source. + * \retval FLAC__int64 + * The current position on success, \c -1 on error. + */ +typedef FLAC__int64 (*FLAC__IOCallback_Tell) (FLAC__IOHandle handle); + +/** Signature for the EOF callback. + * The signature and semantics mostly match POSIX feof() but WATCHOUT: + * on many systems, feof() is a macro, so in this case a wrapper function + * must be provided instead. + * + * \param handle The handle to the data source. + * \retval int + * \c 0 if not at end of file, nonzero if at end of file. + */ +typedef int (*FLAC__IOCallback_Eof) (FLAC__IOHandle handle); + +/** Signature for the close callback. + * The signature and semantics match POSIX fclose() implementations + * and can generally be used interchangeably. + * + * \param handle The handle to the data source. + * \retval int + * \c 0 on success, \c EOF on error. + */ +typedef int (*FLAC__IOCallback_Close) (FLAC__IOHandle handle); + +/** A structure for holding a set of callbacks. + * Each FLAC interface that requires a FLAC__IOCallbacks structure will + * describe which of the callbacks are required. The ones that are not + * required may be set to NULL. + * + * If the seek requirement for an interface is optional, you can signify that + * a data sorce is not seekable by setting the \a seek field to \c NULL. + */ +typedef struct { + FLAC__IOCallback_Read read; + FLAC__IOCallback_Write write; + FLAC__IOCallback_Seek seek; + FLAC__IOCallback_Tell tell; + FLAC__IOCallback_Eof eof; + FLAC__IOCallback_Close close; +} FLAC__IOCallbacks; + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/export.h b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/export.h new file mode 100644 index 0000000..a525f29 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/export.h @@ -0,0 +1,91 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__EXPORT_H +#define FLAC__EXPORT_H + +/** \file include/FLAC/export.h + * + * \brief + * This module contains #defines and symbols for exporting function + * calls, and providing version information and compiled-in features. + * + * See the \link flac_export export \endlink module. + */ + +/** \defgroup flac_export FLAC/export.h: export symbols + * \ingroup flac + * + * \brief + * This module contains #defines and symbols for exporting function + * calls, and providing version information and compiled-in features. + * + * If you are compiling with MSVC and will link to the static library + * (libFLAC.lib) you should define FLAC__NO_DLL in your project to + * make sure the symbols are exported properly. + * + * \{ + */ + +#if defined(FLAC__NO_DLL) || !defined(_MSC_VER) +#define FLAC_API + +#else + +#ifdef FLAC_API_EXPORTS +#define FLAC_API _declspec(dllexport) +#else +#define FLAC_API _declspec(dllimport) + +#endif +#endif + +/** These #defines will mirror the libtool-based library version number, see + * http://www.gnu.org/software/libtool/manual.html#Libtool-versioning + */ +#define FLAC_API_VERSION_CURRENT 10 +#define FLAC_API_VERSION_REVISION 0 /**< see above */ +#define FLAC_API_VERSION_AGE 2 /**< see above */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \c 1 if the library has been compiled with support for Ogg FLAC, else \c 0. */ +extern FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC; + +#ifdef __cplusplus +} +#endif + +/* \} */ + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/format.h b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/format.h new file mode 100644 index 0000000..77e2d01 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/format.h @@ -0,0 +1,1010 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__FORMAT_H +#define FLAC__FORMAT_H + +#include "export.h" +#include "ordinals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** \file include/FLAC/format.h + * + * \brief + * This module contains structure definitions for the representation + * of FLAC format components in memory. These are the basic + * structures used by the rest of the interfaces. + * + * See the detailed documentation in the + * \link flac_format format \endlink module. + */ + +/** \defgroup flac_format FLAC/format.h: format components + * \ingroup flac + * + * \brief + * This module contains structure definitions for the representation + * of FLAC format components in memory. These are the basic + * structures used by the rest of the interfaces. + * + * First, you should be familiar with the + * FLAC format. Many of the values here + * follow directly from the specification. As a user of libFLAC, the + * interesting parts really are the structures that describe the frame + * header and metadata blocks. + * + * The format structures here are very primitive, designed to store + * information in an efficient way. Reading information from the + * structures is easy but creating or modifying them directly is + * more complex. For the most part, as a user of a library, editing + * is not necessary; however, for metadata blocks it is, so there are + * convenience functions provided in the \link flac_metadata metadata + * module \endlink to simplify the manipulation of metadata blocks. + * + * \note + * It's not the best convention, but symbols ending in _LEN are in bits + * and _LENGTH are in bytes. _LENGTH symbols are \#defines instead of + * global variables because they are usually used when declaring byte + * arrays and some compilers require compile-time knowledge of array + * sizes when declared on the stack. + * + * \{ + */ + + +/* + Most of the values described in this file are defined by the FLAC + format specification. There is nothing to tune here. +*/ + +/** The largest legal metadata type code. */ +#define FLAC__MAX_METADATA_TYPE_CODE (126u) + +/** The minimum block size, in samples, permitted by the format. */ +#define FLAC__MIN_BLOCK_SIZE (16u) + +/** The maximum block size, in samples, permitted by the format. */ +#define FLAC__MAX_BLOCK_SIZE (65535u) + +/** The maximum block size, in samples, permitted by the FLAC subset for + * sample rates up to 48kHz. */ +#define FLAC__SUBSET_MAX_BLOCK_SIZE_48000HZ (4608u) + +/** The maximum number of channels permitted by the format. */ +#define FLAC__MAX_CHANNELS (8u) + +/** The minimum sample resolution permitted by the format. */ +#define FLAC__MIN_BITS_PER_SAMPLE (4u) + +/** The maximum sample resolution permitted by the format. */ +#define FLAC__MAX_BITS_PER_SAMPLE (32u) + +/** The maximum sample resolution permitted by libFLAC. + * + * \warning + * FLAC__MAX_BITS_PER_SAMPLE is the limit of the FLAC format. However, + * the reference encoder/decoder is currently limited to 24 bits because + * of prevalent 32-bit math, so make sure and use this value when + * appropriate. + */ +#define FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE (24u) + +/** The maximum sample rate permitted by the format. The value is + * ((2 ^ 16) - 1) * 10; see FLAC format + * as to why. + */ +#define FLAC__MAX_SAMPLE_RATE (655350u) + +/** The maximum LPC order permitted by the format. */ +#define FLAC__MAX_LPC_ORDER (32u) + +/** The maximum LPC order permitted by the FLAC subset for sample rates + * up to 48kHz. */ +#define FLAC__SUBSET_MAX_LPC_ORDER_48000HZ (12u) + +/** The minimum quantized linear predictor coefficient precision + * permitted by the format. + */ +#define FLAC__MIN_QLP_COEFF_PRECISION (5u) + +/** The maximum quantized linear predictor coefficient precision + * permitted by the format. + */ +#define FLAC__MAX_QLP_COEFF_PRECISION (15u) + +/** The maximum order of the fixed predictors permitted by the format. */ +#define FLAC__MAX_FIXED_ORDER (4u) + +/** The maximum Rice partition order permitted by the format. */ +#define FLAC__MAX_RICE_PARTITION_ORDER (15u) + +/** The maximum Rice partition order permitted by the FLAC Subset. */ +#define FLAC__SUBSET_MAX_RICE_PARTITION_ORDER (8u) + +/** The version string of the release, stamped onto the libraries and binaries. + * + * \note + * This does not correspond to the shared library version number, which + * is used to determine binary compatibility. + */ +extern FLAC_API const char *FLAC__VERSION_STRING; + +/** The vendor string inserted by the encoder into the VORBIS_COMMENT block. + * This is a NUL-terminated ASCII string; when inserted into the + * VORBIS_COMMENT the trailing null is stripped. + */ +extern FLAC_API const char *FLAC__VENDOR_STRING; + +/** The byte string representation of the beginning of a FLAC stream. */ +extern FLAC_API const FLAC__byte FLAC__STREAM_SYNC_STRING[4]; /* = "fLaC" */ + +/** The 32-bit integer big-endian representation of the beginning of + * a FLAC stream. + */ +extern FLAC_API const unsigned FLAC__STREAM_SYNC; /* = 0x664C6143 */ + +/** The length of the FLAC signature in bits. */ +extern FLAC_API const unsigned FLAC__STREAM_SYNC_LEN; /* = 32 bits */ + +/** The length of the FLAC signature in bytes. */ +#define FLAC__STREAM_SYNC_LENGTH (4u) + + +/***************************************************************************** + * + * Subframe structures + * + *****************************************************************************/ + +/*****************************************************************************/ + +/** An enumeration of the available entropy coding methods. */ +typedef enum { + FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0, + /**< Residual is coded by partitioning into contexts, each with it's own + * 4-bit Rice parameter. */ + + FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 = 1 + /**< Residual is coded by partitioning into contexts, each with it's own + * 5-bit Rice parameter. */ +} FLAC__EntropyCodingMethodType; + +/** Maps a FLAC__EntropyCodingMethodType to a C string. + * + * Using a FLAC__EntropyCodingMethodType as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__EntropyCodingMethodTypeString[]; + + +/** Contents of a Rice partitioned residual + */ +typedef struct { + + unsigned *parameters; + /**< The Rice parameters for each context. */ + + unsigned *raw_bits; + /**< Widths for escape-coded partitions. Will be non-zero for escaped + * partitions and zero for unescaped partitions. + */ + + unsigned capacity_by_order; + /**< The capacity of the \a parameters and \a raw_bits arrays + * specified as an order, i.e. the number of array elements + * allocated is 2 ^ \a capacity_by_order. + */ +} FLAC__EntropyCodingMethod_PartitionedRiceContents; + +/** Header for a Rice partitioned residual. (c.f. format specification) + */ +typedef struct { + + unsigned order; + /**< The partition order, i.e. # of contexts = 2 ^ \a order. */ + + const FLAC__EntropyCodingMethod_PartitionedRiceContents *contents; + /**< The context's Rice parameters and/or raw bits. */ + +} FLAC__EntropyCodingMethod_PartitionedRice; + +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN; /**< == 5 (bits) */ +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN; /**< == 5 (bits) */ + +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER; +/**< == (1<format specification) + */ +typedef struct { + FLAC__EntropyCodingMethodType type; + union { + FLAC__EntropyCodingMethod_PartitionedRice partitioned_rice; + } data; +} FLAC__EntropyCodingMethod; + +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_TYPE_LEN; /**< == 2 (bits) */ + +/*****************************************************************************/ + +/** An enumeration of the available subframe types. */ +typedef enum { + FLAC__SUBFRAME_TYPE_CONSTANT = 0, /**< constant signal */ + FLAC__SUBFRAME_TYPE_VERBATIM = 1, /**< uncompressed signal */ + FLAC__SUBFRAME_TYPE_FIXED = 2, /**< fixed polynomial prediction */ + FLAC__SUBFRAME_TYPE_LPC = 3 /**< linear prediction */ +} FLAC__SubframeType; + +/** Maps a FLAC__SubframeType to a C string. + * + * Using a FLAC__SubframeType as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__SubframeTypeString[]; + + +/** CONSTANT subframe. (c.f. format specification) + */ +typedef struct { + FLAC__int32 value; /**< The constant signal value. */ +} FLAC__Subframe_Constant; + + +/** VERBATIM subframe. (c.f. format specification) + */ +typedef struct { + const FLAC__int32 *data; /**< A pointer to verbatim signal. */ +} FLAC__Subframe_Verbatim; + + +/** FIXED subframe. (c.f. format specification) + */ +typedef struct { + FLAC__EntropyCodingMethod entropy_coding_method; + /**< The residual coding method. */ + + unsigned order; + /**< The polynomial order. */ + + FLAC__int32 warmup[FLAC__MAX_FIXED_ORDER]; + /**< Warmup samples to prime the predictor, length == order. */ + + const FLAC__int32 *residual; + /**< The residual signal, length == (blocksize minus order) samples. */ +} FLAC__Subframe_Fixed; + + +/** LPC subframe. (c.f. format specification) + */ +typedef struct { + FLAC__EntropyCodingMethod entropy_coding_method; + /**< The residual coding method. */ + + unsigned order; + /**< The FIR order. */ + + unsigned qlp_coeff_precision; + /**< Quantized FIR filter coefficient precision in bits. */ + + int quantization_level; + /**< The qlp coeff shift needed. */ + + FLAC__int32 qlp_coeff[FLAC__MAX_LPC_ORDER]; + /**< FIR filter coefficients. */ + + FLAC__int32 warmup[FLAC__MAX_LPC_ORDER]; + /**< Warmup samples to prime the predictor, length == order. */ + + const FLAC__int32 *residual; + /**< The residual signal, length == (blocksize minus order) samples. */ +} FLAC__Subframe_LPC; + +extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN; /**< == 5 (bits) */ + + +/** FLAC subframe structure. (c.f. format specification) + */ +typedef struct { + FLAC__SubframeType type; + union { + FLAC__Subframe_Constant constant; + FLAC__Subframe_Fixed fixed; + FLAC__Subframe_LPC lpc; + FLAC__Subframe_Verbatim verbatim; + } data; + unsigned wasted_bits; +} FLAC__Subframe; + +/** == 1 (bit) + * + * This used to be a zero-padding bit (hence the name + * FLAC__SUBFRAME_ZERO_PAD_LEN) but is now a reserved bit. It still has a + * mandatory value of \c 0 but in the future may take on the value \c 0 or \c 1 + * to mean something else. + */ +extern FLAC_API const unsigned FLAC__SUBFRAME_ZERO_PAD_LEN; +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LEN; /**< == 6 (bits) */ +extern FLAC_API const unsigned FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN; /**< == 1 (bit) */ + +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK; /**< = 0x00 */ +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK; /**< = 0x02 */ +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_FIXED_BYTE_ALIGNED_MASK; /**< = 0x10 */ +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK; /**< = 0x40 */ + +/*****************************************************************************/ + + +/***************************************************************************** + * + * Frame structures + * + *****************************************************************************/ + +/** An enumeration of the available channel assignments. */ +typedef enum { + FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT = 0, /**< independent channels */ + FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE = 1, /**< left+side stereo */ + FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE = 2, /**< right+side stereo */ + FLAC__CHANNEL_ASSIGNMENT_MID_SIDE = 3 /**< mid+side stereo */ +} FLAC__ChannelAssignment; + +/** Maps a FLAC__ChannelAssignment to a C string. + * + * Using a FLAC__ChannelAssignment as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__ChannelAssignmentString[]; + +/** An enumeration of the possible frame numbering methods. */ +typedef enum { + FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER, /**< number contains the frame number */ + FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER /**< number contains the sample number of first sample in frame */ +} FLAC__FrameNumberType; + +/** Maps a FLAC__FrameNumberType to a C string. + * + * Using a FLAC__FrameNumberType as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__FrameNumberTypeString[]; + + +/** FLAC frame header structure. (c.f. format specification) + */ +typedef struct { + unsigned blocksize; + /**< The number of samples per subframe. */ + + unsigned sample_rate; + /**< The sample rate in Hz. */ + + unsigned channels; + /**< The number of channels (== number of subframes). */ + + FLAC__ChannelAssignment channel_assignment; + /**< The channel assignment for the frame. */ + + unsigned bits_per_sample; + /**< The sample resolution. */ + + FLAC__FrameNumberType number_type; + /**< The numbering scheme used for the frame. As a convenience, the + * decoder will always convert a frame number to a sample number because + * the rules are complex. */ + + union { + FLAC__uint32 frame_number; + FLAC__uint64 sample_number; + } number; + /**< The frame number or sample number of first sample in frame; + * use the \a number_type value to determine which to use. */ + + FLAC__uint8 crc; + /**< CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0) + * of the raw frame header bytes, meaning everything before the CRC byte + * including the sync code. + */ +} FLAC__FrameHeader; + +extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC; /**< == 0x3ffe; the frame header sync code */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC_LEN; /**< == 14 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_RESERVED_LEN; /**< == 1 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN; /**< == 1 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCK_SIZE_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_SAMPLE_RATE_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN; /**< == 3 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_ZERO_PAD_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_CRC_LEN; /**< == 8 (bits) */ + + +/** FLAC frame footer structure. (c.f. format specification) + */ +typedef struct { + FLAC__uint16 crc; + /**< CRC-16 (polynomial = x^16 + x^15 + x^2 + x^0, initialized with + * 0) of the bytes before the crc, back to and including the frame header + * sync code. + */ +} FLAC__FrameFooter; + +extern FLAC_API const unsigned FLAC__FRAME_FOOTER_CRC_LEN; /**< == 16 (bits) */ + + +/** FLAC frame structure. (c.f. format specification) + */ +typedef struct { + FLAC__FrameHeader header; + FLAC__Subframe subframes[FLAC__MAX_CHANNELS]; + FLAC__FrameFooter footer; +} FLAC__Frame; + +/*****************************************************************************/ + + +/***************************************************************************** + * + * Meta-data structures + * + *****************************************************************************/ + +/** An enumeration of the available metadata block types. */ +typedef enum { + + FLAC__METADATA_TYPE_STREAMINFO = 0, + /**< STREAMINFO block */ + + FLAC__METADATA_TYPE_PADDING = 1, + /**< PADDING block */ + + FLAC__METADATA_TYPE_APPLICATION = 2, + /**< APPLICATION block */ + + FLAC__METADATA_TYPE_SEEKTABLE = 3, + /**< SEEKTABLE block */ + + FLAC__METADATA_TYPE_VORBIS_COMMENT = 4, + /**< VORBISCOMMENT block (a.k.a. FLAC tags) */ + + FLAC__METADATA_TYPE_CUESHEET = 5, + /**< CUESHEET block */ + + FLAC__METADATA_TYPE_PICTURE = 6, + /**< PICTURE block */ + + FLAC__METADATA_TYPE_UNDEFINED = 7 + /**< marker to denote beginning of undefined type range; this number will increase as new metadata types are added */ + +} FLAC__MetadataType; + +/** Maps a FLAC__MetadataType to a C string. + * + * Using a FLAC__MetadataType as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__MetadataTypeString[]; + + +/** FLAC STREAMINFO structure. (c.f. format specification) + */ +typedef struct { + unsigned min_blocksize, max_blocksize; + unsigned min_framesize, max_framesize; + unsigned sample_rate; + unsigned channels; + unsigned bits_per_sample; + FLAC__uint64 total_samples; + FLAC__byte md5sum[16]; +} FLAC__StreamMetadata_StreamInfo; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN; /**< == 16 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN; /**< == 16 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN; /**< == 24 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN; /**< == 24 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN; /**< == 20 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN; /**< == 3 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN; /**< == 5 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN; /**< == 36 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; /**< == 128 (bits) */ + +/** The total stream length of the STREAMINFO block in bytes. */ +#define FLAC__STREAM_METADATA_STREAMINFO_LENGTH (34u) + +/** FLAC PADDING structure. (c.f. format specification) + */ +typedef struct { + int dummy; + /**< Conceptually this is an empty struct since we don't store the + * padding bytes. Empty structs are not allowed by some C compilers, + * hence the dummy. + */ +} FLAC__StreamMetadata_Padding; + + +/** FLAC APPLICATION structure. (c.f. format specification) + */ +typedef struct { + FLAC__byte id[4]; + FLAC__byte *data; +} FLAC__StreamMetadata_Application; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_APPLICATION_ID_LEN; /**< == 32 (bits) */ + +/** SeekPoint structure used in SEEKTABLE blocks. (c.f. format specification) + */ +typedef struct { + FLAC__uint64 sample_number; + /**< The sample number of the target frame. */ + + FLAC__uint64 stream_offset; + /**< The offset, in bytes, of the target frame with respect to + * beginning of the first frame. */ + + unsigned frame_samples; + /**< The number of samples in the target frame. */ +} FLAC__StreamMetadata_SeekPoint; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN; /**< == 16 (bits) */ + +/** The total stream length of a seek point in bytes. */ +#define FLAC__STREAM_METADATA_SEEKPOINT_LENGTH (18u) + +/** The value used in the \a sample_number field of + * FLAC__StreamMetadataSeekPoint used to indicate a placeholder + * point (== 0xffffffffffffffff). + */ +extern FLAC_API const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; + + +/** FLAC SEEKTABLE structure. (c.f. format specification) + * + * \note From the format specification: + * - The seek points must be sorted by ascending sample number. + * - Each seek point's sample number must be the first sample of the + * target frame. + * - Each seek point's sample number must be unique within the table. + * - Existence of a SEEKTABLE block implies a correct setting of + * total_samples in the stream_info block. + * - Behavior is undefined when more than one SEEKTABLE block is + * present in a stream. + */ +typedef struct { + unsigned num_points; + FLAC__StreamMetadata_SeekPoint *points; +} FLAC__StreamMetadata_SeekTable; + + +/** Vorbis comment entry structure used in VORBIS_COMMENT blocks. (c.f. format specification) + * + * For convenience, the APIs maintain a trailing NUL character at the end of + * \a entry which is not counted toward \a length, i.e. + * \code strlen(entry) == length \endcode + */ +typedef struct { + FLAC__uint32 length; + FLAC__byte *entry; +} FLAC__StreamMetadata_VorbisComment_Entry; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN; /**< == 32 (bits) */ + + +/** FLAC VORBIS_COMMENT structure. (c.f. format specification) + */ +typedef struct { + FLAC__StreamMetadata_VorbisComment_Entry vendor_string; + FLAC__uint32 num_comments; + FLAC__StreamMetadata_VorbisComment_Entry *comments; +} FLAC__StreamMetadata_VorbisComment; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN; /**< == 32 (bits) */ + + +/** FLAC CUESHEET track index structure. (See the + * format specification for + * the full description of each field.) + */ +typedef struct { + FLAC__uint64 offset; + /**< Offset in samples, relative to the track offset, of the index + * point. + */ + + FLAC__byte number; + /**< The index point number. */ +} FLAC__StreamMetadata_CueSheet_Index; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN; /**< == 8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN; /**< == 3*8 (bits) */ + + +/** FLAC CUESHEET track structure. (See the + * format specification for + * the full description of each field.) + */ +typedef struct { + FLAC__uint64 offset; + /**< Track offset in samples, relative to the beginning of the FLAC audio stream. */ + + FLAC__byte number; + /**< The track number. */ + + char isrc[13]; + /**< Track ISRC. This is a 12-digit alphanumeric code plus a trailing \c NUL byte */ + + unsigned type:1; + /**< The track type: 0 for audio, 1 for non-audio. */ + + unsigned pre_emphasis:1; + /**< The pre-emphasis flag: 0 for no pre-emphasis, 1 for pre-emphasis. */ + + FLAC__byte num_indices; + /**< The number of track index points. */ + + FLAC__StreamMetadata_CueSheet_Index *indices; + /**< NULL if num_indices == 0, else pointer to array of index points. */ + +} FLAC__StreamMetadata_CueSheet_Track; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN; /**< == 8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN; /**< == 12*8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN; /**< == 6+13*8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN; /**< == 8 (bits) */ + + +/** FLAC CUESHEET structure. (See the + * format specification + * for the full description of each field.) + */ +typedef struct { + char media_catalog_number[129]; + /**< Media catalog number, in ASCII printable characters 0x20-0x7e. In + * general, the media catalog number may be 0 to 128 bytes long; any + * unused characters should be right-padded with NUL characters. + */ + + FLAC__uint64 lead_in; + /**< The number of lead-in samples. */ + + FLAC__bool is_cd; + /**< \c true if CUESHEET corresponds to a Compact Disc, else \c false. */ + + unsigned num_tracks; + /**< The number of tracks. */ + + FLAC__StreamMetadata_CueSheet_Track *tracks; + /**< NULL if num_tracks == 0, else pointer to array of tracks. */ + +} FLAC__StreamMetadata_CueSheet; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN; /**< == 128*8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN; /**< == 7+258*8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN; /**< == 8 (bits) */ + + +/** An enumeration of the PICTURE types (see FLAC__StreamMetadataPicture and id3 v2.4 APIC tag). */ +typedef enum { + FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER = 0, /**< Other */ + FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD = 1, /**< 32x32 pixels 'file icon' (PNG only) */ + FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON = 2, /**< Other file icon */ + FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER = 3, /**< Cover (front) */ + FLAC__STREAM_METADATA_PICTURE_TYPE_BACK_COVER = 4, /**< Cover (back) */ + FLAC__STREAM_METADATA_PICTURE_TYPE_LEAFLET_PAGE = 5, /**< Leaflet page */ + FLAC__STREAM_METADATA_PICTURE_TYPE_MEDIA = 6, /**< Media (e.g. label side of CD) */ + FLAC__STREAM_METADATA_PICTURE_TYPE_LEAD_ARTIST = 7, /**< Lead artist/lead performer/soloist */ + FLAC__STREAM_METADATA_PICTURE_TYPE_ARTIST = 8, /**< Artist/performer */ + FLAC__STREAM_METADATA_PICTURE_TYPE_CONDUCTOR = 9, /**< Conductor */ + FLAC__STREAM_METADATA_PICTURE_TYPE_BAND = 10, /**< Band/Orchestra */ + FLAC__STREAM_METADATA_PICTURE_TYPE_COMPOSER = 11, /**< Composer */ + FLAC__STREAM_METADATA_PICTURE_TYPE_LYRICIST = 12, /**< Lyricist/text writer */ + FLAC__STREAM_METADATA_PICTURE_TYPE_RECORDING_LOCATION = 13, /**< Recording Location */ + FLAC__STREAM_METADATA_PICTURE_TYPE_DURING_RECORDING = 14, /**< During recording */ + FLAC__STREAM_METADATA_PICTURE_TYPE_DURING_PERFORMANCE = 15, /**< During performance */ + FLAC__STREAM_METADATA_PICTURE_TYPE_VIDEO_SCREEN_CAPTURE = 16, /**< Movie/video screen capture */ + FLAC__STREAM_METADATA_PICTURE_TYPE_FISH = 17, /**< A bright coloured fish */ + FLAC__STREAM_METADATA_PICTURE_TYPE_ILLUSTRATION = 18, /**< Illustration */ + FLAC__STREAM_METADATA_PICTURE_TYPE_BAND_LOGOTYPE = 19, /**< Band/artist logotype */ + FLAC__STREAM_METADATA_PICTURE_TYPE_PUBLISHER_LOGOTYPE = 20, /**< Publisher/Studio logotype */ + FLAC__STREAM_METADATA_PICTURE_TYPE_UNDEFINED +} FLAC__StreamMetadata_Picture_Type; + +/** Maps a FLAC__StreamMetadata_Picture_Type to a C string. + * + * Using a FLAC__StreamMetadata_Picture_Type as the index to this array + * will give the string equivalent. The contents should not be + * modified. + */ +extern FLAC_API const char * const FLAC__StreamMetadata_Picture_TypeString[]; + +/** FLAC PICTURE structure. (See the + * format specification + * for the full description of each field.) + */ +typedef struct { + FLAC__StreamMetadata_Picture_Type type; + /**< The kind of picture stored. */ + + char *mime_type; + /**< Picture data's MIME type, in ASCII printable characters + * 0x20-0x7e, NUL terminated. For best compatibility with players, + * use picture data of MIME type \c image/jpeg or \c image/png. A + * MIME type of '-->' is also allowed, in which case the picture + * data should be a complete URL. In file storage, the MIME type is + * stored as a 32-bit length followed by the ASCII string with no NUL + * terminator, but is converted to a plain C string in this structure + * for convenience. + */ + + FLAC__byte *description; + /**< Picture's description in UTF-8, NUL terminated. In file storage, + * the description is stored as a 32-bit length followed by the UTF-8 + * string with no NUL terminator, but is converted to a plain C string + * in this structure for convenience. + */ + + FLAC__uint32 width; + /**< Picture's width in pixels. */ + + FLAC__uint32 height; + /**< Picture's height in pixels. */ + + FLAC__uint32 depth; + /**< Picture's color depth in bits-per-pixel. */ + + FLAC__uint32 colors; + /**< For indexed palettes (like GIF), picture's number of colors (the + * number of palette entries), or \c 0 for non-indexed (i.e. 2^depth). + */ + + FLAC__uint32 data_length; + /**< Length of binary picture data in bytes. */ + + FLAC__byte *data; + /**< Binary picture data. */ + +} FLAC__StreamMetadata_Picture; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_TYPE_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_COLORS_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN; /**< == 32 (bits) */ + + +/** Structure that is used when a metadata block of unknown type is loaded. + * The contents are opaque. The structure is used only internally to + * correctly handle unknown metadata. + */ +typedef struct { + FLAC__byte *data; +} FLAC__StreamMetadata_Unknown; + + +/** FLAC metadata block structure. (c.f. format specification) + */ +typedef struct { + FLAC__MetadataType type; + /**< The type of the metadata block; used determine which member of the + * \a data union to dereference. If type >= FLAC__METADATA_TYPE_UNDEFINED + * then \a data.unknown must be used. */ + + FLAC__bool is_last; + /**< \c true if this metadata block is the last, else \a false */ + + unsigned length; + /**< Length, in bytes, of the block data as it appears in the stream. */ + + union { + FLAC__StreamMetadata_StreamInfo stream_info; + FLAC__StreamMetadata_Padding padding; + FLAC__StreamMetadata_Application application; + FLAC__StreamMetadata_SeekTable seek_table; + FLAC__StreamMetadata_VorbisComment vorbis_comment; + FLAC__StreamMetadata_CueSheet cue_sheet; + FLAC__StreamMetadata_Picture picture; + FLAC__StreamMetadata_Unknown unknown; + } data; + /**< Polymorphic block data; use the \a type value to determine which + * to use. */ +} FLAC__StreamMetadata; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_IS_LAST_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_TYPE_LEN; /**< == 7 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_LENGTH_LEN; /**< == 24 (bits) */ + +/** The total stream length of a metadata block header in bytes. */ +#define FLAC__STREAM_METADATA_HEADER_LENGTH (4u) + +/*****************************************************************************/ + + +/***************************************************************************** + * + * Utility functions + * + *****************************************************************************/ + +/** Tests that a sample rate is valid for FLAC. + * + * \param sample_rate The sample rate to test for compliance. + * \retval FLAC__bool + * \c true if the given sample rate conforms to the specification, else + * \c false. + */ +FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(unsigned sample_rate); + +/** Tests that a sample rate is valid for the FLAC subset. The subset rules + * for valid sample rates are slightly more complex since the rate has to + * be expressible completely in the frame header. + * + * \param sample_rate The sample rate to test for compliance. + * \retval FLAC__bool + * \c true if the given sample rate conforms to the specification for the + * subset, else \c false. + */ +FLAC_API FLAC__bool FLAC__format_sample_rate_is_subset(unsigned sample_rate); + +/** Check a Vorbis comment entry name to see if it conforms to the Vorbis + * comment specification. + * + * Vorbis comment names must be composed only of characters from + * [0x20-0x3C,0x3E-0x7D]. + * + * \param name A NUL-terminated string to be checked. + * \assert + * \code name != NULL \endcode + * \retval FLAC__bool + * \c false if entry name is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_name_is_legal(const char *name); + +/** Check a Vorbis comment entry value to see if it conforms to the Vorbis + * comment specification. + * + * Vorbis comment values must be valid UTF-8 sequences. + * + * \param value A string to be checked. + * \param length A the length of \a value in bytes. May be + * \c (unsigned)(-1) to indicate that \a value is a plain + * UTF-8 NUL-terminated string. + * \assert + * \code value != NULL \endcode + * \retval FLAC__bool + * \c false if entry name is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_value_is_legal(const FLAC__byte *value, unsigned length); + +/** Check a Vorbis comment entry to see if it conforms to the Vorbis + * comment specification. + * + * Vorbis comment entries must be of the form 'name=value', and 'name' and + * 'value' must be legal according to + * FLAC__format_vorbiscomment_entry_name_is_legal() and + * FLAC__format_vorbiscomment_entry_value_is_legal() respectively. + * + * \param entry An entry to be checked. + * \param length The length of \a entry in bytes. + * \assert + * \code value != NULL \endcode + * \retval FLAC__bool + * \c false if entry name is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_is_legal(const FLAC__byte *entry, unsigned length); + +/** Check a seek table to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * seek table. + * + * \param seek_table A pointer to a seek table to be checked. + * \assert + * \code seek_table != NULL \endcode + * \retval FLAC__bool + * \c false if seek table is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_seektable_is_legal(const FLAC__StreamMetadata_SeekTable *seek_table); + +/** Sort a seek table's seek points according to the format specification. + * This includes a "unique-ification" step to remove duplicates, i.e. + * seek points with identical \a sample_number values. Duplicate seek + * points are converted into placeholder points and sorted to the end of + * the table. + * + * \param seek_table A pointer to a seek table to be sorted. + * \assert + * \code seek_table != NULL \endcode + * \retval unsigned + * The number of duplicate seek points converted into placeholders. + */ +FLAC_API unsigned FLAC__format_seektable_sort(FLAC__StreamMetadata_SeekTable *seek_table); + +/** Check a cue sheet to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * cue sheet. + * + * \param cue_sheet A pointer to an existing cue sheet to be checked. + * \param check_cd_da_subset If \c true, check CUESHEET against more + * stringent requirements for a CD-DA (audio) disc. + * \param violation Address of a pointer to a string. If there is a + * violation, a pointer to a string explanation of the + * violation will be returned here. \a violation may be + * \c NULL if you don't need the returned string. Do not + * free the returned string; it will always point to static + * data. + * \assert + * \code cue_sheet != NULL \endcode + * \retval FLAC__bool + * \c false if cue sheet is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_cuesheet_is_legal(const FLAC__StreamMetadata_CueSheet *cue_sheet, FLAC__bool check_cd_da_subset, const char **violation); + +/** Check picture data to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * PICTURE block. + * + * \param picture A pointer to existing picture data to be checked. + * \param violation Address of a pointer to a string. If there is a + * violation, a pointer to a string explanation of the + * violation will be returned here. \a violation may be + * \c NULL if you don't need the returned string. Do not + * free the returned string; it will always point to static + * data. + * \assert + * \code picture != NULL \endcode + * \retval FLAC__bool + * \c false if picture data is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_picture_is_legal(const FLAC__StreamMetadata_Picture *picture, const char **violation); + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/metadata.h b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/metadata.h new file mode 100644 index 0000000..fff90b0 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/metadata.h @@ -0,0 +1,2181 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__METADATA_H +#define FLAC__METADATA_H + +#include /* for off_t */ +#include "export.h" +#include "callback.h" +#include "format.h" + +/* -------------------------------------------------------------------- + (For an example of how all these routines are used, see the source + code for the unit tests in src/test_libFLAC/metadata_*.c, or + metaflac in src/metaflac/) + ------------------------------------------------------------------*/ + +/** \file include/FLAC/metadata.h + * + * \brief + * This module provides functions for creating and manipulating FLAC + * metadata blocks in memory, and three progressively more powerful + * interfaces for traversing and editing metadata in FLAC files. + * + * See the detailed documentation for each interface in the + * \link flac_metadata metadata \endlink module. + */ + +/** \defgroup flac_metadata FLAC/metadata.h: metadata interfaces + * \ingroup flac + * + * \brief + * This module provides functions for creating and manipulating FLAC + * metadata blocks in memory, and three progressively more powerful + * interfaces for traversing and editing metadata in native FLAC files. + * Note that currently only the Chain interface (level 2) supports Ogg + * FLAC files, and it is read-only i.e. no writing back changed + * metadata to file. + * + * There are three metadata interfaces of increasing complexity: + * + * Level 0: + * Read-only access to the STREAMINFO, VORBIS_COMMENT, CUESHEET, and + * PICTURE blocks. + * + * Level 1: + * Read-write access to all metadata blocks. This level is write- + * efficient in most cases (more on this below), and uses less memory + * than level 2. + * + * Level 2: + * Read-write access to all metadata blocks. This level is write- + * efficient in all cases, but uses more memory since all metadata for + * the whole file is read into memory and manipulated before writing + * out again. + * + * What do we mean by efficient? Since FLAC metadata appears at the + * beginning of the file, when writing metadata back to a FLAC file + * it is possible to grow or shrink the metadata such that the entire + * file must be rewritten. However, if the size remains the same during + * changes or PADDING blocks are utilized, only the metadata needs to be + * overwritten, which is much faster. + * + * Efficient means the whole file is rewritten at most one time, and only + * when necessary. Level 1 is not efficient only in the case that you + * cause more than one metadata block to grow or shrink beyond what can + * be accomodated by padding. In this case you should probably use level + * 2, which allows you to edit all the metadata for a file in memory and + * write it out all at once. + * + * All levels know how to skip over and not disturb an ID3v2 tag at the + * front of the file. + * + * All levels access files via their filenames. In addition, level 2 + * has additional alternative read and write functions that take an I/O + * handle and callbacks, for situations where access by filename is not + * possible. + * + * In addition to the three interfaces, this module defines functions for + * creating and manipulating various metadata objects in memory. As we see + * from the Format module, FLAC metadata blocks in memory are very primitive + * structures for storing information in an efficient way. Reading + * information from the structures is easy but creating or modifying them + * directly is more complex. The metadata object routines here facilitate + * this by taking care of the consistency and memory management drudgery. + * + * Unless you will be using the level 1 or 2 interfaces to modify existing + * metadata however, you will not probably not need these. + * + * From a dependency standpoint, none of the encoders or decoders require + * the metadata module. This is so that embedded users can strip out the + * metadata module from libFLAC to reduce the size and complexity. + */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/** \defgroup flac_metadata_level0 FLAC/metadata.h: metadata level 0 interface + * \ingroup flac_metadata + * + * \brief + * The level 0 interface consists of individual routines to read the + * STREAMINFO, VORBIS_COMMENT, CUESHEET, and PICTURE blocks, requiring + * only a filename. + * + * They try to skip any ID3v2 tag at the head of the file. + * + * \{ + */ + +/** Read the STREAMINFO metadata block of the given FLAC file. This function + * will try to skip any ID3v2 tag at the head of the file. + * + * \param filename The path to the FLAC file to read. + * \param streaminfo A pointer to space for the STREAMINFO block. Since + * FLAC__StreamMetadata is a simple structure with no + * memory allocation involved, you pass the address of + * an existing structure. It need not be initialized. + * \assert + * \code filename != NULL \endcode + * \code streaminfo != NULL \endcode + * \retval FLAC__bool + * \c true if a valid STREAMINFO block was read from \a filename. Returns + * \c false if there was a memory allocation error, a file decoder error, + * or the file contained no STREAMINFO block. (A memory allocation error + * is possible because this function must set up a file decoder.) + */ +FLAC_API FLAC__bool FLAC__metadata_get_streaminfo(const char *filename, FLAC__StreamMetadata *streaminfo); + +/** Read the VORBIS_COMMENT metadata block of the given FLAC file. This + * function will try to skip any ID3v2 tag at the head of the file. + * + * \param filename The path to the FLAC file to read. + * \param tags The address where the returned pointer will be + * stored. The \a tags object must be deleted by + * the caller using FLAC__metadata_object_delete(). + * \assert + * \code filename != NULL \endcode + * \code tags != NULL \endcode + * \retval FLAC__bool + * \c true if a valid VORBIS_COMMENT block was read from \a filename, + * and \a *tags will be set to the address of the metadata structure. + * Returns \c false if there was a memory allocation error, a file + * decoder error, or the file contained no VORBIS_COMMENT block, and + * \a *tags will be set to \c NULL. + */ +FLAC_API FLAC__bool FLAC__metadata_get_tags(const char *filename, FLAC__StreamMetadata **tags); + +/** Read the CUESHEET metadata block of the given FLAC file. This + * function will try to skip any ID3v2 tag at the head of the file. + * + * \param filename The path to the FLAC file to read. + * \param cuesheet The address where the returned pointer will be + * stored. The \a cuesheet object must be deleted by + * the caller using FLAC__metadata_object_delete(). + * \assert + * \code filename != NULL \endcode + * \code cuesheet != NULL \endcode + * \retval FLAC__bool + * \c true if a valid CUESHEET block was read from \a filename, + * and \a *cuesheet will be set to the address of the metadata + * structure. Returns \c false if there was a memory allocation + * error, a file decoder error, or the file contained no CUESHEET + * block, and \a *cuesheet will be set to \c NULL. + */ +FLAC_API FLAC__bool FLAC__metadata_get_cuesheet(const char *filename, FLAC__StreamMetadata **cuesheet); + +/** Read a PICTURE metadata block of the given FLAC file. This + * function will try to skip any ID3v2 tag at the head of the file. + * Since there can be more than one PICTURE block in a file, this + * function takes a number of parameters that act as constraints to + * the search. The PICTURE block with the largest area matching all + * the constraints will be returned, or \a *picture will be set to + * \c NULL if there was no such block. + * + * \param filename The path to the FLAC file to read. + * \param picture The address where the returned pointer will be + * stored. The \a picture object must be deleted by + * the caller using FLAC__metadata_object_delete(). + * \param type The desired picture type. Use \c -1 to mean + * "any type". + * \param mime_type The desired MIME type, e.g. "image/jpeg". The + * string will be matched exactly. Use \c NULL to + * mean "any MIME type". + * \param description The desired description. The string will be + * matched exactly. Use \c NULL to mean "any + * description". + * \param max_width The maximum width in pixels desired. Use + * \c (unsigned)(-1) to mean "any width". + * \param max_height The maximum height in pixels desired. Use + * \c (unsigned)(-1) to mean "any height". + * \param max_depth The maximum color depth in bits-per-pixel desired. + * Use \c (unsigned)(-1) to mean "any depth". + * \param max_colors The maximum number of colors desired. Use + * \c (unsigned)(-1) to mean "any number of colors". + * \assert + * \code filename != NULL \endcode + * \code picture != NULL \endcode + * \retval FLAC__bool + * \c true if a valid PICTURE block was read from \a filename, + * and \a *picture will be set to the address of the metadata + * structure. Returns \c false if there was a memory allocation + * error, a file decoder error, or the file contained no PICTURE + * block, and \a *picture will be set to \c NULL. + */ +FLAC_API FLAC__bool FLAC__metadata_get_picture(const char *filename, FLAC__StreamMetadata **picture, FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, unsigned max_width, unsigned max_height, unsigned max_depth, unsigned max_colors); + +/* \} */ + + +/** \defgroup flac_metadata_level1 FLAC/metadata.h: metadata level 1 interface + * \ingroup flac_metadata + * + * \brief + * The level 1 interface provides read-write access to FLAC file metadata and + * operates directly on the FLAC file. + * + * The general usage of this interface is: + * + * - Create an iterator using FLAC__metadata_simple_iterator_new() + * - Attach it to a file using FLAC__metadata_simple_iterator_init() and check + * the exit code. Call FLAC__metadata_simple_iterator_is_writable() to + * see if the file is writable, or only read access is allowed. + * - Use FLAC__metadata_simple_iterator_next() and + * FLAC__metadata_simple_iterator_prev() to traverse the blocks. + * This is does not read the actual blocks themselves. + * FLAC__metadata_simple_iterator_next() is relatively fast. + * FLAC__metadata_simple_iterator_prev() is slower since it needs to search + * forward from the front of the file. + * - Use FLAC__metadata_simple_iterator_get_block_type() or + * FLAC__metadata_simple_iterator_get_block() to access the actual data at + * the current iterator position. The returned object is yours to modify + * and free. + * - Use FLAC__metadata_simple_iterator_set_block() to write a modified block + * back. You must have write permission to the original file. Make sure to + * read the whole comment to FLAC__metadata_simple_iterator_set_block() + * below. + * - Use FLAC__metadata_simple_iterator_insert_block_after() to add new blocks. + * Use the object creation functions from + * \link flac_metadata_object here \endlink to generate new objects. + * - Use FLAC__metadata_simple_iterator_delete_block() to remove the block + * currently referred to by the iterator, or replace it with padding. + * - Destroy the iterator with FLAC__metadata_simple_iterator_delete() when + * finished. + * + * \note + * The FLAC file remains open the whole time between + * FLAC__metadata_simple_iterator_init() and + * FLAC__metadata_simple_iterator_delete(), so make sure you are not altering + * the file during this time. + * + * \note + * Do not modify the \a is_last, \a length, or \a type fields of returned + * FLAC__StreamMetadata objects. These are managed automatically. + * + * \note + * If any of the modification functions + * (FLAC__metadata_simple_iterator_set_block(), + * FLAC__metadata_simple_iterator_delete_block(), + * FLAC__metadata_simple_iterator_insert_block_after(), etc.) return \c false, + * you should delete the iterator as it may no longer be valid. + * + * \{ + */ + +struct FLAC__Metadata_SimpleIterator; +/** The opaque structure definition for the level 1 iterator type. + * See the + * \link flac_metadata_level1 metadata level 1 module \endlink + * for a detailed description. + */ +typedef struct FLAC__Metadata_SimpleIterator FLAC__Metadata_SimpleIterator; + +/** Status type for FLAC__Metadata_SimpleIterator. + * + * The iterator's current status can be obtained by calling FLAC__metadata_simple_iterator_status(). + */ +typedef enum { + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK = 0, + /**< The iterator is in the normal OK state */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT, + /**< The data passed into a function violated the function's usage criteria */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE, + /**< The iterator could not open the target file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE, + /**< The iterator could not find the FLAC signature at the start of the file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE, + /**< The iterator tried to write to a file that was not writable */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_BAD_METADATA, + /**< The iterator encountered input that does not conform to the FLAC metadata specification */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR, + /**< The iterator encountered an error while reading the FLAC file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR, + /**< The iterator encountered an error while seeking in the FLAC file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR, + /**< The iterator encountered an error while writing the FLAC file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_RENAME_ERROR, + /**< The iterator encountered an error renaming the FLAC file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_UNLINK_ERROR, + /**< The iterator encountered an error removing the temporary file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR, + /**< Memory allocation failed */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_INTERNAL_ERROR + /**< The caller violated an assertion or an unexpected error occurred */ + +} FLAC__Metadata_SimpleIteratorStatus; + +/** Maps a FLAC__Metadata_SimpleIteratorStatus to a C string. + * + * Using a FLAC__Metadata_SimpleIteratorStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__Metadata_SimpleIteratorStatusString[]; + + +/** Create a new iterator instance. + * + * \retval FLAC__Metadata_SimpleIterator* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__Metadata_SimpleIterator *FLAC__metadata_simple_iterator_new(void); + +/** Free an iterator instance. Deletes the object pointed to by \a iterator. + * + * \param iterator A pointer to an existing iterator. + * \assert + * \code iterator != NULL \endcode + */ +FLAC_API void FLAC__metadata_simple_iterator_delete(FLAC__Metadata_SimpleIterator *iterator); + +/** Get the current status of the iterator. Call this after a function + * returns \c false to get the reason for the error. Also resets the status + * to FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK. + * + * \param iterator A pointer to an existing iterator. + * \assert + * \code iterator != NULL \endcode + * \retval FLAC__Metadata_SimpleIteratorStatus + * The current status of the iterator. + */ +FLAC_API FLAC__Metadata_SimpleIteratorStatus FLAC__metadata_simple_iterator_status(FLAC__Metadata_SimpleIterator *iterator); + +/** Initialize the iterator to point to the first metadata block in the + * given FLAC file. + * + * \param iterator A pointer to an existing iterator. + * \param filename The path to the FLAC file. + * \param read_only If \c true, the FLAC file will be opened + * in read-only mode; if \c false, the FLAC + * file will be opened for edit even if no + * edits are performed. + * \param preserve_file_stats If \c true, the owner and modification + * time will be preserved even if the FLAC + * file is written to. + * \assert + * \code iterator != NULL \endcode + * \code filename != NULL \endcode + * \retval FLAC__bool + * \c false if a memory allocation error occurs, the file can't be + * opened, or another error occurs, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_init(FLAC__Metadata_SimpleIterator *iterator, const char *filename, FLAC__bool read_only, FLAC__bool preserve_file_stats); + +/** Returns \c true if the FLAC file is writable. If \c false, calls to + * FLAC__metadata_simple_iterator_set_block() and + * FLAC__metadata_simple_iterator_insert_block_after() will fail. + * + * \param iterator A pointer to an existing iterator. + * \assert + * \code iterator != NULL \endcode + * \retval FLAC__bool + * See above. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_is_writable(const FLAC__Metadata_SimpleIterator *iterator); + +/** Moves the iterator forward one metadata block, returning \c false if + * already at the end. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c false if already at the last metadata block of the chain, else + * \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_next(FLAC__Metadata_SimpleIterator *iterator); + +/** Moves the iterator backward one metadata block, returning \c false if + * already at the beginning. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c false if already at the first metadata block of the chain, else + * \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_prev(FLAC__Metadata_SimpleIterator *iterator); + +/** Returns a flag telling if the current metadata block is the last. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c true if the current metadata block is the last in the file, + * else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_is_last(const FLAC__Metadata_SimpleIterator *iterator); + +/** Get the offset of the metadata block at the current position. This + * avoids reading the actual block data which can save time for large + * blocks. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval off_t + * The offset of the metadata block at the current iterator position. + * This is the byte offset relative to the beginning of the file of + * the current metadata block's header. + */ +FLAC_API off_t FLAC__metadata_simple_iterator_get_block_offset(const FLAC__Metadata_SimpleIterator *iterator); + +/** Get the type of the metadata block at the current position. This + * avoids reading the actual block data which can save time for large + * blocks. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__MetadataType + * The type of the metadata block at the current iterator position. + */ +FLAC_API FLAC__MetadataType FLAC__metadata_simple_iterator_get_block_type(const FLAC__Metadata_SimpleIterator *iterator); + +/** Get the length of the metadata block at the current position. This + * avoids reading the actual block data which can save time for large + * blocks. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval unsigned + * The length of the metadata block at the current iterator position. + * The is same length as that in the + * metadata block header, + * i.e. the length of the metadata body that follows the header. + */ +FLAC_API unsigned FLAC__metadata_simple_iterator_get_block_length(const FLAC__Metadata_SimpleIterator *iterator); + +/** Get the application ID of the \c APPLICATION block at the current + * position. This avoids reading the actual block data which can save + * time for large blocks. + * + * \param iterator A pointer to an existing initialized iterator. + * \param id A pointer to a buffer of at least \c 4 bytes where + * the ID will be stored. + * \assert + * \code iterator != NULL \endcode + * \code id != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c true if the ID was successfully read, else \c false, in which + * case you should check FLAC__metadata_simple_iterator_status() to + * find out why. If the status is + * \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT, then the + * current metadata block is not an \c APPLICATION block. Otherwise + * if the status is + * \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR or + * \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR, an I/O error + * occurred and the iterator can no longer be used. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_get_application_id(FLAC__Metadata_SimpleIterator *iterator, FLAC__byte *id); + +/** Get the metadata block at the current position. You can modify the + * block but must use FLAC__metadata_simple_iterator_set_block() to + * write it back to the FLAC file. + * + * You must call FLAC__metadata_object_delete() on the returned object + * when you are finished with it. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__StreamMetadata* + * The current metadata block, or \c NULL if there was a memory + * allocation error. + */ +FLAC_API FLAC__StreamMetadata *FLAC__metadata_simple_iterator_get_block(FLAC__Metadata_SimpleIterator *iterator); + +/** Write a block back to the FLAC file. This function tries to be + * as efficient as possible; how the block is actually written is + * shown by the following: + * + * Existing block is a STREAMINFO block and the new block is a + * STREAMINFO block: the new block is written in place. Make sure + * you know what you're doing when changing the values of a + * STREAMINFO block. + * + * Existing block is a STREAMINFO block and the new block is a + * not a STREAMINFO block: this is an error since the first block + * must be a STREAMINFO block. Returns \c false without altering the + * file. + * + * Existing block is not a STREAMINFO block and the new block is a + * STREAMINFO block: this is an error since there may be only one + * STREAMINFO block. Returns \c false without altering the file. + * + * Existing block and new block are the same length: the existing + * block will be replaced by the new block, written in place. + * + * Existing block is longer than new block: if use_padding is \c true, + * the existing block will be overwritten in place with the new + * block followed by a PADDING block, if possible, to make the total + * size the same as the existing block. Remember that a padding + * block requires at least four bytes so if the difference in size + * between the new block and existing block is less than that, the + * entire file will have to be rewritten, using the new block's + * exact size. If use_padding is \c false, the entire file will be + * rewritten, replacing the existing block by the new block. + * + * Existing block is shorter than new block: if use_padding is \c true, + * the function will try and expand the new block into the following + * PADDING block, if it exists and doing so won't shrink the PADDING + * block to less than 4 bytes. If there is no following PADDING + * block, or it will shrink to less than 4 bytes, or use_padding is + * \c false, the entire file is rewritten, replacing the existing block + * with the new block. Note that in this case any following PADDING + * block is preserved as is. + * + * After writing the block, the iterator will remain in the same + * place, i.e. pointing to the new block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block The block to set. + * \param use_padding See above. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \code block != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_set_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding); + +/** This is similar to FLAC__metadata_simple_iterator_set_block() + * except that instead of writing over an existing block, it appends + * a block after the existing block. \a use_padding is again used to + * tell the function to try an expand into following padding in an + * attempt to avoid rewriting the entire file. + * + * This function will fail and return \c false if given a STREAMINFO + * block. + * + * After writing the block, the iterator will be pointing to the + * new block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block The block to set. + * \param use_padding See above. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \code block != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_insert_block_after(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding); + +/** Deletes the block at the current position. This will cause the + * entire FLAC file to be rewritten, unless \a use_padding is \c true, + * in which case the block will be replaced by an equal-sized PADDING + * block. The iterator will be left pointing to the block before the + * one just deleted. + * + * You may not delete the STREAMINFO block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param use_padding See above. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c true if successful, else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_delete_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__bool use_padding); + +/* \} */ + + +/** \defgroup flac_metadata_level2 FLAC/metadata.h: metadata level 2 interface + * \ingroup flac_metadata + * + * \brief + * The level 2 interface provides read-write access to FLAC file metadata; + * all metadata is read into memory, operated on in memory, and then written + * to file, which is more efficient than level 1 when editing multiple blocks. + * + * Currently Ogg FLAC is supported for read only, via + * FLAC__metadata_chain_read_ogg() but a subsequent + * FLAC__metadata_chain_write() will fail. + * + * The general usage of this interface is: + * + * - Create a new chain using FLAC__metadata_chain_new(). A chain is a + * linked list of FLAC metadata blocks. + * - Read all metadata into the the chain from a FLAC file using + * FLAC__metadata_chain_read() or FLAC__metadata_chain_read_ogg() and + * check the status. + * - Optionally, consolidate the padding using + * FLAC__metadata_chain_merge_padding() or + * FLAC__metadata_chain_sort_padding(). + * - Create a new iterator using FLAC__metadata_iterator_new() + * - Initialize the iterator to point to the first element in the chain + * using FLAC__metadata_iterator_init() + * - Traverse the chain using FLAC__metadata_iterator_next and + * FLAC__metadata_iterator_prev(). + * - Get a block for reading or modification using + * FLAC__metadata_iterator_get_block(). The pointer to the object + * inside the chain is returned, so the block is yours to modify. + * Changes will be reflected in the FLAC file when you write the + * chain. You can also add and delete blocks (see functions below). + * - When done, write out the chain using FLAC__metadata_chain_write(). + * Make sure to read the whole comment to the function below. + * - Delete the chain using FLAC__metadata_chain_delete(). + * + * \note + * Even though the FLAC file is not open while the chain is being + * manipulated, you must not alter the file externally during + * this time. The chain assumes the FLAC file will not change + * between the time of FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg() + * and FLAC__metadata_chain_write(). + * + * \note + * Do not modify the is_last, length, or type fields of returned + * FLAC__StreamMetadata objects. These are managed automatically. + * + * \note + * The metadata objects returned by FLAC__metadata_iterator_get_block() + * are owned by the chain; do not FLAC__metadata_object_delete() them. + * In the same way, blocks passed to FLAC__metadata_iterator_set_block() + * become owned by the chain and they will be deleted when the chain is + * deleted. + * + * \{ + */ + +struct FLAC__Metadata_Chain; +/** The opaque structure definition for the level 2 chain type. + */ +typedef struct FLAC__Metadata_Chain FLAC__Metadata_Chain; + +struct FLAC__Metadata_Iterator; +/** The opaque structure definition for the level 2 iterator type. + */ +typedef struct FLAC__Metadata_Iterator FLAC__Metadata_Iterator; + +typedef enum { + FLAC__METADATA_CHAIN_STATUS_OK = 0, + /**< The chain is in the normal OK state */ + + FLAC__METADATA_CHAIN_STATUS_ILLEGAL_INPUT, + /**< The data passed into a function violated the function's usage criteria */ + + FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE, + /**< The chain could not open the target file */ + + FLAC__METADATA_CHAIN_STATUS_NOT_A_FLAC_FILE, + /**< The chain could not find the FLAC signature at the start of the file */ + + FLAC__METADATA_CHAIN_STATUS_NOT_WRITABLE, + /**< The chain tried to write to a file that was not writable */ + + FLAC__METADATA_CHAIN_STATUS_BAD_METADATA, + /**< The chain encountered input that does not conform to the FLAC metadata specification */ + + FLAC__METADATA_CHAIN_STATUS_READ_ERROR, + /**< The chain encountered an error while reading the FLAC file */ + + FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR, + /**< The chain encountered an error while seeking in the FLAC file */ + + FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR, + /**< The chain encountered an error while writing the FLAC file */ + + FLAC__METADATA_CHAIN_STATUS_RENAME_ERROR, + /**< The chain encountered an error renaming the FLAC file */ + + FLAC__METADATA_CHAIN_STATUS_UNLINK_ERROR, + /**< The chain encountered an error removing the temporary file */ + + FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR, + /**< Memory allocation failed */ + + FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR, + /**< The caller violated an assertion or an unexpected error occurred */ + + FLAC__METADATA_CHAIN_STATUS_INVALID_CALLBACKS, + /**< One or more of the required callbacks was NULL */ + + FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH, + /**< FLAC__metadata_chain_write() was called on a chain read by + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), + * or + * FLAC__metadata_chain_write_with_callbacks()/FLAC__metadata_chain_write_with_callbacks_and_tempfile() + * was called on a chain read by + * FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). + * Matching read/write methods must always be used. */ + + FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL + /**< FLAC__metadata_chain_write_with_callbacks() was called when the + * chain write requires a tempfile; use + * FLAC__metadata_chain_write_with_callbacks_and_tempfile() instead. + * Or, FLAC__metadata_chain_write_with_callbacks_and_tempfile() was + * called when the chain write does not require a tempfile; use + * FLAC__metadata_chain_write_with_callbacks() instead. + * Always check FLAC__metadata_chain_check_if_tempfile_needed() + * before writing via callbacks. */ + +} FLAC__Metadata_ChainStatus; + +/** Maps a FLAC__Metadata_ChainStatus to a C string. + * + * Using a FLAC__Metadata_ChainStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__Metadata_ChainStatusString[]; + +/*********** FLAC__Metadata_Chain ***********/ + +/** Create a new chain instance. + * + * \retval FLAC__Metadata_Chain* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__Metadata_Chain *FLAC__metadata_chain_new(void); + +/** Free a chain instance. Deletes the object pointed to by \a chain. + * + * \param chain A pointer to an existing chain. + * \assert + * \code chain != NULL \endcode + */ +FLAC_API void FLAC__metadata_chain_delete(FLAC__Metadata_Chain *chain); + +/** Get the current status of the chain. Call this after a function + * returns \c false to get the reason for the error. Also resets the + * status to FLAC__METADATA_CHAIN_STATUS_OK. + * + * \param chain A pointer to an existing chain. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__Metadata_ChainStatus + * The current status of the chain. + */ +FLAC_API FLAC__Metadata_ChainStatus FLAC__metadata_chain_status(FLAC__Metadata_Chain *chain); + +/** Read all metadata from a FLAC file into the chain. + * + * \param chain A pointer to an existing chain. + * \param filename The path to the FLAC file to read. + * \assert + * \code chain != NULL \endcode + * \code filename != NULL \endcode + * \retval FLAC__bool + * \c true if a valid list of metadata blocks was read from + * \a filename, else \c false. On failure, check the status with + * FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_read(FLAC__Metadata_Chain *chain, const char *filename); + +/** Read all metadata from an Ogg FLAC file into the chain. + * + * \note Ogg FLAC metadata data writing is not supported yet and + * FLAC__metadata_chain_write() will fail. + * + * \param chain A pointer to an existing chain. + * \param filename The path to the Ogg FLAC file to read. + * \assert + * \code chain != NULL \endcode + * \code filename != NULL \endcode + * \retval FLAC__bool + * \c true if a valid list of metadata blocks was read from + * \a filename, else \c false. On failure, check the status with + * FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg(FLAC__Metadata_Chain *chain, const char *filename); + +/** Read all metadata from a FLAC stream into the chain via I/O callbacks. + * + * The \a handle need only be open for reading, but must be seekable. + * The equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" + * for Windows). + * + * \param chain A pointer to an existing chain. + * \param handle The I/O handle of the FLAC stream to read. The + * handle will NOT be closed after the metadata is read; + * that is the duty of the caller. + * \param callbacks + * A set of callbacks to use for I/O. The mandatory + * callbacks are \a read, \a seek, and \a tell. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if a valid list of metadata blocks was read from + * \a handle, else \c false. On failure, check the status with + * FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_read_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks); + +/** Read all metadata from an Ogg FLAC stream into the chain via I/O callbacks. + * + * The \a handle need only be open for reading, but must be seekable. + * The equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" + * for Windows). + * + * \note Ogg FLAC metadata data writing is not supported yet and + * FLAC__metadata_chain_write() will fail. + * + * \param chain A pointer to an existing chain. + * \param handle The I/O handle of the Ogg FLAC stream to read. The + * handle will NOT be closed after the metadata is read; + * that is the duty of the caller. + * \param callbacks + * A set of callbacks to use for I/O. The mandatory + * callbacks are \a read, \a seek, and \a tell. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if a valid list of metadata blocks was read from + * \a handle, else \c false. On failure, check the status with + * FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks); + +/** Checks if writing the given chain would require the use of a + * temporary file, or if it could be written in place. + * + * Under certain conditions, padding can be utilized so that writing + * edited metadata back to the FLAC file does not require rewriting the + * entire file. If rewriting is required, then a temporary workfile is + * required. When writing metadata using callbacks, you must check + * this function to know whether to call + * FLAC__metadata_chain_write_with_callbacks() or + * FLAC__metadata_chain_write_with_callbacks_and_tempfile(). When + * writing with FLAC__metadata_chain_write(), the temporary file is + * handled internally. + * + * \param chain A pointer to an existing chain. + * \param use_padding + * Whether or not padding will be allowed to be used + * during the write. The value of \a use_padding given + * here must match the value later passed to + * FLAC__metadata_chain_write_with_callbacks() or + * FLAC__metadata_chain_write_with_callbacks_with_tempfile(). + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if writing the current chain would require a tempfile, or + * \c false if metadata can be written in place. + */ +FLAC_API FLAC__bool FLAC__metadata_chain_check_if_tempfile_needed(FLAC__Metadata_Chain *chain, FLAC__bool use_padding); + +/** Write all metadata out to the FLAC file. This function tries to be as + * efficient as possible; how the metadata is actually written is shown by + * the following: + * + * If the current chain is the same size as the existing metadata, the new + * data is written in place. + * + * If the current chain is longer than the existing metadata, and + * \a use_padding is \c true, and the last block is a PADDING block of + * sufficient length, the function will truncate the final padding block + * so that the overall size of the metadata is the same as the existing + * metadata, and then just rewrite the metadata. Otherwise, if not all of + * the above conditions are met, the entire FLAC file must be rewritten. + * If you want to use padding this way it is a good idea to call + * FLAC__metadata_chain_sort_padding() first so that you have the maximum + * amount of padding to work with, unless you need to preserve ordering + * of the PADDING blocks for some reason. + * + * If the current chain is shorter than the existing metadata, and + * \a use_padding is \c true, and the final block is a PADDING block, the padding + * is extended to make the overall size the same as the existing data. If + * \a use_padding is \c true and the last block is not a PADDING block, a new + * PADDING block is added to the end of the new data to make it the same + * size as the existing data (if possible, see the note to + * FLAC__metadata_simple_iterator_set_block() about the four byte limit) + * and the new data is written in place. If none of the above apply or + * \a use_padding is \c false, the entire FLAC file is rewritten. + * + * If \a preserve_file_stats is \c true, the owner and modification time will + * be preserved even if the FLAC file is written. + * + * For this write function to be used, the chain must have been read with + * FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(), not + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(). + * + * \param chain A pointer to an existing chain. + * \param use_padding See above. + * \param preserve_file_stats See above. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if the write succeeded, else \c false. On failure, + * check the status with FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_write(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__bool preserve_file_stats); + +/** Write all metadata out to a FLAC stream via callbacks. + * + * (See FLAC__metadata_chain_write() for the details on how padding is + * used to write metadata in place if possible.) + * + * The \a handle must be open for updating and be seekable. The + * equivalent minimum stdio fopen() file mode is \c "r+" (or \c "r+b" + * for Windows). + * + * For this write function to be used, the chain must have been read with + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), + * not FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). + * Also, FLAC__metadata_chain_check_if_tempfile_needed() must have returned + * \c false. + * + * \param chain A pointer to an existing chain. + * \param use_padding See FLAC__metadata_chain_write() + * \param handle The I/O handle of the FLAC stream to write. The + * handle will NOT be closed after the metadata is + * written; that is the duty of the caller. + * \param callbacks A set of callbacks to use for I/O. The mandatory + * callbacks are \a write and \a seek. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if the write succeeded, else \c false. On failure, + * check the status with FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_write_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks); + +/** Write all metadata out to a FLAC stream via callbacks. + * + * (See FLAC__metadata_chain_write() for the details on how padding is + * used to write metadata in place if possible.) + * + * This version of the write-with-callbacks function must be used when + * FLAC__metadata_chain_check_if_tempfile_needed() returns true. In + * this function, you must supply an I/O handle corresponding to the + * FLAC file to edit, and a temporary handle to which the new FLAC + * file will be written. It is the caller's job to move this temporary + * FLAC file on top of the original FLAC file to complete the metadata + * edit. + * + * The \a handle must be open for reading and be seekable. The + * equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" + * for Windows). + * + * The \a temp_handle must be open for writing. The + * equivalent minimum stdio fopen() file mode is \c "w" (or \c "wb" + * for Windows). It should be an empty stream, or at least positioned + * at the start-of-file (in which case it is the caller's duty to + * truncate it on return). + * + * For this write function to be used, the chain must have been read with + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), + * not FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). + * Also, FLAC__metadata_chain_check_if_tempfile_needed() must have returned + * \c true. + * + * \param chain A pointer to an existing chain. + * \param use_padding See FLAC__metadata_chain_write() + * \param handle The I/O handle of the original FLAC stream to read. + * The handle will NOT be closed after the metadata is + * written; that is the duty of the caller. + * \param callbacks A set of callbacks to use for I/O on \a handle. + * The mandatory callbacks are \a read, \a seek, and + * \a eof. + * \param temp_handle The I/O handle of the FLAC stream to write. The + * handle will NOT be closed after the metadata is + * written; that is the duty of the caller. + * \param temp_callbacks + * A set of callbacks to use for I/O on temp_handle. + * The only mandatory callback is \a write. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if the write succeeded, else \c false. On failure, + * check the status with FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_write_with_callbacks_and_tempfile(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks, FLAC__IOHandle temp_handle, FLAC__IOCallbacks temp_callbacks); + +/** Merge adjacent PADDING blocks into a single block. + * + * \note This function does not write to the FLAC file, it only + * modifies the chain. + * + * \warning Any iterator on the current chain will become invalid after this + * call. You should delete the iterator and get a new one. + * + * \param chain A pointer to an existing chain. + * \assert + * \code chain != NULL \endcode + */ +FLAC_API void FLAC__metadata_chain_merge_padding(FLAC__Metadata_Chain *chain); + +/** This function will move all PADDING blocks to the end on the metadata, + * then merge them into a single block. + * + * \note This function does not write to the FLAC file, it only + * modifies the chain. + * + * \warning Any iterator on the current chain will become invalid after this + * call. You should delete the iterator and get a new one. + * + * \param chain A pointer to an existing chain. + * \assert + * \code chain != NULL \endcode + */ +FLAC_API void FLAC__metadata_chain_sort_padding(FLAC__Metadata_Chain *chain); + + +/*********** FLAC__Metadata_Iterator ***********/ + +/** Create a new iterator instance. + * + * \retval FLAC__Metadata_Iterator* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__Metadata_Iterator *FLAC__metadata_iterator_new(void); + +/** Free an iterator instance. Deletes the object pointed to by \a iterator. + * + * \param iterator A pointer to an existing iterator. + * \assert + * \code iterator != NULL \endcode + */ +FLAC_API void FLAC__metadata_iterator_delete(FLAC__Metadata_Iterator *iterator); + +/** Initialize the iterator to point to the first metadata block in the + * given chain. + * + * \param iterator A pointer to an existing iterator. + * \param chain A pointer to an existing and initialized (read) chain. + * \assert + * \code iterator != NULL \endcode + * \code chain != NULL \endcode + */ +FLAC_API void FLAC__metadata_iterator_init(FLAC__Metadata_Iterator *iterator, FLAC__Metadata_Chain *chain); + +/** Moves the iterator forward one metadata block, returning \c false if + * already at the end. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if already at the last metadata block of the chain, else + * \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_next(FLAC__Metadata_Iterator *iterator); + +/** Moves the iterator backward one metadata block, returning \c false if + * already at the beginning. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if already at the first metadata block of the chain, else + * \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_prev(FLAC__Metadata_Iterator *iterator); + +/** Get the type of the metadata block at the current position. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__MetadataType + * The type of the metadata block at the current iterator position. + */ +FLAC_API FLAC__MetadataType FLAC__metadata_iterator_get_block_type(const FLAC__Metadata_Iterator *iterator); + +/** Get the metadata block at the current position. You can modify + * the block in place but must write the chain before the changes + * are reflected to the FLAC file. You do not need to call + * FLAC__metadata_iterator_set_block() to reflect the changes; + * the pointer returned by FLAC__metadata_iterator_get_block() + * points directly into the chain. + * + * \warning + * Do not call FLAC__metadata_object_delete() on the returned object; + * to delete a block use FLAC__metadata_iterator_delete_block(). + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__StreamMetadata* + * The current metadata block. + */ +FLAC_API FLAC__StreamMetadata *FLAC__metadata_iterator_get_block(FLAC__Metadata_Iterator *iterator); + +/** Set the metadata block at the current position, replacing the existing + * block. The new block passed in becomes owned by the chain and it will be + * deleted when the chain is deleted. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block A pointer to a metadata block. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \code block != NULL \endcode + * \retval FLAC__bool + * \c false if the conditions in the above description are not met, or + * a memory allocation error occurs, otherwise \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_set_block(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block); + +/** Removes the current block from the chain. If \a replace_with_padding is + * \c true, the block will instead be replaced with a padding block of equal + * size. You can not delete the STREAMINFO block. The iterator will be + * left pointing to the block before the one just "deleted", even if + * \a replace_with_padding is \c true. + * + * \param iterator A pointer to an existing initialized iterator. + * \param replace_with_padding See above. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if the conditions in the above description are not met, + * otherwise \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_delete_block(FLAC__Metadata_Iterator *iterator, FLAC__bool replace_with_padding); + +/** Insert a new block before the current block. You cannot insert a block + * before the first STREAMINFO block. You cannot insert a STREAMINFO block + * as there can be only one, the one that already exists at the head when you + * read in a chain. The chain takes ownership of the new block and it will be + * deleted when the chain is deleted. The iterator will be left pointing to + * the new block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block A pointer to a metadata block to insert. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if the conditions in the above description are not met, or + * a memory allocation error occurs, otherwise \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_insert_block_before(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block); + +/** Insert a new block after the current block. You cannot insert a STREAMINFO + * block as there can be only one, the one that already exists at the head when + * you read in a chain. The chain takes ownership of the new block and it will + * be deleted when the chain is deleted. The iterator will be left pointing to + * the new block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block A pointer to a metadata block to insert. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if the conditions in the above description are not met, or + * a memory allocation error occurs, otherwise \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_insert_block_after(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block); + +/* \} */ + + +/** \defgroup flac_metadata_object FLAC/metadata.h: metadata object methods + * \ingroup flac_metadata + * + * \brief + * This module contains methods for manipulating FLAC metadata objects. + * + * Since many are variable length we have to be careful about the memory + * management. We decree that all pointers to data in the object are + * owned by the object and memory-managed by the object. + * + * Use the FLAC__metadata_object_new() and FLAC__metadata_object_delete() + * functions to create all instances. When using the + * FLAC__metadata_object_set_*() functions to set pointers to data, set + * \a copy to \c true to have the function make it's own copy of the data, or + * to \c false to give the object ownership of your data. In the latter case + * your pointer must be freeable by free() and will be free()d when the object + * is FLAC__metadata_object_delete()d. It is legal to pass a null pointer as + * the data pointer to a FLAC__metadata_object_set_*() function as long as + * the length argument is 0 and the \a copy argument is \c false. + * + * The FLAC__metadata_object_new() and FLAC__metadata_object_clone() function + * will return \c NULL in the case of a memory allocation error, otherwise a new + * object. The FLAC__metadata_object_set_*() functions return \c false in the + * case of a memory allocation error. + * + * We don't have the convenience of C++ here, so note that the library relies + * on you to keep the types straight. In other words, if you pass, for + * example, a FLAC__StreamMetadata* that represents a STREAMINFO block to + * FLAC__metadata_object_application_set_data(), you will get an assertion + * failure. + * + * For convenience the FLAC__metadata_object_vorbiscomment_*() functions + * maintain a trailing NUL on each Vorbis comment entry. This is not counted + * toward the length or stored in the stream, but it can make working with plain + * comments (those that don't contain embedded-NULs in the value) easier. + * Entries passed into these functions have trailing NULs added if missing, and + * returned entries are guaranteed to have a trailing NUL. + * + * The FLAC__metadata_object_vorbiscomment_*() functions that take a Vorbis + * comment entry/name/value will first validate that it complies with the Vorbis + * comment specification and return false if it does not. + * + * There is no need to recalculate the length field on metadata blocks you + * have modified. They will be calculated automatically before they are + * written back to a file. + * + * \{ + */ + + +/** Create a new metadata object instance of the given type. + * + * The object will be "empty"; i.e. values and data pointers will be \c 0, + * with the exception of FLAC__METADATA_TYPE_VORBIS_COMMENT, which will have + * the vendor string set (but zero comments). + * + * Do not pass in a value greater than or equal to + * \a FLAC__METADATA_TYPE_UNDEFINED unless you really know what you're + * doing. + * + * \param type Type of object to create + * \retval FLAC__StreamMetadata* + * \c NULL if there was an error allocating memory or the type code is + * greater than FLAC__MAX_METADATA_TYPE_CODE, else the new instance. + */ +FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type); + +/** Create a copy of an existing metadata object. + * + * The copy is a "deep" copy, i.e. dynamically allocated data within the + * object is also copied. The caller takes ownership of the new block and + * is responsible for freeing it with FLAC__metadata_object_delete(). + * + * \param object Pointer to object to copy. + * \assert + * \code object != NULL \endcode + * \retval FLAC__StreamMetadata* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_clone(const FLAC__StreamMetadata *object); + +/** Free a metadata object. Deletes the object pointed to by \a object. + * + * The delete is a "deep" delete, i.e. dynamically allocated data within the + * object is also deleted. + * + * \param object A pointer to an existing object. + * \assert + * \code object != NULL \endcode + */ +FLAC_API void FLAC__metadata_object_delete(FLAC__StreamMetadata *object); + +/** Compares two metadata objects. + * + * The compare is "deep", i.e. dynamically allocated data within the + * object is also compared. + * + * \param block1 A pointer to an existing object. + * \param block2 A pointer to an existing object. + * \assert + * \code block1 != NULL \endcode + * \code block2 != NULL \endcode + * \retval FLAC__bool + * \c true if objects are identical, else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_object_is_equal(const FLAC__StreamMetadata *block1, const FLAC__StreamMetadata *block2); + +/** Sets the application data of an APPLICATION block. + * + * If \a copy is \c true, a copy of the data is stored; otherwise, the object + * takes ownership of the pointer. The existing data will be freed if this + * function is successful, otherwise the original data will remain if \a copy + * is \c true and malloc() fails. + * + * \note It is safe to pass a const pointer to \a data if \a copy is \c true. + * + * \param object A pointer to an existing APPLICATION object. + * \param data A pointer to the data to set. + * \param length The length of \a data in bytes. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_APPLICATION \endcode + * \code (data != NULL && length > 0) || + * (data == NULL && length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_application_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, unsigned length, FLAC__bool copy); + +/** Resize the seekpoint array. + * + * If the size shrinks, elements will truncated; if it grows, new placeholder + * points will be added to the end. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param new_num_points The desired length of the array; may be \c 0. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code (object->data.seek_table.points == NULL && object->data.seek_table.num_points == 0) || + * (object->data.seek_table.points != NULL && object->data.seek_table.num_points > 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_resize_points(FLAC__StreamMetadata *object, unsigned new_num_points); + +/** Set a seekpoint in a seektable. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param point_num Index into seekpoint array to set. + * \param point The point to set. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code object->data.seek_table.num_points > point_num \endcode + */ +FLAC_API void FLAC__metadata_object_seektable_set_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point); + +/** Insert a seekpoint into a seektable. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param point_num Index into seekpoint array to set. + * \param point The point to set. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code object->data.seek_table.num_points >= point_num \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_insert_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point); + +/** Delete a seekpoint from a seektable. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param point_num Index into seekpoint array to set. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code object->data.seek_table.num_points > point_num \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_delete_point(FLAC__StreamMetadata *object, unsigned point_num); + +/** Check a seektable to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * seektable. + * + * \param object A pointer to an existing SEEKTABLE object. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if seek table is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_is_legal(const FLAC__StreamMetadata *object); + +/** Append a number of placeholder points to the end of a seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param num The number of placeholder points to append. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_placeholders(FLAC__StreamMetadata *object, unsigned num); + +/** Append a specific seek point template to the end of a seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param sample_number The sample number of the seek point template. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_point(FLAC__StreamMetadata *object, FLAC__uint64 sample_number); + +/** Append specific seek point templates to the end of a seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param sample_numbers An array of sample numbers for the seek points. + * \param num The number of seek point templates to append. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_points(FLAC__StreamMetadata *object, FLAC__uint64 sample_numbers[], unsigned num); + +/** Append a set of evenly-spaced seek point templates to the end of a + * seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param num The number of placeholder points to append. + * \param total_samples The total number of samples to be encoded; + * the seekpoints will be spaced approximately + * \a total_samples / \a num samples apart. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code total_samples > 0 \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_spaced_points(FLAC__StreamMetadata *object, unsigned num, FLAC__uint64 total_samples); + +/** Append a set of evenly-spaced seek point templates to the end of a + * seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param samples The number of samples apart to space the placeholder + * points. The first point will be at sample \c 0, the + * second at sample \a samples, then 2*\a samples, and + * so on. As long as \a samples and \a total_samples + * are greater than \c 0, there will always be at least + * one seekpoint at sample \c 0. + * \param total_samples The total number of samples to be encoded; + * the seekpoints will be spaced + * \a samples samples apart. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code samples > 0 \endcode + * \code total_samples > 0 \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_spaced_points_by_samples(FLAC__StreamMetadata *object, unsigned samples, FLAC__uint64 total_samples); + +/** Sort a seek table's seek points according to the format specification, + * removing duplicates. + * + * \param object A pointer to a seek table to be sorted. + * \param compact If \c false, behaves like FLAC__format_seektable_sort(). + * If \c true, duplicates are deleted and the seek table is + * shrunk appropriately; the number of placeholder points + * present in the seek table will be the same after the call + * as before. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_sort(FLAC__StreamMetadata *object, FLAC__bool compact); + +/** Sets the vendor string in a VORBIS_COMMENT block. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param entry The entry to set the vendor string to. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_vendor_string(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); + +/** Resize the comment array. + * + * If the size shrinks, elements will truncated; if it grows, new empty + * fields will be added to the end. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param new_num_comments The desired length of the array; may be \c 0. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code (object->data.vorbis_comment.comments == NULL && object->data.vorbis_comment.num_comments == 0) || + * (object->data.vorbis_comment.comments != NULL && object->data.vorbis_comment.num_comments > 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_resize_comments(FLAC__StreamMetadata *object, unsigned new_num_comments); + +/** Sets a comment in a VORBIS_COMMENT block. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param comment_num Index into comment array to set. + * \param entry The entry to set the comment to. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code comment_num < object->data.vorbis_comment.num_comments \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); + +/** Insert a comment in a VORBIS_COMMENT block at the given index. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param comment_num The index at which to insert the comment. The comments + * at and after \a comment_num move right one position. + * To append a comment to the end, set \a comment_num to + * \c object->data.vorbis_comment.num_comments . + * \param entry The comment to insert. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code object->data.vorbis_comment.num_comments >= comment_num \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_insert_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); + +/** Appends a comment to a VORBIS_COMMENT block. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param entry The comment to insert. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_append_comment(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); + +/** Replaces comments in a VORBIS_COMMENT block with a new one. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * Depending on the the value of \a all, either all or just the first comment + * whose field name(s) match the given entry's name will be replaced by the + * given entry. If no comments match, \a entry will simply be appended. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param entry The comment to insert. + * \param all If \c true, all comments whose field name matches + * \a entry's field name will be removed, and \a entry will + * be inserted at the position of the first matching + * comment. If \c false, only the first comment whose + * field name matches \a entry's field name will be + * replaced with \a entry. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_replace_comment(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool all, FLAC__bool copy); + +/** Delete a comment in a VORBIS_COMMENT block at the given index. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param comment_num The index of the comment to delete. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code object->data.vorbis_comment.num_comments > comment_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_delete_comment(FLAC__StreamMetadata *object, unsigned comment_num); + +/** Creates a Vorbis comment entry from NUL-terminated name and value strings. + * + * On return, the filled-in \a entry->entry pointer will point to malloc()ed + * memory and shall be owned by the caller. For convenience the entry will + * have a terminating NUL. + * + * \param entry A pointer to a Vorbis comment entry. The entry's + * \c entry pointer should not point to allocated + * memory as it will be overwritten. + * \param field_name The field name in ASCII, \c NUL terminated. + * \param field_value The field value in UTF-8, \c NUL terminated. + * \assert + * \code entry != NULL \endcode + * \code field_name != NULL \endcode + * \code field_value != NULL \endcode + * \retval FLAC__bool + * \c false if malloc() fails, or if \a field_name or \a field_value does + * not comply with the Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(FLAC__StreamMetadata_VorbisComment_Entry *entry, const char *field_name, const char *field_value); + +/** Splits a Vorbis comment entry into NUL-terminated name and value strings. + * + * The returned pointers to name and value will be allocated by malloc() + * and shall be owned by the caller. + * + * \param entry An existing Vorbis comment entry. + * \param field_name The address of where the returned pointer to the + * field name will be stored. + * \param field_value The address of where the returned pointer to the + * field value will be stored. + * \assert + * \code (entry.entry != NULL && entry.length > 0) \endcode + * \code memchr(entry.entry, '=', entry.length) != NULL \endcode + * \code field_name != NULL \endcode + * \code field_value != NULL \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_to_name_value_pair(const FLAC__StreamMetadata_VorbisComment_Entry entry, char **field_name, char **field_value); + +/** Check if the given Vorbis comment entry's field name matches the given + * field name. + * + * \param entry An existing Vorbis comment entry. + * \param field_name The field name to check. + * \param field_name_length The length of \a field_name, not including the + * terminating \c NUL. + * \assert + * \code (entry.entry != NULL && entry.length > 0) \endcode + * \retval FLAC__bool + * \c true if the field names match, else \c false + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_matches(const FLAC__StreamMetadata_VorbisComment_Entry entry, const char *field_name, unsigned field_name_length); + +/** Find a Vorbis comment with the given field name. + * + * The search begins at entry number \a offset; use an offset of 0 to + * search from the beginning of the comment array. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param offset The offset into the comment array from where to start + * the search. + * \param field_name The field name of the comment to find. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code field_name != NULL \endcode + * \retval int + * The offset in the comment array of the first comment whose field + * name matches \a field_name, or \c -1 if no match was found. + */ +FLAC_API int FLAC__metadata_object_vorbiscomment_find_entry_from(const FLAC__StreamMetadata *object, unsigned offset, const char *field_name); + +/** Remove first Vorbis comment matching the given field name. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param field_name The field name of comment to delete. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \retval int + * \c -1 for memory allocation error, \c 0 for no matching entries, + * \c 1 for one matching entry deleted. + */ +FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entry_matching(FLAC__StreamMetadata *object, const char *field_name); + +/** Remove all Vorbis comments matching the given field name. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param field_name The field name of comments to delete. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \retval int + * \c -1 for memory allocation error, \c 0 for no matching entries, + * else the number of matching entries deleted. + */ +FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entries_matching(FLAC__StreamMetadata *object, const char *field_name); + +/** Create a new CUESHEET track instance. + * + * The object will be "empty"; i.e. values and data pointers will be \c 0. + * + * \retval FLAC__StreamMetadata_CueSheet_Track* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_new(void); + +/** Create a copy of an existing CUESHEET track object. + * + * The copy is a "deep" copy, i.e. dynamically allocated data within the + * object is also copied. The caller takes ownership of the new object and + * is responsible for freeing it with + * FLAC__metadata_object_cuesheet_track_delete(). + * + * \param object Pointer to object to copy. + * \assert + * \code object != NULL \endcode + * \retval FLAC__StreamMetadata_CueSheet_Track* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_clone(const FLAC__StreamMetadata_CueSheet_Track *object); + +/** Delete a CUESHEET track object + * + * \param object A pointer to an existing CUESHEET track object. + * \assert + * \code object != NULL \endcode + */ +FLAC_API void FLAC__metadata_object_cuesheet_track_delete(FLAC__StreamMetadata_CueSheet_Track *object); + +/** Resize a track's index point array. + * + * If the size shrinks, elements will truncated; if it grows, new blank + * indices will be added to the end. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index of the track to modify. NOTE: this is not + * necessarily the same as the track's \a number field. + * \param new_num_indices The desired length of the array; may be \c 0. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \code (object->data.cue_sheet.tracks[track_num].indices == NULL && object->data.cue_sheet.tracks[track_num].num_indices == 0) || + * (object->data.cue_sheet.tracks[track_num].indices != NULL && object->data.cue_sheet.tracks[track_num].num_indices > 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_resize_indices(FLAC__StreamMetadata *object, unsigned track_num, unsigned new_num_indices); + +/** Insert an index point in a CUESHEET track at the given index. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index of the track to modify. NOTE: this is not + * necessarily the same as the track's \a number field. + * \param index_num The index into the track's index array at which to + * insert the index point. NOTE: this is not necessarily + * the same as the index point's \a number field. The + * indices at and after \a index_num move right one + * position. To append an index point to the end, set + * \a index_num to + * \c object->data.cue_sheet.tracks[track_num].num_indices . + * \param index The index point to insert. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \code object->data.cue_sheet.tracks[track_num].num_indices >= index_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num, FLAC__StreamMetadata_CueSheet_Index index); + +/** Insert a blank index point in a CUESHEET track at the given index. + * + * A blank index point is one in which all field values are zero. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index of the track to modify. NOTE: this is not + * necessarily the same as the track's \a number field. + * \param index_num The index into the track's index array at which to + * insert the index point. NOTE: this is not necessarily + * the same as the index point's \a number field. The + * indices at and after \a index_num move right one + * position. To append an index point to the end, set + * \a index_num to + * \c object->data.cue_sheet.tracks[track_num].num_indices . + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \code object->data.cue_sheet.tracks[track_num].num_indices >= index_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_blank_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num); + +/** Delete an index point in a CUESHEET track at the given index. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index into the track array of the track to + * modify. NOTE: this is not necessarily the same + * as the track's \a number field. + * \param index_num The index into the track's index array of the index + * to delete. NOTE: this is not necessarily the same + * as the index's \a number field. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \code object->data.cue_sheet.tracks[track_num].num_indices > index_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_delete_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num); + +/** Resize the track array. + * + * If the size shrinks, elements will truncated; if it grows, new blank + * tracks will be added to the end. + * + * \param object A pointer to an existing CUESHEET object. + * \param new_num_tracks The desired length of the array; may be \c 0. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code (object->data.cue_sheet.tracks == NULL && object->data.cue_sheet.num_tracks == 0) || + * (object->data.cue_sheet.tracks != NULL && object->data.cue_sheet.num_tracks > 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_resize_tracks(FLAC__StreamMetadata *object, unsigned new_num_tracks); + +/** Sets a track in a CUESHEET block. + * + * If \a copy is \c true, a copy of the track is stored; otherwise, the object + * takes ownership of the \a track pointer. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num Index into track array to set. NOTE: this is not + * necessarily the same as the track's \a number field. + * \param track The track to set the track to. You may safely pass in + * a const pointer if \a copy is \c true. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code track_num < object->data.cue_sheet.num_tracks \endcode + * \code (track->indices != NULL && track->num_indices > 0) || + * (track->indices == NULL && track->num_indices == 0) + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_set_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy); + +/** Insert a track in a CUESHEET block at the given index. + * + * If \a copy is \c true, a copy of the track is stored; otherwise, the object + * takes ownership of the \a track pointer. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index at which to insert the track. NOTE: this + * is not necessarily the same as the track's \a number + * field. The tracks at and after \a track_num move right + * one position. To append a track to the end, set + * \a track_num to \c object->data.cue_sheet.num_tracks . + * \param track The track to insert. You may safely pass in a const + * pointer if \a copy is \c true. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks >= track_num \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy); + +/** Insert a blank track in a CUESHEET block at the given index. + * + * A blank track is one in which all field values are zero. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index at which to insert the track. NOTE: this + * is not necessarily the same as the track's \a number + * field. The tracks at and after \a track_num move right + * one position. To append a track to the end, set + * \a track_num to \c object->data.cue_sheet.num_tracks . + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks >= track_num \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_blank_track(FLAC__StreamMetadata *object, unsigned track_num); + +/** Delete a track in a CUESHEET block at the given index. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index into the track array of the track to + * delete. NOTE: this is not necessarily the same + * as the track's \a number field. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_delete_track(FLAC__StreamMetadata *object, unsigned track_num); + +/** Check a cue sheet to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * cue sheet. + * + * \param object A pointer to an existing CUESHEET object. + * \param check_cd_da_subset If \c true, check CUESHEET against more + * stringent requirements for a CD-DA (audio) disc. + * \param violation Address of a pointer to a string. If there is a + * violation, a pointer to a string explanation of the + * violation will be returned here. \a violation may be + * \c NULL if you don't need the returned string. Do not + * free the returned string; it will always point to static + * data. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \retval FLAC__bool + * \c false if cue sheet is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_is_legal(const FLAC__StreamMetadata *object, FLAC__bool check_cd_da_subset, const char **violation); + +/** Calculate and return the CDDB/freedb ID for a cue sheet. The function + * assumes the cue sheet corresponds to a CD; the result is undefined + * if the cuesheet's is_cd bit is not set. + * + * \param object A pointer to an existing CUESHEET object. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \retval FLAC__uint32 + * The unsigned integer representation of the CDDB/freedb ID + */ +FLAC_API FLAC__uint32 FLAC__metadata_object_cuesheet_calculate_cddb_id(const FLAC__StreamMetadata *object); + +/** Sets the MIME type of a PICTURE block. + * + * If \a copy is \c true, a copy of the string is stored; otherwise, the object + * takes ownership of the pointer. The existing string will be freed if this + * function is successful, otherwise the original string will remain if \a copy + * is \c true and malloc() fails. + * + * \note It is safe to pass a const pointer to \a mime_type if \a copy is \c true. + * + * \param object A pointer to an existing PICTURE object. + * \param mime_type A pointer to the MIME type string. The string must be + * ASCII characters 0x20-0x7e, NUL-terminated. No validation + * is done. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode + * \code (mime_type != NULL) \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_picture_set_mime_type(FLAC__StreamMetadata *object, char *mime_type, FLAC__bool copy); + +/** Sets the description of a PICTURE block. + * + * If \a copy is \c true, a copy of the string is stored; otherwise, the object + * takes ownership of the pointer. The existing string will be freed if this + * function is successful, otherwise the original string will remain if \a copy + * is \c true and malloc() fails. + * + * \note It is safe to pass a const pointer to \a description if \a copy is \c true. + * + * \param object A pointer to an existing PICTURE object. + * \param description A pointer to the description string. The string must be + * valid UTF-8, NUL-terminated. No validation is done. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode + * \code (description != NULL) \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_picture_set_description(FLAC__StreamMetadata *object, FLAC__byte *description, FLAC__bool copy); + +/** Sets the picture data of a PICTURE block. + * + * If \a copy is \c true, a copy of the data is stored; otherwise, the object + * takes ownership of the pointer. Also sets the \a data_length field of the + * metadata object to what is passed in as the \a length parameter. The + * existing data will be freed if this function is successful, otherwise the + * original data and data_length will remain if \a copy is \c true and + * malloc() fails. + * + * \note It is safe to pass a const pointer to \a data if \a copy is \c true. + * + * \param object A pointer to an existing PICTURE object. + * \param data A pointer to the data to set. + * \param length The length of \a data in bytes. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode + * \code (data != NULL && length > 0) || + * (data == NULL && length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_picture_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, FLAC__uint32 length, FLAC__bool copy); + +/** Check a PICTURE block to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * PICTURE block. + * + * \param object A pointer to existing PICTURE block to be checked. + * \param violation Address of a pointer to a string. If there is a + * violation, a pointer to a string explanation of the + * violation will be returned here. \a violation may be + * \c NULL if you don't need the returned string. Do not + * free the returned string; it will always point to static + * data. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode + * \retval FLAC__bool + * \c false if PICTURE block is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_picture_is_legal(const FLAC__StreamMetadata *object, const char **violation); + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/ordinals.h b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/ordinals.h new file mode 100644 index 0000000..a7a5cd9 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/ordinals.h @@ -0,0 +1,80 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__ORDINALS_H +#define FLAC__ORDINALS_H + +#if !(defined(_MSC_VER) || defined(__BORLANDC__) || defined(__EMX__)) +#include +#endif + +typedef signed char FLAC__int8; +typedef unsigned char FLAC__uint8; + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef __int16 FLAC__int16; +typedef __int32 FLAC__int32; +typedef __int64 FLAC__int64; +typedef unsigned __int16 FLAC__uint16; +typedef unsigned __int32 FLAC__uint32; +typedef unsigned __int64 FLAC__uint64; +#elif defined(__EMX__) +typedef short FLAC__int16; +typedef long FLAC__int32; +typedef long long FLAC__int64; +typedef unsigned short FLAC__uint16; +typedef unsigned long FLAC__uint32; +typedef unsigned long long FLAC__uint64; +#else +typedef int16_t FLAC__int16; +typedef int32_t FLAC__int32; +typedef int64_t FLAC__int64; +typedef uint16_t FLAC__uint16; +typedef uint32_t FLAC__uint32; +typedef uint64_t FLAC__uint64; +#endif + +typedef int FLAC__bool; + +typedef FLAC__uint8 FLAC__byte; + +#ifdef true +#undef true +#endif +#ifdef false +#undef false +#endif +#ifndef __cplusplus +#define true 1 +#define false 0 +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/stream_decoder.h b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/stream_decoder.h new file mode 100644 index 0000000..9ac1594 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/stream_decoder.h @@ -0,0 +1,1559 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__STREAM_DECODER_H +#define FLAC__STREAM_DECODER_H + +#include /* for FILE */ +#include "export.h" +#include "format.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/** \file include/FLAC/stream_decoder.h + * + * \brief + * This module contains the functions which implement the stream + * decoder. + * + * See the detailed documentation in the + * \link flac_stream_decoder stream decoder \endlink module. + */ + +/** \defgroup flac_decoder FLAC/ \*_decoder.h: decoder interfaces + * \ingroup flac + * + * \brief + * This module describes the decoder layers provided by libFLAC. + * + * The stream decoder can be used to decode complete streams either from + * the client via callbacks, or directly from a file, depending on how + * it is initialized. When decoding via callbacks, the client provides + * callbacks for reading FLAC data and writing decoded samples, and + * handling metadata and errors. If the client also supplies seek-related + * callback, the decoder function for sample-accurate seeking within the + * FLAC input is also available. When decoding from a file, the client + * needs only supply a filename or open \c FILE* and write/metadata/error + * callbacks; the rest of the callbacks are supplied internally. For more + * info see the \link flac_stream_decoder stream decoder \endlink module. + */ + +/** \defgroup flac_stream_decoder FLAC/stream_decoder.h: stream decoder interface + * \ingroup flac_decoder + * + * \brief + * This module contains the functions which implement the stream + * decoder. + * + * The stream decoder can decode native FLAC, and optionally Ogg FLAC + * (check FLAC_API_SUPPORTS_OGG_FLAC) streams and files. + * + * The basic usage of this decoder is as follows: + * - The program creates an instance of a decoder using + * FLAC__stream_decoder_new(). + * - The program overrides the default settings using + * FLAC__stream_decoder_set_*() functions. + * - The program initializes the instance to validate the settings and + * prepare for decoding using + * - FLAC__stream_decoder_init_stream() or FLAC__stream_decoder_init_FILE() + * or FLAC__stream_decoder_init_file() for native FLAC, + * - FLAC__stream_decoder_init_ogg_stream() or FLAC__stream_decoder_init_ogg_FILE() + * or FLAC__stream_decoder_init_ogg_file() for Ogg FLAC + * - The program calls the FLAC__stream_decoder_process_*() functions + * to decode data, which subsequently calls the callbacks. + * - The program finishes the decoding with FLAC__stream_decoder_finish(), + * which flushes the input and output and resets the decoder to the + * uninitialized state. + * - The instance may be used again or deleted with + * FLAC__stream_decoder_delete(). + * + * In more detail, the program will create a new instance by calling + * FLAC__stream_decoder_new(), then call FLAC__stream_decoder_set_*() + * functions to override the default decoder options, and call + * one of the FLAC__stream_decoder_init_*() functions. + * + * There are three initialization functions for native FLAC, one for + * setting up the decoder to decode FLAC data from the client via + * callbacks, and two for decoding directly from a FLAC file. + * + * For decoding via callbacks, use FLAC__stream_decoder_init_stream(). + * You must also supply several callbacks for handling I/O. Some (like + * seeking) are optional, depending on the capabilities of the input. + * + * For decoding directly from a file, use FLAC__stream_decoder_init_FILE() + * or FLAC__stream_decoder_init_file(). Then you must only supply an open + * \c FILE* or filename and fewer callbacks; the decoder will handle + * the other callbacks internally. + * + * There are three similarly-named init functions for decoding from Ogg + * FLAC streams. Check \c FLAC_API_SUPPORTS_OGG_FLAC to find out if the + * library has been built with Ogg support. + * + * Once the decoder is initialized, your program will call one of several + * functions to start the decoding process: + * + * - FLAC__stream_decoder_process_single() - Tells the decoder to process at + * most one metadata block or audio frame and return, calling either the + * metadata callback or write callback, respectively, once. If the decoder + * loses sync it will return with only the error callback being called. + * - FLAC__stream_decoder_process_until_end_of_metadata() - Tells the decoder + * to process the stream from the current location and stop upon reaching + * the first audio frame. The client will get one metadata, write, or error + * callback per metadata block, audio frame, or sync error, respectively. + * - FLAC__stream_decoder_process_until_end_of_stream() - Tells the decoder + * to process the stream from the current location until the read callback + * returns FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM or + * FLAC__STREAM_DECODER_READ_STATUS_ABORT. The client will get one metadata, + * write, or error callback per metadata block, audio frame, or sync error, + * respectively. + * + * When the decoder has finished decoding (normally or through an abort), + * the instance is finished by calling FLAC__stream_decoder_finish(), which + * ensures the decoder is in the correct state and frees memory. Then the + * instance may be deleted with FLAC__stream_decoder_delete() or initialized + * again to decode another stream. + * + * Seeking is exposed through the FLAC__stream_decoder_seek_absolute() method. + * At any point after the stream decoder has been initialized, the client can + * call this function to seek to an exact sample within the stream. + * Subsequently, the first time the write callback is called it will be + * passed a (possibly partial) block starting at that sample. + * + * If the client cannot seek via the callback interface provided, but still + * has another way of seeking, it can flush the decoder using + * FLAC__stream_decoder_flush() and start feeding data from the new position + * through the read callback. + * + * The stream decoder also provides MD5 signature checking. If this is + * turned on before initialization, FLAC__stream_decoder_finish() will + * report when the decoded MD5 signature does not match the one stored + * in the STREAMINFO block. MD5 checking is automatically turned off + * (until the next FLAC__stream_decoder_reset()) if there is no signature + * in the STREAMINFO block or when a seek is attempted. + * + * The FLAC__stream_decoder_set_metadata_*() functions deserve special + * attention. By default, the decoder only calls the metadata_callback for + * the STREAMINFO block. These functions allow you to tell the decoder + * explicitly which blocks to parse and return via the metadata_callback + * and/or which to skip. Use a FLAC__stream_decoder_set_metadata_respond_all(), + * FLAC__stream_decoder_set_metadata_ignore() ... or FLAC__stream_decoder_set_metadata_ignore_all(), + * FLAC__stream_decoder_set_metadata_respond() ... sequence to exactly specify + * which blocks to return. Remember that metadata blocks can potentially + * be big (for example, cover art) so filtering out the ones you don't + * use can reduce the memory requirements of the decoder. Also note the + * special forms FLAC__stream_decoder_set_metadata_respond_application(id) + * and FLAC__stream_decoder_set_metadata_ignore_application(id) for + * filtering APPLICATION blocks based on the application ID. + * + * STREAMINFO and SEEKTABLE blocks are always parsed and used internally, but + * they still can legally be filtered from the metadata_callback. + * + * \note + * The "set" functions may only be called when the decoder is in the + * state FLAC__STREAM_DECODER_UNINITIALIZED, i.e. after + * FLAC__stream_decoder_new() or FLAC__stream_decoder_finish(), but + * before FLAC__stream_decoder_init_*(). If this is the case they will + * return \c true, otherwise \c false. + * + * \note + * FLAC__stream_decoder_finish() resets all settings to the constructor + * defaults, including the callbacks. + * + * \{ + */ + + +/** State values for a FLAC__StreamDecoder + * + * The decoder's state can be obtained by calling FLAC__stream_decoder_get_state(). + */ +typedef enum { + + FLAC__STREAM_DECODER_SEARCH_FOR_METADATA = 0, + /**< The decoder is ready to search for metadata. */ + + FLAC__STREAM_DECODER_READ_METADATA, + /**< The decoder is ready to or is in the process of reading metadata. */ + + FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC, + /**< The decoder is ready to or is in the process of searching for the + * frame sync code. + */ + + FLAC__STREAM_DECODER_READ_FRAME, + /**< The decoder is ready to or is in the process of reading a frame. */ + + FLAC__STREAM_DECODER_END_OF_STREAM, + /**< The decoder has reached the end of the stream. */ + + FLAC__STREAM_DECODER_OGG_ERROR, + /**< An error occurred in the underlying Ogg layer. */ + + FLAC__STREAM_DECODER_SEEK_ERROR, + /**< An error occurred while seeking. The decoder must be flushed + * with FLAC__stream_decoder_flush() or reset with + * FLAC__stream_decoder_reset() before decoding can continue. + */ + + FLAC__STREAM_DECODER_ABORTED, + /**< The decoder was aborted by the read callback. */ + + FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR, + /**< An error occurred allocating memory. The decoder is in an invalid + * state and can no longer be used. + */ + + FLAC__STREAM_DECODER_UNINITIALIZED + /**< The decoder is in the uninitialized state; one of the + * FLAC__stream_decoder_init_*() functions must be called before samples + * can be processed. + */ + +} FLAC__StreamDecoderState; + +/** Maps a FLAC__StreamDecoderState to a C string. + * + * Using a FLAC__StreamDecoderState as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderStateString[]; + + +/** Possible return values for the FLAC__stream_decoder_init_*() functions. + */ +typedef enum { + + FLAC__STREAM_DECODER_INIT_STATUS_OK = 0, + /**< Initialization was successful. */ + + FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER, + /**< The library was not compiled with support for the given container + * format. + */ + + FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS, + /**< A required callback was not supplied. */ + + FLAC__STREAM_DECODER_INIT_STATUS_MEMORY_ALLOCATION_ERROR, + /**< An error occurred allocating memory. */ + + FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE, + /**< fopen() failed in FLAC__stream_decoder_init_file() or + * FLAC__stream_decoder_init_ogg_file(). */ + + FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED + /**< FLAC__stream_decoder_init_*() was called when the decoder was + * already initialized, usually because + * FLAC__stream_decoder_finish() was not called. + */ + +} FLAC__StreamDecoderInitStatus; + +/** Maps a FLAC__StreamDecoderInitStatus to a C string. + * + * Using a FLAC__StreamDecoderInitStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderInitStatusString[]; + + +/** Return values for the FLAC__StreamDecoder read callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, + /**< The read was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM, + /**< The read was attempted while at the end of the stream. Note that + * the client must only return this value when the read callback was + * called when already at the end of the stream. Otherwise, if the read + * itself moves to the end of the stream, the client should still return + * the data and \c FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, and then on + * the next read callback it should return + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM with a byte count + * of \c 0. + */ + + FLAC__STREAM_DECODER_READ_STATUS_ABORT + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + +} FLAC__StreamDecoderReadStatus; + +/** Maps a FLAC__StreamDecoderReadStatus to a C string. + * + * Using a FLAC__StreamDecoderReadStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderReadStatusString[]; + + +/** Return values for the FLAC__StreamDecoder seek callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_SEEK_STATUS_OK, + /**< The seek was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_SEEK_STATUS_ERROR, + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + + FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED + /**< Client does not support seeking. */ + +} FLAC__StreamDecoderSeekStatus; + +/** Maps a FLAC__StreamDecoderSeekStatus to a C string. + * + * Using a FLAC__StreamDecoderSeekStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderSeekStatusString[]; + + +/** Return values for the FLAC__StreamDecoder tell callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_TELL_STATUS_OK, + /**< The tell was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_TELL_STATUS_ERROR, + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + + FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED + /**< Client does not support telling the position. */ + +} FLAC__StreamDecoderTellStatus; + +/** Maps a FLAC__StreamDecoderTellStatus to a C string. + * + * Using a FLAC__StreamDecoderTellStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderTellStatusString[]; + + +/** Return values for the FLAC__StreamDecoder length callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_LENGTH_STATUS_OK, + /**< The length call was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR, + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + + FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED + /**< Client does not support reporting the length. */ + +} FLAC__StreamDecoderLengthStatus; + +/** Maps a FLAC__StreamDecoderLengthStatus to a C string. + * + * Using a FLAC__StreamDecoderLengthStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderLengthStatusString[]; + + +/** Return values for the FLAC__StreamDecoder write callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE, + /**< The write was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_WRITE_STATUS_ABORT + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + +} FLAC__StreamDecoderWriteStatus; + +/** Maps a FLAC__StreamDecoderWriteStatus to a C string. + * + * Using a FLAC__StreamDecoderWriteStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderWriteStatusString[]; + + +/** Possible values passed back to the FLAC__StreamDecoder error callback. + * \c FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC is the generic catch- + * all. The rest could be caused by bad sync (false synchronization on + * data that is not the start of a frame) or corrupted data. The error + * itself is the decoder's best guess at what happened assuming a correct + * sync. For example \c FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER + * could be caused by a correct sync on the start of a frame, but some + * data in the frame header was corrupted. Or it could be the result of + * syncing on a point the stream that looked like the starting of a frame + * but was not. \c FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM + * could be because the decoder encountered a valid frame made by a future + * version of the encoder which it cannot parse, or because of a false + * sync making it appear as though an encountered frame was generated by + * a future encoder. + */ +typedef enum { + + FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC, + /**< An error in the stream caused the decoder to lose synchronization. */ + + FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER, + /**< The decoder encountered a corrupted frame header. */ + + FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH, + /**< The frame's data did not match the CRC in the footer. */ + + FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM + /**< The decoder encountered reserved fields in use in the stream. */ + +} FLAC__StreamDecoderErrorStatus; + +/** Maps a FLAC__StreamDecoderErrorStatus to a C string. + * + * Using a FLAC__StreamDecoderErrorStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderErrorStatusString[]; + + +/*********************************************************************** + * + * class FLAC__StreamDecoder + * + ***********************************************************************/ + +struct FLAC__StreamDecoderProtected; +struct FLAC__StreamDecoderPrivate; +/** The opaque structure definition for the stream decoder type. + * See the \link flac_stream_decoder stream decoder module \endlink + * for a detailed description. + */ +typedef struct { + struct FLAC__StreamDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */ + struct FLAC__StreamDecoderPrivate *private_; /* avoid the C++ keyword 'private' */ +} FLAC__StreamDecoder; + +/** Signature for the read callback. + * + * A function pointer matching this signature must be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder needs more input data. The address of the + * buffer to be filled is supplied, along with the number of bytes the + * buffer can hold. The callback may choose to supply less data and + * modify the byte count but must be careful not to overflow the buffer. + * The callback then returns a status code chosen from + * FLAC__StreamDecoderReadStatus. + * + * Here is an example of a read callback for stdio streams: + * \code + * FLAC__StreamDecoderReadStatus read_cb(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * if(*bytes > 0) { + * *bytes = fread(buffer, sizeof(FLAC__byte), *bytes, file); + * if(ferror(file)) + * return FLAC__STREAM_DECODER_READ_STATUS_ABORT; + * else if(*bytes == 0) + * return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; + * else + * return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; + * } + * else + * return FLAC__STREAM_DECODER_READ_STATUS_ABORT; + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param buffer A pointer to a location for the callee to store + * data to be decoded. + * \param bytes A pointer to the size of the buffer. On entry + * to the callback, it contains the maximum number + * of bytes that may be stored in \a buffer. The + * callee must set it to the actual number of bytes + * stored (0 in case of error or end-of-stream) before + * returning. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderReadStatus + * The callee's return status. Note that the callback should return + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM if and only if + * zero bytes were read and there is no more data to be read. + */ +typedef FLAC__StreamDecoderReadStatus (*FLAC__StreamDecoderReadCallback)(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data); + +/** Signature for the seek callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder needs to seek the input stream. The decoder + * will pass the absolute byte offset to seek to, 0 meaning the + * beginning of the stream. + * + * Here is an example of a seek callback for stdio streams: + * \code + * FLAC__StreamDecoderSeekStatus seek_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * if(file == stdin) + * return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED; + * else if(fseeko(file, (off_t)absolute_byte_offset, SEEK_SET) < 0) + * return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; + * else + * return FLAC__STREAM_DECODER_SEEK_STATUS_OK; + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param absolute_byte_offset The offset from the beginning of the stream + * to seek to. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderSeekStatus + * The callee's return status. + */ +typedef FLAC__StreamDecoderSeekStatus (*FLAC__StreamDecoderSeekCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data); + +/** Signature for the tell callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder wants to know the current position of the + * stream. The callback should return the byte offset from the + * beginning of the stream. + * + * Here is an example of a tell callback for stdio streams: + * \code + * FLAC__StreamDecoderTellStatus tell_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * off_t pos; + * if(file == stdin) + * return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED; + * else if((pos = ftello(file)) < 0) + * return FLAC__STREAM_DECODER_TELL_STATUS_ERROR; + * else { + * *absolute_byte_offset = (FLAC__uint64)pos; + * return FLAC__STREAM_DECODER_TELL_STATUS_OK; + * } + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param absolute_byte_offset A pointer to storage for the current offset + * from the beginning of the stream. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderTellStatus + * The callee's return status. + */ +typedef FLAC__StreamDecoderTellStatus (*FLAC__StreamDecoderTellCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data); + +/** Signature for the length callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder wants to know the total length of the stream + * in bytes. + * + * Here is an example of a length callback for stdio streams: + * \code + * FLAC__StreamDecoderLengthStatus length_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * struct stat filestats; + * + * if(file == stdin) + * return FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED; + * else if(fstat(fileno(file), &filestats) != 0) + * return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; + * else { + * *stream_length = (FLAC__uint64)filestats.st_size; + * return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; + * } + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param stream_length A pointer to storage for the length of the stream + * in bytes. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderLengthStatus + * The callee's return status. + */ +typedef FLAC__StreamDecoderLengthStatus (*FLAC__StreamDecoderLengthCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data); + +/** Signature for the EOF callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder needs to know if the end of the stream has + * been reached. + * + * Here is an example of a EOF callback for stdio streams: + * FLAC__bool eof_cb(const FLAC__StreamDecoder *decoder, void *client_data) + * \code + * { + * FILE *file = ((MyClientData*)client_data)->file; + * return feof(file)? true : false; + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__bool + * \c true if the currently at the end of the stream, else \c false. + */ +typedef FLAC__bool (*FLAC__StreamDecoderEofCallback)(const FLAC__StreamDecoder *decoder, void *client_data); + +/** Signature for the write callback. + * + * A function pointer matching this signature must be passed to one of + * the FLAC__stream_decoder_init_*() functions. + * The supplied function will be called when the decoder has decoded a + * single audio frame. The decoder will pass the frame metadata as well + * as an array of pointers (one for each channel) pointing to the + * decoded audio. + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param frame The description of the decoded frame. See + * FLAC__Frame. + * \param buffer An array of pointers to decoded channels of data. + * Each pointer will point to an array of signed + * samples of length \a frame->header.blocksize. + * Channels will be ordered according to the FLAC + * specification; see the documentation for the + * frame header. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderWriteStatus + * The callee's return status. + */ +typedef FLAC__StreamDecoderWriteStatus (*FLAC__StreamDecoderWriteCallback)(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); + +/** Signature for the metadata callback. + * + * A function pointer matching this signature must be passed to one of + * the FLAC__stream_decoder_init_*() functions. + * The supplied function will be called when the decoder has decoded a + * metadata block. In a valid FLAC file there will always be one + * \c STREAMINFO block, followed by zero or more other metadata blocks. + * These will be supplied by the decoder in the same order as they + * appear in the stream and always before the first audio frame (i.e. + * write callback). The metadata block that is passed in must not be + * modified, and it doesn't live beyond the callback, so you should make + * a copy of it with FLAC__metadata_object_clone() if you will need it + * elsewhere. Since metadata blocks can potentially be large, by + * default the decoder only calls the metadata callback for the + * \c STREAMINFO block; you can instruct the decoder to pass or filter + * other blocks with FLAC__stream_decoder_set_metadata_*() calls. + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param metadata The decoded metadata block. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + */ +typedef void (*FLAC__StreamDecoderMetadataCallback)(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); + +/** Signature for the error callback. + * + * A function pointer matching this signature must be passed to one of + * the FLAC__stream_decoder_init_*() functions. + * The supplied function will be called whenever an error occurs during + * decoding. + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param status The error encountered by the decoder. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + */ +typedef void (*FLAC__StreamDecoderErrorCallback)(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); + + +/*********************************************************************** + * + * Class constructor/destructor + * + ***********************************************************************/ + +/** Create a new stream decoder instance. The instance is created with + * default settings; see the individual FLAC__stream_decoder_set_*() + * functions for each setting's default. + * + * \retval FLAC__StreamDecoder* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamDecoder *FLAC__stream_decoder_new(void); + +/** Free a decoder instance. Deletes the object pointed to by \a decoder. + * + * \param decoder A pointer to an existing decoder. + * \assert + * \code decoder != NULL \endcode + */ +FLAC_API void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder); + + +/*********************************************************************** + * + * Public class method prototypes + * + ***********************************************************************/ + +/** Set the serial number for the FLAC stream within the Ogg container. + * The default behavior is to use the serial number of the first Ogg + * page. Setting a serial number here will explicitly specify which + * stream is to be decoded. + * + * \note + * This does not need to be set for native FLAC decoding. + * + * \default \c use serial number of first page + * \param decoder A decoder instance to set. + * \param serial_number See above. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_ogg_serial_number(FLAC__StreamDecoder *decoder, long serial_number); + +/** Set the "MD5 signature checking" flag. If \c true, the decoder will + * compute the MD5 signature of the unencoded audio data while decoding + * and compare it to the signature from the STREAMINFO block, if it + * exists, during FLAC__stream_decoder_finish(). + * + * MD5 signature checking will be turned off (until the next + * FLAC__stream_decoder_reset()) if there is no signature in the + * STREAMINFO block or when a seek is attempted. + * + * Clients that do not use the MD5 check should leave this off to speed + * up decoding. + * + * \default \c false + * \param decoder A decoder instance to set. + * \param value Flag value (see above). + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_md5_checking(FLAC__StreamDecoder *decoder, FLAC__bool value); + +/** Direct the decoder to pass on all metadata blocks of type \a type. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \param type See above. + * \assert + * \code decoder != NULL \endcode + * \a type is valid + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecoder *decoder, FLAC__MetadataType type); + +/** Direct the decoder to pass on all APPLICATION metadata blocks of the + * given \a id. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \param id See above. + * \assert + * \code decoder != NULL \endcode + * \code id != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]); + +/** Direct the decoder to pass on all metadata blocks of any type. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_all(FLAC__StreamDecoder *decoder); + +/** Direct the decoder to filter out all metadata blocks of type \a type. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \param type See above. + * \assert + * \code decoder != NULL \endcode + * \a type is valid + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder *decoder, FLAC__MetadataType type); + +/** Direct the decoder to filter out all APPLICATION metadata blocks of + * the given \a id. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \param id See above. + * \assert + * \code decoder != NULL \endcode + * \code id != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]); + +/** Direct the decoder to filter out all metadata blocks of any type. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all(FLAC__StreamDecoder *decoder); + +/** Get the current decoder state. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderState + * The current decoder state. + */ +FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_get_state(const FLAC__StreamDecoder *decoder); + +/** Get the current decoder state as a C string. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval const char * + * The decoder state as a C string. Do not modify the contents. + */ +FLAC_API const char *FLAC__stream_decoder_get_resolved_state_string(const FLAC__StreamDecoder *decoder); + +/** Get the "MD5 signature checking" flag. + * This is the value of the setting, not whether or not the decoder is + * currently checking the MD5 (remember, it can be turned off automatically + * by a seek). When the decoder is reset the flag will be restored to the + * value returned by this function. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * See above. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_get_md5_checking(const FLAC__StreamDecoder *decoder); + +/** Get the total number of samples in the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the \c STREAMINFO block. A value of \c 0 means "unknown". + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API FLAC__uint64 FLAC__stream_decoder_get_total_samples(const FLAC__StreamDecoder *decoder); + +/** Get the current number of channels in the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API unsigned FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder); + +/** Get the current channel assignment in the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__ChannelAssignment + * See above. + */ +FLAC_API FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment(const FLAC__StreamDecoder *decoder); + +/** Get the current sample resolution in the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder); + +/** Get the current sample rate in Hz of the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder); + +/** Get the current blocksize of the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder); + +/** Returns the decoder's current read position within the stream. + * The position is the byte offset from the start of the stream. + * Bytes before this position have been fully decoded. Note that + * there may still be undecoded bytes in the decoder's read FIFO. + * The returned position is correct even after a seek. + * + * \warning This function currently only works for native FLAC, + * not Ogg FLAC streams. + * + * \param decoder A decoder instance to query. + * \param position Address at which to return the desired position. + * \assert + * \code decoder != NULL \endcode + * \code position != NULL \endcode + * \retval FLAC__bool + * \c true if successful, \c false if the stream is not native FLAC, + * or there was an error from the 'tell' callback or it returned + * \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position(const FLAC__StreamDecoder *decoder, FLAC__uint64 *position); + +/** Initialize the decoder instance to decode native FLAC streams. + * + * This flavor of initialization sets up the decoder to decode from a + * native FLAC stream. I/O is performed via callbacks to the client. + * For decoding from a plain file via filename or open FILE*, + * FLAC__stream_decoder_init_file() and FLAC__stream_decoder_init_FILE() + * provide a simpler interface. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \param decoder An uninitialized decoder instance. + * \param read_callback See FLAC__StreamDecoderReadCallback. This + * pointer must not be \c NULL. + * \param seek_callback See FLAC__StreamDecoderSeekCallback. This + * pointer may be \c NULL if seeking is not + * supported. If \a seek_callback is not \c NULL then a + * \a tell_callback, \a length_callback, and \a eof_callback must also be supplied. + * Alternatively, a dummy seek callback that just + * returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param tell_callback See FLAC__StreamDecoderTellCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a tell_callback must also be supplied. + * Alternatively, a dummy tell callback that just + * returns \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param length_callback See FLAC__StreamDecoderLengthCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a length_callback must also be supplied. + * Alternatively, a dummy length callback that just + * returns \c FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param eof_callback See FLAC__StreamDecoderEofCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a eof_callback must also be supplied. + * Alternatively, a dummy length callback that just + * returns \c false + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_stream( + FLAC__StreamDecoder *decoder, + FLAC__StreamDecoderReadCallback read_callback, + FLAC__StreamDecoderSeekCallback seek_callback, + FLAC__StreamDecoderTellCallback tell_callback, + FLAC__StreamDecoderLengthCallback length_callback, + FLAC__StreamDecoderEofCallback eof_callback, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode Ogg FLAC streams. + * + * This flavor of initialization sets up the decoder to decode from a + * FLAC stream in an Ogg container. I/O is performed via callbacks to the + * client. For decoding from a plain file via filename or open FILE*, + * FLAC__stream_decoder_init_ogg_file() and FLAC__stream_decoder_init_ogg_FILE() + * provide a simpler interface. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \note Support for Ogg FLAC in the library is optional. If this + * library has been built without support for Ogg FLAC, this function + * will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER. + * + * \param decoder An uninitialized decoder instance. + * \param read_callback See FLAC__StreamDecoderReadCallback. This + * pointer must not be \c NULL. + * \param seek_callback See FLAC__StreamDecoderSeekCallback. This + * pointer may be \c NULL if seeking is not + * supported. If \a seek_callback is not \c NULL then a + * \a tell_callback, \a length_callback, and \a eof_callback must also be supplied. + * Alternatively, a dummy seek callback that just + * returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param tell_callback See FLAC__StreamDecoderTellCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a tell_callback must also be supplied. + * Alternatively, a dummy tell callback that just + * returns \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param length_callback See FLAC__StreamDecoderLengthCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a length_callback must also be supplied. + * Alternatively, a dummy length callback that just + * returns \c FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param eof_callback See FLAC__StreamDecoderEofCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a eof_callback must also be supplied. + * Alternatively, a dummy length callback that just + * returns \c false + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_stream( + FLAC__StreamDecoder *decoder, + FLAC__StreamDecoderReadCallback read_callback, + FLAC__StreamDecoderSeekCallback seek_callback, + FLAC__StreamDecoderTellCallback tell_callback, + FLAC__StreamDecoderLengthCallback length_callback, + FLAC__StreamDecoderEofCallback eof_callback, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode native FLAC files. + * + * This flavor of initialization sets up the decoder to decode from a + * plain native FLAC file. For non-stdio streams, you must use + * FLAC__stream_decoder_init_stream() and provide callbacks for the I/O. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \param decoder An uninitialized decoder instance. + * \param file An open FLAC file. The file should have been + * opened with mode \c "rb" and rewound. The file + * becomes owned by the decoder and should not be + * manipulated by the client while decoding. + * Unless \a file is \c stdin, it will be closed + * when FLAC__stream_decoder_finish() is called. + * Note however that seeking will not work when + * decoding from \c stdout since it is not seekable. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \code file != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_FILE( + FLAC__StreamDecoder *decoder, + FILE *file, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode Ogg FLAC files. + * + * This flavor of initialization sets up the decoder to decode from a + * plain Ogg FLAC file. For non-stdio streams, you must use + * FLAC__stream_decoder_init_ogg_stream() and provide callbacks for the I/O. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \note Support for Ogg FLAC in the library is optional. If this + * library has been built without support for Ogg FLAC, this function + * will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER. + * + * \param decoder An uninitialized decoder instance. + * \param file An open FLAC file. The file should have been + * opened with mode \c "rb" and rewound. The file + * becomes owned by the decoder and should not be + * manipulated by the client while decoding. + * Unless \a file is \c stdin, it will be closed + * when FLAC__stream_decoder_finish() is called. + * Note however that seeking will not work when + * decoding from \c stdout since it is not seekable. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \code file != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_FILE( + FLAC__StreamDecoder *decoder, + FILE *file, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode native FLAC files. + * + * This flavor of initialization sets up the decoder to decode from a plain + * native FLAC file. If POSIX fopen() semantics are not sufficient, (for + * example, with Unicode filenames on Windows), you must use + * FLAC__stream_decoder_init_FILE(), or FLAC__stream_decoder_init_stream() + * and provide callbacks for the I/O. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \param decoder An uninitialized decoder instance. + * \param filename The name of the file to decode from. The file will + * be opened with fopen(). Use \c NULL to decode from + * \c stdin. Note that \c stdin is not seekable. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_file( + FLAC__StreamDecoder *decoder, + const char *filename, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode Ogg FLAC files. + * + * This flavor of initialization sets up the decoder to decode from a plain + * Ogg FLAC file. If POSIX fopen() semantics are not sufficient, (for + * example, with Unicode filenames on Windows), you must use + * FLAC__stream_decoder_init_ogg_FILE(), or FLAC__stream_decoder_init_ogg_stream() + * and provide callbacks for the I/O. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \note Support for Ogg FLAC in the library is optional. If this + * library has been built without support for Ogg FLAC, this function + * will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER. + * + * \param decoder An uninitialized decoder instance. + * \param filename The name of the file to decode from. The file will + * be opened with fopen(). Use \c NULL to decode from + * \c stdin. Note that \c stdin is not seekable. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_file( + FLAC__StreamDecoder *decoder, + const char *filename, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Finish the decoding process. + * Flushes the decoding buffer, releases resources, resets the decoder + * settings to their defaults, and returns the decoder state to + * FLAC__STREAM_DECODER_UNINITIALIZED. + * + * In the event of a prematurely-terminated decode, it is not strictly + * necessary to call this immediately before FLAC__stream_decoder_delete() + * but it is good practice to match every FLAC__stream_decoder_init_*() + * with a FLAC__stream_decoder_finish(). + * + * \param decoder An uninitialized decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if MD5 checking is on AND a STREAMINFO block was available + * AND the MD5 signature in the STREAMINFO block was non-zero AND the + * signature does not match the one computed by the decoder; else + * \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder); + +/** Flush the stream input. + * The decoder's input buffer will be cleared and the state set to + * \c FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC. This will also turn + * off MD5 checking. + * + * \param decoder A decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false if a memory allocation + * error occurs (in which case the state will be set to + * \c FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder); + +/** Reset the decoding process. + * The decoder's input buffer will be cleared and the state set to + * \c FLAC__STREAM_DECODER_SEARCH_FOR_METADATA. This is similar to + * FLAC__stream_decoder_finish() except that the settings are + * preserved; there is no need to call FLAC__stream_decoder_init_*() + * before decoding again. MD5 checking will be restored to its original + * setting. + * + * If the decoder is seekable, or was initialized with + * FLAC__stream_decoder_init*_FILE() or FLAC__stream_decoder_init*_file(), + * the decoder will also attempt to seek to the beginning of the file. + * If this rewind fails, this function will return \c false. It follows + * that FLAC__stream_decoder_reset() cannot be used when decoding from + * \c stdin. + * + * If the decoder was initialized with FLAC__stream_encoder_init*_stream() + * and is not seekable (i.e. no seek callback was provided or the seek + * callback returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED), it + * is the duty of the client to start feeding data from the beginning of + * the stream on the next FLAC__stream_decoder_process() or + * FLAC__stream_decoder_process_interleaved() call. + * + * \param decoder A decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false if a memory allocation occurs + * (in which case the state will be set to + * \c FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR) or a seek error + * occurs (the state will be unchanged). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder); + +/** Decode one metadata block or audio frame. + * This version instructs the decoder to decode a either a single metadata + * block or a single frame and stop, unless the callbacks return a fatal + * error or the read callback returns + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM. + * + * As the decoder needs more input it will call the read callback. + * Depending on what was decoded, the metadata or write callback will be + * called with the decoded metadata block or audio frame. + * + * Unless there is a fatal read error or end of stream, this function + * will return once one whole frame is decoded. In other words, if the + * stream is not synchronized or points to a corrupt frame header, the + * decoder will continue to try and resync until it gets to a valid + * frame, then decode one frame, then return. If the decoder points to + * a frame whose frame CRC in the frame footer does not match the + * computed frame CRC, this function will issue a + * FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH error to the + * error callback, and return, having decoded one complete, although + * corrupt, frame. (Such corrupted frames are sent as silence of the + * correct length to the write callback.) + * + * \param decoder An initialized decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if any fatal read, write, or memory allocation error + * occurred (meaning decoding must stop), else \c true; for more + * information about the decoder, check the decoder state with + * FLAC__stream_decoder_get_state(). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_process_single(FLAC__StreamDecoder *decoder); + +/** Decode until the end of the metadata. + * This version instructs the decoder to decode from the current position + * and continue until all the metadata has been read, or until the + * callbacks return a fatal error or the read callback returns + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM. + * + * As the decoder needs more input it will call the read callback. + * As each metadata block is decoded, the metadata callback will be called + * with the decoded metadata. + * + * \param decoder An initialized decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if any fatal read, write, or memory allocation error + * occurred (meaning decoding must stop), else \c true; for more + * information about the decoder, check the decoder state with + * FLAC__stream_decoder_get_state(). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata(FLAC__StreamDecoder *decoder); + +/** Decode until the end of the stream. + * This version instructs the decoder to decode from the current position + * and continue until the end of stream (the read callback returns + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM), or until the + * callbacks return a fatal error. + * + * As the decoder needs more input it will call the read callback. + * As each metadata block and frame is decoded, the metadata or write + * callback will be called with the decoded metadata or frame. + * + * \param decoder An initialized decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if any fatal read, write, or memory allocation error + * occurred (meaning decoding must stop), else \c true; for more + * information about the decoder, check the decoder state with + * FLAC__stream_decoder_get_state(). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_stream(FLAC__StreamDecoder *decoder); + +/** Skip one audio frame. + * This version instructs the decoder to 'skip' a single frame and stop, + * unless the callbacks return a fatal error or the read callback returns + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM. + * + * The decoding flow is the same as what occurs when + * FLAC__stream_decoder_process_single() is called to process an audio + * frame, except that this function does not decode the parsed data into + * PCM or call the write callback. The integrity of the frame is still + * checked the same way as in the other process functions. + * + * This function will return once one whole frame is skipped, in the + * same way that FLAC__stream_decoder_process_single() will return once + * one whole frame is decoded. + * + * This function can be used in more quickly determining FLAC frame + * boundaries when decoding of the actual data is not needed, for + * example when an application is separating a FLAC stream into frames + * for editing or storing in a container. To do this, the application + * can use FLAC__stream_decoder_skip_single_frame() to quickly advance + * to the next frame, then use + * FLAC__stream_decoder_get_decode_position() to find the new frame + * boundary. + * + * This function should only be called when the stream has advanced + * past all the metadata, otherwise it will return \c false. + * + * \param decoder An initialized decoder instance not in a metadata + * state. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if any fatal read, write, or memory allocation error + * occurred (meaning decoding must stop), or if the decoder + * is in the FLAC__STREAM_DECODER_SEARCH_FOR_METADATA or + * FLAC__STREAM_DECODER_READ_METADATA state, else \c true; for more + * information about the decoder, check the decoder state with + * FLAC__stream_decoder_get_state(). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_frame(FLAC__StreamDecoder *decoder); + +/** Flush the input and seek to an absolute sample. + * Decoding will resume at the given sample. Note that because of + * this, the next write callback may contain a partial block. The + * client must support seeking the input or this function will fail + * and return \c false. Furthermore, if the decoder state is + * \c FLAC__STREAM_DECODER_SEEK_ERROR, then the decoder must be flushed + * with FLAC__stream_decoder_flush() or reset with + * FLAC__stream_decoder_reset() before decoding can continue. + * + * \param decoder A decoder instance. + * \param sample The target sample number to seek to. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_seek_absolute(FLAC__StreamDecoder *decoder, FLAC__uint64 sample); + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/stream_encoder.h b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/stream_encoder.h new file mode 100644 index 0000000..dbbbb23 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Headers/stream_encoder.h @@ -0,0 +1,1768 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__STREAM_ENCODER_H +#define FLAC__STREAM_ENCODER_H + +#include /* for FILE */ +#include "export.h" +#include "format.h" +#include "stream_decoder.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/** \file include/FLAC/stream_encoder.h + * + * \brief + * This module contains the functions which implement the stream + * encoder. + * + * See the detailed documentation in the + * \link flac_stream_encoder stream encoder \endlink module. + */ + +/** \defgroup flac_encoder FLAC/ \*_encoder.h: encoder interfaces + * \ingroup flac + * + * \brief + * This module describes the encoder layers provided by libFLAC. + * + * The stream encoder can be used to encode complete streams either to the + * client via callbacks, or directly to a file, depending on how it is + * initialized. When encoding via callbacks, the client provides a write + * callback which will be called whenever FLAC data is ready to be written. + * If the client also supplies a seek callback, the encoder will also + * automatically handle the writing back of metadata discovered while + * encoding, like stream info, seek points offsets, etc. When encoding to + * a file, the client needs only supply a filename or open \c FILE* and an + * optional progress callback for periodic notification of progress; the + * write and seek callbacks are supplied internally. For more info see the + * \link flac_stream_encoder stream encoder \endlink module. + */ + +/** \defgroup flac_stream_encoder FLAC/stream_encoder.h: stream encoder interface + * \ingroup flac_encoder + * + * \brief + * This module contains the functions which implement the stream + * encoder. + * + * The stream encoder can encode to native FLAC, and optionally Ogg FLAC + * (check FLAC_API_SUPPORTS_OGG_FLAC) streams and files. + * + * The basic usage of this encoder is as follows: + * - The program creates an instance of an encoder using + * FLAC__stream_encoder_new(). + * - The program overrides the default settings using + * FLAC__stream_encoder_set_*() functions. At a minimum, the following + * functions should be called: + * - FLAC__stream_encoder_set_channels() + * - FLAC__stream_encoder_set_bits_per_sample() + * - FLAC__stream_encoder_set_sample_rate() + * - FLAC__stream_encoder_set_ogg_serial_number() (if encoding to Ogg FLAC) + * - FLAC__stream_encoder_set_total_samples_estimate() (if known) + * - If the application wants to control the compression level or set its own + * metadata, then the following should also be called: + * - FLAC__stream_encoder_set_compression_level() + * - FLAC__stream_encoder_set_verify() + * - FLAC__stream_encoder_set_metadata() + * - The rest of the set functions should only be called if the client needs + * exact control over how the audio is compressed; thorough understanding + * of the FLAC format is necessary to achieve good results. + * - The program initializes the instance to validate the settings and + * prepare for encoding using + * - FLAC__stream_encoder_init_stream() or FLAC__stream_encoder_init_FILE() + * or FLAC__stream_encoder_init_file() for native FLAC + * - FLAC__stream_encoder_init_ogg_stream() or FLAC__stream_encoder_init_ogg_FILE() + * or FLAC__stream_encoder_init_ogg_file() for Ogg FLAC + * - The program calls FLAC__stream_encoder_process() or + * FLAC__stream_encoder_process_interleaved() to encode data, which + * subsequently calls the callbacks when there is encoder data ready + * to be written. + * - The program finishes the encoding with FLAC__stream_encoder_finish(), + * which causes the encoder to encode any data still in its input pipe, + * update the metadata with the final encoding statistics if output + * seeking is possible, and finally reset the encoder to the + * uninitialized state. + * - The instance may be used again or deleted with + * FLAC__stream_encoder_delete(). + * + * In more detail, the stream encoder functions similarly to the + * \link flac_stream_decoder stream decoder \endlink, but has fewer + * callbacks and more options. Typically the client will create a new + * instance by calling FLAC__stream_encoder_new(), then set the necessary + * parameters with FLAC__stream_encoder_set_*(), and initialize it by + * calling one of the FLAC__stream_encoder_init_*() functions. + * + * Unlike the decoders, the stream encoder has many options that can + * affect the speed and compression ratio. When setting these parameters + * you should have some basic knowledge of the format (see the + * user-level documentation + * or the formal description). The + * FLAC__stream_encoder_set_*() functions themselves do not validate the + * values as many are interdependent. The FLAC__stream_encoder_init_*() + * functions will do this, so make sure to pay attention to the state + * returned by FLAC__stream_encoder_init_*() to make sure that it is + * FLAC__STREAM_ENCODER_INIT_STATUS_OK. Any parameters that are not set + * before FLAC__stream_encoder_init_*() will take on the defaults from + * the constructor. + * + * There are three initialization functions for native FLAC, one for + * setting up the encoder to encode FLAC data to the client via + * callbacks, and two for encoding directly to a file. + * + * For encoding via callbacks, use FLAC__stream_encoder_init_stream(). + * You must also supply a write callback which will be called anytime + * there is raw encoded data to write. If the client can seek the output + * it is best to also supply seek and tell callbacks, as this allows the + * encoder to go back after encoding is finished to write back + * information that was collected while encoding, like seek point offsets, + * frame sizes, etc. + * + * For encoding directly to a file, use FLAC__stream_encoder_init_FILE() + * or FLAC__stream_encoder_init_file(). Then you must only supply a + * filename or open \c FILE*; the encoder will handle all the callbacks + * internally. You may also supply a progress callback for periodic + * notification of the encoding progress. + * + * There are three similarly-named init functions for encoding to Ogg + * FLAC streams. Check \c FLAC_API_SUPPORTS_OGG_FLAC to find out if the + * library has been built with Ogg support. + * + * The call to FLAC__stream_encoder_init_*() currently will also immediately + * call the write callback several times, once with the \c fLaC signature, + * and once for each encoded metadata block. Note that for Ogg FLAC + * encoding you will usually get at least twice the number of callbacks than + * with native FLAC, one for the Ogg page header and one for the page body. + * + * After initializing the instance, the client may feed audio data to the + * encoder in one of two ways: + * + * - Channel separate, through FLAC__stream_encoder_process() - The client + * will pass an array of pointers to buffers, one for each channel, to + * the encoder, each of the same length. The samples need not be + * block-aligned, but each channel should have the same number of samples. + * - Channel interleaved, through + * FLAC__stream_encoder_process_interleaved() - The client will pass a single + * pointer to data that is channel-interleaved (i.e. channel0_sample0, + * channel1_sample0, ... , channelN_sample0, channel0_sample1, ...). + * Again, the samples need not be block-aligned but they must be + * sample-aligned, i.e. the first value should be channel0_sample0 and + * the last value channelN_sampleM. + * + * Note that for either process call, each sample in the buffers should be a + * signed integer, right-justified to the resolution set by + * FLAC__stream_encoder_set_bits_per_sample(). For example, if the resolution + * is 16 bits per sample, the samples should all be in the range [-32768,32767]. + * + * When the client is finished encoding data, it calls + * FLAC__stream_encoder_finish(), which causes the encoder to encode any + * data still in its input pipe, and call the metadata callback with the + * final encoding statistics. Then the instance may be deleted with + * FLAC__stream_encoder_delete() or initialized again to encode another + * stream. + * + * For programs that write their own metadata, but that do not know the + * actual metadata until after encoding, it is advantageous to instruct + * the encoder to write a PADDING block of the correct size, so that + * instead of rewriting the whole stream after encoding, the program can + * just overwrite the PADDING block. If only the maximum size of the + * metadata is known, the program can write a slightly larger padding + * block, then split it after encoding. + * + * Make sure you understand how lengths are calculated. All FLAC metadata + * blocks have a 4 byte header which contains the type and length. This + * length does not include the 4 bytes of the header. See the format page + * for the specification of metadata blocks and their lengths. + * + * \note + * If you are writing the FLAC data to a file via callbacks, make sure it + * is open for update (e.g. mode "w+" for stdio streams). This is because + * after the first encoding pass, the encoder will try to seek back to the + * beginning of the stream, to the STREAMINFO block, to write some data + * there. (If using FLAC__stream_encoder_init*_file() or + * FLAC__stream_encoder_init*_FILE(), the file is managed internally.) + * + * \note + * The "set" functions may only be called when the encoder is in the + * state FLAC__STREAM_ENCODER_UNINITIALIZED, i.e. after + * FLAC__stream_encoder_new() or FLAC__stream_encoder_finish(), but + * before FLAC__stream_encoder_init_*(). If this is the case they will + * return \c true, otherwise \c false. + * + * \note + * FLAC__stream_encoder_finish() resets all settings to the constructor + * defaults. + * + * \{ + */ + + +/** State values for a FLAC__StreamEncoder. + * + * The encoder's state can be obtained by calling FLAC__stream_encoder_get_state(). + * + * If the encoder gets into any other state besides \c FLAC__STREAM_ENCODER_OK + * or \c FLAC__STREAM_ENCODER_UNINITIALIZED, it becomes invalid for encoding and + * must be deleted with FLAC__stream_encoder_delete(). + */ +typedef enum { + + FLAC__STREAM_ENCODER_OK = 0, + /**< The encoder is in the normal OK state and samples can be processed. */ + + FLAC__STREAM_ENCODER_UNINITIALIZED, + /**< The encoder is in the uninitialized state; one of the + * FLAC__stream_encoder_init_*() functions must be called before samples + * can be processed. + */ + + FLAC__STREAM_ENCODER_OGG_ERROR, + /**< An error occurred in the underlying Ogg layer. */ + + FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR, + /**< An error occurred in the underlying verify stream decoder; + * check FLAC__stream_encoder_get_verify_decoder_state(). + */ + + FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA, + /**< The verify decoder detected a mismatch between the original + * audio signal and the decoded audio signal. + */ + + FLAC__STREAM_ENCODER_CLIENT_ERROR, + /**< One of the callbacks returned a fatal error. */ + + FLAC__STREAM_ENCODER_IO_ERROR, + /**< An I/O error occurred while opening/reading/writing a file. + * Check \c errno. + */ + + FLAC__STREAM_ENCODER_FRAMING_ERROR, + /**< An error occurred while writing the stream; usually, the + * write_callback returned an error. + */ + + FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR + /**< Memory allocation failed. */ + +} FLAC__StreamEncoderState; + +/** Maps a FLAC__StreamEncoderState to a C string. + * + * Using a FLAC__StreamEncoderState as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderStateString[]; + + +/** Possible return values for the FLAC__stream_encoder_init_*() functions. + */ +typedef enum { + + FLAC__STREAM_ENCODER_INIT_STATUS_OK = 0, + /**< Initialization was successful. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR, + /**< General failure to set up encoder; call FLAC__stream_encoder_get_state() for cause. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_UNSUPPORTED_CONTAINER, + /**< The library was not compiled with support for the given container + * format. + */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_CALLBACKS, + /**< A required callback was not supplied. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_NUMBER_OF_CHANNELS, + /**< The encoder has an invalid setting for number of channels. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BITS_PER_SAMPLE, + /**< The encoder has an invalid setting for bits-per-sample. + * FLAC supports 4-32 bps but the reference encoder currently supports + * only up to 24 bps. + */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_SAMPLE_RATE, + /**< The encoder has an invalid setting for the input sample rate. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BLOCK_SIZE, + /**< The encoder has an invalid setting for the block size. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_MAX_LPC_ORDER, + /**< The encoder has an invalid setting for the maximum LPC order. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_QLP_COEFF_PRECISION, + /**< The encoder has an invalid setting for the precision of the quantized linear predictor coefficients. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_BLOCK_SIZE_TOO_SMALL_FOR_LPC_ORDER, + /**< The specified block size is less than the maximum LPC order. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE, + /**< The encoder is bound to the Subset but other settings violate it. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA, + /**< The metadata input to the encoder is invalid, in one of the following ways: + * - FLAC__stream_encoder_set_metadata() was called with a null pointer but a block count > 0 + * - One of the metadata blocks contains an undefined type + * - It contains an illegal CUESHEET as checked by FLAC__format_cuesheet_is_legal() + * - It contains an illegal SEEKTABLE as checked by FLAC__format_seektable_is_legal() + * - It contains more than one SEEKTABLE block or more than one VORBIS_COMMENT block + */ + + FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED + /**< FLAC__stream_encoder_init_*() was called when the encoder was + * already initialized, usually because + * FLAC__stream_encoder_finish() was not called. + */ + +} FLAC__StreamEncoderInitStatus; + +/** Maps a FLAC__StreamEncoderInitStatus to a C string. + * + * Using a FLAC__StreamEncoderInitStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderInitStatusString[]; + + +/** Return values for the FLAC__StreamEncoder read callback. + */ +typedef enum { + + FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE, + /**< The read was OK and decoding can continue. */ + + FLAC__STREAM_ENCODER_READ_STATUS_END_OF_STREAM, + /**< The read was attempted at the end of the stream. */ + + FLAC__STREAM_ENCODER_READ_STATUS_ABORT, + /**< An unrecoverable error occurred. */ + + FLAC__STREAM_ENCODER_READ_STATUS_UNSUPPORTED + /**< Client does not support reading back from the output. */ + +} FLAC__StreamEncoderReadStatus; + +/** Maps a FLAC__StreamEncoderReadStatus to a C string. + * + * Using a FLAC__StreamEncoderReadStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderReadStatusString[]; + + +/** Return values for the FLAC__StreamEncoder write callback. + */ +typedef enum { + + FLAC__STREAM_ENCODER_WRITE_STATUS_OK = 0, + /**< The write was OK and encoding can continue. */ + + FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR + /**< An unrecoverable error occurred. The encoder will return from the process call. */ + +} FLAC__StreamEncoderWriteStatus; + +/** Maps a FLAC__StreamEncoderWriteStatus to a C string. + * + * Using a FLAC__StreamEncoderWriteStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderWriteStatusString[]; + + +/** Return values for the FLAC__StreamEncoder seek callback. + */ +typedef enum { + + FLAC__STREAM_ENCODER_SEEK_STATUS_OK, + /**< The seek was OK and encoding can continue. */ + + FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR, + /**< An unrecoverable error occurred. */ + + FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED + /**< Client does not support seeking. */ + +} FLAC__StreamEncoderSeekStatus; + +/** Maps a FLAC__StreamEncoderSeekStatus to a C string. + * + * Using a FLAC__StreamEncoderSeekStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderSeekStatusString[]; + + +/** Return values for the FLAC__StreamEncoder tell callback. + */ +typedef enum { + + FLAC__STREAM_ENCODER_TELL_STATUS_OK, + /**< The tell was OK and encoding can continue. */ + + FLAC__STREAM_ENCODER_TELL_STATUS_ERROR, + /**< An unrecoverable error occurred. */ + + FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED + /**< Client does not support seeking. */ + +} FLAC__StreamEncoderTellStatus; + +/** Maps a FLAC__StreamEncoderTellStatus to a C string. + * + * Using a FLAC__StreamEncoderTellStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderTellStatusString[]; + + +/*********************************************************************** + * + * class FLAC__StreamEncoder + * + ***********************************************************************/ + +struct FLAC__StreamEncoderProtected; +struct FLAC__StreamEncoderPrivate; +/** The opaque structure definition for the stream encoder type. + * See the \link flac_stream_encoder stream encoder module \endlink + * for a detailed description. + */ +typedef struct { + struct FLAC__StreamEncoderProtected *protected_; /* avoid the C++ keyword 'protected' */ + struct FLAC__StreamEncoderPrivate *private_; /* avoid the C++ keyword 'private' */ +} FLAC__StreamEncoder; + +/** Signature for the read callback. + * + * A function pointer matching this signature must be passed to + * FLAC__stream_encoder_init_ogg_stream() if seeking is supported. + * The supplied function will be called when the encoder needs to read back + * encoded data. This happens during the metadata callback, when the encoder + * has to read, modify, and rewrite the metadata (e.g. seekpoints) gathered + * while encoding. The address of the buffer to be filled is supplied, along + * with the number of bytes the buffer can hold. The callback may choose to + * supply less data and modify the byte count but must be careful not to + * overflow the buffer. The callback then returns a status code chosen from + * FLAC__StreamEncoderReadStatus. + * + * Here is an example of a read callback for stdio streams: + * \code + * FLAC__StreamEncoderReadStatus read_cb(const FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * if(*bytes > 0) { + * *bytes = fread(buffer, sizeof(FLAC__byte), *bytes, file); + * if(ferror(file)) + * return FLAC__STREAM_ENCODER_READ_STATUS_ABORT; + * else if(*bytes == 0) + * return FLAC__STREAM_ENCODER_READ_STATUS_END_OF_STREAM; + * else + * return FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE; + * } + * else + * return FLAC__STREAM_ENCODER_READ_STATUS_ABORT; + * } + * \endcode + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param buffer A pointer to a location for the callee to store + * data to be encoded. + * \param bytes A pointer to the size of the buffer. On entry + * to the callback, it contains the maximum number + * of bytes that may be stored in \a buffer. The + * callee must set it to the actual number of bytes + * stored (0 in case of error or end-of-stream) before + * returning. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_set_client_data(). + * \retval FLAC__StreamEncoderReadStatus + * The callee's return status. + */ +typedef FLAC__StreamEncoderReadStatus (*FLAC__StreamEncoderReadCallback)(const FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data); + +/** Signature for the write callback. + * + * A function pointer matching this signature must be passed to + * FLAC__stream_encoder_init*_stream(). The supplied function will be called + * by the encoder anytime there is raw encoded data ready to write. It may + * include metadata mixed with encoded audio frames and the data is not + * guaranteed to be aligned on frame or metadata block boundaries. + * + * The only duty of the callback is to write out the \a bytes worth of data + * in \a buffer to the current position in the output stream. The arguments + * \a samples and \a current_frame are purely informational. If \a samples + * is greater than \c 0, then \a current_frame will hold the current frame + * number that is being written; otherwise it indicates that the write + * callback is being called to write metadata. + * + * \note + * Unlike when writing to native FLAC, when writing to Ogg FLAC the + * write callback will be called twice when writing each audio + * frame; once for the page header, and once for the page body. + * When writing the page header, the \a samples argument to the + * write callback will be \c 0. + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param buffer An array of encoded data of length \a bytes. + * \param bytes The byte length of \a buffer. + * \param samples The number of samples encoded by \a buffer. + * \c 0 has a special meaning; see above. + * \param current_frame The number of the current frame being encoded. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + * \retval FLAC__StreamEncoderWriteStatus + * The callee's return status. + */ +typedef FLAC__StreamEncoderWriteStatus (*FLAC__StreamEncoderWriteCallback)(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data); + +/** Signature for the seek callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_encoder_init*_stream(). The supplied function will be called + * when the encoder needs to seek the output stream. The encoder will pass + * the absolute byte offset to seek to, 0 meaning the beginning of the stream. + * + * Here is an example of a seek callback for stdio streams: + * \code + * FLAC__StreamEncoderSeekStatus seek_cb(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * if(file == stdin) + * return FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED; + * else if(fseeko(file, (off_t)absolute_byte_offset, SEEK_SET) < 0) + * return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR; + * else + * return FLAC__STREAM_ENCODER_SEEK_STATUS_OK; + * } + * \endcode + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param absolute_byte_offset The offset from the beginning of the stream + * to seek to. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + * \retval FLAC__StreamEncoderSeekStatus + * The callee's return status. + */ +typedef FLAC__StreamEncoderSeekStatus (*FLAC__StreamEncoderSeekCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data); + +/** Signature for the tell callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_encoder_init*_stream(). The supplied function will be called + * when the encoder needs to know the current position of the output stream. + * + * \warning + * The callback must return the true current byte offset of the output to + * which the encoder is writing. If you are buffering the output, make + * sure and take this into account. If you are writing directly to a + * FILE* from your write callback, ftell() is sufficient. If you are + * writing directly to a file descriptor from your write callback, you + * can use lseek(fd, SEEK_CUR, 0). The encoder may later seek back to + * these points to rewrite metadata after encoding. + * + * Here is an example of a tell callback for stdio streams: + * \code + * FLAC__StreamEncoderTellStatus tell_cb(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * off_t pos; + * if(file == stdin) + * return FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED; + * else if((pos = ftello(file)) < 0) + * return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR; + * else { + * *absolute_byte_offset = (FLAC__uint64)pos; + * return FLAC__STREAM_ENCODER_TELL_STATUS_OK; + * } + * } + * \endcode + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param absolute_byte_offset The address at which to store the current + * position of the output. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + * \retval FLAC__StreamEncoderTellStatus + * The callee's return status. + */ +typedef FLAC__StreamEncoderTellStatus (*FLAC__StreamEncoderTellCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data); + +/** Signature for the metadata callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_encoder_init*_stream(). The supplied function will be called + * once at the end of encoding with the populated STREAMINFO structure. This + * is so the client can seek back to the beginning of the file and write the + * STREAMINFO block with the correct statistics after encoding (like + * minimum/maximum frame size and total samples). + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param metadata The final populated STREAMINFO block. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + */ +typedef void (*FLAC__StreamEncoderMetadataCallback)(const FLAC__StreamEncoder *encoder, const FLAC__StreamMetadata *metadata, void *client_data); + +/** Signature for the progress callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_encoder_init*_file() or FLAC__stream_encoder_init*_FILE(). + * The supplied function will be called when the encoder has finished + * writing a frame. The \c total_frames_estimate argument to the + * callback will be based on the value from + * FLAC__stream_encoder_set_total_samples_estimate(). + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param bytes_written Bytes written so far. + * \param samples_written Samples written so far. + * \param frames_written Frames written so far. + * \param total_frames_estimate The estimate of the total number of + * frames to be written. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + */ +typedef void (*FLAC__StreamEncoderProgressCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data); + + +/*********************************************************************** + * + * Class constructor/destructor + * + ***********************************************************************/ + +/** Create a new stream encoder instance. The instance is created with + * default settings; see the individual FLAC__stream_encoder_set_*() + * functions for each setting's default. + * + * \retval FLAC__StreamEncoder* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamEncoder *FLAC__stream_encoder_new(void); + +/** Free an encoder instance. Deletes the object pointed to by \a encoder. + * + * \param encoder A pointer to an existing encoder. + * \assert + * \code encoder != NULL \endcode + */ +FLAC_API void FLAC__stream_encoder_delete(FLAC__StreamEncoder *encoder); + + +/*********************************************************************** + * + * Public class method prototypes + * + ***********************************************************************/ + +/** Set the serial number for the FLAC stream to use in the Ogg container. + * + * \note + * This does not need to be set for native FLAC encoding. + * + * \note + * It is recommended to set a serial number explicitly as the default of '0' + * may collide with other streams. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param serial_number See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_ogg_serial_number(FLAC__StreamEncoder *encoder, long serial_number); + +/** Set the "verify" flag. If \c true, the encoder will verify it's own + * encoded output by feeding it through an internal decoder and comparing + * the original signal against the decoded signal. If a mismatch occurs, + * the process call will return \c false. Note that this will slow the + * encoding process by the extra time required for decoding and comparison. + * + * \default \c false + * \param encoder An encoder instance to set. + * \param value Flag value (see above). + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_verify(FLAC__StreamEncoder *encoder, FLAC__bool value); + +/** Set the Subset flag. If \c true, + * the encoder will comply with the Subset and will check the + * settings during FLAC__stream_encoder_init_*() to see if all settings + * comply. If \c false, the settings may take advantage of the full + * range that the format allows. + * + * Make sure you know what it entails before setting this to \c false. + * + * \default \c true + * \param encoder An encoder instance to set. + * \param value Flag value (see above). + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_streamable_subset(FLAC__StreamEncoder *encoder, FLAC__bool value); + +/** Set the number of channels to be encoded. + * + * \default \c 2 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_channels(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the sample resolution of the input to be encoded. + * + * \warning + * Do not feed the encoder data that is wider than the value you + * set here or you will generate an invalid stream. + * + * \default \c 16 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_bits_per_sample(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the sample rate (in Hz) of the input to be encoded. + * + * \default \c 44100 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the compression level + * + * The compression level is roughly proportional to the amount of effort + * the encoder expends to compress the file. A higher level usually + * means more computation but higher compression. The default level is + * suitable for most applications. + * + * Currently the levels range from \c 0 (fastest, least compression) to + * \c 8 (slowest, most compression). A value larger than \c 8 will be + * treated as \c 8. + * + * This function automatically calls the following other \c _set_ + * functions with appropriate values, so the client does not need to + * unless it specifically wants to override them: + * - FLAC__stream_encoder_set_do_mid_side_stereo() + * - FLAC__stream_encoder_set_loose_mid_side_stereo() + * - FLAC__stream_encoder_set_apodization() + * - FLAC__stream_encoder_set_max_lpc_order() + * - FLAC__stream_encoder_set_qlp_coeff_precision() + * - FLAC__stream_encoder_set_do_qlp_coeff_prec_search() + * - FLAC__stream_encoder_set_do_escape_coding() + * - FLAC__stream_encoder_set_do_exhaustive_model_search() + * - FLAC__stream_encoder_set_min_residual_partition_order() + * - FLAC__stream_encoder_set_max_residual_partition_order() + * - FLAC__stream_encoder_set_rice_parameter_search_dist() + * + * The actual values set for each level are: + * + * + * + * + * + * + * + * + * + * + * + * + *
level + * do mid-side stereo + * loose mid-side stereo + * apodization + * max lpc order + * qlp coeff precision + * qlp coeff prec search + * escape coding + * exhaustive model search + * min residual partition order + * max residual partition order + * rice parameter search dist + *
0 false false tukey(0.5) 0 0 false false false 0 3 0
1 true true tukey(0.5) 0 0 false false false 0 3 0
2 true false tukey(0.5) 0 0 false false false 0 3 0
3 false false tukey(0.5) 6 0 false false false 0 4 0
4 true true tukey(0.5) 8 0 false false false 0 4 0
5 true false tukey(0.5) 8 0 false false false 0 5 0
6 true false tukey(0.5) 8 0 false false false 0 6 0
7 true false tukey(0.5) 8 0 false false true 0 6 0
8 true false tukey(0.5) 12 0 false false true 0 6 0
+ * + * \default \c 5 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_compression_level(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the blocksize to use while encoding. + * + * The number of samples to use per frame. Use \c 0 to let the encoder + * estimate a blocksize; this is usually best. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_blocksize(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set to \c true to enable mid-side encoding on stereo input. The + * number of channels must be 2 for this to have any effect. Set to + * \c false to use only independent channel coding. + * + * \default \c false + * \param encoder An encoder instance to set. + * \param value Flag value (see above). + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_do_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value); + +/** Set to \c true to enable adaptive switching between mid-side and + * left-right encoding on stereo input. Set to \c false to use + * exhaustive searching. Setting this to \c true requires + * FLAC__stream_encoder_set_do_mid_side_stereo() to also be set to + * \c true in order to have any effect. + * + * \default \c false + * \param encoder An encoder instance to set. + * \param value Flag value (see above). + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_loose_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value); + +/** Sets the apodization function(s) the encoder will use when windowing + * audio data for LPC analysis. + * + * The \a specification is a plain ASCII string which specifies exactly + * which functions to use. There may be more than one (up to 32), + * separated by \c ';' characters. Some functions take one or more + * comma-separated arguments in parentheses. + * + * The available functions are \c bartlett, \c bartlett_hann, + * \c blackman, \c blackman_harris_4term_92db, \c connes, \c flattop, + * \c gauss(STDDEV), \c hamming, \c hann, \c kaiser_bessel, \c nuttall, + * \c rectangle, \c triangle, \c tukey(P), \c welch. + * + * For \c gauss(STDDEV), STDDEV specifies the standard deviation + * (0blocksize / (2 ^ order). + * + * Set both min and max values to \c 0 to force a single context, + * whose Rice parameter is based on the residual signal variance. + * Otherwise, set a min and max order, and the encoder will search + * all orders, using the mean of each context for its Rice parameter, + * and use the best. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_min_residual_partition_order(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the maximum partition order to search when coding the residual. + * This is used in tandem with + * FLAC__stream_encoder_set_min_residual_partition_order(). + * + * The partition order determines the context size in the residual. + * The context size will be approximately blocksize / (2 ^ order). + * + * Set both min and max values to \c 0 to force a single context, + * whose Rice parameter is based on the residual signal variance. + * Otherwise, set a min and max order, and the encoder will search + * all orders, using the mean of each context for its Rice parameter, + * and use the best. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_max_residual_partition_order(FLAC__StreamEncoder *encoder, unsigned value); + +/** Deprecated. Setting this value has no effect. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_rice_parameter_search_dist(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set an estimate of the total samples that will be encoded. + * This is merely an estimate and may be set to \c 0 if unknown. + * This value will be written to the STREAMINFO block before encoding, + * and can remove the need for the caller to rewrite the value later + * if the value is known before encoding. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_total_samples_estimate(FLAC__StreamEncoder *encoder, FLAC__uint64 value); + +/** Set the metadata blocks to be emitted to the stream before encoding. + * A value of \c NULL, \c 0 implies no metadata; otherwise, supply an + * array of pointers to metadata blocks. The array is non-const since + * the encoder may need to change the \a is_last flag inside them, and + * in some cases update seek point offsets. Otherwise, the encoder will + * not modify or free the blocks. It is up to the caller to free the + * metadata blocks after encoding finishes. + * + * \note + * The encoder stores only copies of the pointers in the \a metadata array; + * the metadata blocks themselves must survive at least until after + * FLAC__stream_encoder_finish() returns. Do not free the blocks until then. + * + * \note + * The STREAMINFO block is always written and no STREAMINFO block may + * occur in the supplied array. + * + * \note + * By default the encoder does not create a SEEKTABLE. If one is supplied + * in the \a metadata array, but the client has specified that it does not + * support seeking, then the SEEKTABLE will be written verbatim. However + * by itself this is not very useful as the client will not know the stream + * offsets for the seekpoints ahead of time. In order to get a proper + * seektable the client must support seeking. See next note. + * + * \note + * SEEKTABLE blocks are handled specially. Since you will not know + * the values for the seek point stream offsets, you should pass in + * a SEEKTABLE 'template', that is, a SEEKTABLE object with the + * required sample numbers (or placeholder points), with \c 0 for the + * \a frame_samples and \a stream_offset fields for each point. If the + * client has specified that it supports seeking by providing a seek + * callback to FLAC__stream_encoder_init_stream() or both seek AND read + * callback to FLAC__stream_encoder_init_ogg_stream() (or by using + * FLAC__stream_encoder_init*_file() or FLAC__stream_encoder_init*_FILE()), + * then while it is encoding the encoder will fill the stream offsets in + * for you and when encoding is finished, it will seek back and write the + * real values into the SEEKTABLE block in the stream. There are helper + * routines for manipulating seektable template blocks; see metadata.h: + * FLAC__metadata_object_seektable_template_*(). If the client does + * not support seeking, the SEEKTABLE will have inaccurate offsets which + * will slow down or remove the ability to seek in the FLAC stream. + * + * \note + * The encoder instance \b will modify the first \c SEEKTABLE block + * as it transforms the template to a valid seektable while encoding, + * but it is still up to the caller to free all metadata blocks after + * encoding. + * + * \note + * A VORBIS_COMMENT block may be supplied. The vendor string in it + * will be ignored. libFLAC will use it's own vendor string. libFLAC + * will not modify the passed-in VORBIS_COMMENT's vendor string, it + * will simply write it's own into the stream. If no VORBIS_COMMENT + * block is present in the \a metadata array, libFLAC will write an + * empty one, containing only the vendor string. + * + * \note The Ogg FLAC mapping requires that the VORBIS_COMMENT block be + * the second metadata block of the stream. The encoder already supplies + * the STREAMINFO block automatically. If \a metadata does not contain a + * VORBIS_COMMENT block, the encoder will supply that too. Otherwise, if + * \a metadata does contain a VORBIS_COMMENT block and it is not the + * first, the init function will reorder \a metadata by moving the + * VORBIS_COMMENT block to the front; the relative ordering of the other + * blocks will remain as they were. + * + * \note The Ogg FLAC mapping limits the number of metadata blocks per + * stream to \c 65535. If \a num_blocks exceeds this the function will + * return \c false. + * + * \default \c NULL, 0 + * \param encoder An encoder instance to set. + * \param metadata See above. + * \param num_blocks See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + * \c false if the encoder is already initialized, or if + * \a num_blocks > 65535 if encoding to Ogg FLAC, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_metadata(FLAC__StreamEncoder *encoder, FLAC__StreamMetadata **metadata, unsigned num_blocks); + +/** Get the current encoder state. + * + * \param encoder An encoder instance to query. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__StreamEncoderState + * The current encoder state. + */ +FLAC_API FLAC__StreamEncoderState FLAC__stream_encoder_get_state(const FLAC__StreamEncoder *encoder); + +/** Get the state of the verify stream decoder. + * Useful when the stream encoder state is + * \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR. + * + * \param encoder An encoder instance to query. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__StreamDecoderState + * The verify stream decoder state. + */ +FLAC_API FLAC__StreamDecoderState FLAC__stream_encoder_get_verify_decoder_state(const FLAC__StreamEncoder *encoder); + +/** Get the current encoder state as a C string. + * This version automatically resolves + * \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR by getting the + * verify decoder's state. + * + * \param encoder A encoder instance to query. + * \assert + * \code encoder != NULL \endcode + * \retval const char * + * The encoder state as a C string. Do not modify the contents. + */ +FLAC_API const char *FLAC__stream_encoder_get_resolved_state_string(const FLAC__StreamEncoder *encoder); + +/** Get relevant values about the nature of a verify decoder error. + * Useful when the stream encoder state is + * \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR. The arguments should + * be addresses in which the stats will be returned, or NULL if value + * is not desired. + * + * \param encoder An encoder instance to query. + * \param absolute_sample The absolute sample number of the mismatch. + * \param frame_number The number of the frame in which the mismatch occurred. + * \param channel The channel in which the mismatch occurred. + * \param sample The number of the sample (relative to the frame) in + * which the mismatch occurred. + * \param expected The expected value for the sample in question. + * \param got The actual value returned by the decoder. + * \assert + * \code encoder != NULL \endcode + */ +FLAC_API void FLAC__stream_encoder_get_verify_decoder_error_stats(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got); + +/** Get the "verify" flag. + * + * \param encoder An encoder instance to query. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * See FLAC__stream_encoder_set_verify(). + */ +FLAC_API FLAC__bool FLAC__stream_encoder_get_verify(const FLAC__StreamEncoder *encoder); + +/** Get the frame header. + * + * \param encoder An initialized encoder instance in the OK state. + * \param buffer An array of pointers to each channel's signal. + * \param samples The number of samples in one channel. + * \assert + * \code encoder != NULL \endcode + * \code FLAC__stream_encoder_get_state(encoder) == FLAC__STREAM_ENCODER_OK \endcode + * \retval FLAC__bool + * \c true if successful, else \c false; in this case, check the + * encoder state with FLAC__stream_encoder_get_state() to see what + * went wrong. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples); + +/** Submit data for encoding. + * This version allows you to supply the input data where the channels + * are interleaved into a single array (i.e. channel0_sample0, + * channel1_sample0, ... , channelN_sample0, channel0_sample1, ...). + * The samples need not be block-aligned but they must be + * sample-aligned, i.e. the first value should be channel0_sample0 + * and the last value channelN_sampleM. Each sample should be a signed + * integer, right-justified to the resolution set by + * FLAC__stream_encoder_set_bits_per_sample(). For example, if the + * resolution is 16 bits per sample, the samples should all be in the + * range [-32768,32767]. + * + * For applications where channel order is important, channels must + * follow the order as described in the + * frame header. + * + * \param encoder An initialized encoder instance in the OK state. + * \param buffer An array of channel-interleaved data (see above). + * \param samples The number of samples in one channel, the same as for + * FLAC__stream_encoder_process(). For example, if + * encoding two channels, \c 1000 \a samples corresponds + * to a \a buffer of 2000 values. + * \assert + * \code encoder != NULL \endcode + * \code FLAC__stream_encoder_get_state(encoder) == FLAC__STREAM_ENCODER_OK \endcode + * \retval FLAC__bool + * \c true if successful, else \c false; in this case, check the + * encoder state with FLAC__stream_encoder_get_state() to see what + * went wrong. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder *encoder, const FLAC__int32 buffer[], unsigned samples); + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Resources/Info.plist b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..80c56a4 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,40 @@ + + + + + BuildMachineOSBuild + 12C3104 + CFBundleDevelopmentRegion + English + CFBundleExecutable + FLAC + CFBundleIdentifier + ap4y.FLAC + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + FLAC + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 4H127 + DTPlatformVersion + GM + DTSDKBuild + 12C37 + DTSDKName + macosx10.8 + DTXcode + 0460 + DTXcodeBuild + 4H127 + + diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Resources/en.lproj/InfoPlist.strings b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Resources/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..5e45963 Binary files /dev/null and b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/A/Resources/en.lproj/InfoPlist.strings differ diff --git a/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/Current b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Audio-Frameworks/bin/flac/FLAC_OSX/FLAC.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Audio-Frameworks/bin/flac/headers/FLAC/all.h b/Audio-Frameworks/bin/flac/headers/FLAC/all.h new file mode 100644 index 0000000..c542c0d --- /dev/null +++ b/Audio-Frameworks/bin/flac/headers/FLAC/all.h @@ -0,0 +1,370 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__ALL_H +#define FLAC__ALL_H + +#include "export.h" + +#include "assert.h" +#include "callback.h" +#include "format.h" +#include "metadata.h" +#include "ordinals.h" +#include "stream_decoder.h" +#include "stream_encoder.h" + +/** \mainpage + * + * \section intro Introduction + * + * This is the documentation for the FLAC C and C++ APIs. It is + * highly interconnected; this introduction should give you a top + * level idea of the structure and how to find the information you + * need. As a prerequisite you should have at least a basic + * knowledge of the FLAC format, documented + * here. + * + * \section c_api FLAC C API + * + * The FLAC C API is the interface to libFLAC, a set of structures + * describing the components of FLAC streams, and functions for + * encoding and decoding streams, as well as manipulating FLAC + * metadata in files. The public include files will be installed + * in your include area (for example /usr/include/FLAC/...). + * + * By writing a little code and linking against libFLAC, it is + * relatively easy to add FLAC support to another program. The + * library is licensed under Xiph's BSD license. + * Complete source code of libFLAC as well as the command-line + * encoder and plugins is available and is a useful source of + * examples. + * + * Aside from encoders and decoders, libFLAC provides a powerful + * metadata interface for manipulating metadata in FLAC files. It + * allows the user to add, delete, and modify FLAC metadata blocks + * and it can automatically take advantage of PADDING blocks to avoid + * rewriting the entire FLAC file when changing the size of the + * metadata. + * + * libFLAC usually only requires the standard C library and C math + * library. In particular, threading is not used so there is no + * dependency on a thread library. However, libFLAC does not use + * global variables and should be thread-safe. + * + * libFLAC also supports encoding to and decoding from Ogg FLAC. + * However the metadata editing interfaces currently have limited + * read-only support for Ogg FLAC files. + * + * \section cpp_api FLAC C++ API + * + * The FLAC C++ API is a set of classes that encapsulate the + * structures and functions in libFLAC. They provide slightly more + * functionality with respect to metadata but are otherwise + * equivalent. For the most part, they share the same usage as + * their counterparts in libFLAC, and the FLAC C API documentation + * can be used as a supplement. The public include files + * for the C++ API will be installed in your include area (for + * example /usr/include/FLAC++/...). + * + * libFLAC++ is also licensed under + * Xiph's BSD license. + * + * \section getting_started Getting Started + * + * A good starting point for learning the API is to browse through + * the modules. Modules are logical + * groupings of related functions or classes, which correspond roughly + * to header files or sections of header files. Each module includes a + * detailed description of the general usage of its functions or + * classes. + * + * From there you can go on to look at the documentation of + * individual functions. You can see different views of the individual + * functions through the links in top bar across this page. + * + * If you prefer a more hands-on approach, you can jump right to some + * example code. + * + * \section porting_guide Porting Guide + * + * Starting with FLAC 1.1.3 a \link porting Porting Guide \endlink + * has been introduced which gives detailed instructions on how to + * port your code to newer versions of FLAC. + * + * \section embedded_developers Embedded Developers + * + * libFLAC has grown larger over time as more functionality has been + * included, but much of it may be unnecessary for a particular embedded + * implementation. Unused parts may be pruned by some simple editing of + * src/libFLAC/Makefile.am. In general, the decoders, encoders, and + * metadata interface are all independent from each other. + * + * It is easiest to just describe the dependencies: + * + * - All modules depend on the \link flac_format Format \endlink module. + * - The decoders and encoders depend on the bitbuffer. + * - The decoder is independent of the encoder. The encoder uses the + * decoder because of the verify feature, but this can be removed if + * not needed. + * - Parts of the metadata interface require the stream decoder (but not + * the encoder). + * - Ogg support is selectable through the compile time macro + * \c FLAC__HAS_OGG. + * + * For example, if your application only requires the stream decoder, no + * encoder, and no metadata interface, you can remove the stream encoder + * and the metadata interface, which will greatly reduce the size of the + * library. + * + * Also, there are several places in the libFLAC code with comments marked + * with "OPT:" where a #define can be changed to enable code that might be + * faster on a specific platform. Experimenting with these can yield faster + * binaries. + */ + +/** \defgroup porting Porting Guide for New Versions + * + * This module describes differences in the library interfaces from + * version to version. It assists in the porting of code that uses + * the libraries to newer versions of FLAC. + * + * One simple facility for making porting easier that has been added + * in FLAC 1.1.3 is a set of \c #defines in \c export.h of each + * library's includes (e.g. \c include/FLAC/export.h). The + * \c #defines mirror the libraries' + * libtool version numbers, + * e.g. in libFLAC there are \c FLAC_API_VERSION_CURRENT, + * \c FLAC_API_VERSION_REVISION, and \c FLAC_API_VERSION_AGE. + * These can be used to support multiple versions of an API during the + * transition phase, e.g. + * + * \code + * #if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7 + * legacy code + * #else + * new code + * #endif + * \endcode + * + * The the source will work for multiple versions and the legacy code can + * easily be removed when the transition is complete. + * + * Another available symbol is FLAC_API_SUPPORTS_OGG_FLAC (defined in + * include/FLAC/export.h), which can be used to determine whether or not + * the library has been compiled with support for Ogg FLAC. This is + * simpler than trying to call an Ogg init function and catching the + * error. + */ + +/** \defgroup porting_1_1_2_to_1_1_3 Porting from FLAC 1.1.2 to 1.1.3 + * \ingroup porting + * + * \brief + * This module describes porting from FLAC 1.1.2 to FLAC 1.1.3. + * + * The main change between the APIs in 1.1.2 and 1.1.3 is that they have + * been simplified. First, libOggFLAC has been merged into libFLAC and + * libOggFLAC++ has been merged into libFLAC++. Second, both the three + * decoding layers and three encoding layers have been merged into a + * single stream decoder and stream encoder. That is, the functionality + * of FLAC__SeekableStreamDecoder and FLAC__FileDecoder has been merged + * into FLAC__StreamDecoder, and FLAC__SeekableStreamEncoder and + * FLAC__FileEncoder into FLAC__StreamEncoder. Only the + * FLAC__StreamDecoder and FLAC__StreamEncoder remain. What this means + * is there is now a single API that can be used to encode or decode + * streams to/from native FLAC or Ogg FLAC and the single API can work + * on both seekable and non-seekable streams. + * + * Instead of creating an encoder or decoder of a certain layer, now the + * client will always create a FLAC__StreamEncoder or + * FLAC__StreamDecoder. The old layers are now differentiated by the + * initialization function. For example, for the decoder, + * FLAC__stream_decoder_init() has been replaced by + * FLAC__stream_decoder_init_stream(). This init function takes + * callbacks for the I/O, and the seeking callbacks are optional. This + * allows the client to use the same object for seekable and + * non-seekable streams. For decoding a FLAC file directly, the client + * can use FLAC__stream_decoder_init_file() and pass just a filename + * and fewer callbacks; most of the other callbacks are supplied + * internally. For situations where fopen()ing by filename is not + * possible (e.g. Unicode filenames on Windows) the client can instead + * open the file itself and supply the FILE* to + * FLAC__stream_decoder_init_FILE(). The init functions now returns a + * FLAC__StreamDecoderInitStatus instead of FLAC__StreamDecoderState. + * Since the callbacks and client data are now passed to the init + * function, the FLAC__stream_decoder_set_*_callback() functions and + * FLAC__stream_decoder_set_client_data() are no longer needed. The + * rest of the calls to the decoder are the same as before. + * + * There are counterpart init functions for Ogg FLAC, e.g. + * FLAC__stream_decoder_init_ogg_stream(). All the rest of the calls + * and callbacks are the same as for native FLAC. + * + * As an example, in FLAC 1.1.2 a seekable stream decoder would have + * been set up like so: + * + * \code + * FLAC__SeekableStreamDecoder *decoder = FLAC__seekable_stream_decoder_new(); + * if(decoder == NULL) do_something; + * FLAC__seekable_stream_decoder_set_md5_checking(decoder, true); + * [... other settings ...] + * FLAC__seekable_stream_decoder_set_read_callback(decoder, my_read_callback); + * FLAC__seekable_stream_decoder_set_seek_callback(decoder, my_seek_callback); + * FLAC__seekable_stream_decoder_set_tell_callback(decoder, my_tell_callback); + * FLAC__seekable_stream_decoder_set_length_callback(decoder, my_length_callback); + * FLAC__seekable_stream_decoder_set_eof_callback(decoder, my_eof_callback); + * FLAC__seekable_stream_decoder_set_write_callback(decoder, my_write_callback); + * FLAC__seekable_stream_decoder_set_metadata_callback(decoder, my_metadata_callback); + * FLAC__seekable_stream_decoder_set_error_callback(decoder, my_error_callback); + * FLAC__seekable_stream_decoder_set_client_data(decoder, my_client_data); + * if(FLAC__seekable_stream_decoder_init(decoder) != FLAC__SEEKABLE_STREAM_DECODER_OK) do_something; + * \endcode + * + * In FLAC 1.1.3 it is like this: + * + * \code + * FLAC__StreamDecoder *decoder = FLAC__stream_decoder_new(); + * if(decoder == NULL) do_something; + * FLAC__stream_decoder_set_md5_checking(decoder, true); + * [... other settings ...] + * if(FLAC__stream_decoder_init_stream( + * decoder, + * my_read_callback, + * my_seek_callback, // or NULL + * my_tell_callback, // or NULL + * my_length_callback, // or NULL + * my_eof_callback, // or NULL + * my_write_callback, + * my_metadata_callback, // or NULL + * my_error_callback, + * my_client_data + * ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something; + * \endcode + * + * or you could do; + * + * \code + * [...] + * FILE *file = fopen("somefile.flac","rb"); + * if(file == NULL) do_somthing; + * if(FLAC__stream_decoder_init_FILE( + * decoder, + * file, + * my_write_callback, + * my_metadata_callback, // or NULL + * my_error_callback, + * my_client_data + * ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something; + * \endcode + * + * or just: + * + * \code + * [...] + * if(FLAC__stream_decoder_init_file( + * decoder, + * "somefile.flac", + * my_write_callback, + * my_metadata_callback, // or NULL + * my_error_callback, + * my_client_data + * ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something; + * \endcode + * + * Another small change to the decoder is in how it handles unparseable + * streams. Before, when the decoder found an unparseable stream + * (reserved for when the decoder encounters a stream from a future + * encoder that it can't parse), it changed the state to + * \c FLAC__STREAM_DECODER_UNPARSEABLE_STREAM. Now the decoder instead + * drops sync and calls the error callback with a new error code + * \c FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM. This is + * more robust. If your error callback does not discriminate on the the + * error state, your code does not need to be changed. + * + * The encoder now has a new setting: + * FLAC__stream_encoder_set_apodization(). This is for setting the + * method used to window the data before LPC analysis. You only need to + * add a call to this function if the default is not suitable. There + * are also two new convenience functions that may be useful: + * FLAC__metadata_object_cuesheet_calculate_cddb_id() and + * FLAC__metadata_get_cuesheet(). + * + * The \a bytes parameter to FLAC__StreamDecoderReadCallback, + * FLAC__StreamEncoderReadCallback, and FLAC__StreamEncoderWriteCallback + * is now \c size_t instead of \c unsigned. + */ + +/** \defgroup porting_1_1_3_to_1_1_4 Porting from FLAC 1.1.3 to 1.1.4 + * \ingroup porting + * + * \brief + * This module describes porting from FLAC 1.1.3 to FLAC 1.1.4. + * + * There were no changes to any of the interfaces from 1.1.3 to 1.1.4. + * There was a slight change in the implementation of + * FLAC__stream_encoder_set_metadata(); the function now makes a copy + * of the \a metadata array of pointers so the client no longer needs + * to maintain it after the call. The objects themselves that are + * pointed to by the array are still not copied though and must be + * maintained until the call to FLAC__stream_encoder_finish(). + */ + +/** \defgroup porting_1_1_4_to_1_2_0 Porting from FLAC 1.1.4 to 1.2.0 + * \ingroup porting + * + * \brief + * This module describes porting from FLAC 1.1.4 to FLAC 1.2.0. + * + * There were only very minor changes to the interfaces from 1.1.4 to 1.2.0. + * In libFLAC, \c FLAC__format_sample_rate_is_subset() was added. + * In libFLAC++, \c FLAC::Decoder::Stream::get_decode_position() was added. + * + * Finally, value of the constant \c FLAC__FRAME_HEADER_RESERVED_LEN + * has changed to reflect the conversion of one of the reserved bits + * into active use. It used to be \c 2 and now is \c 1. However the + * FLAC frame header length has not changed, so to skip the proper + * number of bits, use \c FLAC__FRAME_HEADER_RESERVED_LEN + + * \c FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN + */ + +/** \defgroup flac FLAC C API + * + * The FLAC C API is the interface to libFLAC, a set of structures + * describing the components of FLAC streams, and functions for + * encoding and decoding streams, as well as manipulating FLAC + * metadata in files. + * + * You should start with the format components as all other modules + * are dependent on it. + */ + +#endif diff --git a/Audio-Frameworks/bin/flac/headers/FLAC/assert.h b/Audio-Frameworks/bin/flac/headers/FLAC/assert.h new file mode 100644 index 0000000..3fc03f3 --- /dev/null +++ b/Audio-Frameworks/bin/flac/headers/FLAC/assert.h @@ -0,0 +1,45 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__ASSERT_H +#define FLAC__ASSERT_H + +/* we need this since some compilers (like MSVC) leave assert()s on release code (and we don't want to use their ASSERT) */ +#ifdef DEBUG +#include +#define FLAC__ASSERT(x) assert(x) +#define FLAC__ASSERT_DECLARATION(x) x +#else +#define FLAC__ASSERT(x) +#define FLAC__ASSERT_DECLARATION(x) +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/headers/FLAC/callback.h b/Audio-Frameworks/bin/flac/headers/FLAC/callback.h new file mode 100644 index 0000000..c954121 --- /dev/null +++ b/Audio-Frameworks/bin/flac/headers/FLAC/callback.h @@ -0,0 +1,184 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__CALLBACK_H +#define FLAC__CALLBACK_H + +#include "ordinals.h" +#include /* for size_t */ + +/** \file include/FLAC/callback.h + * + * \brief + * This module defines the structures for describing I/O callbacks + * to the other FLAC interfaces. + * + * See the detailed documentation for callbacks in the + * \link flac_callbacks callbacks \endlink module. + */ + +/** \defgroup flac_callbacks FLAC/callback.h: I/O callback structures + * \ingroup flac + * + * \brief + * This module defines the structures for describing I/O callbacks + * to the other FLAC interfaces. + * + * The purpose of the I/O callback functions is to create a common way + * for the metadata interfaces to handle I/O. + * + * Originally the metadata interfaces required filenames as the way of + * specifying FLAC files to operate on. This is problematic in some + * environments so there is an additional option to specify a set of + * callbacks for doing I/O on the FLAC file, instead of the filename. + * + * In addition to the callbacks, a FLAC__IOHandle type is defined as an + * opaque structure for a data source. + * + * The callback function prototypes are similar (but not identical) to the + * stdio functions fread, fwrite, fseek, ftell, feof, and fclose. If you use + * stdio streams to implement the callbacks, you can pass fread, fwrite, and + * fclose anywhere a FLAC__IOCallback_Read, FLAC__IOCallback_Write, or + * FLAC__IOCallback_Close is required, and a FILE* anywhere a FLAC__IOHandle + * is required. \warning You generally CANNOT directly use fseek or ftell + * for FLAC__IOCallback_Seek or FLAC__IOCallback_Tell since on most systems + * these use 32-bit offsets and FLAC requires 64-bit offsets to deal with + * large files. You will have to find an equivalent function (e.g. ftello), + * or write a wrapper. The same is true for feof() since this is usually + * implemented as a macro, not as a function whose address can be taken. + * + * \{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the opaque handle type used by the callbacks. Typically + * this is a \c FILE* or address of a file descriptor. + */ +typedef void* FLAC__IOHandle; + +/** Signature for the read callback. + * The signature and semantics match POSIX fread() implementations + * and can generally be used interchangeably. + * + * \param ptr The address of the read buffer. + * \param size The size of the records to be read. + * \param nmemb The number of records to be read. + * \param handle The handle to the data source. + * \retval size_t + * The number of records read. + */ +typedef size_t (*FLAC__IOCallback_Read) (void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle); + +/** Signature for the write callback. + * The signature and semantics match POSIX fwrite() implementations + * and can generally be used interchangeably. + * + * \param ptr The address of the write buffer. + * \param size The size of the records to be written. + * \param nmemb The number of records to be written. + * \param handle The handle to the data source. + * \retval size_t + * The number of records written. + */ +typedef size_t (*FLAC__IOCallback_Write) (const void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle); + +/** Signature for the seek callback. + * The signature and semantics mostly match POSIX fseek() WITH ONE IMPORTANT + * EXCEPTION: the offset is a 64-bit type whereas fseek() is generally 'long' + * and 32-bits wide. + * + * \param handle The handle to the data source. + * \param offset The new position, relative to \a whence + * \param whence \c SEEK_SET, \c SEEK_CUR, or \c SEEK_END + * \retval int + * \c 0 on success, \c -1 on error. + */ +typedef int (*FLAC__IOCallback_Seek) (FLAC__IOHandle handle, FLAC__int64 offset, int whence); + +/** Signature for the tell callback. + * The signature and semantics mostly match POSIX ftell() WITH ONE IMPORTANT + * EXCEPTION: the offset is a 64-bit type whereas ftell() is generally 'long' + * and 32-bits wide. + * + * \param handle The handle to the data source. + * \retval FLAC__int64 + * The current position on success, \c -1 on error. + */ +typedef FLAC__int64 (*FLAC__IOCallback_Tell) (FLAC__IOHandle handle); + +/** Signature for the EOF callback. + * The signature and semantics mostly match POSIX feof() but WATCHOUT: + * on many systems, feof() is a macro, so in this case a wrapper function + * must be provided instead. + * + * \param handle The handle to the data source. + * \retval int + * \c 0 if not at end of file, nonzero if at end of file. + */ +typedef int (*FLAC__IOCallback_Eof) (FLAC__IOHandle handle); + +/** Signature for the close callback. + * The signature and semantics match POSIX fclose() implementations + * and can generally be used interchangeably. + * + * \param handle The handle to the data source. + * \retval int + * \c 0 on success, \c EOF on error. + */ +typedef int (*FLAC__IOCallback_Close) (FLAC__IOHandle handle); + +/** A structure for holding a set of callbacks. + * Each FLAC interface that requires a FLAC__IOCallbacks structure will + * describe which of the callbacks are required. The ones that are not + * required may be set to NULL. + * + * If the seek requirement for an interface is optional, you can signify that + * a data sorce is not seekable by setting the \a seek field to \c NULL. + */ +typedef struct { + FLAC__IOCallback_Read read; + FLAC__IOCallback_Write write; + FLAC__IOCallback_Seek seek; + FLAC__IOCallback_Tell tell; + FLAC__IOCallback_Eof eof; + FLAC__IOCallback_Close close; +} FLAC__IOCallbacks; + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/headers/FLAC/export.h b/Audio-Frameworks/bin/flac/headers/FLAC/export.h new file mode 100644 index 0000000..a525f29 --- /dev/null +++ b/Audio-Frameworks/bin/flac/headers/FLAC/export.h @@ -0,0 +1,91 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__EXPORT_H +#define FLAC__EXPORT_H + +/** \file include/FLAC/export.h + * + * \brief + * This module contains #defines and symbols for exporting function + * calls, and providing version information and compiled-in features. + * + * See the \link flac_export export \endlink module. + */ + +/** \defgroup flac_export FLAC/export.h: export symbols + * \ingroup flac + * + * \brief + * This module contains #defines and symbols for exporting function + * calls, and providing version information and compiled-in features. + * + * If you are compiling with MSVC and will link to the static library + * (libFLAC.lib) you should define FLAC__NO_DLL in your project to + * make sure the symbols are exported properly. + * + * \{ + */ + +#if defined(FLAC__NO_DLL) || !defined(_MSC_VER) +#define FLAC_API + +#else + +#ifdef FLAC_API_EXPORTS +#define FLAC_API _declspec(dllexport) +#else +#define FLAC_API _declspec(dllimport) + +#endif +#endif + +/** These #defines will mirror the libtool-based library version number, see + * http://www.gnu.org/software/libtool/manual.html#Libtool-versioning + */ +#define FLAC_API_VERSION_CURRENT 10 +#define FLAC_API_VERSION_REVISION 0 /**< see above */ +#define FLAC_API_VERSION_AGE 2 /**< see above */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \c 1 if the library has been compiled with support for Ogg FLAC, else \c 0. */ +extern FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC; + +#ifdef __cplusplus +} +#endif + +/* \} */ + +#endif diff --git a/Audio-Frameworks/bin/flac/headers/FLAC/format.h b/Audio-Frameworks/bin/flac/headers/FLAC/format.h new file mode 100644 index 0000000..77e2d01 --- /dev/null +++ b/Audio-Frameworks/bin/flac/headers/FLAC/format.h @@ -0,0 +1,1010 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__FORMAT_H +#define FLAC__FORMAT_H + +#include "export.h" +#include "ordinals.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** \file include/FLAC/format.h + * + * \brief + * This module contains structure definitions for the representation + * of FLAC format components in memory. These are the basic + * structures used by the rest of the interfaces. + * + * See the detailed documentation in the + * \link flac_format format \endlink module. + */ + +/** \defgroup flac_format FLAC/format.h: format components + * \ingroup flac + * + * \brief + * This module contains structure definitions for the representation + * of FLAC format components in memory. These are the basic + * structures used by the rest of the interfaces. + * + * First, you should be familiar with the + * FLAC format. Many of the values here + * follow directly from the specification. As a user of libFLAC, the + * interesting parts really are the structures that describe the frame + * header and metadata blocks. + * + * The format structures here are very primitive, designed to store + * information in an efficient way. Reading information from the + * structures is easy but creating or modifying them directly is + * more complex. For the most part, as a user of a library, editing + * is not necessary; however, for metadata blocks it is, so there are + * convenience functions provided in the \link flac_metadata metadata + * module \endlink to simplify the manipulation of metadata blocks. + * + * \note + * It's not the best convention, but symbols ending in _LEN are in bits + * and _LENGTH are in bytes. _LENGTH symbols are \#defines instead of + * global variables because they are usually used when declaring byte + * arrays and some compilers require compile-time knowledge of array + * sizes when declared on the stack. + * + * \{ + */ + + +/* + Most of the values described in this file are defined by the FLAC + format specification. There is nothing to tune here. +*/ + +/** The largest legal metadata type code. */ +#define FLAC__MAX_METADATA_TYPE_CODE (126u) + +/** The minimum block size, in samples, permitted by the format. */ +#define FLAC__MIN_BLOCK_SIZE (16u) + +/** The maximum block size, in samples, permitted by the format. */ +#define FLAC__MAX_BLOCK_SIZE (65535u) + +/** The maximum block size, in samples, permitted by the FLAC subset for + * sample rates up to 48kHz. */ +#define FLAC__SUBSET_MAX_BLOCK_SIZE_48000HZ (4608u) + +/** The maximum number of channels permitted by the format. */ +#define FLAC__MAX_CHANNELS (8u) + +/** The minimum sample resolution permitted by the format. */ +#define FLAC__MIN_BITS_PER_SAMPLE (4u) + +/** The maximum sample resolution permitted by the format. */ +#define FLAC__MAX_BITS_PER_SAMPLE (32u) + +/** The maximum sample resolution permitted by libFLAC. + * + * \warning + * FLAC__MAX_BITS_PER_SAMPLE is the limit of the FLAC format. However, + * the reference encoder/decoder is currently limited to 24 bits because + * of prevalent 32-bit math, so make sure and use this value when + * appropriate. + */ +#define FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE (24u) + +/** The maximum sample rate permitted by the format. The value is + * ((2 ^ 16) - 1) * 10; see FLAC format + * as to why. + */ +#define FLAC__MAX_SAMPLE_RATE (655350u) + +/** The maximum LPC order permitted by the format. */ +#define FLAC__MAX_LPC_ORDER (32u) + +/** The maximum LPC order permitted by the FLAC subset for sample rates + * up to 48kHz. */ +#define FLAC__SUBSET_MAX_LPC_ORDER_48000HZ (12u) + +/** The minimum quantized linear predictor coefficient precision + * permitted by the format. + */ +#define FLAC__MIN_QLP_COEFF_PRECISION (5u) + +/** The maximum quantized linear predictor coefficient precision + * permitted by the format. + */ +#define FLAC__MAX_QLP_COEFF_PRECISION (15u) + +/** The maximum order of the fixed predictors permitted by the format. */ +#define FLAC__MAX_FIXED_ORDER (4u) + +/** The maximum Rice partition order permitted by the format. */ +#define FLAC__MAX_RICE_PARTITION_ORDER (15u) + +/** The maximum Rice partition order permitted by the FLAC Subset. */ +#define FLAC__SUBSET_MAX_RICE_PARTITION_ORDER (8u) + +/** The version string of the release, stamped onto the libraries and binaries. + * + * \note + * This does not correspond to the shared library version number, which + * is used to determine binary compatibility. + */ +extern FLAC_API const char *FLAC__VERSION_STRING; + +/** The vendor string inserted by the encoder into the VORBIS_COMMENT block. + * This is a NUL-terminated ASCII string; when inserted into the + * VORBIS_COMMENT the trailing null is stripped. + */ +extern FLAC_API const char *FLAC__VENDOR_STRING; + +/** The byte string representation of the beginning of a FLAC stream. */ +extern FLAC_API const FLAC__byte FLAC__STREAM_SYNC_STRING[4]; /* = "fLaC" */ + +/** The 32-bit integer big-endian representation of the beginning of + * a FLAC stream. + */ +extern FLAC_API const unsigned FLAC__STREAM_SYNC; /* = 0x664C6143 */ + +/** The length of the FLAC signature in bits. */ +extern FLAC_API const unsigned FLAC__STREAM_SYNC_LEN; /* = 32 bits */ + +/** The length of the FLAC signature in bytes. */ +#define FLAC__STREAM_SYNC_LENGTH (4u) + + +/***************************************************************************** + * + * Subframe structures + * + *****************************************************************************/ + +/*****************************************************************************/ + +/** An enumeration of the available entropy coding methods. */ +typedef enum { + FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0, + /**< Residual is coded by partitioning into contexts, each with it's own + * 4-bit Rice parameter. */ + + FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 = 1 + /**< Residual is coded by partitioning into contexts, each with it's own + * 5-bit Rice parameter. */ +} FLAC__EntropyCodingMethodType; + +/** Maps a FLAC__EntropyCodingMethodType to a C string. + * + * Using a FLAC__EntropyCodingMethodType as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__EntropyCodingMethodTypeString[]; + + +/** Contents of a Rice partitioned residual + */ +typedef struct { + + unsigned *parameters; + /**< The Rice parameters for each context. */ + + unsigned *raw_bits; + /**< Widths for escape-coded partitions. Will be non-zero for escaped + * partitions and zero for unescaped partitions. + */ + + unsigned capacity_by_order; + /**< The capacity of the \a parameters and \a raw_bits arrays + * specified as an order, i.e. the number of array elements + * allocated is 2 ^ \a capacity_by_order. + */ +} FLAC__EntropyCodingMethod_PartitionedRiceContents; + +/** Header for a Rice partitioned residual. (c.f. format specification) + */ +typedef struct { + + unsigned order; + /**< The partition order, i.e. # of contexts = 2 ^ \a order. */ + + const FLAC__EntropyCodingMethod_PartitionedRiceContents *contents; + /**< The context's Rice parameters and/or raw bits. */ + +} FLAC__EntropyCodingMethod_PartitionedRice; + +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN; /**< == 5 (bits) */ +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN; /**< == 5 (bits) */ + +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER; +/**< == (1<format specification) + */ +typedef struct { + FLAC__EntropyCodingMethodType type; + union { + FLAC__EntropyCodingMethod_PartitionedRice partitioned_rice; + } data; +} FLAC__EntropyCodingMethod; + +extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_TYPE_LEN; /**< == 2 (bits) */ + +/*****************************************************************************/ + +/** An enumeration of the available subframe types. */ +typedef enum { + FLAC__SUBFRAME_TYPE_CONSTANT = 0, /**< constant signal */ + FLAC__SUBFRAME_TYPE_VERBATIM = 1, /**< uncompressed signal */ + FLAC__SUBFRAME_TYPE_FIXED = 2, /**< fixed polynomial prediction */ + FLAC__SUBFRAME_TYPE_LPC = 3 /**< linear prediction */ +} FLAC__SubframeType; + +/** Maps a FLAC__SubframeType to a C string. + * + * Using a FLAC__SubframeType as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__SubframeTypeString[]; + + +/** CONSTANT subframe. (c.f. format specification) + */ +typedef struct { + FLAC__int32 value; /**< The constant signal value. */ +} FLAC__Subframe_Constant; + + +/** VERBATIM subframe. (c.f. format specification) + */ +typedef struct { + const FLAC__int32 *data; /**< A pointer to verbatim signal. */ +} FLAC__Subframe_Verbatim; + + +/** FIXED subframe. (c.f. format specification) + */ +typedef struct { + FLAC__EntropyCodingMethod entropy_coding_method; + /**< The residual coding method. */ + + unsigned order; + /**< The polynomial order. */ + + FLAC__int32 warmup[FLAC__MAX_FIXED_ORDER]; + /**< Warmup samples to prime the predictor, length == order. */ + + const FLAC__int32 *residual; + /**< The residual signal, length == (blocksize minus order) samples. */ +} FLAC__Subframe_Fixed; + + +/** LPC subframe. (c.f. format specification) + */ +typedef struct { + FLAC__EntropyCodingMethod entropy_coding_method; + /**< The residual coding method. */ + + unsigned order; + /**< The FIR order. */ + + unsigned qlp_coeff_precision; + /**< Quantized FIR filter coefficient precision in bits. */ + + int quantization_level; + /**< The qlp coeff shift needed. */ + + FLAC__int32 qlp_coeff[FLAC__MAX_LPC_ORDER]; + /**< FIR filter coefficients. */ + + FLAC__int32 warmup[FLAC__MAX_LPC_ORDER]; + /**< Warmup samples to prime the predictor, length == order. */ + + const FLAC__int32 *residual; + /**< The residual signal, length == (blocksize minus order) samples. */ +} FLAC__Subframe_LPC; + +extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN; /**< == 5 (bits) */ + + +/** FLAC subframe structure. (c.f. format specification) + */ +typedef struct { + FLAC__SubframeType type; + union { + FLAC__Subframe_Constant constant; + FLAC__Subframe_Fixed fixed; + FLAC__Subframe_LPC lpc; + FLAC__Subframe_Verbatim verbatim; + } data; + unsigned wasted_bits; +} FLAC__Subframe; + +/** == 1 (bit) + * + * This used to be a zero-padding bit (hence the name + * FLAC__SUBFRAME_ZERO_PAD_LEN) but is now a reserved bit. It still has a + * mandatory value of \c 0 but in the future may take on the value \c 0 or \c 1 + * to mean something else. + */ +extern FLAC_API const unsigned FLAC__SUBFRAME_ZERO_PAD_LEN; +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LEN; /**< == 6 (bits) */ +extern FLAC_API const unsigned FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN; /**< == 1 (bit) */ + +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK; /**< = 0x00 */ +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK; /**< = 0x02 */ +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_FIXED_BYTE_ALIGNED_MASK; /**< = 0x10 */ +extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK; /**< = 0x40 */ + +/*****************************************************************************/ + + +/***************************************************************************** + * + * Frame structures + * + *****************************************************************************/ + +/** An enumeration of the available channel assignments. */ +typedef enum { + FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT = 0, /**< independent channels */ + FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE = 1, /**< left+side stereo */ + FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE = 2, /**< right+side stereo */ + FLAC__CHANNEL_ASSIGNMENT_MID_SIDE = 3 /**< mid+side stereo */ +} FLAC__ChannelAssignment; + +/** Maps a FLAC__ChannelAssignment to a C string. + * + * Using a FLAC__ChannelAssignment as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__ChannelAssignmentString[]; + +/** An enumeration of the possible frame numbering methods. */ +typedef enum { + FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER, /**< number contains the frame number */ + FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER /**< number contains the sample number of first sample in frame */ +} FLAC__FrameNumberType; + +/** Maps a FLAC__FrameNumberType to a C string. + * + * Using a FLAC__FrameNumberType as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__FrameNumberTypeString[]; + + +/** FLAC frame header structure. (c.f. format specification) + */ +typedef struct { + unsigned blocksize; + /**< The number of samples per subframe. */ + + unsigned sample_rate; + /**< The sample rate in Hz. */ + + unsigned channels; + /**< The number of channels (== number of subframes). */ + + FLAC__ChannelAssignment channel_assignment; + /**< The channel assignment for the frame. */ + + unsigned bits_per_sample; + /**< The sample resolution. */ + + FLAC__FrameNumberType number_type; + /**< The numbering scheme used for the frame. As a convenience, the + * decoder will always convert a frame number to a sample number because + * the rules are complex. */ + + union { + FLAC__uint32 frame_number; + FLAC__uint64 sample_number; + } number; + /**< The frame number or sample number of first sample in frame; + * use the \a number_type value to determine which to use. */ + + FLAC__uint8 crc; + /**< CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0) + * of the raw frame header bytes, meaning everything before the CRC byte + * including the sync code. + */ +} FLAC__FrameHeader; + +extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC; /**< == 0x3ffe; the frame header sync code */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC_LEN; /**< == 14 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_RESERVED_LEN; /**< == 1 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN; /**< == 1 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCK_SIZE_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_SAMPLE_RATE_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN; /**< == 4 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN; /**< == 3 (bits) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_ZERO_PAD_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__FRAME_HEADER_CRC_LEN; /**< == 8 (bits) */ + + +/** FLAC frame footer structure. (c.f. format specification) + */ +typedef struct { + FLAC__uint16 crc; + /**< CRC-16 (polynomial = x^16 + x^15 + x^2 + x^0, initialized with + * 0) of the bytes before the crc, back to and including the frame header + * sync code. + */ +} FLAC__FrameFooter; + +extern FLAC_API const unsigned FLAC__FRAME_FOOTER_CRC_LEN; /**< == 16 (bits) */ + + +/** FLAC frame structure. (c.f. format specification) + */ +typedef struct { + FLAC__FrameHeader header; + FLAC__Subframe subframes[FLAC__MAX_CHANNELS]; + FLAC__FrameFooter footer; +} FLAC__Frame; + +/*****************************************************************************/ + + +/***************************************************************************** + * + * Meta-data structures + * + *****************************************************************************/ + +/** An enumeration of the available metadata block types. */ +typedef enum { + + FLAC__METADATA_TYPE_STREAMINFO = 0, + /**< STREAMINFO block */ + + FLAC__METADATA_TYPE_PADDING = 1, + /**< PADDING block */ + + FLAC__METADATA_TYPE_APPLICATION = 2, + /**< APPLICATION block */ + + FLAC__METADATA_TYPE_SEEKTABLE = 3, + /**< SEEKTABLE block */ + + FLAC__METADATA_TYPE_VORBIS_COMMENT = 4, + /**< VORBISCOMMENT block (a.k.a. FLAC tags) */ + + FLAC__METADATA_TYPE_CUESHEET = 5, + /**< CUESHEET block */ + + FLAC__METADATA_TYPE_PICTURE = 6, + /**< PICTURE block */ + + FLAC__METADATA_TYPE_UNDEFINED = 7 + /**< marker to denote beginning of undefined type range; this number will increase as new metadata types are added */ + +} FLAC__MetadataType; + +/** Maps a FLAC__MetadataType to a C string. + * + * Using a FLAC__MetadataType as the index to this array will + * give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__MetadataTypeString[]; + + +/** FLAC STREAMINFO structure. (c.f. format specification) + */ +typedef struct { + unsigned min_blocksize, max_blocksize; + unsigned min_framesize, max_framesize; + unsigned sample_rate; + unsigned channels; + unsigned bits_per_sample; + FLAC__uint64 total_samples; + FLAC__byte md5sum[16]; +} FLAC__StreamMetadata_StreamInfo; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN; /**< == 16 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN; /**< == 16 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN; /**< == 24 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN; /**< == 24 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN; /**< == 20 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN; /**< == 3 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN; /**< == 5 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN; /**< == 36 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; /**< == 128 (bits) */ + +/** The total stream length of the STREAMINFO block in bytes. */ +#define FLAC__STREAM_METADATA_STREAMINFO_LENGTH (34u) + +/** FLAC PADDING structure. (c.f. format specification) + */ +typedef struct { + int dummy; + /**< Conceptually this is an empty struct since we don't store the + * padding bytes. Empty structs are not allowed by some C compilers, + * hence the dummy. + */ +} FLAC__StreamMetadata_Padding; + + +/** FLAC APPLICATION structure. (c.f. format specification) + */ +typedef struct { + FLAC__byte id[4]; + FLAC__byte *data; +} FLAC__StreamMetadata_Application; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_APPLICATION_ID_LEN; /**< == 32 (bits) */ + +/** SeekPoint structure used in SEEKTABLE blocks. (c.f. format specification) + */ +typedef struct { + FLAC__uint64 sample_number; + /**< The sample number of the target frame. */ + + FLAC__uint64 stream_offset; + /**< The offset, in bytes, of the target frame with respect to + * beginning of the first frame. */ + + unsigned frame_samples; + /**< The number of samples in the target frame. */ +} FLAC__StreamMetadata_SeekPoint; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN; /**< == 16 (bits) */ + +/** The total stream length of a seek point in bytes. */ +#define FLAC__STREAM_METADATA_SEEKPOINT_LENGTH (18u) + +/** The value used in the \a sample_number field of + * FLAC__StreamMetadataSeekPoint used to indicate a placeholder + * point (== 0xffffffffffffffff). + */ +extern FLAC_API const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; + + +/** FLAC SEEKTABLE structure. (c.f. format specification) + * + * \note From the format specification: + * - The seek points must be sorted by ascending sample number. + * - Each seek point's sample number must be the first sample of the + * target frame. + * - Each seek point's sample number must be unique within the table. + * - Existence of a SEEKTABLE block implies a correct setting of + * total_samples in the stream_info block. + * - Behavior is undefined when more than one SEEKTABLE block is + * present in a stream. + */ +typedef struct { + unsigned num_points; + FLAC__StreamMetadata_SeekPoint *points; +} FLAC__StreamMetadata_SeekTable; + + +/** Vorbis comment entry structure used in VORBIS_COMMENT blocks. (c.f. format specification) + * + * For convenience, the APIs maintain a trailing NUL character at the end of + * \a entry which is not counted toward \a length, i.e. + * \code strlen(entry) == length \endcode + */ +typedef struct { + FLAC__uint32 length; + FLAC__byte *entry; +} FLAC__StreamMetadata_VorbisComment_Entry; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN; /**< == 32 (bits) */ + + +/** FLAC VORBIS_COMMENT structure. (c.f. format specification) + */ +typedef struct { + FLAC__StreamMetadata_VorbisComment_Entry vendor_string; + FLAC__uint32 num_comments; + FLAC__StreamMetadata_VorbisComment_Entry *comments; +} FLAC__StreamMetadata_VorbisComment; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN; /**< == 32 (bits) */ + + +/** FLAC CUESHEET track index structure. (See the + * format specification for + * the full description of each field.) + */ +typedef struct { + FLAC__uint64 offset; + /**< Offset in samples, relative to the track offset, of the index + * point. + */ + + FLAC__byte number; + /**< The index point number. */ +} FLAC__StreamMetadata_CueSheet_Index; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN; /**< == 8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN; /**< == 3*8 (bits) */ + + +/** FLAC CUESHEET track structure. (See the + * format specification for + * the full description of each field.) + */ +typedef struct { + FLAC__uint64 offset; + /**< Track offset in samples, relative to the beginning of the FLAC audio stream. */ + + FLAC__byte number; + /**< The track number. */ + + char isrc[13]; + /**< Track ISRC. This is a 12-digit alphanumeric code plus a trailing \c NUL byte */ + + unsigned type:1; + /**< The track type: 0 for audio, 1 for non-audio. */ + + unsigned pre_emphasis:1; + /**< The pre-emphasis flag: 0 for no pre-emphasis, 1 for pre-emphasis. */ + + FLAC__byte num_indices; + /**< The number of track index points. */ + + FLAC__StreamMetadata_CueSheet_Index *indices; + /**< NULL if num_indices == 0, else pointer to array of index points. */ + +} FLAC__StreamMetadata_CueSheet_Track; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN; /**< == 8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN; /**< == 12*8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN; /**< == 6+13*8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN; /**< == 8 (bits) */ + + +/** FLAC CUESHEET structure. (See the + * format specification + * for the full description of each field.) + */ +typedef struct { + char media_catalog_number[129]; + /**< Media catalog number, in ASCII printable characters 0x20-0x7e. In + * general, the media catalog number may be 0 to 128 bytes long; any + * unused characters should be right-padded with NUL characters. + */ + + FLAC__uint64 lead_in; + /**< The number of lead-in samples. */ + + FLAC__bool is_cd; + /**< \c true if CUESHEET corresponds to a Compact Disc, else \c false. */ + + unsigned num_tracks; + /**< The number of tracks. */ + + FLAC__StreamMetadata_CueSheet_Track *tracks; + /**< NULL if num_tracks == 0, else pointer to array of tracks. */ + +} FLAC__StreamMetadata_CueSheet; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN; /**< == 128*8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN; /**< == 64 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN; /**< == 7+258*8 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN; /**< == 8 (bits) */ + + +/** An enumeration of the PICTURE types (see FLAC__StreamMetadataPicture and id3 v2.4 APIC tag). */ +typedef enum { + FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER = 0, /**< Other */ + FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD = 1, /**< 32x32 pixels 'file icon' (PNG only) */ + FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON = 2, /**< Other file icon */ + FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER = 3, /**< Cover (front) */ + FLAC__STREAM_METADATA_PICTURE_TYPE_BACK_COVER = 4, /**< Cover (back) */ + FLAC__STREAM_METADATA_PICTURE_TYPE_LEAFLET_PAGE = 5, /**< Leaflet page */ + FLAC__STREAM_METADATA_PICTURE_TYPE_MEDIA = 6, /**< Media (e.g. label side of CD) */ + FLAC__STREAM_METADATA_PICTURE_TYPE_LEAD_ARTIST = 7, /**< Lead artist/lead performer/soloist */ + FLAC__STREAM_METADATA_PICTURE_TYPE_ARTIST = 8, /**< Artist/performer */ + FLAC__STREAM_METADATA_PICTURE_TYPE_CONDUCTOR = 9, /**< Conductor */ + FLAC__STREAM_METADATA_PICTURE_TYPE_BAND = 10, /**< Band/Orchestra */ + FLAC__STREAM_METADATA_PICTURE_TYPE_COMPOSER = 11, /**< Composer */ + FLAC__STREAM_METADATA_PICTURE_TYPE_LYRICIST = 12, /**< Lyricist/text writer */ + FLAC__STREAM_METADATA_PICTURE_TYPE_RECORDING_LOCATION = 13, /**< Recording Location */ + FLAC__STREAM_METADATA_PICTURE_TYPE_DURING_RECORDING = 14, /**< During recording */ + FLAC__STREAM_METADATA_PICTURE_TYPE_DURING_PERFORMANCE = 15, /**< During performance */ + FLAC__STREAM_METADATA_PICTURE_TYPE_VIDEO_SCREEN_CAPTURE = 16, /**< Movie/video screen capture */ + FLAC__STREAM_METADATA_PICTURE_TYPE_FISH = 17, /**< A bright coloured fish */ + FLAC__STREAM_METADATA_PICTURE_TYPE_ILLUSTRATION = 18, /**< Illustration */ + FLAC__STREAM_METADATA_PICTURE_TYPE_BAND_LOGOTYPE = 19, /**< Band/artist logotype */ + FLAC__STREAM_METADATA_PICTURE_TYPE_PUBLISHER_LOGOTYPE = 20, /**< Publisher/Studio logotype */ + FLAC__STREAM_METADATA_PICTURE_TYPE_UNDEFINED +} FLAC__StreamMetadata_Picture_Type; + +/** Maps a FLAC__StreamMetadata_Picture_Type to a C string. + * + * Using a FLAC__StreamMetadata_Picture_Type as the index to this array + * will give the string equivalent. The contents should not be + * modified. + */ +extern FLAC_API const char * const FLAC__StreamMetadata_Picture_TypeString[]; + +/** FLAC PICTURE structure. (See the + * format specification + * for the full description of each field.) + */ +typedef struct { + FLAC__StreamMetadata_Picture_Type type; + /**< The kind of picture stored. */ + + char *mime_type; + /**< Picture data's MIME type, in ASCII printable characters + * 0x20-0x7e, NUL terminated. For best compatibility with players, + * use picture data of MIME type \c image/jpeg or \c image/png. A + * MIME type of '-->' is also allowed, in which case the picture + * data should be a complete URL. In file storage, the MIME type is + * stored as a 32-bit length followed by the ASCII string with no NUL + * terminator, but is converted to a plain C string in this structure + * for convenience. + */ + + FLAC__byte *description; + /**< Picture's description in UTF-8, NUL terminated. In file storage, + * the description is stored as a 32-bit length followed by the UTF-8 + * string with no NUL terminator, but is converted to a plain C string + * in this structure for convenience. + */ + + FLAC__uint32 width; + /**< Picture's width in pixels. */ + + FLAC__uint32 height; + /**< Picture's height in pixels. */ + + FLAC__uint32 depth; + /**< Picture's color depth in bits-per-pixel. */ + + FLAC__uint32 colors; + /**< For indexed palettes (like GIF), picture's number of colors (the + * number of palette entries), or \c 0 for non-indexed (i.e. 2^depth). + */ + + FLAC__uint32 data_length; + /**< Length of binary picture data in bytes. */ + + FLAC__byte *data; + /**< Binary picture data. */ + +} FLAC__StreamMetadata_Picture; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_TYPE_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_COLORS_LEN; /**< == 32 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN; /**< == 32 (bits) */ + + +/** Structure that is used when a metadata block of unknown type is loaded. + * The contents are opaque. The structure is used only internally to + * correctly handle unknown metadata. + */ +typedef struct { + FLAC__byte *data; +} FLAC__StreamMetadata_Unknown; + + +/** FLAC metadata block structure. (c.f. format specification) + */ +typedef struct { + FLAC__MetadataType type; + /**< The type of the metadata block; used determine which member of the + * \a data union to dereference. If type >= FLAC__METADATA_TYPE_UNDEFINED + * then \a data.unknown must be used. */ + + FLAC__bool is_last; + /**< \c true if this metadata block is the last, else \a false */ + + unsigned length; + /**< Length, in bytes, of the block data as it appears in the stream. */ + + union { + FLAC__StreamMetadata_StreamInfo stream_info; + FLAC__StreamMetadata_Padding padding; + FLAC__StreamMetadata_Application application; + FLAC__StreamMetadata_SeekTable seek_table; + FLAC__StreamMetadata_VorbisComment vorbis_comment; + FLAC__StreamMetadata_CueSheet cue_sheet; + FLAC__StreamMetadata_Picture picture; + FLAC__StreamMetadata_Unknown unknown; + } data; + /**< Polymorphic block data; use the \a type value to determine which + * to use. */ +} FLAC__StreamMetadata; + +extern FLAC_API const unsigned FLAC__STREAM_METADATA_IS_LAST_LEN; /**< == 1 (bit) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_TYPE_LEN; /**< == 7 (bits) */ +extern FLAC_API const unsigned FLAC__STREAM_METADATA_LENGTH_LEN; /**< == 24 (bits) */ + +/** The total stream length of a metadata block header in bytes. */ +#define FLAC__STREAM_METADATA_HEADER_LENGTH (4u) + +/*****************************************************************************/ + + +/***************************************************************************** + * + * Utility functions + * + *****************************************************************************/ + +/** Tests that a sample rate is valid for FLAC. + * + * \param sample_rate The sample rate to test for compliance. + * \retval FLAC__bool + * \c true if the given sample rate conforms to the specification, else + * \c false. + */ +FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(unsigned sample_rate); + +/** Tests that a sample rate is valid for the FLAC subset. The subset rules + * for valid sample rates are slightly more complex since the rate has to + * be expressible completely in the frame header. + * + * \param sample_rate The sample rate to test for compliance. + * \retval FLAC__bool + * \c true if the given sample rate conforms to the specification for the + * subset, else \c false. + */ +FLAC_API FLAC__bool FLAC__format_sample_rate_is_subset(unsigned sample_rate); + +/** Check a Vorbis comment entry name to see if it conforms to the Vorbis + * comment specification. + * + * Vorbis comment names must be composed only of characters from + * [0x20-0x3C,0x3E-0x7D]. + * + * \param name A NUL-terminated string to be checked. + * \assert + * \code name != NULL \endcode + * \retval FLAC__bool + * \c false if entry name is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_name_is_legal(const char *name); + +/** Check a Vorbis comment entry value to see if it conforms to the Vorbis + * comment specification. + * + * Vorbis comment values must be valid UTF-8 sequences. + * + * \param value A string to be checked. + * \param length A the length of \a value in bytes. May be + * \c (unsigned)(-1) to indicate that \a value is a plain + * UTF-8 NUL-terminated string. + * \assert + * \code value != NULL \endcode + * \retval FLAC__bool + * \c false if entry name is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_value_is_legal(const FLAC__byte *value, unsigned length); + +/** Check a Vorbis comment entry to see if it conforms to the Vorbis + * comment specification. + * + * Vorbis comment entries must be of the form 'name=value', and 'name' and + * 'value' must be legal according to + * FLAC__format_vorbiscomment_entry_name_is_legal() and + * FLAC__format_vorbiscomment_entry_value_is_legal() respectively. + * + * \param entry An entry to be checked. + * \param length The length of \a entry in bytes. + * \assert + * \code value != NULL \endcode + * \retval FLAC__bool + * \c false if entry name is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_is_legal(const FLAC__byte *entry, unsigned length); + +/** Check a seek table to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * seek table. + * + * \param seek_table A pointer to a seek table to be checked. + * \assert + * \code seek_table != NULL \endcode + * \retval FLAC__bool + * \c false if seek table is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_seektable_is_legal(const FLAC__StreamMetadata_SeekTable *seek_table); + +/** Sort a seek table's seek points according to the format specification. + * This includes a "unique-ification" step to remove duplicates, i.e. + * seek points with identical \a sample_number values. Duplicate seek + * points are converted into placeholder points and sorted to the end of + * the table. + * + * \param seek_table A pointer to a seek table to be sorted. + * \assert + * \code seek_table != NULL \endcode + * \retval unsigned + * The number of duplicate seek points converted into placeholders. + */ +FLAC_API unsigned FLAC__format_seektable_sort(FLAC__StreamMetadata_SeekTable *seek_table); + +/** Check a cue sheet to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * cue sheet. + * + * \param cue_sheet A pointer to an existing cue sheet to be checked. + * \param check_cd_da_subset If \c true, check CUESHEET against more + * stringent requirements for a CD-DA (audio) disc. + * \param violation Address of a pointer to a string. If there is a + * violation, a pointer to a string explanation of the + * violation will be returned here. \a violation may be + * \c NULL if you don't need the returned string. Do not + * free the returned string; it will always point to static + * data. + * \assert + * \code cue_sheet != NULL \endcode + * \retval FLAC__bool + * \c false if cue sheet is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_cuesheet_is_legal(const FLAC__StreamMetadata_CueSheet *cue_sheet, FLAC__bool check_cd_da_subset, const char **violation); + +/** Check picture data to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * PICTURE block. + * + * \param picture A pointer to existing picture data to be checked. + * \param violation Address of a pointer to a string. If there is a + * violation, a pointer to a string explanation of the + * violation will be returned here. \a violation may be + * \c NULL if you don't need the returned string. Do not + * free the returned string; it will always point to static + * data. + * \assert + * \code picture != NULL \endcode + * \retval FLAC__bool + * \c false if picture data is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__format_picture_is_legal(const FLAC__StreamMetadata_Picture *picture, const char **violation); + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/headers/FLAC/metadata.h b/Audio-Frameworks/bin/flac/headers/FLAC/metadata.h new file mode 100644 index 0000000..fff90b0 --- /dev/null +++ b/Audio-Frameworks/bin/flac/headers/FLAC/metadata.h @@ -0,0 +1,2181 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__METADATA_H +#define FLAC__METADATA_H + +#include /* for off_t */ +#include "export.h" +#include "callback.h" +#include "format.h" + +/* -------------------------------------------------------------------- + (For an example of how all these routines are used, see the source + code for the unit tests in src/test_libFLAC/metadata_*.c, or + metaflac in src/metaflac/) + ------------------------------------------------------------------*/ + +/** \file include/FLAC/metadata.h + * + * \brief + * This module provides functions for creating and manipulating FLAC + * metadata blocks in memory, and three progressively more powerful + * interfaces for traversing and editing metadata in FLAC files. + * + * See the detailed documentation for each interface in the + * \link flac_metadata metadata \endlink module. + */ + +/** \defgroup flac_metadata FLAC/metadata.h: metadata interfaces + * \ingroup flac + * + * \brief + * This module provides functions for creating and manipulating FLAC + * metadata blocks in memory, and three progressively more powerful + * interfaces for traversing and editing metadata in native FLAC files. + * Note that currently only the Chain interface (level 2) supports Ogg + * FLAC files, and it is read-only i.e. no writing back changed + * metadata to file. + * + * There are three metadata interfaces of increasing complexity: + * + * Level 0: + * Read-only access to the STREAMINFO, VORBIS_COMMENT, CUESHEET, and + * PICTURE blocks. + * + * Level 1: + * Read-write access to all metadata blocks. This level is write- + * efficient in most cases (more on this below), and uses less memory + * than level 2. + * + * Level 2: + * Read-write access to all metadata blocks. This level is write- + * efficient in all cases, but uses more memory since all metadata for + * the whole file is read into memory and manipulated before writing + * out again. + * + * What do we mean by efficient? Since FLAC metadata appears at the + * beginning of the file, when writing metadata back to a FLAC file + * it is possible to grow or shrink the metadata such that the entire + * file must be rewritten. However, if the size remains the same during + * changes or PADDING blocks are utilized, only the metadata needs to be + * overwritten, which is much faster. + * + * Efficient means the whole file is rewritten at most one time, and only + * when necessary. Level 1 is not efficient only in the case that you + * cause more than one metadata block to grow or shrink beyond what can + * be accomodated by padding. In this case you should probably use level + * 2, which allows you to edit all the metadata for a file in memory and + * write it out all at once. + * + * All levels know how to skip over and not disturb an ID3v2 tag at the + * front of the file. + * + * All levels access files via their filenames. In addition, level 2 + * has additional alternative read and write functions that take an I/O + * handle and callbacks, for situations where access by filename is not + * possible. + * + * In addition to the three interfaces, this module defines functions for + * creating and manipulating various metadata objects in memory. As we see + * from the Format module, FLAC metadata blocks in memory are very primitive + * structures for storing information in an efficient way. Reading + * information from the structures is easy but creating or modifying them + * directly is more complex. The metadata object routines here facilitate + * this by taking care of the consistency and memory management drudgery. + * + * Unless you will be using the level 1 or 2 interfaces to modify existing + * metadata however, you will not probably not need these. + * + * From a dependency standpoint, none of the encoders or decoders require + * the metadata module. This is so that embedded users can strip out the + * metadata module from libFLAC to reduce the size and complexity. + */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/** \defgroup flac_metadata_level0 FLAC/metadata.h: metadata level 0 interface + * \ingroup flac_metadata + * + * \brief + * The level 0 interface consists of individual routines to read the + * STREAMINFO, VORBIS_COMMENT, CUESHEET, and PICTURE blocks, requiring + * only a filename. + * + * They try to skip any ID3v2 tag at the head of the file. + * + * \{ + */ + +/** Read the STREAMINFO metadata block of the given FLAC file. This function + * will try to skip any ID3v2 tag at the head of the file. + * + * \param filename The path to the FLAC file to read. + * \param streaminfo A pointer to space for the STREAMINFO block. Since + * FLAC__StreamMetadata is a simple structure with no + * memory allocation involved, you pass the address of + * an existing structure. It need not be initialized. + * \assert + * \code filename != NULL \endcode + * \code streaminfo != NULL \endcode + * \retval FLAC__bool + * \c true if a valid STREAMINFO block was read from \a filename. Returns + * \c false if there was a memory allocation error, a file decoder error, + * or the file contained no STREAMINFO block. (A memory allocation error + * is possible because this function must set up a file decoder.) + */ +FLAC_API FLAC__bool FLAC__metadata_get_streaminfo(const char *filename, FLAC__StreamMetadata *streaminfo); + +/** Read the VORBIS_COMMENT metadata block of the given FLAC file. This + * function will try to skip any ID3v2 tag at the head of the file. + * + * \param filename The path to the FLAC file to read. + * \param tags The address where the returned pointer will be + * stored. The \a tags object must be deleted by + * the caller using FLAC__metadata_object_delete(). + * \assert + * \code filename != NULL \endcode + * \code tags != NULL \endcode + * \retval FLAC__bool + * \c true if a valid VORBIS_COMMENT block was read from \a filename, + * and \a *tags will be set to the address of the metadata structure. + * Returns \c false if there was a memory allocation error, a file + * decoder error, or the file contained no VORBIS_COMMENT block, and + * \a *tags will be set to \c NULL. + */ +FLAC_API FLAC__bool FLAC__metadata_get_tags(const char *filename, FLAC__StreamMetadata **tags); + +/** Read the CUESHEET metadata block of the given FLAC file. This + * function will try to skip any ID3v2 tag at the head of the file. + * + * \param filename The path to the FLAC file to read. + * \param cuesheet The address where the returned pointer will be + * stored. The \a cuesheet object must be deleted by + * the caller using FLAC__metadata_object_delete(). + * \assert + * \code filename != NULL \endcode + * \code cuesheet != NULL \endcode + * \retval FLAC__bool + * \c true if a valid CUESHEET block was read from \a filename, + * and \a *cuesheet will be set to the address of the metadata + * structure. Returns \c false if there was a memory allocation + * error, a file decoder error, or the file contained no CUESHEET + * block, and \a *cuesheet will be set to \c NULL. + */ +FLAC_API FLAC__bool FLAC__metadata_get_cuesheet(const char *filename, FLAC__StreamMetadata **cuesheet); + +/** Read a PICTURE metadata block of the given FLAC file. This + * function will try to skip any ID3v2 tag at the head of the file. + * Since there can be more than one PICTURE block in a file, this + * function takes a number of parameters that act as constraints to + * the search. The PICTURE block with the largest area matching all + * the constraints will be returned, or \a *picture will be set to + * \c NULL if there was no such block. + * + * \param filename The path to the FLAC file to read. + * \param picture The address where the returned pointer will be + * stored. The \a picture object must be deleted by + * the caller using FLAC__metadata_object_delete(). + * \param type The desired picture type. Use \c -1 to mean + * "any type". + * \param mime_type The desired MIME type, e.g. "image/jpeg". The + * string will be matched exactly. Use \c NULL to + * mean "any MIME type". + * \param description The desired description. The string will be + * matched exactly. Use \c NULL to mean "any + * description". + * \param max_width The maximum width in pixels desired. Use + * \c (unsigned)(-1) to mean "any width". + * \param max_height The maximum height in pixels desired. Use + * \c (unsigned)(-1) to mean "any height". + * \param max_depth The maximum color depth in bits-per-pixel desired. + * Use \c (unsigned)(-1) to mean "any depth". + * \param max_colors The maximum number of colors desired. Use + * \c (unsigned)(-1) to mean "any number of colors". + * \assert + * \code filename != NULL \endcode + * \code picture != NULL \endcode + * \retval FLAC__bool + * \c true if a valid PICTURE block was read from \a filename, + * and \a *picture will be set to the address of the metadata + * structure. Returns \c false if there was a memory allocation + * error, a file decoder error, or the file contained no PICTURE + * block, and \a *picture will be set to \c NULL. + */ +FLAC_API FLAC__bool FLAC__metadata_get_picture(const char *filename, FLAC__StreamMetadata **picture, FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, unsigned max_width, unsigned max_height, unsigned max_depth, unsigned max_colors); + +/* \} */ + + +/** \defgroup flac_metadata_level1 FLAC/metadata.h: metadata level 1 interface + * \ingroup flac_metadata + * + * \brief + * The level 1 interface provides read-write access to FLAC file metadata and + * operates directly on the FLAC file. + * + * The general usage of this interface is: + * + * - Create an iterator using FLAC__metadata_simple_iterator_new() + * - Attach it to a file using FLAC__metadata_simple_iterator_init() and check + * the exit code. Call FLAC__metadata_simple_iterator_is_writable() to + * see if the file is writable, or only read access is allowed. + * - Use FLAC__metadata_simple_iterator_next() and + * FLAC__metadata_simple_iterator_prev() to traverse the blocks. + * This is does not read the actual blocks themselves. + * FLAC__metadata_simple_iterator_next() is relatively fast. + * FLAC__metadata_simple_iterator_prev() is slower since it needs to search + * forward from the front of the file. + * - Use FLAC__metadata_simple_iterator_get_block_type() or + * FLAC__metadata_simple_iterator_get_block() to access the actual data at + * the current iterator position. The returned object is yours to modify + * and free. + * - Use FLAC__metadata_simple_iterator_set_block() to write a modified block + * back. You must have write permission to the original file. Make sure to + * read the whole comment to FLAC__metadata_simple_iterator_set_block() + * below. + * - Use FLAC__metadata_simple_iterator_insert_block_after() to add new blocks. + * Use the object creation functions from + * \link flac_metadata_object here \endlink to generate new objects. + * - Use FLAC__metadata_simple_iterator_delete_block() to remove the block + * currently referred to by the iterator, or replace it with padding. + * - Destroy the iterator with FLAC__metadata_simple_iterator_delete() when + * finished. + * + * \note + * The FLAC file remains open the whole time between + * FLAC__metadata_simple_iterator_init() and + * FLAC__metadata_simple_iterator_delete(), so make sure you are not altering + * the file during this time. + * + * \note + * Do not modify the \a is_last, \a length, or \a type fields of returned + * FLAC__StreamMetadata objects. These are managed automatically. + * + * \note + * If any of the modification functions + * (FLAC__metadata_simple_iterator_set_block(), + * FLAC__metadata_simple_iterator_delete_block(), + * FLAC__metadata_simple_iterator_insert_block_after(), etc.) return \c false, + * you should delete the iterator as it may no longer be valid. + * + * \{ + */ + +struct FLAC__Metadata_SimpleIterator; +/** The opaque structure definition for the level 1 iterator type. + * See the + * \link flac_metadata_level1 metadata level 1 module \endlink + * for a detailed description. + */ +typedef struct FLAC__Metadata_SimpleIterator FLAC__Metadata_SimpleIterator; + +/** Status type for FLAC__Metadata_SimpleIterator. + * + * The iterator's current status can be obtained by calling FLAC__metadata_simple_iterator_status(). + */ +typedef enum { + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK = 0, + /**< The iterator is in the normal OK state */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT, + /**< The data passed into a function violated the function's usage criteria */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE, + /**< The iterator could not open the target file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE, + /**< The iterator could not find the FLAC signature at the start of the file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE, + /**< The iterator tried to write to a file that was not writable */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_BAD_METADATA, + /**< The iterator encountered input that does not conform to the FLAC metadata specification */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR, + /**< The iterator encountered an error while reading the FLAC file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR, + /**< The iterator encountered an error while seeking in the FLAC file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR, + /**< The iterator encountered an error while writing the FLAC file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_RENAME_ERROR, + /**< The iterator encountered an error renaming the FLAC file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_UNLINK_ERROR, + /**< The iterator encountered an error removing the temporary file */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR, + /**< Memory allocation failed */ + + FLAC__METADATA_SIMPLE_ITERATOR_STATUS_INTERNAL_ERROR + /**< The caller violated an assertion or an unexpected error occurred */ + +} FLAC__Metadata_SimpleIteratorStatus; + +/** Maps a FLAC__Metadata_SimpleIteratorStatus to a C string. + * + * Using a FLAC__Metadata_SimpleIteratorStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__Metadata_SimpleIteratorStatusString[]; + + +/** Create a new iterator instance. + * + * \retval FLAC__Metadata_SimpleIterator* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__Metadata_SimpleIterator *FLAC__metadata_simple_iterator_new(void); + +/** Free an iterator instance. Deletes the object pointed to by \a iterator. + * + * \param iterator A pointer to an existing iterator. + * \assert + * \code iterator != NULL \endcode + */ +FLAC_API void FLAC__metadata_simple_iterator_delete(FLAC__Metadata_SimpleIterator *iterator); + +/** Get the current status of the iterator. Call this after a function + * returns \c false to get the reason for the error. Also resets the status + * to FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK. + * + * \param iterator A pointer to an existing iterator. + * \assert + * \code iterator != NULL \endcode + * \retval FLAC__Metadata_SimpleIteratorStatus + * The current status of the iterator. + */ +FLAC_API FLAC__Metadata_SimpleIteratorStatus FLAC__metadata_simple_iterator_status(FLAC__Metadata_SimpleIterator *iterator); + +/** Initialize the iterator to point to the first metadata block in the + * given FLAC file. + * + * \param iterator A pointer to an existing iterator. + * \param filename The path to the FLAC file. + * \param read_only If \c true, the FLAC file will be opened + * in read-only mode; if \c false, the FLAC + * file will be opened for edit even if no + * edits are performed. + * \param preserve_file_stats If \c true, the owner and modification + * time will be preserved even if the FLAC + * file is written to. + * \assert + * \code iterator != NULL \endcode + * \code filename != NULL \endcode + * \retval FLAC__bool + * \c false if a memory allocation error occurs, the file can't be + * opened, or another error occurs, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_init(FLAC__Metadata_SimpleIterator *iterator, const char *filename, FLAC__bool read_only, FLAC__bool preserve_file_stats); + +/** Returns \c true if the FLAC file is writable. If \c false, calls to + * FLAC__metadata_simple_iterator_set_block() and + * FLAC__metadata_simple_iterator_insert_block_after() will fail. + * + * \param iterator A pointer to an existing iterator. + * \assert + * \code iterator != NULL \endcode + * \retval FLAC__bool + * See above. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_is_writable(const FLAC__Metadata_SimpleIterator *iterator); + +/** Moves the iterator forward one metadata block, returning \c false if + * already at the end. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c false if already at the last metadata block of the chain, else + * \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_next(FLAC__Metadata_SimpleIterator *iterator); + +/** Moves the iterator backward one metadata block, returning \c false if + * already at the beginning. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c false if already at the first metadata block of the chain, else + * \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_prev(FLAC__Metadata_SimpleIterator *iterator); + +/** Returns a flag telling if the current metadata block is the last. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c true if the current metadata block is the last in the file, + * else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_is_last(const FLAC__Metadata_SimpleIterator *iterator); + +/** Get the offset of the metadata block at the current position. This + * avoids reading the actual block data which can save time for large + * blocks. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval off_t + * The offset of the metadata block at the current iterator position. + * This is the byte offset relative to the beginning of the file of + * the current metadata block's header. + */ +FLAC_API off_t FLAC__metadata_simple_iterator_get_block_offset(const FLAC__Metadata_SimpleIterator *iterator); + +/** Get the type of the metadata block at the current position. This + * avoids reading the actual block data which can save time for large + * blocks. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__MetadataType + * The type of the metadata block at the current iterator position. + */ +FLAC_API FLAC__MetadataType FLAC__metadata_simple_iterator_get_block_type(const FLAC__Metadata_SimpleIterator *iterator); + +/** Get the length of the metadata block at the current position. This + * avoids reading the actual block data which can save time for large + * blocks. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval unsigned + * The length of the metadata block at the current iterator position. + * The is same length as that in the + * metadata block header, + * i.e. the length of the metadata body that follows the header. + */ +FLAC_API unsigned FLAC__metadata_simple_iterator_get_block_length(const FLAC__Metadata_SimpleIterator *iterator); + +/** Get the application ID of the \c APPLICATION block at the current + * position. This avoids reading the actual block data which can save + * time for large blocks. + * + * \param iterator A pointer to an existing initialized iterator. + * \param id A pointer to a buffer of at least \c 4 bytes where + * the ID will be stored. + * \assert + * \code iterator != NULL \endcode + * \code id != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c true if the ID was successfully read, else \c false, in which + * case you should check FLAC__metadata_simple_iterator_status() to + * find out why. If the status is + * \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT, then the + * current metadata block is not an \c APPLICATION block. Otherwise + * if the status is + * \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR or + * \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR, an I/O error + * occurred and the iterator can no longer be used. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_get_application_id(FLAC__Metadata_SimpleIterator *iterator, FLAC__byte *id); + +/** Get the metadata block at the current position. You can modify the + * block but must use FLAC__metadata_simple_iterator_set_block() to + * write it back to the FLAC file. + * + * You must call FLAC__metadata_object_delete() on the returned object + * when you are finished with it. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__StreamMetadata* + * The current metadata block, or \c NULL if there was a memory + * allocation error. + */ +FLAC_API FLAC__StreamMetadata *FLAC__metadata_simple_iterator_get_block(FLAC__Metadata_SimpleIterator *iterator); + +/** Write a block back to the FLAC file. This function tries to be + * as efficient as possible; how the block is actually written is + * shown by the following: + * + * Existing block is a STREAMINFO block and the new block is a + * STREAMINFO block: the new block is written in place. Make sure + * you know what you're doing when changing the values of a + * STREAMINFO block. + * + * Existing block is a STREAMINFO block and the new block is a + * not a STREAMINFO block: this is an error since the first block + * must be a STREAMINFO block. Returns \c false without altering the + * file. + * + * Existing block is not a STREAMINFO block and the new block is a + * STREAMINFO block: this is an error since there may be only one + * STREAMINFO block. Returns \c false without altering the file. + * + * Existing block and new block are the same length: the existing + * block will be replaced by the new block, written in place. + * + * Existing block is longer than new block: if use_padding is \c true, + * the existing block will be overwritten in place with the new + * block followed by a PADDING block, if possible, to make the total + * size the same as the existing block. Remember that a padding + * block requires at least four bytes so if the difference in size + * between the new block and existing block is less than that, the + * entire file will have to be rewritten, using the new block's + * exact size. If use_padding is \c false, the entire file will be + * rewritten, replacing the existing block by the new block. + * + * Existing block is shorter than new block: if use_padding is \c true, + * the function will try and expand the new block into the following + * PADDING block, if it exists and doing so won't shrink the PADDING + * block to less than 4 bytes. If there is no following PADDING + * block, or it will shrink to less than 4 bytes, or use_padding is + * \c false, the entire file is rewritten, replacing the existing block + * with the new block. Note that in this case any following PADDING + * block is preserved as is. + * + * After writing the block, the iterator will remain in the same + * place, i.e. pointing to the new block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block The block to set. + * \param use_padding See above. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \code block != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_set_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding); + +/** This is similar to FLAC__metadata_simple_iterator_set_block() + * except that instead of writing over an existing block, it appends + * a block after the existing block. \a use_padding is again used to + * tell the function to try an expand into following padding in an + * attempt to avoid rewriting the entire file. + * + * This function will fail and return \c false if given a STREAMINFO + * block. + * + * After writing the block, the iterator will be pointing to the + * new block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block The block to set. + * \param use_padding See above. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \code block != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_insert_block_after(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding); + +/** Deletes the block at the current position. This will cause the + * entire FLAC file to be rewritten, unless \a use_padding is \c true, + * in which case the block will be replaced by an equal-sized PADDING + * block. The iterator will be left pointing to the block before the + * one just deleted. + * + * You may not delete the STREAMINFO block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param use_padding See above. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_simple_iterator_init() + * \retval FLAC__bool + * \c true if successful, else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_simple_iterator_delete_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__bool use_padding); + +/* \} */ + + +/** \defgroup flac_metadata_level2 FLAC/metadata.h: metadata level 2 interface + * \ingroup flac_metadata + * + * \brief + * The level 2 interface provides read-write access to FLAC file metadata; + * all metadata is read into memory, operated on in memory, and then written + * to file, which is more efficient than level 1 when editing multiple blocks. + * + * Currently Ogg FLAC is supported for read only, via + * FLAC__metadata_chain_read_ogg() but a subsequent + * FLAC__metadata_chain_write() will fail. + * + * The general usage of this interface is: + * + * - Create a new chain using FLAC__metadata_chain_new(). A chain is a + * linked list of FLAC metadata blocks. + * - Read all metadata into the the chain from a FLAC file using + * FLAC__metadata_chain_read() or FLAC__metadata_chain_read_ogg() and + * check the status. + * - Optionally, consolidate the padding using + * FLAC__metadata_chain_merge_padding() or + * FLAC__metadata_chain_sort_padding(). + * - Create a new iterator using FLAC__metadata_iterator_new() + * - Initialize the iterator to point to the first element in the chain + * using FLAC__metadata_iterator_init() + * - Traverse the chain using FLAC__metadata_iterator_next and + * FLAC__metadata_iterator_prev(). + * - Get a block for reading or modification using + * FLAC__metadata_iterator_get_block(). The pointer to the object + * inside the chain is returned, so the block is yours to modify. + * Changes will be reflected in the FLAC file when you write the + * chain. You can also add and delete blocks (see functions below). + * - When done, write out the chain using FLAC__metadata_chain_write(). + * Make sure to read the whole comment to the function below. + * - Delete the chain using FLAC__metadata_chain_delete(). + * + * \note + * Even though the FLAC file is not open while the chain is being + * manipulated, you must not alter the file externally during + * this time. The chain assumes the FLAC file will not change + * between the time of FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg() + * and FLAC__metadata_chain_write(). + * + * \note + * Do not modify the is_last, length, or type fields of returned + * FLAC__StreamMetadata objects. These are managed automatically. + * + * \note + * The metadata objects returned by FLAC__metadata_iterator_get_block() + * are owned by the chain; do not FLAC__metadata_object_delete() them. + * In the same way, blocks passed to FLAC__metadata_iterator_set_block() + * become owned by the chain and they will be deleted when the chain is + * deleted. + * + * \{ + */ + +struct FLAC__Metadata_Chain; +/** The opaque structure definition for the level 2 chain type. + */ +typedef struct FLAC__Metadata_Chain FLAC__Metadata_Chain; + +struct FLAC__Metadata_Iterator; +/** The opaque structure definition for the level 2 iterator type. + */ +typedef struct FLAC__Metadata_Iterator FLAC__Metadata_Iterator; + +typedef enum { + FLAC__METADATA_CHAIN_STATUS_OK = 0, + /**< The chain is in the normal OK state */ + + FLAC__METADATA_CHAIN_STATUS_ILLEGAL_INPUT, + /**< The data passed into a function violated the function's usage criteria */ + + FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE, + /**< The chain could not open the target file */ + + FLAC__METADATA_CHAIN_STATUS_NOT_A_FLAC_FILE, + /**< The chain could not find the FLAC signature at the start of the file */ + + FLAC__METADATA_CHAIN_STATUS_NOT_WRITABLE, + /**< The chain tried to write to a file that was not writable */ + + FLAC__METADATA_CHAIN_STATUS_BAD_METADATA, + /**< The chain encountered input that does not conform to the FLAC metadata specification */ + + FLAC__METADATA_CHAIN_STATUS_READ_ERROR, + /**< The chain encountered an error while reading the FLAC file */ + + FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR, + /**< The chain encountered an error while seeking in the FLAC file */ + + FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR, + /**< The chain encountered an error while writing the FLAC file */ + + FLAC__METADATA_CHAIN_STATUS_RENAME_ERROR, + /**< The chain encountered an error renaming the FLAC file */ + + FLAC__METADATA_CHAIN_STATUS_UNLINK_ERROR, + /**< The chain encountered an error removing the temporary file */ + + FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR, + /**< Memory allocation failed */ + + FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR, + /**< The caller violated an assertion or an unexpected error occurred */ + + FLAC__METADATA_CHAIN_STATUS_INVALID_CALLBACKS, + /**< One or more of the required callbacks was NULL */ + + FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH, + /**< FLAC__metadata_chain_write() was called on a chain read by + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), + * or + * FLAC__metadata_chain_write_with_callbacks()/FLAC__metadata_chain_write_with_callbacks_and_tempfile() + * was called on a chain read by + * FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). + * Matching read/write methods must always be used. */ + + FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL + /**< FLAC__metadata_chain_write_with_callbacks() was called when the + * chain write requires a tempfile; use + * FLAC__metadata_chain_write_with_callbacks_and_tempfile() instead. + * Or, FLAC__metadata_chain_write_with_callbacks_and_tempfile() was + * called when the chain write does not require a tempfile; use + * FLAC__metadata_chain_write_with_callbacks() instead. + * Always check FLAC__metadata_chain_check_if_tempfile_needed() + * before writing via callbacks. */ + +} FLAC__Metadata_ChainStatus; + +/** Maps a FLAC__Metadata_ChainStatus to a C string. + * + * Using a FLAC__Metadata_ChainStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__Metadata_ChainStatusString[]; + +/*********** FLAC__Metadata_Chain ***********/ + +/** Create a new chain instance. + * + * \retval FLAC__Metadata_Chain* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__Metadata_Chain *FLAC__metadata_chain_new(void); + +/** Free a chain instance. Deletes the object pointed to by \a chain. + * + * \param chain A pointer to an existing chain. + * \assert + * \code chain != NULL \endcode + */ +FLAC_API void FLAC__metadata_chain_delete(FLAC__Metadata_Chain *chain); + +/** Get the current status of the chain. Call this after a function + * returns \c false to get the reason for the error. Also resets the + * status to FLAC__METADATA_CHAIN_STATUS_OK. + * + * \param chain A pointer to an existing chain. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__Metadata_ChainStatus + * The current status of the chain. + */ +FLAC_API FLAC__Metadata_ChainStatus FLAC__metadata_chain_status(FLAC__Metadata_Chain *chain); + +/** Read all metadata from a FLAC file into the chain. + * + * \param chain A pointer to an existing chain. + * \param filename The path to the FLAC file to read. + * \assert + * \code chain != NULL \endcode + * \code filename != NULL \endcode + * \retval FLAC__bool + * \c true if a valid list of metadata blocks was read from + * \a filename, else \c false. On failure, check the status with + * FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_read(FLAC__Metadata_Chain *chain, const char *filename); + +/** Read all metadata from an Ogg FLAC file into the chain. + * + * \note Ogg FLAC metadata data writing is not supported yet and + * FLAC__metadata_chain_write() will fail. + * + * \param chain A pointer to an existing chain. + * \param filename The path to the Ogg FLAC file to read. + * \assert + * \code chain != NULL \endcode + * \code filename != NULL \endcode + * \retval FLAC__bool + * \c true if a valid list of metadata blocks was read from + * \a filename, else \c false. On failure, check the status with + * FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg(FLAC__Metadata_Chain *chain, const char *filename); + +/** Read all metadata from a FLAC stream into the chain via I/O callbacks. + * + * The \a handle need only be open for reading, but must be seekable. + * The equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" + * for Windows). + * + * \param chain A pointer to an existing chain. + * \param handle The I/O handle of the FLAC stream to read. The + * handle will NOT be closed after the metadata is read; + * that is the duty of the caller. + * \param callbacks + * A set of callbacks to use for I/O. The mandatory + * callbacks are \a read, \a seek, and \a tell. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if a valid list of metadata blocks was read from + * \a handle, else \c false. On failure, check the status with + * FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_read_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks); + +/** Read all metadata from an Ogg FLAC stream into the chain via I/O callbacks. + * + * The \a handle need only be open for reading, but must be seekable. + * The equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" + * for Windows). + * + * \note Ogg FLAC metadata data writing is not supported yet and + * FLAC__metadata_chain_write() will fail. + * + * \param chain A pointer to an existing chain. + * \param handle The I/O handle of the Ogg FLAC stream to read. The + * handle will NOT be closed after the metadata is read; + * that is the duty of the caller. + * \param callbacks + * A set of callbacks to use for I/O. The mandatory + * callbacks are \a read, \a seek, and \a tell. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if a valid list of metadata blocks was read from + * \a handle, else \c false. On failure, check the status with + * FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks); + +/** Checks if writing the given chain would require the use of a + * temporary file, or if it could be written in place. + * + * Under certain conditions, padding can be utilized so that writing + * edited metadata back to the FLAC file does not require rewriting the + * entire file. If rewriting is required, then a temporary workfile is + * required. When writing metadata using callbacks, you must check + * this function to know whether to call + * FLAC__metadata_chain_write_with_callbacks() or + * FLAC__metadata_chain_write_with_callbacks_and_tempfile(). When + * writing with FLAC__metadata_chain_write(), the temporary file is + * handled internally. + * + * \param chain A pointer to an existing chain. + * \param use_padding + * Whether or not padding will be allowed to be used + * during the write. The value of \a use_padding given + * here must match the value later passed to + * FLAC__metadata_chain_write_with_callbacks() or + * FLAC__metadata_chain_write_with_callbacks_with_tempfile(). + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if writing the current chain would require a tempfile, or + * \c false if metadata can be written in place. + */ +FLAC_API FLAC__bool FLAC__metadata_chain_check_if_tempfile_needed(FLAC__Metadata_Chain *chain, FLAC__bool use_padding); + +/** Write all metadata out to the FLAC file. This function tries to be as + * efficient as possible; how the metadata is actually written is shown by + * the following: + * + * If the current chain is the same size as the existing metadata, the new + * data is written in place. + * + * If the current chain is longer than the existing metadata, and + * \a use_padding is \c true, and the last block is a PADDING block of + * sufficient length, the function will truncate the final padding block + * so that the overall size of the metadata is the same as the existing + * metadata, and then just rewrite the metadata. Otherwise, if not all of + * the above conditions are met, the entire FLAC file must be rewritten. + * If you want to use padding this way it is a good idea to call + * FLAC__metadata_chain_sort_padding() first so that you have the maximum + * amount of padding to work with, unless you need to preserve ordering + * of the PADDING blocks for some reason. + * + * If the current chain is shorter than the existing metadata, and + * \a use_padding is \c true, and the final block is a PADDING block, the padding + * is extended to make the overall size the same as the existing data. If + * \a use_padding is \c true and the last block is not a PADDING block, a new + * PADDING block is added to the end of the new data to make it the same + * size as the existing data (if possible, see the note to + * FLAC__metadata_simple_iterator_set_block() about the four byte limit) + * and the new data is written in place. If none of the above apply or + * \a use_padding is \c false, the entire FLAC file is rewritten. + * + * If \a preserve_file_stats is \c true, the owner and modification time will + * be preserved even if the FLAC file is written. + * + * For this write function to be used, the chain must have been read with + * FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(), not + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(). + * + * \param chain A pointer to an existing chain. + * \param use_padding See above. + * \param preserve_file_stats See above. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if the write succeeded, else \c false. On failure, + * check the status with FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_write(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__bool preserve_file_stats); + +/** Write all metadata out to a FLAC stream via callbacks. + * + * (See FLAC__metadata_chain_write() for the details on how padding is + * used to write metadata in place if possible.) + * + * The \a handle must be open for updating and be seekable. The + * equivalent minimum stdio fopen() file mode is \c "r+" (or \c "r+b" + * for Windows). + * + * For this write function to be used, the chain must have been read with + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), + * not FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). + * Also, FLAC__metadata_chain_check_if_tempfile_needed() must have returned + * \c false. + * + * \param chain A pointer to an existing chain. + * \param use_padding See FLAC__metadata_chain_write() + * \param handle The I/O handle of the FLAC stream to write. The + * handle will NOT be closed after the metadata is + * written; that is the duty of the caller. + * \param callbacks A set of callbacks to use for I/O. The mandatory + * callbacks are \a write and \a seek. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if the write succeeded, else \c false. On failure, + * check the status with FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_write_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks); + +/** Write all metadata out to a FLAC stream via callbacks. + * + * (See FLAC__metadata_chain_write() for the details on how padding is + * used to write metadata in place if possible.) + * + * This version of the write-with-callbacks function must be used when + * FLAC__metadata_chain_check_if_tempfile_needed() returns true. In + * this function, you must supply an I/O handle corresponding to the + * FLAC file to edit, and a temporary handle to which the new FLAC + * file will be written. It is the caller's job to move this temporary + * FLAC file on top of the original FLAC file to complete the metadata + * edit. + * + * The \a handle must be open for reading and be seekable. The + * equivalent minimum stdio fopen() file mode is \c "r" (or \c "rb" + * for Windows). + * + * The \a temp_handle must be open for writing. The + * equivalent minimum stdio fopen() file mode is \c "w" (or \c "wb" + * for Windows). It should be an empty stream, or at least positioned + * at the start-of-file (in which case it is the caller's duty to + * truncate it on return). + * + * For this write function to be used, the chain must have been read with + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), + * not FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). + * Also, FLAC__metadata_chain_check_if_tempfile_needed() must have returned + * \c true. + * + * \param chain A pointer to an existing chain. + * \param use_padding See FLAC__metadata_chain_write() + * \param handle The I/O handle of the original FLAC stream to read. + * The handle will NOT be closed after the metadata is + * written; that is the duty of the caller. + * \param callbacks A set of callbacks to use for I/O on \a handle. + * The mandatory callbacks are \a read, \a seek, and + * \a eof. + * \param temp_handle The I/O handle of the FLAC stream to write. The + * handle will NOT be closed after the metadata is + * written; that is the duty of the caller. + * \param temp_callbacks + * A set of callbacks to use for I/O on temp_handle. + * The only mandatory callback is \a write. + * \assert + * \code chain != NULL \endcode + * \retval FLAC__bool + * \c true if the write succeeded, else \c false. On failure, + * check the status with FLAC__metadata_chain_status(). + */ +FLAC_API FLAC__bool FLAC__metadata_chain_write_with_callbacks_and_tempfile(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks, FLAC__IOHandle temp_handle, FLAC__IOCallbacks temp_callbacks); + +/** Merge adjacent PADDING blocks into a single block. + * + * \note This function does not write to the FLAC file, it only + * modifies the chain. + * + * \warning Any iterator on the current chain will become invalid after this + * call. You should delete the iterator and get a new one. + * + * \param chain A pointer to an existing chain. + * \assert + * \code chain != NULL \endcode + */ +FLAC_API void FLAC__metadata_chain_merge_padding(FLAC__Metadata_Chain *chain); + +/** This function will move all PADDING blocks to the end on the metadata, + * then merge them into a single block. + * + * \note This function does not write to the FLAC file, it only + * modifies the chain. + * + * \warning Any iterator on the current chain will become invalid after this + * call. You should delete the iterator and get a new one. + * + * \param chain A pointer to an existing chain. + * \assert + * \code chain != NULL \endcode + */ +FLAC_API void FLAC__metadata_chain_sort_padding(FLAC__Metadata_Chain *chain); + + +/*********** FLAC__Metadata_Iterator ***********/ + +/** Create a new iterator instance. + * + * \retval FLAC__Metadata_Iterator* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__Metadata_Iterator *FLAC__metadata_iterator_new(void); + +/** Free an iterator instance. Deletes the object pointed to by \a iterator. + * + * \param iterator A pointer to an existing iterator. + * \assert + * \code iterator != NULL \endcode + */ +FLAC_API void FLAC__metadata_iterator_delete(FLAC__Metadata_Iterator *iterator); + +/** Initialize the iterator to point to the first metadata block in the + * given chain. + * + * \param iterator A pointer to an existing iterator. + * \param chain A pointer to an existing and initialized (read) chain. + * \assert + * \code iterator != NULL \endcode + * \code chain != NULL \endcode + */ +FLAC_API void FLAC__metadata_iterator_init(FLAC__Metadata_Iterator *iterator, FLAC__Metadata_Chain *chain); + +/** Moves the iterator forward one metadata block, returning \c false if + * already at the end. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if already at the last metadata block of the chain, else + * \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_next(FLAC__Metadata_Iterator *iterator); + +/** Moves the iterator backward one metadata block, returning \c false if + * already at the beginning. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if already at the first metadata block of the chain, else + * \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_prev(FLAC__Metadata_Iterator *iterator); + +/** Get the type of the metadata block at the current position. + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__MetadataType + * The type of the metadata block at the current iterator position. + */ +FLAC_API FLAC__MetadataType FLAC__metadata_iterator_get_block_type(const FLAC__Metadata_Iterator *iterator); + +/** Get the metadata block at the current position. You can modify + * the block in place but must write the chain before the changes + * are reflected to the FLAC file. You do not need to call + * FLAC__metadata_iterator_set_block() to reflect the changes; + * the pointer returned by FLAC__metadata_iterator_get_block() + * points directly into the chain. + * + * \warning + * Do not call FLAC__metadata_object_delete() on the returned object; + * to delete a block use FLAC__metadata_iterator_delete_block(). + * + * \param iterator A pointer to an existing initialized iterator. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__StreamMetadata* + * The current metadata block. + */ +FLAC_API FLAC__StreamMetadata *FLAC__metadata_iterator_get_block(FLAC__Metadata_Iterator *iterator); + +/** Set the metadata block at the current position, replacing the existing + * block. The new block passed in becomes owned by the chain and it will be + * deleted when the chain is deleted. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block A pointer to a metadata block. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \code block != NULL \endcode + * \retval FLAC__bool + * \c false if the conditions in the above description are not met, or + * a memory allocation error occurs, otherwise \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_set_block(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block); + +/** Removes the current block from the chain. If \a replace_with_padding is + * \c true, the block will instead be replaced with a padding block of equal + * size. You can not delete the STREAMINFO block. The iterator will be + * left pointing to the block before the one just "deleted", even if + * \a replace_with_padding is \c true. + * + * \param iterator A pointer to an existing initialized iterator. + * \param replace_with_padding See above. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if the conditions in the above description are not met, + * otherwise \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_delete_block(FLAC__Metadata_Iterator *iterator, FLAC__bool replace_with_padding); + +/** Insert a new block before the current block. You cannot insert a block + * before the first STREAMINFO block. You cannot insert a STREAMINFO block + * as there can be only one, the one that already exists at the head when you + * read in a chain. The chain takes ownership of the new block and it will be + * deleted when the chain is deleted. The iterator will be left pointing to + * the new block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block A pointer to a metadata block to insert. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if the conditions in the above description are not met, or + * a memory allocation error occurs, otherwise \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_insert_block_before(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block); + +/** Insert a new block after the current block. You cannot insert a STREAMINFO + * block as there can be only one, the one that already exists at the head when + * you read in a chain. The chain takes ownership of the new block and it will + * be deleted when the chain is deleted. The iterator will be left pointing to + * the new block. + * + * \param iterator A pointer to an existing initialized iterator. + * \param block A pointer to a metadata block to insert. + * \assert + * \code iterator != NULL \endcode + * \a iterator has been successfully initialized with + * FLAC__metadata_iterator_init() + * \retval FLAC__bool + * \c false if the conditions in the above description are not met, or + * a memory allocation error occurs, otherwise \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_iterator_insert_block_after(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block); + +/* \} */ + + +/** \defgroup flac_metadata_object FLAC/metadata.h: metadata object methods + * \ingroup flac_metadata + * + * \brief + * This module contains methods for manipulating FLAC metadata objects. + * + * Since many are variable length we have to be careful about the memory + * management. We decree that all pointers to data in the object are + * owned by the object and memory-managed by the object. + * + * Use the FLAC__metadata_object_new() and FLAC__metadata_object_delete() + * functions to create all instances. When using the + * FLAC__metadata_object_set_*() functions to set pointers to data, set + * \a copy to \c true to have the function make it's own copy of the data, or + * to \c false to give the object ownership of your data. In the latter case + * your pointer must be freeable by free() and will be free()d when the object + * is FLAC__metadata_object_delete()d. It is legal to pass a null pointer as + * the data pointer to a FLAC__metadata_object_set_*() function as long as + * the length argument is 0 and the \a copy argument is \c false. + * + * The FLAC__metadata_object_new() and FLAC__metadata_object_clone() function + * will return \c NULL in the case of a memory allocation error, otherwise a new + * object. The FLAC__metadata_object_set_*() functions return \c false in the + * case of a memory allocation error. + * + * We don't have the convenience of C++ here, so note that the library relies + * on you to keep the types straight. In other words, if you pass, for + * example, a FLAC__StreamMetadata* that represents a STREAMINFO block to + * FLAC__metadata_object_application_set_data(), you will get an assertion + * failure. + * + * For convenience the FLAC__metadata_object_vorbiscomment_*() functions + * maintain a trailing NUL on each Vorbis comment entry. This is not counted + * toward the length or stored in the stream, but it can make working with plain + * comments (those that don't contain embedded-NULs in the value) easier. + * Entries passed into these functions have trailing NULs added if missing, and + * returned entries are guaranteed to have a trailing NUL. + * + * The FLAC__metadata_object_vorbiscomment_*() functions that take a Vorbis + * comment entry/name/value will first validate that it complies with the Vorbis + * comment specification and return false if it does not. + * + * There is no need to recalculate the length field on metadata blocks you + * have modified. They will be calculated automatically before they are + * written back to a file. + * + * \{ + */ + + +/** Create a new metadata object instance of the given type. + * + * The object will be "empty"; i.e. values and data pointers will be \c 0, + * with the exception of FLAC__METADATA_TYPE_VORBIS_COMMENT, which will have + * the vendor string set (but zero comments). + * + * Do not pass in a value greater than or equal to + * \a FLAC__METADATA_TYPE_UNDEFINED unless you really know what you're + * doing. + * + * \param type Type of object to create + * \retval FLAC__StreamMetadata* + * \c NULL if there was an error allocating memory or the type code is + * greater than FLAC__MAX_METADATA_TYPE_CODE, else the new instance. + */ +FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type); + +/** Create a copy of an existing metadata object. + * + * The copy is a "deep" copy, i.e. dynamically allocated data within the + * object is also copied. The caller takes ownership of the new block and + * is responsible for freeing it with FLAC__metadata_object_delete(). + * + * \param object Pointer to object to copy. + * \assert + * \code object != NULL \endcode + * \retval FLAC__StreamMetadata* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_clone(const FLAC__StreamMetadata *object); + +/** Free a metadata object. Deletes the object pointed to by \a object. + * + * The delete is a "deep" delete, i.e. dynamically allocated data within the + * object is also deleted. + * + * \param object A pointer to an existing object. + * \assert + * \code object != NULL \endcode + */ +FLAC_API void FLAC__metadata_object_delete(FLAC__StreamMetadata *object); + +/** Compares two metadata objects. + * + * The compare is "deep", i.e. dynamically allocated data within the + * object is also compared. + * + * \param block1 A pointer to an existing object. + * \param block2 A pointer to an existing object. + * \assert + * \code block1 != NULL \endcode + * \code block2 != NULL \endcode + * \retval FLAC__bool + * \c true if objects are identical, else \c false. + */ +FLAC_API FLAC__bool FLAC__metadata_object_is_equal(const FLAC__StreamMetadata *block1, const FLAC__StreamMetadata *block2); + +/** Sets the application data of an APPLICATION block. + * + * If \a copy is \c true, a copy of the data is stored; otherwise, the object + * takes ownership of the pointer. The existing data will be freed if this + * function is successful, otherwise the original data will remain if \a copy + * is \c true and malloc() fails. + * + * \note It is safe to pass a const pointer to \a data if \a copy is \c true. + * + * \param object A pointer to an existing APPLICATION object. + * \param data A pointer to the data to set. + * \param length The length of \a data in bytes. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_APPLICATION \endcode + * \code (data != NULL && length > 0) || + * (data == NULL && length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_application_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, unsigned length, FLAC__bool copy); + +/** Resize the seekpoint array. + * + * If the size shrinks, elements will truncated; if it grows, new placeholder + * points will be added to the end. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param new_num_points The desired length of the array; may be \c 0. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code (object->data.seek_table.points == NULL && object->data.seek_table.num_points == 0) || + * (object->data.seek_table.points != NULL && object->data.seek_table.num_points > 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_resize_points(FLAC__StreamMetadata *object, unsigned new_num_points); + +/** Set a seekpoint in a seektable. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param point_num Index into seekpoint array to set. + * \param point The point to set. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code object->data.seek_table.num_points > point_num \endcode + */ +FLAC_API void FLAC__metadata_object_seektable_set_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point); + +/** Insert a seekpoint into a seektable. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param point_num Index into seekpoint array to set. + * \param point The point to set. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code object->data.seek_table.num_points >= point_num \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_insert_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point); + +/** Delete a seekpoint from a seektable. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param point_num Index into seekpoint array to set. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code object->data.seek_table.num_points > point_num \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_delete_point(FLAC__StreamMetadata *object, unsigned point_num); + +/** Check a seektable to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * seektable. + * + * \param object A pointer to an existing SEEKTABLE object. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if seek table is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_is_legal(const FLAC__StreamMetadata *object); + +/** Append a number of placeholder points to the end of a seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param num The number of placeholder points to append. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_placeholders(FLAC__StreamMetadata *object, unsigned num); + +/** Append a specific seek point template to the end of a seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param sample_number The sample number of the seek point template. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_point(FLAC__StreamMetadata *object, FLAC__uint64 sample_number); + +/** Append specific seek point templates to the end of a seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param sample_numbers An array of sample numbers for the seek points. + * \param num The number of seek point templates to append. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_points(FLAC__StreamMetadata *object, FLAC__uint64 sample_numbers[], unsigned num); + +/** Append a set of evenly-spaced seek point templates to the end of a + * seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param num The number of placeholder points to append. + * \param total_samples The total number of samples to be encoded; + * the seekpoints will be spaced approximately + * \a total_samples / \a num samples apart. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code total_samples > 0 \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_spaced_points(FLAC__StreamMetadata *object, unsigned num, FLAC__uint64 total_samples); + +/** Append a set of evenly-spaced seek point templates to the end of a + * seek table. + * + * \note + * As with the other ..._seektable_template_... functions, you should + * call FLAC__metadata_object_seektable_template_sort() when finished + * to make the seek table legal. + * + * \param object A pointer to an existing SEEKTABLE object. + * \param samples The number of samples apart to space the placeholder + * points. The first point will be at sample \c 0, the + * second at sample \a samples, then 2*\a samples, and + * so on. As long as \a samples and \a total_samples + * are greater than \c 0, there will always be at least + * one seekpoint at sample \c 0. + * \param total_samples The total number of samples to be encoded; + * the seekpoints will be spaced + * \a samples samples apart. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \code samples > 0 \endcode + * \code total_samples > 0 \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_spaced_points_by_samples(FLAC__StreamMetadata *object, unsigned samples, FLAC__uint64 total_samples); + +/** Sort a seek table's seek points according to the format specification, + * removing duplicates. + * + * \param object A pointer to a seek table to be sorted. + * \param compact If \c false, behaves like FLAC__format_seektable_sort(). + * If \c true, duplicates are deleted and the seek table is + * shrunk appropriately; the number of placeholder points + * present in the seek table will be the same after the call + * as before. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_SEEKTABLE \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_sort(FLAC__StreamMetadata *object, FLAC__bool compact); + +/** Sets the vendor string in a VORBIS_COMMENT block. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param entry The entry to set the vendor string to. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_vendor_string(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); + +/** Resize the comment array. + * + * If the size shrinks, elements will truncated; if it grows, new empty + * fields will be added to the end. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param new_num_comments The desired length of the array; may be \c 0. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code (object->data.vorbis_comment.comments == NULL && object->data.vorbis_comment.num_comments == 0) || + * (object->data.vorbis_comment.comments != NULL && object->data.vorbis_comment.num_comments > 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_resize_comments(FLAC__StreamMetadata *object, unsigned new_num_comments); + +/** Sets a comment in a VORBIS_COMMENT block. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param comment_num Index into comment array to set. + * \param entry The entry to set the comment to. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code comment_num < object->data.vorbis_comment.num_comments \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); + +/** Insert a comment in a VORBIS_COMMENT block at the given index. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param comment_num The index at which to insert the comment. The comments + * at and after \a comment_num move right one position. + * To append a comment to the end, set \a comment_num to + * \c object->data.vorbis_comment.num_comments . + * \param entry The comment to insert. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code object->data.vorbis_comment.num_comments >= comment_num \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_insert_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); + +/** Appends a comment to a VORBIS_COMMENT block. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param entry The comment to insert. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_append_comment(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy); + +/** Replaces comments in a VORBIS_COMMENT block with a new one. + * + * For convenience, a trailing NUL is added to the entry if it doesn't have + * one already. + * + * Depending on the the value of \a all, either all or just the first comment + * whose field name(s) match the given entry's name will be replaced by the + * given entry. If no comments match, \a entry will simply be appended. + * + * If \a copy is \c true, a copy of the entry is stored; otherwise, the object + * takes ownership of the \c entry.entry pointer. + * + * \note If this function returns \c false, the caller still owns the + * pointer. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param entry The comment to insert. + * \param all If \c true, all comments whose field name matches + * \a entry's field name will be removed, and \a entry will + * be inserted at the position of the first matching + * comment. If \c false, only the first comment whose + * field name matches \a entry's field name will be + * replaced with \a entry. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code (entry.entry != NULL && entry.length > 0) || + * (entry.entry == NULL && entry.length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_replace_comment(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool all, FLAC__bool copy); + +/** Delete a comment in a VORBIS_COMMENT block at the given index. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param comment_num The index of the comment to delete. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code object->data.vorbis_comment.num_comments > comment_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_delete_comment(FLAC__StreamMetadata *object, unsigned comment_num); + +/** Creates a Vorbis comment entry from NUL-terminated name and value strings. + * + * On return, the filled-in \a entry->entry pointer will point to malloc()ed + * memory and shall be owned by the caller. For convenience the entry will + * have a terminating NUL. + * + * \param entry A pointer to a Vorbis comment entry. The entry's + * \c entry pointer should not point to allocated + * memory as it will be overwritten. + * \param field_name The field name in ASCII, \c NUL terminated. + * \param field_value The field value in UTF-8, \c NUL terminated. + * \assert + * \code entry != NULL \endcode + * \code field_name != NULL \endcode + * \code field_value != NULL \endcode + * \retval FLAC__bool + * \c false if malloc() fails, or if \a field_name or \a field_value does + * not comply with the Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(FLAC__StreamMetadata_VorbisComment_Entry *entry, const char *field_name, const char *field_value); + +/** Splits a Vorbis comment entry into NUL-terminated name and value strings. + * + * The returned pointers to name and value will be allocated by malloc() + * and shall be owned by the caller. + * + * \param entry An existing Vorbis comment entry. + * \param field_name The address of where the returned pointer to the + * field name will be stored. + * \param field_value The address of where the returned pointer to the + * field value will be stored. + * \assert + * \code (entry.entry != NULL && entry.length > 0) \endcode + * \code memchr(entry.entry, '=', entry.length) != NULL \endcode + * \code field_name != NULL \endcode + * \code field_value != NULL \endcode + * \retval FLAC__bool + * \c false if memory allocation fails or \a entry does not comply with the + * Vorbis comment specification, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_to_name_value_pair(const FLAC__StreamMetadata_VorbisComment_Entry entry, char **field_name, char **field_value); + +/** Check if the given Vorbis comment entry's field name matches the given + * field name. + * + * \param entry An existing Vorbis comment entry. + * \param field_name The field name to check. + * \param field_name_length The length of \a field_name, not including the + * terminating \c NUL. + * \assert + * \code (entry.entry != NULL && entry.length > 0) \endcode + * \retval FLAC__bool + * \c true if the field names match, else \c false + */ +FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_matches(const FLAC__StreamMetadata_VorbisComment_Entry entry, const char *field_name, unsigned field_name_length); + +/** Find a Vorbis comment with the given field name. + * + * The search begins at entry number \a offset; use an offset of 0 to + * search from the beginning of the comment array. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param offset The offset into the comment array from where to start + * the search. + * \param field_name The field name of the comment to find. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \code field_name != NULL \endcode + * \retval int + * The offset in the comment array of the first comment whose field + * name matches \a field_name, or \c -1 if no match was found. + */ +FLAC_API int FLAC__metadata_object_vorbiscomment_find_entry_from(const FLAC__StreamMetadata *object, unsigned offset, const char *field_name); + +/** Remove first Vorbis comment matching the given field name. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param field_name The field name of comment to delete. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \retval int + * \c -1 for memory allocation error, \c 0 for no matching entries, + * \c 1 for one matching entry deleted. + */ +FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entry_matching(FLAC__StreamMetadata *object, const char *field_name); + +/** Remove all Vorbis comments matching the given field name. + * + * \param object A pointer to an existing VORBIS_COMMENT object. + * \param field_name The field name of comments to delete. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT \endcode + * \retval int + * \c -1 for memory allocation error, \c 0 for no matching entries, + * else the number of matching entries deleted. + */ +FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entries_matching(FLAC__StreamMetadata *object, const char *field_name); + +/** Create a new CUESHEET track instance. + * + * The object will be "empty"; i.e. values and data pointers will be \c 0. + * + * \retval FLAC__StreamMetadata_CueSheet_Track* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_new(void); + +/** Create a copy of an existing CUESHEET track object. + * + * The copy is a "deep" copy, i.e. dynamically allocated data within the + * object is also copied. The caller takes ownership of the new object and + * is responsible for freeing it with + * FLAC__metadata_object_cuesheet_track_delete(). + * + * \param object Pointer to object to copy. + * \assert + * \code object != NULL \endcode + * \retval FLAC__StreamMetadata_CueSheet_Track* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_clone(const FLAC__StreamMetadata_CueSheet_Track *object); + +/** Delete a CUESHEET track object + * + * \param object A pointer to an existing CUESHEET track object. + * \assert + * \code object != NULL \endcode + */ +FLAC_API void FLAC__metadata_object_cuesheet_track_delete(FLAC__StreamMetadata_CueSheet_Track *object); + +/** Resize a track's index point array. + * + * If the size shrinks, elements will truncated; if it grows, new blank + * indices will be added to the end. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index of the track to modify. NOTE: this is not + * necessarily the same as the track's \a number field. + * \param new_num_indices The desired length of the array; may be \c 0. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \code (object->data.cue_sheet.tracks[track_num].indices == NULL && object->data.cue_sheet.tracks[track_num].num_indices == 0) || + * (object->data.cue_sheet.tracks[track_num].indices != NULL && object->data.cue_sheet.tracks[track_num].num_indices > 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_resize_indices(FLAC__StreamMetadata *object, unsigned track_num, unsigned new_num_indices); + +/** Insert an index point in a CUESHEET track at the given index. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index of the track to modify. NOTE: this is not + * necessarily the same as the track's \a number field. + * \param index_num The index into the track's index array at which to + * insert the index point. NOTE: this is not necessarily + * the same as the index point's \a number field. The + * indices at and after \a index_num move right one + * position. To append an index point to the end, set + * \a index_num to + * \c object->data.cue_sheet.tracks[track_num].num_indices . + * \param index The index point to insert. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \code object->data.cue_sheet.tracks[track_num].num_indices >= index_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num, FLAC__StreamMetadata_CueSheet_Index index); + +/** Insert a blank index point in a CUESHEET track at the given index. + * + * A blank index point is one in which all field values are zero. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index of the track to modify. NOTE: this is not + * necessarily the same as the track's \a number field. + * \param index_num The index into the track's index array at which to + * insert the index point. NOTE: this is not necessarily + * the same as the index point's \a number field. The + * indices at and after \a index_num move right one + * position. To append an index point to the end, set + * \a index_num to + * \c object->data.cue_sheet.tracks[track_num].num_indices . + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \code object->data.cue_sheet.tracks[track_num].num_indices >= index_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_blank_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num); + +/** Delete an index point in a CUESHEET track at the given index. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index into the track array of the track to + * modify. NOTE: this is not necessarily the same + * as the track's \a number field. + * \param index_num The index into the track's index array of the index + * to delete. NOTE: this is not necessarily the same + * as the index's \a number field. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \code object->data.cue_sheet.tracks[track_num].num_indices > index_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_delete_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num); + +/** Resize the track array. + * + * If the size shrinks, elements will truncated; if it grows, new blank + * tracks will be added to the end. + * + * \param object A pointer to an existing CUESHEET object. + * \param new_num_tracks The desired length of the array; may be \c 0. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code (object->data.cue_sheet.tracks == NULL && object->data.cue_sheet.num_tracks == 0) || + * (object->data.cue_sheet.tracks != NULL && object->data.cue_sheet.num_tracks > 0) \endcode + * \retval FLAC__bool + * \c false if memory allocation error, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_resize_tracks(FLAC__StreamMetadata *object, unsigned new_num_tracks); + +/** Sets a track in a CUESHEET block. + * + * If \a copy is \c true, a copy of the track is stored; otherwise, the object + * takes ownership of the \a track pointer. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num Index into track array to set. NOTE: this is not + * necessarily the same as the track's \a number field. + * \param track The track to set the track to. You may safely pass in + * a const pointer if \a copy is \c true. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code track_num < object->data.cue_sheet.num_tracks \endcode + * \code (track->indices != NULL && track->num_indices > 0) || + * (track->indices == NULL && track->num_indices == 0) + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_set_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy); + +/** Insert a track in a CUESHEET block at the given index. + * + * If \a copy is \c true, a copy of the track is stored; otherwise, the object + * takes ownership of the \a track pointer. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index at which to insert the track. NOTE: this + * is not necessarily the same as the track's \a number + * field. The tracks at and after \a track_num move right + * one position. To append a track to the end, set + * \a track_num to \c object->data.cue_sheet.num_tracks . + * \param track The track to insert. You may safely pass in a const + * pointer if \a copy is \c true. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks >= track_num \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy); + +/** Insert a blank track in a CUESHEET block at the given index. + * + * A blank track is one in which all field values are zero. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index at which to insert the track. NOTE: this + * is not necessarily the same as the track's \a number + * field. The tracks at and after \a track_num move right + * one position. To append a track to the end, set + * \a track_num to \c object->data.cue_sheet.num_tracks . + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks >= track_num \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_blank_track(FLAC__StreamMetadata *object, unsigned track_num); + +/** Delete a track in a CUESHEET block at the given index. + * + * \param object A pointer to an existing CUESHEET object. + * \param track_num The index into the track array of the track to + * delete. NOTE: this is not necessarily the same + * as the track's \a number field. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \code object->data.cue_sheet.num_tracks > track_num \endcode + * \retval FLAC__bool + * \c false if realloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_delete_track(FLAC__StreamMetadata *object, unsigned track_num); + +/** Check a cue sheet to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * cue sheet. + * + * \param object A pointer to an existing CUESHEET object. + * \param check_cd_da_subset If \c true, check CUESHEET against more + * stringent requirements for a CD-DA (audio) disc. + * \param violation Address of a pointer to a string. If there is a + * violation, a pointer to a string explanation of the + * violation will be returned here. \a violation may be + * \c NULL if you don't need the returned string. Do not + * free the returned string; it will always point to static + * data. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \retval FLAC__bool + * \c false if cue sheet is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_is_legal(const FLAC__StreamMetadata *object, FLAC__bool check_cd_da_subset, const char **violation); + +/** Calculate and return the CDDB/freedb ID for a cue sheet. The function + * assumes the cue sheet corresponds to a CD; the result is undefined + * if the cuesheet's is_cd bit is not set. + * + * \param object A pointer to an existing CUESHEET object. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode + * \retval FLAC__uint32 + * The unsigned integer representation of the CDDB/freedb ID + */ +FLAC_API FLAC__uint32 FLAC__metadata_object_cuesheet_calculate_cddb_id(const FLAC__StreamMetadata *object); + +/** Sets the MIME type of a PICTURE block. + * + * If \a copy is \c true, a copy of the string is stored; otherwise, the object + * takes ownership of the pointer. The existing string will be freed if this + * function is successful, otherwise the original string will remain if \a copy + * is \c true and malloc() fails. + * + * \note It is safe to pass a const pointer to \a mime_type if \a copy is \c true. + * + * \param object A pointer to an existing PICTURE object. + * \param mime_type A pointer to the MIME type string. The string must be + * ASCII characters 0x20-0x7e, NUL-terminated. No validation + * is done. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode + * \code (mime_type != NULL) \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_picture_set_mime_type(FLAC__StreamMetadata *object, char *mime_type, FLAC__bool copy); + +/** Sets the description of a PICTURE block. + * + * If \a copy is \c true, a copy of the string is stored; otherwise, the object + * takes ownership of the pointer. The existing string will be freed if this + * function is successful, otherwise the original string will remain if \a copy + * is \c true and malloc() fails. + * + * \note It is safe to pass a const pointer to \a description if \a copy is \c true. + * + * \param object A pointer to an existing PICTURE object. + * \param description A pointer to the description string. The string must be + * valid UTF-8, NUL-terminated. No validation is done. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode + * \code (description != NULL) \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_picture_set_description(FLAC__StreamMetadata *object, FLAC__byte *description, FLAC__bool copy); + +/** Sets the picture data of a PICTURE block. + * + * If \a copy is \c true, a copy of the data is stored; otherwise, the object + * takes ownership of the pointer. Also sets the \a data_length field of the + * metadata object to what is passed in as the \a length parameter. The + * existing data will be freed if this function is successful, otherwise the + * original data and data_length will remain if \a copy is \c true and + * malloc() fails. + * + * \note It is safe to pass a const pointer to \a data if \a copy is \c true. + * + * \param object A pointer to an existing PICTURE object. + * \param data A pointer to the data to set. + * \param length The length of \a data in bytes. + * \param copy See above. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode + * \code (data != NULL && length > 0) || + * (data == NULL && length == 0 && copy == false) \endcode + * \retval FLAC__bool + * \c false if \a copy is \c true and malloc() fails, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_picture_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, FLAC__uint32 length, FLAC__bool copy); + +/** Check a PICTURE block to see if it conforms to the FLAC specification. + * See the format specification for limits on the contents of the + * PICTURE block. + * + * \param object A pointer to existing PICTURE block to be checked. + * \param violation Address of a pointer to a string. If there is a + * violation, a pointer to a string explanation of the + * violation will be returned here. \a violation may be + * \c NULL if you don't need the returned string. Do not + * free the returned string; it will always point to static + * data. + * \assert + * \code object != NULL \endcode + * \code object->type == FLAC__METADATA_TYPE_PICTURE \endcode + * \retval FLAC__bool + * \c false if PICTURE block is illegal, else \c true. + */ +FLAC_API FLAC__bool FLAC__metadata_object_picture_is_legal(const FLAC__StreamMetadata *object, const char **violation); + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/headers/FLAC/ordinals.h b/Audio-Frameworks/bin/flac/headers/FLAC/ordinals.h new file mode 100644 index 0000000..a7a5cd9 --- /dev/null +++ b/Audio-Frameworks/bin/flac/headers/FLAC/ordinals.h @@ -0,0 +1,80 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__ORDINALS_H +#define FLAC__ORDINALS_H + +#if !(defined(_MSC_VER) || defined(__BORLANDC__) || defined(__EMX__)) +#include +#endif + +typedef signed char FLAC__int8; +typedef unsigned char FLAC__uint8; + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef __int16 FLAC__int16; +typedef __int32 FLAC__int32; +typedef __int64 FLAC__int64; +typedef unsigned __int16 FLAC__uint16; +typedef unsigned __int32 FLAC__uint32; +typedef unsigned __int64 FLAC__uint64; +#elif defined(__EMX__) +typedef short FLAC__int16; +typedef long FLAC__int32; +typedef long long FLAC__int64; +typedef unsigned short FLAC__uint16; +typedef unsigned long FLAC__uint32; +typedef unsigned long long FLAC__uint64; +#else +typedef int16_t FLAC__int16; +typedef int32_t FLAC__int32; +typedef int64_t FLAC__int64; +typedef uint16_t FLAC__uint16; +typedef uint32_t FLAC__uint32; +typedef uint64_t FLAC__uint64; +#endif + +typedef int FLAC__bool; + +typedef FLAC__uint8 FLAC__byte; + +#ifdef true +#undef true +#endif +#ifdef false +#undef false +#endif +#ifndef __cplusplus +#define true 1 +#define false 0 +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/headers/FLAC/stream_decoder.h b/Audio-Frameworks/bin/flac/headers/FLAC/stream_decoder.h new file mode 100644 index 0000000..9ac1594 --- /dev/null +++ b/Audio-Frameworks/bin/flac/headers/FLAC/stream_decoder.h @@ -0,0 +1,1559 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__STREAM_DECODER_H +#define FLAC__STREAM_DECODER_H + +#include /* for FILE */ +#include "export.h" +#include "format.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/** \file include/FLAC/stream_decoder.h + * + * \brief + * This module contains the functions which implement the stream + * decoder. + * + * See the detailed documentation in the + * \link flac_stream_decoder stream decoder \endlink module. + */ + +/** \defgroup flac_decoder FLAC/ \*_decoder.h: decoder interfaces + * \ingroup flac + * + * \brief + * This module describes the decoder layers provided by libFLAC. + * + * The stream decoder can be used to decode complete streams either from + * the client via callbacks, or directly from a file, depending on how + * it is initialized. When decoding via callbacks, the client provides + * callbacks for reading FLAC data and writing decoded samples, and + * handling metadata and errors. If the client also supplies seek-related + * callback, the decoder function for sample-accurate seeking within the + * FLAC input is also available. When decoding from a file, the client + * needs only supply a filename or open \c FILE* and write/metadata/error + * callbacks; the rest of the callbacks are supplied internally. For more + * info see the \link flac_stream_decoder stream decoder \endlink module. + */ + +/** \defgroup flac_stream_decoder FLAC/stream_decoder.h: stream decoder interface + * \ingroup flac_decoder + * + * \brief + * This module contains the functions which implement the stream + * decoder. + * + * The stream decoder can decode native FLAC, and optionally Ogg FLAC + * (check FLAC_API_SUPPORTS_OGG_FLAC) streams and files. + * + * The basic usage of this decoder is as follows: + * - The program creates an instance of a decoder using + * FLAC__stream_decoder_new(). + * - The program overrides the default settings using + * FLAC__stream_decoder_set_*() functions. + * - The program initializes the instance to validate the settings and + * prepare for decoding using + * - FLAC__stream_decoder_init_stream() or FLAC__stream_decoder_init_FILE() + * or FLAC__stream_decoder_init_file() for native FLAC, + * - FLAC__stream_decoder_init_ogg_stream() or FLAC__stream_decoder_init_ogg_FILE() + * or FLAC__stream_decoder_init_ogg_file() for Ogg FLAC + * - The program calls the FLAC__stream_decoder_process_*() functions + * to decode data, which subsequently calls the callbacks. + * - The program finishes the decoding with FLAC__stream_decoder_finish(), + * which flushes the input and output and resets the decoder to the + * uninitialized state. + * - The instance may be used again or deleted with + * FLAC__stream_decoder_delete(). + * + * In more detail, the program will create a new instance by calling + * FLAC__stream_decoder_new(), then call FLAC__stream_decoder_set_*() + * functions to override the default decoder options, and call + * one of the FLAC__stream_decoder_init_*() functions. + * + * There are three initialization functions for native FLAC, one for + * setting up the decoder to decode FLAC data from the client via + * callbacks, and two for decoding directly from a FLAC file. + * + * For decoding via callbacks, use FLAC__stream_decoder_init_stream(). + * You must also supply several callbacks for handling I/O. Some (like + * seeking) are optional, depending on the capabilities of the input. + * + * For decoding directly from a file, use FLAC__stream_decoder_init_FILE() + * or FLAC__stream_decoder_init_file(). Then you must only supply an open + * \c FILE* or filename and fewer callbacks; the decoder will handle + * the other callbacks internally. + * + * There are three similarly-named init functions for decoding from Ogg + * FLAC streams. Check \c FLAC_API_SUPPORTS_OGG_FLAC to find out if the + * library has been built with Ogg support. + * + * Once the decoder is initialized, your program will call one of several + * functions to start the decoding process: + * + * - FLAC__stream_decoder_process_single() - Tells the decoder to process at + * most one metadata block or audio frame and return, calling either the + * metadata callback or write callback, respectively, once. If the decoder + * loses sync it will return with only the error callback being called. + * - FLAC__stream_decoder_process_until_end_of_metadata() - Tells the decoder + * to process the stream from the current location and stop upon reaching + * the first audio frame. The client will get one metadata, write, or error + * callback per metadata block, audio frame, or sync error, respectively. + * - FLAC__stream_decoder_process_until_end_of_stream() - Tells the decoder + * to process the stream from the current location until the read callback + * returns FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM or + * FLAC__STREAM_DECODER_READ_STATUS_ABORT. The client will get one metadata, + * write, or error callback per metadata block, audio frame, or sync error, + * respectively. + * + * When the decoder has finished decoding (normally or through an abort), + * the instance is finished by calling FLAC__stream_decoder_finish(), which + * ensures the decoder is in the correct state and frees memory. Then the + * instance may be deleted with FLAC__stream_decoder_delete() or initialized + * again to decode another stream. + * + * Seeking is exposed through the FLAC__stream_decoder_seek_absolute() method. + * At any point after the stream decoder has been initialized, the client can + * call this function to seek to an exact sample within the stream. + * Subsequently, the first time the write callback is called it will be + * passed a (possibly partial) block starting at that sample. + * + * If the client cannot seek via the callback interface provided, but still + * has another way of seeking, it can flush the decoder using + * FLAC__stream_decoder_flush() and start feeding data from the new position + * through the read callback. + * + * The stream decoder also provides MD5 signature checking. If this is + * turned on before initialization, FLAC__stream_decoder_finish() will + * report when the decoded MD5 signature does not match the one stored + * in the STREAMINFO block. MD5 checking is automatically turned off + * (until the next FLAC__stream_decoder_reset()) if there is no signature + * in the STREAMINFO block or when a seek is attempted. + * + * The FLAC__stream_decoder_set_metadata_*() functions deserve special + * attention. By default, the decoder only calls the metadata_callback for + * the STREAMINFO block. These functions allow you to tell the decoder + * explicitly which blocks to parse and return via the metadata_callback + * and/or which to skip. Use a FLAC__stream_decoder_set_metadata_respond_all(), + * FLAC__stream_decoder_set_metadata_ignore() ... or FLAC__stream_decoder_set_metadata_ignore_all(), + * FLAC__stream_decoder_set_metadata_respond() ... sequence to exactly specify + * which blocks to return. Remember that metadata blocks can potentially + * be big (for example, cover art) so filtering out the ones you don't + * use can reduce the memory requirements of the decoder. Also note the + * special forms FLAC__stream_decoder_set_metadata_respond_application(id) + * and FLAC__stream_decoder_set_metadata_ignore_application(id) for + * filtering APPLICATION blocks based on the application ID. + * + * STREAMINFO and SEEKTABLE blocks are always parsed and used internally, but + * they still can legally be filtered from the metadata_callback. + * + * \note + * The "set" functions may only be called when the decoder is in the + * state FLAC__STREAM_DECODER_UNINITIALIZED, i.e. after + * FLAC__stream_decoder_new() or FLAC__stream_decoder_finish(), but + * before FLAC__stream_decoder_init_*(). If this is the case they will + * return \c true, otherwise \c false. + * + * \note + * FLAC__stream_decoder_finish() resets all settings to the constructor + * defaults, including the callbacks. + * + * \{ + */ + + +/** State values for a FLAC__StreamDecoder + * + * The decoder's state can be obtained by calling FLAC__stream_decoder_get_state(). + */ +typedef enum { + + FLAC__STREAM_DECODER_SEARCH_FOR_METADATA = 0, + /**< The decoder is ready to search for metadata. */ + + FLAC__STREAM_DECODER_READ_METADATA, + /**< The decoder is ready to or is in the process of reading metadata. */ + + FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC, + /**< The decoder is ready to or is in the process of searching for the + * frame sync code. + */ + + FLAC__STREAM_DECODER_READ_FRAME, + /**< The decoder is ready to or is in the process of reading a frame. */ + + FLAC__STREAM_DECODER_END_OF_STREAM, + /**< The decoder has reached the end of the stream. */ + + FLAC__STREAM_DECODER_OGG_ERROR, + /**< An error occurred in the underlying Ogg layer. */ + + FLAC__STREAM_DECODER_SEEK_ERROR, + /**< An error occurred while seeking. The decoder must be flushed + * with FLAC__stream_decoder_flush() or reset with + * FLAC__stream_decoder_reset() before decoding can continue. + */ + + FLAC__STREAM_DECODER_ABORTED, + /**< The decoder was aborted by the read callback. */ + + FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR, + /**< An error occurred allocating memory. The decoder is in an invalid + * state and can no longer be used. + */ + + FLAC__STREAM_DECODER_UNINITIALIZED + /**< The decoder is in the uninitialized state; one of the + * FLAC__stream_decoder_init_*() functions must be called before samples + * can be processed. + */ + +} FLAC__StreamDecoderState; + +/** Maps a FLAC__StreamDecoderState to a C string. + * + * Using a FLAC__StreamDecoderState as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderStateString[]; + + +/** Possible return values for the FLAC__stream_decoder_init_*() functions. + */ +typedef enum { + + FLAC__STREAM_DECODER_INIT_STATUS_OK = 0, + /**< Initialization was successful. */ + + FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER, + /**< The library was not compiled with support for the given container + * format. + */ + + FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS, + /**< A required callback was not supplied. */ + + FLAC__STREAM_DECODER_INIT_STATUS_MEMORY_ALLOCATION_ERROR, + /**< An error occurred allocating memory. */ + + FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE, + /**< fopen() failed in FLAC__stream_decoder_init_file() or + * FLAC__stream_decoder_init_ogg_file(). */ + + FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED + /**< FLAC__stream_decoder_init_*() was called when the decoder was + * already initialized, usually because + * FLAC__stream_decoder_finish() was not called. + */ + +} FLAC__StreamDecoderInitStatus; + +/** Maps a FLAC__StreamDecoderInitStatus to a C string. + * + * Using a FLAC__StreamDecoderInitStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderInitStatusString[]; + + +/** Return values for the FLAC__StreamDecoder read callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, + /**< The read was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM, + /**< The read was attempted while at the end of the stream. Note that + * the client must only return this value when the read callback was + * called when already at the end of the stream. Otherwise, if the read + * itself moves to the end of the stream, the client should still return + * the data and \c FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, and then on + * the next read callback it should return + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM with a byte count + * of \c 0. + */ + + FLAC__STREAM_DECODER_READ_STATUS_ABORT + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + +} FLAC__StreamDecoderReadStatus; + +/** Maps a FLAC__StreamDecoderReadStatus to a C string. + * + * Using a FLAC__StreamDecoderReadStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderReadStatusString[]; + + +/** Return values for the FLAC__StreamDecoder seek callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_SEEK_STATUS_OK, + /**< The seek was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_SEEK_STATUS_ERROR, + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + + FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED + /**< Client does not support seeking. */ + +} FLAC__StreamDecoderSeekStatus; + +/** Maps a FLAC__StreamDecoderSeekStatus to a C string. + * + * Using a FLAC__StreamDecoderSeekStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderSeekStatusString[]; + + +/** Return values for the FLAC__StreamDecoder tell callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_TELL_STATUS_OK, + /**< The tell was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_TELL_STATUS_ERROR, + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + + FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED + /**< Client does not support telling the position. */ + +} FLAC__StreamDecoderTellStatus; + +/** Maps a FLAC__StreamDecoderTellStatus to a C string. + * + * Using a FLAC__StreamDecoderTellStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderTellStatusString[]; + + +/** Return values for the FLAC__StreamDecoder length callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_LENGTH_STATUS_OK, + /**< The length call was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR, + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + + FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED + /**< Client does not support reporting the length. */ + +} FLAC__StreamDecoderLengthStatus; + +/** Maps a FLAC__StreamDecoderLengthStatus to a C string. + * + * Using a FLAC__StreamDecoderLengthStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderLengthStatusString[]; + + +/** Return values for the FLAC__StreamDecoder write callback. + */ +typedef enum { + + FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE, + /**< The write was OK and decoding can continue. */ + + FLAC__STREAM_DECODER_WRITE_STATUS_ABORT + /**< An unrecoverable error occurred. The decoder will return from the process call. */ + +} FLAC__StreamDecoderWriteStatus; + +/** Maps a FLAC__StreamDecoderWriteStatus to a C string. + * + * Using a FLAC__StreamDecoderWriteStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderWriteStatusString[]; + + +/** Possible values passed back to the FLAC__StreamDecoder error callback. + * \c FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC is the generic catch- + * all. The rest could be caused by bad sync (false synchronization on + * data that is not the start of a frame) or corrupted data. The error + * itself is the decoder's best guess at what happened assuming a correct + * sync. For example \c FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER + * could be caused by a correct sync on the start of a frame, but some + * data in the frame header was corrupted. Or it could be the result of + * syncing on a point the stream that looked like the starting of a frame + * but was not. \c FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM + * could be because the decoder encountered a valid frame made by a future + * version of the encoder which it cannot parse, or because of a false + * sync making it appear as though an encountered frame was generated by + * a future encoder. + */ +typedef enum { + + FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC, + /**< An error in the stream caused the decoder to lose synchronization. */ + + FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER, + /**< The decoder encountered a corrupted frame header. */ + + FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH, + /**< The frame's data did not match the CRC in the footer. */ + + FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM + /**< The decoder encountered reserved fields in use in the stream. */ + +} FLAC__StreamDecoderErrorStatus; + +/** Maps a FLAC__StreamDecoderErrorStatus to a C string. + * + * Using a FLAC__StreamDecoderErrorStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamDecoderErrorStatusString[]; + + +/*********************************************************************** + * + * class FLAC__StreamDecoder + * + ***********************************************************************/ + +struct FLAC__StreamDecoderProtected; +struct FLAC__StreamDecoderPrivate; +/** The opaque structure definition for the stream decoder type. + * See the \link flac_stream_decoder stream decoder module \endlink + * for a detailed description. + */ +typedef struct { + struct FLAC__StreamDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */ + struct FLAC__StreamDecoderPrivate *private_; /* avoid the C++ keyword 'private' */ +} FLAC__StreamDecoder; + +/** Signature for the read callback. + * + * A function pointer matching this signature must be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder needs more input data. The address of the + * buffer to be filled is supplied, along with the number of bytes the + * buffer can hold. The callback may choose to supply less data and + * modify the byte count but must be careful not to overflow the buffer. + * The callback then returns a status code chosen from + * FLAC__StreamDecoderReadStatus. + * + * Here is an example of a read callback for stdio streams: + * \code + * FLAC__StreamDecoderReadStatus read_cb(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * if(*bytes > 0) { + * *bytes = fread(buffer, sizeof(FLAC__byte), *bytes, file); + * if(ferror(file)) + * return FLAC__STREAM_DECODER_READ_STATUS_ABORT; + * else if(*bytes == 0) + * return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; + * else + * return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; + * } + * else + * return FLAC__STREAM_DECODER_READ_STATUS_ABORT; + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param buffer A pointer to a location for the callee to store + * data to be decoded. + * \param bytes A pointer to the size of the buffer. On entry + * to the callback, it contains the maximum number + * of bytes that may be stored in \a buffer. The + * callee must set it to the actual number of bytes + * stored (0 in case of error or end-of-stream) before + * returning. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderReadStatus + * The callee's return status. Note that the callback should return + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM if and only if + * zero bytes were read and there is no more data to be read. + */ +typedef FLAC__StreamDecoderReadStatus (*FLAC__StreamDecoderReadCallback)(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data); + +/** Signature for the seek callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder needs to seek the input stream. The decoder + * will pass the absolute byte offset to seek to, 0 meaning the + * beginning of the stream. + * + * Here is an example of a seek callback for stdio streams: + * \code + * FLAC__StreamDecoderSeekStatus seek_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * if(file == stdin) + * return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED; + * else if(fseeko(file, (off_t)absolute_byte_offset, SEEK_SET) < 0) + * return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; + * else + * return FLAC__STREAM_DECODER_SEEK_STATUS_OK; + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param absolute_byte_offset The offset from the beginning of the stream + * to seek to. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderSeekStatus + * The callee's return status. + */ +typedef FLAC__StreamDecoderSeekStatus (*FLAC__StreamDecoderSeekCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data); + +/** Signature for the tell callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder wants to know the current position of the + * stream. The callback should return the byte offset from the + * beginning of the stream. + * + * Here is an example of a tell callback for stdio streams: + * \code + * FLAC__StreamDecoderTellStatus tell_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * off_t pos; + * if(file == stdin) + * return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED; + * else if((pos = ftello(file)) < 0) + * return FLAC__STREAM_DECODER_TELL_STATUS_ERROR; + * else { + * *absolute_byte_offset = (FLAC__uint64)pos; + * return FLAC__STREAM_DECODER_TELL_STATUS_OK; + * } + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param absolute_byte_offset A pointer to storage for the current offset + * from the beginning of the stream. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderTellStatus + * The callee's return status. + */ +typedef FLAC__StreamDecoderTellStatus (*FLAC__StreamDecoderTellCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data); + +/** Signature for the length callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder wants to know the total length of the stream + * in bytes. + * + * Here is an example of a length callback for stdio streams: + * \code + * FLAC__StreamDecoderLengthStatus length_cb(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * struct stat filestats; + * + * if(file == stdin) + * return FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED; + * else if(fstat(fileno(file), &filestats) != 0) + * return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; + * else { + * *stream_length = (FLAC__uint64)filestats.st_size; + * return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; + * } + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param stream_length A pointer to storage for the length of the stream + * in bytes. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderLengthStatus + * The callee's return status. + */ +typedef FLAC__StreamDecoderLengthStatus (*FLAC__StreamDecoderLengthCallback)(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data); + +/** Signature for the EOF callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_decoder_init*_stream(). The supplied function will be + * called when the decoder needs to know if the end of the stream has + * been reached. + * + * Here is an example of a EOF callback for stdio streams: + * FLAC__bool eof_cb(const FLAC__StreamDecoder *decoder, void *client_data) + * \code + * { + * FILE *file = ((MyClientData*)client_data)->file; + * return feof(file)? true : false; + * } + * \endcode + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__bool + * \c true if the currently at the end of the stream, else \c false. + */ +typedef FLAC__bool (*FLAC__StreamDecoderEofCallback)(const FLAC__StreamDecoder *decoder, void *client_data); + +/** Signature for the write callback. + * + * A function pointer matching this signature must be passed to one of + * the FLAC__stream_decoder_init_*() functions. + * The supplied function will be called when the decoder has decoded a + * single audio frame. The decoder will pass the frame metadata as well + * as an array of pointers (one for each channel) pointing to the + * decoded audio. + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param frame The description of the decoded frame. See + * FLAC__Frame. + * \param buffer An array of pointers to decoded channels of data. + * Each pointer will point to an array of signed + * samples of length \a frame->header.blocksize. + * Channels will be ordered according to the FLAC + * specification; see the documentation for the + * frame header. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + * \retval FLAC__StreamDecoderWriteStatus + * The callee's return status. + */ +typedef FLAC__StreamDecoderWriteStatus (*FLAC__StreamDecoderWriteCallback)(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); + +/** Signature for the metadata callback. + * + * A function pointer matching this signature must be passed to one of + * the FLAC__stream_decoder_init_*() functions. + * The supplied function will be called when the decoder has decoded a + * metadata block. In a valid FLAC file there will always be one + * \c STREAMINFO block, followed by zero or more other metadata blocks. + * These will be supplied by the decoder in the same order as they + * appear in the stream and always before the first audio frame (i.e. + * write callback). The metadata block that is passed in must not be + * modified, and it doesn't live beyond the callback, so you should make + * a copy of it with FLAC__metadata_object_clone() if you will need it + * elsewhere. Since metadata blocks can potentially be large, by + * default the decoder only calls the metadata callback for the + * \c STREAMINFO block; you can instruct the decoder to pass or filter + * other blocks with FLAC__stream_decoder_set_metadata_*() calls. + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param metadata The decoded metadata block. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + */ +typedef void (*FLAC__StreamDecoderMetadataCallback)(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); + +/** Signature for the error callback. + * + * A function pointer matching this signature must be passed to one of + * the FLAC__stream_decoder_init_*() functions. + * The supplied function will be called whenever an error occurs during + * decoding. + * + * \note In general, FLAC__StreamDecoder functions which change the + * state should not be called on the \a decoder while in the callback. + * + * \param decoder The decoder instance calling the callback. + * \param status The error encountered by the decoder. + * \param client_data The callee's client data set through + * FLAC__stream_decoder_init_*(). + */ +typedef void (*FLAC__StreamDecoderErrorCallback)(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); + + +/*********************************************************************** + * + * Class constructor/destructor + * + ***********************************************************************/ + +/** Create a new stream decoder instance. The instance is created with + * default settings; see the individual FLAC__stream_decoder_set_*() + * functions for each setting's default. + * + * \retval FLAC__StreamDecoder* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamDecoder *FLAC__stream_decoder_new(void); + +/** Free a decoder instance. Deletes the object pointed to by \a decoder. + * + * \param decoder A pointer to an existing decoder. + * \assert + * \code decoder != NULL \endcode + */ +FLAC_API void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder); + + +/*********************************************************************** + * + * Public class method prototypes + * + ***********************************************************************/ + +/** Set the serial number for the FLAC stream within the Ogg container. + * The default behavior is to use the serial number of the first Ogg + * page. Setting a serial number here will explicitly specify which + * stream is to be decoded. + * + * \note + * This does not need to be set for native FLAC decoding. + * + * \default \c use serial number of first page + * \param decoder A decoder instance to set. + * \param serial_number See above. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_ogg_serial_number(FLAC__StreamDecoder *decoder, long serial_number); + +/** Set the "MD5 signature checking" flag. If \c true, the decoder will + * compute the MD5 signature of the unencoded audio data while decoding + * and compare it to the signature from the STREAMINFO block, if it + * exists, during FLAC__stream_decoder_finish(). + * + * MD5 signature checking will be turned off (until the next + * FLAC__stream_decoder_reset()) if there is no signature in the + * STREAMINFO block or when a seek is attempted. + * + * Clients that do not use the MD5 check should leave this off to speed + * up decoding. + * + * \default \c false + * \param decoder A decoder instance to set. + * \param value Flag value (see above). + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_md5_checking(FLAC__StreamDecoder *decoder, FLAC__bool value); + +/** Direct the decoder to pass on all metadata blocks of type \a type. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \param type See above. + * \assert + * \code decoder != NULL \endcode + * \a type is valid + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecoder *decoder, FLAC__MetadataType type); + +/** Direct the decoder to pass on all APPLICATION metadata blocks of the + * given \a id. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \param id See above. + * \assert + * \code decoder != NULL \endcode + * \code id != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]); + +/** Direct the decoder to pass on all metadata blocks of any type. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_all(FLAC__StreamDecoder *decoder); + +/** Direct the decoder to filter out all metadata blocks of type \a type. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \param type See above. + * \assert + * \code decoder != NULL \endcode + * \a type is valid + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder *decoder, FLAC__MetadataType type); + +/** Direct the decoder to filter out all APPLICATION metadata blocks of + * the given \a id. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \param id See above. + * \assert + * \code decoder != NULL \endcode + * \code id != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]); + +/** Direct the decoder to filter out all metadata blocks of any type. + * + * \default By default, only the \c STREAMINFO block is returned via the + * metadata callback. + * \param decoder A decoder instance to set. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if the decoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all(FLAC__StreamDecoder *decoder); + +/** Get the current decoder state. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderState + * The current decoder state. + */ +FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_get_state(const FLAC__StreamDecoder *decoder); + +/** Get the current decoder state as a C string. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval const char * + * The decoder state as a C string. Do not modify the contents. + */ +FLAC_API const char *FLAC__stream_decoder_get_resolved_state_string(const FLAC__StreamDecoder *decoder); + +/** Get the "MD5 signature checking" flag. + * This is the value of the setting, not whether or not the decoder is + * currently checking the MD5 (remember, it can be turned off automatically + * by a seek). When the decoder is reset the flag will be restored to the + * value returned by this function. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * See above. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_get_md5_checking(const FLAC__StreamDecoder *decoder); + +/** Get the total number of samples in the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the \c STREAMINFO block. A value of \c 0 means "unknown". + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API FLAC__uint64 FLAC__stream_decoder_get_total_samples(const FLAC__StreamDecoder *decoder); + +/** Get the current number of channels in the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API unsigned FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder); + +/** Get the current channel assignment in the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__ChannelAssignment + * See above. + */ +FLAC_API FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment(const FLAC__StreamDecoder *decoder); + +/** Get the current sample resolution in the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder); + +/** Get the current sample rate in Hz of the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder); + +/** Get the current blocksize of the stream being decoded. + * Will only be valid after decoding has started and will contain the + * value from the most recently decoded frame header. + * + * \param decoder A decoder instance to query. + * \assert + * \code decoder != NULL \endcode + * \retval unsigned + * See above. + */ +FLAC_API unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder); + +/** Returns the decoder's current read position within the stream. + * The position is the byte offset from the start of the stream. + * Bytes before this position have been fully decoded. Note that + * there may still be undecoded bytes in the decoder's read FIFO. + * The returned position is correct even after a seek. + * + * \warning This function currently only works for native FLAC, + * not Ogg FLAC streams. + * + * \param decoder A decoder instance to query. + * \param position Address at which to return the desired position. + * \assert + * \code decoder != NULL \endcode + * \code position != NULL \endcode + * \retval FLAC__bool + * \c true if successful, \c false if the stream is not native FLAC, + * or there was an error from the 'tell' callback or it returned + * \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position(const FLAC__StreamDecoder *decoder, FLAC__uint64 *position); + +/** Initialize the decoder instance to decode native FLAC streams. + * + * This flavor of initialization sets up the decoder to decode from a + * native FLAC stream. I/O is performed via callbacks to the client. + * For decoding from a plain file via filename or open FILE*, + * FLAC__stream_decoder_init_file() and FLAC__stream_decoder_init_FILE() + * provide a simpler interface. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \param decoder An uninitialized decoder instance. + * \param read_callback See FLAC__StreamDecoderReadCallback. This + * pointer must not be \c NULL. + * \param seek_callback See FLAC__StreamDecoderSeekCallback. This + * pointer may be \c NULL if seeking is not + * supported. If \a seek_callback is not \c NULL then a + * \a tell_callback, \a length_callback, and \a eof_callback must also be supplied. + * Alternatively, a dummy seek callback that just + * returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param tell_callback See FLAC__StreamDecoderTellCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a tell_callback must also be supplied. + * Alternatively, a dummy tell callback that just + * returns \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param length_callback See FLAC__StreamDecoderLengthCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a length_callback must also be supplied. + * Alternatively, a dummy length callback that just + * returns \c FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param eof_callback See FLAC__StreamDecoderEofCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a eof_callback must also be supplied. + * Alternatively, a dummy length callback that just + * returns \c false + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_stream( + FLAC__StreamDecoder *decoder, + FLAC__StreamDecoderReadCallback read_callback, + FLAC__StreamDecoderSeekCallback seek_callback, + FLAC__StreamDecoderTellCallback tell_callback, + FLAC__StreamDecoderLengthCallback length_callback, + FLAC__StreamDecoderEofCallback eof_callback, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode Ogg FLAC streams. + * + * This flavor of initialization sets up the decoder to decode from a + * FLAC stream in an Ogg container. I/O is performed via callbacks to the + * client. For decoding from a plain file via filename or open FILE*, + * FLAC__stream_decoder_init_ogg_file() and FLAC__stream_decoder_init_ogg_FILE() + * provide a simpler interface. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \note Support for Ogg FLAC in the library is optional. If this + * library has been built without support for Ogg FLAC, this function + * will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER. + * + * \param decoder An uninitialized decoder instance. + * \param read_callback See FLAC__StreamDecoderReadCallback. This + * pointer must not be \c NULL. + * \param seek_callback See FLAC__StreamDecoderSeekCallback. This + * pointer may be \c NULL if seeking is not + * supported. If \a seek_callback is not \c NULL then a + * \a tell_callback, \a length_callback, and \a eof_callback must also be supplied. + * Alternatively, a dummy seek callback that just + * returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param tell_callback See FLAC__StreamDecoderTellCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a tell_callback must also be supplied. + * Alternatively, a dummy tell callback that just + * returns \c FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param length_callback See FLAC__StreamDecoderLengthCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a length_callback must also be supplied. + * Alternatively, a dummy length callback that just + * returns \c FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param eof_callback See FLAC__StreamDecoderEofCallback. This + * pointer may be \c NULL if not supported by the client. If + * \a seek_callback is not \c NULL then a + * \a eof_callback must also be supplied. + * Alternatively, a dummy length callback that just + * returns \c false + * may also be supplied, all though this is slightly + * less efficient for the decoder. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_stream( + FLAC__StreamDecoder *decoder, + FLAC__StreamDecoderReadCallback read_callback, + FLAC__StreamDecoderSeekCallback seek_callback, + FLAC__StreamDecoderTellCallback tell_callback, + FLAC__StreamDecoderLengthCallback length_callback, + FLAC__StreamDecoderEofCallback eof_callback, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode native FLAC files. + * + * This flavor of initialization sets up the decoder to decode from a + * plain native FLAC file. For non-stdio streams, you must use + * FLAC__stream_decoder_init_stream() and provide callbacks for the I/O. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \param decoder An uninitialized decoder instance. + * \param file An open FLAC file. The file should have been + * opened with mode \c "rb" and rewound. The file + * becomes owned by the decoder and should not be + * manipulated by the client while decoding. + * Unless \a file is \c stdin, it will be closed + * when FLAC__stream_decoder_finish() is called. + * Note however that seeking will not work when + * decoding from \c stdout since it is not seekable. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \code file != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_FILE( + FLAC__StreamDecoder *decoder, + FILE *file, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode Ogg FLAC files. + * + * This flavor of initialization sets up the decoder to decode from a + * plain Ogg FLAC file. For non-stdio streams, you must use + * FLAC__stream_decoder_init_ogg_stream() and provide callbacks for the I/O. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \note Support for Ogg FLAC in the library is optional. If this + * library has been built without support for Ogg FLAC, this function + * will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER. + * + * \param decoder An uninitialized decoder instance. + * \param file An open FLAC file. The file should have been + * opened with mode \c "rb" and rewound. The file + * becomes owned by the decoder and should not be + * manipulated by the client while decoding. + * Unless \a file is \c stdin, it will be closed + * when FLAC__stream_decoder_finish() is called. + * Note however that seeking will not work when + * decoding from \c stdout since it is not seekable. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \code file != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_FILE( + FLAC__StreamDecoder *decoder, + FILE *file, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode native FLAC files. + * + * This flavor of initialization sets up the decoder to decode from a plain + * native FLAC file. If POSIX fopen() semantics are not sufficient, (for + * example, with Unicode filenames on Windows), you must use + * FLAC__stream_decoder_init_FILE(), or FLAC__stream_decoder_init_stream() + * and provide callbacks for the I/O. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \param decoder An uninitialized decoder instance. + * \param filename The name of the file to decode from. The file will + * be opened with fopen(). Use \c NULL to decode from + * \c stdin. Note that \c stdin is not seekable. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_file( + FLAC__StreamDecoder *decoder, + const char *filename, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Initialize the decoder instance to decode Ogg FLAC files. + * + * This flavor of initialization sets up the decoder to decode from a plain + * Ogg FLAC file. If POSIX fopen() semantics are not sufficient, (for + * example, with Unicode filenames on Windows), you must use + * FLAC__stream_decoder_init_ogg_FILE(), or FLAC__stream_decoder_init_ogg_stream() + * and provide callbacks for the I/O. + * + * This function should be called after FLAC__stream_decoder_new() and + * FLAC__stream_decoder_set_*() but before any of the + * FLAC__stream_decoder_process_*() functions. Will set and return the + * decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA + * if initialization succeeded. + * + * \note Support for Ogg FLAC in the library is optional. If this + * library has been built without support for Ogg FLAC, this function + * will return \c FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER. + * + * \param decoder An uninitialized decoder instance. + * \param filename The name of the file to decode from. The file will + * be opened with fopen(). Use \c NULL to decode from + * \c stdin. Note that \c stdin is not seekable. + * \param write_callback See FLAC__StreamDecoderWriteCallback. This + * pointer must not be \c NULL. + * \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This + * pointer may be \c NULL if the callback is not + * desired. + * \param error_callback See FLAC__StreamDecoderErrorCallback. This + * pointer must not be \c NULL. + * \param client_data This value will be supplied to callbacks in their + * \a client_data argument. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__StreamDecoderInitStatus + * \c FLAC__STREAM_DECODER_INIT_STATUS_OK if initialization was successful; + * see FLAC__StreamDecoderInitStatus for the meanings of other return values. + */ +FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_file( + FLAC__StreamDecoder *decoder, + const char *filename, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data +); + +/** Finish the decoding process. + * Flushes the decoding buffer, releases resources, resets the decoder + * settings to their defaults, and returns the decoder state to + * FLAC__STREAM_DECODER_UNINITIALIZED. + * + * In the event of a prematurely-terminated decode, it is not strictly + * necessary to call this immediately before FLAC__stream_decoder_delete() + * but it is good practice to match every FLAC__stream_decoder_init_*() + * with a FLAC__stream_decoder_finish(). + * + * \param decoder An uninitialized decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if MD5 checking is on AND a STREAMINFO block was available + * AND the MD5 signature in the STREAMINFO block was non-zero AND the + * signature does not match the one computed by the decoder; else + * \c true. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder); + +/** Flush the stream input. + * The decoder's input buffer will be cleared and the state set to + * \c FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC. This will also turn + * off MD5 checking. + * + * \param decoder A decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false if a memory allocation + * error occurs (in which case the state will be set to + * \c FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder); + +/** Reset the decoding process. + * The decoder's input buffer will be cleared and the state set to + * \c FLAC__STREAM_DECODER_SEARCH_FOR_METADATA. This is similar to + * FLAC__stream_decoder_finish() except that the settings are + * preserved; there is no need to call FLAC__stream_decoder_init_*() + * before decoding again. MD5 checking will be restored to its original + * setting. + * + * If the decoder is seekable, or was initialized with + * FLAC__stream_decoder_init*_FILE() or FLAC__stream_decoder_init*_file(), + * the decoder will also attempt to seek to the beginning of the file. + * If this rewind fails, this function will return \c false. It follows + * that FLAC__stream_decoder_reset() cannot be used when decoding from + * \c stdin. + * + * If the decoder was initialized with FLAC__stream_encoder_init*_stream() + * and is not seekable (i.e. no seek callback was provided or the seek + * callback returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED), it + * is the duty of the client to start feeding data from the beginning of + * the stream on the next FLAC__stream_decoder_process() or + * FLAC__stream_decoder_process_interleaved() call. + * + * \param decoder A decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false if a memory allocation occurs + * (in which case the state will be set to + * \c FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR) or a seek error + * occurs (the state will be unchanged). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder); + +/** Decode one metadata block or audio frame. + * This version instructs the decoder to decode a either a single metadata + * block or a single frame and stop, unless the callbacks return a fatal + * error or the read callback returns + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM. + * + * As the decoder needs more input it will call the read callback. + * Depending on what was decoded, the metadata or write callback will be + * called with the decoded metadata block or audio frame. + * + * Unless there is a fatal read error or end of stream, this function + * will return once one whole frame is decoded. In other words, if the + * stream is not synchronized or points to a corrupt frame header, the + * decoder will continue to try and resync until it gets to a valid + * frame, then decode one frame, then return. If the decoder points to + * a frame whose frame CRC in the frame footer does not match the + * computed frame CRC, this function will issue a + * FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH error to the + * error callback, and return, having decoded one complete, although + * corrupt, frame. (Such corrupted frames are sent as silence of the + * correct length to the write callback.) + * + * \param decoder An initialized decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if any fatal read, write, or memory allocation error + * occurred (meaning decoding must stop), else \c true; for more + * information about the decoder, check the decoder state with + * FLAC__stream_decoder_get_state(). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_process_single(FLAC__StreamDecoder *decoder); + +/** Decode until the end of the metadata. + * This version instructs the decoder to decode from the current position + * and continue until all the metadata has been read, or until the + * callbacks return a fatal error or the read callback returns + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM. + * + * As the decoder needs more input it will call the read callback. + * As each metadata block is decoded, the metadata callback will be called + * with the decoded metadata. + * + * \param decoder An initialized decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if any fatal read, write, or memory allocation error + * occurred (meaning decoding must stop), else \c true; for more + * information about the decoder, check the decoder state with + * FLAC__stream_decoder_get_state(). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata(FLAC__StreamDecoder *decoder); + +/** Decode until the end of the stream. + * This version instructs the decoder to decode from the current position + * and continue until the end of stream (the read callback returns + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM), or until the + * callbacks return a fatal error. + * + * As the decoder needs more input it will call the read callback. + * As each metadata block and frame is decoded, the metadata or write + * callback will be called with the decoded metadata or frame. + * + * \param decoder An initialized decoder instance. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if any fatal read, write, or memory allocation error + * occurred (meaning decoding must stop), else \c true; for more + * information about the decoder, check the decoder state with + * FLAC__stream_decoder_get_state(). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_stream(FLAC__StreamDecoder *decoder); + +/** Skip one audio frame. + * This version instructs the decoder to 'skip' a single frame and stop, + * unless the callbacks return a fatal error or the read callback returns + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM. + * + * The decoding flow is the same as what occurs when + * FLAC__stream_decoder_process_single() is called to process an audio + * frame, except that this function does not decode the parsed data into + * PCM or call the write callback. The integrity of the frame is still + * checked the same way as in the other process functions. + * + * This function will return once one whole frame is skipped, in the + * same way that FLAC__stream_decoder_process_single() will return once + * one whole frame is decoded. + * + * This function can be used in more quickly determining FLAC frame + * boundaries when decoding of the actual data is not needed, for + * example when an application is separating a FLAC stream into frames + * for editing or storing in a container. To do this, the application + * can use FLAC__stream_decoder_skip_single_frame() to quickly advance + * to the next frame, then use + * FLAC__stream_decoder_get_decode_position() to find the new frame + * boundary. + * + * This function should only be called when the stream has advanced + * past all the metadata, otherwise it will return \c false. + * + * \param decoder An initialized decoder instance not in a metadata + * state. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c false if any fatal read, write, or memory allocation error + * occurred (meaning decoding must stop), or if the decoder + * is in the FLAC__STREAM_DECODER_SEARCH_FOR_METADATA or + * FLAC__STREAM_DECODER_READ_METADATA state, else \c true; for more + * information about the decoder, check the decoder state with + * FLAC__stream_decoder_get_state(). + */ +FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_frame(FLAC__StreamDecoder *decoder); + +/** Flush the input and seek to an absolute sample. + * Decoding will resume at the given sample. Note that because of + * this, the next write callback may contain a partial block. The + * client must support seeking the input or this function will fail + * and return \c false. Furthermore, if the decoder state is + * \c FLAC__STREAM_DECODER_SEEK_ERROR, then the decoder must be flushed + * with FLAC__stream_decoder_flush() or reset with + * FLAC__stream_decoder_reset() before decoding can continue. + * + * \param decoder A decoder instance. + * \param sample The target sample number to seek to. + * \assert + * \code decoder != NULL \endcode + * \retval FLAC__bool + * \c true if successful, else \c false. + */ +FLAC_API FLAC__bool FLAC__stream_decoder_seek_absolute(FLAC__StreamDecoder *decoder, FLAC__uint64 sample); + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/headers/FLAC/stream_encoder.h b/Audio-Frameworks/bin/flac/headers/FLAC/stream_encoder.h new file mode 100644 index 0000000..dbbbb23 --- /dev/null +++ b/Audio-Frameworks/bin/flac/headers/FLAC/stream_encoder.h @@ -0,0 +1,1768 @@ +/* libFLAC - Free Lossless Audio Codec library + * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FLAC__STREAM_ENCODER_H +#define FLAC__STREAM_ENCODER_H + +#include /* for FILE */ +#include "export.h" +#include "format.h" +#include "stream_decoder.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/** \file include/FLAC/stream_encoder.h + * + * \brief + * This module contains the functions which implement the stream + * encoder. + * + * See the detailed documentation in the + * \link flac_stream_encoder stream encoder \endlink module. + */ + +/** \defgroup flac_encoder FLAC/ \*_encoder.h: encoder interfaces + * \ingroup flac + * + * \brief + * This module describes the encoder layers provided by libFLAC. + * + * The stream encoder can be used to encode complete streams either to the + * client via callbacks, or directly to a file, depending on how it is + * initialized. When encoding via callbacks, the client provides a write + * callback which will be called whenever FLAC data is ready to be written. + * If the client also supplies a seek callback, the encoder will also + * automatically handle the writing back of metadata discovered while + * encoding, like stream info, seek points offsets, etc. When encoding to + * a file, the client needs only supply a filename or open \c FILE* and an + * optional progress callback for periodic notification of progress; the + * write and seek callbacks are supplied internally. For more info see the + * \link flac_stream_encoder stream encoder \endlink module. + */ + +/** \defgroup flac_stream_encoder FLAC/stream_encoder.h: stream encoder interface + * \ingroup flac_encoder + * + * \brief + * This module contains the functions which implement the stream + * encoder. + * + * The stream encoder can encode to native FLAC, and optionally Ogg FLAC + * (check FLAC_API_SUPPORTS_OGG_FLAC) streams and files. + * + * The basic usage of this encoder is as follows: + * - The program creates an instance of an encoder using + * FLAC__stream_encoder_new(). + * - The program overrides the default settings using + * FLAC__stream_encoder_set_*() functions. At a minimum, the following + * functions should be called: + * - FLAC__stream_encoder_set_channels() + * - FLAC__stream_encoder_set_bits_per_sample() + * - FLAC__stream_encoder_set_sample_rate() + * - FLAC__stream_encoder_set_ogg_serial_number() (if encoding to Ogg FLAC) + * - FLAC__stream_encoder_set_total_samples_estimate() (if known) + * - If the application wants to control the compression level or set its own + * metadata, then the following should also be called: + * - FLAC__stream_encoder_set_compression_level() + * - FLAC__stream_encoder_set_verify() + * - FLAC__stream_encoder_set_metadata() + * - The rest of the set functions should only be called if the client needs + * exact control over how the audio is compressed; thorough understanding + * of the FLAC format is necessary to achieve good results. + * - The program initializes the instance to validate the settings and + * prepare for encoding using + * - FLAC__stream_encoder_init_stream() or FLAC__stream_encoder_init_FILE() + * or FLAC__stream_encoder_init_file() for native FLAC + * - FLAC__stream_encoder_init_ogg_stream() or FLAC__stream_encoder_init_ogg_FILE() + * or FLAC__stream_encoder_init_ogg_file() for Ogg FLAC + * - The program calls FLAC__stream_encoder_process() or + * FLAC__stream_encoder_process_interleaved() to encode data, which + * subsequently calls the callbacks when there is encoder data ready + * to be written. + * - The program finishes the encoding with FLAC__stream_encoder_finish(), + * which causes the encoder to encode any data still in its input pipe, + * update the metadata with the final encoding statistics if output + * seeking is possible, and finally reset the encoder to the + * uninitialized state. + * - The instance may be used again or deleted with + * FLAC__stream_encoder_delete(). + * + * In more detail, the stream encoder functions similarly to the + * \link flac_stream_decoder stream decoder \endlink, but has fewer + * callbacks and more options. Typically the client will create a new + * instance by calling FLAC__stream_encoder_new(), then set the necessary + * parameters with FLAC__stream_encoder_set_*(), and initialize it by + * calling one of the FLAC__stream_encoder_init_*() functions. + * + * Unlike the decoders, the stream encoder has many options that can + * affect the speed and compression ratio. When setting these parameters + * you should have some basic knowledge of the format (see the + * user-level documentation + * or the formal description). The + * FLAC__stream_encoder_set_*() functions themselves do not validate the + * values as many are interdependent. The FLAC__stream_encoder_init_*() + * functions will do this, so make sure to pay attention to the state + * returned by FLAC__stream_encoder_init_*() to make sure that it is + * FLAC__STREAM_ENCODER_INIT_STATUS_OK. Any parameters that are not set + * before FLAC__stream_encoder_init_*() will take on the defaults from + * the constructor. + * + * There are three initialization functions for native FLAC, one for + * setting up the encoder to encode FLAC data to the client via + * callbacks, and two for encoding directly to a file. + * + * For encoding via callbacks, use FLAC__stream_encoder_init_stream(). + * You must also supply a write callback which will be called anytime + * there is raw encoded data to write. If the client can seek the output + * it is best to also supply seek and tell callbacks, as this allows the + * encoder to go back after encoding is finished to write back + * information that was collected while encoding, like seek point offsets, + * frame sizes, etc. + * + * For encoding directly to a file, use FLAC__stream_encoder_init_FILE() + * or FLAC__stream_encoder_init_file(). Then you must only supply a + * filename or open \c FILE*; the encoder will handle all the callbacks + * internally. You may also supply a progress callback for periodic + * notification of the encoding progress. + * + * There are three similarly-named init functions for encoding to Ogg + * FLAC streams. Check \c FLAC_API_SUPPORTS_OGG_FLAC to find out if the + * library has been built with Ogg support. + * + * The call to FLAC__stream_encoder_init_*() currently will also immediately + * call the write callback several times, once with the \c fLaC signature, + * and once for each encoded metadata block. Note that for Ogg FLAC + * encoding you will usually get at least twice the number of callbacks than + * with native FLAC, one for the Ogg page header and one for the page body. + * + * After initializing the instance, the client may feed audio data to the + * encoder in one of two ways: + * + * - Channel separate, through FLAC__stream_encoder_process() - The client + * will pass an array of pointers to buffers, one for each channel, to + * the encoder, each of the same length. The samples need not be + * block-aligned, but each channel should have the same number of samples. + * - Channel interleaved, through + * FLAC__stream_encoder_process_interleaved() - The client will pass a single + * pointer to data that is channel-interleaved (i.e. channel0_sample0, + * channel1_sample0, ... , channelN_sample0, channel0_sample1, ...). + * Again, the samples need not be block-aligned but they must be + * sample-aligned, i.e. the first value should be channel0_sample0 and + * the last value channelN_sampleM. + * + * Note that for either process call, each sample in the buffers should be a + * signed integer, right-justified to the resolution set by + * FLAC__stream_encoder_set_bits_per_sample(). For example, if the resolution + * is 16 bits per sample, the samples should all be in the range [-32768,32767]. + * + * When the client is finished encoding data, it calls + * FLAC__stream_encoder_finish(), which causes the encoder to encode any + * data still in its input pipe, and call the metadata callback with the + * final encoding statistics. Then the instance may be deleted with + * FLAC__stream_encoder_delete() or initialized again to encode another + * stream. + * + * For programs that write their own metadata, but that do not know the + * actual metadata until after encoding, it is advantageous to instruct + * the encoder to write a PADDING block of the correct size, so that + * instead of rewriting the whole stream after encoding, the program can + * just overwrite the PADDING block. If only the maximum size of the + * metadata is known, the program can write a slightly larger padding + * block, then split it after encoding. + * + * Make sure you understand how lengths are calculated. All FLAC metadata + * blocks have a 4 byte header which contains the type and length. This + * length does not include the 4 bytes of the header. See the format page + * for the specification of metadata blocks and their lengths. + * + * \note + * If you are writing the FLAC data to a file via callbacks, make sure it + * is open for update (e.g. mode "w+" for stdio streams). This is because + * after the first encoding pass, the encoder will try to seek back to the + * beginning of the stream, to the STREAMINFO block, to write some data + * there. (If using FLAC__stream_encoder_init*_file() or + * FLAC__stream_encoder_init*_FILE(), the file is managed internally.) + * + * \note + * The "set" functions may only be called when the encoder is in the + * state FLAC__STREAM_ENCODER_UNINITIALIZED, i.e. after + * FLAC__stream_encoder_new() or FLAC__stream_encoder_finish(), but + * before FLAC__stream_encoder_init_*(). If this is the case they will + * return \c true, otherwise \c false. + * + * \note + * FLAC__stream_encoder_finish() resets all settings to the constructor + * defaults. + * + * \{ + */ + + +/** State values for a FLAC__StreamEncoder. + * + * The encoder's state can be obtained by calling FLAC__stream_encoder_get_state(). + * + * If the encoder gets into any other state besides \c FLAC__STREAM_ENCODER_OK + * or \c FLAC__STREAM_ENCODER_UNINITIALIZED, it becomes invalid for encoding and + * must be deleted with FLAC__stream_encoder_delete(). + */ +typedef enum { + + FLAC__STREAM_ENCODER_OK = 0, + /**< The encoder is in the normal OK state and samples can be processed. */ + + FLAC__STREAM_ENCODER_UNINITIALIZED, + /**< The encoder is in the uninitialized state; one of the + * FLAC__stream_encoder_init_*() functions must be called before samples + * can be processed. + */ + + FLAC__STREAM_ENCODER_OGG_ERROR, + /**< An error occurred in the underlying Ogg layer. */ + + FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR, + /**< An error occurred in the underlying verify stream decoder; + * check FLAC__stream_encoder_get_verify_decoder_state(). + */ + + FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA, + /**< The verify decoder detected a mismatch between the original + * audio signal and the decoded audio signal. + */ + + FLAC__STREAM_ENCODER_CLIENT_ERROR, + /**< One of the callbacks returned a fatal error. */ + + FLAC__STREAM_ENCODER_IO_ERROR, + /**< An I/O error occurred while opening/reading/writing a file. + * Check \c errno. + */ + + FLAC__STREAM_ENCODER_FRAMING_ERROR, + /**< An error occurred while writing the stream; usually, the + * write_callback returned an error. + */ + + FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR + /**< Memory allocation failed. */ + +} FLAC__StreamEncoderState; + +/** Maps a FLAC__StreamEncoderState to a C string. + * + * Using a FLAC__StreamEncoderState as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderStateString[]; + + +/** Possible return values for the FLAC__stream_encoder_init_*() functions. + */ +typedef enum { + + FLAC__STREAM_ENCODER_INIT_STATUS_OK = 0, + /**< Initialization was successful. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR, + /**< General failure to set up encoder; call FLAC__stream_encoder_get_state() for cause. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_UNSUPPORTED_CONTAINER, + /**< The library was not compiled with support for the given container + * format. + */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_CALLBACKS, + /**< A required callback was not supplied. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_NUMBER_OF_CHANNELS, + /**< The encoder has an invalid setting for number of channels. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BITS_PER_SAMPLE, + /**< The encoder has an invalid setting for bits-per-sample. + * FLAC supports 4-32 bps but the reference encoder currently supports + * only up to 24 bps. + */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_SAMPLE_RATE, + /**< The encoder has an invalid setting for the input sample rate. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BLOCK_SIZE, + /**< The encoder has an invalid setting for the block size. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_MAX_LPC_ORDER, + /**< The encoder has an invalid setting for the maximum LPC order. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_QLP_COEFF_PRECISION, + /**< The encoder has an invalid setting for the precision of the quantized linear predictor coefficients. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_BLOCK_SIZE_TOO_SMALL_FOR_LPC_ORDER, + /**< The specified block size is less than the maximum LPC order. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE, + /**< The encoder is bound to the Subset but other settings violate it. */ + + FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA, + /**< The metadata input to the encoder is invalid, in one of the following ways: + * - FLAC__stream_encoder_set_metadata() was called with a null pointer but a block count > 0 + * - One of the metadata blocks contains an undefined type + * - It contains an illegal CUESHEET as checked by FLAC__format_cuesheet_is_legal() + * - It contains an illegal SEEKTABLE as checked by FLAC__format_seektable_is_legal() + * - It contains more than one SEEKTABLE block or more than one VORBIS_COMMENT block + */ + + FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED + /**< FLAC__stream_encoder_init_*() was called when the encoder was + * already initialized, usually because + * FLAC__stream_encoder_finish() was not called. + */ + +} FLAC__StreamEncoderInitStatus; + +/** Maps a FLAC__StreamEncoderInitStatus to a C string. + * + * Using a FLAC__StreamEncoderInitStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderInitStatusString[]; + + +/** Return values for the FLAC__StreamEncoder read callback. + */ +typedef enum { + + FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE, + /**< The read was OK and decoding can continue. */ + + FLAC__STREAM_ENCODER_READ_STATUS_END_OF_STREAM, + /**< The read was attempted at the end of the stream. */ + + FLAC__STREAM_ENCODER_READ_STATUS_ABORT, + /**< An unrecoverable error occurred. */ + + FLAC__STREAM_ENCODER_READ_STATUS_UNSUPPORTED + /**< Client does not support reading back from the output. */ + +} FLAC__StreamEncoderReadStatus; + +/** Maps a FLAC__StreamEncoderReadStatus to a C string. + * + * Using a FLAC__StreamEncoderReadStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderReadStatusString[]; + + +/** Return values for the FLAC__StreamEncoder write callback. + */ +typedef enum { + + FLAC__STREAM_ENCODER_WRITE_STATUS_OK = 0, + /**< The write was OK and encoding can continue. */ + + FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR + /**< An unrecoverable error occurred. The encoder will return from the process call. */ + +} FLAC__StreamEncoderWriteStatus; + +/** Maps a FLAC__StreamEncoderWriteStatus to a C string. + * + * Using a FLAC__StreamEncoderWriteStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderWriteStatusString[]; + + +/** Return values for the FLAC__StreamEncoder seek callback. + */ +typedef enum { + + FLAC__STREAM_ENCODER_SEEK_STATUS_OK, + /**< The seek was OK and encoding can continue. */ + + FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR, + /**< An unrecoverable error occurred. */ + + FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED + /**< Client does not support seeking. */ + +} FLAC__StreamEncoderSeekStatus; + +/** Maps a FLAC__StreamEncoderSeekStatus to a C string. + * + * Using a FLAC__StreamEncoderSeekStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderSeekStatusString[]; + + +/** Return values for the FLAC__StreamEncoder tell callback. + */ +typedef enum { + + FLAC__STREAM_ENCODER_TELL_STATUS_OK, + /**< The tell was OK and encoding can continue. */ + + FLAC__STREAM_ENCODER_TELL_STATUS_ERROR, + /**< An unrecoverable error occurred. */ + + FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED + /**< Client does not support seeking. */ + +} FLAC__StreamEncoderTellStatus; + +/** Maps a FLAC__StreamEncoderTellStatus to a C string. + * + * Using a FLAC__StreamEncoderTellStatus as the index to this array + * will give the string equivalent. The contents should not be modified. + */ +extern FLAC_API const char * const FLAC__StreamEncoderTellStatusString[]; + + +/*********************************************************************** + * + * class FLAC__StreamEncoder + * + ***********************************************************************/ + +struct FLAC__StreamEncoderProtected; +struct FLAC__StreamEncoderPrivate; +/** The opaque structure definition for the stream encoder type. + * See the \link flac_stream_encoder stream encoder module \endlink + * for a detailed description. + */ +typedef struct { + struct FLAC__StreamEncoderProtected *protected_; /* avoid the C++ keyword 'protected' */ + struct FLAC__StreamEncoderPrivate *private_; /* avoid the C++ keyword 'private' */ +} FLAC__StreamEncoder; + +/** Signature for the read callback. + * + * A function pointer matching this signature must be passed to + * FLAC__stream_encoder_init_ogg_stream() if seeking is supported. + * The supplied function will be called when the encoder needs to read back + * encoded data. This happens during the metadata callback, when the encoder + * has to read, modify, and rewrite the metadata (e.g. seekpoints) gathered + * while encoding. The address of the buffer to be filled is supplied, along + * with the number of bytes the buffer can hold. The callback may choose to + * supply less data and modify the byte count but must be careful not to + * overflow the buffer. The callback then returns a status code chosen from + * FLAC__StreamEncoderReadStatus. + * + * Here is an example of a read callback for stdio streams: + * \code + * FLAC__StreamEncoderReadStatus read_cb(const FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * if(*bytes > 0) { + * *bytes = fread(buffer, sizeof(FLAC__byte), *bytes, file); + * if(ferror(file)) + * return FLAC__STREAM_ENCODER_READ_STATUS_ABORT; + * else if(*bytes == 0) + * return FLAC__STREAM_ENCODER_READ_STATUS_END_OF_STREAM; + * else + * return FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE; + * } + * else + * return FLAC__STREAM_ENCODER_READ_STATUS_ABORT; + * } + * \endcode + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param buffer A pointer to a location for the callee to store + * data to be encoded. + * \param bytes A pointer to the size of the buffer. On entry + * to the callback, it contains the maximum number + * of bytes that may be stored in \a buffer. The + * callee must set it to the actual number of bytes + * stored (0 in case of error or end-of-stream) before + * returning. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_set_client_data(). + * \retval FLAC__StreamEncoderReadStatus + * The callee's return status. + */ +typedef FLAC__StreamEncoderReadStatus (*FLAC__StreamEncoderReadCallback)(const FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data); + +/** Signature for the write callback. + * + * A function pointer matching this signature must be passed to + * FLAC__stream_encoder_init*_stream(). The supplied function will be called + * by the encoder anytime there is raw encoded data ready to write. It may + * include metadata mixed with encoded audio frames and the data is not + * guaranteed to be aligned on frame or metadata block boundaries. + * + * The only duty of the callback is to write out the \a bytes worth of data + * in \a buffer to the current position in the output stream. The arguments + * \a samples and \a current_frame are purely informational. If \a samples + * is greater than \c 0, then \a current_frame will hold the current frame + * number that is being written; otherwise it indicates that the write + * callback is being called to write metadata. + * + * \note + * Unlike when writing to native FLAC, when writing to Ogg FLAC the + * write callback will be called twice when writing each audio + * frame; once for the page header, and once for the page body. + * When writing the page header, the \a samples argument to the + * write callback will be \c 0. + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param buffer An array of encoded data of length \a bytes. + * \param bytes The byte length of \a buffer. + * \param samples The number of samples encoded by \a buffer. + * \c 0 has a special meaning; see above. + * \param current_frame The number of the current frame being encoded. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + * \retval FLAC__StreamEncoderWriteStatus + * The callee's return status. + */ +typedef FLAC__StreamEncoderWriteStatus (*FLAC__StreamEncoderWriteCallback)(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data); + +/** Signature for the seek callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_encoder_init*_stream(). The supplied function will be called + * when the encoder needs to seek the output stream. The encoder will pass + * the absolute byte offset to seek to, 0 meaning the beginning of the stream. + * + * Here is an example of a seek callback for stdio streams: + * \code + * FLAC__StreamEncoderSeekStatus seek_cb(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * if(file == stdin) + * return FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED; + * else if(fseeko(file, (off_t)absolute_byte_offset, SEEK_SET) < 0) + * return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR; + * else + * return FLAC__STREAM_ENCODER_SEEK_STATUS_OK; + * } + * \endcode + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param absolute_byte_offset The offset from the beginning of the stream + * to seek to. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + * \retval FLAC__StreamEncoderSeekStatus + * The callee's return status. + */ +typedef FLAC__StreamEncoderSeekStatus (*FLAC__StreamEncoderSeekCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data); + +/** Signature for the tell callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_encoder_init*_stream(). The supplied function will be called + * when the encoder needs to know the current position of the output stream. + * + * \warning + * The callback must return the true current byte offset of the output to + * which the encoder is writing. If you are buffering the output, make + * sure and take this into account. If you are writing directly to a + * FILE* from your write callback, ftell() is sufficient. If you are + * writing directly to a file descriptor from your write callback, you + * can use lseek(fd, SEEK_CUR, 0). The encoder may later seek back to + * these points to rewrite metadata after encoding. + * + * Here is an example of a tell callback for stdio streams: + * \code + * FLAC__StreamEncoderTellStatus tell_cb(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) + * { + * FILE *file = ((MyClientData*)client_data)->file; + * off_t pos; + * if(file == stdin) + * return FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED; + * else if((pos = ftello(file)) < 0) + * return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR; + * else { + * *absolute_byte_offset = (FLAC__uint64)pos; + * return FLAC__STREAM_ENCODER_TELL_STATUS_OK; + * } + * } + * \endcode + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param absolute_byte_offset The address at which to store the current + * position of the output. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + * \retval FLAC__StreamEncoderTellStatus + * The callee's return status. + */ +typedef FLAC__StreamEncoderTellStatus (*FLAC__StreamEncoderTellCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data); + +/** Signature for the metadata callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_encoder_init*_stream(). The supplied function will be called + * once at the end of encoding with the populated STREAMINFO structure. This + * is so the client can seek back to the beginning of the file and write the + * STREAMINFO block with the correct statistics after encoding (like + * minimum/maximum frame size and total samples). + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param metadata The final populated STREAMINFO block. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + */ +typedef void (*FLAC__StreamEncoderMetadataCallback)(const FLAC__StreamEncoder *encoder, const FLAC__StreamMetadata *metadata, void *client_data); + +/** Signature for the progress callback. + * + * A function pointer matching this signature may be passed to + * FLAC__stream_encoder_init*_file() or FLAC__stream_encoder_init*_FILE(). + * The supplied function will be called when the encoder has finished + * writing a frame. The \c total_frames_estimate argument to the + * callback will be based on the value from + * FLAC__stream_encoder_set_total_samples_estimate(). + * + * \note In general, FLAC__StreamEncoder functions which change the + * state should not be called on the \a encoder while in the callback. + * + * \param encoder The encoder instance calling the callback. + * \param bytes_written Bytes written so far. + * \param samples_written Samples written so far. + * \param frames_written Frames written so far. + * \param total_frames_estimate The estimate of the total number of + * frames to be written. + * \param client_data The callee's client data set through + * FLAC__stream_encoder_init_*(). + */ +typedef void (*FLAC__StreamEncoderProgressCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data); + + +/*********************************************************************** + * + * Class constructor/destructor + * + ***********************************************************************/ + +/** Create a new stream encoder instance. The instance is created with + * default settings; see the individual FLAC__stream_encoder_set_*() + * functions for each setting's default. + * + * \retval FLAC__StreamEncoder* + * \c NULL if there was an error allocating memory, else the new instance. + */ +FLAC_API FLAC__StreamEncoder *FLAC__stream_encoder_new(void); + +/** Free an encoder instance. Deletes the object pointed to by \a encoder. + * + * \param encoder A pointer to an existing encoder. + * \assert + * \code encoder != NULL \endcode + */ +FLAC_API void FLAC__stream_encoder_delete(FLAC__StreamEncoder *encoder); + + +/*********************************************************************** + * + * Public class method prototypes + * + ***********************************************************************/ + +/** Set the serial number for the FLAC stream to use in the Ogg container. + * + * \note + * This does not need to be set for native FLAC encoding. + * + * \note + * It is recommended to set a serial number explicitly as the default of '0' + * may collide with other streams. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param serial_number See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_ogg_serial_number(FLAC__StreamEncoder *encoder, long serial_number); + +/** Set the "verify" flag. If \c true, the encoder will verify it's own + * encoded output by feeding it through an internal decoder and comparing + * the original signal against the decoded signal. If a mismatch occurs, + * the process call will return \c false. Note that this will slow the + * encoding process by the extra time required for decoding and comparison. + * + * \default \c false + * \param encoder An encoder instance to set. + * \param value Flag value (see above). + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_verify(FLAC__StreamEncoder *encoder, FLAC__bool value); + +/** Set the Subset flag. If \c true, + * the encoder will comply with the Subset and will check the + * settings during FLAC__stream_encoder_init_*() to see if all settings + * comply. If \c false, the settings may take advantage of the full + * range that the format allows. + * + * Make sure you know what it entails before setting this to \c false. + * + * \default \c true + * \param encoder An encoder instance to set. + * \param value Flag value (see above). + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_streamable_subset(FLAC__StreamEncoder *encoder, FLAC__bool value); + +/** Set the number of channels to be encoded. + * + * \default \c 2 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_channels(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the sample resolution of the input to be encoded. + * + * \warning + * Do not feed the encoder data that is wider than the value you + * set here or you will generate an invalid stream. + * + * \default \c 16 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_bits_per_sample(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the sample rate (in Hz) of the input to be encoded. + * + * \default \c 44100 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the compression level + * + * The compression level is roughly proportional to the amount of effort + * the encoder expends to compress the file. A higher level usually + * means more computation but higher compression. The default level is + * suitable for most applications. + * + * Currently the levels range from \c 0 (fastest, least compression) to + * \c 8 (slowest, most compression). A value larger than \c 8 will be + * treated as \c 8. + * + * This function automatically calls the following other \c _set_ + * functions with appropriate values, so the client does not need to + * unless it specifically wants to override them: + * - FLAC__stream_encoder_set_do_mid_side_stereo() + * - FLAC__stream_encoder_set_loose_mid_side_stereo() + * - FLAC__stream_encoder_set_apodization() + * - FLAC__stream_encoder_set_max_lpc_order() + * - FLAC__stream_encoder_set_qlp_coeff_precision() + * - FLAC__stream_encoder_set_do_qlp_coeff_prec_search() + * - FLAC__stream_encoder_set_do_escape_coding() + * - FLAC__stream_encoder_set_do_exhaustive_model_search() + * - FLAC__stream_encoder_set_min_residual_partition_order() + * - FLAC__stream_encoder_set_max_residual_partition_order() + * - FLAC__stream_encoder_set_rice_parameter_search_dist() + * + * The actual values set for each level are: + * + * + * + * + * + * + * + * + * + * + * + * + *
level + * do mid-side stereo + * loose mid-side stereo + * apodization + * max lpc order + * qlp coeff precision + * qlp coeff prec search + * escape coding + * exhaustive model search + * min residual partition order + * max residual partition order + * rice parameter search dist + *
0 false false tukey(0.5) 0 0 false false false 0 3 0
1 true true tukey(0.5) 0 0 false false false 0 3 0
2 true false tukey(0.5) 0 0 false false false 0 3 0
3 false false tukey(0.5) 6 0 false false false 0 4 0
4 true true tukey(0.5) 8 0 false false false 0 4 0
5 true false tukey(0.5) 8 0 false false false 0 5 0
6 true false tukey(0.5) 8 0 false false false 0 6 0
7 true false tukey(0.5) 8 0 false false true 0 6 0
8 true false tukey(0.5) 12 0 false false true 0 6 0
+ * + * \default \c 5 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_compression_level(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the blocksize to use while encoding. + * + * The number of samples to use per frame. Use \c 0 to let the encoder + * estimate a blocksize; this is usually best. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_blocksize(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set to \c true to enable mid-side encoding on stereo input. The + * number of channels must be 2 for this to have any effect. Set to + * \c false to use only independent channel coding. + * + * \default \c false + * \param encoder An encoder instance to set. + * \param value Flag value (see above). + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_do_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value); + +/** Set to \c true to enable adaptive switching between mid-side and + * left-right encoding on stereo input. Set to \c false to use + * exhaustive searching. Setting this to \c true requires + * FLAC__stream_encoder_set_do_mid_side_stereo() to also be set to + * \c true in order to have any effect. + * + * \default \c false + * \param encoder An encoder instance to set. + * \param value Flag value (see above). + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_loose_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value); + +/** Sets the apodization function(s) the encoder will use when windowing + * audio data for LPC analysis. + * + * The \a specification is a plain ASCII string which specifies exactly + * which functions to use. There may be more than one (up to 32), + * separated by \c ';' characters. Some functions take one or more + * comma-separated arguments in parentheses. + * + * The available functions are \c bartlett, \c bartlett_hann, + * \c blackman, \c blackman_harris_4term_92db, \c connes, \c flattop, + * \c gauss(STDDEV), \c hamming, \c hann, \c kaiser_bessel, \c nuttall, + * \c rectangle, \c triangle, \c tukey(P), \c welch. + * + * For \c gauss(STDDEV), STDDEV specifies the standard deviation + * (0blocksize / (2 ^ order). + * + * Set both min and max values to \c 0 to force a single context, + * whose Rice parameter is based on the residual signal variance. + * Otherwise, set a min and max order, and the encoder will search + * all orders, using the mean of each context for its Rice parameter, + * and use the best. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_min_residual_partition_order(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set the maximum partition order to search when coding the residual. + * This is used in tandem with + * FLAC__stream_encoder_set_min_residual_partition_order(). + * + * The partition order determines the context size in the residual. + * The context size will be approximately blocksize / (2 ^ order). + * + * Set both min and max values to \c 0 to force a single context, + * whose Rice parameter is based on the residual signal variance. + * Otherwise, set a min and max order, and the encoder will search + * all orders, using the mean of each context for its Rice parameter, + * and use the best. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_max_residual_partition_order(FLAC__StreamEncoder *encoder, unsigned value); + +/** Deprecated. Setting this value has no effect. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_rice_parameter_search_dist(FLAC__StreamEncoder *encoder, unsigned value); + +/** Set an estimate of the total samples that will be encoded. + * This is merely an estimate and may be set to \c 0 if unknown. + * This value will be written to the STREAMINFO block before encoding, + * and can remove the need for the caller to rewrite the value later + * if the value is known before encoding. + * + * \default \c 0 + * \param encoder An encoder instance to set. + * \param value See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_total_samples_estimate(FLAC__StreamEncoder *encoder, FLAC__uint64 value); + +/** Set the metadata blocks to be emitted to the stream before encoding. + * A value of \c NULL, \c 0 implies no metadata; otherwise, supply an + * array of pointers to metadata blocks. The array is non-const since + * the encoder may need to change the \a is_last flag inside them, and + * in some cases update seek point offsets. Otherwise, the encoder will + * not modify or free the blocks. It is up to the caller to free the + * metadata blocks after encoding finishes. + * + * \note + * The encoder stores only copies of the pointers in the \a metadata array; + * the metadata blocks themselves must survive at least until after + * FLAC__stream_encoder_finish() returns. Do not free the blocks until then. + * + * \note + * The STREAMINFO block is always written and no STREAMINFO block may + * occur in the supplied array. + * + * \note + * By default the encoder does not create a SEEKTABLE. If one is supplied + * in the \a metadata array, but the client has specified that it does not + * support seeking, then the SEEKTABLE will be written verbatim. However + * by itself this is not very useful as the client will not know the stream + * offsets for the seekpoints ahead of time. In order to get a proper + * seektable the client must support seeking. See next note. + * + * \note + * SEEKTABLE blocks are handled specially. Since you will not know + * the values for the seek point stream offsets, you should pass in + * a SEEKTABLE 'template', that is, a SEEKTABLE object with the + * required sample numbers (or placeholder points), with \c 0 for the + * \a frame_samples and \a stream_offset fields for each point. If the + * client has specified that it supports seeking by providing a seek + * callback to FLAC__stream_encoder_init_stream() or both seek AND read + * callback to FLAC__stream_encoder_init_ogg_stream() (or by using + * FLAC__stream_encoder_init*_file() or FLAC__stream_encoder_init*_FILE()), + * then while it is encoding the encoder will fill the stream offsets in + * for you and when encoding is finished, it will seek back and write the + * real values into the SEEKTABLE block in the stream. There are helper + * routines for manipulating seektable template blocks; see metadata.h: + * FLAC__metadata_object_seektable_template_*(). If the client does + * not support seeking, the SEEKTABLE will have inaccurate offsets which + * will slow down or remove the ability to seek in the FLAC stream. + * + * \note + * The encoder instance \b will modify the first \c SEEKTABLE block + * as it transforms the template to a valid seektable while encoding, + * but it is still up to the caller to free all metadata blocks after + * encoding. + * + * \note + * A VORBIS_COMMENT block may be supplied. The vendor string in it + * will be ignored. libFLAC will use it's own vendor string. libFLAC + * will not modify the passed-in VORBIS_COMMENT's vendor string, it + * will simply write it's own into the stream. If no VORBIS_COMMENT + * block is present in the \a metadata array, libFLAC will write an + * empty one, containing only the vendor string. + * + * \note The Ogg FLAC mapping requires that the VORBIS_COMMENT block be + * the second metadata block of the stream. The encoder already supplies + * the STREAMINFO block automatically. If \a metadata does not contain a + * VORBIS_COMMENT block, the encoder will supply that too. Otherwise, if + * \a metadata does contain a VORBIS_COMMENT block and it is not the + * first, the init function will reorder \a metadata by moving the + * VORBIS_COMMENT block to the front; the relative ordering of the other + * blocks will remain as they were. + * + * \note The Ogg FLAC mapping limits the number of metadata blocks per + * stream to \c 65535. If \a num_blocks exceeds this the function will + * return \c false. + * + * \default \c NULL, 0 + * \param encoder An encoder instance to set. + * \param metadata See above. + * \param num_blocks See above. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * \c false if the encoder is already initialized, else \c true. + * \c false if the encoder is already initialized, or if + * \a num_blocks > 65535 if encoding to Ogg FLAC, else \c true. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_set_metadata(FLAC__StreamEncoder *encoder, FLAC__StreamMetadata **metadata, unsigned num_blocks); + +/** Get the current encoder state. + * + * \param encoder An encoder instance to query. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__StreamEncoderState + * The current encoder state. + */ +FLAC_API FLAC__StreamEncoderState FLAC__stream_encoder_get_state(const FLAC__StreamEncoder *encoder); + +/** Get the state of the verify stream decoder. + * Useful when the stream encoder state is + * \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR. + * + * \param encoder An encoder instance to query. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__StreamDecoderState + * The verify stream decoder state. + */ +FLAC_API FLAC__StreamDecoderState FLAC__stream_encoder_get_verify_decoder_state(const FLAC__StreamEncoder *encoder); + +/** Get the current encoder state as a C string. + * This version automatically resolves + * \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR by getting the + * verify decoder's state. + * + * \param encoder A encoder instance to query. + * \assert + * \code encoder != NULL \endcode + * \retval const char * + * The encoder state as a C string. Do not modify the contents. + */ +FLAC_API const char *FLAC__stream_encoder_get_resolved_state_string(const FLAC__StreamEncoder *encoder); + +/** Get relevant values about the nature of a verify decoder error. + * Useful when the stream encoder state is + * \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR. The arguments should + * be addresses in which the stats will be returned, or NULL if value + * is not desired. + * + * \param encoder An encoder instance to query. + * \param absolute_sample The absolute sample number of the mismatch. + * \param frame_number The number of the frame in which the mismatch occurred. + * \param channel The channel in which the mismatch occurred. + * \param sample The number of the sample (relative to the frame) in + * which the mismatch occurred. + * \param expected The expected value for the sample in question. + * \param got The actual value returned by the decoder. + * \assert + * \code encoder != NULL \endcode + */ +FLAC_API void FLAC__stream_encoder_get_verify_decoder_error_stats(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got); + +/** Get the "verify" flag. + * + * \param encoder An encoder instance to query. + * \assert + * \code encoder != NULL \endcode + * \retval FLAC__bool + * See FLAC__stream_encoder_set_verify(). + */ +FLAC_API FLAC__bool FLAC__stream_encoder_get_verify(const FLAC__StreamEncoder *encoder); + +/** Get the frame header. + * + * \param encoder An initialized encoder instance in the OK state. + * \param buffer An array of pointers to each channel's signal. + * \param samples The number of samples in one channel. + * \assert + * \code encoder != NULL \endcode + * \code FLAC__stream_encoder_get_state(encoder) == FLAC__STREAM_ENCODER_OK \endcode + * \retval FLAC__bool + * \c true if successful, else \c false; in this case, check the + * encoder state with FLAC__stream_encoder_get_state() to see what + * went wrong. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples); + +/** Submit data for encoding. + * This version allows you to supply the input data where the channels + * are interleaved into a single array (i.e. channel0_sample0, + * channel1_sample0, ... , channelN_sample0, channel0_sample1, ...). + * The samples need not be block-aligned but they must be + * sample-aligned, i.e. the first value should be channel0_sample0 + * and the last value channelN_sampleM. Each sample should be a signed + * integer, right-justified to the resolution set by + * FLAC__stream_encoder_set_bits_per_sample(). For example, if the + * resolution is 16 bits per sample, the samples should all be in the + * range [-32768,32767]. + * + * For applications where channel order is important, channels must + * follow the order as described in the + * frame header. + * + * \param encoder An initialized encoder instance in the OK state. + * \param buffer An array of channel-interleaved data (see above). + * \param samples The number of samples in one channel, the same as for + * FLAC__stream_encoder_process(). For example, if + * encoding two channels, \c 1000 \a samples corresponds + * to a \a buffer of 2000 values. + * \assert + * \code encoder != NULL \endcode + * \code FLAC__stream_encoder_get_state(encoder) == FLAC__STREAM_ENCODER_OK \endcode + * \retval FLAC__bool + * \c true if successful, else \c false; in this case, check the + * encoder state with FLAC__stream_encoder_get_state() to see what + * went wrong. + */ +FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder *encoder, const FLAC__int32 buffer[], unsigned samples); + +/* \} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Audio-Frameworks/bin/flac/headers/ogg/ogg.h b/Audio-Frameworks/bin/flac/headers/ogg/ogg.h new file mode 100644 index 0000000..cea4ebe --- /dev/null +++ b/Audio-Frameworks/bin/flac/headers/ogg/ogg.h @@ -0,0 +1,210 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: toplevel libogg include + last mod: $Id: ogg.h 18044 2011-08-01 17:55:20Z gmaxwell $ + + ********************************************************************/ +#ifndef _OGG_H +#define _OGG_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +typedef struct { + void *iov_base; + size_t iov_len; +} ogg_iovec_t; + +typedef struct { + long endbyte; + int endbit; + + unsigned char *buffer; + unsigned char *ptr; + long storage; +} oggpack_buffer; + +/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/ + +typedef struct { + unsigned char *header; + long header_len; + unsigned char *body; + long body_len; +} ogg_page; + +/* ogg_stream_state contains the current encode/decode state of a logical + Ogg bitstream **********************************************************/ + +typedef struct { + unsigned char *body_data; /* bytes from packet bodies */ + long body_storage; /* storage elements allocated */ + long body_fill; /* elements stored; fill mark */ + long body_returned; /* elements of fill returned */ + + + int *lacing_vals; /* The values that will go to the segment table */ + ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact + this way, but it is simple coupled to the + lacing fifo */ + long lacing_storage; + long lacing_fill; + long lacing_packet; + long lacing_returned; + + unsigned char header[282]; /* working space for header encode */ + int header_fill; + + int e_o_s; /* set when we have buffered the last packet in the + logical bitstream */ + int b_o_s; /* set after we've written the initial page + of a logical bitstream */ + long serialno; + long pageno; + ogg_int64_t packetno; /* sequence number for decode; the framing + knows where there's a hole in the data, + but we need coupling so that the codec + (which is in a separate abstraction + layer) also knows about the gap */ + ogg_int64_t granulepos; + +} ogg_stream_state; + +/* ogg_packet is used to encapsulate the data and metadata belonging + to a single raw Ogg/Vorbis packet *************************************/ + +typedef struct { + unsigned char *packet; + long bytes; + long b_o_s; + long e_o_s; + + ogg_int64_t granulepos; + + ogg_int64_t packetno; /* sequence number for decode; the framing + knows where there's a hole in the data, + but we need coupling so that the codec + (which is in a separate abstraction + layer) also knows about the gap */ +} ogg_packet; + +typedef struct { + unsigned char *data; + int storage; + int fill; + int returned; + + int unsynced; + int headerbytes; + int bodybytes; +} ogg_sync_state; + +/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/ + +extern void oggpack_writeinit(oggpack_buffer *b); +extern int oggpack_writecheck(oggpack_buffer *b); +extern void oggpack_writetrunc(oggpack_buffer *b,long bits); +extern void oggpack_writealign(oggpack_buffer *b); +extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits); +extern void oggpack_reset(oggpack_buffer *b); +extern void oggpack_writeclear(oggpack_buffer *b); +extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); +extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits); +extern long oggpack_look(oggpack_buffer *b,int bits); +extern long oggpack_look1(oggpack_buffer *b); +extern void oggpack_adv(oggpack_buffer *b,int bits); +extern void oggpack_adv1(oggpack_buffer *b); +extern long oggpack_read(oggpack_buffer *b,int bits); +extern long oggpack_read1(oggpack_buffer *b); +extern long oggpack_bytes(oggpack_buffer *b); +extern long oggpack_bits(oggpack_buffer *b); +extern unsigned char *oggpack_get_buffer(oggpack_buffer *b); + +extern void oggpackB_writeinit(oggpack_buffer *b); +extern int oggpackB_writecheck(oggpack_buffer *b); +extern void oggpackB_writetrunc(oggpack_buffer *b,long bits); +extern void oggpackB_writealign(oggpack_buffer *b); +extern void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits); +extern void oggpackB_reset(oggpack_buffer *b); +extern void oggpackB_writeclear(oggpack_buffer *b); +extern void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); +extern void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits); +extern long oggpackB_look(oggpack_buffer *b,int bits); +extern long oggpackB_look1(oggpack_buffer *b); +extern void oggpackB_adv(oggpack_buffer *b,int bits); +extern void oggpackB_adv1(oggpack_buffer *b); +extern long oggpackB_read(oggpack_buffer *b,int bits); +extern long oggpackB_read1(oggpack_buffer *b); +extern long oggpackB_bytes(oggpack_buffer *b); +extern long oggpackB_bits(oggpack_buffer *b); +extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b); + +/* Ogg BITSTREAM PRIMITIVES: encoding **************************/ + +extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op); +extern int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov, + int count, long e_o_s, ogg_int64_t granulepos); +extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og); +extern int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill); +extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og); +extern int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill); + +/* Ogg BITSTREAM PRIMITIVES: decoding **************************/ + +extern int ogg_sync_init(ogg_sync_state *oy); +extern int ogg_sync_clear(ogg_sync_state *oy); +extern int ogg_sync_reset(ogg_sync_state *oy); +extern int ogg_sync_destroy(ogg_sync_state *oy); +extern int ogg_sync_check(ogg_sync_state *oy); + +extern char *ogg_sync_buffer(ogg_sync_state *oy, long size); +extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes); +extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og); +extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og); +extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og); +extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op); +extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op); + +/* Ogg BITSTREAM PRIMITIVES: general ***************************/ + +extern int ogg_stream_init(ogg_stream_state *os,int serialno); +extern int ogg_stream_clear(ogg_stream_state *os); +extern int ogg_stream_reset(ogg_stream_state *os); +extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno); +extern int ogg_stream_destroy(ogg_stream_state *os); +extern int ogg_stream_check(ogg_stream_state *os); +extern int ogg_stream_eos(ogg_stream_state *os); + +extern void ogg_page_checksum_set(ogg_page *og); + +extern int ogg_page_version(const ogg_page *og); +extern int ogg_page_continued(const ogg_page *og); +extern int ogg_page_bos(const ogg_page *og); +extern int ogg_page_eos(const ogg_page *og); +extern ogg_int64_t ogg_page_granulepos(const ogg_page *og); +extern int ogg_page_serialno(const ogg_page *og); +extern long ogg_page_pageno(const ogg_page *og); +extern int ogg_page_packets(const ogg_page *og); + +extern void ogg_packet_clear(ogg_packet *op); + + +#ifdef __cplusplus +} +#endif + +#endif /* _OGG_H */ diff --git a/Audio-Frameworks/bin/flac/headers/ogg/os_types.h b/Audio-Frameworks/bin/flac/headers/ogg/os_types.h new file mode 100644 index 0000000..d6691b7 --- /dev/null +++ b/Audio-Frameworks/bin/flac/headers/ogg/os_types.h @@ -0,0 +1,147 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: #ifdef jail to whip a few platforms into the UNIX ideal. + last mod: $Id: os_types.h 17712 2010-12-03 17:10:02Z xiphmont $ + + ********************************************************************/ +#ifndef _OS_TYPES_H +#define _OS_TYPES_H + +/* make it easy on the folks that want to compile the libs with a + different malloc than stdlib */ +#define _ogg_malloc malloc +#define _ogg_calloc calloc +#define _ogg_realloc realloc +#define _ogg_free free + +#if defined(_WIN32) + +# if defined(__CYGWIN__) +# include + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; + typedef uint32_t ogg_uint32_t; + typedef int64_t ogg_int64_t; + typedef uint64_t ogg_uint64_t; +# elif defined(__MINGW32__) +# include + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + typedef unsigned long long ogg_uint64_t; +# elif defined(__MWERKS__) + typedef long long ogg_int64_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; +# else + /* MSVC/Borland */ + typedef __int64 ogg_int64_t; + typedef __int32 ogg_int32_t; + typedef unsigned __int32 ogg_uint32_t; + typedef __int16 ogg_int16_t; + typedef unsigned __int16 ogg_uint16_t; +# endif + +#elif defined(__MACOS__) + +# include + typedef SInt16 ogg_int16_t; + typedef UInt16 ogg_uint16_t; + typedef SInt32 ogg_int32_t; + typedef UInt32 ogg_uint32_t; + typedef SInt64 ogg_int64_t; + +#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ + +# include + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; + typedef uint32_t ogg_uint32_t; + typedef int64_t ogg_int64_t; + +#elif defined(__HAIKU__) + + /* Haiku */ +# include + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + +#elif defined(__BEOS__) + + /* Be */ +# include + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; + typedef uint32_t ogg_uint32_t; + typedef int64_t ogg_int64_t; + +#elif defined (__EMX__) + + /* OS/2 GCC */ + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + +#elif defined (DJGPP) + + /* DJGPP */ + typedef short ogg_int16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + +#elif defined(R5900) + + /* PS2 EE */ + typedef long ogg_int64_t; + typedef int ogg_int32_t; + typedef unsigned ogg_uint32_t; + typedef short ogg_int16_t; + +#elif defined(__SYMBIAN32__) + + /* Symbian GCC */ + typedef signed short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef signed int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long int ogg_int64_t; + +#elif defined(__TMS320C6X__) + + /* TI C64x compiler */ + typedef signed short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef signed int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long int ogg_int64_t; + +#else + +# include + +#endif + +#endif /* _OS_TYPES_H */ diff --git a/Audio-Frameworks/bin/flac/libFLAC.a b/Audio-Frameworks/bin/flac/libFLAC.a new file mode 100644 index 0000000..e3ac321 Binary files /dev/null and b/Audio-Frameworks/bin/flac/libFLAC.a differ diff --git a/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Headers b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Ogg b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Ogg new file mode 120000 index 0000000..d6b4e13 --- /dev/null +++ b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Ogg @@ -0,0 +1 @@ +Versions/Current/Ogg \ No newline at end of file diff --git a/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Resources b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/A/Headers/ogg.h b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/A/Headers/ogg.h new file mode 100644 index 0000000..cea4ebe --- /dev/null +++ b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/A/Headers/ogg.h @@ -0,0 +1,210 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: toplevel libogg include + last mod: $Id: ogg.h 18044 2011-08-01 17:55:20Z gmaxwell $ + + ********************************************************************/ +#ifndef _OGG_H +#define _OGG_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +typedef struct { + void *iov_base; + size_t iov_len; +} ogg_iovec_t; + +typedef struct { + long endbyte; + int endbit; + + unsigned char *buffer; + unsigned char *ptr; + long storage; +} oggpack_buffer; + +/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/ + +typedef struct { + unsigned char *header; + long header_len; + unsigned char *body; + long body_len; +} ogg_page; + +/* ogg_stream_state contains the current encode/decode state of a logical + Ogg bitstream **********************************************************/ + +typedef struct { + unsigned char *body_data; /* bytes from packet bodies */ + long body_storage; /* storage elements allocated */ + long body_fill; /* elements stored; fill mark */ + long body_returned; /* elements of fill returned */ + + + int *lacing_vals; /* The values that will go to the segment table */ + ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact + this way, but it is simple coupled to the + lacing fifo */ + long lacing_storage; + long lacing_fill; + long lacing_packet; + long lacing_returned; + + unsigned char header[282]; /* working space for header encode */ + int header_fill; + + int e_o_s; /* set when we have buffered the last packet in the + logical bitstream */ + int b_o_s; /* set after we've written the initial page + of a logical bitstream */ + long serialno; + long pageno; + ogg_int64_t packetno; /* sequence number for decode; the framing + knows where there's a hole in the data, + but we need coupling so that the codec + (which is in a separate abstraction + layer) also knows about the gap */ + ogg_int64_t granulepos; + +} ogg_stream_state; + +/* ogg_packet is used to encapsulate the data and metadata belonging + to a single raw Ogg/Vorbis packet *************************************/ + +typedef struct { + unsigned char *packet; + long bytes; + long b_o_s; + long e_o_s; + + ogg_int64_t granulepos; + + ogg_int64_t packetno; /* sequence number for decode; the framing + knows where there's a hole in the data, + but we need coupling so that the codec + (which is in a separate abstraction + layer) also knows about the gap */ +} ogg_packet; + +typedef struct { + unsigned char *data; + int storage; + int fill; + int returned; + + int unsynced; + int headerbytes; + int bodybytes; +} ogg_sync_state; + +/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/ + +extern void oggpack_writeinit(oggpack_buffer *b); +extern int oggpack_writecheck(oggpack_buffer *b); +extern void oggpack_writetrunc(oggpack_buffer *b,long bits); +extern void oggpack_writealign(oggpack_buffer *b); +extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits); +extern void oggpack_reset(oggpack_buffer *b); +extern void oggpack_writeclear(oggpack_buffer *b); +extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); +extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits); +extern long oggpack_look(oggpack_buffer *b,int bits); +extern long oggpack_look1(oggpack_buffer *b); +extern void oggpack_adv(oggpack_buffer *b,int bits); +extern void oggpack_adv1(oggpack_buffer *b); +extern long oggpack_read(oggpack_buffer *b,int bits); +extern long oggpack_read1(oggpack_buffer *b); +extern long oggpack_bytes(oggpack_buffer *b); +extern long oggpack_bits(oggpack_buffer *b); +extern unsigned char *oggpack_get_buffer(oggpack_buffer *b); + +extern void oggpackB_writeinit(oggpack_buffer *b); +extern int oggpackB_writecheck(oggpack_buffer *b); +extern void oggpackB_writetrunc(oggpack_buffer *b,long bits); +extern void oggpackB_writealign(oggpack_buffer *b); +extern void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits); +extern void oggpackB_reset(oggpack_buffer *b); +extern void oggpackB_writeclear(oggpack_buffer *b); +extern void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); +extern void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits); +extern long oggpackB_look(oggpack_buffer *b,int bits); +extern long oggpackB_look1(oggpack_buffer *b); +extern void oggpackB_adv(oggpack_buffer *b,int bits); +extern void oggpackB_adv1(oggpack_buffer *b); +extern long oggpackB_read(oggpack_buffer *b,int bits); +extern long oggpackB_read1(oggpack_buffer *b); +extern long oggpackB_bytes(oggpack_buffer *b); +extern long oggpackB_bits(oggpack_buffer *b); +extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b); + +/* Ogg BITSTREAM PRIMITIVES: encoding **************************/ + +extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op); +extern int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov, + int count, long e_o_s, ogg_int64_t granulepos); +extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og); +extern int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill); +extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og); +extern int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill); + +/* Ogg BITSTREAM PRIMITIVES: decoding **************************/ + +extern int ogg_sync_init(ogg_sync_state *oy); +extern int ogg_sync_clear(ogg_sync_state *oy); +extern int ogg_sync_reset(ogg_sync_state *oy); +extern int ogg_sync_destroy(ogg_sync_state *oy); +extern int ogg_sync_check(ogg_sync_state *oy); + +extern char *ogg_sync_buffer(ogg_sync_state *oy, long size); +extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes); +extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og); +extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og); +extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og); +extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op); +extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op); + +/* Ogg BITSTREAM PRIMITIVES: general ***************************/ + +extern int ogg_stream_init(ogg_stream_state *os,int serialno); +extern int ogg_stream_clear(ogg_stream_state *os); +extern int ogg_stream_reset(ogg_stream_state *os); +extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno); +extern int ogg_stream_destroy(ogg_stream_state *os); +extern int ogg_stream_check(ogg_stream_state *os); +extern int ogg_stream_eos(ogg_stream_state *os); + +extern void ogg_page_checksum_set(ogg_page *og); + +extern int ogg_page_version(const ogg_page *og); +extern int ogg_page_continued(const ogg_page *og); +extern int ogg_page_bos(const ogg_page *og); +extern int ogg_page_eos(const ogg_page *og); +extern ogg_int64_t ogg_page_granulepos(const ogg_page *og); +extern int ogg_page_serialno(const ogg_page *og); +extern long ogg_page_pageno(const ogg_page *og); +extern int ogg_page_packets(const ogg_page *og); + +extern void ogg_packet_clear(ogg_packet *op); + + +#ifdef __cplusplus +} +#endif + +#endif /* _OGG_H */ diff --git a/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/A/Headers/os_types.h b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/A/Headers/os_types.h new file mode 100644 index 0000000..d6691b7 --- /dev/null +++ b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/A/Headers/os_types.h @@ -0,0 +1,147 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: #ifdef jail to whip a few platforms into the UNIX ideal. + last mod: $Id: os_types.h 17712 2010-12-03 17:10:02Z xiphmont $ + + ********************************************************************/ +#ifndef _OS_TYPES_H +#define _OS_TYPES_H + +/* make it easy on the folks that want to compile the libs with a + different malloc than stdlib */ +#define _ogg_malloc malloc +#define _ogg_calloc calloc +#define _ogg_realloc realloc +#define _ogg_free free + +#if defined(_WIN32) + +# if defined(__CYGWIN__) +# include + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; + typedef uint32_t ogg_uint32_t; + typedef int64_t ogg_int64_t; + typedef uint64_t ogg_uint64_t; +# elif defined(__MINGW32__) +# include + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + typedef unsigned long long ogg_uint64_t; +# elif defined(__MWERKS__) + typedef long long ogg_int64_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; +# else + /* MSVC/Borland */ + typedef __int64 ogg_int64_t; + typedef __int32 ogg_int32_t; + typedef unsigned __int32 ogg_uint32_t; + typedef __int16 ogg_int16_t; + typedef unsigned __int16 ogg_uint16_t; +# endif + +#elif defined(__MACOS__) + +# include + typedef SInt16 ogg_int16_t; + typedef UInt16 ogg_uint16_t; + typedef SInt32 ogg_int32_t; + typedef UInt32 ogg_uint32_t; + typedef SInt64 ogg_int64_t; + +#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ + +# include + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; + typedef uint32_t ogg_uint32_t; + typedef int64_t ogg_int64_t; + +#elif defined(__HAIKU__) + + /* Haiku */ +# include + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + +#elif defined(__BEOS__) + + /* Be */ +# include + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; + typedef uint32_t ogg_uint32_t; + typedef int64_t ogg_int64_t; + +#elif defined (__EMX__) + + /* OS/2 GCC */ + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + +#elif defined (DJGPP) + + /* DJGPP */ + typedef short ogg_int16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + +#elif defined(R5900) + + /* PS2 EE */ + typedef long ogg_int64_t; + typedef int ogg_int32_t; + typedef unsigned ogg_uint32_t; + typedef short ogg_int16_t; + +#elif defined(__SYMBIAN32__) + + /* Symbian GCC */ + typedef signed short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef signed int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long int ogg_int64_t; + +#elif defined(__TMS320C6X__) + + /* TI C64x compiler */ + typedef signed short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef signed int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long int ogg_int64_t; + +#else + +# include + +#endif + +#endif /* _OS_TYPES_H */ diff --git a/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/A/Ogg b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/A/Ogg new file mode 100755 index 0000000..736bc97 Binary files /dev/null and b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/A/Ogg differ diff --git a/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/A/Resources/Info.plist b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..80c6cb6 --- /dev/null +++ b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,42 @@ + + + + + BuildMachineOSBuild + 12F37 + CFBundleDevelopmentRegion + English + CFBundleExecutable + Ogg + CFBundleIdentifier + com.ap4y.Ogg + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Ogg + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 5A1413 + DTPlatformVersion + GM + DTSDKBuild + 12D75 + DTSDKName + macosx10.8 + DTXcode + 0500 + DTXcodeBuild + 5A1413 + NSHumanReadableCopyright + Copyright © 2013 Arthur Evstifeev. All rights reserved. + + diff --git a/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/Current b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Audio-Frameworks/bin/ogg/MacOS/Ogg.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Audio-Frameworks/bin/ogg/Ogg.framework/Headers b/Audio-Frameworks/bin/ogg/Ogg.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Audio-Frameworks/bin/ogg/Ogg.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Audio-Frameworks/bin/ogg/Ogg.framework/Ogg b/Audio-Frameworks/bin/ogg/Ogg.framework/Ogg new file mode 120000 index 0000000..d6b4e13 --- /dev/null +++ b/Audio-Frameworks/bin/ogg/Ogg.framework/Ogg @@ -0,0 +1 @@ +Versions/Current/Ogg \ No newline at end of file diff --git a/Audio-Frameworks/bin/ogg/Ogg.framework/Resources b/Audio-Frameworks/bin/ogg/Ogg.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/Audio-Frameworks/bin/ogg/Ogg.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/A/Headers/ogg.h b/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/A/Headers/ogg.h new file mode 100644 index 0000000..cea4ebe --- /dev/null +++ b/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/A/Headers/ogg.h @@ -0,0 +1,210 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: toplevel libogg include + last mod: $Id: ogg.h 18044 2011-08-01 17:55:20Z gmaxwell $ + + ********************************************************************/ +#ifndef _OGG_H +#define _OGG_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +typedef struct { + void *iov_base; + size_t iov_len; +} ogg_iovec_t; + +typedef struct { + long endbyte; + int endbit; + + unsigned char *buffer; + unsigned char *ptr; + long storage; +} oggpack_buffer; + +/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/ + +typedef struct { + unsigned char *header; + long header_len; + unsigned char *body; + long body_len; +} ogg_page; + +/* ogg_stream_state contains the current encode/decode state of a logical + Ogg bitstream **********************************************************/ + +typedef struct { + unsigned char *body_data; /* bytes from packet bodies */ + long body_storage; /* storage elements allocated */ + long body_fill; /* elements stored; fill mark */ + long body_returned; /* elements of fill returned */ + + + int *lacing_vals; /* The values that will go to the segment table */ + ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact + this way, but it is simple coupled to the + lacing fifo */ + long lacing_storage; + long lacing_fill; + long lacing_packet; + long lacing_returned; + + unsigned char header[282]; /* working space for header encode */ + int header_fill; + + int e_o_s; /* set when we have buffered the last packet in the + logical bitstream */ + int b_o_s; /* set after we've written the initial page + of a logical bitstream */ + long serialno; + long pageno; + ogg_int64_t packetno; /* sequence number for decode; the framing + knows where there's a hole in the data, + but we need coupling so that the codec + (which is in a separate abstraction + layer) also knows about the gap */ + ogg_int64_t granulepos; + +} ogg_stream_state; + +/* ogg_packet is used to encapsulate the data and metadata belonging + to a single raw Ogg/Vorbis packet *************************************/ + +typedef struct { + unsigned char *packet; + long bytes; + long b_o_s; + long e_o_s; + + ogg_int64_t granulepos; + + ogg_int64_t packetno; /* sequence number for decode; the framing + knows where there's a hole in the data, + but we need coupling so that the codec + (which is in a separate abstraction + layer) also knows about the gap */ +} ogg_packet; + +typedef struct { + unsigned char *data; + int storage; + int fill; + int returned; + + int unsynced; + int headerbytes; + int bodybytes; +} ogg_sync_state; + +/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/ + +extern void oggpack_writeinit(oggpack_buffer *b); +extern int oggpack_writecheck(oggpack_buffer *b); +extern void oggpack_writetrunc(oggpack_buffer *b,long bits); +extern void oggpack_writealign(oggpack_buffer *b); +extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits); +extern void oggpack_reset(oggpack_buffer *b); +extern void oggpack_writeclear(oggpack_buffer *b); +extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); +extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits); +extern long oggpack_look(oggpack_buffer *b,int bits); +extern long oggpack_look1(oggpack_buffer *b); +extern void oggpack_adv(oggpack_buffer *b,int bits); +extern void oggpack_adv1(oggpack_buffer *b); +extern long oggpack_read(oggpack_buffer *b,int bits); +extern long oggpack_read1(oggpack_buffer *b); +extern long oggpack_bytes(oggpack_buffer *b); +extern long oggpack_bits(oggpack_buffer *b); +extern unsigned char *oggpack_get_buffer(oggpack_buffer *b); + +extern void oggpackB_writeinit(oggpack_buffer *b); +extern int oggpackB_writecheck(oggpack_buffer *b); +extern void oggpackB_writetrunc(oggpack_buffer *b,long bits); +extern void oggpackB_writealign(oggpack_buffer *b); +extern void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits); +extern void oggpackB_reset(oggpack_buffer *b); +extern void oggpackB_writeclear(oggpack_buffer *b); +extern void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); +extern void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits); +extern long oggpackB_look(oggpack_buffer *b,int bits); +extern long oggpackB_look1(oggpack_buffer *b); +extern void oggpackB_adv(oggpack_buffer *b,int bits); +extern void oggpackB_adv1(oggpack_buffer *b); +extern long oggpackB_read(oggpack_buffer *b,int bits); +extern long oggpackB_read1(oggpack_buffer *b); +extern long oggpackB_bytes(oggpack_buffer *b); +extern long oggpackB_bits(oggpack_buffer *b); +extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b); + +/* Ogg BITSTREAM PRIMITIVES: encoding **************************/ + +extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op); +extern int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov, + int count, long e_o_s, ogg_int64_t granulepos); +extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og); +extern int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill); +extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og); +extern int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill); + +/* Ogg BITSTREAM PRIMITIVES: decoding **************************/ + +extern int ogg_sync_init(ogg_sync_state *oy); +extern int ogg_sync_clear(ogg_sync_state *oy); +extern int ogg_sync_reset(ogg_sync_state *oy); +extern int ogg_sync_destroy(ogg_sync_state *oy); +extern int ogg_sync_check(ogg_sync_state *oy); + +extern char *ogg_sync_buffer(ogg_sync_state *oy, long size); +extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes); +extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og); +extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og); +extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og); +extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op); +extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op); + +/* Ogg BITSTREAM PRIMITIVES: general ***************************/ + +extern int ogg_stream_init(ogg_stream_state *os,int serialno); +extern int ogg_stream_clear(ogg_stream_state *os); +extern int ogg_stream_reset(ogg_stream_state *os); +extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno); +extern int ogg_stream_destroy(ogg_stream_state *os); +extern int ogg_stream_check(ogg_stream_state *os); +extern int ogg_stream_eos(ogg_stream_state *os); + +extern void ogg_page_checksum_set(ogg_page *og); + +extern int ogg_page_version(const ogg_page *og); +extern int ogg_page_continued(const ogg_page *og); +extern int ogg_page_bos(const ogg_page *og); +extern int ogg_page_eos(const ogg_page *og); +extern ogg_int64_t ogg_page_granulepos(const ogg_page *og); +extern int ogg_page_serialno(const ogg_page *og); +extern long ogg_page_pageno(const ogg_page *og); +extern int ogg_page_packets(const ogg_page *og); + +extern void ogg_packet_clear(ogg_packet *op); + + +#ifdef __cplusplus +} +#endif + +#endif /* _OGG_H */ diff --git a/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/A/Headers/os_types.h b/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/A/Headers/os_types.h new file mode 100644 index 0000000..d6691b7 --- /dev/null +++ b/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/A/Headers/os_types.h @@ -0,0 +1,147 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: #ifdef jail to whip a few platforms into the UNIX ideal. + last mod: $Id: os_types.h 17712 2010-12-03 17:10:02Z xiphmont $ + + ********************************************************************/ +#ifndef _OS_TYPES_H +#define _OS_TYPES_H + +/* make it easy on the folks that want to compile the libs with a + different malloc than stdlib */ +#define _ogg_malloc malloc +#define _ogg_calloc calloc +#define _ogg_realloc realloc +#define _ogg_free free + +#if defined(_WIN32) + +# if defined(__CYGWIN__) +# include + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; + typedef uint32_t ogg_uint32_t; + typedef int64_t ogg_int64_t; + typedef uint64_t ogg_uint64_t; +# elif defined(__MINGW32__) +# include + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + typedef unsigned long long ogg_uint64_t; +# elif defined(__MWERKS__) + typedef long long ogg_int64_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; +# else + /* MSVC/Borland */ + typedef __int64 ogg_int64_t; + typedef __int32 ogg_int32_t; + typedef unsigned __int32 ogg_uint32_t; + typedef __int16 ogg_int16_t; + typedef unsigned __int16 ogg_uint16_t; +# endif + +#elif defined(__MACOS__) + +# include + typedef SInt16 ogg_int16_t; + typedef UInt16 ogg_uint16_t; + typedef SInt32 ogg_int32_t; + typedef UInt32 ogg_uint32_t; + typedef SInt64 ogg_int64_t; + +#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ + +# include + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; + typedef uint32_t ogg_uint32_t; + typedef int64_t ogg_int64_t; + +#elif defined(__HAIKU__) + + /* Haiku */ +# include + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + +#elif defined(__BEOS__) + + /* Be */ +# include + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; + typedef uint32_t ogg_uint32_t; + typedef int64_t ogg_int64_t; + +#elif defined (__EMX__) + + /* OS/2 GCC */ + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + +#elif defined (DJGPP) + + /* DJGPP */ + typedef short ogg_int16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + +#elif defined(R5900) + + /* PS2 EE */ + typedef long ogg_int64_t; + typedef int ogg_int32_t; + typedef unsigned ogg_uint32_t; + typedef short ogg_int16_t; + +#elif defined(__SYMBIAN32__) + + /* Symbian GCC */ + typedef signed short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef signed int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long int ogg_int64_t; + +#elif defined(__TMS320C6X__) + + /* TI C64x compiler */ + typedef signed short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef signed int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long int ogg_int64_t; + +#else + +# include + +#endif + +#endif /* _OS_TYPES_H */ diff --git a/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/A/Ogg b/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/A/Ogg new file mode 100644 index 0000000..2014a01 Binary files /dev/null and b/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/A/Ogg differ diff --git a/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/A/Resources/Info.plist b/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..3bbdc9c Binary files /dev/null and b/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/A/Resources/Info.plist differ diff --git a/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/Current b/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Audio-Frameworks/bin/ogg/Ogg.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Audio-Frameworks/bin/ogg/include/ogg/ogg.h b/Audio-Frameworks/bin/ogg/include/ogg/ogg.h new file mode 100644 index 0000000..cea4ebe --- /dev/null +++ b/Audio-Frameworks/bin/ogg/include/ogg/ogg.h @@ -0,0 +1,210 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: toplevel libogg include + last mod: $Id: ogg.h 18044 2011-08-01 17:55:20Z gmaxwell $ + + ********************************************************************/ +#ifndef _OGG_H +#define _OGG_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +typedef struct { + void *iov_base; + size_t iov_len; +} ogg_iovec_t; + +typedef struct { + long endbyte; + int endbit; + + unsigned char *buffer; + unsigned char *ptr; + long storage; +} oggpack_buffer; + +/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/ + +typedef struct { + unsigned char *header; + long header_len; + unsigned char *body; + long body_len; +} ogg_page; + +/* ogg_stream_state contains the current encode/decode state of a logical + Ogg bitstream **********************************************************/ + +typedef struct { + unsigned char *body_data; /* bytes from packet bodies */ + long body_storage; /* storage elements allocated */ + long body_fill; /* elements stored; fill mark */ + long body_returned; /* elements of fill returned */ + + + int *lacing_vals; /* The values that will go to the segment table */ + ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact + this way, but it is simple coupled to the + lacing fifo */ + long lacing_storage; + long lacing_fill; + long lacing_packet; + long lacing_returned; + + unsigned char header[282]; /* working space for header encode */ + int header_fill; + + int e_o_s; /* set when we have buffered the last packet in the + logical bitstream */ + int b_o_s; /* set after we've written the initial page + of a logical bitstream */ + long serialno; + long pageno; + ogg_int64_t packetno; /* sequence number for decode; the framing + knows where there's a hole in the data, + but we need coupling so that the codec + (which is in a separate abstraction + layer) also knows about the gap */ + ogg_int64_t granulepos; + +} ogg_stream_state; + +/* ogg_packet is used to encapsulate the data and metadata belonging + to a single raw Ogg/Vorbis packet *************************************/ + +typedef struct { + unsigned char *packet; + long bytes; + long b_o_s; + long e_o_s; + + ogg_int64_t granulepos; + + ogg_int64_t packetno; /* sequence number for decode; the framing + knows where there's a hole in the data, + but we need coupling so that the codec + (which is in a separate abstraction + layer) also knows about the gap */ +} ogg_packet; + +typedef struct { + unsigned char *data; + int storage; + int fill; + int returned; + + int unsynced; + int headerbytes; + int bodybytes; +} ogg_sync_state; + +/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/ + +extern void oggpack_writeinit(oggpack_buffer *b); +extern int oggpack_writecheck(oggpack_buffer *b); +extern void oggpack_writetrunc(oggpack_buffer *b,long bits); +extern void oggpack_writealign(oggpack_buffer *b); +extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits); +extern void oggpack_reset(oggpack_buffer *b); +extern void oggpack_writeclear(oggpack_buffer *b); +extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); +extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits); +extern long oggpack_look(oggpack_buffer *b,int bits); +extern long oggpack_look1(oggpack_buffer *b); +extern void oggpack_adv(oggpack_buffer *b,int bits); +extern void oggpack_adv1(oggpack_buffer *b); +extern long oggpack_read(oggpack_buffer *b,int bits); +extern long oggpack_read1(oggpack_buffer *b); +extern long oggpack_bytes(oggpack_buffer *b); +extern long oggpack_bits(oggpack_buffer *b); +extern unsigned char *oggpack_get_buffer(oggpack_buffer *b); + +extern void oggpackB_writeinit(oggpack_buffer *b); +extern int oggpackB_writecheck(oggpack_buffer *b); +extern void oggpackB_writetrunc(oggpack_buffer *b,long bits); +extern void oggpackB_writealign(oggpack_buffer *b); +extern void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits); +extern void oggpackB_reset(oggpack_buffer *b); +extern void oggpackB_writeclear(oggpack_buffer *b); +extern void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); +extern void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits); +extern long oggpackB_look(oggpack_buffer *b,int bits); +extern long oggpackB_look1(oggpack_buffer *b); +extern void oggpackB_adv(oggpack_buffer *b,int bits); +extern void oggpackB_adv1(oggpack_buffer *b); +extern long oggpackB_read(oggpack_buffer *b,int bits); +extern long oggpackB_read1(oggpack_buffer *b); +extern long oggpackB_bytes(oggpack_buffer *b); +extern long oggpackB_bits(oggpack_buffer *b); +extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b); + +/* Ogg BITSTREAM PRIMITIVES: encoding **************************/ + +extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op); +extern int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov, + int count, long e_o_s, ogg_int64_t granulepos); +extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og); +extern int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill); +extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og); +extern int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill); + +/* Ogg BITSTREAM PRIMITIVES: decoding **************************/ + +extern int ogg_sync_init(ogg_sync_state *oy); +extern int ogg_sync_clear(ogg_sync_state *oy); +extern int ogg_sync_reset(ogg_sync_state *oy); +extern int ogg_sync_destroy(ogg_sync_state *oy); +extern int ogg_sync_check(ogg_sync_state *oy); + +extern char *ogg_sync_buffer(ogg_sync_state *oy, long size); +extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes); +extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og); +extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og); +extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og); +extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op); +extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op); + +/* Ogg BITSTREAM PRIMITIVES: general ***************************/ + +extern int ogg_stream_init(ogg_stream_state *os,int serialno); +extern int ogg_stream_clear(ogg_stream_state *os); +extern int ogg_stream_reset(ogg_stream_state *os); +extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno); +extern int ogg_stream_destroy(ogg_stream_state *os); +extern int ogg_stream_check(ogg_stream_state *os); +extern int ogg_stream_eos(ogg_stream_state *os); + +extern void ogg_page_checksum_set(ogg_page *og); + +extern int ogg_page_version(const ogg_page *og); +extern int ogg_page_continued(const ogg_page *og); +extern int ogg_page_bos(const ogg_page *og); +extern int ogg_page_eos(const ogg_page *og); +extern ogg_int64_t ogg_page_granulepos(const ogg_page *og); +extern int ogg_page_serialno(const ogg_page *og); +extern long ogg_page_pageno(const ogg_page *og); +extern int ogg_page_packets(const ogg_page *og); + +extern void ogg_packet_clear(ogg_packet *op); + + +#ifdef __cplusplus +} +#endif + +#endif /* _OGG_H */ diff --git a/Audio-Frameworks/bin/ogg/include/ogg/os_types.h b/Audio-Frameworks/bin/ogg/include/ogg/os_types.h new file mode 100644 index 0000000..d6691b7 --- /dev/null +++ b/Audio-Frameworks/bin/ogg/include/ogg/os_types.h @@ -0,0 +1,147 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: #ifdef jail to whip a few platforms into the UNIX ideal. + last mod: $Id: os_types.h 17712 2010-12-03 17:10:02Z xiphmont $ + + ********************************************************************/ +#ifndef _OS_TYPES_H +#define _OS_TYPES_H + +/* make it easy on the folks that want to compile the libs with a + different malloc than stdlib */ +#define _ogg_malloc malloc +#define _ogg_calloc calloc +#define _ogg_realloc realloc +#define _ogg_free free + +#if defined(_WIN32) + +# if defined(__CYGWIN__) +# include + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; + typedef uint32_t ogg_uint32_t; + typedef int64_t ogg_int64_t; + typedef uint64_t ogg_uint64_t; +# elif defined(__MINGW32__) +# include + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + typedef unsigned long long ogg_uint64_t; +# elif defined(__MWERKS__) + typedef long long ogg_int64_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; +# else + /* MSVC/Borland */ + typedef __int64 ogg_int64_t; + typedef __int32 ogg_int32_t; + typedef unsigned __int32 ogg_uint32_t; + typedef __int16 ogg_int16_t; + typedef unsigned __int16 ogg_uint16_t; +# endif + +#elif defined(__MACOS__) + +# include + typedef SInt16 ogg_int16_t; + typedef UInt16 ogg_uint16_t; + typedef SInt32 ogg_int32_t; + typedef UInt32 ogg_uint32_t; + typedef SInt64 ogg_int64_t; + +#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ + +# include + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; + typedef uint32_t ogg_uint32_t; + typedef int64_t ogg_int64_t; + +#elif defined(__HAIKU__) + + /* Haiku */ +# include + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + +#elif defined(__BEOS__) + + /* Be */ +# include + typedef int16_t ogg_int16_t; + typedef uint16_t ogg_uint16_t; + typedef int32_t ogg_int32_t; + typedef uint32_t ogg_uint32_t; + typedef int64_t ogg_int64_t; + +#elif defined (__EMX__) + + /* OS/2 GCC */ + typedef short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + +#elif defined (DJGPP) + + /* DJGPP */ + typedef short ogg_int16_t; + typedef int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long ogg_int64_t; + +#elif defined(R5900) + + /* PS2 EE */ + typedef long ogg_int64_t; + typedef int ogg_int32_t; + typedef unsigned ogg_uint32_t; + typedef short ogg_int16_t; + +#elif defined(__SYMBIAN32__) + + /* Symbian GCC */ + typedef signed short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef signed int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long int ogg_int64_t; + +#elif defined(__TMS320C6X__) + + /* TI C64x compiler */ + typedef signed short ogg_int16_t; + typedef unsigned short ogg_uint16_t; + typedef signed int ogg_int32_t; + typedef unsigned int ogg_uint32_t; + typedef long long int ogg_int64_t; + +#else + +# include + +#endif + +#endif /* _OS_TYPES_H */ diff --git a/Audio-Frameworks/bin/ogg/libogg.a b/Audio-Frameworks/bin/ogg/libogg.a new file mode 100644 index 0000000..d1ce8e7 Binary files /dev/null and b/Audio-Frameworks/bin/ogg/libogg.a differ diff --git a/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Headers b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Opus b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Opus new file mode 120000 index 0000000..e38fe46 --- /dev/null +++ b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Opus @@ -0,0 +1 @@ +Versions/Current/Opus \ No newline at end of file diff --git a/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Resources b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Headers/opus.h b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Headers/opus.h new file mode 100644 index 0000000..ce86038 --- /dev/null +++ b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Headers/opus.h @@ -0,0 +1,906 @@ +/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited + Written by Jean-Marc Valin and Koen Vos */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @file opus.h + * @brief Opus reference implementation API + */ + +#ifndef OPUS_H +#define OPUS_H + +#include "opus_types.h" +#include "opus_defines.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @mainpage Opus + * + * The Opus codec is designed for interactive speech and audio transmission over the Internet. + * It is designed by the IETF Codec Working Group and incorporates technology from + * Skype's SILK codec and Xiph.Org's CELT codec. + * + * The Opus codec is designed to handle a wide range of interactive audio applications, + * including Voice over IP, videoconferencing, in-game chat, and even remote live music + * performances. It can scale from low bit-rate narrowband speech to very high quality + * stereo music. Its main features are: + + * @li Sampling rates from 8 to 48 kHz + * @li Bit-rates from 6 kb/s to 510 kb/s + * @li Support for both constant bit-rate (CBR) and variable bit-rate (VBR) + * @li Audio bandwidth from narrowband to full-band + * @li Support for speech and music + * @li Support for mono and stereo + * @li Support for multichannel (up to 255 channels) + * @li Frame sizes from 2.5 ms to 60 ms + * @li Good loss robustness and packet loss concealment (PLC) + * @li Floating point and fixed-point implementation + * + * Documentation sections: + * @li @ref opus_encoder + * @li @ref opus_decoder + * @li @ref opus_repacketizer + * @li @ref opus_multistream + * @li @ref opus_libinfo + * @li @ref opus_custom + */ + +/** @defgroup opus_encoder Opus Encoder + * @{ + * + * @brief This page describes the process and functions used to encode Opus. + * + * Since Opus is a stateful codec, the encoding process starts with creating an encoder + * state. This can be done with: + * + * @code + * int error; + * OpusEncoder *enc; + * enc = opus_encoder_create(Fs, channels, application, &error); + * @endcode + * + * From this point, @c enc can be used for encoding an audio stream. An encoder state + * @b must @b not be used for more than one stream at the same time. Similarly, the encoder + * state @b must @b not be re-initialized for each frame. + * + * While opus_encoder_create() allocates memory for the state, it's also possible + * to initialize pre-allocated memory: + * + * @code + * int size; + * int error; + * OpusEncoder *enc; + * size = opus_encoder_get_size(channels); + * enc = malloc(size); + * error = opus_encoder_init(enc, Fs, channels, application); + * @endcode + * + * where opus_encoder_get_size() returns the required size for the encoder state. Note that + * future versions of this code may change the size, so no assuptions should be made about it. + * + * The encoder state is always continuous in memory and only a shallow copy is sufficient + * to copy it (e.g. memcpy()) + * + * It is possible to change some of the encoder's settings using the opus_encoder_ctl() + * interface. All these settings already default to the recommended value, so they should + * only be changed when necessary. The most common settings one may want to change are: + * + * @code + * opus_encoder_ctl(enc, OPUS_SET_BITRATE(bitrate)); + * opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(complexity)); + * opus_encoder_ctl(enc, OPUS_SET_SIGNAL(signal_type)); + * @endcode + * + * where + * + * @arg bitrate is in bits per second (b/s) + * @arg complexity is a value from 1 to 10, where 1 is the lowest complexity and 10 is the highest + * @arg signal_type is either OPUS_AUTO (default), OPUS_SIGNAL_VOICE, or OPUS_SIGNAL_MUSIC + * + * See @ref opus_encoderctls and @ref opus_genericctls for a complete list of parameters that can be set or queried. Most parameters can be set or changed at any time during a stream. + * + * To encode a frame, opus_encode() or opus_encode_float() must be called with exactly one frame (2.5, 5, 10, 20, 40 or 60 ms) of audio data: + * @code + * len = opus_encode(enc, audio_frame, frame_size, packet, max_packet); + * @endcode + * + * where + *
    + *
  • audio_frame is the audio data in opus_int16 (or float for opus_encode_float())
  • + *
  • frame_size is the duration of the frame in samples (per channel)
  • + *
  • packet is the byte array to which the compressed data is written
  • + *
  • max_packet is the maximum number of bytes that can be written in the packet (4000 bytes is recommended). + * Do not use max_packet to control VBR target bitrate, instead use the #OPUS_SET_BITRATE CTL.
  • + *
+ * + * opus_encode() and opus_encode_float() return the number of bytes actually written to the packet. + * The return value can be negative, which indicates that an error has occurred. If the return value + * is 1 byte, then the packet does not need to be transmitted (DTX). + * + * Once the encoder state if no longer needed, it can be destroyed with + * + * @code + * opus_encoder_destroy(enc); + * @endcode + * + * If the encoder was created with opus_encoder_init() rather than opus_encoder_create(), + * then no action is required aside from potentially freeing the memory that was manually + * allocated for it (calling free(enc) for the example above) + * + */ + +/** Opus encoder state. + * This contains the complete state of an Opus encoder. + * It is position independent and can be freely copied. + * @see opus_encoder_create,opus_encoder_init + */ +typedef struct OpusEncoder OpusEncoder; + +/** Gets the size of an OpusEncoder structure. + * @param[in] channels int: Number of channels. + * This must be 1 or 2. + * @returns The size in bytes. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_encoder_get_size(int channels); + +/** + */ + +/** Allocates and initializes an encoder state. + * There are three coding modes: + * + * @ref OPUS_APPLICATION_VOIP gives best quality at a given bitrate for voice + * signals. It enhances the input signal by high-pass filtering and + * emphasizing formants and harmonics. Optionally it includes in-band + * forward error correction to protect against packet loss. Use this + * mode for typical VoIP applications. Because of the enhancement, + * even at high bitrates the output may sound different from the input. + * + * @ref OPUS_APPLICATION_AUDIO gives best quality at a given bitrate for most + * non-voice signals like music. Use this mode for music and mixed + * (music/voice) content, broadcast, and applications requiring less + * than 15 ms of coding delay. + * + * @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY configures low-delay mode that + * disables the speech-optimized mode in exchange for slightly reduced delay. + * This mode can only be set on an newly initialized or freshly reset encoder + * because it changes the codec delay. + * + * This is useful when the caller knows that the speech-optimized modes will not be needed (use with caution). + * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param [in] channels int: Number of channels (1 or 2) in input signal + * @param [in] application int: Coding mode (@ref OPUS_APPLICATION_VOIP/@ref OPUS_APPLICATION_AUDIO/@ref OPUS_APPLICATION_RESTRICTED_LOWDELAY) + * @param [out] error int*: @ref opus_errorcodes + * @note Regardless of the sampling rate and number channels selected, the Opus encoder + * can switch to a lower audio bandwidth or number of channels if the bitrate + * selected is too low. This also means that it is safe to always use 48 kHz stereo input + * and let the encoder optimize the encoding. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusEncoder *opus_encoder_create( + opus_int32 Fs, + int channels, + int application, + int *error +); + +/** Initializes a previously allocated encoder state + * The memory pointed to by st must be at least the size returned by opus_encoder_get_size(). + * This is intended for applications which use their own allocator instead of malloc. + * @see opus_encoder_create(),opus_encoder_get_size() + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @param [in] st OpusEncoder*: Encoder state + * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param [in] channels int: Number of channels (1 or 2) in input signal + * @param [in] application int: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY) + * @retval #OPUS_OK Success or @ref opus_errorcodes + */ +OPUS_EXPORT int opus_encoder_init( + OpusEncoder *st, + opus_int32 Fs, + int channels, + int application +) OPUS_ARG_NONNULL(1); + +/** Encodes an Opus frame. + * @param [in] st OpusEncoder*: Encoder state + * @param [in] pcm opus_int16*: Input signal (interleaved if 2 channels). length is frame_size*channels*sizeof(opus_int16) + * @param [in] frame_size int: Number of samples per channel in the + * input signal. + * This must be an Opus frame size for + * the encoder's sampling rate. + * For example, at 48 kHz the permitted + * values are 120, 240, 480, 960, 1920, + * and 2880. + * Passing in a duration of less than + * 10 ms (480 samples at 48 kHz) will + * prevent the encoder from using the LPC + * or hybrid modes. + * @param [out] data unsigned char*: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes opus_int32: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode( + OpusEncoder *st, + const opus_int16 *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + +/** Encodes an Opus frame from floating point input. + * @param [in] st OpusEncoder*: Encoder state + * @param [in] pcm float*: Input in float format (interleaved if 2 channels), with a normal range of +/-1.0. + * Samples with a range beyond +/-1.0 are supported but will + * be clipped by decoders using the integer API and should + * only be used if it is known that the far end supports + * extended dynamic range. + * length is frame_size*channels*sizeof(float) + * @param [in] frame_size int: Number of samples per channel in the + * input signal. + * This must be an Opus frame size for + * the encoder's sampling rate. + * For example, at 48 kHz the permitted + * values are 120, 240, 480, 960, 1920, + * and 2880. + * Passing in a duration of less than + * 10 ms (480 samples at 48 kHz) will + * prevent the encoder from using the LPC + * or hybrid modes. + * @param [out] data unsigned char*: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes opus_int32: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode_float( + OpusEncoder *st, + const float *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + +/** Frees an OpusEncoder allocated by opus_encoder_create(). + * @param[in] st OpusEncoder*: State to be freed. + */ +OPUS_EXPORT void opus_encoder_destroy(OpusEncoder *st); + +/** Perform a CTL function on an Opus encoder. + * + * Generally the request and subsequent arguments are generated + * by a convenience macro. + * @param st OpusEncoder*: Encoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls or + * @ref opus_encoderctls. + * @see opus_genericctls + * @see opus_encoderctls + */ +OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); +/**@}*/ + +/** @defgroup opus_decoder Opus Decoder + * @{ + * + * @brief This page describes the process and functions used to decode Opus. + * + * The decoding process also starts with creating a decoder + * state. This can be done with: + * @code + * int error; + * OpusDecoder *dec; + * dec = opus_decoder_create(Fs, channels, &error); + * @endcode + * where + * @li Fs is the sampling rate and must be 8000, 12000, 16000, 24000, or 48000 + * @li channels is the number of channels (1 or 2) + * @li error will hold the error code in case of failure (or #OPUS_OK on success) + * @li the return value is a newly created decoder state to be used for decoding + * + * While opus_decoder_create() allocates memory for the state, it's also possible + * to initialize pre-allocated memory: + * @code + * int size; + * int error; + * OpusDecoder *dec; + * size = opus_decoder_get_size(channels); + * dec = malloc(size); + * error = opus_decoder_init(dec, Fs, channels); + * @endcode + * where opus_decoder_get_size() returns the required size for the decoder state. Note that + * future versions of this code may change the size, so no assuptions should be made about it. + * + * The decoder state is always continuous in memory and only a shallow copy is sufficient + * to copy it (e.g. memcpy()) + * + * To decode a frame, opus_decode() or opus_decode_float() must be called with a packet of compressed audio data: + * @code + * frame_size = opus_decode(dec, packet, len, decoded, max_size, 0); + * @endcode + * where + * + * @li packet is the byte array containing the compressed data + * @li len is the exact number of bytes contained in the packet + * @li decoded is the decoded audio data in opus_int16 (or float for opus_decode_float()) + * @li max_size is the max duration of the frame in samples (per channel) that can fit into the decoded_frame array + * + * opus_decode() and opus_decode_float() return the number of samples (per channel) decoded from the packet. + * If that value is negative, then an error has occurred. This can occur if the packet is corrupted or if the audio + * buffer is too small to hold the decoded audio. + * + * Opus is a stateful codec with overlapping blocks and as a result Opus + * packets are not coded independently of each other. Packets must be + * passed into the decoder serially and in the correct order for a correct + * decode. Lost packets can be replaced with loss concealment by calling + * the decoder with a null pointer and zero length for the missing packet. + * + * A single codec state may only be accessed from a single thread at + * a time and any required locking must be performed by the caller. Separate + * streams must be decoded with separate decoder states and can be decoded + * in parallel unless the library was compiled with NONTHREADSAFE_PSEUDOSTACK + * defined. + * + */ + +/** Opus decoder state. + * This contains the complete state of an Opus decoder. + * It is position independent and can be freely copied. + * @see opus_decoder_create,opus_decoder_init + */ +typedef struct OpusDecoder OpusDecoder; + +/** Gets the size of an OpusDecoder structure. + * @param [in] channels int: Number of channels. + * This must be 1 or 2. + * @returns The size in bytes. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_size(int channels); + +/** Allocates and initializes a decoder state. + * @param [in] Fs opus_int32: Sample rate to decode at (Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param [in] channels int: Number of channels (1 or 2) to decode + * @param [out] error int*: #OPUS_OK Success or @ref opus_errorcodes + * + * Internally Opus stores data at 48000 Hz, so that should be the default + * value for Fs. However, the decoder can efficiently decode to buffers + * at 8, 12, 16, and 24 kHz so if for some reason the caller cannot use + * data at the full sample rate, or knows the compressed data doesn't + * use the full frequency range, it can request decoding at a reduced + * rate. Likewise, the decoder is capable of filling in either mono or + * interleaved stereo pcm buffers, at the caller's request. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusDecoder *opus_decoder_create( + opus_int32 Fs, + int channels, + int *error +); + +/** Initializes a previously allocated decoder state. + * The state must be at least the size returned by opus_decoder_get_size(). + * This is intended for applications which use their own allocator instead of malloc. @see opus_decoder_create,opus_decoder_get_size + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @param [in] st OpusDecoder*: Decoder state. + * @param [in] Fs opus_int32: Sampling rate to decode to (Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param [in] channels int: Number of channels (1 or 2) to decode + * @retval #OPUS_OK Success or @ref opus_errorcodes + */ +OPUS_EXPORT int opus_decoder_init( + OpusDecoder *st, + opus_int32 Fs, + int channels +) OPUS_ARG_NONNULL(1); + +/** Decode an Opus packet. + * @param [in] st OpusDecoder*: Decoder state + * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss + * @param [in] len opus_int32: Number of bytes in payload* + * @param [out] pcm opus_int16*: Output signal (interleaved if 2 channels). length + * is frame_size*channels*sizeof(opus_int16) + * @param [in] frame_size Number of samples per channel of available space in \a pcm. + * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will + * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), + * then frame_size needs to be exactly the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and + * FEC cases, frame_size must be a multiple of 2.5 ms. + * @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be + * decoded. If no such data is available, the frame is decoded as if it were lost. + * @returns Number of decoded samples or @ref opus_errorcodes + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode( + OpusDecoder *st, + const unsigned char *data, + opus_int32 len, + opus_int16 *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Decode an Opus packet with floating point output. + * @param [in] st OpusDecoder*: Decoder state + * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss + * @param [in] len opus_int32: Number of bytes in payload + * @param [out] pcm float*: Output signal (interleaved if 2 channels). length + * is frame_size*channels*sizeof(float) + * @param [in] frame_size Number of samples per channel of available space in \a pcm. + * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will + * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), + * then frame_size needs to be exactly the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and + * FEC cases, frame_size must be a multiple of 2.5 ms. + * @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be + * decoded. If no such data is available the frame is decoded as if it were lost. + * @returns Number of decoded samples or @ref opus_errorcodes + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode_float( + OpusDecoder *st, + const unsigned char *data, + opus_int32 len, + float *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Perform a CTL function on an Opus decoder. + * + * Generally the request and subsequent arguments are generated + * by a convenience macro. + * @param st OpusDecoder*: Decoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls or + * @ref opus_decoderctls. + * @see opus_genericctls + * @see opus_decoderctls + */ +OPUS_EXPORT int opus_decoder_ctl(OpusDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); + +/** Frees an OpusDecoder allocated by opus_decoder_create(). + * @param[in] st OpusDecoder*: State to be freed. + */ +OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st); + +/** Parse an opus packet into one or more frames. + * Opus_decode will perform this operation internally so most applications do + * not need to use this function. + * This function does not copy the frames, the returned pointers are pointers into + * the input packet. + * @param [in] data char*: Opus packet to be parsed + * @param [in] len opus_int32: size of data + * @param [out] out_toc char*: TOC pointer + * @param [out] frames char*[48] encapsulated frames + * @param [out] size opus_int16[48] sizes of the encapsulated frames + * @param [out] payload_offset int*: returns the position of the payload within the packet (in bytes) + * @returns number of frames + */ +OPUS_EXPORT int opus_packet_parse( + const unsigned char *data, + opus_int32 len, + unsigned char *out_toc, + const unsigned char *frames[48], + opus_int16 size[48], + int *payload_offset +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Gets the bandwidth of an Opus packet. + * @param [in] data char*: Opus packet + * @retval OPUS_BANDWIDTH_NARROWBAND Narrowband (4kHz bandpass) + * @retval OPUS_BANDWIDTH_MEDIUMBAND Mediumband (6kHz bandpass) + * @retval OPUS_BANDWIDTH_WIDEBAND Wideband (8kHz bandpass) + * @retval OPUS_BANDWIDTH_SUPERWIDEBAND Superwideband (12kHz bandpass) + * @retval OPUS_BANDWIDTH_FULLBAND Fullband (20kHz bandpass) + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_bandwidth(const unsigned char *data) OPUS_ARG_NONNULL(1); + +/** Gets the number of samples per frame from an Opus packet. + * @param [in] data char*: Opus packet. + * This must contain at least one byte of + * data. + * @param [in] Fs opus_int32: Sampling rate in Hz. + * This must be a multiple of 400, or + * inaccurate results will be returned. + * @returns Number of samples per frame. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_samples_per_frame(const unsigned char *data, opus_int32 Fs) OPUS_ARG_NONNULL(1); + +/** Gets the number of channels from an Opus packet. + * @param [in] data char*: Opus packet + * @returns Number of channels + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_channels(const unsigned char *data) OPUS_ARG_NONNULL(1); + +/** Gets the number of frames in an Opus packet. + * @param [in] packet char*: Opus packet + * @param [in] len opus_int32: Length of packet + * @returns Number of frames + * @retval OPUS_BAD_ARG Insufficient data was passed to the function + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_frames(const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1); + +/** Gets the number of samples of an Opus packet. + * @param [in] packet char*: Opus packet + * @param [in] len opus_int32: Length of packet + * @param [in] Fs opus_int32: Sampling rate in Hz. + * This must be a multiple of 400, or + * inaccurate results will be returned. + * @returns Number of samples + * @retval OPUS_BAD_ARG Insufficient data was passed to the function + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_samples(const unsigned char packet[], opus_int32 len, opus_int32 Fs) OPUS_ARG_NONNULL(1); + +/** Gets the number of samples of an Opus packet. + * @param [in] dec OpusDecoder*: Decoder state + * @param [in] packet char*: Opus packet + * @param [in] len opus_int32: Length of packet + * @returns Number of samples + * @retval OPUS_BAD_ARG Insufficient data was passed to the function + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_nb_samples(const OpusDecoder *dec, const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); +/**@}*/ + +/** @defgroup opus_repacketizer Repacketizer + * @{ + * + * The repacketizer can be used to merge multiple Opus packets into a single + * packet or alternatively to split Opus packets that have previously been + * merged. Splitting valid Opus packets is always guaranteed to succeed, + * whereas merging valid packets only succeeds if all frames have the same + * mode, bandwidth, and frame size, and when the total duration of the merged + * packet is no more than 120 ms. + * The repacketizer currently only operates on elementary Opus + * streams. It will not manipualte multistream packets successfully, except in + * the degenerate case where they consist of data from a single stream. + * + * The repacketizing process starts with creating a repacketizer state, either + * by calling opus_repacketizer_create() or by allocating the memory yourself, + * e.g., + * @code + * OpusRepacketizer *rp; + * rp = (OpusRepacketizer*)malloc(opus_repacketizer_get_size()); + * if (rp != NULL) + * opus_repacketizer_init(rp); + * @endcode + * + * Then the application should submit packets with opus_repacketizer_cat(), + * extract new packets with opus_repacketizer_out() or + * opus_repacketizer_out_range(), and then reset the state for the next set of + * input packets via opus_repacketizer_init(). + * + * For example, to split a sequence of packets into individual frames: + * @code + * unsigned char *data; + * int len; + * while (get_next_packet(&data, &len)) + * { + * unsigned char out[1276]; + * opus_int32 out_len; + * int nb_frames; + * int err; + * int i; + * err = opus_repacketizer_cat(rp, data, len); + * if (err != OPUS_OK) + * { + * release_packet(data); + * return err; + * } + * nb_frames = opus_repacketizer_get_nb_frames(rp); + * for (i = 0; i < nb_frames; i++) + * { + * out_len = opus_repacketizer_out_range(rp, i, i+1, out, sizeof(out)); + * if (out_len < 0) + * { + * release_packet(data); + * return (int)out_len; + * } + * output_next_packet(out, out_len); + * } + * opus_repacketizer_init(rp); + * release_packet(data); + * } + * @endcode + * + * Alternatively, to combine a sequence of frames into packets that each + * contain up to TARGET_DURATION_MS milliseconds of data: + * @code + * // The maximum number of packets with duration TARGET_DURATION_MS occurs + * // when the frame size is 2.5 ms, for a total of (TARGET_DURATION_MS*2/5) + * // packets. + * unsigned char *data[(TARGET_DURATION_MS*2/5)+1]; + * opus_int32 len[(TARGET_DURATION_MS*2/5)+1]; + * int nb_packets; + * unsigned char out[1277*(TARGET_DURATION_MS*2/2)]; + * opus_int32 out_len; + * int prev_toc; + * nb_packets = 0; + * while (get_next_packet(data+nb_packets, len+nb_packets)) + * { + * int nb_frames; + * int err; + * nb_frames = opus_packet_get_nb_frames(data[nb_packets], len[nb_packets]); + * if (nb_frames < 1) + * { + * release_packets(data, nb_packets+1); + * return nb_frames; + * } + * nb_frames += opus_repacketizer_get_nb_frames(rp); + * // If adding the next packet would exceed our target, or it has an + * // incompatible TOC sequence, output the packets we already have before + * // submitting it. + * // N.B., The nb_packets > 0 check ensures we've submitted at least one + * // packet since the last call to opus_repacketizer_init(). Otherwise a + * // single packet longer than TARGET_DURATION_MS would cause us to try to + * // output an (invalid) empty packet. It also ensures that prev_toc has + * // been set to a valid value. Additionally, len[nb_packets] > 0 is + * // guaranteed by the call to opus_packet_get_nb_frames() above, so the + * // reference to data[nb_packets][0] should be valid. + * if (nb_packets > 0 && ( + * ((prev_toc & 0xFC) != (data[nb_packets][0] & 0xFC)) || + * opus_packet_get_samples_per_frame(data[nb_packets], 48000)*nb_frames > + * TARGET_DURATION_MS*48)) + * { + * out_len = opus_repacketizer_out(rp, out, sizeof(out)); + * if (out_len < 0) + * { + * release_packets(data, nb_packets+1); + * return (int)out_len; + * } + * output_next_packet(out, out_len); + * opus_repacketizer_init(rp); + * release_packets(data, nb_packets); + * data[0] = data[nb_packets]; + * len[0] = len[nb_packets]; + * nb_packets = 0; + * } + * err = opus_repacketizer_cat(rp, data[nb_packets], len[nb_packets]); + * if (err != OPUS_OK) + * { + * release_packets(data, nb_packets+1); + * return err; + * } + * prev_toc = data[nb_packets][0]; + * nb_packets++; + * } + * // Output the final, partial packet. + * if (nb_packets > 0) + * { + * out_len = opus_repacketizer_out(rp, out, sizeof(out)); + * release_packets(data, nb_packets); + * if (out_len < 0) + * return (int)out_len; + * output_next_packet(out, out_len); + * } + * @endcode + * + * An alternate way of merging packets is to simply call opus_repacketizer_cat() + * unconditionally until it fails. At that point, the merged packet can be + * obtained with opus_repacketizer_out() and the input packet for which + * opus_repacketizer_cat() needs to be re-added to a newly reinitialized + * repacketizer state. + */ + +typedef struct OpusRepacketizer OpusRepacketizer; + +/** Gets the size of an OpusRepacketizer structure. + * @returns The size in bytes. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_size(void); + +/** (Re)initializes a previously allocated repacketizer state. + * The state must be at least the size returned by opus_repacketizer_get_size(). + * This can be used for applications which use their own allocator instead of + * malloc(). + * It must also be called to reset the queue of packets waiting to be + * repacketized, which is necessary if the maximum packet duration of 120 ms + * is reached or if you wish to submit packets with a different Opus + * configuration (coding mode, audio bandwidth, frame size, or channel count). + * Failure to do so will prevent a new packet from being added with + * opus_repacketizer_cat(). + * @see opus_repacketizer_create + * @see opus_repacketizer_get_size + * @see opus_repacketizer_cat + * @param rp OpusRepacketizer*: The repacketizer state to + * (re)initialize. + * @returns A pointer to the same repacketizer state that was passed in. + */ +OPUS_EXPORT OpusRepacketizer *opus_repacketizer_init(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); + +/** Allocates memory and initializes the new repacketizer with + * opus_repacketizer_init(). + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusRepacketizer *opus_repacketizer_create(void); + +/** Frees an OpusRepacketizer allocated by + * opus_repacketizer_create(). + * @param[in] rp OpusRepacketizer*: State to be freed. + */ +OPUS_EXPORT void opus_repacketizer_destroy(OpusRepacketizer *rp); + +/** Add a packet to the current repacketizer state. + * This packet must match the configuration of any packets already submitted + * for repacketization since the last call to opus_repacketizer_init(). + * This means that it must have the same coding mode, audio bandwidth, frame + * size, and channel count. + * This can be checked in advance by examining the top 6 bits of the first + * byte of the packet, and ensuring they match the top 6 bits of the first + * byte of any previously submitted packet. + * The total duration of audio in the repacketizer state also must not exceed + * 120 ms, the maximum duration of a single packet, after adding this packet. + * + * The contents of the current repacketizer state can be extracted into new + * packets using opus_repacketizer_out() or opus_repacketizer_out_range(). + * + * In order to add a packet with a different configuration or to add more + * audio beyond 120 ms, you must clear the repacketizer state by calling + * opus_repacketizer_init(). + * If a packet is too large to add to the current repacketizer state, no part + * of it is added, even if it contains multiple frames, some of which might + * fit. + * If you wish to be able to add parts of such packets, you should first use + * another repacketizer to split the packet into pieces and add them + * individually. + * @see opus_repacketizer_out_range + * @see opus_repacketizer_out + * @see opus_repacketizer_init + * @param rp OpusRepacketizer*: The repacketizer state to which to + * add the packet. + * @param[in] data const unsigned char*: The packet data. + * The application must ensure + * this pointer remains valid + * until the next call to + * opus_repacketizer_init() or + * opus_repacketizer_destroy(). + * @param len opus_int32: The number of bytes in the packet data. + * @returns An error code indicating whether or not the operation succeeded. + * @retval #OPUS_OK The packet's contents have been added to the repacketizer + * state. + * @retval #OPUS_INVALID_PACKET The packet did not have a valid TOC sequence, + * the packet's TOC sequence was not compatible + * with previously submitted packets (because + * the coding mode, audio bandwidth, frame size, + * or channel count did not match), or adding + * this packet would increase the total amount of + * audio stored in the repacketizer state to more + * than 120 ms. + */ +OPUS_EXPORT int opus_repacketizer_cat(OpusRepacketizer *rp, const unsigned char *data, opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); + + +/** Construct a new packet from data previously submitted to the repacketizer + * state via opus_repacketizer_cat(). + * @param rp OpusRepacketizer*: The repacketizer state from which to + * construct the new packet. + * @param begin int: The index of the first frame in the current + * repacketizer state to include in the output. + * @param end int: One past the index of the last frame in the + * current repacketizer state to include in the + * output. + * @param[out] data const unsigned char*: The buffer in which to + * store the output packet. + * @param maxlen opus_int32: The maximum number of bytes to store in + * the output buffer. In order to guarantee + * success, this should be at least + * 1276 for a single frame, + * or for multiple frames, + * 1277*(end-begin). + * However, 1*(end-begin) plus + * the size of all packet data submitted to + * the repacketizer since the last call to + * opus_repacketizer_init() or + * opus_repacketizer_create() is also + * sufficient, and possibly much smaller. + * @returns The total size of the output packet on success, or an error code + * on failure. + * @retval #OPUS_BAD_ARG [begin,end) was an invalid range of + * frames (begin < 0, begin >= end, or end > + * opus_repacketizer_get_nb_frames()). + * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the + * complete output packet. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out_range(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Return the total number of frames contained in packet data submitted to + * the repacketizer state so far via opus_repacketizer_cat() since the last + * call to opus_repacketizer_init() or opus_repacketizer_create(). + * This defines the valid range of packets that can be extracted with + * opus_repacketizer_out_range() or opus_repacketizer_out(). + * @param rp OpusRepacketizer*: The repacketizer state containing the + * frames. + * @returns The total number of frames contained in the packet data submitted + * to the repacketizer state. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_nb_frames(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); + +/** Construct a new packet from data previously submitted to the repacketizer + * state via opus_repacketizer_cat(). + * This is a convenience routine that returns all the data submitted so far + * in a single packet. + * It is equivalent to calling + * @code + * opus_repacketizer_out_range(rp, 0, opus_repacketizer_get_nb_frames(rp), + * data, maxlen) + * @endcode + * @param rp OpusRepacketizer*: The repacketizer state from which to + * construct the new packet. + * @param[out] data const unsigned char*: The buffer in which to + * store the output packet. + * @param maxlen opus_int32: The maximum number of bytes to store in + * the output buffer. In order to guarantee + * success, this should be at least + * 1277*opus_repacketizer_get_nb_frames(rp). + * However, + * 1*opus_repacketizer_get_nb_frames(rp) + * plus the size of all packet data + * submitted to the repacketizer since the + * last call to opus_repacketizer_init() or + * opus_repacketizer_create() is also + * sufficient, and possibly much smaller. + * @returns The total size of the output packet on success, or an error code + * on failure. + * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the + * complete output packet. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1); + +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* OPUS_H */ diff --git a/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Headers/opus_defines.h b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Headers/opus_defines.h new file mode 100644 index 0000000..9fa3ccb --- /dev/null +++ b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Headers/opus_defines.h @@ -0,0 +1,655 @@ +/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited + Written by Jean-Marc Valin and Koen Vos */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @file opus_defines.h + * @brief Opus reference implementation constants + */ + +#ifndef OPUS_DEFINES_H +#define OPUS_DEFINES_H + +#include "opus_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @defgroup opus_errorcodes Error codes + * @{ + */ +/** No error @hideinitializer*/ +#define OPUS_OK 0 +/** One or more invalid/out of range arguments @hideinitializer*/ +#define OPUS_BAD_ARG -1 +/** The mode struct passed is invalid @hideinitializer*/ +#define OPUS_BUFFER_TOO_SMALL -2 +/** An internal error was detected @hideinitializer*/ +#define OPUS_INTERNAL_ERROR -3 +/** The compressed data passed is corrupted @hideinitializer*/ +#define OPUS_INVALID_PACKET -4 +/** Invalid/unsupported request number @hideinitializer*/ +#define OPUS_UNIMPLEMENTED -5 +/** An encoder or decoder structure is invalid or already freed @hideinitializer*/ +#define OPUS_INVALID_STATE -6 +/** Memory allocation has failed @hideinitializer*/ +#define OPUS_ALLOC_FAIL -7 +/**@}*/ + +/** @cond OPUS_INTERNAL_DOC */ +/**Export control for opus functions */ + +#ifndef OPUS_EXPORT +# if defined(WIN32) +# ifdef OPUS_BUILD +# define OPUS_EXPORT __declspec(dllexport) +# else +# define OPUS_EXPORT +# endif +# elif defined(__GNUC__) && defined(OPUS_BUILD) +# define OPUS_EXPORT __attribute__ ((visibility ("default"))) +# else +# define OPUS_EXPORT +# endif +#endif + +# if !defined(OPUS_GNUC_PREREQ) +# if defined(__GNUC__)&&defined(__GNUC_MINOR__) +# define OPUS_GNUC_PREREQ(_maj,_min) \ + ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) +# else +# define OPUS_GNUC_PREREQ(_maj,_min) 0 +# endif +# endif + +#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) +# if OPUS_GNUC_PREREQ(3,0) +# define OPUS_RESTRICT __restrict__ +# elif (defined(_MSC_VER) && _MSC_VER >= 1400) +# define OPUS_RESTRICT __restrict +# else +# define OPUS_RESTRICT +# endif +#else +# define OPUS_RESTRICT restrict +#endif + +/**Warning attributes for opus functions + * NONNULL is not used in OPUS_BUILD to avoid the compiler optimizing out + * some paranoid null checks. */ +#if defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) +# define OPUS_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) +#else +# define OPUS_WARN_UNUSED_RESULT +#endif +#if !defined(OPUS_BUILD) && defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) +# define OPUS_ARG_NONNULL(_x) __attribute__ ((__nonnull__(_x))) +#else +# define OPUS_ARG_NONNULL(_x) +#endif + +/** These are the actual Encoder CTL ID numbers. + * They should not be used directly by applications. + * In general, SETs should be even and GETs should be odd.*/ +#define OPUS_SET_APPLICATION_REQUEST 4000 +#define OPUS_GET_APPLICATION_REQUEST 4001 +#define OPUS_SET_BITRATE_REQUEST 4002 +#define OPUS_GET_BITRATE_REQUEST 4003 +#define OPUS_SET_MAX_BANDWIDTH_REQUEST 4004 +#define OPUS_GET_MAX_BANDWIDTH_REQUEST 4005 +#define OPUS_SET_VBR_REQUEST 4006 +#define OPUS_GET_VBR_REQUEST 4007 +#define OPUS_SET_BANDWIDTH_REQUEST 4008 +#define OPUS_GET_BANDWIDTH_REQUEST 4009 +#define OPUS_SET_COMPLEXITY_REQUEST 4010 +#define OPUS_GET_COMPLEXITY_REQUEST 4011 +#define OPUS_SET_INBAND_FEC_REQUEST 4012 +#define OPUS_GET_INBAND_FEC_REQUEST 4013 +#define OPUS_SET_PACKET_LOSS_PERC_REQUEST 4014 +#define OPUS_GET_PACKET_LOSS_PERC_REQUEST 4015 +#define OPUS_SET_DTX_REQUEST 4016 +#define OPUS_GET_DTX_REQUEST 4017 +#define OPUS_SET_VBR_CONSTRAINT_REQUEST 4020 +#define OPUS_GET_VBR_CONSTRAINT_REQUEST 4021 +#define OPUS_SET_FORCE_CHANNELS_REQUEST 4022 +#define OPUS_GET_FORCE_CHANNELS_REQUEST 4023 +#define OPUS_SET_SIGNAL_REQUEST 4024 +#define OPUS_GET_SIGNAL_REQUEST 4025 +#define OPUS_GET_LOOKAHEAD_REQUEST 4027 +/* #define OPUS_RESET_STATE 4028 */ +#define OPUS_GET_SAMPLE_RATE_REQUEST 4029 +#define OPUS_GET_FINAL_RANGE_REQUEST 4031 +#define OPUS_GET_PITCH_REQUEST 4033 +#define OPUS_SET_GAIN_REQUEST 4034 +#define OPUS_GET_GAIN_REQUEST 4045 /* Should have been 4035 */ +#define OPUS_SET_LSB_DEPTH_REQUEST 4036 +#define OPUS_GET_LSB_DEPTH_REQUEST 4037 + +#define OPUS_GET_LAST_PACKET_DURATION_REQUEST 4039 + +/* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */ + +/* Macros to trigger compilation errors when the wrong types are provided to a CTL */ +#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x)) +#define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr))) +#define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr))) +/** @endcond */ + +/** @defgroup opus_ctlvalues Pre-defined values for CTL interface + * @see opus_genericctls, opus_encoderctls + * @{ + */ +/* Values for the various encoder CTLs */ +#define OPUS_AUTO -1000 /**opus_int32: Allowed values: 0-10, inclusive. + * + * @hideinitializer */ +#define OPUS_SET_COMPLEXITY(x) OPUS_SET_COMPLEXITY_REQUEST, __opus_check_int(x) +/** Gets the encoder's complexity configuration. + * @see OPUS_SET_COMPLEXITY + * @param[out] x opus_int32 *: Returns a value in the range 0-10, + * inclusive. + * @hideinitializer */ +#define OPUS_GET_COMPLEXITY(x) OPUS_GET_COMPLEXITY_REQUEST, __opus_check_int_ptr(x) + +/** Configures the bitrate in the encoder. + * Rates from 500 to 512000 bits per second are meaningful, as well as the + * special values #OPUS_AUTO and #OPUS_BITRATE_MAX. + * The value #OPUS_BITRATE_MAX can be used to cause the codec to use as much + * rate as it can, which is useful for controlling the rate by adjusting the + * output buffer size. + * @see OPUS_GET_BITRATE + * @param[in] x opus_int32: Bitrate in bits per second. The default + * is determined based on the number of + * channels and the input sampling rate. + * @hideinitializer */ +#define OPUS_SET_BITRATE(x) OPUS_SET_BITRATE_REQUEST, __opus_check_int(x) +/** Gets the encoder's bitrate configuration. + * @see OPUS_SET_BITRATE + * @param[out] x opus_int32 *: Returns the bitrate in bits per second. + * The default is determined based on the + * number of channels and the input + * sampling rate. + * @hideinitializer */ +#define OPUS_GET_BITRATE(x) OPUS_GET_BITRATE_REQUEST, __opus_check_int_ptr(x) + +/** Enables or disables variable bitrate (VBR) in the encoder. + * The configured bitrate may not be met exactly because frames must + * be an integer number of bytes in length. + * @warning Only the MDCT mode of Opus can provide hard CBR behavior. + * @see OPUS_GET_VBR + * @see OPUS_SET_VBR_CONSTRAINT + * @param[in] x opus_int32: Allowed values: + *
+ *
0
Hard CBR. For LPC/hybrid modes at very low bit-rate, this can + * cause noticeable quality degradation.
+ *
1
VBR (default). The exact type of VBR is controlled by + * #OPUS_SET_VBR_CONSTRAINT.
+ *
+ * @hideinitializer */ +#define OPUS_SET_VBR(x) OPUS_SET_VBR_REQUEST, __opus_check_int(x) +/** Determine if variable bitrate (VBR) is enabled in the encoder. + * @see OPUS_SET_VBR + * @see OPUS_GET_VBR_CONSTRAINT + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
0
Hard CBR.
+ *
1
VBR (default). The exact type of VBR may be retrieved via + * #OPUS_GET_VBR_CONSTRAINT.
+ *
+ * @hideinitializer */ +#define OPUS_GET_VBR(x) OPUS_GET_VBR_REQUEST, __opus_check_int_ptr(x) + +/** Enables or disables constrained VBR in the encoder. + * This setting is ignored when the encoder is in CBR mode. + * @warning Only the MDCT mode of Opus currently heeds the constraint. + * Speech mode ignores it completely, hybrid mode may fail to obey it + * if the LPC layer uses more bitrate than the constraint would have + * permitted. + * @see OPUS_GET_VBR_CONSTRAINT + * @see OPUS_SET_VBR + * @param[in] x opus_int32: Allowed values: + *
+ *
0
Unconstrained VBR.
+ *
1
Constrained VBR (default). This creates a maximum of one + * frame of buffering delay assuming a transport with a + * serialization speed of the nominal bitrate.
+ *
+ * @hideinitializer */ +#define OPUS_SET_VBR_CONSTRAINT(x) OPUS_SET_VBR_CONSTRAINT_REQUEST, __opus_check_int(x) +/** Determine if constrained VBR is enabled in the encoder. + * @see OPUS_SET_VBR_CONSTRAINT + * @see OPUS_GET_VBR + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
0
Unconstrained VBR.
+ *
1
Constrained VBR (default).
+ *
+ * @hideinitializer */ +#define OPUS_GET_VBR_CONSTRAINT(x) OPUS_GET_VBR_CONSTRAINT_REQUEST, __opus_check_int_ptr(x) + +/** Configures mono/stereo forcing in the encoder. + * This can force the encoder to produce packets encoded as either mono or + * stereo, regardless of the format of the input audio. This is useful when + * the caller knows that the input signal is currently a mono source embedded + * in a stereo stream. + * @see OPUS_GET_FORCE_CHANNELS + * @param[in] x opus_int32: Allowed values: + *
+ *
#OPUS_AUTO
Not forced (default)
+ *
1
Forced mono
+ *
2
Forced stereo
+ *
+ * @hideinitializer */ +#define OPUS_SET_FORCE_CHANNELS(x) OPUS_SET_FORCE_CHANNELS_REQUEST, __opus_check_int(x) +/** Gets the encoder's forced channel configuration. + * @see OPUS_SET_FORCE_CHANNELS + * @param[out] x opus_int32 *: + *
+ *
#OPUS_AUTO
Not forced (default)
+ *
1
Forced mono
+ *
2
Forced stereo
+ *
+ * @hideinitializer */ +#define OPUS_GET_FORCE_CHANNELS(x) OPUS_GET_FORCE_CHANNELS_REQUEST, __opus_check_int_ptr(x) + +/** Configures the maximum bandpass that the encoder will select automatically. + * Applications should normally use this instead of #OPUS_SET_BANDWIDTH + * (leaving that set to the default, #OPUS_AUTO). This allows the + * application to set an upper bound based on the type of input it is + * providing, but still gives the encoder the freedom to reduce the bandpass + * when the bitrate becomes too low, for better overall quality. + * @see OPUS_GET_MAX_BANDWIDTH + * @param[in] x opus_int32: Allowed values: + *
+ *
OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
+ *
OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
+ *
OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
+ *
OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
+ *
OPUS_BANDWIDTH_FULLBAND
20 kHz passband (default)
+ *
+ * @hideinitializer */ +#define OPUS_SET_MAX_BANDWIDTH(x) OPUS_SET_MAX_BANDWIDTH_REQUEST, __opus_check_int(x) + +/** Gets the encoder's configured maximum allowed bandpass. + * @see OPUS_SET_MAX_BANDWIDTH + * @param[out] x opus_int32 *: Allowed values: + *
+ *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
+ *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
+ *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
+ *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
+ *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband (default)
+ *
+ * @hideinitializer */ +#define OPUS_GET_MAX_BANDWIDTH(x) OPUS_GET_MAX_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) + +/** Sets the encoder's bandpass to a specific value. + * This prevents the encoder from automatically selecting the bandpass based + * on the available bitrate. If an application knows the bandpass of the input + * audio it is providing, it should normally use #OPUS_SET_MAX_BANDWIDTH + * instead, which still gives the encoder the freedom to reduce the bandpass + * when the bitrate becomes too low, for better overall quality. + * @see OPUS_GET_BANDWIDTH + * @param[in] x opus_int32: Allowed values: + *
+ *
#OPUS_AUTO
(default)
+ *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
+ *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
+ *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
+ *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
+ *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband
+ *
+ * @hideinitializer */ +#define OPUS_SET_BANDWIDTH(x) OPUS_SET_BANDWIDTH_REQUEST, __opus_check_int(x) + +/** Configures the type of signal being encoded. + * This is a hint which helps the encoder's mode selection. + * @see OPUS_GET_SIGNAL + * @param[in] x opus_int32: Allowed values: + *
+ *
#OPUS_AUTO
(default)
+ *
#OPUS_SIGNAL_VOICE
Bias thresholds towards choosing LPC or Hybrid modes.
+ *
#OPUS_SIGNAL_MUSIC
Bias thresholds towards choosing MDCT modes.
+ *
+ * @hideinitializer */ +#define OPUS_SET_SIGNAL(x) OPUS_SET_SIGNAL_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured signal type. + * @see OPUS_SET_SIGNAL + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
#OPUS_AUTO
(default)
+ *
#OPUS_SIGNAL_VOICE
Bias thresholds towards choosing LPC or Hybrid modes.
+ *
#OPUS_SIGNAL_MUSIC
Bias thresholds towards choosing MDCT modes.
+ *
+ * @hideinitializer */ +#define OPUS_GET_SIGNAL(x) OPUS_GET_SIGNAL_REQUEST, __opus_check_int_ptr(x) + + +/** Configures the encoder's intended application. + * The initial value is a mandatory argument to the encoder_create function. + * @see OPUS_GET_APPLICATION + * @param[in] x opus_int32: Returns one of the following values: + *
+ *
#OPUS_APPLICATION_VOIP
+ *
Process signal for improved speech intelligibility.
+ *
#OPUS_APPLICATION_AUDIO
+ *
Favor faithfulness to the original input.
+ *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
+ *
Configure the minimum possible coding delay by disabling certain modes + * of operation.
+ *
+ * @hideinitializer */ +#define OPUS_SET_APPLICATION(x) OPUS_SET_APPLICATION_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured application. + * @see OPUS_SET_APPLICATION + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
#OPUS_APPLICATION_VOIP
+ *
Process signal for improved speech intelligibility.
+ *
#OPUS_APPLICATION_AUDIO
+ *
Favor faithfulness to the original input.
+ *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
+ *
Configure the minimum possible coding delay by disabling certain modes + * of operation.
+ *
+ * @hideinitializer */ +#define OPUS_GET_APPLICATION(x) OPUS_GET_APPLICATION_REQUEST, __opus_check_int_ptr(x) + +/** Gets the sampling rate the encoder or decoder was initialized with. + * This simply returns the Fs value passed to opus_encoder_init() + * or opus_decoder_init(). + * @param[out] x opus_int32 *: Sampling rate of encoder or decoder. + * @hideinitializer + */ +#define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_ptr(x) + +/** Gets the total samples of delay added by the entire codec. + * This can be queried by the encoder and then the provided number of samples can be + * skipped on from the start of the decoder's output to provide time aligned input + * and output. From the perspective of a decoding application the real data begins this many + * samples late. + * + * The decoder contribution to this delay is identical for all decoders, but the + * encoder portion of the delay may vary from implementation to implementation, + * version to version, or even depend on the encoder's initial configuration. + * Applications needing delay compensation should call this CTL rather than + * hard-coding a value. + * @param[out] x opus_int32 *: Number of lookahead samples + * @hideinitializer */ +#define OPUS_GET_LOOKAHEAD(x) OPUS_GET_LOOKAHEAD_REQUEST, __opus_check_int_ptr(x) + +/** Configures the encoder's use of inband forward error correction (FEC). + * @note This is only applicable to the LPC layer + * @see OPUS_GET_INBAND_FEC + * @param[in] x opus_int32: Allowed values: + *
+ *
0
Disable inband FEC (default).
+ *
1
Enable inband FEC.
+ *
+ * @hideinitializer */ +#define OPUS_SET_INBAND_FEC(x) OPUS_SET_INBAND_FEC_REQUEST, __opus_check_int(x) +/** Gets encoder's configured use of inband forward error correction. + * @see OPUS_SET_INBAND_FEC + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
0
Inband FEC disabled (default).
+ *
1
Inband FEC enabled.
+ *
+ * @hideinitializer */ +#define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x) + +/** Configures the encoder's expected packet loss percentage. + * Higher values with trigger progressively more loss resistant behavior in the encoder + * at the expense of quality at a given bitrate in the lossless case, but greater quality + * under loss. + * @see OPUS_GET_PACKET_LOSS_PERC + * @param[in] x opus_int32: Loss percentage in the range 0-100, inclusive (default: 0). + * @hideinitializer */ +#define OPUS_SET_PACKET_LOSS_PERC(x) OPUS_SET_PACKET_LOSS_PERC_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured packet loss percentage. + * @see OPUS_SET_PACKET_LOSS_PERC + * @param[out] x opus_int32 *: Returns the configured loss percentage + * in the range 0-100, inclusive (default: 0). + * @hideinitializer */ +#define OPUS_GET_PACKET_LOSS_PERC(x) OPUS_GET_PACKET_LOSS_PERC_REQUEST, __opus_check_int_ptr(x) + +/** Configures the encoder's use of discontinuous transmission (DTX). + * @note This is only applicable to the LPC layer + * @see OPUS_GET_DTX + * @param[in] x opus_int32: Allowed values: + *
+ *
0
Disable DTX (default).
+ *
1
Enabled DTX.
+ *
+ * @hideinitializer */ +#define OPUS_SET_DTX(x) OPUS_SET_DTX_REQUEST, __opus_check_int(x) +/** Gets encoder's configured use of discontinuous transmission. + * @see OPUS_SET_DTX + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
0
DTX disabled (default).
+ *
1
DTX enabled.
+ *
+ * @hideinitializer */ +#define OPUS_GET_DTX(x) OPUS_GET_DTX_REQUEST, __opus_check_int_ptr(x) +/** Configures the depth of signal being encoded. + * This is a hint which helps the encoder identify silence and near-silence. + * @see OPUS_GET_LSB_DEPTH + * @param[in] x opus_int32: Input precision in bits, between 8 and 24 + * (default: 24). + * @hideinitializer */ +#define OPUS_SET_LSB_DEPTH(x) OPUS_SET_LSB_DEPTH_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured signal depth. + * @see OPUS_SET_LSB_DEPTH + * @param[out] x opus_int32 *: Input precision in bits, between 8 and + * 24 (default: 24). + * @hideinitializer */ +#define OPUS_GET_LSB_DEPTH(x) OPUS_GET_LSB_DEPTH_REQUEST, __opus_check_int_ptr(x) + +/** Gets the duration (in samples) of the last packet successfully decoded or concealed. + * @param[out] x opus_int32 *: Number of samples (at current sampling rate). + * @hideinitializer */ +#define OPUS_GET_LAST_PACKET_DURATION(x) OPUS_GET_LAST_PACKET_DURATION_REQUEST, __opus_check_int_ptr(x) +/**@}*/ + +/** @defgroup opus_genericctls Generic CTLs + * + * These macros are used with the \c opus_decoder_ctl and + * \c opus_encoder_ctl calls to generate a particular + * request. + * + * When called on an \c OpusDecoder they apply to that + * particular decoder instance. When called on an + * \c OpusEncoder they apply to the corresponding setting + * on that encoder instance, if present. + * + * Some usage examples: + * + * @code + * int ret; + * opus_int32 pitch; + * ret = opus_decoder_ctl(dec_ctx, OPUS_GET_PITCH(&pitch)); + * if (ret == OPUS_OK) return ret; + * + * opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE); + * opus_decoder_ctl(dec_ctx, OPUS_RESET_STATE); + * + * opus_int32 enc_bw, dec_bw; + * opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&enc_bw)); + * opus_decoder_ctl(dec_ctx, OPUS_GET_BANDWIDTH(&dec_bw)); + * if (enc_bw != dec_bw) { + * printf("packet bandwidth mismatch!\n"); + * } + * @endcode + * + * @see opus_encoder, opus_decoder_ctl, opus_encoder_ctl, opus_decoderctls, opus_encoderctls + * @{ + */ + +/** Resets the codec state to be equivalent to a freshly initialized state. + * This should be called when switching streams in order to prevent + * the back to back decoding from giving different results from + * one at a time decoding. + * @hideinitializer */ +#define OPUS_RESET_STATE 4028 + +/** Gets the final state of the codec's entropy coder. + * This is used for testing purposes, + * The encoder and decoder state should be identical after coding a payload + * (assuming no data corruption or software bugs) + * + * @param[out] x opus_uint32 *: Entropy coder state + * + * @hideinitializer */ +#define OPUS_GET_FINAL_RANGE(x) OPUS_GET_FINAL_RANGE_REQUEST, __opus_check_uint_ptr(x) + +/** Gets the pitch of the last decoded frame, if available. + * This can be used for any post-processing algorithm requiring the use of pitch, + * e.g. time stretching/shortening. If the last frame was not voiced, or if the + * pitch was not coded in the frame, then zero is returned. + * + * This CTL is only implemented for decoder instances. + * + * @param[out] x opus_int32 *: pitch period at 48 kHz (or 0 if not available) + * + * @hideinitializer */ +#define OPUS_GET_PITCH(x) OPUS_GET_PITCH_REQUEST, __opus_check_int_ptr(x) + +/** Gets the encoder's configured bandpass or the decoder's last bandpass. + * @see OPUS_SET_BANDWIDTH + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
#OPUS_AUTO
(default)
+ *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
+ *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
+ *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
+ *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
+ *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband
+ *
+ * @hideinitializer */ +#define OPUS_GET_BANDWIDTH(x) OPUS_GET_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) + +/**@}*/ + +/** @defgroup opus_decoderctls Decoder related CTLs + * @see opus_genericctls, opus_encoderctls, opus_decoder + * @{ + */ + +/** Configures decoder gain adjustment. + * Scales the decoded output by a factor specified in Q8 dB units. + * This has a maximum range of -32768 to 32767 inclusive, and returns + * OPUS_BAD_ARG otherwise. The default is zero indicating no adjustment. + * This setting survives decoder reset. + * + * gain = pow(10, x/(20.0*256)) + * + * @param[in] x opus_int32: Amount to scale PCM signal by in Q8 dB units. + * @hideinitializer */ +#define OPUS_SET_GAIN(x) OPUS_SET_GAIN_REQUEST, __opus_check_int(x) +/** Gets the decoder's configured gain adjustment. @see OPUS_SET_GAIN + * + * @param[out] x opus_int32 *: Amount to scale PCM signal by in Q8 dB units. + * @hideinitializer */ +#define OPUS_GET_GAIN(x) OPUS_GET_GAIN_REQUEST, __opus_check_int_ptr(x) + +/**@}*/ + +/** @defgroup opus_libinfo Opus library information functions + * @{ + */ + +/** Converts an opus error code into a human readable string. + * + * @param[in] error int: Error number + * @returns Error string + */ +OPUS_EXPORT const char *opus_strerror(int error); + +/** Gets the libopus version string. + * + * @returns Version string + */ +OPUS_EXPORT const char *opus_get_version_string(void); +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* OPUS_DEFINES_H */ diff --git a/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Headers/opus_multistream.h b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Headers/opus_multistream.h new file mode 100644 index 0000000..ae59979 --- /dev/null +++ b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Headers/opus_multistream.h @@ -0,0 +1,660 @@ +/* Copyright (c) 2011 Xiph.Org Foundation + Written by Jean-Marc Valin */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @file opus_multistream.h + * @brief Opus reference implementation multistream API + */ + +#ifndef OPUS_MULTISTREAM_H +#define OPUS_MULTISTREAM_H + +#include "opus.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @cond OPUS_INTERNAL_DOC */ + +/** Macros to trigger compilation errors when the wrong types are provided to a + * CTL. */ +/**@{*/ +#define __opus_check_encstate_ptr(ptr) ((ptr) + ((ptr) - (OpusEncoder**)(ptr))) +#define __opus_check_decstate_ptr(ptr) ((ptr) + ((ptr) - (OpusDecoder**)(ptr))) +/**@}*/ + +/** These are the actual encoder and decoder CTL ID numbers. + * They should not be used directly by applications. + * In general, SETs should be even and GETs should be odd.*/ +/**@{*/ +#define OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST 5120 +#define OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST 5122 +/**@}*/ + +/** @endcond */ + +/** @defgroup opus_multistream_ctls Multistream specific encoder and decoder CTLs + * + * These are convenience macros that are specific to the + * opus_multistream_encoder_ctl() and opus_multistream_decoder_ctl() + * interface. + * The CTLs from @ref opus_genericctls, @ref opus_encoderctls, and + * @ref opus_decoderctls may be applied to a multistream encoder or decoder as + * well. + * In addition, you may retrieve the encoder or decoder state for an specific + * stream via #OPUS_MULTISTREAM_GET_ENCODER_STATE or + * #OPUS_MULTISTREAM_GET_DECODER_STATE and apply CTLs to it individually. + */ +/**@{*/ + +/** Gets the encoder state for an individual stream of a multistream encoder. + * @param[in] x opus_int32: The index of the stream whose encoder you + * wish to retrieve. + * This must be non-negative and less than + * the streams parameter used + * to initialize the encoder. + * @param[out] y OpusEncoder**: Returns a pointer to the given + * encoder state. + * @retval OPUS_BAD_ARG The index of the requested stream was out of range. + * @hideinitializer + */ +#define OPUS_MULTISTREAM_GET_ENCODER_STATE(x,y) OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST, __opus_check_int(x), __opus_check_encstate_ptr(y) + +/** Gets the decoder state for an individual stream of a multistream decoder. + * @param[in] x opus_int32: The index of the stream whose decoder you + * wish to retrieve. + * This must be non-negative and less than + * the streams parameter used + * to initialize the decoder. + * @param[out] y OpusDecoder**: Returns a pointer to the given + * decoder state. + * @retval OPUS_BAD_ARG The index of the requested stream was out of range. + * @hideinitializer + */ +#define OPUS_MULTISTREAM_GET_DECODER_STATE(x,y) OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST, __opus_check_int(x), __opus_check_decstate_ptr(y) + +/**@}*/ + +/** @defgroup opus_multistream Opus Multistream API + * @{ + * + * The multistream API allows individual Opus streams to be combined into a + * single packet, enabling support for up to 255 channels. Unlike an + * elementary Opus stream, the encoder and decoder must negotiate the channel + * configuration before the decoder can successfully interpret the data in the + * packets produced by the encoder. Some basic information, such as packet + * duration, can be computed without any special negotiation. + * + * The format for multistream Opus packets is defined in the + * Ogg + * encapsulation specification and is based on the self-delimited Opus + * framing described in Appendix B of RFC 6716. + * Normal Opus packets are just a degenerate case of multistream Opus packets, + * and can be encoded or decoded with the multistream API by setting + * streams to 1 when initializing the encoder or + * decoder. + * + * Multistream Opus streams can contain up to 255 elementary Opus streams. + * These may be either "uncoupled" or "coupled", indicating that the decoder + * is configured to decode them to either 1 or 2 channels, respectively. + * The streams are ordered so that all coupled streams appear at the + * beginning. + * + * A mapping table defines which decoded channel i + * should be used for each input/output (I/O) channel j. This table is + * typically provided as an unsigned char array. + * Let i = mapping[j] be the index for I/O channel j. + * If i < 2*coupled_streams, then I/O channel j is + * encoded as the left channel of stream (i/2) if i + * is even, or as the right channel of stream (i/2) if + * i is odd. Otherwise, I/O channel j is encoded as + * mono in stream (i - coupled_streams), unless it has the special + * value 255, in which case it is omitted from the encoding entirely (the + * decoder will reproduce it as silence). Each value i must either + * be the special value 255 or be less than streams + coupled_streams. + * + * The output channels specified by the encoder + * should use the + * Vorbis + * channel ordering. A decoder may wish to apply an additional permutation + * to the mapping the encoder used to achieve a different output channel + * order (e.g. for outputing in WAV order). + * + * Each multistream packet contains an Opus packet for each stream, and all of + * the Opus packets in a single multistream packet must have the same + * duration. Therefore the duration of a multistream packet can be extracted + * from the TOC sequence of the first stream, which is located at the + * beginning of the packet, just like an elementary Opus stream: + * + * @code + * int nb_samples; + * int nb_frames; + * nb_frames = opus_packet_get_nb_frames(data, len); + * if (nb_frames < 1) + * return nb_frames; + * nb_samples = opus_packet_get_samples_per_frame(data, 48000) * nb_frames; + * @endcode + * + * The general encoding and decoding process proceeds exactly the same as in + * the normal @ref opus_encoder and @ref opus_decoder APIs. + * See their documentation for an overview of how to use the corresponding + * multistream functions. + */ + +/** Opus multistream encoder state. + * This contains the complete state of a multistream Opus encoder. + * It is position independent and can be freely copied. + * @see opus_multistream_encoder_create + * @see opus_multistream_encoder_init + */ +typedef struct OpusMSEncoder OpusMSEncoder; + +/** Opus multistream decoder state. + * This contains the complete state of a multistream Opus decoder. + * It is position independent and can be freely copied. + * @see opus_multistream_decoder_create + * @see opus_multistream_decoder_init + */ +typedef struct OpusMSDecoder OpusMSDecoder; + +/**\name Multistream encoder functions */ +/**@{*/ + +/** Gets the size of an OpusMSEncoder structure. + * @param streams int: The total number of streams to encode from the + * input. + * This must be no more than 255. + * @param coupled_streams int: Number of coupled (2 channel) streams + * to encode. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * encoded channels (streams + + * coupled_streams) must be no + * more than 255. + * @returns The size in bytes on success, or a negative error code + * (see @ref opus_errorcodes) on error. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size( + int streams, + int coupled_streams +); + +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_surround_encoder_get_size( + int channels, + int mapping_family +); + + +/** Allocates and initializes a multistream encoder state. + * Call opus_multistream_encoder_destroy() to release + * this object when finished. + * @param Fs opus_int32: Sampling rate of the input signal (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels int: Number of channels in the input signal. + * This must be at most 255. + * It may be greater than the number of + * coded channels (streams + + * coupled_streams). + * @param streams int: The total number of streams to encode from the + * input. + * This must be no more than the number of channels. + * @param coupled_streams int: Number of coupled (2 channel) streams + * to encode. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * encoded channels (streams + + * coupled_streams) must be no + * more than the number of input channels. + * @param[in] mapping const unsigned char[channels]: Mapping from + * encoded channels to input channels, as described in + * @ref opus_multistream. As an extra constraint, the + * multistream encoder does not allow encoding coupled + * streams for which one channel is unused since this + * is never a good idea. + * @param application int: The target encoder application. + * This must be one of the following: + *
+ *
#OPUS_APPLICATION_VOIP
+ *
Process signal for improved speech intelligibility.
+ *
#OPUS_APPLICATION_AUDIO
+ *
Favor faithfulness to the original input.
+ *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
+ *
Configure the minimum possible coding delay by disabling certain modes + * of operation.
+ *
+ * @param[out] error int *: Returns #OPUS_OK on success, or an error + * code (see @ref opus_errorcodes) on + * failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create( + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping, + int application, + int *error +) OPUS_ARG_NONNULL(5); + +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_encoder_create( + opus_int32 Fs, + int channels, + int mapping_family, + int *streams, + int *coupled_streams, + unsigned char *mapping, + int application, + int *error +) OPUS_ARG_NONNULL(5); + +/** Initialize a previously allocated multistream encoder state. + * The memory pointed to by \a st must be at least the size returned by + * opus_multistream_encoder_get_size(). + * This is intended for applications which use their own allocator instead of + * malloc. + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @see opus_multistream_encoder_create + * @see opus_multistream_encoder_get_size + * @param st OpusMSEncoder*: Multistream encoder state to initialize. + * @param Fs opus_int32: Sampling rate of the input signal (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels int: Number of channels in the input signal. + * This must be at most 255. + * It may be greater than the number of + * coded channels (streams + + * coupled_streams). + * @param streams int: The total number of streams to encode from the + * input. + * This must be no more than the number of channels. + * @param coupled_streams int: Number of coupled (2 channel) streams + * to encode. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * encoded channels (streams + + * coupled_streams) must be no + * more than the number of input channels. + * @param[in] mapping const unsigned char[channels]: Mapping from + * encoded channels to input channels, as described in + * @ref opus_multistream. As an extra constraint, the + * multistream encoder does not allow encoding coupled + * streams for which one channel is unused since this + * is never a good idea. + * @param application int: The target encoder application. + * This must be one of the following: + *
+ *
#OPUS_APPLICATION_VOIP
+ *
Process signal for improved speech intelligibility.
+ *
#OPUS_APPLICATION_AUDIO
+ *
Favor faithfulness to the original input.
+ *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
+ *
Configure the minimum possible coding delay by disabling certain modes + * of operation.
+ *
+ * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) + * on failure. + */ +OPUS_EXPORT int opus_multistream_encoder_init( + OpusMSEncoder *st, + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping, + int application +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); + +OPUS_EXPORT int opus_multistream_surround_encoder_init( + OpusMSEncoder *st, + opus_int32 Fs, + int channels, + int mapping_family, + int *streams, + int *coupled_streams, + unsigned char *mapping, + int application +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); + +/** Encodes a multistream Opus frame. + * @param st OpusMSEncoder*: Multistream encoder state. + * @param[in] pcm const opus_int16*: The input signal as interleaved + * samples. + * This must contain + * frame_size*channels + * samples. + * @param frame_size int: Number of samples per channel in the input + * signal. + * This must be an Opus frame size for the + * encoder's sampling rate. + * For example, at 48 kHz the permitted values + * are 120, 240, 480, 960, 1920, and 2880. + * Passing in a duration of less than 10 ms + * (480 samples at 48 kHz) will prevent the + * encoder from using the LPC or hybrid modes. + * @param[out] data unsigned char*: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes opus_int32: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode( + OpusMSEncoder *st, + const opus_int16 *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + +/** Encodes a multistream Opus frame from floating point input. + * @param st OpusMSEncoder*: Multistream encoder state. + * @param[in] pcm const float*: The input signal as interleaved + * samples with a normal range of + * +/-1.0. + * Samples with a range beyond +/-1.0 + * are supported but will be clipped by + * decoders using the integer API and + * should only be used if it is known + * that the far end supports extended + * dynamic range. + * This must contain + * frame_size*channels + * samples. + * @param frame_size int: Number of samples per channel in the input + * signal. + * This must be an Opus frame size for the + * encoder's sampling rate. + * For example, at 48 kHz the permitted values + * are 120, 240, 480, 960, 1920, and 2880. + * Passing in a duration of less than 10 ms + * (480 samples at 48 kHz) will prevent the + * encoder from using the LPC or hybrid modes. + * @param[out] data unsigned char*: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes opus_int32: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float( + OpusMSEncoder *st, + const float *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + +/** Frees an OpusMSEncoder allocated by + * opus_multistream_encoder_create(). + * @param st OpusMSEncoder*: Multistream encoder state to be freed. + */ +OPUS_EXPORT void opus_multistream_encoder_destroy(OpusMSEncoder *st); + +/** Perform a CTL function on a multistream Opus encoder. + * + * Generally the request and subsequent arguments are generated by a + * convenience macro. + * @param st OpusMSEncoder*: Multistream encoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls, + * @ref opus_encoderctls, or @ref opus_multistream_ctls. + * @see opus_genericctls + * @see opus_encoderctls + * @see opus_multistream_ctls + */ +OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); + +/**@}*/ + +/**\name Multistream decoder functions */ +/**@{*/ + +/** Gets the size of an OpusMSDecoder structure. + * @param streams int: The total number of streams coded in the + * input. + * This must be no more than 255. + * @param coupled_streams int: Number streams to decode as coupled + * (2 channel) streams. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * coded channels (streams + + * coupled_streams) must be no + * more than 255. + * @returns The size in bytes on success, or a negative error code + * (see @ref opus_errorcodes) on error. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size( + int streams, + int coupled_streams +); + +/** Allocates and initializes a multistream decoder state. + * Call opus_multistream_decoder_destroy() to release + * this object when finished. + * @param Fs opus_int32: Sampling rate to decode at (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels int: Number of channels to output. + * This must be at most 255. + * It may be different from the number of coded + * channels (streams + + * coupled_streams). + * @param streams int: The total number of streams coded in the + * input. + * This must be no more than 255. + * @param coupled_streams int: Number of streams to decode as coupled + * (2 channel) streams. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * coded channels (streams + + * coupled_streams) must be no + * more than 255. + * @param[in] mapping const unsigned char[channels]: Mapping from + * coded channels to output channels, as described in + * @ref opus_multistream. + * @param[out] error int *: Returns #OPUS_OK on success, or an error + * code (see @ref opus_errorcodes) on + * failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create( + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping, + int *error +) OPUS_ARG_NONNULL(5); + +/** Intialize a previously allocated decoder state object. + * The memory pointed to by \a st must be at least the size returned by + * opus_multistream_encoder_get_size(). + * This is intended for applications which use their own allocator instead of + * malloc. + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @see opus_multistream_decoder_create + * @see opus_multistream_deocder_get_size + * @param st OpusMSEncoder*: Multistream encoder state to initialize. + * @param Fs opus_int32: Sampling rate to decode at (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels int: Number of channels to output. + * This must be at most 255. + * It may be different from the number of coded + * channels (streams + + * coupled_streams). + * @param streams int: The total number of streams coded in the + * input. + * This must be no more than 255. + * @param coupled_streams int: Number of streams to decode as coupled + * (2 channel) streams. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * coded channels (streams + + * coupled_streams) must be no + * more than 255. + * @param[in] mapping const unsigned char[channels]: Mapping from + * coded channels to output channels, as described in + * @ref opus_multistream. + * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) + * on failure. + */ +OPUS_EXPORT int opus_multistream_decoder_init( + OpusMSDecoder *st, + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); + +/** Decode a multistream Opus packet. + * @param st OpusMSDecoder*: Multistream decoder state. + * @param[in] data const unsigned char*: Input payload. + * Use a NULL + * pointer to indicate packet + * loss. + * @param len opus_int32: Number of bytes in payload. + * @param[out] pcm opus_int16*: Output signal, with interleaved + * samples. + * This must contain room for + * frame_size*channels + * samples. + * @param frame_size int: The number of samples per channel of + * available space in \a pcm. + * If this is less than the maximum packet duration + * (120 ms; 5760 for 48kHz), this function will not be capable + * of decoding some packets. In the case of PLC (data==NULL) + * or FEC (decode_fec=1), then frame_size needs to be exactly + * the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the + * next incoming packet. For the PLC and FEC cases, frame_size + * must be a multiple of 2.5 ms. + * @param decode_fec int: Flag (0 or 1) to request that any in-band + * forward error correction data be decoded. + * If no such data is available, the frame is + * decoded as if it were lost. + * @returns Number of samples decoded on success or a negative error code + * (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode( + OpusMSDecoder *st, + const unsigned char *data, + opus_int32 len, + opus_int16 *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Decode a multistream Opus packet with floating point output. + * @param st OpusMSDecoder*: Multistream decoder state. + * @param[in] data const unsigned char*: Input payload. + * Use a NULL + * pointer to indicate packet + * loss. + * @param len opus_int32: Number of bytes in payload. + * @param[out] pcm opus_int16*: Output signal, with interleaved + * samples. + * This must contain room for + * frame_size*channels + * samples. + * @param frame_size int: The number of samples per channel of + * available space in \a pcm. + * If this is less than the maximum packet duration + * (120 ms; 5760 for 48kHz), this function will not be capable + * of decoding some packets. In the case of PLC (data==NULL) + * or FEC (decode_fec=1), then frame_size needs to be exactly + * the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the + * next incoming packet. For the PLC and FEC cases, frame_size + * must be a multiple of 2.5 ms. + * @param decode_fec int: Flag (0 or 1) to request that any in-band + * forward error correction data be decoded. + * If no such data is available, the frame is + * decoded as if it were lost. + * @returns Number of samples decoded on success or a negative error code + * (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode_float( + OpusMSDecoder *st, + const unsigned char *data, + opus_int32 len, + float *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Perform a CTL function on a multistream Opus decoder. + * + * Generally the request and subsequent arguments are generated by a + * convenience macro. + * @param st OpusMSDecoder*: Multistream decoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls, + * @ref opus_decoderctls, or @ref opus_multistream_ctls. + * @see opus_genericctls + * @see opus_decoderctls + * @see opus_multistream_ctls + */ +OPUS_EXPORT int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); + +/** Frees an OpusMSDecoder allocated by + * opus_multistream_decoder_create(). + * @param st OpusMSDecoder: Multistream decoder state to be freed. + */ +OPUS_EXPORT void opus_multistream_decoder_destroy(OpusMSDecoder *st); + +/**@}*/ + +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* OPUS_MULTISTREAM_H */ diff --git a/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Headers/opus_types.h b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Headers/opus_types.h new file mode 100644 index 0000000..b28e03a --- /dev/null +++ b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Headers/opus_types.h @@ -0,0 +1,159 @@ +/* (C) COPYRIGHT 1994-2002 Xiph.Org Foundation */ +/* Modified by Jean-Marc Valin */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/* opus_types.h based on ogg_types.h from libogg */ + +/** + @file opus_types.h + @brief Opus reference implementation types +*/ +#ifndef OPUS_TYPES_H +#define OPUS_TYPES_H + +/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */ +#if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H)) +#include + + typedef int16_t opus_int16; + typedef uint16_t opus_uint16; + typedef int32_t opus_int32; + typedef uint32_t opus_uint32; +#elif defined(_WIN32) + +# if defined(__CYGWIN__) +# include <_G_config.h> + typedef _G_int32_t opus_int32; + typedef _G_uint32_t opus_uint32; + typedef _G_int16 opus_int16; + typedef _G_uint16 opus_uint16; +# elif defined(__MINGW32__) + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; +# elif defined(__MWERKS__) + typedef int opus_int32; + typedef unsigned int opus_uint32; + typedef short opus_int16; + typedef unsigned short opus_uint16; +# else + /* MSVC/Borland */ + typedef __int32 opus_int32; + typedef unsigned __int32 opus_uint32; + typedef __int16 opus_int16; + typedef unsigned __int16 opus_uint16; +# endif + +#elif defined(__MACOS__) + +# include + typedef SInt16 opus_int16; + typedef UInt16 opus_uint16; + typedef SInt32 opus_int32; + typedef UInt32 opus_uint32; + +#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ + +# include + typedef int16_t opus_int16; + typedef u_int16_t opus_uint16; + typedef int32_t opus_int32; + typedef u_int32_t opus_uint32; + +#elif defined(__BEOS__) + + /* Be */ +# include + typedef int16 opus_int16; + typedef u_int16 opus_uint16; + typedef int32_t opus_int32; + typedef u_int32_t opus_uint32; + +#elif defined (__EMX__) + + /* OS/2 GCC */ + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; + +#elif defined (DJGPP) + + /* DJGPP */ + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; + +#elif defined(R5900) + + /* PS2 EE */ + typedef int opus_int32; + typedef unsigned opus_uint32; + typedef short opus_int16; + typedef unsigned short opus_uint16; + +#elif defined(__SYMBIAN32__) + + /* Symbian GCC */ + typedef signed short opus_int16; + typedef unsigned short opus_uint16; + typedef signed int opus_int32; + typedef unsigned int opus_uint32; + +#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) + + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef long opus_int32; + typedef unsigned long opus_uint32; + +#elif defined(CONFIG_TI_C6X) + + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; + +#else + + /* Give up, take a reasonable guess */ + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; + +#endif + +#define opus_int int /* used for counters etc; at least 16 bits */ +#define opus_int64 long long +#define opus_int8 signed char + +#define opus_uint unsigned int /* used for counters etc; at least 16 bits */ +#define opus_uint64 unsigned long long +#define opus_uint8 unsigned char + +#endif /* OPUS_TYPES_H */ diff --git a/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Opus b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Opus new file mode 100755 index 0000000..f6fa580 Binary files /dev/null and b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Opus differ diff --git a/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Resources/Info.plist b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..a76269b --- /dev/null +++ b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,42 @@ + + + + + BuildMachineOSBuild + 12F37 + CFBundleDevelopmentRegion + English + CFBundleExecutable + Opus + CFBundleIdentifier + com.ap4y.Opus.Opus + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Opus + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 5A1413 + DTPlatformVersion + GM + DTSDKBuild + 12D75 + DTSDKName + macosx10.8 + DTXcode + 0500 + DTXcodeBuild + 5A1413 + NSHumanReadableCopyright + Copyright © 2013 Arthur Evstifeev. All rights reserved. + + diff --git a/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/Current b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Audio-Frameworks/bin/opus/MacOS/Opus.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Audio-Frameworks/bin/opus/Opus.framework/Headers b/Audio-Frameworks/bin/opus/Opus.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Audio-Frameworks/bin/opus/Opus.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Audio-Frameworks/bin/opus/Opus.framework/Opus b/Audio-Frameworks/bin/opus/Opus.framework/Opus new file mode 120000 index 0000000..e38fe46 --- /dev/null +++ b/Audio-Frameworks/bin/opus/Opus.framework/Opus @@ -0,0 +1 @@ +Versions/Current/Opus \ No newline at end of file diff --git a/Audio-Frameworks/bin/opus/Opus.framework/Resources b/Audio-Frameworks/bin/opus/Opus.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/Audio-Frameworks/bin/opus/Opus.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Headers/opus.h b/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Headers/opus.h new file mode 100644 index 0000000..ce86038 --- /dev/null +++ b/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Headers/opus.h @@ -0,0 +1,906 @@ +/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited + Written by Jean-Marc Valin and Koen Vos */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @file opus.h + * @brief Opus reference implementation API + */ + +#ifndef OPUS_H +#define OPUS_H + +#include "opus_types.h" +#include "opus_defines.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @mainpage Opus + * + * The Opus codec is designed for interactive speech and audio transmission over the Internet. + * It is designed by the IETF Codec Working Group and incorporates technology from + * Skype's SILK codec and Xiph.Org's CELT codec. + * + * The Opus codec is designed to handle a wide range of interactive audio applications, + * including Voice over IP, videoconferencing, in-game chat, and even remote live music + * performances. It can scale from low bit-rate narrowband speech to very high quality + * stereo music. Its main features are: + + * @li Sampling rates from 8 to 48 kHz + * @li Bit-rates from 6 kb/s to 510 kb/s + * @li Support for both constant bit-rate (CBR) and variable bit-rate (VBR) + * @li Audio bandwidth from narrowband to full-band + * @li Support for speech and music + * @li Support for mono and stereo + * @li Support for multichannel (up to 255 channels) + * @li Frame sizes from 2.5 ms to 60 ms + * @li Good loss robustness and packet loss concealment (PLC) + * @li Floating point and fixed-point implementation + * + * Documentation sections: + * @li @ref opus_encoder + * @li @ref opus_decoder + * @li @ref opus_repacketizer + * @li @ref opus_multistream + * @li @ref opus_libinfo + * @li @ref opus_custom + */ + +/** @defgroup opus_encoder Opus Encoder + * @{ + * + * @brief This page describes the process and functions used to encode Opus. + * + * Since Opus is a stateful codec, the encoding process starts with creating an encoder + * state. This can be done with: + * + * @code + * int error; + * OpusEncoder *enc; + * enc = opus_encoder_create(Fs, channels, application, &error); + * @endcode + * + * From this point, @c enc can be used for encoding an audio stream. An encoder state + * @b must @b not be used for more than one stream at the same time. Similarly, the encoder + * state @b must @b not be re-initialized for each frame. + * + * While opus_encoder_create() allocates memory for the state, it's also possible + * to initialize pre-allocated memory: + * + * @code + * int size; + * int error; + * OpusEncoder *enc; + * size = opus_encoder_get_size(channels); + * enc = malloc(size); + * error = opus_encoder_init(enc, Fs, channels, application); + * @endcode + * + * where opus_encoder_get_size() returns the required size for the encoder state. Note that + * future versions of this code may change the size, so no assuptions should be made about it. + * + * The encoder state is always continuous in memory and only a shallow copy is sufficient + * to copy it (e.g. memcpy()) + * + * It is possible to change some of the encoder's settings using the opus_encoder_ctl() + * interface. All these settings already default to the recommended value, so they should + * only be changed when necessary. The most common settings one may want to change are: + * + * @code + * opus_encoder_ctl(enc, OPUS_SET_BITRATE(bitrate)); + * opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(complexity)); + * opus_encoder_ctl(enc, OPUS_SET_SIGNAL(signal_type)); + * @endcode + * + * where + * + * @arg bitrate is in bits per second (b/s) + * @arg complexity is a value from 1 to 10, where 1 is the lowest complexity and 10 is the highest + * @arg signal_type is either OPUS_AUTO (default), OPUS_SIGNAL_VOICE, or OPUS_SIGNAL_MUSIC + * + * See @ref opus_encoderctls and @ref opus_genericctls for a complete list of parameters that can be set or queried. Most parameters can be set or changed at any time during a stream. + * + * To encode a frame, opus_encode() or opus_encode_float() must be called with exactly one frame (2.5, 5, 10, 20, 40 or 60 ms) of audio data: + * @code + * len = opus_encode(enc, audio_frame, frame_size, packet, max_packet); + * @endcode + * + * where + *
    + *
  • audio_frame is the audio data in opus_int16 (or float for opus_encode_float())
  • + *
  • frame_size is the duration of the frame in samples (per channel)
  • + *
  • packet is the byte array to which the compressed data is written
  • + *
  • max_packet is the maximum number of bytes that can be written in the packet (4000 bytes is recommended). + * Do not use max_packet to control VBR target bitrate, instead use the #OPUS_SET_BITRATE CTL.
  • + *
+ * + * opus_encode() and opus_encode_float() return the number of bytes actually written to the packet. + * The return value can be negative, which indicates that an error has occurred. If the return value + * is 1 byte, then the packet does not need to be transmitted (DTX). + * + * Once the encoder state if no longer needed, it can be destroyed with + * + * @code + * opus_encoder_destroy(enc); + * @endcode + * + * If the encoder was created with opus_encoder_init() rather than opus_encoder_create(), + * then no action is required aside from potentially freeing the memory that was manually + * allocated for it (calling free(enc) for the example above) + * + */ + +/** Opus encoder state. + * This contains the complete state of an Opus encoder. + * It is position independent and can be freely copied. + * @see opus_encoder_create,opus_encoder_init + */ +typedef struct OpusEncoder OpusEncoder; + +/** Gets the size of an OpusEncoder structure. + * @param[in] channels int: Number of channels. + * This must be 1 or 2. + * @returns The size in bytes. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_encoder_get_size(int channels); + +/** + */ + +/** Allocates and initializes an encoder state. + * There are three coding modes: + * + * @ref OPUS_APPLICATION_VOIP gives best quality at a given bitrate for voice + * signals. It enhances the input signal by high-pass filtering and + * emphasizing formants and harmonics. Optionally it includes in-band + * forward error correction to protect against packet loss. Use this + * mode for typical VoIP applications. Because of the enhancement, + * even at high bitrates the output may sound different from the input. + * + * @ref OPUS_APPLICATION_AUDIO gives best quality at a given bitrate for most + * non-voice signals like music. Use this mode for music and mixed + * (music/voice) content, broadcast, and applications requiring less + * than 15 ms of coding delay. + * + * @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY configures low-delay mode that + * disables the speech-optimized mode in exchange for slightly reduced delay. + * This mode can only be set on an newly initialized or freshly reset encoder + * because it changes the codec delay. + * + * This is useful when the caller knows that the speech-optimized modes will not be needed (use with caution). + * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param [in] channels int: Number of channels (1 or 2) in input signal + * @param [in] application int: Coding mode (@ref OPUS_APPLICATION_VOIP/@ref OPUS_APPLICATION_AUDIO/@ref OPUS_APPLICATION_RESTRICTED_LOWDELAY) + * @param [out] error int*: @ref opus_errorcodes + * @note Regardless of the sampling rate and number channels selected, the Opus encoder + * can switch to a lower audio bandwidth or number of channels if the bitrate + * selected is too low. This also means that it is safe to always use 48 kHz stereo input + * and let the encoder optimize the encoding. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusEncoder *opus_encoder_create( + opus_int32 Fs, + int channels, + int application, + int *error +); + +/** Initializes a previously allocated encoder state + * The memory pointed to by st must be at least the size returned by opus_encoder_get_size(). + * This is intended for applications which use their own allocator instead of malloc. + * @see opus_encoder_create(),opus_encoder_get_size() + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @param [in] st OpusEncoder*: Encoder state + * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param [in] channels int: Number of channels (1 or 2) in input signal + * @param [in] application int: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY) + * @retval #OPUS_OK Success or @ref opus_errorcodes + */ +OPUS_EXPORT int opus_encoder_init( + OpusEncoder *st, + opus_int32 Fs, + int channels, + int application +) OPUS_ARG_NONNULL(1); + +/** Encodes an Opus frame. + * @param [in] st OpusEncoder*: Encoder state + * @param [in] pcm opus_int16*: Input signal (interleaved if 2 channels). length is frame_size*channels*sizeof(opus_int16) + * @param [in] frame_size int: Number of samples per channel in the + * input signal. + * This must be an Opus frame size for + * the encoder's sampling rate. + * For example, at 48 kHz the permitted + * values are 120, 240, 480, 960, 1920, + * and 2880. + * Passing in a duration of less than + * 10 ms (480 samples at 48 kHz) will + * prevent the encoder from using the LPC + * or hybrid modes. + * @param [out] data unsigned char*: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes opus_int32: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode( + OpusEncoder *st, + const opus_int16 *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + +/** Encodes an Opus frame from floating point input. + * @param [in] st OpusEncoder*: Encoder state + * @param [in] pcm float*: Input in float format (interleaved if 2 channels), with a normal range of +/-1.0. + * Samples with a range beyond +/-1.0 are supported but will + * be clipped by decoders using the integer API and should + * only be used if it is known that the far end supports + * extended dynamic range. + * length is frame_size*channels*sizeof(float) + * @param [in] frame_size int: Number of samples per channel in the + * input signal. + * This must be an Opus frame size for + * the encoder's sampling rate. + * For example, at 48 kHz the permitted + * values are 120, 240, 480, 960, 1920, + * and 2880. + * Passing in a duration of less than + * 10 ms (480 samples at 48 kHz) will + * prevent the encoder from using the LPC + * or hybrid modes. + * @param [out] data unsigned char*: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes opus_int32: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode_float( + OpusEncoder *st, + const float *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + +/** Frees an OpusEncoder allocated by opus_encoder_create(). + * @param[in] st OpusEncoder*: State to be freed. + */ +OPUS_EXPORT void opus_encoder_destroy(OpusEncoder *st); + +/** Perform a CTL function on an Opus encoder. + * + * Generally the request and subsequent arguments are generated + * by a convenience macro. + * @param st OpusEncoder*: Encoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls or + * @ref opus_encoderctls. + * @see opus_genericctls + * @see opus_encoderctls + */ +OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); +/**@}*/ + +/** @defgroup opus_decoder Opus Decoder + * @{ + * + * @brief This page describes the process and functions used to decode Opus. + * + * The decoding process also starts with creating a decoder + * state. This can be done with: + * @code + * int error; + * OpusDecoder *dec; + * dec = opus_decoder_create(Fs, channels, &error); + * @endcode + * where + * @li Fs is the sampling rate and must be 8000, 12000, 16000, 24000, or 48000 + * @li channels is the number of channels (1 or 2) + * @li error will hold the error code in case of failure (or #OPUS_OK on success) + * @li the return value is a newly created decoder state to be used for decoding + * + * While opus_decoder_create() allocates memory for the state, it's also possible + * to initialize pre-allocated memory: + * @code + * int size; + * int error; + * OpusDecoder *dec; + * size = opus_decoder_get_size(channels); + * dec = malloc(size); + * error = opus_decoder_init(dec, Fs, channels); + * @endcode + * where opus_decoder_get_size() returns the required size for the decoder state. Note that + * future versions of this code may change the size, so no assuptions should be made about it. + * + * The decoder state is always continuous in memory and only a shallow copy is sufficient + * to copy it (e.g. memcpy()) + * + * To decode a frame, opus_decode() or opus_decode_float() must be called with a packet of compressed audio data: + * @code + * frame_size = opus_decode(dec, packet, len, decoded, max_size, 0); + * @endcode + * where + * + * @li packet is the byte array containing the compressed data + * @li len is the exact number of bytes contained in the packet + * @li decoded is the decoded audio data in opus_int16 (or float for opus_decode_float()) + * @li max_size is the max duration of the frame in samples (per channel) that can fit into the decoded_frame array + * + * opus_decode() and opus_decode_float() return the number of samples (per channel) decoded from the packet. + * If that value is negative, then an error has occurred. This can occur if the packet is corrupted or if the audio + * buffer is too small to hold the decoded audio. + * + * Opus is a stateful codec with overlapping blocks and as a result Opus + * packets are not coded independently of each other. Packets must be + * passed into the decoder serially and in the correct order for a correct + * decode. Lost packets can be replaced with loss concealment by calling + * the decoder with a null pointer and zero length for the missing packet. + * + * A single codec state may only be accessed from a single thread at + * a time and any required locking must be performed by the caller. Separate + * streams must be decoded with separate decoder states and can be decoded + * in parallel unless the library was compiled with NONTHREADSAFE_PSEUDOSTACK + * defined. + * + */ + +/** Opus decoder state. + * This contains the complete state of an Opus decoder. + * It is position independent and can be freely copied. + * @see opus_decoder_create,opus_decoder_init + */ +typedef struct OpusDecoder OpusDecoder; + +/** Gets the size of an OpusDecoder structure. + * @param [in] channels int: Number of channels. + * This must be 1 or 2. + * @returns The size in bytes. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_size(int channels); + +/** Allocates and initializes a decoder state. + * @param [in] Fs opus_int32: Sample rate to decode at (Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param [in] channels int: Number of channels (1 or 2) to decode + * @param [out] error int*: #OPUS_OK Success or @ref opus_errorcodes + * + * Internally Opus stores data at 48000 Hz, so that should be the default + * value for Fs. However, the decoder can efficiently decode to buffers + * at 8, 12, 16, and 24 kHz so if for some reason the caller cannot use + * data at the full sample rate, or knows the compressed data doesn't + * use the full frequency range, it can request decoding at a reduced + * rate. Likewise, the decoder is capable of filling in either mono or + * interleaved stereo pcm buffers, at the caller's request. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusDecoder *opus_decoder_create( + opus_int32 Fs, + int channels, + int *error +); + +/** Initializes a previously allocated decoder state. + * The state must be at least the size returned by opus_decoder_get_size(). + * This is intended for applications which use their own allocator instead of malloc. @see opus_decoder_create,opus_decoder_get_size + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @param [in] st OpusDecoder*: Decoder state. + * @param [in] Fs opus_int32: Sampling rate to decode to (Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param [in] channels int: Number of channels (1 or 2) to decode + * @retval #OPUS_OK Success or @ref opus_errorcodes + */ +OPUS_EXPORT int opus_decoder_init( + OpusDecoder *st, + opus_int32 Fs, + int channels +) OPUS_ARG_NONNULL(1); + +/** Decode an Opus packet. + * @param [in] st OpusDecoder*: Decoder state + * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss + * @param [in] len opus_int32: Number of bytes in payload* + * @param [out] pcm opus_int16*: Output signal (interleaved if 2 channels). length + * is frame_size*channels*sizeof(opus_int16) + * @param [in] frame_size Number of samples per channel of available space in \a pcm. + * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will + * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), + * then frame_size needs to be exactly the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and + * FEC cases, frame_size must be a multiple of 2.5 ms. + * @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be + * decoded. If no such data is available, the frame is decoded as if it were lost. + * @returns Number of decoded samples or @ref opus_errorcodes + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode( + OpusDecoder *st, + const unsigned char *data, + opus_int32 len, + opus_int16 *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Decode an Opus packet with floating point output. + * @param [in] st OpusDecoder*: Decoder state + * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss + * @param [in] len opus_int32: Number of bytes in payload + * @param [out] pcm float*: Output signal (interleaved if 2 channels). length + * is frame_size*channels*sizeof(float) + * @param [in] frame_size Number of samples per channel of available space in \a pcm. + * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will + * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), + * then frame_size needs to be exactly the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and + * FEC cases, frame_size must be a multiple of 2.5 ms. + * @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be + * decoded. If no such data is available the frame is decoded as if it were lost. + * @returns Number of decoded samples or @ref opus_errorcodes + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode_float( + OpusDecoder *st, + const unsigned char *data, + opus_int32 len, + float *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Perform a CTL function on an Opus decoder. + * + * Generally the request and subsequent arguments are generated + * by a convenience macro. + * @param st OpusDecoder*: Decoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls or + * @ref opus_decoderctls. + * @see opus_genericctls + * @see opus_decoderctls + */ +OPUS_EXPORT int opus_decoder_ctl(OpusDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); + +/** Frees an OpusDecoder allocated by opus_decoder_create(). + * @param[in] st OpusDecoder*: State to be freed. + */ +OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st); + +/** Parse an opus packet into one or more frames. + * Opus_decode will perform this operation internally so most applications do + * not need to use this function. + * This function does not copy the frames, the returned pointers are pointers into + * the input packet. + * @param [in] data char*: Opus packet to be parsed + * @param [in] len opus_int32: size of data + * @param [out] out_toc char*: TOC pointer + * @param [out] frames char*[48] encapsulated frames + * @param [out] size opus_int16[48] sizes of the encapsulated frames + * @param [out] payload_offset int*: returns the position of the payload within the packet (in bytes) + * @returns number of frames + */ +OPUS_EXPORT int opus_packet_parse( + const unsigned char *data, + opus_int32 len, + unsigned char *out_toc, + const unsigned char *frames[48], + opus_int16 size[48], + int *payload_offset +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Gets the bandwidth of an Opus packet. + * @param [in] data char*: Opus packet + * @retval OPUS_BANDWIDTH_NARROWBAND Narrowband (4kHz bandpass) + * @retval OPUS_BANDWIDTH_MEDIUMBAND Mediumband (6kHz bandpass) + * @retval OPUS_BANDWIDTH_WIDEBAND Wideband (8kHz bandpass) + * @retval OPUS_BANDWIDTH_SUPERWIDEBAND Superwideband (12kHz bandpass) + * @retval OPUS_BANDWIDTH_FULLBAND Fullband (20kHz bandpass) + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_bandwidth(const unsigned char *data) OPUS_ARG_NONNULL(1); + +/** Gets the number of samples per frame from an Opus packet. + * @param [in] data char*: Opus packet. + * This must contain at least one byte of + * data. + * @param [in] Fs opus_int32: Sampling rate in Hz. + * This must be a multiple of 400, or + * inaccurate results will be returned. + * @returns Number of samples per frame. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_samples_per_frame(const unsigned char *data, opus_int32 Fs) OPUS_ARG_NONNULL(1); + +/** Gets the number of channels from an Opus packet. + * @param [in] data char*: Opus packet + * @returns Number of channels + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_channels(const unsigned char *data) OPUS_ARG_NONNULL(1); + +/** Gets the number of frames in an Opus packet. + * @param [in] packet char*: Opus packet + * @param [in] len opus_int32: Length of packet + * @returns Number of frames + * @retval OPUS_BAD_ARG Insufficient data was passed to the function + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_frames(const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1); + +/** Gets the number of samples of an Opus packet. + * @param [in] packet char*: Opus packet + * @param [in] len opus_int32: Length of packet + * @param [in] Fs opus_int32: Sampling rate in Hz. + * This must be a multiple of 400, or + * inaccurate results will be returned. + * @returns Number of samples + * @retval OPUS_BAD_ARG Insufficient data was passed to the function + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_samples(const unsigned char packet[], opus_int32 len, opus_int32 Fs) OPUS_ARG_NONNULL(1); + +/** Gets the number of samples of an Opus packet. + * @param [in] dec OpusDecoder*: Decoder state + * @param [in] packet char*: Opus packet + * @param [in] len opus_int32: Length of packet + * @returns Number of samples + * @retval OPUS_BAD_ARG Insufficient data was passed to the function + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_nb_samples(const OpusDecoder *dec, const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); +/**@}*/ + +/** @defgroup opus_repacketizer Repacketizer + * @{ + * + * The repacketizer can be used to merge multiple Opus packets into a single + * packet or alternatively to split Opus packets that have previously been + * merged. Splitting valid Opus packets is always guaranteed to succeed, + * whereas merging valid packets only succeeds if all frames have the same + * mode, bandwidth, and frame size, and when the total duration of the merged + * packet is no more than 120 ms. + * The repacketizer currently only operates on elementary Opus + * streams. It will not manipualte multistream packets successfully, except in + * the degenerate case where they consist of data from a single stream. + * + * The repacketizing process starts with creating a repacketizer state, either + * by calling opus_repacketizer_create() or by allocating the memory yourself, + * e.g., + * @code + * OpusRepacketizer *rp; + * rp = (OpusRepacketizer*)malloc(opus_repacketizer_get_size()); + * if (rp != NULL) + * opus_repacketizer_init(rp); + * @endcode + * + * Then the application should submit packets with opus_repacketizer_cat(), + * extract new packets with opus_repacketizer_out() or + * opus_repacketizer_out_range(), and then reset the state for the next set of + * input packets via opus_repacketizer_init(). + * + * For example, to split a sequence of packets into individual frames: + * @code + * unsigned char *data; + * int len; + * while (get_next_packet(&data, &len)) + * { + * unsigned char out[1276]; + * opus_int32 out_len; + * int nb_frames; + * int err; + * int i; + * err = opus_repacketizer_cat(rp, data, len); + * if (err != OPUS_OK) + * { + * release_packet(data); + * return err; + * } + * nb_frames = opus_repacketizer_get_nb_frames(rp); + * for (i = 0; i < nb_frames; i++) + * { + * out_len = opus_repacketizer_out_range(rp, i, i+1, out, sizeof(out)); + * if (out_len < 0) + * { + * release_packet(data); + * return (int)out_len; + * } + * output_next_packet(out, out_len); + * } + * opus_repacketizer_init(rp); + * release_packet(data); + * } + * @endcode + * + * Alternatively, to combine a sequence of frames into packets that each + * contain up to TARGET_DURATION_MS milliseconds of data: + * @code + * // The maximum number of packets with duration TARGET_DURATION_MS occurs + * // when the frame size is 2.5 ms, for a total of (TARGET_DURATION_MS*2/5) + * // packets. + * unsigned char *data[(TARGET_DURATION_MS*2/5)+1]; + * opus_int32 len[(TARGET_DURATION_MS*2/5)+1]; + * int nb_packets; + * unsigned char out[1277*(TARGET_DURATION_MS*2/2)]; + * opus_int32 out_len; + * int prev_toc; + * nb_packets = 0; + * while (get_next_packet(data+nb_packets, len+nb_packets)) + * { + * int nb_frames; + * int err; + * nb_frames = opus_packet_get_nb_frames(data[nb_packets], len[nb_packets]); + * if (nb_frames < 1) + * { + * release_packets(data, nb_packets+1); + * return nb_frames; + * } + * nb_frames += opus_repacketizer_get_nb_frames(rp); + * // If adding the next packet would exceed our target, or it has an + * // incompatible TOC sequence, output the packets we already have before + * // submitting it. + * // N.B., The nb_packets > 0 check ensures we've submitted at least one + * // packet since the last call to opus_repacketizer_init(). Otherwise a + * // single packet longer than TARGET_DURATION_MS would cause us to try to + * // output an (invalid) empty packet. It also ensures that prev_toc has + * // been set to a valid value. Additionally, len[nb_packets] > 0 is + * // guaranteed by the call to opus_packet_get_nb_frames() above, so the + * // reference to data[nb_packets][0] should be valid. + * if (nb_packets > 0 && ( + * ((prev_toc & 0xFC) != (data[nb_packets][0] & 0xFC)) || + * opus_packet_get_samples_per_frame(data[nb_packets], 48000)*nb_frames > + * TARGET_DURATION_MS*48)) + * { + * out_len = opus_repacketizer_out(rp, out, sizeof(out)); + * if (out_len < 0) + * { + * release_packets(data, nb_packets+1); + * return (int)out_len; + * } + * output_next_packet(out, out_len); + * opus_repacketizer_init(rp); + * release_packets(data, nb_packets); + * data[0] = data[nb_packets]; + * len[0] = len[nb_packets]; + * nb_packets = 0; + * } + * err = opus_repacketizer_cat(rp, data[nb_packets], len[nb_packets]); + * if (err != OPUS_OK) + * { + * release_packets(data, nb_packets+1); + * return err; + * } + * prev_toc = data[nb_packets][0]; + * nb_packets++; + * } + * // Output the final, partial packet. + * if (nb_packets > 0) + * { + * out_len = opus_repacketizer_out(rp, out, sizeof(out)); + * release_packets(data, nb_packets); + * if (out_len < 0) + * return (int)out_len; + * output_next_packet(out, out_len); + * } + * @endcode + * + * An alternate way of merging packets is to simply call opus_repacketizer_cat() + * unconditionally until it fails. At that point, the merged packet can be + * obtained with opus_repacketizer_out() and the input packet for which + * opus_repacketizer_cat() needs to be re-added to a newly reinitialized + * repacketizer state. + */ + +typedef struct OpusRepacketizer OpusRepacketizer; + +/** Gets the size of an OpusRepacketizer structure. + * @returns The size in bytes. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_size(void); + +/** (Re)initializes a previously allocated repacketizer state. + * The state must be at least the size returned by opus_repacketizer_get_size(). + * This can be used for applications which use their own allocator instead of + * malloc(). + * It must also be called to reset the queue of packets waiting to be + * repacketized, which is necessary if the maximum packet duration of 120 ms + * is reached or if you wish to submit packets with a different Opus + * configuration (coding mode, audio bandwidth, frame size, or channel count). + * Failure to do so will prevent a new packet from being added with + * opus_repacketizer_cat(). + * @see opus_repacketizer_create + * @see opus_repacketizer_get_size + * @see opus_repacketizer_cat + * @param rp OpusRepacketizer*: The repacketizer state to + * (re)initialize. + * @returns A pointer to the same repacketizer state that was passed in. + */ +OPUS_EXPORT OpusRepacketizer *opus_repacketizer_init(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); + +/** Allocates memory and initializes the new repacketizer with + * opus_repacketizer_init(). + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusRepacketizer *opus_repacketizer_create(void); + +/** Frees an OpusRepacketizer allocated by + * opus_repacketizer_create(). + * @param[in] rp OpusRepacketizer*: State to be freed. + */ +OPUS_EXPORT void opus_repacketizer_destroy(OpusRepacketizer *rp); + +/** Add a packet to the current repacketizer state. + * This packet must match the configuration of any packets already submitted + * for repacketization since the last call to opus_repacketizer_init(). + * This means that it must have the same coding mode, audio bandwidth, frame + * size, and channel count. + * This can be checked in advance by examining the top 6 bits of the first + * byte of the packet, and ensuring they match the top 6 bits of the first + * byte of any previously submitted packet. + * The total duration of audio in the repacketizer state also must not exceed + * 120 ms, the maximum duration of a single packet, after adding this packet. + * + * The contents of the current repacketizer state can be extracted into new + * packets using opus_repacketizer_out() or opus_repacketizer_out_range(). + * + * In order to add a packet with a different configuration or to add more + * audio beyond 120 ms, you must clear the repacketizer state by calling + * opus_repacketizer_init(). + * If a packet is too large to add to the current repacketizer state, no part + * of it is added, even if it contains multiple frames, some of which might + * fit. + * If you wish to be able to add parts of such packets, you should first use + * another repacketizer to split the packet into pieces and add them + * individually. + * @see opus_repacketizer_out_range + * @see opus_repacketizer_out + * @see opus_repacketizer_init + * @param rp OpusRepacketizer*: The repacketizer state to which to + * add the packet. + * @param[in] data const unsigned char*: The packet data. + * The application must ensure + * this pointer remains valid + * until the next call to + * opus_repacketizer_init() or + * opus_repacketizer_destroy(). + * @param len opus_int32: The number of bytes in the packet data. + * @returns An error code indicating whether or not the operation succeeded. + * @retval #OPUS_OK The packet's contents have been added to the repacketizer + * state. + * @retval #OPUS_INVALID_PACKET The packet did not have a valid TOC sequence, + * the packet's TOC sequence was not compatible + * with previously submitted packets (because + * the coding mode, audio bandwidth, frame size, + * or channel count did not match), or adding + * this packet would increase the total amount of + * audio stored in the repacketizer state to more + * than 120 ms. + */ +OPUS_EXPORT int opus_repacketizer_cat(OpusRepacketizer *rp, const unsigned char *data, opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); + + +/** Construct a new packet from data previously submitted to the repacketizer + * state via opus_repacketizer_cat(). + * @param rp OpusRepacketizer*: The repacketizer state from which to + * construct the new packet. + * @param begin int: The index of the first frame in the current + * repacketizer state to include in the output. + * @param end int: One past the index of the last frame in the + * current repacketizer state to include in the + * output. + * @param[out] data const unsigned char*: The buffer in which to + * store the output packet. + * @param maxlen opus_int32: The maximum number of bytes to store in + * the output buffer. In order to guarantee + * success, this should be at least + * 1276 for a single frame, + * or for multiple frames, + * 1277*(end-begin). + * However, 1*(end-begin) plus + * the size of all packet data submitted to + * the repacketizer since the last call to + * opus_repacketizer_init() or + * opus_repacketizer_create() is also + * sufficient, and possibly much smaller. + * @returns The total size of the output packet on success, or an error code + * on failure. + * @retval #OPUS_BAD_ARG [begin,end) was an invalid range of + * frames (begin < 0, begin >= end, or end > + * opus_repacketizer_get_nb_frames()). + * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the + * complete output packet. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out_range(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Return the total number of frames contained in packet data submitted to + * the repacketizer state so far via opus_repacketizer_cat() since the last + * call to opus_repacketizer_init() or opus_repacketizer_create(). + * This defines the valid range of packets that can be extracted with + * opus_repacketizer_out_range() or opus_repacketizer_out(). + * @param rp OpusRepacketizer*: The repacketizer state containing the + * frames. + * @returns The total number of frames contained in the packet data submitted + * to the repacketizer state. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_nb_frames(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); + +/** Construct a new packet from data previously submitted to the repacketizer + * state via opus_repacketizer_cat(). + * This is a convenience routine that returns all the data submitted so far + * in a single packet. + * It is equivalent to calling + * @code + * opus_repacketizer_out_range(rp, 0, opus_repacketizer_get_nb_frames(rp), + * data, maxlen) + * @endcode + * @param rp OpusRepacketizer*: The repacketizer state from which to + * construct the new packet. + * @param[out] data const unsigned char*: The buffer in which to + * store the output packet. + * @param maxlen opus_int32: The maximum number of bytes to store in + * the output buffer. In order to guarantee + * success, this should be at least + * 1277*opus_repacketizer_get_nb_frames(rp). + * However, + * 1*opus_repacketizer_get_nb_frames(rp) + * plus the size of all packet data + * submitted to the repacketizer since the + * last call to opus_repacketizer_init() or + * opus_repacketizer_create() is also + * sufficient, and possibly much smaller. + * @returns The total size of the output packet on success, or an error code + * on failure. + * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the + * complete output packet. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1); + +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* OPUS_H */ diff --git a/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Headers/opus_defines.h b/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Headers/opus_defines.h new file mode 100644 index 0000000..9fa3ccb --- /dev/null +++ b/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Headers/opus_defines.h @@ -0,0 +1,655 @@ +/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited + Written by Jean-Marc Valin and Koen Vos */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @file opus_defines.h + * @brief Opus reference implementation constants + */ + +#ifndef OPUS_DEFINES_H +#define OPUS_DEFINES_H + +#include "opus_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @defgroup opus_errorcodes Error codes + * @{ + */ +/** No error @hideinitializer*/ +#define OPUS_OK 0 +/** One or more invalid/out of range arguments @hideinitializer*/ +#define OPUS_BAD_ARG -1 +/** The mode struct passed is invalid @hideinitializer*/ +#define OPUS_BUFFER_TOO_SMALL -2 +/** An internal error was detected @hideinitializer*/ +#define OPUS_INTERNAL_ERROR -3 +/** The compressed data passed is corrupted @hideinitializer*/ +#define OPUS_INVALID_PACKET -4 +/** Invalid/unsupported request number @hideinitializer*/ +#define OPUS_UNIMPLEMENTED -5 +/** An encoder or decoder structure is invalid or already freed @hideinitializer*/ +#define OPUS_INVALID_STATE -6 +/** Memory allocation has failed @hideinitializer*/ +#define OPUS_ALLOC_FAIL -7 +/**@}*/ + +/** @cond OPUS_INTERNAL_DOC */ +/**Export control for opus functions */ + +#ifndef OPUS_EXPORT +# if defined(WIN32) +# ifdef OPUS_BUILD +# define OPUS_EXPORT __declspec(dllexport) +# else +# define OPUS_EXPORT +# endif +# elif defined(__GNUC__) && defined(OPUS_BUILD) +# define OPUS_EXPORT __attribute__ ((visibility ("default"))) +# else +# define OPUS_EXPORT +# endif +#endif + +# if !defined(OPUS_GNUC_PREREQ) +# if defined(__GNUC__)&&defined(__GNUC_MINOR__) +# define OPUS_GNUC_PREREQ(_maj,_min) \ + ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) +# else +# define OPUS_GNUC_PREREQ(_maj,_min) 0 +# endif +# endif + +#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) +# if OPUS_GNUC_PREREQ(3,0) +# define OPUS_RESTRICT __restrict__ +# elif (defined(_MSC_VER) && _MSC_VER >= 1400) +# define OPUS_RESTRICT __restrict +# else +# define OPUS_RESTRICT +# endif +#else +# define OPUS_RESTRICT restrict +#endif + +/**Warning attributes for opus functions + * NONNULL is not used in OPUS_BUILD to avoid the compiler optimizing out + * some paranoid null checks. */ +#if defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) +# define OPUS_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) +#else +# define OPUS_WARN_UNUSED_RESULT +#endif +#if !defined(OPUS_BUILD) && defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) +# define OPUS_ARG_NONNULL(_x) __attribute__ ((__nonnull__(_x))) +#else +# define OPUS_ARG_NONNULL(_x) +#endif + +/** These are the actual Encoder CTL ID numbers. + * They should not be used directly by applications. + * In general, SETs should be even and GETs should be odd.*/ +#define OPUS_SET_APPLICATION_REQUEST 4000 +#define OPUS_GET_APPLICATION_REQUEST 4001 +#define OPUS_SET_BITRATE_REQUEST 4002 +#define OPUS_GET_BITRATE_REQUEST 4003 +#define OPUS_SET_MAX_BANDWIDTH_REQUEST 4004 +#define OPUS_GET_MAX_BANDWIDTH_REQUEST 4005 +#define OPUS_SET_VBR_REQUEST 4006 +#define OPUS_GET_VBR_REQUEST 4007 +#define OPUS_SET_BANDWIDTH_REQUEST 4008 +#define OPUS_GET_BANDWIDTH_REQUEST 4009 +#define OPUS_SET_COMPLEXITY_REQUEST 4010 +#define OPUS_GET_COMPLEXITY_REQUEST 4011 +#define OPUS_SET_INBAND_FEC_REQUEST 4012 +#define OPUS_GET_INBAND_FEC_REQUEST 4013 +#define OPUS_SET_PACKET_LOSS_PERC_REQUEST 4014 +#define OPUS_GET_PACKET_LOSS_PERC_REQUEST 4015 +#define OPUS_SET_DTX_REQUEST 4016 +#define OPUS_GET_DTX_REQUEST 4017 +#define OPUS_SET_VBR_CONSTRAINT_REQUEST 4020 +#define OPUS_GET_VBR_CONSTRAINT_REQUEST 4021 +#define OPUS_SET_FORCE_CHANNELS_REQUEST 4022 +#define OPUS_GET_FORCE_CHANNELS_REQUEST 4023 +#define OPUS_SET_SIGNAL_REQUEST 4024 +#define OPUS_GET_SIGNAL_REQUEST 4025 +#define OPUS_GET_LOOKAHEAD_REQUEST 4027 +/* #define OPUS_RESET_STATE 4028 */ +#define OPUS_GET_SAMPLE_RATE_REQUEST 4029 +#define OPUS_GET_FINAL_RANGE_REQUEST 4031 +#define OPUS_GET_PITCH_REQUEST 4033 +#define OPUS_SET_GAIN_REQUEST 4034 +#define OPUS_GET_GAIN_REQUEST 4045 /* Should have been 4035 */ +#define OPUS_SET_LSB_DEPTH_REQUEST 4036 +#define OPUS_GET_LSB_DEPTH_REQUEST 4037 + +#define OPUS_GET_LAST_PACKET_DURATION_REQUEST 4039 + +/* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */ + +/* Macros to trigger compilation errors when the wrong types are provided to a CTL */ +#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x)) +#define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr))) +#define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr))) +/** @endcond */ + +/** @defgroup opus_ctlvalues Pre-defined values for CTL interface + * @see opus_genericctls, opus_encoderctls + * @{ + */ +/* Values for the various encoder CTLs */ +#define OPUS_AUTO -1000 /**opus_int32: Allowed values: 0-10, inclusive. + * + * @hideinitializer */ +#define OPUS_SET_COMPLEXITY(x) OPUS_SET_COMPLEXITY_REQUEST, __opus_check_int(x) +/** Gets the encoder's complexity configuration. + * @see OPUS_SET_COMPLEXITY + * @param[out] x opus_int32 *: Returns a value in the range 0-10, + * inclusive. + * @hideinitializer */ +#define OPUS_GET_COMPLEXITY(x) OPUS_GET_COMPLEXITY_REQUEST, __opus_check_int_ptr(x) + +/** Configures the bitrate in the encoder. + * Rates from 500 to 512000 bits per second are meaningful, as well as the + * special values #OPUS_AUTO and #OPUS_BITRATE_MAX. + * The value #OPUS_BITRATE_MAX can be used to cause the codec to use as much + * rate as it can, which is useful for controlling the rate by adjusting the + * output buffer size. + * @see OPUS_GET_BITRATE + * @param[in] x opus_int32: Bitrate in bits per second. The default + * is determined based on the number of + * channels and the input sampling rate. + * @hideinitializer */ +#define OPUS_SET_BITRATE(x) OPUS_SET_BITRATE_REQUEST, __opus_check_int(x) +/** Gets the encoder's bitrate configuration. + * @see OPUS_SET_BITRATE + * @param[out] x opus_int32 *: Returns the bitrate in bits per second. + * The default is determined based on the + * number of channels and the input + * sampling rate. + * @hideinitializer */ +#define OPUS_GET_BITRATE(x) OPUS_GET_BITRATE_REQUEST, __opus_check_int_ptr(x) + +/** Enables or disables variable bitrate (VBR) in the encoder. + * The configured bitrate may not be met exactly because frames must + * be an integer number of bytes in length. + * @warning Only the MDCT mode of Opus can provide hard CBR behavior. + * @see OPUS_GET_VBR + * @see OPUS_SET_VBR_CONSTRAINT + * @param[in] x opus_int32: Allowed values: + *
+ *
0
Hard CBR. For LPC/hybrid modes at very low bit-rate, this can + * cause noticeable quality degradation.
+ *
1
VBR (default). The exact type of VBR is controlled by + * #OPUS_SET_VBR_CONSTRAINT.
+ *
+ * @hideinitializer */ +#define OPUS_SET_VBR(x) OPUS_SET_VBR_REQUEST, __opus_check_int(x) +/** Determine if variable bitrate (VBR) is enabled in the encoder. + * @see OPUS_SET_VBR + * @see OPUS_GET_VBR_CONSTRAINT + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
0
Hard CBR.
+ *
1
VBR (default). The exact type of VBR may be retrieved via + * #OPUS_GET_VBR_CONSTRAINT.
+ *
+ * @hideinitializer */ +#define OPUS_GET_VBR(x) OPUS_GET_VBR_REQUEST, __opus_check_int_ptr(x) + +/** Enables or disables constrained VBR in the encoder. + * This setting is ignored when the encoder is in CBR mode. + * @warning Only the MDCT mode of Opus currently heeds the constraint. + * Speech mode ignores it completely, hybrid mode may fail to obey it + * if the LPC layer uses more bitrate than the constraint would have + * permitted. + * @see OPUS_GET_VBR_CONSTRAINT + * @see OPUS_SET_VBR + * @param[in] x opus_int32: Allowed values: + *
+ *
0
Unconstrained VBR.
+ *
1
Constrained VBR (default). This creates a maximum of one + * frame of buffering delay assuming a transport with a + * serialization speed of the nominal bitrate.
+ *
+ * @hideinitializer */ +#define OPUS_SET_VBR_CONSTRAINT(x) OPUS_SET_VBR_CONSTRAINT_REQUEST, __opus_check_int(x) +/** Determine if constrained VBR is enabled in the encoder. + * @see OPUS_SET_VBR_CONSTRAINT + * @see OPUS_GET_VBR + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
0
Unconstrained VBR.
+ *
1
Constrained VBR (default).
+ *
+ * @hideinitializer */ +#define OPUS_GET_VBR_CONSTRAINT(x) OPUS_GET_VBR_CONSTRAINT_REQUEST, __opus_check_int_ptr(x) + +/** Configures mono/stereo forcing in the encoder. + * This can force the encoder to produce packets encoded as either mono or + * stereo, regardless of the format of the input audio. This is useful when + * the caller knows that the input signal is currently a mono source embedded + * in a stereo stream. + * @see OPUS_GET_FORCE_CHANNELS + * @param[in] x opus_int32: Allowed values: + *
+ *
#OPUS_AUTO
Not forced (default)
+ *
1
Forced mono
+ *
2
Forced stereo
+ *
+ * @hideinitializer */ +#define OPUS_SET_FORCE_CHANNELS(x) OPUS_SET_FORCE_CHANNELS_REQUEST, __opus_check_int(x) +/** Gets the encoder's forced channel configuration. + * @see OPUS_SET_FORCE_CHANNELS + * @param[out] x opus_int32 *: + *
+ *
#OPUS_AUTO
Not forced (default)
+ *
1
Forced mono
+ *
2
Forced stereo
+ *
+ * @hideinitializer */ +#define OPUS_GET_FORCE_CHANNELS(x) OPUS_GET_FORCE_CHANNELS_REQUEST, __opus_check_int_ptr(x) + +/** Configures the maximum bandpass that the encoder will select automatically. + * Applications should normally use this instead of #OPUS_SET_BANDWIDTH + * (leaving that set to the default, #OPUS_AUTO). This allows the + * application to set an upper bound based on the type of input it is + * providing, but still gives the encoder the freedom to reduce the bandpass + * when the bitrate becomes too low, for better overall quality. + * @see OPUS_GET_MAX_BANDWIDTH + * @param[in] x opus_int32: Allowed values: + *
+ *
OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
+ *
OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
+ *
OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
+ *
OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
+ *
OPUS_BANDWIDTH_FULLBAND
20 kHz passband (default)
+ *
+ * @hideinitializer */ +#define OPUS_SET_MAX_BANDWIDTH(x) OPUS_SET_MAX_BANDWIDTH_REQUEST, __opus_check_int(x) + +/** Gets the encoder's configured maximum allowed bandpass. + * @see OPUS_SET_MAX_BANDWIDTH + * @param[out] x opus_int32 *: Allowed values: + *
+ *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
+ *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
+ *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
+ *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
+ *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband (default)
+ *
+ * @hideinitializer */ +#define OPUS_GET_MAX_BANDWIDTH(x) OPUS_GET_MAX_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) + +/** Sets the encoder's bandpass to a specific value. + * This prevents the encoder from automatically selecting the bandpass based + * on the available bitrate. If an application knows the bandpass of the input + * audio it is providing, it should normally use #OPUS_SET_MAX_BANDWIDTH + * instead, which still gives the encoder the freedom to reduce the bandpass + * when the bitrate becomes too low, for better overall quality. + * @see OPUS_GET_BANDWIDTH + * @param[in] x opus_int32: Allowed values: + *
+ *
#OPUS_AUTO
(default)
+ *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
+ *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
+ *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
+ *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
+ *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband
+ *
+ * @hideinitializer */ +#define OPUS_SET_BANDWIDTH(x) OPUS_SET_BANDWIDTH_REQUEST, __opus_check_int(x) + +/** Configures the type of signal being encoded. + * This is a hint which helps the encoder's mode selection. + * @see OPUS_GET_SIGNAL + * @param[in] x opus_int32: Allowed values: + *
+ *
#OPUS_AUTO
(default)
+ *
#OPUS_SIGNAL_VOICE
Bias thresholds towards choosing LPC or Hybrid modes.
+ *
#OPUS_SIGNAL_MUSIC
Bias thresholds towards choosing MDCT modes.
+ *
+ * @hideinitializer */ +#define OPUS_SET_SIGNAL(x) OPUS_SET_SIGNAL_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured signal type. + * @see OPUS_SET_SIGNAL + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
#OPUS_AUTO
(default)
+ *
#OPUS_SIGNAL_VOICE
Bias thresholds towards choosing LPC or Hybrid modes.
+ *
#OPUS_SIGNAL_MUSIC
Bias thresholds towards choosing MDCT modes.
+ *
+ * @hideinitializer */ +#define OPUS_GET_SIGNAL(x) OPUS_GET_SIGNAL_REQUEST, __opus_check_int_ptr(x) + + +/** Configures the encoder's intended application. + * The initial value is a mandatory argument to the encoder_create function. + * @see OPUS_GET_APPLICATION + * @param[in] x opus_int32: Returns one of the following values: + *
+ *
#OPUS_APPLICATION_VOIP
+ *
Process signal for improved speech intelligibility.
+ *
#OPUS_APPLICATION_AUDIO
+ *
Favor faithfulness to the original input.
+ *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
+ *
Configure the minimum possible coding delay by disabling certain modes + * of operation.
+ *
+ * @hideinitializer */ +#define OPUS_SET_APPLICATION(x) OPUS_SET_APPLICATION_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured application. + * @see OPUS_SET_APPLICATION + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
#OPUS_APPLICATION_VOIP
+ *
Process signal for improved speech intelligibility.
+ *
#OPUS_APPLICATION_AUDIO
+ *
Favor faithfulness to the original input.
+ *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
+ *
Configure the minimum possible coding delay by disabling certain modes + * of operation.
+ *
+ * @hideinitializer */ +#define OPUS_GET_APPLICATION(x) OPUS_GET_APPLICATION_REQUEST, __opus_check_int_ptr(x) + +/** Gets the sampling rate the encoder or decoder was initialized with. + * This simply returns the Fs value passed to opus_encoder_init() + * or opus_decoder_init(). + * @param[out] x opus_int32 *: Sampling rate of encoder or decoder. + * @hideinitializer + */ +#define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_ptr(x) + +/** Gets the total samples of delay added by the entire codec. + * This can be queried by the encoder and then the provided number of samples can be + * skipped on from the start of the decoder's output to provide time aligned input + * and output. From the perspective of a decoding application the real data begins this many + * samples late. + * + * The decoder contribution to this delay is identical for all decoders, but the + * encoder portion of the delay may vary from implementation to implementation, + * version to version, or even depend on the encoder's initial configuration. + * Applications needing delay compensation should call this CTL rather than + * hard-coding a value. + * @param[out] x opus_int32 *: Number of lookahead samples + * @hideinitializer */ +#define OPUS_GET_LOOKAHEAD(x) OPUS_GET_LOOKAHEAD_REQUEST, __opus_check_int_ptr(x) + +/** Configures the encoder's use of inband forward error correction (FEC). + * @note This is only applicable to the LPC layer + * @see OPUS_GET_INBAND_FEC + * @param[in] x opus_int32: Allowed values: + *
+ *
0
Disable inband FEC (default).
+ *
1
Enable inband FEC.
+ *
+ * @hideinitializer */ +#define OPUS_SET_INBAND_FEC(x) OPUS_SET_INBAND_FEC_REQUEST, __opus_check_int(x) +/** Gets encoder's configured use of inband forward error correction. + * @see OPUS_SET_INBAND_FEC + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
0
Inband FEC disabled (default).
+ *
1
Inband FEC enabled.
+ *
+ * @hideinitializer */ +#define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x) + +/** Configures the encoder's expected packet loss percentage. + * Higher values with trigger progressively more loss resistant behavior in the encoder + * at the expense of quality at a given bitrate in the lossless case, but greater quality + * under loss. + * @see OPUS_GET_PACKET_LOSS_PERC + * @param[in] x opus_int32: Loss percentage in the range 0-100, inclusive (default: 0). + * @hideinitializer */ +#define OPUS_SET_PACKET_LOSS_PERC(x) OPUS_SET_PACKET_LOSS_PERC_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured packet loss percentage. + * @see OPUS_SET_PACKET_LOSS_PERC + * @param[out] x opus_int32 *: Returns the configured loss percentage + * in the range 0-100, inclusive (default: 0). + * @hideinitializer */ +#define OPUS_GET_PACKET_LOSS_PERC(x) OPUS_GET_PACKET_LOSS_PERC_REQUEST, __opus_check_int_ptr(x) + +/** Configures the encoder's use of discontinuous transmission (DTX). + * @note This is only applicable to the LPC layer + * @see OPUS_GET_DTX + * @param[in] x opus_int32: Allowed values: + *
+ *
0
Disable DTX (default).
+ *
1
Enabled DTX.
+ *
+ * @hideinitializer */ +#define OPUS_SET_DTX(x) OPUS_SET_DTX_REQUEST, __opus_check_int(x) +/** Gets encoder's configured use of discontinuous transmission. + * @see OPUS_SET_DTX + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
0
DTX disabled (default).
+ *
1
DTX enabled.
+ *
+ * @hideinitializer */ +#define OPUS_GET_DTX(x) OPUS_GET_DTX_REQUEST, __opus_check_int_ptr(x) +/** Configures the depth of signal being encoded. + * This is a hint which helps the encoder identify silence and near-silence. + * @see OPUS_GET_LSB_DEPTH + * @param[in] x opus_int32: Input precision in bits, between 8 and 24 + * (default: 24). + * @hideinitializer */ +#define OPUS_SET_LSB_DEPTH(x) OPUS_SET_LSB_DEPTH_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured signal depth. + * @see OPUS_SET_LSB_DEPTH + * @param[out] x opus_int32 *: Input precision in bits, between 8 and + * 24 (default: 24). + * @hideinitializer */ +#define OPUS_GET_LSB_DEPTH(x) OPUS_GET_LSB_DEPTH_REQUEST, __opus_check_int_ptr(x) + +/** Gets the duration (in samples) of the last packet successfully decoded or concealed. + * @param[out] x opus_int32 *: Number of samples (at current sampling rate). + * @hideinitializer */ +#define OPUS_GET_LAST_PACKET_DURATION(x) OPUS_GET_LAST_PACKET_DURATION_REQUEST, __opus_check_int_ptr(x) +/**@}*/ + +/** @defgroup opus_genericctls Generic CTLs + * + * These macros are used with the \c opus_decoder_ctl and + * \c opus_encoder_ctl calls to generate a particular + * request. + * + * When called on an \c OpusDecoder they apply to that + * particular decoder instance. When called on an + * \c OpusEncoder they apply to the corresponding setting + * on that encoder instance, if present. + * + * Some usage examples: + * + * @code + * int ret; + * opus_int32 pitch; + * ret = opus_decoder_ctl(dec_ctx, OPUS_GET_PITCH(&pitch)); + * if (ret == OPUS_OK) return ret; + * + * opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE); + * opus_decoder_ctl(dec_ctx, OPUS_RESET_STATE); + * + * opus_int32 enc_bw, dec_bw; + * opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&enc_bw)); + * opus_decoder_ctl(dec_ctx, OPUS_GET_BANDWIDTH(&dec_bw)); + * if (enc_bw != dec_bw) { + * printf("packet bandwidth mismatch!\n"); + * } + * @endcode + * + * @see opus_encoder, opus_decoder_ctl, opus_encoder_ctl, opus_decoderctls, opus_encoderctls + * @{ + */ + +/** Resets the codec state to be equivalent to a freshly initialized state. + * This should be called when switching streams in order to prevent + * the back to back decoding from giving different results from + * one at a time decoding. + * @hideinitializer */ +#define OPUS_RESET_STATE 4028 + +/** Gets the final state of the codec's entropy coder. + * This is used for testing purposes, + * The encoder and decoder state should be identical after coding a payload + * (assuming no data corruption or software bugs) + * + * @param[out] x opus_uint32 *: Entropy coder state + * + * @hideinitializer */ +#define OPUS_GET_FINAL_RANGE(x) OPUS_GET_FINAL_RANGE_REQUEST, __opus_check_uint_ptr(x) + +/** Gets the pitch of the last decoded frame, if available. + * This can be used for any post-processing algorithm requiring the use of pitch, + * e.g. time stretching/shortening. If the last frame was not voiced, or if the + * pitch was not coded in the frame, then zero is returned. + * + * This CTL is only implemented for decoder instances. + * + * @param[out] x opus_int32 *: pitch period at 48 kHz (or 0 if not available) + * + * @hideinitializer */ +#define OPUS_GET_PITCH(x) OPUS_GET_PITCH_REQUEST, __opus_check_int_ptr(x) + +/** Gets the encoder's configured bandpass or the decoder's last bandpass. + * @see OPUS_SET_BANDWIDTH + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
#OPUS_AUTO
(default)
+ *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
+ *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
+ *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
+ *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
+ *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband
+ *
+ * @hideinitializer */ +#define OPUS_GET_BANDWIDTH(x) OPUS_GET_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) + +/**@}*/ + +/** @defgroup opus_decoderctls Decoder related CTLs + * @see opus_genericctls, opus_encoderctls, opus_decoder + * @{ + */ + +/** Configures decoder gain adjustment. + * Scales the decoded output by a factor specified in Q8 dB units. + * This has a maximum range of -32768 to 32767 inclusive, and returns + * OPUS_BAD_ARG otherwise. The default is zero indicating no adjustment. + * This setting survives decoder reset. + * + * gain = pow(10, x/(20.0*256)) + * + * @param[in] x opus_int32: Amount to scale PCM signal by in Q8 dB units. + * @hideinitializer */ +#define OPUS_SET_GAIN(x) OPUS_SET_GAIN_REQUEST, __opus_check_int(x) +/** Gets the decoder's configured gain adjustment. @see OPUS_SET_GAIN + * + * @param[out] x opus_int32 *: Amount to scale PCM signal by in Q8 dB units. + * @hideinitializer */ +#define OPUS_GET_GAIN(x) OPUS_GET_GAIN_REQUEST, __opus_check_int_ptr(x) + +/**@}*/ + +/** @defgroup opus_libinfo Opus library information functions + * @{ + */ + +/** Converts an opus error code into a human readable string. + * + * @param[in] error int: Error number + * @returns Error string + */ +OPUS_EXPORT const char *opus_strerror(int error); + +/** Gets the libopus version string. + * + * @returns Version string + */ +OPUS_EXPORT const char *opus_get_version_string(void); +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* OPUS_DEFINES_H */ diff --git a/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Headers/opus_multistream.h b/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Headers/opus_multistream.h new file mode 100644 index 0000000..ae59979 --- /dev/null +++ b/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Headers/opus_multistream.h @@ -0,0 +1,660 @@ +/* Copyright (c) 2011 Xiph.Org Foundation + Written by Jean-Marc Valin */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @file opus_multistream.h + * @brief Opus reference implementation multistream API + */ + +#ifndef OPUS_MULTISTREAM_H +#define OPUS_MULTISTREAM_H + +#include "opus.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @cond OPUS_INTERNAL_DOC */ + +/** Macros to trigger compilation errors when the wrong types are provided to a + * CTL. */ +/**@{*/ +#define __opus_check_encstate_ptr(ptr) ((ptr) + ((ptr) - (OpusEncoder**)(ptr))) +#define __opus_check_decstate_ptr(ptr) ((ptr) + ((ptr) - (OpusDecoder**)(ptr))) +/**@}*/ + +/** These are the actual encoder and decoder CTL ID numbers. + * They should not be used directly by applications. + * In general, SETs should be even and GETs should be odd.*/ +/**@{*/ +#define OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST 5120 +#define OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST 5122 +/**@}*/ + +/** @endcond */ + +/** @defgroup opus_multistream_ctls Multistream specific encoder and decoder CTLs + * + * These are convenience macros that are specific to the + * opus_multistream_encoder_ctl() and opus_multistream_decoder_ctl() + * interface. + * The CTLs from @ref opus_genericctls, @ref opus_encoderctls, and + * @ref opus_decoderctls may be applied to a multistream encoder or decoder as + * well. + * In addition, you may retrieve the encoder or decoder state for an specific + * stream via #OPUS_MULTISTREAM_GET_ENCODER_STATE or + * #OPUS_MULTISTREAM_GET_DECODER_STATE and apply CTLs to it individually. + */ +/**@{*/ + +/** Gets the encoder state for an individual stream of a multistream encoder. + * @param[in] x opus_int32: The index of the stream whose encoder you + * wish to retrieve. + * This must be non-negative and less than + * the streams parameter used + * to initialize the encoder. + * @param[out] y OpusEncoder**: Returns a pointer to the given + * encoder state. + * @retval OPUS_BAD_ARG The index of the requested stream was out of range. + * @hideinitializer + */ +#define OPUS_MULTISTREAM_GET_ENCODER_STATE(x,y) OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST, __opus_check_int(x), __opus_check_encstate_ptr(y) + +/** Gets the decoder state for an individual stream of a multistream decoder. + * @param[in] x opus_int32: The index of the stream whose decoder you + * wish to retrieve. + * This must be non-negative and less than + * the streams parameter used + * to initialize the decoder. + * @param[out] y OpusDecoder**: Returns a pointer to the given + * decoder state. + * @retval OPUS_BAD_ARG The index of the requested stream was out of range. + * @hideinitializer + */ +#define OPUS_MULTISTREAM_GET_DECODER_STATE(x,y) OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST, __opus_check_int(x), __opus_check_decstate_ptr(y) + +/**@}*/ + +/** @defgroup opus_multistream Opus Multistream API + * @{ + * + * The multistream API allows individual Opus streams to be combined into a + * single packet, enabling support for up to 255 channels. Unlike an + * elementary Opus stream, the encoder and decoder must negotiate the channel + * configuration before the decoder can successfully interpret the data in the + * packets produced by the encoder. Some basic information, such as packet + * duration, can be computed without any special negotiation. + * + * The format for multistream Opus packets is defined in the + * Ogg + * encapsulation specification and is based on the self-delimited Opus + * framing described in Appendix B of RFC 6716. + * Normal Opus packets are just a degenerate case of multistream Opus packets, + * and can be encoded or decoded with the multistream API by setting + * streams to 1 when initializing the encoder or + * decoder. + * + * Multistream Opus streams can contain up to 255 elementary Opus streams. + * These may be either "uncoupled" or "coupled", indicating that the decoder + * is configured to decode them to either 1 or 2 channels, respectively. + * The streams are ordered so that all coupled streams appear at the + * beginning. + * + * A mapping table defines which decoded channel i + * should be used for each input/output (I/O) channel j. This table is + * typically provided as an unsigned char array. + * Let i = mapping[j] be the index for I/O channel j. + * If i < 2*coupled_streams, then I/O channel j is + * encoded as the left channel of stream (i/2) if i + * is even, or as the right channel of stream (i/2) if + * i is odd. Otherwise, I/O channel j is encoded as + * mono in stream (i - coupled_streams), unless it has the special + * value 255, in which case it is omitted from the encoding entirely (the + * decoder will reproduce it as silence). Each value i must either + * be the special value 255 or be less than streams + coupled_streams. + * + * The output channels specified by the encoder + * should use the + * Vorbis + * channel ordering. A decoder may wish to apply an additional permutation + * to the mapping the encoder used to achieve a different output channel + * order (e.g. for outputing in WAV order). + * + * Each multistream packet contains an Opus packet for each stream, and all of + * the Opus packets in a single multistream packet must have the same + * duration. Therefore the duration of a multistream packet can be extracted + * from the TOC sequence of the first stream, which is located at the + * beginning of the packet, just like an elementary Opus stream: + * + * @code + * int nb_samples; + * int nb_frames; + * nb_frames = opus_packet_get_nb_frames(data, len); + * if (nb_frames < 1) + * return nb_frames; + * nb_samples = opus_packet_get_samples_per_frame(data, 48000) * nb_frames; + * @endcode + * + * The general encoding and decoding process proceeds exactly the same as in + * the normal @ref opus_encoder and @ref opus_decoder APIs. + * See their documentation for an overview of how to use the corresponding + * multistream functions. + */ + +/** Opus multistream encoder state. + * This contains the complete state of a multistream Opus encoder. + * It is position independent and can be freely copied. + * @see opus_multistream_encoder_create + * @see opus_multistream_encoder_init + */ +typedef struct OpusMSEncoder OpusMSEncoder; + +/** Opus multistream decoder state. + * This contains the complete state of a multistream Opus decoder. + * It is position independent and can be freely copied. + * @see opus_multistream_decoder_create + * @see opus_multistream_decoder_init + */ +typedef struct OpusMSDecoder OpusMSDecoder; + +/**\name Multistream encoder functions */ +/**@{*/ + +/** Gets the size of an OpusMSEncoder structure. + * @param streams int: The total number of streams to encode from the + * input. + * This must be no more than 255. + * @param coupled_streams int: Number of coupled (2 channel) streams + * to encode. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * encoded channels (streams + + * coupled_streams) must be no + * more than 255. + * @returns The size in bytes on success, or a negative error code + * (see @ref opus_errorcodes) on error. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size( + int streams, + int coupled_streams +); + +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_surround_encoder_get_size( + int channels, + int mapping_family +); + + +/** Allocates and initializes a multistream encoder state. + * Call opus_multistream_encoder_destroy() to release + * this object when finished. + * @param Fs opus_int32: Sampling rate of the input signal (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels int: Number of channels in the input signal. + * This must be at most 255. + * It may be greater than the number of + * coded channels (streams + + * coupled_streams). + * @param streams int: The total number of streams to encode from the + * input. + * This must be no more than the number of channels. + * @param coupled_streams int: Number of coupled (2 channel) streams + * to encode. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * encoded channels (streams + + * coupled_streams) must be no + * more than the number of input channels. + * @param[in] mapping const unsigned char[channels]: Mapping from + * encoded channels to input channels, as described in + * @ref opus_multistream. As an extra constraint, the + * multistream encoder does not allow encoding coupled + * streams for which one channel is unused since this + * is never a good idea. + * @param application int: The target encoder application. + * This must be one of the following: + *
+ *
#OPUS_APPLICATION_VOIP
+ *
Process signal for improved speech intelligibility.
+ *
#OPUS_APPLICATION_AUDIO
+ *
Favor faithfulness to the original input.
+ *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
+ *
Configure the minimum possible coding delay by disabling certain modes + * of operation.
+ *
+ * @param[out] error int *: Returns #OPUS_OK on success, or an error + * code (see @ref opus_errorcodes) on + * failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create( + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping, + int application, + int *error +) OPUS_ARG_NONNULL(5); + +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_encoder_create( + opus_int32 Fs, + int channels, + int mapping_family, + int *streams, + int *coupled_streams, + unsigned char *mapping, + int application, + int *error +) OPUS_ARG_NONNULL(5); + +/** Initialize a previously allocated multistream encoder state. + * The memory pointed to by \a st must be at least the size returned by + * opus_multistream_encoder_get_size(). + * This is intended for applications which use their own allocator instead of + * malloc. + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @see opus_multistream_encoder_create + * @see opus_multistream_encoder_get_size + * @param st OpusMSEncoder*: Multistream encoder state to initialize. + * @param Fs opus_int32: Sampling rate of the input signal (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels int: Number of channels in the input signal. + * This must be at most 255. + * It may be greater than the number of + * coded channels (streams + + * coupled_streams). + * @param streams int: The total number of streams to encode from the + * input. + * This must be no more than the number of channels. + * @param coupled_streams int: Number of coupled (2 channel) streams + * to encode. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * encoded channels (streams + + * coupled_streams) must be no + * more than the number of input channels. + * @param[in] mapping const unsigned char[channels]: Mapping from + * encoded channels to input channels, as described in + * @ref opus_multistream. As an extra constraint, the + * multistream encoder does not allow encoding coupled + * streams for which one channel is unused since this + * is never a good idea. + * @param application int: The target encoder application. + * This must be one of the following: + *
+ *
#OPUS_APPLICATION_VOIP
+ *
Process signal for improved speech intelligibility.
+ *
#OPUS_APPLICATION_AUDIO
+ *
Favor faithfulness to the original input.
+ *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
+ *
Configure the minimum possible coding delay by disabling certain modes + * of operation.
+ *
+ * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) + * on failure. + */ +OPUS_EXPORT int opus_multistream_encoder_init( + OpusMSEncoder *st, + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping, + int application +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); + +OPUS_EXPORT int opus_multistream_surround_encoder_init( + OpusMSEncoder *st, + opus_int32 Fs, + int channels, + int mapping_family, + int *streams, + int *coupled_streams, + unsigned char *mapping, + int application +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); + +/** Encodes a multistream Opus frame. + * @param st OpusMSEncoder*: Multistream encoder state. + * @param[in] pcm const opus_int16*: The input signal as interleaved + * samples. + * This must contain + * frame_size*channels + * samples. + * @param frame_size int: Number of samples per channel in the input + * signal. + * This must be an Opus frame size for the + * encoder's sampling rate. + * For example, at 48 kHz the permitted values + * are 120, 240, 480, 960, 1920, and 2880. + * Passing in a duration of less than 10 ms + * (480 samples at 48 kHz) will prevent the + * encoder from using the LPC or hybrid modes. + * @param[out] data unsigned char*: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes opus_int32: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode( + OpusMSEncoder *st, + const opus_int16 *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + +/** Encodes a multistream Opus frame from floating point input. + * @param st OpusMSEncoder*: Multistream encoder state. + * @param[in] pcm const float*: The input signal as interleaved + * samples with a normal range of + * +/-1.0. + * Samples with a range beyond +/-1.0 + * are supported but will be clipped by + * decoders using the integer API and + * should only be used if it is known + * that the far end supports extended + * dynamic range. + * This must contain + * frame_size*channels + * samples. + * @param frame_size int: Number of samples per channel in the input + * signal. + * This must be an Opus frame size for the + * encoder's sampling rate. + * For example, at 48 kHz the permitted values + * are 120, 240, 480, 960, 1920, and 2880. + * Passing in a duration of less than 10 ms + * (480 samples at 48 kHz) will prevent the + * encoder from using the LPC or hybrid modes. + * @param[out] data unsigned char*: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes opus_int32: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float( + OpusMSEncoder *st, + const float *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + +/** Frees an OpusMSEncoder allocated by + * opus_multistream_encoder_create(). + * @param st OpusMSEncoder*: Multistream encoder state to be freed. + */ +OPUS_EXPORT void opus_multistream_encoder_destroy(OpusMSEncoder *st); + +/** Perform a CTL function on a multistream Opus encoder. + * + * Generally the request and subsequent arguments are generated by a + * convenience macro. + * @param st OpusMSEncoder*: Multistream encoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls, + * @ref opus_encoderctls, or @ref opus_multistream_ctls. + * @see opus_genericctls + * @see opus_encoderctls + * @see opus_multistream_ctls + */ +OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); + +/**@}*/ + +/**\name Multistream decoder functions */ +/**@{*/ + +/** Gets the size of an OpusMSDecoder structure. + * @param streams int: The total number of streams coded in the + * input. + * This must be no more than 255. + * @param coupled_streams int: Number streams to decode as coupled + * (2 channel) streams. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * coded channels (streams + + * coupled_streams) must be no + * more than 255. + * @returns The size in bytes on success, or a negative error code + * (see @ref opus_errorcodes) on error. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size( + int streams, + int coupled_streams +); + +/** Allocates and initializes a multistream decoder state. + * Call opus_multistream_decoder_destroy() to release + * this object when finished. + * @param Fs opus_int32: Sampling rate to decode at (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels int: Number of channels to output. + * This must be at most 255. + * It may be different from the number of coded + * channels (streams + + * coupled_streams). + * @param streams int: The total number of streams coded in the + * input. + * This must be no more than 255. + * @param coupled_streams int: Number of streams to decode as coupled + * (2 channel) streams. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * coded channels (streams + + * coupled_streams) must be no + * more than 255. + * @param[in] mapping const unsigned char[channels]: Mapping from + * coded channels to output channels, as described in + * @ref opus_multistream. + * @param[out] error int *: Returns #OPUS_OK on success, or an error + * code (see @ref opus_errorcodes) on + * failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create( + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping, + int *error +) OPUS_ARG_NONNULL(5); + +/** Intialize a previously allocated decoder state object. + * The memory pointed to by \a st must be at least the size returned by + * opus_multistream_encoder_get_size(). + * This is intended for applications which use their own allocator instead of + * malloc. + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @see opus_multistream_decoder_create + * @see opus_multistream_deocder_get_size + * @param st OpusMSEncoder*: Multistream encoder state to initialize. + * @param Fs opus_int32: Sampling rate to decode at (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels int: Number of channels to output. + * This must be at most 255. + * It may be different from the number of coded + * channels (streams + + * coupled_streams). + * @param streams int: The total number of streams coded in the + * input. + * This must be no more than 255. + * @param coupled_streams int: Number of streams to decode as coupled + * (2 channel) streams. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * coded channels (streams + + * coupled_streams) must be no + * more than 255. + * @param[in] mapping const unsigned char[channels]: Mapping from + * coded channels to output channels, as described in + * @ref opus_multistream. + * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) + * on failure. + */ +OPUS_EXPORT int opus_multistream_decoder_init( + OpusMSDecoder *st, + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); + +/** Decode a multistream Opus packet. + * @param st OpusMSDecoder*: Multistream decoder state. + * @param[in] data const unsigned char*: Input payload. + * Use a NULL + * pointer to indicate packet + * loss. + * @param len opus_int32: Number of bytes in payload. + * @param[out] pcm opus_int16*: Output signal, with interleaved + * samples. + * This must contain room for + * frame_size*channels + * samples. + * @param frame_size int: The number of samples per channel of + * available space in \a pcm. + * If this is less than the maximum packet duration + * (120 ms; 5760 for 48kHz), this function will not be capable + * of decoding some packets. In the case of PLC (data==NULL) + * or FEC (decode_fec=1), then frame_size needs to be exactly + * the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the + * next incoming packet. For the PLC and FEC cases, frame_size + * must be a multiple of 2.5 ms. + * @param decode_fec int: Flag (0 or 1) to request that any in-band + * forward error correction data be decoded. + * If no such data is available, the frame is + * decoded as if it were lost. + * @returns Number of samples decoded on success or a negative error code + * (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode( + OpusMSDecoder *st, + const unsigned char *data, + opus_int32 len, + opus_int16 *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Decode a multistream Opus packet with floating point output. + * @param st OpusMSDecoder*: Multistream decoder state. + * @param[in] data const unsigned char*: Input payload. + * Use a NULL + * pointer to indicate packet + * loss. + * @param len opus_int32: Number of bytes in payload. + * @param[out] pcm opus_int16*: Output signal, with interleaved + * samples. + * This must contain room for + * frame_size*channels + * samples. + * @param frame_size int: The number of samples per channel of + * available space in \a pcm. + * If this is less than the maximum packet duration + * (120 ms; 5760 for 48kHz), this function will not be capable + * of decoding some packets. In the case of PLC (data==NULL) + * or FEC (decode_fec=1), then frame_size needs to be exactly + * the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the + * next incoming packet. For the PLC and FEC cases, frame_size + * must be a multiple of 2.5 ms. + * @param decode_fec int: Flag (0 or 1) to request that any in-band + * forward error correction data be decoded. + * If no such data is available, the frame is + * decoded as if it were lost. + * @returns Number of samples decoded on success or a negative error code + * (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode_float( + OpusMSDecoder *st, + const unsigned char *data, + opus_int32 len, + float *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Perform a CTL function on a multistream Opus decoder. + * + * Generally the request and subsequent arguments are generated by a + * convenience macro. + * @param st OpusMSDecoder*: Multistream decoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls, + * @ref opus_decoderctls, or @ref opus_multistream_ctls. + * @see opus_genericctls + * @see opus_decoderctls + * @see opus_multistream_ctls + */ +OPUS_EXPORT int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); + +/** Frees an OpusMSDecoder allocated by + * opus_multistream_decoder_create(). + * @param st OpusMSDecoder: Multistream decoder state to be freed. + */ +OPUS_EXPORT void opus_multistream_decoder_destroy(OpusMSDecoder *st); + +/**@}*/ + +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* OPUS_MULTISTREAM_H */ diff --git a/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Headers/opus_types.h b/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Headers/opus_types.h new file mode 100644 index 0000000..b28e03a --- /dev/null +++ b/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Headers/opus_types.h @@ -0,0 +1,159 @@ +/* (C) COPYRIGHT 1994-2002 Xiph.Org Foundation */ +/* Modified by Jean-Marc Valin */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/* opus_types.h based on ogg_types.h from libogg */ + +/** + @file opus_types.h + @brief Opus reference implementation types +*/ +#ifndef OPUS_TYPES_H +#define OPUS_TYPES_H + +/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */ +#if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H)) +#include + + typedef int16_t opus_int16; + typedef uint16_t opus_uint16; + typedef int32_t opus_int32; + typedef uint32_t opus_uint32; +#elif defined(_WIN32) + +# if defined(__CYGWIN__) +# include <_G_config.h> + typedef _G_int32_t opus_int32; + typedef _G_uint32_t opus_uint32; + typedef _G_int16 opus_int16; + typedef _G_uint16 opus_uint16; +# elif defined(__MINGW32__) + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; +# elif defined(__MWERKS__) + typedef int opus_int32; + typedef unsigned int opus_uint32; + typedef short opus_int16; + typedef unsigned short opus_uint16; +# else + /* MSVC/Borland */ + typedef __int32 opus_int32; + typedef unsigned __int32 opus_uint32; + typedef __int16 opus_int16; + typedef unsigned __int16 opus_uint16; +# endif + +#elif defined(__MACOS__) + +# include + typedef SInt16 opus_int16; + typedef UInt16 opus_uint16; + typedef SInt32 opus_int32; + typedef UInt32 opus_uint32; + +#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ + +# include + typedef int16_t opus_int16; + typedef u_int16_t opus_uint16; + typedef int32_t opus_int32; + typedef u_int32_t opus_uint32; + +#elif defined(__BEOS__) + + /* Be */ +# include + typedef int16 opus_int16; + typedef u_int16 opus_uint16; + typedef int32_t opus_int32; + typedef u_int32_t opus_uint32; + +#elif defined (__EMX__) + + /* OS/2 GCC */ + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; + +#elif defined (DJGPP) + + /* DJGPP */ + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; + +#elif defined(R5900) + + /* PS2 EE */ + typedef int opus_int32; + typedef unsigned opus_uint32; + typedef short opus_int16; + typedef unsigned short opus_uint16; + +#elif defined(__SYMBIAN32__) + + /* Symbian GCC */ + typedef signed short opus_int16; + typedef unsigned short opus_uint16; + typedef signed int opus_int32; + typedef unsigned int opus_uint32; + +#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) + + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef long opus_int32; + typedef unsigned long opus_uint32; + +#elif defined(CONFIG_TI_C6X) + + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; + +#else + + /* Give up, take a reasonable guess */ + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; + +#endif + +#define opus_int int /* used for counters etc; at least 16 bits */ +#define opus_int64 long long +#define opus_int8 signed char + +#define opus_uint unsigned int /* used for counters etc; at least 16 bits */ +#define opus_uint64 unsigned long long +#define opus_uint8 unsigned char + +#endif /* OPUS_TYPES_H */ diff --git a/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Opus b/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Opus new file mode 100644 index 0000000..0465ecb Binary files /dev/null and b/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Opus differ diff --git a/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Resources/Info.plist b/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..6538bd8 Binary files /dev/null and b/Audio-Frameworks/bin/opus/Opus.framework/Versions/A/Resources/Info.plist differ diff --git a/Audio-Frameworks/bin/opus/Opus.framework/Versions/Current b/Audio-Frameworks/bin/opus/Opus.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Audio-Frameworks/bin/opus/Opus.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Audio-Frameworks/bin/opus/include/opus.h b/Audio-Frameworks/bin/opus/include/opus.h new file mode 100644 index 0000000..ce86038 --- /dev/null +++ b/Audio-Frameworks/bin/opus/include/opus.h @@ -0,0 +1,906 @@ +/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited + Written by Jean-Marc Valin and Koen Vos */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @file opus.h + * @brief Opus reference implementation API + */ + +#ifndef OPUS_H +#define OPUS_H + +#include "opus_types.h" +#include "opus_defines.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @mainpage Opus + * + * The Opus codec is designed for interactive speech and audio transmission over the Internet. + * It is designed by the IETF Codec Working Group and incorporates technology from + * Skype's SILK codec and Xiph.Org's CELT codec. + * + * The Opus codec is designed to handle a wide range of interactive audio applications, + * including Voice over IP, videoconferencing, in-game chat, and even remote live music + * performances. It can scale from low bit-rate narrowband speech to very high quality + * stereo music. Its main features are: + + * @li Sampling rates from 8 to 48 kHz + * @li Bit-rates from 6 kb/s to 510 kb/s + * @li Support for both constant bit-rate (CBR) and variable bit-rate (VBR) + * @li Audio bandwidth from narrowband to full-band + * @li Support for speech and music + * @li Support for mono and stereo + * @li Support for multichannel (up to 255 channels) + * @li Frame sizes from 2.5 ms to 60 ms + * @li Good loss robustness and packet loss concealment (PLC) + * @li Floating point and fixed-point implementation + * + * Documentation sections: + * @li @ref opus_encoder + * @li @ref opus_decoder + * @li @ref opus_repacketizer + * @li @ref opus_multistream + * @li @ref opus_libinfo + * @li @ref opus_custom + */ + +/** @defgroup opus_encoder Opus Encoder + * @{ + * + * @brief This page describes the process and functions used to encode Opus. + * + * Since Opus is a stateful codec, the encoding process starts with creating an encoder + * state. This can be done with: + * + * @code + * int error; + * OpusEncoder *enc; + * enc = opus_encoder_create(Fs, channels, application, &error); + * @endcode + * + * From this point, @c enc can be used for encoding an audio stream. An encoder state + * @b must @b not be used for more than one stream at the same time. Similarly, the encoder + * state @b must @b not be re-initialized for each frame. + * + * While opus_encoder_create() allocates memory for the state, it's also possible + * to initialize pre-allocated memory: + * + * @code + * int size; + * int error; + * OpusEncoder *enc; + * size = opus_encoder_get_size(channels); + * enc = malloc(size); + * error = opus_encoder_init(enc, Fs, channels, application); + * @endcode + * + * where opus_encoder_get_size() returns the required size for the encoder state. Note that + * future versions of this code may change the size, so no assuptions should be made about it. + * + * The encoder state is always continuous in memory and only a shallow copy is sufficient + * to copy it (e.g. memcpy()) + * + * It is possible to change some of the encoder's settings using the opus_encoder_ctl() + * interface. All these settings already default to the recommended value, so they should + * only be changed when necessary. The most common settings one may want to change are: + * + * @code + * opus_encoder_ctl(enc, OPUS_SET_BITRATE(bitrate)); + * opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(complexity)); + * opus_encoder_ctl(enc, OPUS_SET_SIGNAL(signal_type)); + * @endcode + * + * where + * + * @arg bitrate is in bits per second (b/s) + * @arg complexity is a value from 1 to 10, where 1 is the lowest complexity and 10 is the highest + * @arg signal_type is either OPUS_AUTO (default), OPUS_SIGNAL_VOICE, or OPUS_SIGNAL_MUSIC + * + * See @ref opus_encoderctls and @ref opus_genericctls for a complete list of parameters that can be set or queried. Most parameters can be set or changed at any time during a stream. + * + * To encode a frame, opus_encode() or opus_encode_float() must be called with exactly one frame (2.5, 5, 10, 20, 40 or 60 ms) of audio data: + * @code + * len = opus_encode(enc, audio_frame, frame_size, packet, max_packet); + * @endcode + * + * where + *
    + *
  • audio_frame is the audio data in opus_int16 (or float for opus_encode_float())
  • + *
  • frame_size is the duration of the frame in samples (per channel)
  • + *
  • packet is the byte array to which the compressed data is written
  • + *
  • max_packet is the maximum number of bytes that can be written in the packet (4000 bytes is recommended). + * Do not use max_packet to control VBR target bitrate, instead use the #OPUS_SET_BITRATE CTL.
  • + *
+ * + * opus_encode() and opus_encode_float() return the number of bytes actually written to the packet. + * The return value can be negative, which indicates that an error has occurred. If the return value + * is 1 byte, then the packet does not need to be transmitted (DTX). + * + * Once the encoder state if no longer needed, it can be destroyed with + * + * @code + * opus_encoder_destroy(enc); + * @endcode + * + * If the encoder was created with opus_encoder_init() rather than opus_encoder_create(), + * then no action is required aside from potentially freeing the memory that was manually + * allocated for it (calling free(enc) for the example above) + * + */ + +/** Opus encoder state. + * This contains the complete state of an Opus encoder. + * It is position independent and can be freely copied. + * @see opus_encoder_create,opus_encoder_init + */ +typedef struct OpusEncoder OpusEncoder; + +/** Gets the size of an OpusEncoder structure. + * @param[in] channels int: Number of channels. + * This must be 1 or 2. + * @returns The size in bytes. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_encoder_get_size(int channels); + +/** + */ + +/** Allocates and initializes an encoder state. + * There are three coding modes: + * + * @ref OPUS_APPLICATION_VOIP gives best quality at a given bitrate for voice + * signals. It enhances the input signal by high-pass filtering and + * emphasizing formants and harmonics. Optionally it includes in-band + * forward error correction to protect against packet loss. Use this + * mode for typical VoIP applications. Because of the enhancement, + * even at high bitrates the output may sound different from the input. + * + * @ref OPUS_APPLICATION_AUDIO gives best quality at a given bitrate for most + * non-voice signals like music. Use this mode for music and mixed + * (music/voice) content, broadcast, and applications requiring less + * than 15 ms of coding delay. + * + * @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY configures low-delay mode that + * disables the speech-optimized mode in exchange for slightly reduced delay. + * This mode can only be set on an newly initialized or freshly reset encoder + * because it changes the codec delay. + * + * This is useful when the caller knows that the speech-optimized modes will not be needed (use with caution). + * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param [in] channels int: Number of channels (1 or 2) in input signal + * @param [in] application int: Coding mode (@ref OPUS_APPLICATION_VOIP/@ref OPUS_APPLICATION_AUDIO/@ref OPUS_APPLICATION_RESTRICTED_LOWDELAY) + * @param [out] error int*: @ref opus_errorcodes + * @note Regardless of the sampling rate and number channels selected, the Opus encoder + * can switch to a lower audio bandwidth or number of channels if the bitrate + * selected is too low. This also means that it is safe to always use 48 kHz stereo input + * and let the encoder optimize the encoding. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusEncoder *opus_encoder_create( + opus_int32 Fs, + int channels, + int application, + int *error +); + +/** Initializes a previously allocated encoder state + * The memory pointed to by st must be at least the size returned by opus_encoder_get_size(). + * This is intended for applications which use their own allocator instead of malloc. + * @see opus_encoder_create(),opus_encoder_get_size() + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @param [in] st OpusEncoder*: Encoder state + * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param [in] channels int: Number of channels (1 or 2) in input signal + * @param [in] application int: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY) + * @retval #OPUS_OK Success or @ref opus_errorcodes + */ +OPUS_EXPORT int opus_encoder_init( + OpusEncoder *st, + opus_int32 Fs, + int channels, + int application +) OPUS_ARG_NONNULL(1); + +/** Encodes an Opus frame. + * @param [in] st OpusEncoder*: Encoder state + * @param [in] pcm opus_int16*: Input signal (interleaved if 2 channels). length is frame_size*channels*sizeof(opus_int16) + * @param [in] frame_size int: Number of samples per channel in the + * input signal. + * This must be an Opus frame size for + * the encoder's sampling rate. + * For example, at 48 kHz the permitted + * values are 120, 240, 480, 960, 1920, + * and 2880. + * Passing in a duration of less than + * 10 ms (480 samples at 48 kHz) will + * prevent the encoder from using the LPC + * or hybrid modes. + * @param [out] data unsigned char*: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes opus_int32: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode( + OpusEncoder *st, + const opus_int16 *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + +/** Encodes an Opus frame from floating point input. + * @param [in] st OpusEncoder*: Encoder state + * @param [in] pcm float*: Input in float format (interleaved if 2 channels), with a normal range of +/-1.0. + * Samples with a range beyond +/-1.0 are supported but will + * be clipped by decoders using the integer API and should + * only be used if it is known that the far end supports + * extended dynamic range. + * length is frame_size*channels*sizeof(float) + * @param [in] frame_size int: Number of samples per channel in the + * input signal. + * This must be an Opus frame size for + * the encoder's sampling rate. + * For example, at 48 kHz the permitted + * values are 120, 240, 480, 960, 1920, + * and 2880. + * Passing in a duration of less than + * 10 ms (480 samples at 48 kHz) will + * prevent the encoder from using the LPC + * or hybrid modes. + * @param [out] data unsigned char*: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes opus_int32: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode_float( + OpusEncoder *st, + const float *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + +/** Frees an OpusEncoder allocated by opus_encoder_create(). + * @param[in] st OpusEncoder*: State to be freed. + */ +OPUS_EXPORT void opus_encoder_destroy(OpusEncoder *st); + +/** Perform a CTL function on an Opus encoder. + * + * Generally the request and subsequent arguments are generated + * by a convenience macro. + * @param st OpusEncoder*: Encoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls or + * @ref opus_encoderctls. + * @see opus_genericctls + * @see opus_encoderctls + */ +OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); +/**@}*/ + +/** @defgroup opus_decoder Opus Decoder + * @{ + * + * @brief This page describes the process and functions used to decode Opus. + * + * The decoding process also starts with creating a decoder + * state. This can be done with: + * @code + * int error; + * OpusDecoder *dec; + * dec = opus_decoder_create(Fs, channels, &error); + * @endcode + * where + * @li Fs is the sampling rate and must be 8000, 12000, 16000, 24000, or 48000 + * @li channels is the number of channels (1 or 2) + * @li error will hold the error code in case of failure (or #OPUS_OK on success) + * @li the return value is a newly created decoder state to be used for decoding + * + * While opus_decoder_create() allocates memory for the state, it's also possible + * to initialize pre-allocated memory: + * @code + * int size; + * int error; + * OpusDecoder *dec; + * size = opus_decoder_get_size(channels); + * dec = malloc(size); + * error = opus_decoder_init(dec, Fs, channels); + * @endcode + * where opus_decoder_get_size() returns the required size for the decoder state. Note that + * future versions of this code may change the size, so no assuptions should be made about it. + * + * The decoder state is always continuous in memory and only a shallow copy is sufficient + * to copy it (e.g. memcpy()) + * + * To decode a frame, opus_decode() or opus_decode_float() must be called with a packet of compressed audio data: + * @code + * frame_size = opus_decode(dec, packet, len, decoded, max_size, 0); + * @endcode + * where + * + * @li packet is the byte array containing the compressed data + * @li len is the exact number of bytes contained in the packet + * @li decoded is the decoded audio data in opus_int16 (or float for opus_decode_float()) + * @li max_size is the max duration of the frame in samples (per channel) that can fit into the decoded_frame array + * + * opus_decode() and opus_decode_float() return the number of samples (per channel) decoded from the packet. + * If that value is negative, then an error has occurred. This can occur if the packet is corrupted or if the audio + * buffer is too small to hold the decoded audio. + * + * Opus is a stateful codec with overlapping blocks and as a result Opus + * packets are not coded independently of each other. Packets must be + * passed into the decoder serially and in the correct order for a correct + * decode. Lost packets can be replaced with loss concealment by calling + * the decoder with a null pointer and zero length for the missing packet. + * + * A single codec state may only be accessed from a single thread at + * a time and any required locking must be performed by the caller. Separate + * streams must be decoded with separate decoder states and can be decoded + * in parallel unless the library was compiled with NONTHREADSAFE_PSEUDOSTACK + * defined. + * + */ + +/** Opus decoder state. + * This contains the complete state of an Opus decoder. + * It is position independent and can be freely copied. + * @see opus_decoder_create,opus_decoder_init + */ +typedef struct OpusDecoder OpusDecoder; + +/** Gets the size of an OpusDecoder structure. + * @param [in] channels int: Number of channels. + * This must be 1 or 2. + * @returns The size in bytes. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_size(int channels); + +/** Allocates and initializes a decoder state. + * @param [in] Fs opus_int32: Sample rate to decode at (Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param [in] channels int: Number of channels (1 or 2) to decode + * @param [out] error int*: #OPUS_OK Success or @ref opus_errorcodes + * + * Internally Opus stores data at 48000 Hz, so that should be the default + * value for Fs. However, the decoder can efficiently decode to buffers + * at 8, 12, 16, and 24 kHz so if for some reason the caller cannot use + * data at the full sample rate, or knows the compressed data doesn't + * use the full frequency range, it can request decoding at a reduced + * rate. Likewise, the decoder is capable of filling in either mono or + * interleaved stereo pcm buffers, at the caller's request. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusDecoder *opus_decoder_create( + opus_int32 Fs, + int channels, + int *error +); + +/** Initializes a previously allocated decoder state. + * The state must be at least the size returned by opus_decoder_get_size(). + * This is intended for applications which use their own allocator instead of malloc. @see opus_decoder_create,opus_decoder_get_size + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @param [in] st OpusDecoder*: Decoder state. + * @param [in] Fs opus_int32: Sampling rate to decode to (Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param [in] channels int: Number of channels (1 or 2) to decode + * @retval #OPUS_OK Success or @ref opus_errorcodes + */ +OPUS_EXPORT int opus_decoder_init( + OpusDecoder *st, + opus_int32 Fs, + int channels +) OPUS_ARG_NONNULL(1); + +/** Decode an Opus packet. + * @param [in] st OpusDecoder*: Decoder state + * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss + * @param [in] len opus_int32: Number of bytes in payload* + * @param [out] pcm opus_int16*: Output signal (interleaved if 2 channels). length + * is frame_size*channels*sizeof(opus_int16) + * @param [in] frame_size Number of samples per channel of available space in \a pcm. + * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will + * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), + * then frame_size needs to be exactly the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and + * FEC cases, frame_size must be a multiple of 2.5 ms. + * @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be + * decoded. If no such data is available, the frame is decoded as if it were lost. + * @returns Number of decoded samples or @ref opus_errorcodes + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode( + OpusDecoder *st, + const unsigned char *data, + opus_int32 len, + opus_int16 *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Decode an Opus packet with floating point output. + * @param [in] st OpusDecoder*: Decoder state + * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss + * @param [in] len opus_int32: Number of bytes in payload + * @param [out] pcm float*: Output signal (interleaved if 2 channels). length + * is frame_size*channels*sizeof(float) + * @param [in] frame_size Number of samples per channel of available space in \a pcm. + * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will + * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), + * then frame_size needs to be exactly the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and + * FEC cases, frame_size must be a multiple of 2.5 ms. + * @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be + * decoded. If no such data is available the frame is decoded as if it were lost. + * @returns Number of decoded samples or @ref opus_errorcodes + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode_float( + OpusDecoder *st, + const unsigned char *data, + opus_int32 len, + float *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Perform a CTL function on an Opus decoder. + * + * Generally the request and subsequent arguments are generated + * by a convenience macro. + * @param st OpusDecoder*: Decoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls or + * @ref opus_decoderctls. + * @see opus_genericctls + * @see opus_decoderctls + */ +OPUS_EXPORT int opus_decoder_ctl(OpusDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); + +/** Frees an OpusDecoder allocated by opus_decoder_create(). + * @param[in] st OpusDecoder*: State to be freed. + */ +OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st); + +/** Parse an opus packet into one or more frames. + * Opus_decode will perform this operation internally so most applications do + * not need to use this function. + * This function does not copy the frames, the returned pointers are pointers into + * the input packet. + * @param [in] data char*: Opus packet to be parsed + * @param [in] len opus_int32: size of data + * @param [out] out_toc char*: TOC pointer + * @param [out] frames char*[48] encapsulated frames + * @param [out] size opus_int16[48] sizes of the encapsulated frames + * @param [out] payload_offset int*: returns the position of the payload within the packet (in bytes) + * @returns number of frames + */ +OPUS_EXPORT int opus_packet_parse( + const unsigned char *data, + opus_int32 len, + unsigned char *out_toc, + const unsigned char *frames[48], + opus_int16 size[48], + int *payload_offset +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Gets the bandwidth of an Opus packet. + * @param [in] data char*: Opus packet + * @retval OPUS_BANDWIDTH_NARROWBAND Narrowband (4kHz bandpass) + * @retval OPUS_BANDWIDTH_MEDIUMBAND Mediumband (6kHz bandpass) + * @retval OPUS_BANDWIDTH_WIDEBAND Wideband (8kHz bandpass) + * @retval OPUS_BANDWIDTH_SUPERWIDEBAND Superwideband (12kHz bandpass) + * @retval OPUS_BANDWIDTH_FULLBAND Fullband (20kHz bandpass) + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_bandwidth(const unsigned char *data) OPUS_ARG_NONNULL(1); + +/** Gets the number of samples per frame from an Opus packet. + * @param [in] data char*: Opus packet. + * This must contain at least one byte of + * data. + * @param [in] Fs opus_int32: Sampling rate in Hz. + * This must be a multiple of 400, or + * inaccurate results will be returned. + * @returns Number of samples per frame. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_samples_per_frame(const unsigned char *data, opus_int32 Fs) OPUS_ARG_NONNULL(1); + +/** Gets the number of channels from an Opus packet. + * @param [in] data char*: Opus packet + * @returns Number of channels + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_channels(const unsigned char *data) OPUS_ARG_NONNULL(1); + +/** Gets the number of frames in an Opus packet. + * @param [in] packet char*: Opus packet + * @param [in] len opus_int32: Length of packet + * @returns Number of frames + * @retval OPUS_BAD_ARG Insufficient data was passed to the function + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_frames(const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1); + +/** Gets the number of samples of an Opus packet. + * @param [in] packet char*: Opus packet + * @param [in] len opus_int32: Length of packet + * @param [in] Fs opus_int32: Sampling rate in Hz. + * This must be a multiple of 400, or + * inaccurate results will be returned. + * @returns Number of samples + * @retval OPUS_BAD_ARG Insufficient data was passed to the function + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_samples(const unsigned char packet[], opus_int32 len, opus_int32 Fs) OPUS_ARG_NONNULL(1); + +/** Gets the number of samples of an Opus packet. + * @param [in] dec OpusDecoder*: Decoder state + * @param [in] packet char*: Opus packet + * @param [in] len opus_int32: Length of packet + * @returns Number of samples + * @retval OPUS_BAD_ARG Insufficient data was passed to the function + * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_nb_samples(const OpusDecoder *dec, const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); +/**@}*/ + +/** @defgroup opus_repacketizer Repacketizer + * @{ + * + * The repacketizer can be used to merge multiple Opus packets into a single + * packet or alternatively to split Opus packets that have previously been + * merged. Splitting valid Opus packets is always guaranteed to succeed, + * whereas merging valid packets only succeeds if all frames have the same + * mode, bandwidth, and frame size, and when the total duration of the merged + * packet is no more than 120 ms. + * The repacketizer currently only operates on elementary Opus + * streams. It will not manipualte multistream packets successfully, except in + * the degenerate case where they consist of data from a single stream. + * + * The repacketizing process starts with creating a repacketizer state, either + * by calling opus_repacketizer_create() or by allocating the memory yourself, + * e.g., + * @code + * OpusRepacketizer *rp; + * rp = (OpusRepacketizer*)malloc(opus_repacketizer_get_size()); + * if (rp != NULL) + * opus_repacketizer_init(rp); + * @endcode + * + * Then the application should submit packets with opus_repacketizer_cat(), + * extract new packets with opus_repacketizer_out() or + * opus_repacketizer_out_range(), and then reset the state for the next set of + * input packets via opus_repacketizer_init(). + * + * For example, to split a sequence of packets into individual frames: + * @code + * unsigned char *data; + * int len; + * while (get_next_packet(&data, &len)) + * { + * unsigned char out[1276]; + * opus_int32 out_len; + * int nb_frames; + * int err; + * int i; + * err = opus_repacketizer_cat(rp, data, len); + * if (err != OPUS_OK) + * { + * release_packet(data); + * return err; + * } + * nb_frames = opus_repacketizer_get_nb_frames(rp); + * for (i = 0; i < nb_frames; i++) + * { + * out_len = opus_repacketizer_out_range(rp, i, i+1, out, sizeof(out)); + * if (out_len < 0) + * { + * release_packet(data); + * return (int)out_len; + * } + * output_next_packet(out, out_len); + * } + * opus_repacketizer_init(rp); + * release_packet(data); + * } + * @endcode + * + * Alternatively, to combine a sequence of frames into packets that each + * contain up to TARGET_DURATION_MS milliseconds of data: + * @code + * // The maximum number of packets with duration TARGET_DURATION_MS occurs + * // when the frame size is 2.5 ms, for a total of (TARGET_DURATION_MS*2/5) + * // packets. + * unsigned char *data[(TARGET_DURATION_MS*2/5)+1]; + * opus_int32 len[(TARGET_DURATION_MS*2/5)+1]; + * int nb_packets; + * unsigned char out[1277*(TARGET_DURATION_MS*2/2)]; + * opus_int32 out_len; + * int prev_toc; + * nb_packets = 0; + * while (get_next_packet(data+nb_packets, len+nb_packets)) + * { + * int nb_frames; + * int err; + * nb_frames = opus_packet_get_nb_frames(data[nb_packets], len[nb_packets]); + * if (nb_frames < 1) + * { + * release_packets(data, nb_packets+1); + * return nb_frames; + * } + * nb_frames += opus_repacketizer_get_nb_frames(rp); + * // If adding the next packet would exceed our target, or it has an + * // incompatible TOC sequence, output the packets we already have before + * // submitting it. + * // N.B., The nb_packets > 0 check ensures we've submitted at least one + * // packet since the last call to opus_repacketizer_init(). Otherwise a + * // single packet longer than TARGET_DURATION_MS would cause us to try to + * // output an (invalid) empty packet. It also ensures that prev_toc has + * // been set to a valid value. Additionally, len[nb_packets] > 0 is + * // guaranteed by the call to opus_packet_get_nb_frames() above, so the + * // reference to data[nb_packets][0] should be valid. + * if (nb_packets > 0 && ( + * ((prev_toc & 0xFC) != (data[nb_packets][0] & 0xFC)) || + * opus_packet_get_samples_per_frame(data[nb_packets], 48000)*nb_frames > + * TARGET_DURATION_MS*48)) + * { + * out_len = opus_repacketizer_out(rp, out, sizeof(out)); + * if (out_len < 0) + * { + * release_packets(data, nb_packets+1); + * return (int)out_len; + * } + * output_next_packet(out, out_len); + * opus_repacketizer_init(rp); + * release_packets(data, nb_packets); + * data[0] = data[nb_packets]; + * len[0] = len[nb_packets]; + * nb_packets = 0; + * } + * err = opus_repacketizer_cat(rp, data[nb_packets], len[nb_packets]); + * if (err != OPUS_OK) + * { + * release_packets(data, nb_packets+1); + * return err; + * } + * prev_toc = data[nb_packets][0]; + * nb_packets++; + * } + * // Output the final, partial packet. + * if (nb_packets > 0) + * { + * out_len = opus_repacketizer_out(rp, out, sizeof(out)); + * release_packets(data, nb_packets); + * if (out_len < 0) + * return (int)out_len; + * output_next_packet(out, out_len); + * } + * @endcode + * + * An alternate way of merging packets is to simply call opus_repacketizer_cat() + * unconditionally until it fails. At that point, the merged packet can be + * obtained with opus_repacketizer_out() and the input packet for which + * opus_repacketizer_cat() needs to be re-added to a newly reinitialized + * repacketizer state. + */ + +typedef struct OpusRepacketizer OpusRepacketizer; + +/** Gets the size of an OpusRepacketizer structure. + * @returns The size in bytes. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_size(void); + +/** (Re)initializes a previously allocated repacketizer state. + * The state must be at least the size returned by opus_repacketizer_get_size(). + * This can be used for applications which use their own allocator instead of + * malloc(). + * It must also be called to reset the queue of packets waiting to be + * repacketized, which is necessary if the maximum packet duration of 120 ms + * is reached or if you wish to submit packets with a different Opus + * configuration (coding mode, audio bandwidth, frame size, or channel count). + * Failure to do so will prevent a new packet from being added with + * opus_repacketizer_cat(). + * @see opus_repacketizer_create + * @see opus_repacketizer_get_size + * @see opus_repacketizer_cat + * @param rp OpusRepacketizer*: The repacketizer state to + * (re)initialize. + * @returns A pointer to the same repacketizer state that was passed in. + */ +OPUS_EXPORT OpusRepacketizer *opus_repacketizer_init(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); + +/** Allocates memory and initializes the new repacketizer with + * opus_repacketizer_init(). + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusRepacketizer *opus_repacketizer_create(void); + +/** Frees an OpusRepacketizer allocated by + * opus_repacketizer_create(). + * @param[in] rp OpusRepacketizer*: State to be freed. + */ +OPUS_EXPORT void opus_repacketizer_destroy(OpusRepacketizer *rp); + +/** Add a packet to the current repacketizer state. + * This packet must match the configuration of any packets already submitted + * for repacketization since the last call to opus_repacketizer_init(). + * This means that it must have the same coding mode, audio bandwidth, frame + * size, and channel count. + * This can be checked in advance by examining the top 6 bits of the first + * byte of the packet, and ensuring they match the top 6 bits of the first + * byte of any previously submitted packet. + * The total duration of audio in the repacketizer state also must not exceed + * 120 ms, the maximum duration of a single packet, after adding this packet. + * + * The contents of the current repacketizer state can be extracted into new + * packets using opus_repacketizer_out() or opus_repacketizer_out_range(). + * + * In order to add a packet with a different configuration or to add more + * audio beyond 120 ms, you must clear the repacketizer state by calling + * opus_repacketizer_init(). + * If a packet is too large to add to the current repacketizer state, no part + * of it is added, even if it contains multiple frames, some of which might + * fit. + * If you wish to be able to add parts of such packets, you should first use + * another repacketizer to split the packet into pieces and add them + * individually. + * @see opus_repacketizer_out_range + * @see opus_repacketizer_out + * @see opus_repacketizer_init + * @param rp OpusRepacketizer*: The repacketizer state to which to + * add the packet. + * @param[in] data const unsigned char*: The packet data. + * The application must ensure + * this pointer remains valid + * until the next call to + * opus_repacketizer_init() or + * opus_repacketizer_destroy(). + * @param len opus_int32: The number of bytes in the packet data. + * @returns An error code indicating whether or not the operation succeeded. + * @retval #OPUS_OK The packet's contents have been added to the repacketizer + * state. + * @retval #OPUS_INVALID_PACKET The packet did not have a valid TOC sequence, + * the packet's TOC sequence was not compatible + * with previously submitted packets (because + * the coding mode, audio bandwidth, frame size, + * or channel count did not match), or adding + * this packet would increase the total amount of + * audio stored in the repacketizer state to more + * than 120 ms. + */ +OPUS_EXPORT int opus_repacketizer_cat(OpusRepacketizer *rp, const unsigned char *data, opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); + + +/** Construct a new packet from data previously submitted to the repacketizer + * state via opus_repacketizer_cat(). + * @param rp OpusRepacketizer*: The repacketizer state from which to + * construct the new packet. + * @param begin int: The index of the first frame in the current + * repacketizer state to include in the output. + * @param end int: One past the index of the last frame in the + * current repacketizer state to include in the + * output. + * @param[out] data const unsigned char*: The buffer in which to + * store the output packet. + * @param maxlen opus_int32: The maximum number of bytes to store in + * the output buffer. In order to guarantee + * success, this should be at least + * 1276 for a single frame, + * or for multiple frames, + * 1277*(end-begin). + * However, 1*(end-begin) plus + * the size of all packet data submitted to + * the repacketizer since the last call to + * opus_repacketizer_init() or + * opus_repacketizer_create() is also + * sufficient, and possibly much smaller. + * @returns The total size of the output packet on success, or an error code + * on failure. + * @retval #OPUS_BAD_ARG [begin,end) was an invalid range of + * frames (begin < 0, begin >= end, or end > + * opus_repacketizer_get_nb_frames()). + * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the + * complete output packet. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out_range(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Return the total number of frames contained in packet data submitted to + * the repacketizer state so far via opus_repacketizer_cat() since the last + * call to opus_repacketizer_init() or opus_repacketizer_create(). + * This defines the valid range of packets that can be extracted with + * opus_repacketizer_out_range() or opus_repacketizer_out(). + * @param rp OpusRepacketizer*: The repacketizer state containing the + * frames. + * @returns The total number of frames contained in the packet data submitted + * to the repacketizer state. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_nb_frames(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); + +/** Construct a new packet from data previously submitted to the repacketizer + * state via opus_repacketizer_cat(). + * This is a convenience routine that returns all the data submitted so far + * in a single packet. + * It is equivalent to calling + * @code + * opus_repacketizer_out_range(rp, 0, opus_repacketizer_get_nb_frames(rp), + * data, maxlen) + * @endcode + * @param rp OpusRepacketizer*: The repacketizer state from which to + * construct the new packet. + * @param[out] data const unsigned char*: The buffer in which to + * store the output packet. + * @param maxlen opus_int32: The maximum number of bytes to store in + * the output buffer. In order to guarantee + * success, this should be at least + * 1277*opus_repacketizer_get_nb_frames(rp). + * However, + * 1*opus_repacketizer_get_nb_frames(rp) + * plus the size of all packet data + * submitted to the repacketizer since the + * last call to opus_repacketizer_init() or + * opus_repacketizer_create() is also + * sufficient, and possibly much smaller. + * @returns The total size of the output packet on success, or an error code + * on failure. + * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the + * complete output packet. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1); + +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* OPUS_H */ diff --git a/Audio-Frameworks/bin/opus/include/opus_defines.h b/Audio-Frameworks/bin/opus/include/opus_defines.h new file mode 100644 index 0000000..9fa3ccb --- /dev/null +++ b/Audio-Frameworks/bin/opus/include/opus_defines.h @@ -0,0 +1,655 @@ +/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited + Written by Jean-Marc Valin and Koen Vos */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @file opus_defines.h + * @brief Opus reference implementation constants + */ + +#ifndef OPUS_DEFINES_H +#define OPUS_DEFINES_H + +#include "opus_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @defgroup opus_errorcodes Error codes + * @{ + */ +/** No error @hideinitializer*/ +#define OPUS_OK 0 +/** One or more invalid/out of range arguments @hideinitializer*/ +#define OPUS_BAD_ARG -1 +/** The mode struct passed is invalid @hideinitializer*/ +#define OPUS_BUFFER_TOO_SMALL -2 +/** An internal error was detected @hideinitializer*/ +#define OPUS_INTERNAL_ERROR -3 +/** The compressed data passed is corrupted @hideinitializer*/ +#define OPUS_INVALID_PACKET -4 +/** Invalid/unsupported request number @hideinitializer*/ +#define OPUS_UNIMPLEMENTED -5 +/** An encoder or decoder structure is invalid or already freed @hideinitializer*/ +#define OPUS_INVALID_STATE -6 +/** Memory allocation has failed @hideinitializer*/ +#define OPUS_ALLOC_FAIL -7 +/**@}*/ + +/** @cond OPUS_INTERNAL_DOC */ +/**Export control for opus functions */ + +#ifndef OPUS_EXPORT +# if defined(WIN32) +# ifdef OPUS_BUILD +# define OPUS_EXPORT __declspec(dllexport) +# else +# define OPUS_EXPORT +# endif +# elif defined(__GNUC__) && defined(OPUS_BUILD) +# define OPUS_EXPORT __attribute__ ((visibility ("default"))) +# else +# define OPUS_EXPORT +# endif +#endif + +# if !defined(OPUS_GNUC_PREREQ) +# if defined(__GNUC__)&&defined(__GNUC_MINOR__) +# define OPUS_GNUC_PREREQ(_maj,_min) \ + ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) +# else +# define OPUS_GNUC_PREREQ(_maj,_min) 0 +# endif +# endif + +#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) +# if OPUS_GNUC_PREREQ(3,0) +# define OPUS_RESTRICT __restrict__ +# elif (defined(_MSC_VER) && _MSC_VER >= 1400) +# define OPUS_RESTRICT __restrict +# else +# define OPUS_RESTRICT +# endif +#else +# define OPUS_RESTRICT restrict +#endif + +/**Warning attributes for opus functions + * NONNULL is not used in OPUS_BUILD to avoid the compiler optimizing out + * some paranoid null checks. */ +#if defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) +# define OPUS_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) +#else +# define OPUS_WARN_UNUSED_RESULT +#endif +#if !defined(OPUS_BUILD) && defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) +# define OPUS_ARG_NONNULL(_x) __attribute__ ((__nonnull__(_x))) +#else +# define OPUS_ARG_NONNULL(_x) +#endif + +/** These are the actual Encoder CTL ID numbers. + * They should not be used directly by applications. + * In general, SETs should be even and GETs should be odd.*/ +#define OPUS_SET_APPLICATION_REQUEST 4000 +#define OPUS_GET_APPLICATION_REQUEST 4001 +#define OPUS_SET_BITRATE_REQUEST 4002 +#define OPUS_GET_BITRATE_REQUEST 4003 +#define OPUS_SET_MAX_BANDWIDTH_REQUEST 4004 +#define OPUS_GET_MAX_BANDWIDTH_REQUEST 4005 +#define OPUS_SET_VBR_REQUEST 4006 +#define OPUS_GET_VBR_REQUEST 4007 +#define OPUS_SET_BANDWIDTH_REQUEST 4008 +#define OPUS_GET_BANDWIDTH_REQUEST 4009 +#define OPUS_SET_COMPLEXITY_REQUEST 4010 +#define OPUS_GET_COMPLEXITY_REQUEST 4011 +#define OPUS_SET_INBAND_FEC_REQUEST 4012 +#define OPUS_GET_INBAND_FEC_REQUEST 4013 +#define OPUS_SET_PACKET_LOSS_PERC_REQUEST 4014 +#define OPUS_GET_PACKET_LOSS_PERC_REQUEST 4015 +#define OPUS_SET_DTX_REQUEST 4016 +#define OPUS_GET_DTX_REQUEST 4017 +#define OPUS_SET_VBR_CONSTRAINT_REQUEST 4020 +#define OPUS_GET_VBR_CONSTRAINT_REQUEST 4021 +#define OPUS_SET_FORCE_CHANNELS_REQUEST 4022 +#define OPUS_GET_FORCE_CHANNELS_REQUEST 4023 +#define OPUS_SET_SIGNAL_REQUEST 4024 +#define OPUS_GET_SIGNAL_REQUEST 4025 +#define OPUS_GET_LOOKAHEAD_REQUEST 4027 +/* #define OPUS_RESET_STATE 4028 */ +#define OPUS_GET_SAMPLE_RATE_REQUEST 4029 +#define OPUS_GET_FINAL_RANGE_REQUEST 4031 +#define OPUS_GET_PITCH_REQUEST 4033 +#define OPUS_SET_GAIN_REQUEST 4034 +#define OPUS_GET_GAIN_REQUEST 4045 /* Should have been 4035 */ +#define OPUS_SET_LSB_DEPTH_REQUEST 4036 +#define OPUS_GET_LSB_DEPTH_REQUEST 4037 + +#define OPUS_GET_LAST_PACKET_DURATION_REQUEST 4039 + +/* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */ + +/* Macros to trigger compilation errors when the wrong types are provided to a CTL */ +#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x)) +#define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr))) +#define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr))) +/** @endcond */ + +/** @defgroup opus_ctlvalues Pre-defined values for CTL interface + * @see opus_genericctls, opus_encoderctls + * @{ + */ +/* Values for the various encoder CTLs */ +#define OPUS_AUTO -1000 /**opus_int32: Allowed values: 0-10, inclusive. + * + * @hideinitializer */ +#define OPUS_SET_COMPLEXITY(x) OPUS_SET_COMPLEXITY_REQUEST, __opus_check_int(x) +/** Gets the encoder's complexity configuration. + * @see OPUS_SET_COMPLEXITY + * @param[out] x opus_int32 *: Returns a value in the range 0-10, + * inclusive. + * @hideinitializer */ +#define OPUS_GET_COMPLEXITY(x) OPUS_GET_COMPLEXITY_REQUEST, __opus_check_int_ptr(x) + +/** Configures the bitrate in the encoder. + * Rates from 500 to 512000 bits per second are meaningful, as well as the + * special values #OPUS_AUTO and #OPUS_BITRATE_MAX. + * The value #OPUS_BITRATE_MAX can be used to cause the codec to use as much + * rate as it can, which is useful for controlling the rate by adjusting the + * output buffer size. + * @see OPUS_GET_BITRATE + * @param[in] x opus_int32: Bitrate in bits per second. The default + * is determined based on the number of + * channels and the input sampling rate. + * @hideinitializer */ +#define OPUS_SET_BITRATE(x) OPUS_SET_BITRATE_REQUEST, __opus_check_int(x) +/** Gets the encoder's bitrate configuration. + * @see OPUS_SET_BITRATE + * @param[out] x opus_int32 *: Returns the bitrate in bits per second. + * The default is determined based on the + * number of channels and the input + * sampling rate. + * @hideinitializer */ +#define OPUS_GET_BITRATE(x) OPUS_GET_BITRATE_REQUEST, __opus_check_int_ptr(x) + +/** Enables or disables variable bitrate (VBR) in the encoder. + * The configured bitrate may not be met exactly because frames must + * be an integer number of bytes in length. + * @warning Only the MDCT mode of Opus can provide hard CBR behavior. + * @see OPUS_GET_VBR + * @see OPUS_SET_VBR_CONSTRAINT + * @param[in] x opus_int32: Allowed values: + *
+ *
0
Hard CBR. For LPC/hybrid modes at very low bit-rate, this can + * cause noticeable quality degradation.
+ *
1
VBR (default). The exact type of VBR is controlled by + * #OPUS_SET_VBR_CONSTRAINT.
+ *
+ * @hideinitializer */ +#define OPUS_SET_VBR(x) OPUS_SET_VBR_REQUEST, __opus_check_int(x) +/** Determine if variable bitrate (VBR) is enabled in the encoder. + * @see OPUS_SET_VBR + * @see OPUS_GET_VBR_CONSTRAINT + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
0
Hard CBR.
+ *
1
VBR (default). The exact type of VBR may be retrieved via + * #OPUS_GET_VBR_CONSTRAINT.
+ *
+ * @hideinitializer */ +#define OPUS_GET_VBR(x) OPUS_GET_VBR_REQUEST, __opus_check_int_ptr(x) + +/** Enables or disables constrained VBR in the encoder. + * This setting is ignored when the encoder is in CBR mode. + * @warning Only the MDCT mode of Opus currently heeds the constraint. + * Speech mode ignores it completely, hybrid mode may fail to obey it + * if the LPC layer uses more bitrate than the constraint would have + * permitted. + * @see OPUS_GET_VBR_CONSTRAINT + * @see OPUS_SET_VBR + * @param[in] x opus_int32: Allowed values: + *
+ *
0
Unconstrained VBR.
+ *
1
Constrained VBR (default). This creates a maximum of one + * frame of buffering delay assuming a transport with a + * serialization speed of the nominal bitrate.
+ *
+ * @hideinitializer */ +#define OPUS_SET_VBR_CONSTRAINT(x) OPUS_SET_VBR_CONSTRAINT_REQUEST, __opus_check_int(x) +/** Determine if constrained VBR is enabled in the encoder. + * @see OPUS_SET_VBR_CONSTRAINT + * @see OPUS_GET_VBR + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
0
Unconstrained VBR.
+ *
1
Constrained VBR (default).
+ *
+ * @hideinitializer */ +#define OPUS_GET_VBR_CONSTRAINT(x) OPUS_GET_VBR_CONSTRAINT_REQUEST, __opus_check_int_ptr(x) + +/** Configures mono/stereo forcing in the encoder. + * This can force the encoder to produce packets encoded as either mono or + * stereo, regardless of the format of the input audio. This is useful when + * the caller knows that the input signal is currently a mono source embedded + * in a stereo stream. + * @see OPUS_GET_FORCE_CHANNELS + * @param[in] x opus_int32: Allowed values: + *
+ *
#OPUS_AUTO
Not forced (default)
+ *
1
Forced mono
+ *
2
Forced stereo
+ *
+ * @hideinitializer */ +#define OPUS_SET_FORCE_CHANNELS(x) OPUS_SET_FORCE_CHANNELS_REQUEST, __opus_check_int(x) +/** Gets the encoder's forced channel configuration. + * @see OPUS_SET_FORCE_CHANNELS + * @param[out] x opus_int32 *: + *
+ *
#OPUS_AUTO
Not forced (default)
+ *
1
Forced mono
+ *
2
Forced stereo
+ *
+ * @hideinitializer */ +#define OPUS_GET_FORCE_CHANNELS(x) OPUS_GET_FORCE_CHANNELS_REQUEST, __opus_check_int_ptr(x) + +/** Configures the maximum bandpass that the encoder will select automatically. + * Applications should normally use this instead of #OPUS_SET_BANDWIDTH + * (leaving that set to the default, #OPUS_AUTO). This allows the + * application to set an upper bound based on the type of input it is + * providing, but still gives the encoder the freedom to reduce the bandpass + * when the bitrate becomes too low, for better overall quality. + * @see OPUS_GET_MAX_BANDWIDTH + * @param[in] x opus_int32: Allowed values: + *
+ *
OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
+ *
OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
+ *
OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
+ *
OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
+ *
OPUS_BANDWIDTH_FULLBAND
20 kHz passband (default)
+ *
+ * @hideinitializer */ +#define OPUS_SET_MAX_BANDWIDTH(x) OPUS_SET_MAX_BANDWIDTH_REQUEST, __opus_check_int(x) + +/** Gets the encoder's configured maximum allowed bandpass. + * @see OPUS_SET_MAX_BANDWIDTH + * @param[out] x opus_int32 *: Allowed values: + *
+ *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
+ *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
+ *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
+ *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
+ *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband (default)
+ *
+ * @hideinitializer */ +#define OPUS_GET_MAX_BANDWIDTH(x) OPUS_GET_MAX_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) + +/** Sets the encoder's bandpass to a specific value. + * This prevents the encoder from automatically selecting the bandpass based + * on the available bitrate. If an application knows the bandpass of the input + * audio it is providing, it should normally use #OPUS_SET_MAX_BANDWIDTH + * instead, which still gives the encoder the freedom to reduce the bandpass + * when the bitrate becomes too low, for better overall quality. + * @see OPUS_GET_BANDWIDTH + * @param[in] x opus_int32: Allowed values: + *
+ *
#OPUS_AUTO
(default)
+ *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
+ *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
+ *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
+ *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
+ *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband
+ *
+ * @hideinitializer */ +#define OPUS_SET_BANDWIDTH(x) OPUS_SET_BANDWIDTH_REQUEST, __opus_check_int(x) + +/** Configures the type of signal being encoded. + * This is a hint which helps the encoder's mode selection. + * @see OPUS_GET_SIGNAL + * @param[in] x opus_int32: Allowed values: + *
+ *
#OPUS_AUTO
(default)
+ *
#OPUS_SIGNAL_VOICE
Bias thresholds towards choosing LPC or Hybrid modes.
+ *
#OPUS_SIGNAL_MUSIC
Bias thresholds towards choosing MDCT modes.
+ *
+ * @hideinitializer */ +#define OPUS_SET_SIGNAL(x) OPUS_SET_SIGNAL_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured signal type. + * @see OPUS_SET_SIGNAL + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
#OPUS_AUTO
(default)
+ *
#OPUS_SIGNAL_VOICE
Bias thresholds towards choosing LPC or Hybrid modes.
+ *
#OPUS_SIGNAL_MUSIC
Bias thresholds towards choosing MDCT modes.
+ *
+ * @hideinitializer */ +#define OPUS_GET_SIGNAL(x) OPUS_GET_SIGNAL_REQUEST, __opus_check_int_ptr(x) + + +/** Configures the encoder's intended application. + * The initial value is a mandatory argument to the encoder_create function. + * @see OPUS_GET_APPLICATION + * @param[in] x opus_int32: Returns one of the following values: + *
+ *
#OPUS_APPLICATION_VOIP
+ *
Process signal for improved speech intelligibility.
+ *
#OPUS_APPLICATION_AUDIO
+ *
Favor faithfulness to the original input.
+ *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
+ *
Configure the minimum possible coding delay by disabling certain modes + * of operation.
+ *
+ * @hideinitializer */ +#define OPUS_SET_APPLICATION(x) OPUS_SET_APPLICATION_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured application. + * @see OPUS_SET_APPLICATION + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
#OPUS_APPLICATION_VOIP
+ *
Process signal for improved speech intelligibility.
+ *
#OPUS_APPLICATION_AUDIO
+ *
Favor faithfulness to the original input.
+ *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
+ *
Configure the minimum possible coding delay by disabling certain modes + * of operation.
+ *
+ * @hideinitializer */ +#define OPUS_GET_APPLICATION(x) OPUS_GET_APPLICATION_REQUEST, __opus_check_int_ptr(x) + +/** Gets the sampling rate the encoder or decoder was initialized with. + * This simply returns the Fs value passed to opus_encoder_init() + * or opus_decoder_init(). + * @param[out] x opus_int32 *: Sampling rate of encoder or decoder. + * @hideinitializer + */ +#define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_ptr(x) + +/** Gets the total samples of delay added by the entire codec. + * This can be queried by the encoder and then the provided number of samples can be + * skipped on from the start of the decoder's output to provide time aligned input + * and output. From the perspective of a decoding application the real data begins this many + * samples late. + * + * The decoder contribution to this delay is identical for all decoders, but the + * encoder portion of the delay may vary from implementation to implementation, + * version to version, or even depend on the encoder's initial configuration. + * Applications needing delay compensation should call this CTL rather than + * hard-coding a value. + * @param[out] x opus_int32 *: Number of lookahead samples + * @hideinitializer */ +#define OPUS_GET_LOOKAHEAD(x) OPUS_GET_LOOKAHEAD_REQUEST, __opus_check_int_ptr(x) + +/** Configures the encoder's use of inband forward error correction (FEC). + * @note This is only applicable to the LPC layer + * @see OPUS_GET_INBAND_FEC + * @param[in] x opus_int32: Allowed values: + *
+ *
0
Disable inband FEC (default).
+ *
1
Enable inband FEC.
+ *
+ * @hideinitializer */ +#define OPUS_SET_INBAND_FEC(x) OPUS_SET_INBAND_FEC_REQUEST, __opus_check_int(x) +/** Gets encoder's configured use of inband forward error correction. + * @see OPUS_SET_INBAND_FEC + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
0
Inband FEC disabled (default).
+ *
1
Inband FEC enabled.
+ *
+ * @hideinitializer */ +#define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x) + +/** Configures the encoder's expected packet loss percentage. + * Higher values with trigger progressively more loss resistant behavior in the encoder + * at the expense of quality at a given bitrate in the lossless case, but greater quality + * under loss. + * @see OPUS_GET_PACKET_LOSS_PERC + * @param[in] x opus_int32: Loss percentage in the range 0-100, inclusive (default: 0). + * @hideinitializer */ +#define OPUS_SET_PACKET_LOSS_PERC(x) OPUS_SET_PACKET_LOSS_PERC_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured packet loss percentage. + * @see OPUS_SET_PACKET_LOSS_PERC + * @param[out] x opus_int32 *: Returns the configured loss percentage + * in the range 0-100, inclusive (default: 0). + * @hideinitializer */ +#define OPUS_GET_PACKET_LOSS_PERC(x) OPUS_GET_PACKET_LOSS_PERC_REQUEST, __opus_check_int_ptr(x) + +/** Configures the encoder's use of discontinuous transmission (DTX). + * @note This is only applicable to the LPC layer + * @see OPUS_GET_DTX + * @param[in] x opus_int32: Allowed values: + *
+ *
0
Disable DTX (default).
+ *
1
Enabled DTX.
+ *
+ * @hideinitializer */ +#define OPUS_SET_DTX(x) OPUS_SET_DTX_REQUEST, __opus_check_int(x) +/** Gets encoder's configured use of discontinuous transmission. + * @see OPUS_SET_DTX + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
0
DTX disabled (default).
+ *
1
DTX enabled.
+ *
+ * @hideinitializer */ +#define OPUS_GET_DTX(x) OPUS_GET_DTX_REQUEST, __opus_check_int_ptr(x) +/** Configures the depth of signal being encoded. + * This is a hint which helps the encoder identify silence and near-silence. + * @see OPUS_GET_LSB_DEPTH + * @param[in] x opus_int32: Input precision in bits, between 8 and 24 + * (default: 24). + * @hideinitializer */ +#define OPUS_SET_LSB_DEPTH(x) OPUS_SET_LSB_DEPTH_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured signal depth. + * @see OPUS_SET_LSB_DEPTH + * @param[out] x opus_int32 *: Input precision in bits, between 8 and + * 24 (default: 24). + * @hideinitializer */ +#define OPUS_GET_LSB_DEPTH(x) OPUS_GET_LSB_DEPTH_REQUEST, __opus_check_int_ptr(x) + +/** Gets the duration (in samples) of the last packet successfully decoded or concealed. + * @param[out] x opus_int32 *: Number of samples (at current sampling rate). + * @hideinitializer */ +#define OPUS_GET_LAST_PACKET_DURATION(x) OPUS_GET_LAST_PACKET_DURATION_REQUEST, __opus_check_int_ptr(x) +/**@}*/ + +/** @defgroup opus_genericctls Generic CTLs + * + * These macros are used with the \c opus_decoder_ctl and + * \c opus_encoder_ctl calls to generate a particular + * request. + * + * When called on an \c OpusDecoder they apply to that + * particular decoder instance. When called on an + * \c OpusEncoder they apply to the corresponding setting + * on that encoder instance, if present. + * + * Some usage examples: + * + * @code + * int ret; + * opus_int32 pitch; + * ret = opus_decoder_ctl(dec_ctx, OPUS_GET_PITCH(&pitch)); + * if (ret == OPUS_OK) return ret; + * + * opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE); + * opus_decoder_ctl(dec_ctx, OPUS_RESET_STATE); + * + * opus_int32 enc_bw, dec_bw; + * opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&enc_bw)); + * opus_decoder_ctl(dec_ctx, OPUS_GET_BANDWIDTH(&dec_bw)); + * if (enc_bw != dec_bw) { + * printf("packet bandwidth mismatch!\n"); + * } + * @endcode + * + * @see opus_encoder, opus_decoder_ctl, opus_encoder_ctl, opus_decoderctls, opus_encoderctls + * @{ + */ + +/** Resets the codec state to be equivalent to a freshly initialized state. + * This should be called when switching streams in order to prevent + * the back to back decoding from giving different results from + * one at a time decoding. + * @hideinitializer */ +#define OPUS_RESET_STATE 4028 + +/** Gets the final state of the codec's entropy coder. + * This is used for testing purposes, + * The encoder and decoder state should be identical after coding a payload + * (assuming no data corruption or software bugs) + * + * @param[out] x opus_uint32 *: Entropy coder state + * + * @hideinitializer */ +#define OPUS_GET_FINAL_RANGE(x) OPUS_GET_FINAL_RANGE_REQUEST, __opus_check_uint_ptr(x) + +/** Gets the pitch of the last decoded frame, if available. + * This can be used for any post-processing algorithm requiring the use of pitch, + * e.g. time stretching/shortening. If the last frame was not voiced, or if the + * pitch was not coded in the frame, then zero is returned. + * + * This CTL is only implemented for decoder instances. + * + * @param[out] x opus_int32 *: pitch period at 48 kHz (or 0 if not available) + * + * @hideinitializer */ +#define OPUS_GET_PITCH(x) OPUS_GET_PITCH_REQUEST, __opus_check_int_ptr(x) + +/** Gets the encoder's configured bandpass or the decoder's last bandpass. + * @see OPUS_SET_BANDWIDTH + * @param[out] x opus_int32 *: Returns one of the following values: + *
+ *
#OPUS_AUTO
(default)
+ *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
+ *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
+ *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
+ *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
+ *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband
+ *
+ * @hideinitializer */ +#define OPUS_GET_BANDWIDTH(x) OPUS_GET_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) + +/**@}*/ + +/** @defgroup opus_decoderctls Decoder related CTLs + * @see opus_genericctls, opus_encoderctls, opus_decoder + * @{ + */ + +/** Configures decoder gain adjustment. + * Scales the decoded output by a factor specified in Q8 dB units. + * This has a maximum range of -32768 to 32767 inclusive, and returns + * OPUS_BAD_ARG otherwise. The default is zero indicating no adjustment. + * This setting survives decoder reset. + * + * gain = pow(10, x/(20.0*256)) + * + * @param[in] x opus_int32: Amount to scale PCM signal by in Q8 dB units. + * @hideinitializer */ +#define OPUS_SET_GAIN(x) OPUS_SET_GAIN_REQUEST, __opus_check_int(x) +/** Gets the decoder's configured gain adjustment. @see OPUS_SET_GAIN + * + * @param[out] x opus_int32 *: Amount to scale PCM signal by in Q8 dB units. + * @hideinitializer */ +#define OPUS_GET_GAIN(x) OPUS_GET_GAIN_REQUEST, __opus_check_int_ptr(x) + +/**@}*/ + +/** @defgroup opus_libinfo Opus library information functions + * @{ + */ + +/** Converts an opus error code into a human readable string. + * + * @param[in] error int: Error number + * @returns Error string + */ +OPUS_EXPORT const char *opus_strerror(int error); + +/** Gets the libopus version string. + * + * @returns Version string + */ +OPUS_EXPORT const char *opus_get_version_string(void); +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* OPUS_DEFINES_H */ diff --git a/Audio-Frameworks/bin/opus/include/opus_multistream.h b/Audio-Frameworks/bin/opus/include/opus_multistream.h new file mode 100644 index 0000000..ae59979 --- /dev/null +++ b/Audio-Frameworks/bin/opus/include/opus_multistream.h @@ -0,0 +1,660 @@ +/* Copyright (c) 2011 Xiph.Org Foundation + Written by Jean-Marc Valin */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * @file opus_multistream.h + * @brief Opus reference implementation multistream API + */ + +#ifndef OPUS_MULTISTREAM_H +#define OPUS_MULTISTREAM_H + +#include "opus.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @cond OPUS_INTERNAL_DOC */ + +/** Macros to trigger compilation errors when the wrong types are provided to a + * CTL. */ +/**@{*/ +#define __opus_check_encstate_ptr(ptr) ((ptr) + ((ptr) - (OpusEncoder**)(ptr))) +#define __opus_check_decstate_ptr(ptr) ((ptr) + ((ptr) - (OpusDecoder**)(ptr))) +/**@}*/ + +/** These are the actual encoder and decoder CTL ID numbers. + * They should not be used directly by applications. + * In general, SETs should be even and GETs should be odd.*/ +/**@{*/ +#define OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST 5120 +#define OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST 5122 +/**@}*/ + +/** @endcond */ + +/** @defgroup opus_multistream_ctls Multistream specific encoder and decoder CTLs + * + * These are convenience macros that are specific to the + * opus_multistream_encoder_ctl() and opus_multistream_decoder_ctl() + * interface. + * The CTLs from @ref opus_genericctls, @ref opus_encoderctls, and + * @ref opus_decoderctls may be applied to a multistream encoder or decoder as + * well. + * In addition, you may retrieve the encoder or decoder state for an specific + * stream via #OPUS_MULTISTREAM_GET_ENCODER_STATE or + * #OPUS_MULTISTREAM_GET_DECODER_STATE and apply CTLs to it individually. + */ +/**@{*/ + +/** Gets the encoder state for an individual stream of a multistream encoder. + * @param[in] x opus_int32: The index of the stream whose encoder you + * wish to retrieve. + * This must be non-negative and less than + * the streams parameter used + * to initialize the encoder. + * @param[out] y OpusEncoder**: Returns a pointer to the given + * encoder state. + * @retval OPUS_BAD_ARG The index of the requested stream was out of range. + * @hideinitializer + */ +#define OPUS_MULTISTREAM_GET_ENCODER_STATE(x,y) OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST, __opus_check_int(x), __opus_check_encstate_ptr(y) + +/** Gets the decoder state for an individual stream of a multistream decoder. + * @param[in] x opus_int32: The index of the stream whose decoder you + * wish to retrieve. + * This must be non-negative and less than + * the streams parameter used + * to initialize the decoder. + * @param[out] y OpusDecoder**: Returns a pointer to the given + * decoder state. + * @retval OPUS_BAD_ARG The index of the requested stream was out of range. + * @hideinitializer + */ +#define OPUS_MULTISTREAM_GET_DECODER_STATE(x,y) OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST, __opus_check_int(x), __opus_check_decstate_ptr(y) + +/**@}*/ + +/** @defgroup opus_multistream Opus Multistream API + * @{ + * + * The multistream API allows individual Opus streams to be combined into a + * single packet, enabling support for up to 255 channels. Unlike an + * elementary Opus stream, the encoder and decoder must negotiate the channel + * configuration before the decoder can successfully interpret the data in the + * packets produced by the encoder. Some basic information, such as packet + * duration, can be computed without any special negotiation. + * + * The format for multistream Opus packets is defined in the + * Ogg + * encapsulation specification and is based on the self-delimited Opus + * framing described in Appendix B of RFC 6716. + * Normal Opus packets are just a degenerate case of multistream Opus packets, + * and can be encoded or decoded with the multistream API by setting + * streams to 1 when initializing the encoder or + * decoder. + * + * Multistream Opus streams can contain up to 255 elementary Opus streams. + * These may be either "uncoupled" or "coupled", indicating that the decoder + * is configured to decode them to either 1 or 2 channels, respectively. + * The streams are ordered so that all coupled streams appear at the + * beginning. + * + * A mapping table defines which decoded channel i + * should be used for each input/output (I/O) channel j. This table is + * typically provided as an unsigned char array. + * Let i = mapping[j] be the index for I/O channel j. + * If i < 2*coupled_streams, then I/O channel j is + * encoded as the left channel of stream (i/2) if i + * is even, or as the right channel of stream (i/2) if + * i is odd. Otherwise, I/O channel j is encoded as + * mono in stream (i - coupled_streams), unless it has the special + * value 255, in which case it is omitted from the encoding entirely (the + * decoder will reproduce it as silence). Each value i must either + * be the special value 255 or be less than streams + coupled_streams. + * + * The output channels specified by the encoder + * should use the + * Vorbis + * channel ordering. A decoder may wish to apply an additional permutation + * to the mapping the encoder used to achieve a different output channel + * order (e.g. for outputing in WAV order). + * + * Each multistream packet contains an Opus packet for each stream, and all of + * the Opus packets in a single multistream packet must have the same + * duration. Therefore the duration of a multistream packet can be extracted + * from the TOC sequence of the first stream, which is located at the + * beginning of the packet, just like an elementary Opus stream: + * + * @code + * int nb_samples; + * int nb_frames; + * nb_frames = opus_packet_get_nb_frames(data, len); + * if (nb_frames < 1) + * return nb_frames; + * nb_samples = opus_packet_get_samples_per_frame(data, 48000) * nb_frames; + * @endcode + * + * The general encoding and decoding process proceeds exactly the same as in + * the normal @ref opus_encoder and @ref opus_decoder APIs. + * See their documentation for an overview of how to use the corresponding + * multistream functions. + */ + +/** Opus multistream encoder state. + * This contains the complete state of a multistream Opus encoder. + * It is position independent and can be freely copied. + * @see opus_multistream_encoder_create + * @see opus_multistream_encoder_init + */ +typedef struct OpusMSEncoder OpusMSEncoder; + +/** Opus multistream decoder state. + * This contains the complete state of a multistream Opus decoder. + * It is position independent and can be freely copied. + * @see opus_multistream_decoder_create + * @see opus_multistream_decoder_init + */ +typedef struct OpusMSDecoder OpusMSDecoder; + +/**\name Multistream encoder functions */ +/**@{*/ + +/** Gets the size of an OpusMSEncoder structure. + * @param streams int: The total number of streams to encode from the + * input. + * This must be no more than 255. + * @param coupled_streams int: Number of coupled (2 channel) streams + * to encode. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * encoded channels (streams + + * coupled_streams) must be no + * more than 255. + * @returns The size in bytes on success, or a negative error code + * (see @ref opus_errorcodes) on error. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size( + int streams, + int coupled_streams +); + +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_surround_encoder_get_size( + int channels, + int mapping_family +); + + +/** Allocates and initializes a multistream encoder state. + * Call opus_multistream_encoder_destroy() to release + * this object when finished. + * @param Fs opus_int32: Sampling rate of the input signal (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels int: Number of channels in the input signal. + * This must be at most 255. + * It may be greater than the number of + * coded channels (streams + + * coupled_streams). + * @param streams int: The total number of streams to encode from the + * input. + * This must be no more than the number of channels. + * @param coupled_streams int: Number of coupled (2 channel) streams + * to encode. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * encoded channels (streams + + * coupled_streams) must be no + * more than the number of input channels. + * @param[in] mapping const unsigned char[channels]: Mapping from + * encoded channels to input channels, as described in + * @ref opus_multistream. As an extra constraint, the + * multistream encoder does not allow encoding coupled + * streams for which one channel is unused since this + * is never a good idea. + * @param application int: The target encoder application. + * This must be one of the following: + *
+ *
#OPUS_APPLICATION_VOIP
+ *
Process signal for improved speech intelligibility.
+ *
#OPUS_APPLICATION_AUDIO
+ *
Favor faithfulness to the original input.
+ *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
+ *
Configure the minimum possible coding delay by disabling certain modes + * of operation.
+ *
+ * @param[out] error int *: Returns #OPUS_OK on success, or an error + * code (see @ref opus_errorcodes) on + * failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create( + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping, + int application, + int *error +) OPUS_ARG_NONNULL(5); + +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_encoder_create( + opus_int32 Fs, + int channels, + int mapping_family, + int *streams, + int *coupled_streams, + unsigned char *mapping, + int application, + int *error +) OPUS_ARG_NONNULL(5); + +/** Initialize a previously allocated multistream encoder state. + * The memory pointed to by \a st must be at least the size returned by + * opus_multistream_encoder_get_size(). + * This is intended for applications which use their own allocator instead of + * malloc. + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @see opus_multistream_encoder_create + * @see opus_multistream_encoder_get_size + * @param st OpusMSEncoder*: Multistream encoder state to initialize. + * @param Fs opus_int32: Sampling rate of the input signal (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels int: Number of channels in the input signal. + * This must be at most 255. + * It may be greater than the number of + * coded channels (streams + + * coupled_streams). + * @param streams int: The total number of streams to encode from the + * input. + * This must be no more than the number of channels. + * @param coupled_streams int: Number of coupled (2 channel) streams + * to encode. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * encoded channels (streams + + * coupled_streams) must be no + * more than the number of input channels. + * @param[in] mapping const unsigned char[channels]: Mapping from + * encoded channels to input channels, as described in + * @ref opus_multistream. As an extra constraint, the + * multistream encoder does not allow encoding coupled + * streams for which one channel is unused since this + * is never a good idea. + * @param application int: The target encoder application. + * This must be one of the following: + *
+ *
#OPUS_APPLICATION_VOIP
+ *
Process signal for improved speech intelligibility.
+ *
#OPUS_APPLICATION_AUDIO
+ *
Favor faithfulness to the original input.
+ *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
+ *
Configure the minimum possible coding delay by disabling certain modes + * of operation.
+ *
+ * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) + * on failure. + */ +OPUS_EXPORT int opus_multistream_encoder_init( + OpusMSEncoder *st, + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping, + int application +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); + +OPUS_EXPORT int opus_multistream_surround_encoder_init( + OpusMSEncoder *st, + opus_int32 Fs, + int channels, + int mapping_family, + int *streams, + int *coupled_streams, + unsigned char *mapping, + int application +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); + +/** Encodes a multistream Opus frame. + * @param st OpusMSEncoder*: Multistream encoder state. + * @param[in] pcm const opus_int16*: The input signal as interleaved + * samples. + * This must contain + * frame_size*channels + * samples. + * @param frame_size int: Number of samples per channel in the input + * signal. + * This must be an Opus frame size for the + * encoder's sampling rate. + * For example, at 48 kHz the permitted values + * are 120, 240, 480, 960, 1920, and 2880. + * Passing in a duration of less than 10 ms + * (480 samples at 48 kHz) will prevent the + * encoder from using the LPC or hybrid modes. + * @param[out] data unsigned char*: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes opus_int32: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode( + OpusMSEncoder *st, + const opus_int16 *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + +/** Encodes a multistream Opus frame from floating point input. + * @param st OpusMSEncoder*: Multistream encoder state. + * @param[in] pcm const float*: The input signal as interleaved + * samples with a normal range of + * +/-1.0. + * Samples with a range beyond +/-1.0 + * are supported but will be clipped by + * decoders using the integer API and + * should only be used if it is known + * that the far end supports extended + * dynamic range. + * This must contain + * frame_size*channels + * samples. + * @param frame_size int: Number of samples per channel in the input + * signal. + * This must be an Opus frame size for the + * encoder's sampling rate. + * For example, at 48 kHz the permitted values + * are 120, 240, 480, 960, 1920, and 2880. + * Passing in a duration of less than 10 ms + * (480 samples at 48 kHz) will prevent the + * encoder from using the LPC or hybrid modes. + * @param[out] data unsigned char*: Output payload. + * This must contain storage for at + * least \a max_data_bytes. + * @param [in] max_data_bytes opus_int32: Size of the allocated + * memory for the output + * payload. This may be + * used to impose an upper limit on + * the instant bitrate, but should + * not be used as the only bitrate + * control. Use #OPUS_SET_BITRATE to + * control the bitrate. + * @returns The length of the encoded packet (in bytes) on success or a + * negative error code (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float( + OpusMSEncoder *st, + const float *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); + +/** Frees an OpusMSEncoder allocated by + * opus_multistream_encoder_create(). + * @param st OpusMSEncoder*: Multistream encoder state to be freed. + */ +OPUS_EXPORT void opus_multistream_encoder_destroy(OpusMSEncoder *st); + +/** Perform a CTL function on a multistream Opus encoder. + * + * Generally the request and subsequent arguments are generated by a + * convenience macro. + * @param st OpusMSEncoder*: Multistream encoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls, + * @ref opus_encoderctls, or @ref opus_multistream_ctls. + * @see opus_genericctls + * @see opus_encoderctls + * @see opus_multistream_ctls + */ +OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); + +/**@}*/ + +/**\name Multistream decoder functions */ +/**@{*/ + +/** Gets the size of an OpusMSDecoder structure. + * @param streams int: The total number of streams coded in the + * input. + * This must be no more than 255. + * @param coupled_streams int: Number streams to decode as coupled + * (2 channel) streams. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * coded channels (streams + + * coupled_streams) must be no + * more than 255. + * @returns The size in bytes on success, or a negative error code + * (see @ref opus_errorcodes) on error. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size( + int streams, + int coupled_streams +); + +/** Allocates and initializes a multistream decoder state. + * Call opus_multistream_decoder_destroy() to release + * this object when finished. + * @param Fs opus_int32: Sampling rate to decode at (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels int: Number of channels to output. + * This must be at most 255. + * It may be different from the number of coded + * channels (streams + + * coupled_streams). + * @param streams int: The total number of streams coded in the + * input. + * This must be no more than 255. + * @param coupled_streams int: Number of streams to decode as coupled + * (2 channel) streams. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * coded channels (streams + + * coupled_streams) must be no + * more than 255. + * @param[in] mapping const unsigned char[channels]: Mapping from + * coded channels to output channels, as described in + * @ref opus_multistream. + * @param[out] error int *: Returns #OPUS_OK on success, or an error + * code (see @ref opus_errorcodes) on + * failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create( + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping, + int *error +) OPUS_ARG_NONNULL(5); + +/** Intialize a previously allocated decoder state object. + * The memory pointed to by \a st must be at least the size returned by + * opus_multistream_encoder_get_size(). + * This is intended for applications which use their own allocator instead of + * malloc. + * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. + * @see opus_multistream_decoder_create + * @see opus_multistream_deocder_get_size + * @param st OpusMSEncoder*: Multistream encoder state to initialize. + * @param Fs opus_int32: Sampling rate to decode at (in Hz). + * This must be one of 8000, 12000, 16000, + * 24000, or 48000. + * @param channels int: Number of channels to output. + * This must be at most 255. + * It may be different from the number of coded + * channels (streams + + * coupled_streams). + * @param streams int: The total number of streams coded in the + * input. + * This must be no more than 255. + * @param coupled_streams int: Number of streams to decode as coupled + * (2 channel) streams. + * This must be no larger than the total + * number of streams. + * Additionally, The total number of + * coded channels (streams + + * coupled_streams) must be no + * more than 255. + * @param[in] mapping const unsigned char[channels]: Mapping from + * coded channels to output channels, as described in + * @ref opus_multistream. + * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) + * on failure. + */ +OPUS_EXPORT int opus_multistream_decoder_init( + OpusMSDecoder *st, + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); + +/** Decode a multistream Opus packet. + * @param st OpusMSDecoder*: Multistream decoder state. + * @param[in] data const unsigned char*: Input payload. + * Use a NULL + * pointer to indicate packet + * loss. + * @param len opus_int32: Number of bytes in payload. + * @param[out] pcm opus_int16*: Output signal, with interleaved + * samples. + * This must contain room for + * frame_size*channels + * samples. + * @param frame_size int: The number of samples per channel of + * available space in \a pcm. + * If this is less than the maximum packet duration + * (120 ms; 5760 for 48kHz), this function will not be capable + * of decoding some packets. In the case of PLC (data==NULL) + * or FEC (decode_fec=1), then frame_size needs to be exactly + * the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the + * next incoming packet. For the PLC and FEC cases, frame_size + * must be a multiple of 2.5 ms. + * @param decode_fec int: Flag (0 or 1) to request that any in-band + * forward error correction data be decoded. + * If no such data is available, the frame is + * decoded as if it were lost. + * @returns Number of samples decoded on success or a negative error code + * (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode( + OpusMSDecoder *st, + const unsigned char *data, + opus_int32 len, + opus_int16 *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Decode a multistream Opus packet with floating point output. + * @param st OpusMSDecoder*: Multistream decoder state. + * @param[in] data const unsigned char*: Input payload. + * Use a NULL + * pointer to indicate packet + * loss. + * @param len opus_int32: Number of bytes in payload. + * @param[out] pcm opus_int16*: Output signal, with interleaved + * samples. + * This must contain room for + * frame_size*channels + * samples. + * @param frame_size int: The number of samples per channel of + * available space in \a pcm. + * If this is less than the maximum packet duration + * (120 ms; 5760 for 48kHz), this function will not be capable + * of decoding some packets. In the case of PLC (data==NULL) + * or FEC (decode_fec=1), then frame_size needs to be exactly + * the duration of audio that is missing, otherwise the + * decoder will not be in the optimal state to decode the + * next incoming packet. For the PLC and FEC cases, frame_size + * must be a multiple of 2.5 ms. + * @param decode_fec int: Flag (0 or 1) to request that any in-band + * forward error correction data be decoded. + * If no such data is available, the frame is + * decoded as if it were lost. + * @returns Number of samples decoded on success or a negative error code + * (see @ref opus_errorcodes) on failure. + */ +OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode_float( + OpusMSDecoder *st, + const unsigned char *data, + opus_int32 len, + float *pcm, + int frame_size, + int decode_fec +) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); + +/** Perform a CTL function on a multistream Opus decoder. + * + * Generally the request and subsequent arguments are generated by a + * convenience macro. + * @param st OpusMSDecoder*: Multistream decoder state. + * @param request This and all remaining parameters should be replaced by one + * of the convenience macros in @ref opus_genericctls, + * @ref opus_decoderctls, or @ref opus_multistream_ctls. + * @see opus_genericctls + * @see opus_decoderctls + * @see opus_multistream_ctls + */ +OPUS_EXPORT int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); + +/** Frees an OpusMSDecoder allocated by + * opus_multistream_decoder_create(). + * @param st OpusMSDecoder: Multistream decoder state to be freed. + */ +OPUS_EXPORT void opus_multistream_decoder_destroy(OpusMSDecoder *st); + +/**@}*/ + +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* OPUS_MULTISTREAM_H */ diff --git a/Audio-Frameworks/bin/opus/include/opus_types.h b/Audio-Frameworks/bin/opus/include/opus_types.h new file mode 100644 index 0000000..b28e03a --- /dev/null +++ b/Audio-Frameworks/bin/opus/include/opus_types.h @@ -0,0 +1,159 @@ +/* (C) COPYRIGHT 1994-2002 Xiph.Org Foundation */ +/* Modified by Jean-Marc Valin */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/* opus_types.h based on ogg_types.h from libogg */ + +/** + @file opus_types.h + @brief Opus reference implementation types +*/ +#ifndef OPUS_TYPES_H +#define OPUS_TYPES_H + +/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */ +#if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H)) +#include + + typedef int16_t opus_int16; + typedef uint16_t opus_uint16; + typedef int32_t opus_int32; + typedef uint32_t opus_uint32; +#elif defined(_WIN32) + +# if defined(__CYGWIN__) +# include <_G_config.h> + typedef _G_int32_t opus_int32; + typedef _G_uint32_t opus_uint32; + typedef _G_int16 opus_int16; + typedef _G_uint16 opus_uint16; +# elif defined(__MINGW32__) + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; +# elif defined(__MWERKS__) + typedef int opus_int32; + typedef unsigned int opus_uint32; + typedef short opus_int16; + typedef unsigned short opus_uint16; +# else + /* MSVC/Borland */ + typedef __int32 opus_int32; + typedef unsigned __int32 opus_uint32; + typedef __int16 opus_int16; + typedef unsigned __int16 opus_uint16; +# endif + +#elif defined(__MACOS__) + +# include + typedef SInt16 opus_int16; + typedef UInt16 opus_uint16; + typedef SInt32 opus_int32; + typedef UInt32 opus_uint32; + +#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ + +# include + typedef int16_t opus_int16; + typedef u_int16_t opus_uint16; + typedef int32_t opus_int32; + typedef u_int32_t opus_uint32; + +#elif defined(__BEOS__) + + /* Be */ +# include + typedef int16 opus_int16; + typedef u_int16 opus_uint16; + typedef int32_t opus_int32; + typedef u_int32_t opus_uint32; + +#elif defined (__EMX__) + + /* OS/2 GCC */ + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; + +#elif defined (DJGPP) + + /* DJGPP */ + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; + +#elif defined(R5900) + + /* PS2 EE */ + typedef int opus_int32; + typedef unsigned opus_uint32; + typedef short opus_int16; + typedef unsigned short opus_uint16; + +#elif defined(__SYMBIAN32__) + + /* Symbian GCC */ + typedef signed short opus_int16; + typedef unsigned short opus_uint16; + typedef signed int opus_int32; + typedef unsigned int opus_uint32; + +#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) + + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef long opus_int32; + typedef unsigned long opus_uint32; + +#elif defined(CONFIG_TI_C6X) + + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; + +#else + + /* Give up, take a reasonable guess */ + typedef short opus_int16; + typedef unsigned short opus_uint16; + typedef int opus_int32; + typedef unsigned int opus_uint32; + +#endif + +#define opus_int int /* used for counters etc; at least 16 bits */ +#define opus_int64 long long +#define opus_int8 signed char + +#define opus_uint unsigned int /* used for counters etc; at least 16 bits */ +#define opus_uint64 unsigned long long +#define opus_uint8 unsigned char + +#endif /* OPUS_TYPES_H */ diff --git a/Audio-Frameworks/bin/opus/libopus.a b/Audio-Frameworks/bin/opus/libopus.a new file mode 100644 index 0000000..b137150 Binary files /dev/null and b/Audio-Frameworks/bin/opus/libopus.a differ diff --git a/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Headers b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/OpusFile b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/OpusFile new file mode 120000 index 0000000..5206f36 --- /dev/null +++ b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/OpusFile @@ -0,0 +1 @@ +Versions/Current/OpusFile \ No newline at end of file diff --git a/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Resources b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Versions/A/Headers/opusfile.h b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Versions/A/Headers/opusfile.h new file mode 100644 index 0000000..3eda828 --- /dev/null +++ b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Versions/A/Headers/opusfile.h @@ -0,0 +1,1866 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE libopusfile SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE libopusfile SOURCE CODE IS (C) COPYRIGHT 1994-2012 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: stdio-based convenience library for opening/seeking/decoding + last mod: $Id: vorbisfile.h 17182 2010-04-29 03:48:32Z xiphmont $ + + ********************************************************************/ +#if !defined(_opusfile_h) +# define _opusfile_h (1) + +/**\mainpage + \section Introduction + + This is the documentation for the libopusfile C API. + + The libopusfile package provides a convenient high-level API for + decoding and basic manipulation of all Ogg Opus audio streams. + libopusfile is implemented as a layer on top of Xiph.Org's + reference + libogg + and + libopus + libraries. + + libopusfile provides several sets of built-in routines for + file/stream access, and may also use custom stream I/O routines provided by + the embedded environment. + There are built-in I/O routines provided for ANSI-compliant + stdio (FILE *), memory buffers, and URLs + (including URLs, plus optionally and URLs). + + \section Organization + + The main API is divided into several sections: + - \ref stream_open_close + - \ref stream_info + - \ref stream_decoding + - \ref stream_seeking + + Several additional sections are not tied to the main API. + - \ref stream_callbacks + - \ref header_info + - \ref error_codes + + \section Overview + + The libopusfile API always decodes files to 48 kHz. + The original sample rate is not preserved by the lossy compression, though + it is stored in the header to allow you to resample to it after decoding + (the libopusfile API does not currently provide a resampler, + but the + the + Speex resampler is a good choice if you need one). + In general, if you are playing back the audio, you should leave it at + 48 kHz, provided your audio hardware supports it. + When decoding to a file, it may be worth resampling back to the original + sample rate, so as not to surprise users who might not expect the sample + rate to change after encoding to Opus and decoding. + + Opus files can contain anywhere from 1 to 255 channels of audio. + The channel mappings for up to 8 channels are the same as the + Vorbis + mappings. + A special stereo API can convert everything to 2 channels, making it simple + to support multichannel files in a application which only has stereo + output. + Although the libopusfile ABI provides support for the theoretical + maximum number of channels, the current implementation does not support + files with more than 8 channels, as they do not have well-defined channel + mappings. + + Like all Ogg files, Opus files may be "chained". + That is, multiple Opus files may be combined into a single, longer file just + by concatenating the original files. + This is commonly done in internet radio streaming, as it allows the title + and artist to be updated each time the song changes, since each link in the + chain includes its own set of metadata. + + libopusfile fully supports chained files. + It will decode the first Opus stream found in each link of a chained file + (ignoring any other streams that might be concurrently multiplexed with it, + such as a video stream). + + The channel count can also change between links, but if your application is + not prepared to deal with this, it can use the stereo API to ensure the + audio from all links will always get decoded into a common format. + Since libopusfile always decodes to 48 kHz, you do not have to + worry about the sample rate changing between links (as was possible with + Vorbis). + This makes application support for chained files with libopusfile + very easy.*/ + +# if defined(__cplusplus) +extern "C" { +# endif + +# include +# include +# include +# include + +/*Enable special features for gcc and gcc-compatible compilers.*/ +# if !defined(OP_GNUC_PREREQ) +# if defined(__GNUC__)&&defined(__GNUC_MINOR__) +# define OP_GNUC_PREREQ(_maj,_min) \ + ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) +# else +# define OP_GNUC_PREREQ(_maj,_min) 0 +# endif +# endif + +# if OP_GNUC_PREREQ(4,0) +# pragma GCC visibility push(default) +# endif + +typedef struct OpusHead OpusHead; +typedef struct OpusTags OpusTags; +typedef struct OpusPictureTag OpusPictureTag; +typedef struct OggOpusFile OggOpusFile; + +/*Warning attributes for libopusfile functions.*/ +# if OP_GNUC_PREREQ(3,4) +# define OP_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) +# else +# define OP_WARN_UNUSED_RESULT +# endif +# if OP_GNUC_PREREQ(3,4) +# define OP_ARG_NONNULL(_x) __attribute__((__nonnull__(_x))) +# else +# define OP_ARG_NONNULL(_x) +# endif + +/**\defgroup error_codes Error Codes*/ +/*@{*/ +/**\name List of possible error codes + Many of the functions in this library return a negative error code when a + function fails. + This list provides a brief explanation of the common errors. + See each individual function for more details on what a specific error code + means in that context.*/ +/*@{*/ + +/**A request did not succeed.*/ +#define OP_FALSE (-1) +/*Currently not used externally.*/ +#define OP_EOF (-2) +/**There was a hole in the page sequence numbers (e.g., a page was corrupt or + missing).*/ +#define OP_HOLE (-3) +/**An underlying read, seek, or tell operation failed when it should have + succeeded.*/ +#define OP_EREAD (-128) +/**A NULL pointer was passed where one was unexpected, or an + internal memory allocation failed, or an internal library error was + encountered.*/ +#define OP_EFAULT (-129) +/**The stream used a feature that is not implemented, such as an unsupported + channel family.*/ +#define OP_EIMPL (-130) +/**One or more parameters to a function were invalid.*/ +#define OP_EINVAL (-131) +/**A purported Ogg Opus stream did not begin with an Ogg page, a purported + header packet did not start with one of the required strings, "OpusHead" or + "OpusTags", or a link in a chained file was encountered that did not + contain any logical Opus streams.*/ +#define OP_ENOTFORMAT (-132) +/**A required header packet was not properly formatted, contained illegal + values, or was missing altogether.*/ +#define OP_EBADHEADER (-133) +/**The ID header contained an unrecognized version number.*/ +#define OP_EVERSION (-134) +/*Currently not used at all.*/ +#define OP_ENOTAUDIO (-135) +/**An audio packet failed to decode properly. + This is usually caused by a multistream Ogg packet where the durations of + the individual Opus packets contained in it are not all the same.*/ +#define OP_EBADPACKET (-136) +/**We failed to find data we had seen before, or the bitstream structure was + sufficiently malformed that seeking to the target destination was + impossible.*/ +#define OP_EBADLINK (-137) +/**An operation that requires seeking was requested on an unseekable stream.*/ +#define OP_ENOSEEK (-138) +/**The first or last granule position of a link failed basic validity checks.*/ +#define OP_EBADTIMESTAMP (-139) + +/*@}*/ +/*@}*/ + +/**\defgroup header_info Header Information*/ +/*@{*/ + +/**The maximum number of channels in an Ogg Opus stream.*/ +#define OPUS_CHANNEL_COUNT_MAX (255) + +/**Ogg Opus bitstream information. + This contains the basic playback parameters for a stream, and corresponds to + the initial ID header packet of an Ogg Opus stream.*/ +struct OpusHead{ + /**The Ogg Opus format version, in the range 0...255. + The top 4 bits represent a "major" version, and the bottom four bits + represent backwards-compatible "minor" revisions. + The current specification describes version 1. + This library will recognize versions up through 15 as backwards compatible + with the current specification. + An earlier draft of the specification described a version 0, but the only + difference between version 1 and version 0 is that version 0 did + not specify the semantics for handling the version field.*/ + int version; + /**The number of channels, in the range 1...255.*/ + int channel_count; + /**The number of samples that should be discarded from the beginning of the + stream.*/ + unsigned pre_skip; + /**The sampling rate of the original input. + All Opus audio is coded at 48 kHz, and should also be decoded at 48 kHz + for playback (unless the target hardware does not support this sampling + rate). + However, this field may be used to resample the audio back to the original + sampling rate, for example, when saving the output to a file.*/ + opus_uint32 input_sample_rate; + /**The gain to apply to the decoded output, in dB, as a Q8 value in the range + -32768...32767. + The libopusfile API will automatically apply this gain to the + decoded output before returning it, scaling it by + pow(10,output_gain/(20.0*256)).*/ + int output_gain; + /**The channel mapping family, in the range 0...255. + Channel mapping family 0 covers mono or stereo in a single stream. + Channel mapping family 1 covers 1 to 8 channels in one or more streams, + using the Vorbis speaker assignments. + Channel mapping family 255 covers 1 to 255 channels in one or more + streams, but without any defined speaker assignment.*/ + int mapping_family; + /**The number of Opus streams in each Ogg packet, in the range 1...255.*/ + int stream_count; + /**The number of coupled Opus streams in each Ogg packet, in the range + 0...127. + This must satisfy 0 <= coupled_count <= stream_count and + coupled_count + stream_count <= 255. + The coupled streams appear first, before all uncoupled streams, in an Ogg + Opus packet.*/ + int coupled_count; + /**The mapping from coded stream channels to output channels. + Let index=mapping[k] be the value for channel k. + If index<2*coupled_count, then it refers to the left channel + from stream (index/2) if even, and the right channel from + stream (index/2) if odd. + Otherwise, it refers to the output of the uncoupled stream + (index-coupled_count).*/ + unsigned char mapping[OPUS_CHANNEL_COUNT_MAX]; +}; + +/**The metadata from an Ogg Opus stream. + + This structure holds the in-stream metadata corresponding to the 'comment' + header packet of an Ogg Opus stream. + The comment header is meant to be used much like someone jotting a quick + note on the label of a CD. + It should be a short, to the point text note that can be more than a couple + words, but not more than a short paragraph. + + The metadata is stored as a series of (tag, value) pairs, in length-encoded + string vectors, using the same format as Vorbis (without the final "framing + bit"), Theora, and Speex, except for the packet header. + The first occurrence of the '=' character delimits the tag and value. + A particular tag may occur more than once, and order is significant. + The character set encoding for the strings is always UTF-8, but the tag + names are limited to ASCII, and treated as case-insensitive. + See the Vorbis + comment header specification for details. + + In filling in this structure, libopusfile will null-terminate the + #user_comments strings for safety. + However, the bitstream format itself treats them as 8-bit clean vectors, + possibly containing NUL characters, so the #comment_lengths array should be + treated as their authoritative length. + + This structure is binary and source-compatible with a + vorbis_comment, and pointers to it may be freely cast to + vorbis_comment pointers, and vice versa. + It is provided as a separate type to avoid introducing a compile-time + dependency on the libvorbis headers.*/ +struct OpusTags{ + /**The array of comment string vectors.*/ + char **user_comments; + /**An array of the corresponding length of each vector, in bytes.*/ + int *comment_lengths; + /**The total number of comment streams.*/ + int comments; + /**The null-terminated vendor string. + This identifies the software used to encode the stream.*/ + char *vendor; +}; + +/**\name Picture tag image formats*/ +/*@{*/ + +/**The MIME type was not recognized, or the image data did not match the + declared MIME type.*/ +#define OP_PIC_FORMAT_UNKNOWN (-1) +/**The MIME type indicates the image data is really a URL.*/ +#define OP_PIC_FORMAT_URL (0) +/**The image is a JPEG.*/ +#define OP_PIC_FORMAT_JPEG (1) +/**The image is a PNG.*/ +#define OP_PIC_FORMAT_PNG (2) +/**The image is a GIF.*/ +#define OP_PIC_FORMAT_GIF (3) + +/*@}*/ + +/**The contents of a METADATA_BLOCK_PICTURE tag.*/ +struct OpusPictureTag{ + /**The picture type according to the ID3v2 APIC frame: +
    +
  1. Other
  2. +
  3. 32x32 pixels 'file icon' (PNG only)
  4. +
  5. Other file icon
  6. +
  7. Cover (front)
  8. +
  9. Cover (back)
  10. +
  11. Leaflet page
  12. +
  13. Media (e.g. label side of CD)
  14. +
  15. Lead artist/lead performer/soloist
  16. +
  17. Artist/performer
  18. +
  19. Conductor
  20. +
  21. Band/Orchestra
  22. +
  23. Composer
  24. +
  25. Lyricist/text writer
  26. +
  27. Recording Location
  28. +
  29. During recording
  30. +
  31. During performance
  32. +
  33. Movie/video screen capture
  34. +
  35. A bright colored fish
  36. +
  37. Illustration
  38. +
  39. Band/artist logotype
  40. +
  41. Publisher/Studio logotype
  42. +
+ Others are reserved and should not be used. + There may only be one each of picture type 1 and 2 in a file.*/ + opus_int32 type; + /**The MIME type of the picture, in printable ASCII characters 0x20-0x7E. + The MIME type may also be "-->" to signify that the data part + is a URL pointing to the picture instead of the picture data itself. + In this case, a terminating NUL is appended to the URL string in #data, + but #data_length is set to the length of the string excluding that + terminating NUL.*/ + char *mime_type; + /**The description of the picture, in UTF-8.*/ + char *description; + /**The width of the picture in pixels.*/ + opus_uint32 width; + /**The height of the picture in pixels.*/ + opus_uint32 height; + /**The color depth of the picture in bits-per-pixel (not + bits-per-channel).*/ + opus_uint32 depth; + /**For indexed-color pictures (e.g., GIF), the number of colors used, or 0 + for non-indexed pictures.*/ + opus_uint32 colors; + /**The length of the picture data in bytes.*/ + opus_uint32 data_length; + /**The binary picture data.*/ + unsigned char *data; + /**The format of the picture data, if known. + One of +
    +
  • #OP_PIC_FORMAT_UNKNOWN,
  • +
  • #OP_PIC_FORMAT_URL,
  • +
  • #OP_PIC_FORMAT_JPEG,
  • +
  • #OP_PIC_FORMAT_PNG,
  • +
  • #OP_PIC_FORMAT_GIF, or
  • +
.*/ + int format; +}; + +/**\name Functions for manipulating header data + + These functions manipulate the #OpusHead and #OpusTags structures, + which describe the audio parameters and tag-value metadata, respectively. + These can be used to query the headers returned by libopusfile, or + to parse Opus headers from sources other than an Ogg Opus stream, provided + they use the same format.*/ +/*@{*/ + +/**Parses the contents of the ID header packet of an Ogg Opus stream. + \param[out] _head Returns the contents of the parsed packet. + The contents of this structure are untouched on error. + This may be NULL to merely test the header + for validity. + \param[in] _data The contents of the ID header packet. + \param _len The number of bytes of data in the ID header packet. + \return 0 on success or a negative value on error. + \retval #OP_ENOTFORMAT If the data does not start with the "OpusHead" + string. + \retval #OP_EVERSION If the version field signaled a version this library + does not know how to parse. + \retval #OP_EIMPL If the channel mapping family was 255, which general + purpose players should not attempt to play. + \retval #OP_EBADHEADER If the contents of the packet otherwise violate the + Ogg Opus specification: +
    +
  • Insufficient data,
  • +
  • Too much data for the known minor versions,
  • +
  • An unrecognized channel mapping family,
  • +
  • Zero channels or too many channels,
  • +
  • Zero coded streams,
  • +
  • Too many coupled streams, or
  • +
  • An invalid channel mapping index.
  • +
*/ +OP_WARN_UNUSED_RESULT int opus_head_parse(OpusHead *_head, + const unsigned char *_data,size_t _len) OP_ARG_NONNULL(2); + +/**Converts a granule position to a sample offset for a given Ogg Opus stream. + The sample offset is simply _gp-_head->pre_skip. + Granule position values smaller than OpusHead#pre_skip correspond to audio + that should never be played, and thus have no associated sample offset. + This function returns -1 for such values. + This function also correctly handles extremely large granule positions, + which may have wrapped around to a negative number when stored in a signed + ogg_int64_t value. + \param _head The #OpusHead information from the ID header of the stream. + \param _gp The granule position to convert. + \return The sample offset associated with the given granule position + (counting at a 48 kHz sampling rate), or the special value -1 on + error (i.e., the granule position was smaller than the pre-skip + amount).*/ +ogg_int64_t opus_granule_sample(const OpusHead *_head,ogg_int64_t _gp) + OP_ARG_NONNULL(1); + +/**Parses the contents of the 'comment' header packet of an Ogg Opus stream. + \param[out] _tags An uninitialized #OpusTags structure. + This returns the contents of the parsed packet. + The contents of this structure are untouched on error. + This may be NULL to merely test the header + for validity. + \param[in] _data The contents of the 'comment' header packet. + \param _len The number of bytes of data in the 'info' header packet. + \retval 0 Success. + \retval #OP_ENOTFORMAT If the data does not start with the "OpusTags" + string. + \retval #OP_EBADHEADER If the contents of the packet otherwise violate the + Ogg Opus specification. + \retval #OP_EFAULT If there wasn't enough memory to store the tags.*/ +OP_WARN_UNUSED_RESULT int opus_tags_parse(OpusTags *_tags, + const unsigned char *_data,size_t _len) OP_ARG_NONNULL(2); + +/**Initializes an #OpusTags structure. + This should be called on a freshly allocated #OpusTags structure before + attempting to use it. + \param _tags The #OpusTags structure to initialize.*/ +void opus_tags_init(OpusTags *_tags) OP_ARG_NONNULL(1); + +/**Add a (tag, value) pair to an initialized #OpusTags structure. + \note Neither opus_tags_add() nor opus_tags_add_comment() support values + containing embedded NULs, although the bitstream format does support them. + To add such tags, you will need to manipulate the #OpusTags structure + directly. + \param _tags The #OpusTags structure to add the (tag, value) pair to. + \param _tag A NUL-terminated, case-insensitive, ASCII string containing + the tag to add (without an '=' character). + \param _value A NUL-terminated UTF-8 containing the corresponding value. + \return 0 on success, or a negative value on failure. + \retval #OP_EFAULT An internal memory allocation failed.*/ +int opus_tags_add(OpusTags *_tags,const char *_tag,const char *_value) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2) OP_ARG_NONNULL(3); + +/**Add a comment to an initialized #OpusTags structure. + \note Neither opus_tags_add_comment() nor opus_tags_add() support comments + containing embedded NULs, although the bitstream format does support them. + To add such tags, you will need to manipulate the #OpusTags structure + directly. + \param _tags The #OpusTags structure to add the comment to. + \param _comment A NUL-terminated UTF-8 string containing the comment in + "TAG=value" form. + \return 0 on success, or a negative value on failure. + \retval #OP_EFAULT An internal memory allocation failed.*/ +int opus_tags_add_comment(OpusTags *_tags,const char *_comment) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Look up a comment value by its tag. + \param _tags An initialized #OpusTags structure. + \param _tag The tag to look up. + \param _count The instance of the tag. + The same tag can appear multiple times, each with a distinct + value, so an index is required to retrieve them all. + The order in which these values appear is significant and + should be preserved. + Use opus_tags_query_count() to get the legal range for the + \a _count parameter. + \return A pointer to the queried tag's value. + This points directly to data in the #OpusTags structure. + It should not be modified or freed by the application, and + modifications to the structure may invalidate the pointer. + \retval NULL If no matching tag is found.*/ +const char *opus_tags_query(const OpusTags *_tags,const char *_tag,int _count) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Look up the number of instances of a tag. + Call this first when querying for a specific tag and then iterate over the + number of instances with separate calls to opus_tags_query() to retrieve + all the values for that tag in order. + \param _tags An initialized #OpusTags structure. + \param _tag The tag to look up. + \return The number of instances of this particular tag.*/ +int opus_tags_query_count(const OpusTags *_tags,const char *_tag) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Get the track gain from an R128_TRACK_GAIN tag, if one was specified. + This searches for the first R128_TRACK_GAIN tag with a valid signed, + 16-bit decimal integer value and returns the value. + This routine is exposed merely for convenience for applications which wish + to do something special with the track gain (i.e., display it). + If you simply wish to apply the track gain instead of the header gain, you + can use op_set_gain_offset() with an #OP_TRACK_GAIN type and no offset. + \param _tags An initialized #OpusTags structure. + \param[out] _gain_q8 The track gain, in 1/256ths of a dB. + This will lie in the range [-32768,32767], and should + be applied in addition to the header gain. + On error, no value is returned, and the previous + contents remain unchanged. + \return 0 on success, or a negative value on error. + \retval OP_EFALSE There was no track gain available in the given tags.*/ +int opus_tags_get_track_gain(const OpusTags *_tags,int *_gain_q8) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Clears the #OpusTags structure. + This should be called on an #OpusTags structure after it is no longer + needed. + It will free all memory used by the structure members. + \param _tags The #OpusTags structure to clear.*/ +void opus_tags_clear(OpusTags *_tags) OP_ARG_NONNULL(1); + +/**Parse a single METADATA_BLOCK_PICTURE tag. + This decodes the BASE64-encoded content of the tag and returns a structure + with the MIME type, description, image parameters (if known), and the + compressed image data. + If the MIME type indicates the presence of an image format we recognize + (JPEG, PNG, or GIF) and the actual image data contains the magic signature + associated with that format, then the OpusPictureTag::format field will be + set to the corresponding format. + This is provided as a convenience to avoid requiring applications to parse + the MIME type and/or do their own format detection for the commonly used + formats. + In this case, we also attempt to extract the image parameters directly from + the image data (overriding any that were present in the tag, which the + specification says applications are not meant to rely on). + The application must still provide its own support for actually decoding the + image data and, if applicable, retrieving that data from URLs. + \param[out] _pic Returns the parsed picture data. + No sanitation is done on the type, MIME type, or + description fields, so these might return invalid values. + The contents of this structure are left unmodified on + failure. + \param _tag The METADATA_BLOCK_PICTURE tag contents. + The leading "METADATA_BLOCK_PICTURE=" portion is optional, + to allow the function to be used on either directly on the + values in OpusTags::user_comments or on the return value + of opus_tags_query(). + \return 0 on success or a negative value on error. + \retval #OP_ENOTFORMAT The METADATA_BLOCK_PICTURE contents were not valid. + \retval #OP_EFAULT A memory allocation failed.*/ +int opus_picture_tag_parse(OpusPictureTag *_pic,const char *_tag) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Initializes an #OpusPictureTag structure. + This should be called on a freshly allocated #OpusPictureTag structure + before attempting to use it. + \param _pic The #OpusPictureTag structure to initialize.*/ +void opus_picture_tag_init(OpusPictureTag *_pic) OP_ARG_NONNULL(1); + +/**Clears the #OpusPictureTag structure. + This should be called on an #OpusPictureTag structure after it is no longer + needed. + It will free all memory used by the structure members. + \param _pic The #OpusPictureTag structure to clear.*/ +void opus_picture_tag_clear(OpusPictureTag *_pic) OP_ARG_NONNULL(1); + +/*@}*/ + +/*@}*/ + +/**\defgroup url_options URL Reading Options*/ +/*@{*/ +/**\name URL reading options + Options for op_url_stream_create() and associated functions. + These allow you to provide proxy configuration parameters, skip SSL + certificate checks, etc. + Options are processed in order, and if the same option is passed multiple + times, only the value specified by the last occurrence has an effect + (unless otherwise specified). + They may be expanded in the future.*/ +/*@{*/ + +/*These are the raw numbers used to define the request codes. + They should not be used directly.*/ +#define OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST (6464) +#define OP_HTTP_PROXY_HOST_REQUEST (6528) +#define OP_HTTP_PROXY_PORT_REQUEST (6592) +#define OP_HTTP_PROXY_USER_REQUEST (6656) +#define OP_HTTP_PROXY_PASS_REQUEST (6720) + +#define OP_URL_OPT(_request) ((_request)+(char *)0) + +/*These macros trigger compilation errors or warnings if the wrong types are + provided to one of the URL options.*/ +#define OP_CHECK_INT(_x) ((void)((_x)==(opus_int32)0),(opus_int32)(_x)) +#define OP_CHECK_CONST_CHAR_PTR(_x) ((_x)+((_x)-(const char *)(_x))) + +/**Skip the certificate check when connecting via TLS/SSL (https). + \param _b opus_int32: Whether or not to skip the certificate + check. + The check will be skipped if \a _b is non-zero, and will not be + skipped if \a _b is zero. + \hideinitializer*/ +#define OP_SSL_SKIP_CERTIFICATE_CHECK(_b) \ + OP_URL_OPT(OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST),OP_CHECK_INT(_b) + +/**Proxy connections through the given host. + If no port is specified via #OP_HTTP_PROXY_PORT, the port number defaults + to 8080 (http-alt). + All proxy parameters are ignored for non-http and non-https URLs. + \param _host const char *: The proxy server hostname. + This may be NULL to disable the use of a proxy + server. + \hideinitializer*/ +#define OP_HTTP_PROXY_HOST(_host) \ + OP_URL_OPT(OP_HTTP_PROXY_HOST_REQUEST),OP_CHECK_CONST_CHAR_PTR(_host) + +/**Use the given port when proxying connections. + This option only has an effect if #OP_HTTP_PROXY_HOST is specified with a + non-NULL \a _host. + If this option is not provided, the proxy port number defaults to 8080 + (http-alt). + All proxy parameters are ignored for non-http and non-https URLs. + \param _port opus_int32: The proxy server port. + This must be in the range 0...65535 (inclusive), or the + URL function this is passed to will fail. + \hideinitializer*/ +#define OP_HTTP_PROXY_PORT(_port) \ + OP_URL_OPT(OP_HTTP_PROXY_PORT_REQUEST),OP_CHECK_INT(_port) + +/**Use the given user name for authentication when proxying connections. + All proxy parameters are ignored for non-http and non-https URLs. + \param _user const char *: The proxy server user name. + This may be NULL to disable proxy + authentication. + A non-NULL value only has an effect + if #OP_HTTP_PROXY_HOST and #OP_HTTP_PROXY_PASS + are also specified with non-NULL + arguments. + \hideinitializer*/ +#define OP_HTTP_PROXY_USER(_user) \ + OP_URL_OPT(OP_HTTP_PROXY_USER_REQUEST),OP_CHECK_CONST_CHAR_PTR(_host) + +/**Use the given password for authentication when proxying connections. + All proxy parameters are ignored for non-http and non-https URLs. + \param _pass const char *: The proxy server password. + This may be NULL to disable proxy + authentication. + A non-NULL value only has an effect + if #OP_HTTP_PROXY_HOST and #OP_HTTP_PROXY_USER + are also specified with non-NULL + arguments. + \hideinitializer*/ +#define OP_HTTP_PROXY_PASS(_pass) \ + OP_URL_OPT(OP_HTTP_PROXY_PASS_REQUEST),OP_CHECK_CONST_CHAR_PTR(_host) + +/*@}*/ +/*@}*/ + +/**\defgroup stream_callbacks Abstract Stream Reading Interface*/ +/*@{*/ +/**\name Functions for reading from streams + These functions define the interface used to read from and seek in a stream + of data. + A stream does not need to implement seeking, but the decoder will not be + able to seek if it does not do so. + These functions also include some convenience routines for working with + standard FILE pointers, complete streams stored in a single + block of memory, or URLs.*/ +/*@{*/ + +typedef struct OpusFileCallbacks OpusFileCallbacks; + +/**Reads up to \a _nbytes bytes of data from \a _stream. + \param _stream The stream to read from. + \param[out] _ptr The buffer to store the data in. + \param _nbytes The maximum number of bytes to read. + This function may return fewer, though it will not + return zero unless it reaches end-of-file. + \return The number of bytes successfully read, or a negative value on + error.*/ +typedef int (*op_read_func)(void *_stream,unsigned char *_ptr,int _nbytes); + +/**Sets the position indicator for \a _stream. + The new position, measured in bytes, is obtained by adding \a _offset + bytes to the position specified by \a _whence. + If \a _whence is set to SEEK_SET, SEEK_CUR, or + SEEK_END, the offset is relative to the start of the stream, + the current position indicator, or end-of-file, respectively. + \retval 0 Success. + \retval -1 Seeking is not supported or an error occurred. + errno need not be set.*/ +typedef int (*op_seek_func)(void *_stream,opus_int64 _offset,int _whence); + +/**Obtains the current value of the position indicator for \a _stream. + \return The current position indicator.*/ +typedef opus_int64 (*op_tell_func)(void *_stream); + +/**Closes the underlying stream. + \retval 0 Success. + \retval EOF An error occurred. + errno need not be set.*/ +typedef int (*op_close_func)(void *_stream); + +/**The callbacks used to access non-FILE stream resources. + The function prototypes are basically the same as for the stdio functions + fread(), fseek(), ftell(), and + fclose(). + The differences are that the FILE * arguments have been + replaced with a void *, which is to be used as a pointer to + whatever internal data these functions might need, that #seek and #tell + take and return 64-bit offsets, and that #seek must return -1 if + the stream is unseekable.*/ +struct OpusFileCallbacks{ + /**Used to read data from the stream. + This must not be NULL.*/ + op_read_func read; + /**Used to seek in the stream. + This may be NULL if seeking is not implemented.*/ + op_seek_func seek; + /**Used to return the current read position in the stream. + This may be NULL if seeking is not implemented.*/ + op_tell_func tell; + /**Used to close the stream when the decoder is freed. + This may be NULL to leave the stream open.*/ + op_close_func close; +}; + +/**Opens a stream with fopen() and fills in a set of callbacks + that can be used to access it. + This is useful to avoid writing your own portable 64-bit seeking wrappers, + and also avoids cross-module linking issues on Windows, where a + FILE * must be accessed by routines defined in the same module + that opened it. + \param[out] _cb The callbacks to use for this file. + If there is an error opening the file, nothing will be + filled in here. + \param _path The path to the file to open. + On Windows, this string must be UTF-8 (to allow access to + files whose names cannot be represented in the current + MBCS code page). + All other systems use the native character encoding. + \param _mode The mode to open the file in. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_fopen(OpusFileCallbacks *_cb, + const char *_path,const char *_mode) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2) + OP_ARG_NONNULL(3); + +/**Opens a stream with fdopen() and fills in a set of callbacks + that can be used to access it. + This is useful to avoid writing your own portable 64-bit seeking wrappers, + and also avoids cross-module linking issues on Windows, where a + FILE * must be accessed by routines defined in the same module + that opened it. + \param[out] _cb The callbacks to use for this file. + If there is an error opening the file, nothing will be + filled in here. + \param _fd The file descriptor to open. + \param _mode The mode to open the file in. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_fdopen(OpusFileCallbacks *_cb, + int _fd,const char *_mode) OP_ARG_NONNULL(1) OP_ARG_NONNULL(3); + +/**Opens a stream with freopen() and fills in a set of callbacks + that can be used to access it. + This is useful to avoid writing your own portable 64-bit seeking wrappers, + and also avoids cross-module linking issues on Windows, where a + FILE * must be accessed by routines defined in the same module + that opened it. + \param[out] _cb The callbacks to use for this file. + If there is an error opening the file, nothing will be + filled in here. + \param _path The path to the file to open. + On Windows, this string must be UTF-8 (to allow access + to files whose names cannot be represented in the + current MBCS code page). + All other systems use the native character encoding. + \param _mode The mode to open the file in. + \param _stream A stream previously returned by op_fopen(), op_fdopen(), + or op_freopen(). + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_freopen(OpusFileCallbacks *_cb, + const char *_path,const char *_mode,void *_stream) OP_ARG_NONNULL(1) + OP_ARG_NONNULL(2) OP_ARG_NONNULL(3) OP_ARG_NONNULL(4); + +/**Creates a stream that reads from the given block of memory. + This block of memory must contain the complete stream to decode. + This is useful for caching small streams (e.g., sound effects) in RAM. + \param[out] _cb The callbacks to use for this stream. + If there is an error creating the stream, nothing will be + filled in here. + \param _data The block of memory to read from. + \param _size The size of the block of memory. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_mem_stream_create(OpusFileCallbacks *_cb, + const unsigned char *_data,size_t _size) OP_ARG_NONNULL(1); + +/**Creates a stream that reads from the given URL. + This function behaves identically to op_url_stream_create(), except that it + takes a va_list instead of a variable number of arguments. + It does not call the va_end macro, and because it invokes the + va_arg macro, the value of \a _ap is undefined after the call. + \param[out] _cb The callbacks to use for this stream. + If there is an error creating the stream, nothing will + be filled in here. + \param _url The URL to read from. + Currently only the , , and + schemes are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always fail. + \param[in,out] _ap A list of the \ref url_options "optional flags" to use. + This is a variable-length list of options terminated + with NULL. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_url_stream_vcreate(OpusFileCallbacks *_cb, + const char *_url,va_list _ap) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Creates a stream that reads from the given URL using the specified proxy. + \param[out] _cb The callbacks to use for this stream. + If there is an error creating the stream, nothing will be + filled in here. + \param _url The URL to read from. + Currently only the , , and schemes + are supported. + Both and may be disabled at compile time, + in which case opening such URLs will always fail. + \param ... The \ref url_options "optional flags" to use. + This is a variable-length list of options terminated with + NULL. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_url_stream_create(OpusFileCallbacks *_cb, + const char *_url,...) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/*@}*/ +/*@}*/ + +/**\defgroup stream_open_close Opening and Closing*/ +/*@{*/ +/**\name Functions for opening and closing streams + + These functions allow you to test a stream to see if it is Opus, open it, + and close it. + Several flavors are provided for each of the built-in stream types, plus a + more general version which takes a set of application-provided callbacks.*/ +/*@{*/ + +/**Test to see if this is an Opus stream. + For good results, you will need at least 57 bytes (for a pure Opus-only + stream). + Something like 512 bytes will give more reliable results for multiplexed + streams. + This function is meant to be a quick-rejection filter. + Its purpose is not to guarantee that a stream is a valid Opus stream, but to + ensure that it looks enough like Opus that it isn't going to be recognized + as some other format (except possibly an Opus stream that is also + multiplexed with other codecs, such as video). + \param[out] _head The parsed ID header contents. + You may pass NULL if you do not need + this information. + If the function fails, the contents of this structure + remain untouched. + \param _initial_data An initial buffer of data from the start of the + stream. + \param _initial_bytes The number of bytes in \a _initial_data. + \return 0 if the data appears to be Opus, or a negative value on error. + \retval #OP_FALSE There was not enough data to tell if this was an Opus + stream or not. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL The stream used a feature that is not implemented, + such as an unsupported channel family. + \retval #OP_ENOTFORMAT If the data did not contain a recognizable ID + header for an Opus stream. + \retval #OP_EVERSION If the version field signaled a version this library + does not know how to parse. + \retval #OP_EBADHEADER The ID header was not properly formatted or contained + illegal values.*/ +int op_test(OpusHead *_head, + const unsigned char *_initial_data,size_t _initial_bytes); + +/**Open a stream from the given file path. + \param _path The path to the file to open. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + The failure code will be #OP_EFAULT if the file could not + be opened, or one of the other failure codes from + op_open_callbacks() otherwise. + \return A freshly opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_file(const char *_path,int *_error) + OP_ARG_NONNULL(1); + +/**Open a stream from a memory buffer. + \param _data The memory buffer to open. + \param _size The number of bytes in the buffer. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + See op_open_callbacks() for a full list of failure codes. + \return A freshly opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_memory(const unsigned char *_data, + size_t _size,int *_error); + +/**Open a stream from a URL. + This function behaves identically to op_open_url(), except that it + takes a va_list instead of a variable number of arguments. + It does not call the va_end macro, and because it invokes the + va_arg macro, the value of \a _ap is undefined after the call. + \param _url The URL to open. + Currently only the , , and + schemes are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always + fail. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want + the failure code. + See op_open_callbacks() for a full list of failure + codes. + \param[in,out] _ap A list of the \ref url_options "optional flags" to + use. + This is a variable-length list of options terminated + with NULL. + \return A freshly opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_vopen_url(const char *_url, + int *_error,va_list _ap) OP_ARG_NONNULL(1); + +/**Open a stream from a URL. + However, this approach will not work for live streams or HTTP/1.0 servers + (which do not support Range requets). + \param _url The URL to open. + Currently only the , , and schemes + are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always fail. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + See op_open_callbacks() for a full list of failure codes. + \param ... The \ref url_options "optional flags" to use. + This is a variable-length list of options terminated with + NULL. + \return A freshly opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_url(const char *_url, + int *_error,...) OP_ARG_NONNULL(1); + +/**Open a stream using the given set of callbacks to access it. + \param _source The stream to read from (e.g., a FILE *). + \param _cb The callbacks with which to access the stream. + read() must + be implemented. + seek() and + tell() may + be NULL, or may always return -1 to + indicate a source is unseekable, but if + seek() is + implemented and succeeds on a particular source, then + tell() must + also. + close() may + be NULL, but if it is not, it will be + called when the \c OggOpusFile is destroyed by + op_free(). + It will not be called if op_open_callbacks() fails + with an error. + \param _initial_data An initial buffer of data from the start of the + stream. + Applications can read some number of bytes from the + start of the stream to help identify this as an Opus + stream, and then provide them here to allow the + stream to be opened, even if it is unseekable. + \param _initial_bytes The number of bytes in \a _initial_data. + If the stream is seekable, its current position (as + reported by + tell() + at the start of this function) must be equal to + \a _initial_bytes. + Otherwise, seeking to absolute positions will + generate inconsistent results. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want + the failure code. + The failure code will be one of +
+
#OP_EREAD
+
An underlying read, seek, or tell operation + failed when it should have succeeded, or we failed + to find data in the stream we had seen before.
+
#OP_EFAULT
+
There was a memory allocation failure, or an + internal library error.
+
#OP_EIMPL
+
The stream used a feature that is not + implemented, such as an unsupported channel + family.
+
#OP_EINVAL
+
seek() + was implemented and succeeded on this source, but + tell() + did not, or the starting position indicator was + not equal to \a _initial_bytes.
+
#OP_ENOTFORMAT
+
The stream contained a link that did not have + any logical Opus streams in it.
+
#OP_EBADHEADER
+
A required header packet was not properly + formatted, contained illegal values, or was missing + altogether.
+
#OP_EVERSION
+
An ID header contained an unrecognized version + number.
+
#OP_EBADLINK
+
We failed to find data we had seen before after + seeking.
+
#OP_EBADTIMESTAMP
+
The first or last timestamp in a link failed + basic validity checks.
+
+ \return A freshly opened \c OggOpusFile, or NULL on error. + libopusfile does not take ownership of the source + if the call fails. + The calling application is responsible for closing the source if + this call returns an error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_callbacks(void *_source, + const OpusFileCallbacks *_cb,const unsigned char *_initial_data, + size_t _initial_bytes,int *_error) OP_ARG_NONNULL(2); + +/**Partially open a stream from the given file path. + \see op_test_callbacks + \param _path The path to the file to open. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + The failure code will be #OP_EFAULT if the file could not + be opened, or one of the other failure codes from + op_open_callbacks() otherwise. + \return A partially opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_file(const char *_path,int *_error) + OP_ARG_NONNULL(1); + +/**Partially open a stream from a memory buffer. + \see op_test_callbacks + \param _data The memory buffer to open. + \param _size The number of bytes in the buffer. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + See op_open_callbacks() for a full list of failure codes. + \return A partially opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_memory(const unsigned char *_data, + size_t _size,int *_error); + +/**Partially open a stream from a URL. + This function behaves identically to op_test_url(), except that it + takes a va_list instead of a variable number of arguments. + It does not call the va_end macro, and because it invokes the + va_arg macro, the value of \a _ap is undefined after the call. + \see op_test_url + \see op_test_callbacks + \param _url The URL to open. + Currently only the , , and + schemes are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always + fail. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want + the failure code. + See op_open_callbacks() for a full list of failure + codes. + \param[in,out] _ap A list of the \ref url_options "optional flags" to + use. + This is a variable-length list of options terminated + with NULL. + \return A partially opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_vtest_url(const char *_url, + int *_error,va_list _ap) OP_ARG_NONNULL(1); + +/**Partially open a stream from a URL. + \see op_test_callbacks + \param _url The URL to open. + Currently only the , , and + schemes are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always fail. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + See op_open_callbacks() for a full list of failure + codes. + \param ... The \ref url_options "optional flags" to use. + This is a variable-length list of options terminated + with NULL. + \return A partially opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_url(const char *_url, + int *_error,...) OP_ARG_NONNULL(1); + +/**Partially open a stream using the given set of callbacks to access it. + This tests for Opusness and loads the headers for the first link. + It does not seek (although it tests for seekability). + You can query a partially open stream for the few pieces of basic + information returned by op_serialno(), op_channel_count(), op_head(), and + op_tags() (but only for the first link). + You may also determine if it is seekable via a call to op_seekable(). + You cannot read audio from the stream, seek, get the size or duration, + get information from links other than the first one, or even get the total + number of links until you finish opening the stream with op_test_open(). + If you do not need to do any of these things, you can dispose of it with + op_free() instead. + + This function is provided mostly to simplify porting existing code that used + libvorbisfile. + For new code, you are likely better off using op_test() instead, which + is less resource-intensive, requires less data to succeed, and imposes a + hard limit on the amount of data it examines (important for unseekable + sources, where all such data must be buffered until you are sure of the + stream type). + \param _source The stream to read from (e.g., a FILE *). + \param _cb The callbacks with which to access the stream. + read() must + be implemented. + seek() and + tell() may + be NULL, or may always return -1 to + indicate a source is unseekable, but if + seek() is + implemented and succeeds on a particular source, then + tell() must + also. + close() may + be NULL, but if it is not, it will be + called when the \c OggOpusFile is destroyed by + op_free(). + It will not be called if op_open_callbacks() fails + with an error. + \param _initial_data An initial buffer of data from the start of the + stream. + Applications can read some number of bytes from the + start of the stream to help identify this as an Opus + stream, and then provide them here to allow the + stream to be tested more thoroughly, even if it is + unseekable. + \param _initial_bytes The number of bytes in \a _initial_data. + If the stream is seekable, its current position (as + reported by + tell() + at the start of this function) must be equal to + \a _initial_bytes. + Otherwise, seeking to absolute positions will + generate inconsistent results. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want + the failure code. + See op_open_callbacks() for a full list of failure + codes. + \return A partially opened \c OggOpusFile, or NULL on error. + libopusfile does not take ownership of the source + if the call fails. + The calling application is responsible for closing the source if + this call returns an error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_callbacks(void *_source, + const OpusFileCallbacks *_cb,const unsigned char *_initial_data, + size_t _initial_bytes,int *_error) OP_ARG_NONNULL(2); + +/**Finish opening a stream partially opened with op_test_callbacks() or one of + the associated convenience functions. + If this function fails, you are still responsible for freeing the + \c OggOpusFile with op_free(). + \param _of The \c OggOpusFile to finish opening. + \return 0 on success, or a negative value on error. + \retval #OP_EREAD An underlying read, seek, or tell operation failed + when it should have succeeded. + \retval #OP_EFAULT There was a memory allocation failure, or an + internal library error. + \retval #OP_EIMPL The stream used a feature that is not implemented, + such as an unsupported channel family. + \retval #OP_EINVAL The stream was not partially opened with + op_test_callbacks() or one of the associated + convenience functions. + \retval #OP_ENOTFORMAT The stream contained a link that did not have any + logical Opus streams in it. + \retval #OP_EBADHEADER A required header packet was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An ID header contained an unrecognized version + number. + \retval #OP_EBADLINK We failed to find data we had seen before after + seeking. + \retval #OP_EBADTIMESTAMP The first or last timestamp in a link failed basic + validity checks.*/ +int op_test_open(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Release all memory used by an \c OggOpusFile. + \param _of The \c OggOpusFile to free.*/ +void op_free(OggOpusFile *_of); + +/*@}*/ +/*@}*/ + +/**\defgroup stream_info Stream Information*/ +/*@{*/ +/**\name Functions for obtaining information about streams + + These functions allow you to get basic information about a stream, including + seekability, the number of links (for chained streams), plus the size, + duration, bitrate, header parameters, and meta information for each link + (or, where available, the stream as a whole). + Some of these (size, duration) are only available for seekable streams. + You can also query the current stream position, link, and playback time, + and instantaneous bitrate during playback. + + Some of these functions may be used successfully on the partially open + streams returned by op_test_callbacks() or one of the associated + convenience functions. + Their documention will indicate so explicitly.*/ +/*@{*/ + +/**Returns whether or not the data source being read is seekable. + This is true if +
    +
  1. The seek() and + tell() callbacks are both + non-NULL,
  2. +
  3. The seek() callback was + successfully executed at least once, and
  4. +
  5. The tell() callback was + successfully able to report the position indicator afterwards.
  6. +
+ This function may be called on partially-opened streams. + \param _of The \c OggOpusFile whose seekable status is to be returned. + \return A non-zero value if seekable, and 0 if unseekable.*/ +int op_seekable(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Returns the number of links in this chained stream. + This function may be called on partially-opened streams, but it will always + return 1. + The actual number of links is not known until the stream is fully opened. + \param _of The \c OggOpusFile from which to retrieve the link count. + \return For fully-open seekable sources, this returns the total number of + links in the whole stream. + For partially-open or unseekable sources, this always returns 1.*/ +int op_link_count(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Get the serial number of the given link in a (possibly-chained) Ogg Opus + stream. + This function may be called on partially-opened streams, but it will always + return the serial number of the Opus stream in the first link. + \param _of The \c OggOpusFile from which to retrieve the serial number. + \param _li The index of the link whose serial number should be retrieved. + Use a negative number to get the serial number of the current + link. + \return The serial number of the given link. + If \a _li is greater than the total number of links, this returns + the serial number of the last link. + If the source is not seekable, this always returns the serial number + of the current link.*/ +opus_uint32 op_serialno(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the channel count of the given link in a (possibly-chained) Ogg Opus + stream. + This is equivalent to op_head(_of,_li)->channel_count, but + is provided for convenience. + This function may be called on partially-opened streams, but it will always + return the channel count of the Opus stream in the first link. + \param _of The \c OggOpusFile from which to retrieve the channel count. + \param _li The index of the link whose channel count should be retrieved. + Use a negative number to get the channel count of the current + link. + \return The channel count of the given link. + If \a _li is greater than the total number of links, this returns + the channel count of the last link. + If the source is not seekable, this always returns the channel count + of the current link.*/ +int op_channel_count(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the total (compressed) size of the stream, or of an individual link in + a (possibly-chained) Ogg Opus stream, including all headers and Ogg muxing + overhead. + \param _of The \c OggOpusFile from which to retrieve the compressed size. + \param _li The index of the link whose compressed size should be computed. + Use a negative number to get the compressed size of the entire + stream. + \return The compressed size of the entire stream if \a _li is negative, the + compressed size of link \a _li if it is non-negative, or a negative + value on error. + The compressed size of the entire stream may be smaller than that + of the underlying source if trailing garbage was detected in the + file. + \retval #OP_EINVAL The source is not seekable (so we can't know the length), + \a _li wasn't less than the total number of links in + the stream, or the stream was only partially open.*/ +opus_int64 op_raw_total(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the total PCM length (number of samples at 48 kHz) of the stream, or of + an individual link in a (possibly-chained) Ogg Opus stream. + Users looking for op_time_total() should use op_pcm_total() + instead. + Because timestamps in Opus are fixed at 48 kHz, there is no need for a + separate function to convert this to seconds (and leaving it out avoids + introducing floating point to the API, for those that wish to avoid it). + \param _of The \c OggOpusFile from which to retrieve the PCM offset. + \param _li The index of the link whose PCM length should be computed. + Use a negative number to get the PCM length of the entire stream. + \return The PCM length of the entire stream if \a _li is negative, the PCM + length of link \a _li if it is non-negative, or a negative value on + error. + \retval #OP_EINVAL The source is not seekable (so we can't know the length), + \a _li wasn't less than the total number of links in + the stream, or the stream was only partially open.*/ +ogg_int64_t op_pcm_total(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the ID header information for the given link in a (possibly chained) Ogg + Opus stream. + This function may be called on partially-opened streams, but it will always + return the ID header information of the Opus stream in the first link. + \param _of The \c OggOpusFile from which to retrieve the ID header + information. + \param _li The index of the link whose ID header information should be + retrieved. + Use a negative number to get the ID header information of the + current link. + For an unseekable stream, \a _li is ignored, and the ID header + information for the current link is always returned, if + available. + \return The contents of the ID header for the given link.*/ +const OpusHead *op_head(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the comment header information for the given link in a (possibly + chained) Ogg Opus stream. + This function may be called on partially-opened streams, but it will always + return the tags from the Opus stream in the first link. + \param _of The \c OggOpusFile from which to retrieve the comment header + information. + \param _li The index of the link whose comment header information should be + retrieved. + Use a negative number to get the comment header information of + the current link. + For an unseekable stream, \a _li is ignored, and the comment + header information for the current link is always returned, if + available. + \return The contents of the comment header for the given link, or + NULL if this is an unseekable stream that encountered + an invalid link.*/ +const OpusTags *op_tags(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Retrieve the index of the current link. + This is the link that produced the data most recently read by + op_read_float() or its associated functions, or, after a seek, the link + that the seek target landed in. + Reading more data may advance the link index (even on the first read after a + seek). + \param _of The \c OggOpusFile from which to retrieve the current link index. + \return The index of the current link on success, or a negative value on + failure. + For seekable streams, this is a number between 0 and the value + returned by op_link_count(). + For unseekable streams, this value starts at 0 and increments by one + each time a new link is encountered (even though op_link_count() + always returns 1). + \retval #OP_EINVAL The stream was only partially open.*/ +int op_current_link(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Computes the bitrate for a given link in a (possibly chained) Ogg Opus + stream. + The stream must be seekable to compute the bitrate. + For unseekable streams, use op_bitrate_instant() to get periodic estimates. + \param _of The \c OggOpusFile from which to retrieve the bitrate. + \param _li The index of the link whose bitrate should be computed. + USe a negative number to get the bitrate of the whole stream. + \return The bitrate on success, or a negative value on error. + \retval #OP_EINVAL The stream was only partially open, the stream was not + seekable, or \a _li was larger than the number of + links.*/ +opus_int32 op_bitrate(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Compute the instantaneous bitrate, measured as the ratio of bits to playable + samples decoded since a) the last call to op_bitrate_instant(), b) the last + seek, or c) the start of playback, whichever was most recent. + This will spike somewhat after a seek or at the start/end of a chain + boundary, as pre-skip, pre-roll, and end-trimming causes samples to be + decoded but not played. + \param _of The \c OggOpusFile from which to retrieve the bitrate. + \return The bitrate, in bits per second, or a negative value on error. + \retval #OP_FALSE No data has been decoded since any of the events + described above. + \retval #OP_EINVAL The stream was only partially open.*/ +opus_int32 op_bitrate_instant(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Obtain the current value of the position indicator for \a _of. + \param _of The \c OggOpusFile from which to retrieve the position indicator. + \return The byte position that is currently being read from. + \retval #OP_EINVAL The stream was only partially open.*/ +opus_int64 op_raw_tell(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Obtain the PCM offset of the next sample to be read. + If the stream is not properly timestamped, this might not increment by the + proper amount between reads, or even return monotonically increasing + values. + \param _of The \c OggOpusFile from which to retrieve the PCM offset. + \return The PCM offset of the next sample to be read. + \retval #OP_EINVAL The stream was only partially open.*/ +ogg_int64_t op_pcm_tell(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/*@}*/ +/*@}*/ + +/**\defgroup stream_seeking Seeking*/ +/*@{*/ +/**\name Functions for seeking in Opus streams + + These functions let you seek in Opus streams, if the underlying source + support it. + Seeking is implemented for all built-in stream I/O routines, though some + individual sources may not be seekable (pipes, live HTTP streams, or HTTP + streams from a server that does not support Range requests). + + op_raw_seek() is the fastest: it is guaranteed to perform at most one + physical seek, but, since the target is a byte position, makes no guarantee + how close to a given time it will come. + op_pcm_seek() provides sample-accurate seeking. + The number of physical seeks it requires is still quite small (often 1 or + 2, even in highly variable bitrate streams). + + Seeking in Opus requires decoding some pre-roll amount before playback to + allow the internal state to converge (as if recovering from packet loss). + This is handled internally by libopusfile, but means there is + little extra overhead for decoding up to the exact position requested + (since it must decode some amount of audio anyway). + It also means that decoding after seeking may not return exactly the same + values as would be obtained by decoding the stream straight through. + However, such differences are expected to be smaller than the loss + introduced by Opus's lossy compression.*/ +/*@{*/ + +/**Seek to a byte offset relative to the compressed data. + This also scans packets to update the PCM cursor. + It will cross a logical bitstream boundary, but only if it can't get any + packets out of the tail of the link to which it seeks. + \param _of The \c OggOpusFile in which to seek. + \param _byte_offset The byte position to seek to. + \return 0 on success, or a negative error code on failure. + \retval #OP_EREAD The underlying seek operation failed. + \retval #OP_EINVAL The stream was only partially open, or the target was + outside the valid range for the stream. + \retval #OP_ENOSEEK This stream is not seekable. + \retval #OP_EBADLINK Failed to initialize a decoder for a stream for an + unknown reason.*/ +int op_raw_seek(OggOpusFile *_of,opus_int64 _byte_offset) OP_ARG_NONNULL(1); + +/**Seek to the specified PCM offset, such that decoding will begin at exactly + the requested position. + \param _of The \c OggOpusFile in which to seek. + \param _pcm_offset The PCM offset to seek to. + This is in samples at 48 kHz relative to the start of the + stream. + \return 0 on success, or a negative value on error. + \retval #OP_EREAD An underlying read or seek operation failed. + \retval #OP_EINVAL The stream was only partially open, or the target was + outside the valid range for the stream. + \retval #OP_ENOSEEK This stream is not seekable. + \retval #OP_EBADLINK We failed to find data we had seen before, or the + bitstream structure was sufficiently malformed that + seeking to the target destination was impossible.*/ +int op_pcm_seek(OggOpusFile *_of,ogg_int64_t _pcm_offset) OP_ARG_NONNULL(1); + +/*@}*/ +/*@}*/ + +/**\defgroup stream_decoding Decoding*/ +/*@{*/ +/**\name Functions for decoding audio data + + These functions retrieve actual decoded audio data from the stream. + The general functions, op_read() and op_read_float() return 16-bit or + floating-point output, both using native endian ordering. + The number of channels returned can change from link to link in a chained + stream. + There are special functions, op_read_stereo() and op_read_float_stereo(), + which always output two channels, to simplify applications which do not + wish to handle multichannel audio. + These downmix multichannel files to two channels, so they can always return + samples in the same format for every link in a chained file. + + If the rest of your audio processing chain can handle floating point, those + routines should be preferred, as floating point output avoids introducing + clipping and other issues which might be avoided entirely if, e.g., you + scale down the volume at some other stage. + However, if you intend to direct consume 16-bit samples, the conversion in + libopusfile provides noise-shaping dithering and, if compiled + against libopus 1.1 or later, soft-clipping prevention. + + libopusfile can also be configured at compile time to use the + fixed-point libopus API. + If so, libopusfile's floating-point API may also be disabled. + In that configuration, nothing in libopusfile will use any + floating-point operations, to simplify support on devices without an + adequate FPU. + + \warning HTTPS streams may be be vulnerable to truncation attacks if you do + not check the error return code from op_read_float() or its associated + functions. + If the remote peer does not close the connection gracefully (with a TLS + "close notify" message), these functions will return OP_EREAD instead of 0 + when they reach the end of the file. + If you are reading from an URL (particularly if seeking is not + supported), you should make sure to check for this error and warn the user + appropriately.*/ +/*@{*/ + +/**Gain offset type that indicates that the provided offset is relative to the + header gain. + This is the default.*/ +#define OP_HEADER_GAIN (0) + +/**Gain offset type that indicates that the provided offset is relative to the + R128_TRACK_GAIN value (if any), in addition to the header gain.*/ +#define OP_TRACK_GAIN (3008) + +/**Gain offset type that indicates that the provided offset should be used as + the gain directly, without applying any the header or track gains.*/ +#define OP_ABSOLUTE_GAIN (3009) + +/**Sets the gain to be used for decoded output. + By default, the gain in the header is applied with no additional offset. + The total gain (including header gain and/or track gain, if applicable, and + this offset), will be clamped to [-32768,32767]/256 dB. + This is more than enough to saturate or underflow 16-bit PCM. + \note The new gain will not be applied to any already buffered, decoded + output. + This means you cannot change it sample-by-sample, as at best it will be + updated packet-by-packet. + It is meant for setting a target volume level, rather than applying smooth + fades, etc. + \param _of The \c OggOpusFile on which to set the gain offset. + \param _gain_type One of #OP_HEADER_GAIN, #OP_TRACK_GAIN, or + #OP_ABSOLUTE_GAIN. + \param _gain_offset_q8 The gain offset to apply, in 1/256ths of a dB. + \return 0 on success or a negative value on error. + \retval #OP_EINVAL The \a _gain_type was unrecognized.*/ +int op_set_gain_offset(OggOpusFile *_of, + int _gain_type,opus_int32 _gain_offset_q8); + +/**Reads more samples from the stream. + \note Although \a _buf_size must indicate the total number of values that + can be stored in \a _pcm, the return value is the number of samples + per channel. + This is done because +
    +
  1. The channel count cannot be known a priori (reading more samples might + advance us into the next link, with a different channel count), so + \a _buf_size cannot also be in units of samples per channel,
  2. +
  3. Returning the samples per channel matches the libopus API + as closely as we're able,
  4. +
  5. Returning the total number of values instead of samples per channel + would mean the caller would need a division to compute the samples per + channel, and might worry about the possibility of getting back samples + for some channels and not others, and
  6. +
  7. This approach is relatively fool-proof: if an application passes too + small a value to \a _buf_size, they will simply get fewer samples back, + and if they assume the return value is the total number of values, then + they will simply read too few (rather than reading too many and going + off the end of the buffer).
  8. +
+ \param _of The \c OggOpusFile from which to read. + \param[out] _pcm A buffer in which to store the output PCM samples, as + signed native-endian 16-bit values at 48 kHz + with a nominal range of [-32768,32767). + Multiple channels are interleaved using the + Vorbis + channel ordering. + This must have room for at least \a _buf_size values. + \param _buf_size The number of values that can be stored in \a _pcm. + It is recommended that this be large enough for at + least 120 ms of data at 48 kHz per channel (5760 + values per channel). + Smaller buffers will simply return less data, possibly + consuming more memory to buffer the data internally. + libopusfile may return less data than + requested. + If so, there is no guarantee that the remaining data + in \a _pcm will be unmodified. + \param[out] _li The index of the link this data was decoded from. + You may pass NULL if you do not need this + information. + If this function fails (returning a negative value), + this parameter is left unset. + \return The number of samples read per channel on success, or a negative + value on failure. + The channel count can be retrieved on success by calling + op_head(_of,*_li). + The number of samples returned may be 0 if the buffer was too small + to store even a single sample for all channels, or if end-of-file + was reached. + The list of possible failure codes follows. + Most of them can only be returned by unseekable, chained streams + that encounter a new link. + \retval #OP_HOLE There was a hole in the data, and some samples + may have been skipped. + Call this function again to continue decoding + past the hole. + \retval #OP_EREAD An underlying read operation failed. + This may signal a truncation attack from an + source. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL An unseekable stream encountered a new link that + used a feature that is not implemented, such as + an unsupported channel family. + \retval #OP_EINVAL The stream was only partially open. + \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that + did not have any logical Opus streams in it. + \retval #OP_EBADHEADER An unseekable stream encountered a new link with a + required header packet that was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An unseekable stream encountered a new link with + an ID header that contained an unrecognized + version number. + \retval #OP_EBADPACKET Failed to properly decode the next packet. + \retval #OP_EBADLINK We failed to find data we had seen before. + \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with + a starting timestamp that failed basic validity + checks.*/ +OP_WARN_UNUSED_RESULT int op_read(OggOpusFile *_of, + opus_int16 *_pcm,int _buf_size,int *_li) OP_ARG_NONNULL(1); + +/**Reads more samples from the stream. + \note Although \a _buf_size must indicate the total number of values that + can be stored in \a _pcm, the return value is the number of samples + per channel. +
    +
  1. The channel count cannot be known a priori (reading more samples might + advance us into the next link, with a different channel count), so + \a _buf_size cannot also be in units of samples per channel,
  2. +
  3. Returning the samples per channel matches the libopus API + as closely as we're able,
  4. +
  5. Returning the total number of values instead of samples per channel + would mean the caller would need a division to compute the samples per + channel, and might worry about the possibility of getting back samples + for some channels and not others, and
  6. +
  7. This approach is relatively fool-proof: if an application passes too + small a value to \a _buf_size, they will simply get fewer samples back, + and if they assume the return value is the total number of values, then + they will simply read too few (rather than reading too many and going + off the end of the buffer).
  8. +
+ \param _of The \c OggOpusFile from which to read. + \param[out] _pcm A buffer in which to store the output PCM samples as + signed floats at 48 kHz with a nominal range of + [-1.0,1.0]. + Multiple channels are interleaved using the + Vorbis + channel ordering. + This must have room for at least \a _buf_size floats. + \param _buf_size The number of floats that can be stored in \a _pcm. + It is recommended that this be large enough for at + least 120 ms of data at 48 kHz per channel (5760 + samples per channel). + Smaller buffers will simply return less data, possibly + consuming more memory to buffer the data internally. + If less than \a _buf_size values are returned, + libopusfile makes no guarantee that the + remaining data in \a _pcm will be unmodified. + \param[out] _li The index of the link this data was decoded from. + You may pass NULL if you do not need this + information. + If this function fails (returning a negative value), + this parameter is left unset. + \return The number of samples read per channel on success, or a negative + value on failure. + The channel count can be retrieved on success by calling + op_head(_of,*_li). + The number of samples returned may be 0 if the buffer was too small + to store even a single sample for all channels, or if end-of-file + was reached. + The list of possible failure codes follows. + Most of them can only be returned by unseekable, chained streams + that encounter a new link. + \retval #OP_HOLE There was a hole in the data, and some samples + may have been skipped. + Call this function again to continue decoding + past the hole. + \retval #OP_EREAD An underlying read operation failed. + This may signal a truncation attack from an + source. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL An unseekable stream encountered a new link that + used a feature that is not implemented, such as + an unsupported channel family. + \retval #OP_EINVAL The stream was only partially open. + \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that + did not have any logical Opus streams in it. + \retval #OP_EBADHEADER An unseekable stream encountered a new link with a + required header packet that was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An unseekable stream encountered a new link with + an ID header that contained an unrecognized + version number. + \retval #OP_EBADPACKET Failed to properly decode the next packet. + \retval #OP_EBADLINK We failed to find data we had seen before. + \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with + a starting timestamp that failed basic validity + checks.*/ +OP_WARN_UNUSED_RESULT int op_read_float(OggOpusFile *_of, + float *_pcm,int _buf_size,int *_li) OP_ARG_NONNULL(1); + +/**Reads more samples from the stream and downmixes to stereo, if necessary. + This function is intended for simple players that want a uniform output + format, even if the channel count changes between links in a chained + stream. + \note \a _buf_size indicates the total number of values that can be stored + in \a _pcm, while the return value is the number of samples per + channel, even though the channel count is known, for consistency with + op_read(). + \param _of The \c OggOpusFile from which to read. + \param[out] _pcm A buffer in which to store the output PCM samples, as + signed native-endian 16-bit values at 48 kHz + with a nominal range of [-32768,32767). + The left and right channels are interleaved in the + buffer. + This must have room for at least \a _buf_size values. + \param _buf_size The number of values that can be stored in \a _pcm. + It is recommended that this be large enough for at + least 120 ms of data at 48 kHz per channel (11520 + values total). + Smaller buffers will simply return less data, possibly + consuming more memory to buffer the data internally. + If less than \a _buf_size values are returned, + libopusfile makes no guarantee that the + remaining data in \a _pcm will be unmodified. + \return The number of samples read per channel on success, or a negative + value on failure. + The number of samples returned may be 0 if the buffer was too small + to store even a single sample for both channels, or if end-of-file + was reached. + The list of possible failure codes follows. + Most of them can only be returned by unseekable, chained streams + that encounter a new link. + \retval #OP_HOLE There was a hole in the data, and some samples + may have been skipped. + Call this function again to continue decoding + past the hole. + \retval #OP_EREAD An underlying read operation failed. + This may signal a truncation attack from an + source. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL An unseekable stream encountered a new link that + used a feature that is not implemented, such as + an unsupported channel family. + \retval #OP_EINVAL The stream was only partially open. + \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that + did not have any logical Opus streams in it. + \retval #OP_EBADHEADER An unseekable stream encountered a new link with a + required header packet that was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An unseekable stream encountered a new link with + an ID header that contained an unrecognized + version number. + \retval #OP_EBADPACKET Failed to properly decode the next packet. + \retval #OP_EBADLINK We failed to find data we had seen before. + \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with + a starting timestamp that failed basic validity + checks.*/ +OP_WARN_UNUSED_RESULT int op_read_stereo(OggOpusFile *_of, + opus_int16 *_pcm,int _buf_size) OP_ARG_NONNULL(1); + +/**Reads more samples from the stream and downmixes to stereo, if necessary. + This function is intended for simple players that want a uniform output + format, even if the channel count changes between links in a chained + stream. + \note \a _buf_size indicates the total number of values that can be stored + in \a _pcm, while the return value is the number of samples per + channel, even though the channel count is known, for consistency with + op_read_float(). + \param _of The \c OggOpusFile from which to read. + \param[out] _pcm A buffer in which to store the output PCM samples, as + signed floats at 48 kHz with a nominal range of + [-1.0,1.0]. + The left and right channels are interleaved in the + buffer. + This must have room for at least \a _buf_size values. + \param _buf_size The number of values that can be stored in \a _pcm. + It is recommended that this be large enough for at + least 120 ms of data at 48 kHz per channel (11520 + values total). + Smaller buffers will simply return less data, possibly + consuming more memory to buffer the data internally. + If less than \a _buf_size values are returned, + libopusfile makes no guarantee that the + remaining data in \a _pcm will be unmodified. + \return The number of samples read per channel on success, or a negative + value on failure. + The number of samples returned may be 0 if the buffer was too small + to store even a single sample for both channels, or if end-of-file + was reached. + The list of possible failure codes follows. + Most of them can only be returned by unseekable, chained streams + that encounter a new link. + \retval #OP_HOLE There was a hole in the data, and some samples + may have been skipped. + Call this function again to continue decoding + past the hole. + \retval #OP_EREAD An underlying read operation failed. + This may signal a truncation attack from an + source. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL An unseekable stream encountered a new link that + used a feature that is not implemented, such as + an unsupported channel family. + \retval #OP_EINVAL The stream was only partially open. + \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that + that did not have any logical Opus streams in it. + \retval #OP_EBADHEADER An unseekable stream encountered a new link with a + required header packet that was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An unseekable stream encountered a new link with + an ID header that contained an unrecognized + version number. + \retval #OP_EBADPACKET Failed to properly decode the next packet. + \retval #OP_EBADLINK We failed to find data we had seen before. + \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with + a starting timestamp that failed basic validity + checks.*/ +OP_WARN_UNUSED_RESULT int op_read_float_stereo(OggOpusFile *_of, + float *_pcm,int _buf_size) OP_ARG_NONNULL(1); + +/*@}*/ +/*@}*/ + +# if OP_GNUC_PREREQ(4,0) +# pragma GCC visibility pop +# endif + +# if defined(__cplusplus) +} +# endif + +#endif diff --git a/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Versions/A/OpusFile b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Versions/A/OpusFile new file mode 100755 index 0000000..dfeb0a4 Binary files /dev/null and b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Versions/A/OpusFile differ diff --git a/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Versions/A/Resources/Info.plist b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..d499e79 --- /dev/null +++ b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,42 @@ + + + + + BuildMachineOSBuild + 12F37 + CFBundleDevelopmentRegion + English + CFBundleExecutable + OpusFile + CFBundleIdentifier + com.ap4y.OpusFile + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + OpusFile + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 5A1413 + DTPlatformVersion + GM + DTSDKBuild + 12D75 + DTSDKName + macosx10.8 + DTXcode + 0500 + DTXcodeBuild + 5A1413 + NSHumanReadableCopyright + Copyright © 2013 Arthur Evstifeev. All rights reserved. + + diff --git a/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Versions/Current b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Audio-Frameworks/bin/opusfile/MacOS/OpusFile.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Audio-Frameworks/bin/opusfile/OpusFile.framework/Headers b/Audio-Frameworks/bin/opusfile/OpusFile.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Audio-Frameworks/bin/opusfile/OpusFile.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Audio-Frameworks/bin/opusfile/OpusFile.framework/OpusFile b/Audio-Frameworks/bin/opusfile/OpusFile.framework/OpusFile new file mode 120000 index 0000000..5206f36 --- /dev/null +++ b/Audio-Frameworks/bin/opusfile/OpusFile.framework/OpusFile @@ -0,0 +1 @@ +Versions/Current/OpusFile \ No newline at end of file diff --git a/Audio-Frameworks/bin/opusfile/OpusFile.framework/Resources b/Audio-Frameworks/bin/opusfile/OpusFile.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/Audio-Frameworks/bin/opusfile/OpusFile.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Audio-Frameworks/bin/opusfile/OpusFile.framework/Versions/A/Headers/opusfile.h b/Audio-Frameworks/bin/opusfile/OpusFile.framework/Versions/A/Headers/opusfile.h new file mode 100644 index 0000000..31eeaed --- /dev/null +++ b/Audio-Frameworks/bin/opusfile/OpusFile.framework/Versions/A/Headers/opusfile.h @@ -0,0 +1,1866 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE libopusfile SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE libopusfile SOURCE CODE IS (C) COPYRIGHT 1994-2012 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: stdio-based convenience library for opening/seeking/decoding + last mod: $Id: vorbisfile.h 17182 2010-04-29 03:48:32Z xiphmont $ + + ********************************************************************/ +#if !defined(_opusfile_h) +# define _opusfile_h (1) + +/**\mainpage + \section Introduction + + This is the documentation for the libopusfile C API. + + The libopusfile package provides a convenient high-level API for + decoding and basic manipulation of all Ogg Opus audio streams. + libopusfile is implemented as a layer on top of Xiph.Org's + reference + libogg + and + libopus + libraries. + + libopusfile provides several sets of built-in routines for + file/stream access, and may also use custom stream I/O routines provided by + the embedded environment. + There are built-in I/O routines provided for ANSI-compliant + stdio (FILE *), memory buffers, and URLs + (including URLs, plus optionally and URLs). + + \section Organization + + The main API is divided into several sections: + - \ref stream_open_close + - \ref stream_info + - \ref stream_decoding + - \ref stream_seeking + + Several additional sections are not tied to the main API. + - \ref stream_callbacks + - \ref header_info + - \ref error_codes + + \section Overview + + The libopusfile API always decodes files to 48 kHz. + The original sample rate is not preserved by the lossy compression, though + it is stored in the header to allow you to resample to it after decoding + (the libopusfile API does not currently provide a resampler, + but the + the + Speex resampler is a good choice if you need one). + In general, if you are playing back the audio, you should leave it at + 48 kHz, provided your audio hardware supports it. + When decoding to a file, it may be worth resampling back to the original + sample rate, so as not to surprise users who might not expect the sample + rate to change after encoding to Opus and decoding. + + Opus files can contain anywhere from 1 to 255 channels of audio. + The channel mappings for up to 8 channels are the same as the + Vorbis + mappings. + A special stereo API can convert everything to 2 channels, making it simple + to support multichannel files in a application which only has stereo + output. + Although the libopusfile ABI provides support for the theoretical + maximum number of channels, the current implementation does not support + files with more than 8 channels, as they do not have well-defined channel + mappings. + + Like all Ogg files, Opus files may be "chained". + That is, multiple Opus files may be combined into a single, longer file just + by concatenating the original files. + This is commonly done in internet radio streaming, as it allows the title + and artist to be updated each time the song changes, since each link in the + chain includes its own set of metadata. + + libopusfile fully supports chained files. + It will decode the first Opus stream found in each link of a chained file + (ignoring any other streams that might be concurrently multiplexed with it, + such as a video stream). + + The channel count can also change between links, but if your application is + not prepared to deal with this, it can use the stereo API to ensure the + audio from all links will always get decoded into a common format. + Since libopusfile always decodes to 48 kHz, you do not have to + worry about the sample rate changing between links (as was possible with + Vorbis). + This makes application support for chained files with libopusfile + very easy.*/ + +# if defined(__cplusplus) +extern "C" { +# endif + +# include +# include +# include +# include + +/*Enable special features for gcc and gcc-compatible compilers.*/ +# if !defined(OP_GNUC_PREREQ) +# if defined(__GNUC__)&&defined(__GNUC_MINOR__) +# define OP_GNUC_PREREQ(_maj,_min) \ + ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) +# else +# define OP_GNUC_PREREQ(_maj,_min) 0 +# endif +# endif + +# if OP_GNUC_PREREQ(4,0) +# pragma GCC visibility push(default) +# endif + +typedef struct OpusHead OpusHead; +typedef struct OpusTags OpusTags; +typedef struct OpusPictureTag OpusPictureTag; +typedef struct OggOpusFile OggOpusFile; + +/*Warning attributes for libopusfile functions.*/ +# if OP_GNUC_PREREQ(3,4) +# define OP_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) +# else +# define OP_WARN_UNUSED_RESULT +# endif +# if OP_GNUC_PREREQ(3,4) +# define OP_ARG_NONNULL(_x) __attribute__((__nonnull__(_x))) +# else +# define OP_ARG_NONNULL(_x) +# endif + +/**\defgroup error_codes Error Codes*/ +/*@{*/ +/**\name List of possible error codes + Many of the functions in this library return a negative error code when a + function fails. + This list provides a brief explanation of the common errors. + See each individual function for more details on what a specific error code + means in that context.*/ +/*@{*/ + +/**A request did not succeed.*/ +#define OP_FALSE (-1) +/*Currently not used externally.*/ +#define OP_EOF (-2) +/**There was a hole in the page sequence numbers (e.g., a page was corrupt or + missing).*/ +#define OP_HOLE (-3) +/**An underlying read, seek, or tell operation failed when it should have + succeeded.*/ +#define OP_EREAD (-128) +/**A NULL pointer was passed where one was unexpected, or an + internal memory allocation failed, or an internal library error was + encountered.*/ +#define OP_EFAULT (-129) +/**The stream used a feature that is not implemented, such as an unsupported + channel family.*/ +#define OP_EIMPL (-130) +/**One or more parameters to a function were invalid.*/ +#define OP_EINVAL (-131) +/**A purported Ogg Opus stream did not begin with an Ogg page, a purported + header packet did not start with one of the required strings, "OpusHead" or + "OpusTags", or a link in a chained file was encountered that did not + contain any logical Opus streams.*/ +#define OP_ENOTFORMAT (-132) +/**A required header packet was not properly formatted, contained illegal + values, or was missing altogether.*/ +#define OP_EBADHEADER (-133) +/**The ID header contained an unrecognized version number.*/ +#define OP_EVERSION (-134) +/*Currently not used at all.*/ +#define OP_ENOTAUDIO (-135) +/**An audio packet failed to decode properly. + This is usually caused by a multistream Ogg packet where the durations of + the individual Opus packets contained in it are not all the same.*/ +#define OP_EBADPACKET (-136) +/**We failed to find data we had seen before, or the bitstream structure was + sufficiently malformed that seeking to the target destination was + impossible.*/ +#define OP_EBADLINK (-137) +/**An operation that requires seeking was requested on an unseekable stream.*/ +#define OP_ENOSEEK (-138) +/**The first or last granule position of a link failed basic validity checks.*/ +#define OP_EBADTIMESTAMP (-139) + +/*@}*/ +/*@}*/ + +/**\defgroup header_info Header Information*/ +/*@{*/ + +/**The maximum number of channels in an Ogg Opus stream.*/ +#define OPUS_CHANNEL_COUNT_MAX (255) + +/**Ogg Opus bitstream information. + This contains the basic playback parameters for a stream, and corresponds to + the initial ID header packet of an Ogg Opus stream.*/ +struct OpusHead{ + /**The Ogg Opus format version, in the range 0...255. + The top 4 bits represent a "major" version, and the bottom four bits + represent backwards-compatible "minor" revisions. + The current specification describes version 1. + This library will recognize versions up through 15 as backwards compatible + with the current specification. + An earlier draft of the specification described a version 0, but the only + difference between version 1 and version 0 is that version 0 did + not specify the semantics for handling the version field.*/ + int version; + /**The number of channels, in the range 1...255.*/ + int channel_count; + /**The number of samples that should be discarded from the beginning of the + stream.*/ + unsigned pre_skip; + /**The sampling rate of the original input. + All Opus audio is coded at 48 kHz, and should also be decoded at 48 kHz + for playback (unless the target hardware does not support this sampling + rate). + However, this field may be used to resample the audio back to the original + sampling rate, for example, when saving the output to a file.*/ + opus_uint32 input_sample_rate; + /**The gain to apply to the decoded output, in dB, as a Q8 value in the range + -32768...32767. + The libopusfile API will automatically apply this gain to the + decoded output before returning it, scaling it by + pow(10,output_gain/(20.0*256)).*/ + int output_gain; + /**The channel mapping family, in the range 0...255. + Channel mapping family 0 covers mono or stereo in a single stream. + Channel mapping family 1 covers 1 to 8 channels in one or more streams, + using the Vorbis speaker assignments. + Channel mapping family 255 covers 1 to 255 channels in one or more + streams, but without any defined speaker assignment.*/ + int mapping_family; + /**The number of Opus streams in each Ogg packet, in the range 1...255.*/ + int stream_count; + /**The number of coupled Opus streams in each Ogg packet, in the range + 0...127. + This must satisfy 0 <= coupled_count <= stream_count and + coupled_count + stream_count <= 255. + The coupled streams appear first, before all uncoupled streams, in an Ogg + Opus packet.*/ + int coupled_count; + /**The mapping from coded stream channels to output channels. + Let index=mapping[k] be the value for channel k. + If index<2*coupled_count, then it refers to the left channel + from stream (index/2) if even, and the right channel from + stream (index/2) if odd. + Otherwise, it refers to the output of the uncoupled stream + (index-coupled_count).*/ + unsigned char mapping[OPUS_CHANNEL_COUNT_MAX]; +}; + +/**The metadata from an Ogg Opus stream. + + This structure holds the in-stream metadata corresponding to the 'comment' + header packet of an Ogg Opus stream. + The comment header is meant to be used much like someone jotting a quick + note on the label of a CD. + It should be a short, to the point text note that can be more than a couple + words, but not more than a short paragraph. + + The metadata is stored as a series of (tag, value) pairs, in length-encoded + string vectors, using the same format as Vorbis (without the final "framing + bit"), Theora, and Speex, except for the packet header. + The first occurrence of the '=' character delimits the tag and value. + A particular tag may occur more than once, and order is significant. + The character set encoding for the strings is always UTF-8, but the tag + names are limited to ASCII, and treated as case-insensitive. + See the Vorbis + comment header specification for details. + + In filling in this structure, libopusfile will null-terminate the + #user_comments strings for safety. + However, the bitstream format itself treats them as 8-bit clean vectors, + possibly containing NUL characters, so the #comment_lengths array should be + treated as their authoritative length. + + This structure is binary and source-compatible with a + vorbis_comment, and pointers to it may be freely cast to + vorbis_comment pointers, and vice versa. + It is provided as a separate type to avoid introducing a compile-time + dependency on the libvorbis headers.*/ +struct OpusTags{ + /**The array of comment string vectors.*/ + char **user_comments; + /**An array of the corresponding length of each vector, in bytes.*/ + int *comment_lengths; + /**The total number of comment streams.*/ + int comments; + /**The null-terminated vendor string. + This identifies the software used to encode the stream.*/ + char *vendor; +}; + +/**\name Picture tag image formats*/ +/*@{*/ + +/**The MIME type was not recognized, or the image data did not match the + declared MIME type.*/ +#define OP_PIC_FORMAT_UNKNOWN (-1) +/**The MIME type indicates the image data is really a URL.*/ +#define OP_PIC_FORMAT_URL (0) +/**The image is a JPEG.*/ +#define OP_PIC_FORMAT_JPEG (1) +/**The image is a PNG.*/ +#define OP_PIC_FORMAT_PNG (2) +/**The image is a GIF.*/ +#define OP_PIC_FORMAT_GIF (3) + +/*@}*/ + +/**The contents of a METADATA_BLOCK_PICTURE tag.*/ +struct OpusPictureTag{ + /**The picture type according to the ID3v2 APIC frame: +
    +
  1. Other
  2. +
  3. 32x32 pixels 'file icon' (PNG only)
  4. +
  5. Other file icon
  6. +
  7. Cover (front)
  8. +
  9. Cover (back)
  10. +
  11. Leaflet page
  12. +
  13. Media (e.g. label side of CD)
  14. +
  15. Lead artist/lead performer/soloist
  16. +
  17. Artist/performer
  18. +
  19. Conductor
  20. +
  21. Band/Orchestra
  22. +
  23. Composer
  24. +
  25. Lyricist/text writer
  26. +
  27. Recording Location
  28. +
  29. During recording
  30. +
  31. During performance
  32. +
  33. Movie/video screen capture
  34. +
  35. A bright colored fish
  36. +
  37. Illustration
  38. +
  39. Band/artist logotype
  40. +
  41. Publisher/Studio logotype
  42. +
+ Others are reserved and should not be used. + There may only be one each of picture type 1 and 2 in a file.*/ + opus_int32 type; + /**The MIME type of the picture, in printable ASCII characters 0x20-0x7E. + The MIME type may also be "-->" to signify that the data part + is a URL pointing to the picture instead of the picture data itself. + In this case, a terminating NUL is appended to the URL string in #data, + but #data_length is set to the length of the string excluding that + terminating NUL.*/ + char *mime_type; + /**The description of the picture, in UTF-8.*/ + char *description; + /**The width of the picture in pixels.*/ + opus_uint32 width; + /**The height of the picture in pixels.*/ + opus_uint32 height; + /**The color depth of the picture in bits-per-pixel (not + bits-per-channel).*/ + opus_uint32 depth; + /**For indexed-color pictures (e.g., GIF), the number of colors used, or 0 + for non-indexed pictures.*/ + opus_uint32 colors; + /**The length of the picture data in bytes.*/ + opus_uint32 data_length; + /**The binary picture data.*/ + unsigned char *data; + /**The format of the picture data, if known. + One of +
    +
  • #OP_PIC_FORMAT_UNKNOWN,
  • +
  • #OP_PIC_FORMAT_URL,
  • +
  • #OP_PIC_FORMAT_JPEG,
  • +
  • #OP_PIC_FORMAT_PNG,
  • +
  • #OP_PIC_FORMAT_GIF, or
  • +
.*/ + int format; +}; + +/**\name Functions for manipulating header data + + These functions manipulate the #OpusHead and #OpusTags structures, + which describe the audio parameters and tag-value metadata, respectively. + These can be used to query the headers returned by libopusfile, or + to parse Opus headers from sources other than an Ogg Opus stream, provided + they use the same format.*/ +/*@{*/ + +/**Parses the contents of the ID header packet of an Ogg Opus stream. + \param[out] _head Returns the contents of the parsed packet. + The contents of this structure are untouched on error. + This may be NULL to merely test the header + for validity. + \param[in] _data The contents of the ID header packet. + \param _len The number of bytes of data in the ID header packet. + \return 0 on success or a negative value on error. + \retval #OP_ENOTFORMAT If the data does not start with the "OpusHead" + string. + \retval #OP_EVERSION If the version field signaled a version this library + does not know how to parse. + \retval #OP_EIMPL If the channel mapping family was 255, which general + purpose players should not attempt to play. + \retval #OP_EBADHEADER If the contents of the packet otherwise violate the + Ogg Opus specification: +
    +
  • Insufficient data,
  • +
  • Too much data for the known minor versions,
  • +
  • An unrecognized channel mapping family,
  • +
  • Zero channels or too many channels,
  • +
  • Zero coded streams,
  • +
  • Too many coupled streams, or
  • +
  • An invalid channel mapping index.
  • +
*/ +OP_WARN_UNUSED_RESULT int opus_head_parse(OpusHead *_head, + const unsigned char *_data,size_t _len) OP_ARG_NONNULL(2); + +/**Converts a granule position to a sample offset for a given Ogg Opus stream. + The sample offset is simply _gp-_head->pre_skip. + Granule position values smaller than OpusHead#pre_skip correspond to audio + that should never be played, and thus have no associated sample offset. + This function returns -1 for such values. + This function also correctly handles extremely large granule positions, + which may have wrapped around to a negative number when stored in a signed + ogg_int64_t value. + \param _head The #OpusHead information from the ID header of the stream. + \param _gp The granule position to convert. + \return The sample offset associated with the given granule position + (counting at a 48 kHz sampling rate), or the special value -1 on + error (i.e., the granule position was smaller than the pre-skip + amount).*/ +ogg_int64_t opus_granule_sample(const OpusHead *_head,ogg_int64_t _gp) + OP_ARG_NONNULL(1); + +/**Parses the contents of the 'comment' header packet of an Ogg Opus stream. + \param[out] _tags An uninitialized #OpusTags structure. + This returns the contents of the parsed packet. + The contents of this structure are untouched on error. + This may be NULL to merely test the header + for validity. + \param[in] _data The contents of the 'comment' header packet. + \param _len The number of bytes of data in the 'info' header packet. + \retval 0 Success. + \retval #OP_ENOTFORMAT If the data does not start with the "OpusTags" + string. + \retval #OP_EBADHEADER If the contents of the packet otherwise violate the + Ogg Opus specification. + \retval #OP_EFAULT If there wasn't enough memory to store the tags.*/ +OP_WARN_UNUSED_RESULT int opus_tags_parse(OpusTags *_tags, + const unsigned char *_data,size_t _len) OP_ARG_NONNULL(2); + +/**Initializes an #OpusTags structure. + This should be called on a freshly allocated #OpusTags structure before + attempting to use it. + \param _tags The #OpusTags structure to initialize.*/ +void opus_tags_init(OpusTags *_tags) OP_ARG_NONNULL(1); + +/**Add a (tag, value) pair to an initialized #OpusTags structure. + \note Neither opus_tags_add() nor opus_tags_add_comment() support values + containing embedded NULs, although the bitstream format does support them. + To add such tags, you will need to manipulate the #OpusTags structure + directly. + \param _tags The #OpusTags structure to add the (tag, value) pair to. + \param _tag A NUL-terminated, case-insensitive, ASCII string containing + the tag to add (without an '=' character). + \param _value A NUL-terminated UTF-8 containing the corresponding value. + \return 0 on success, or a negative value on failure. + \retval #OP_EFAULT An internal memory allocation failed.*/ +int opus_tags_add(OpusTags *_tags,const char *_tag,const char *_value) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2) OP_ARG_NONNULL(3); + +/**Add a comment to an initialized #OpusTags structure. + \note Neither opus_tags_add_comment() nor opus_tags_add() support comments + containing embedded NULs, although the bitstream format does support them. + To add such tags, you will need to manipulate the #OpusTags structure + directly. + \param _tags The #OpusTags structure to add the comment to. + \param _comment A NUL-terminated UTF-8 string containing the comment in + "TAG=value" form. + \return 0 on success, or a negative value on failure. + \retval #OP_EFAULT An internal memory allocation failed.*/ +int opus_tags_add_comment(OpusTags *_tags,const char *_comment) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Look up a comment value by its tag. + \param _tags An initialized #OpusTags structure. + \param _tag The tag to look up. + \param _count The instance of the tag. + The same tag can appear multiple times, each with a distinct + value, so an index is required to retrieve them all. + The order in which these values appear is significant and + should be preserved. + Use opus_tags_query_count() to get the legal range for the + \a _count parameter. + \return A pointer to the queried tag's value. + This points directly to data in the #OpusTags structure. + It should not be modified or freed by the application, and + modifications to the structure may invalidate the pointer. + \retval NULL If no matching tag is found.*/ +const char *opus_tags_query(const OpusTags *_tags,const char *_tag,int _count) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Look up the number of instances of a tag. + Call this first when querying for a specific tag and then iterate over the + number of instances with separate calls to opus_tags_query() to retrieve + all the values for that tag in order. + \param _tags An initialized #OpusTags structure. + \param _tag The tag to look up. + \return The number of instances of this particular tag.*/ +int opus_tags_query_count(const OpusTags *_tags,const char *_tag) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Get the track gain from an R128_TRACK_GAIN tag, if one was specified. + This searches for the first R128_TRACK_GAIN tag with a valid signed, + 16-bit decimal integer value and returns the value. + This routine is exposed merely for convenience for applications which wish + to do something special with the track gain (i.e., display it). + If you simply wish to apply the track gain instead of the header gain, you + can use op_set_gain_offset() with an #OP_TRACK_GAIN type and no offset. + \param _tags An initialized #OpusTags structure. + \param[out] _gain_q8 The track gain, in 1/256ths of a dB. + This will lie in the range [-32768,32767], and should + be applied in addition to the header gain. + On error, no value is returned, and the previous + contents remain unchanged. + \return 0 on success, or a negative value on error. + \retval OP_EFALSE There was no track gain available in the given tags.*/ +int opus_tags_get_track_gain(const OpusTags *_tags,int *_gain_q8) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Clears the #OpusTags structure. + This should be called on an #OpusTags structure after it is no longer + needed. + It will free all memory used by the structure members. + \param _tags The #OpusTags structure to clear.*/ +void opus_tags_clear(OpusTags *_tags) OP_ARG_NONNULL(1); + +/**Parse a single METADATA_BLOCK_PICTURE tag. + This decodes the BASE64-encoded content of the tag and returns a structure + with the MIME type, description, image parameters (if known), and the + compressed image data. + If the MIME type indicates the presence of an image format we recognize + (JPEG, PNG, or GIF) and the actual image data contains the magic signature + associated with that format, then the OpusPictureTag::format field will be + set to the corresponding format. + This is provided as a convenience to avoid requiring applications to parse + the MIME type and/or do their own format detection for the commonly used + formats. + In this case, we also attempt to extract the image parameters directly from + the image data (overriding any that were present in the tag, which the + specification says applications are not meant to rely on). + The application must still provide its own support for actually decoding the + image data and, if applicable, retrieving that data from URLs. + \param[out] _pic Returns the parsed picture data. + No sanitation is done on the type, MIME type, or + description fields, so these might return invalid values. + The contents of this structure are left unmodified on + failure. + \param _tag The METADATA_BLOCK_PICTURE tag contents. + The leading "METADATA_BLOCK_PICTURE=" portion is optional, + to allow the function to be used on either directly on the + values in OpusTags::user_comments or on the return value + of opus_tags_query(). + \return 0 on success or a negative value on error. + \retval #OP_ENOTFORMAT The METADATA_BLOCK_PICTURE contents were not valid. + \retval #OP_EFAULT A memory allocation failed.*/ +int opus_picture_tag_parse(OpusPictureTag *_pic,const char *_tag) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Initializes an #OpusPictureTag structure. + This should be called on a freshly allocated #OpusPictureTag structure + before attempting to use it. + \param _pic The #OpusPictureTag structure to initialize.*/ +void opus_picture_tag_init(OpusPictureTag *_pic) OP_ARG_NONNULL(1); + +/**Clears the #OpusPictureTag structure. + This should be called on an #OpusPictureTag structure after it is no longer + needed. + It will free all memory used by the structure members. + \param _pic The #OpusPictureTag structure to clear.*/ +void opus_picture_tag_clear(OpusPictureTag *_pic) OP_ARG_NONNULL(1); + +/*@}*/ + +/*@}*/ + +/**\defgroup url_options URL Reading Options*/ +/*@{*/ +/**\name URL reading options + Options for op_url_stream_create() and associated functions. + These allow you to provide proxy configuration parameters, skip SSL + certificate checks, etc. + Options are processed in order, and if the same option is passed multiple + times, only the value specified by the last occurrence has an effect + (unless otherwise specified). + They may be expanded in the future.*/ +/*@{*/ + +/*These are the raw numbers used to define the request codes. + They should not be used directly.*/ +#define OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST (6464) +#define OP_HTTP_PROXY_HOST_REQUEST (6528) +#define OP_HTTP_PROXY_PORT_REQUEST (6592) +#define OP_HTTP_PROXY_USER_REQUEST (6656) +#define OP_HTTP_PROXY_PASS_REQUEST (6720) + +#define OP_URL_OPT(_request) ((_request)+(char *)0) + +/*These macros trigger compilation errors or warnings if the wrong types are + provided to one of the URL options.*/ +#define OP_CHECK_INT(_x) ((void)((_x)==(opus_int32)0),(opus_int32)(_x)) +#define OP_CHECK_CONST_CHAR_PTR(_x) ((_x)+((_x)-(const char *)(_x))) + +/**Skip the certificate check when connecting via TLS/SSL (https). + \param _b opus_int32: Whether or not to skip the certificate + check. + The check will be skipped if \a _b is non-zero, and will not be + skipped if \a _b is zero. + \hideinitializer*/ +#define OP_SSL_SKIP_CERTIFICATE_CHECK(_b) \ + OP_URL_OPT(OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST),OP_CHECK_INT(_b) + +/**Proxy connections through the given host. + If no port is specified via #OP_HTTP_PROXY_PORT, the port number defaults + to 8080 (http-alt). + All proxy parameters are ignored for non-http and non-https URLs. + \param _host const char *: The proxy server hostname. + This may be NULL to disable the use of a proxy + server. + \hideinitializer*/ +#define OP_HTTP_PROXY_HOST(_host) \ + OP_URL_OPT(OP_HTTP_PROXY_HOST_REQUEST),OP_CHECK_CONST_CHAR_PTR(_host) + +/**Use the given port when proxying connections. + This option only has an effect if #OP_HTTP_PROXY_HOST is specified with a + non-NULL \a _host. + If this option is not provided, the proxy port number defaults to 8080 + (http-alt). + All proxy parameters are ignored for non-http and non-https URLs. + \param _port opus_int32: The proxy server port. + This must be in the range 0...65535 (inclusive), or the + URL function this is passed to will fail. + \hideinitializer*/ +#define OP_HTTP_PROXY_PORT(_port) \ + OP_URL_OPT(OP_HTTP_PROXY_PORT_REQUEST),OP_CHECK_INT(_port) + +/**Use the given user name for authentication when proxying connections. + All proxy parameters are ignored for non-http and non-https URLs. + \param _user const char *: The proxy server user name. + This may be NULL to disable proxy + authentication. + A non-NULL value only has an effect + if #OP_HTTP_PROXY_HOST and #OP_HTTP_PROXY_PASS + are also specified with non-NULL + arguments. + \hideinitializer*/ +#define OP_HTTP_PROXY_USER(_user) \ + OP_URL_OPT(OP_HTTP_PROXY_USER_REQUEST),OP_CHECK_CONST_CHAR_PTR(_host) + +/**Use the given password for authentication when proxying connections. + All proxy parameters are ignored for non-http and non-https URLs. + \param _pass const char *: The proxy server password. + This may be NULL to disable proxy + authentication. + A non-NULL value only has an effect + if #OP_HTTP_PROXY_HOST and #OP_HTTP_PROXY_USER + are also specified with non-NULL + arguments. + \hideinitializer*/ +#define OP_HTTP_PROXY_PASS(_pass) \ + OP_URL_OPT(OP_HTTP_PROXY_PASS_REQUEST),OP_CHECK_CONST_CHAR_PTR(_host) + +/*@}*/ +/*@}*/ + +/**\defgroup stream_callbacks Abstract Stream Reading Interface*/ +/*@{*/ +/**\name Functions for reading from streams + These functions define the interface used to read from and seek in a stream + of data. + A stream does not need to implement seeking, but the decoder will not be + able to seek if it does not do so. + These functions also include some convenience routines for working with + standard FILE pointers, complete streams stored in a single + block of memory, or URLs.*/ +/*@{*/ + +typedef struct OpusFileCallbacks OpusFileCallbacks; + +/**Reads up to \a _nbytes bytes of data from \a _stream. + \param _stream The stream to read from. + \param[out] _ptr The buffer to store the data in. + \param _nbytes The maximum number of bytes to read. + This function may return fewer, though it will not + return zero unless it reaches end-of-file. + \return The number of bytes successfully read, or a negative value on + error.*/ +typedef int (*op_read_func)(void *_stream,unsigned char *_ptr,int _nbytes); + +/**Sets the position indicator for \a _stream. + The new position, measured in bytes, is obtained by adding \a _offset + bytes to the position specified by \a _whence. + If \a _whence is set to SEEK_SET, SEEK_CUR, or + SEEK_END, the offset is relative to the start of the stream, + the current position indicator, or end-of-file, respectively. + \retval 0 Success. + \retval -1 Seeking is not supported or an error occurred. + errno need not be set.*/ +typedef int (*op_seek_func)(void *_stream,opus_int64 _offset,int _whence); + +/**Obtains the current value of the position indicator for \a _stream. + \return The current position indicator.*/ +typedef opus_int64 (*op_tell_func)(void *_stream); + +/**Closes the underlying stream. + \retval 0 Success. + \retval EOF An error occurred. + errno need not be set.*/ +typedef int (*op_close_func)(void *_stream); + +/**The callbacks used to access non-FILE stream resources. + The function prototypes are basically the same as for the stdio functions + fread(), fseek(), ftell(), and + fclose(). + The differences are that the FILE * arguments have been + replaced with a void *, which is to be used as a pointer to + whatever internal data these functions might need, that #seek and #tell + take and return 64-bit offsets, and that #seek must return -1 if + the stream is unseekable.*/ +struct OpusFileCallbacks{ + /**Used to read data from the stream. + This must not be NULL.*/ + op_read_func read; + /**Used to seek in the stream. + This may be NULL if seeking is not implemented.*/ + op_seek_func seek; + /**Used to return the current read position in the stream. + This may be NULL if seeking is not implemented.*/ + op_tell_func tell; + /**Used to close the stream when the decoder is freed. + This may be NULL to leave the stream open.*/ + op_close_func close; +}; + +/**Opens a stream with fopen() and fills in a set of callbacks + that can be used to access it. + This is useful to avoid writing your own portable 64-bit seeking wrappers, + and also avoids cross-module linking issues on Windows, where a + FILE * must be accessed by routines defined in the same module + that opened it. + \param[out] _cb The callbacks to use for this file. + If there is an error opening the file, nothing will be + filled in here. + \param _path The path to the file to open. + On Windows, this string must be UTF-8 (to allow access to + files whose names cannot be represented in the current + MBCS code page). + All other systems use the native character encoding. + \param _mode The mode to open the file in. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_fopen(OpusFileCallbacks *_cb, + const char *_path,const char *_mode) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2) + OP_ARG_NONNULL(3); + +/**Opens a stream with fdopen() and fills in a set of callbacks + that can be used to access it. + This is useful to avoid writing your own portable 64-bit seeking wrappers, + and also avoids cross-module linking issues on Windows, where a + FILE * must be accessed by routines defined in the same module + that opened it. + \param[out] _cb The callbacks to use for this file. + If there is an error opening the file, nothing will be + filled in here. + \param _fd The file descriptor to open. + \param _mode The mode to open the file in. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_fdopen(OpusFileCallbacks *_cb, + int _fd,const char *_mode) OP_ARG_NONNULL(1) OP_ARG_NONNULL(3); + +/**Opens a stream with freopen() and fills in a set of callbacks + that can be used to access it. + This is useful to avoid writing your own portable 64-bit seeking wrappers, + and also avoids cross-module linking issues on Windows, where a + FILE * must be accessed by routines defined in the same module + that opened it. + \param[out] _cb The callbacks to use for this file. + If there is an error opening the file, nothing will be + filled in here. + \param _path The path to the file to open. + On Windows, this string must be UTF-8 (to allow access + to files whose names cannot be represented in the + current MBCS code page). + All other systems use the native character encoding. + \param _mode The mode to open the file in. + \param _stream A stream previously returned by op_fopen(), op_fdopen(), + or op_freopen(). + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_freopen(OpusFileCallbacks *_cb, + const char *_path,const char *_mode,void *_stream) OP_ARG_NONNULL(1) + OP_ARG_NONNULL(2) OP_ARG_NONNULL(3) OP_ARG_NONNULL(4); + +/**Creates a stream that reads from the given block of memory. + This block of memory must contain the complete stream to decode. + This is useful for caching small streams (e.g., sound effects) in RAM. + \param[out] _cb The callbacks to use for this stream. + If there is an error creating the stream, nothing will be + filled in here. + \param _data The block of memory to read from. + \param _size The size of the block of memory. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_mem_stream_create(OpusFileCallbacks *_cb, + const unsigned char *_data,size_t _size) OP_ARG_NONNULL(1); + +/**Creates a stream that reads from the given URL. + This function behaves identically to op_url_stream_create(), except that it + takes a va_list instead of a variable number of arguments. + It does not call the va_end macro, and because it invokes the + va_arg macro, the value of \a _ap is undefined after the call. + \param[out] _cb The callbacks to use for this stream. + If there is an error creating the stream, nothing will + be filled in here. + \param _url The URL to read from. + Currently only the , , and + schemes are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always fail. + \param[in,out] _ap A list of the \ref url_options "optional flags" to use. + This is a variable-length list of options terminated + with NULL. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_url_stream_vcreate(OpusFileCallbacks *_cb, + const char *_url,va_list _ap) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Creates a stream that reads from the given URL using the specified proxy. + \param[out] _cb The callbacks to use for this stream. + If there is an error creating the stream, nothing will be + filled in here. + \param _url The URL to read from. + Currently only the , , and schemes + are supported. + Both and may be disabled at compile time, + in which case opening such URLs will always fail. + \param ... The \ref url_options "optional flags" to use. + This is a variable-length list of options terminated with + NULL. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_url_stream_create(OpusFileCallbacks *_cb, + const char *_url,...) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/*@}*/ +/*@}*/ + +/**\defgroup stream_open_close Opening and Closing*/ +/*@{*/ +/**\name Functions for opening and closing streams + + These functions allow you to test a stream to see if it is Opus, open it, + and close it. + Several flavors are provided for each of the built-in stream types, plus a + more general version which takes a set of application-provided callbacks.*/ +/*@{*/ + +/**Test to see if this is an Opus stream. + For good results, you will need at least 57 bytes (for a pure Opus-only + stream). + Something like 512 bytes will give more reliable results for multiplexed + streams. + This function is meant to be a quick-rejection filter. + Its purpose is not to guarantee that a stream is a valid Opus stream, but to + ensure that it looks enough like Opus that it isn't going to be recognized + as some other format (except possibly an Opus stream that is also + multiplexed with other codecs, such as video). + \param[out] _head The parsed ID header contents. + You may pass NULL if you do not need + this information. + If the function fails, the contents of this structure + remain untouched. + \param _initial_data An initial buffer of data from the start of the + stream. + \param _initial_bytes The number of bytes in \a _initial_data. + \return 0 if the data appears to be Opus, or a negative value on error. + \retval #OP_FALSE There was not enough data to tell if this was an Opus + stream or not. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL The stream used a feature that is not implemented, + such as an unsupported channel family. + \retval #OP_ENOTFORMAT If the data did not contain a recognizable ID + header for an Opus stream. + \retval #OP_EVERSION If the version field signaled a version this library + does not know how to parse. + \retval #OP_EBADHEADER The ID header was not properly formatted or contained + illegal values.*/ +int op_test(OpusHead *_head, + const unsigned char *_initial_data,size_t _initial_bytes); + +/**Open a stream from the given file path. + \param _path The path to the file to open. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + The failure code will be #OP_EFAULT if the file could not + be opened, or one of the other failure codes from + op_open_callbacks() otherwise. + \return A freshly opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_file(const char *_path,int *_error) + OP_ARG_NONNULL(1); + +/**Open a stream from a memory buffer. + \param _data The memory buffer to open. + \param _size The number of bytes in the buffer. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + See op_open_callbacks() for a full list of failure codes. + \return A freshly opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_memory(const unsigned char *_data, + size_t _size,int *_error); + +/**Open a stream from a URL. + This function behaves identically to op_open_url(), except that it + takes a va_list instead of a variable number of arguments. + It does not call the va_end macro, and because it invokes the + va_arg macro, the value of \a _ap is undefined after the call. + \param _url The URL to open. + Currently only the , , and + schemes are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always + fail. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want + the failure code. + See op_open_callbacks() for a full list of failure + codes. + \param[in,out] _ap A list of the \ref url_options "optional flags" to + use. + This is a variable-length list of options terminated + with NULL. + \return A freshly opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_vopen_url(const char *_url, + int *_error,va_list _ap) OP_ARG_NONNULL(1); + +/**Open a stream from a URL. + However, this approach will not work for live streams or HTTP/1.0 servers + (which do not support Range requets). + \param _url The URL to open. + Currently only the , , and schemes + are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always fail. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + See op_open_callbacks() for a full list of failure codes. + \param ... The \ref url_options "optional flags" to use. + This is a variable-length list of options terminated with + NULL. + \return A freshly opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_url(const char *_url, + int *_error,...) OP_ARG_NONNULL(1); + +/**Open a stream using the given set of callbacks to access it. + \param _source The stream to read from (e.g., a FILE *). + \param _cb The callbacks with which to access the stream. + read() must + be implemented. + seek() and + tell() may + be NULL, or may always return -1 to + indicate a source is unseekable, but if + seek() is + implemented and succeeds on a particular source, then + tell() must + also. + close() may + be NULL, but if it is not, it will be + called when the \c OggOpusFile is destroyed by + op_free(). + It will not be called if op_open_callbacks() fails + with an error. + \param _initial_data An initial buffer of data from the start of the + stream. + Applications can read some number of bytes from the + start of the stream to help identify this as an Opus + stream, and then provide them here to allow the + stream to be opened, even if it is unseekable. + \param _initial_bytes The number of bytes in \a _initial_data. + If the stream is seekable, its current position (as + reported by + tell() + at the start of this function) must be equal to + \a _initial_bytes. + Otherwise, seeking to absolute positions will + generate inconsistent results. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want + the failure code. + The failure code will be one of +
+
#OP_EREAD
+
An underlying read, seek, or tell operation + failed when it should have succeeded, or we failed + to find data in the stream we had seen before.
+
#OP_EFAULT
+
There was a memory allocation failure, or an + internal library error.
+
#OP_EIMPL
+
The stream used a feature that is not + implemented, such as an unsupported channel + family.
+
#OP_EINVAL
+
seek() + was implemented and succeeded on this source, but + tell() + did not, or the starting position indicator was + not equal to \a _initial_bytes.
+
#OP_ENOTFORMAT
+
The stream contained a link that did not have + any logical Opus streams in it.
+
#OP_EBADHEADER
+
A required header packet was not properly + formatted, contained illegal values, or was missing + altogether.
+
#OP_EVERSION
+
An ID header contained an unrecognized version + number.
+
#OP_EBADLINK
+
We failed to find data we had seen before after + seeking.
+
#OP_EBADTIMESTAMP
+
The first or last timestamp in a link failed + basic validity checks.
+
+ \return A freshly opened \c OggOpusFile, or NULL on error. + libopusfile does not take ownership of the source + if the call fails. + The calling application is responsible for closing the source if + this call returns an error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_callbacks(void *_source, + const OpusFileCallbacks *_cb,const unsigned char *_initial_data, + size_t _initial_bytes,int *_error) OP_ARG_NONNULL(2); + +/**Partially open a stream from the given file path. + \see op_test_callbacks + \param _path The path to the file to open. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + The failure code will be #OP_EFAULT if the file could not + be opened, or one of the other failure codes from + op_open_callbacks() otherwise. + \return A partially opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_file(const char *_path,int *_error) + OP_ARG_NONNULL(1); + +/**Partially open a stream from a memory buffer. + \see op_test_callbacks + \param _data The memory buffer to open. + \param _size The number of bytes in the buffer. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + See op_open_callbacks() for a full list of failure codes. + \return A partially opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_memory(const unsigned char *_data, + size_t _size,int *_error); + +/**Partially open a stream from a URL. + This function behaves identically to op_test_url(), except that it + takes a va_list instead of a variable number of arguments. + It does not call the va_end macro, and because it invokes the + va_arg macro, the value of \a _ap is undefined after the call. + \see op_test_url + \see op_test_callbacks + \param _url The URL to open. + Currently only the , , and + schemes are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always + fail. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want + the failure code. + See op_open_callbacks() for a full list of failure + codes. + \param[in,out] _ap A list of the \ref url_options "optional flags" to + use. + This is a variable-length list of options terminated + with NULL. + \return A partially opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_vtest_url(const char *_url, + int *_error,va_list _ap) OP_ARG_NONNULL(1); + +/**Partially open a stream from a URL. + \see op_test_callbacks + \param _url The URL to open. + Currently only the , , and + schemes are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always fail. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + See op_open_callbacks() for a full list of failure + codes. + \param ... The \ref url_options "optional flags" to use. + This is a variable-length list of options terminated + with NULL. + \return A partially opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_url(const char *_url, + int *_error,...) OP_ARG_NONNULL(1); + +/**Partially open a stream using the given set of callbacks to access it. + This tests for Opusness and loads the headers for the first link. + It does not seek (although it tests for seekability). + You can query a partially open stream for the few pieces of basic + information returned by op_serialno(), op_channel_count(), op_head(), and + op_tags() (but only for the first link). + You may also determine if it is seekable via a call to op_seekable(). + You cannot read audio from the stream, seek, get the size or duration, + get information from links other than the first one, or even get the total + number of links until you finish opening the stream with op_test_open(). + If you do not need to do any of these things, you can dispose of it with + op_free() instead. + + This function is provided mostly to simplify porting existing code that used + libvorbisfile. + For new code, you are likely better off using op_test() instead, which + is less resource-intensive, requires less data to succeed, and imposes a + hard limit on the amount of data it examines (important for unseekable + sources, where all such data must be buffered until you are sure of the + stream type). + \param _source The stream to read from (e.g., a FILE *). + \param _cb The callbacks with which to access the stream. + read() must + be implemented. + seek() and + tell() may + be NULL, or may always return -1 to + indicate a source is unseekable, but if + seek() is + implemented and succeeds on a particular source, then + tell() must + also. + close() may + be NULL, but if it is not, it will be + called when the \c OggOpusFile is destroyed by + op_free(). + It will not be called if op_open_callbacks() fails + with an error. + \param _initial_data An initial buffer of data from the start of the + stream. + Applications can read some number of bytes from the + start of the stream to help identify this as an Opus + stream, and then provide them here to allow the + stream to be tested more thoroughly, even if it is + unseekable. + \param _initial_bytes The number of bytes in \a _initial_data. + If the stream is seekable, its current position (as + reported by + tell() + at the start of this function) must be equal to + \a _initial_bytes. + Otherwise, seeking to absolute positions will + generate inconsistent results. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want + the failure code. + See op_open_callbacks() for a full list of failure + codes. + \return A partially opened \c OggOpusFile, or NULL on error. + libopusfile does not take ownership of the source + if the call fails. + The calling application is responsible for closing the source if + this call returns an error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_callbacks(void *_source, + const OpusFileCallbacks *_cb,const unsigned char *_initial_data, + size_t _initial_bytes,int *_error) OP_ARG_NONNULL(2); + +/**Finish opening a stream partially opened with op_test_callbacks() or one of + the associated convenience functions. + If this function fails, you are still responsible for freeing the + \c OggOpusFile with op_free(). + \param _of The \c OggOpusFile to finish opening. + \return 0 on success, or a negative value on error. + \retval #OP_EREAD An underlying read, seek, or tell operation failed + when it should have succeeded. + \retval #OP_EFAULT There was a memory allocation failure, or an + internal library error. + \retval #OP_EIMPL The stream used a feature that is not implemented, + such as an unsupported channel family. + \retval #OP_EINVAL The stream was not partially opened with + op_test_callbacks() or one of the associated + convenience functions. + \retval #OP_ENOTFORMAT The stream contained a link that did not have any + logical Opus streams in it. + \retval #OP_EBADHEADER A required header packet was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An ID header contained an unrecognized version + number. + \retval #OP_EBADLINK We failed to find data we had seen before after + seeking. + \retval #OP_EBADTIMESTAMP The first or last timestamp in a link failed basic + validity checks.*/ +int op_test_open(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Release all memory used by an \c OggOpusFile. + \param _of The \c OggOpusFile to free.*/ +void op_free(OggOpusFile *_of); + +/*@}*/ +/*@}*/ + +/**\defgroup stream_info Stream Information*/ +/*@{*/ +/**\name Functions for obtaining information about streams + + These functions allow you to get basic information about a stream, including + seekability, the number of links (for chained streams), plus the size, + duration, bitrate, header parameters, and meta information for each link + (or, where available, the stream as a whole). + Some of these (size, duration) are only available for seekable streams. + You can also query the current stream position, link, and playback time, + and instantaneous bitrate during playback. + + Some of these functions may be used successfully on the partially open + streams returned by op_test_callbacks() or one of the associated + convenience functions. + Their documention will indicate so explicitly.*/ +/*@{*/ + +/**Returns whether or not the data source being read is seekable. + This is true if +
    +
  1. The seek() and + tell() callbacks are both + non-NULL,
  2. +
  3. The seek() callback was + successfully executed at least once, and
  4. +
  5. The tell() callback was + successfully able to report the position indicator afterwards.
  6. +
+ This function may be called on partially-opened streams. + \param _of The \c OggOpusFile whose seekable status is to be returned. + \return A non-zero value if seekable, and 0 if unseekable.*/ +int op_seekable(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Returns the number of links in this chained stream. + This function may be called on partially-opened streams, but it will always + return 1. + The actual number of links is not known until the stream is fully opened. + \param _of The \c OggOpusFile from which to retrieve the link count. + \return For fully-open seekable sources, this returns the total number of + links in the whole stream. + For partially-open or unseekable sources, this always returns 1.*/ +int op_link_count(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Get the serial number of the given link in a (possibly-chained) Ogg Opus + stream. + This function may be called on partially-opened streams, but it will always + return the serial number of the Opus stream in the first link. + \param _of The \c OggOpusFile from which to retrieve the serial number. + \param _li The index of the link whose serial number should be retrieved. + Use a negative number to get the serial number of the current + link. + \return The serial number of the given link. + If \a _li is greater than the total number of links, this returns + the serial number of the last link. + If the source is not seekable, this always returns the serial number + of the current link.*/ +opus_uint32 op_serialno(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the channel count of the given link in a (possibly-chained) Ogg Opus + stream. + This is equivalent to op_head(_of,_li)->channel_count, but + is provided for convenience. + This function may be called on partially-opened streams, but it will always + return the channel count of the Opus stream in the first link. + \param _of The \c OggOpusFile from which to retrieve the channel count. + \param _li The index of the link whose channel count should be retrieved. + Use a negative number to get the channel count of the current + link. + \return The channel count of the given link. + If \a _li is greater than the total number of links, this returns + the channel count of the last link. + If the source is not seekable, this always returns the channel count + of the current link.*/ +int op_channel_count(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the total (compressed) size of the stream, or of an individual link in + a (possibly-chained) Ogg Opus stream, including all headers and Ogg muxing + overhead. + \param _of The \c OggOpusFile from which to retrieve the compressed size. + \param _li The index of the link whose compressed size should be computed. + Use a negative number to get the compressed size of the entire + stream. + \return The compressed size of the entire stream if \a _li is negative, the + compressed size of link \a _li if it is non-negative, or a negative + value on error. + The compressed size of the entire stream may be smaller than that + of the underlying source if trailing garbage was detected in the + file. + \retval #OP_EINVAL The source is not seekable (so we can't know the length), + \a _li wasn't less than the total number of links in + the stream, or the stream was only partially open.*/ +opus_int64 op_raw_total(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the total PCM length (number of samples at 48 kHz) of the stream, or of + an individual link in a (possibly-chained) Ogg Opus stream. + Users looking for op_time_total() should use op_pcm_total() + instead. + Because timestamps in Opus are fixed at 48 kHz, there is no need for a + separate function to convert this to seconds (and leaving it out avoids + introducing floating point to the API, for those that wish to avoid it). + \param _of The \c OggOpusFile from which to retrieve the PCM offset. + \param _li The index of the link whose PCM length should be computed. + Use a negative number to get the PCM length of the entire stream. + \return The PCM length of the entire stream if \a _li is negative, the PCM + length of link \a _li if it is non-negative, or a negative value on + error. + \retval #OP_EINVAL The source is not seekable (so we can't know the length), + \a _li wasn't less than the total number of links in + the stream, or the stream was only partially open.*/ +ogg_int64_t op_pcm_total(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the ID header information for the given link in a (possibly chained) Ogg + Opus stream. + This function may be called on partially-opened streams, but it will always + return the ID header information of the Opus stream in the first link. + \param _of The \c OggOpusFile from which to retrieve the ID header + information. + \param _li The index of the link whose ID header information should be + retrieved. + Use a negative number to get the ID header information of the + current link. + For an unseekable stream, \a _li is ignored, and the ID header + information for the current link is always returned, if + available. + \return The contents of the ID header for the given link.*/ +const OpusHead *op_head(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the comment header information for the given link in a (possibly + chained) Ogg Opus stream. + This function may be called on partially-opened streams, but it will always + return the tags from the Opus stream in the first link. + \param _of The \c OggOpusFile from which to retrieve the comment header + information. + \param _li The index of the link whose comment header information should be + retrieved. + Use a negative number to get the comment header information of + the current link. + For an unseekable stream, \a _li is ignored, and the comment + header information for the current link is always returned, if + available. + \return The contents of the comment header for the given link, or + NULL if this is an unseekable stream that encountered + an invalid link.*/ +const OpusTags *op_tags(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Retrieve the index of the current link. + This is the link that produced the data most recently read by + op_read_float() or its associated functions, or, after a seek, the link + that the seek target landed in. + Reading more data may advance the link index (even on the first read after a + seek). + \param _of The \c OggOpusFile from which to retrieve the current link index. + \return The index of the current link on success, or a negative value on + failure. + For seekable streams, this is a number between 0 and the value + returned by op_link_count(). + For unseekable streams, this value starts at 0 and increments by one + each time a new link is encountered (even though op_link_count() + always returns 1). + \retval #OP_EINVAL The stream was only partially open.*/ +int op_current_link(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Computes the bitrate for a given link in a (possibly chained) Ogg Opus + stream. + The stream must be seekable to compute the bitrate. + For unseekable streams, use op_bitrate_instant() to get periodic estimates. + \param _of The \c OggOpusFile from which to retrieve the bitrate. + \param _li The index of the link whose bitrate should be computed. + USe a negative number to get the bitrate of the whole stream. + \return The bitrate on success, or a negative value on error. + \retval #OP_EINVAL The stream was only partially open, the stream was not + seekable, or \a _li was larger than the number of + links.*/ +opus_int32 op_bitrate(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Compute the instantaneous bitrate, measured as the ratio of bits to playable + samples decoded since a) the last call to op_bitrate_instant(), b) the last + seek, or c) the start of playback, whichever was most recent. + This will spike somewhat after a seek or at the start/end of a chain + boundary, as pre-skip, pre-roll, and end-trimming causes samples to be + decoded but not played. + \param _of The \c OggOpusFile from which to retrieve the bitrate. + \return The bitrate, in bits per second, or a negative value on error. + \retval #OP_FALSE No data has been decoded since any of the events + described above. + \retval #OP_EINVAL The stream was only partially open.*/ +opus_int32 op_bitrate_instant(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Obtain the current value of the position indicator for \a _of. + \param _of The \c OggOpusFile from which to retrieve the position indicator. + \return The byte position that is currently being read from. + \retval #OP_EINVAL The stream was only partially open.*/ +opus_int64 op_raw_tell(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Obtain the PCM offset of the next sample to be read. + If the stream is not properly timestamped, this might not increment by the + proper amount between reads, or even return monotonically increasing + values. + \param _of The \c OggOpusFile from which to retrieve the PCM offset. + \return The PCM offset of the next sample to be read. + \retval #OP_EINVAL The stream was only partially open.*/ +ogg_int64_t op_pcm_tell(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/*@}*/ +/*@}*/ + +/**\defgroup stream_seeking Seeking*/ +/*@{*/ +/**\name Functions for seeking in Opus streams + + These functions let you seek in Opus streams, if the underlying source + support it. + Seeking is implemented for all built-in stream I/O routines, though some + individual sources may not be seekable (pipes, live HTTP streams, or HTTP + streams from a server that does not support Range requests). + + op_raw_seek() is the fastest: it is guaranteed to perform at most one + physical seek, but, since the target is a byte position, makes no guarantee + how close to a given time it will come. + op_pcm_seek() provides sample-accurate seeking. + The number of physical seeks it requires is still quite small (often 1 or + 2, even in highly variable bitrate streams). + + Seeking in Opus requires decoding some pre-roll amount before playback to + allow the internal state to converge (as if recovering from packet loss). + This is handled internally by libopusfile, but means there is + little extra overhead for decoding up to the exact position requested + (since it must decode some amount of audio anyway). + It also means that decoding after seeking may not return exactly the same + values as would be obtained by decoding the stream straight through. + However, such differences are expected to be smaller than the loss + introduced by Opus's lossy compression.*/ +/*@{*/ + +/**Seek to a byte offset relative to the compressed data. + This also scans packets to update the PCM cursor. + It will cross a logical bitstream boundary, but only if it can't get any + packets out of the tail of the link to which it seeks. + \param _of The \c OggOpusFile in which to seek. + \param _byte_offset The byte position to seek to. + \return 0 on success, or a negative error code on failure. + \retval #OP_EREAD The underlying seek operation failed. + \retval #OP_EINVAL The stream was only partially open, or the target was + outside the valid range for the stream. + \retval #OP_ENOSEEK This stream is not seekable. + \retval #OP_EBADLINK Failed to initialize a decoder for a stream for an + unknown reason.*/ +int op_raw_seek(OggOpusFile *_of,opus_int64 _byte_offset) OP_ARG_NONNULL(1); + +/**Seek to the specified PCM offset, such that decoding will begin at exactly + the requested position. + \param _of The \c OggOpusFile in which to seek. + \param _pcm_offset The PCM offset to seek to. + This is in samples at 48 kHz relative to the start of the + stream. + \return 0 on success, or a negative value on error. + \retval #OP_EREAD An underlying read or seek operation failed. + \retval #OP_EINVAL The stream was only partially open, or the target was + outside the valid range for the stream. + \retval #OP_ENOSEEK This stream is not seekable. + \retval #OP_EBADLINK We failed to find data we had seen before, or the + bitstream structure was sufficiently malformed that + seeking to the target destination was impossible.*/ +int op_pcm_seek(OggOpusFile *_of,ogg_int64_t _pcm_offset) OP_ARG_NONNULL(1); + +/*@}*/ +/*@}*/ + +/**\defgroup stream_decoding Decoding*/ +/*@{*/ +/**\name Functions for decoding audio data + + These functions retrieve actual decoded audio data from the stream. + The general functions, op_read() and op_read_float() return 16-bit or + floating-point output, both using native endian ordering. + The number of channels returned can change from link to link in a chained + stream. + There are special functions, op_read_stereo() and op_read_float_stereo(), + which always output two channels, to simplify applications which do not + wish to handle multichannel audio. + These downmix multichannel files to two channels, so they can always return + samples in the same format for every link in a chained file. + + If the rest of your audio processing chain can handle floating point, those + routines should be preferred, as floating point output avoids introducing + clipping and other issues which might be avoided entirely if, e.g., you + scale down the volume at some other stage. + However, if you intend to direct consume 16-bit samples, the conversion in + libopusfile provides noise-shaping dithering and, if compiled + against libopus 1.1 or later, soft-clipping prevention. + + libopusfile can also be configured at compile time to use the + fixed-point libopus API. + If so, libopusfile's floating-point API may also be disabled. + In that configuration, nothing in libopusfile will use any + floating-point operations, to simplify support on devices without an + adequate FPU. + + \warning HTTPS streams may be be vulnerable to truncation attacks if you do + not check the error return code from op_read_float() or its associated + functions. + If the remote peer does not close the connection gracefully (with a TLS + "close notify" message), these functions will return OP_EREAD instead of 0 + when they reach the end of the file. + If you are reading from an URL (particularly if seeking is not + supported), you should make sure to check for this error and warn the user + appropriately.*/ +/*@{*/ + +/**Gain offset type that indicates that the provided offset is relative to the + header gain. + This is the default.*/ +#define OP_HEADER_GAIN (0) + +/**Gain offset type that indicates that the provided offset is relative to the + R128_TRACK_GAIN value (if any), in addition to the header gain.*/ +#define OP_TRACK_GAIN (3008) + +/**Gain offset type that indicates that the provided offset should be used as + the gain directly, without applying any the header or track gains.*/ +#define OP_ABSOLUTE_GAIN (3009) + +/**Sets the gain to be used for decoded output. + By default, the gain in the header is applied with no additional offset. + The total gain (including header gain and/or track gain, if applicable, and + this offset), will be clamped to [-32768,32767]/256 dB. + This is more than enough to saturate or underflow 16-bit PCM. + \note The new gain will not be applied to any already buffered, decoded + output. + This means you cannot change it sample-by-sample, as at best it will be + updated packet-by-packet. + It is meant for setting a target volume level, rather than applying smooth + fades, etc. + \param _of The \c OggOpusFile on which to set the gain offset. + \param _gain_type One of #OP_HEADER_GAIN, #OP_TRACK_GAIN, or + #OP_ABSOLUTE_GAIN. + \param _gain_offset_q8 The gain offset to apply, in 1/256ths of a dB. + \return 0 on success or a negative value on error. + \retval #OP_EINVAL The \a _gain_type was unrecognized.*/ +int op_set_gain_offset(OggOpusFile *_of, + int _gain_type,opus_int32 _gain_offset_q8); + +/**Reads more samples from the stream. + \note Although \a _buf_size must indicate the total number of values that + can be stored in \a _pcm, the return value is the number of samples + per channel. + This is done because +
    +
  1. The channel count cannot be known a priori (reading more samples might + advance us into the next link, with a different channel count), so + \a _buf_size cannot also be in units of samples per channel,
  2. +
  3. Returning the samples per channel matches the libopus API + as closely as we're able,
  4. +
  5. Returning the total number of values instead of samples per channel + would mean the caller would need a division to compute the samples per + channel, and might worry about the possibility of getting back samples + for some channels and not others, and
  6. +
  7. This approach is relatively fool-proof: if an application passes too + small a value to \a _buf_size, they will simply get fewer samples back, + and if they assume the return value is the total number of values, then + they will simply read too few (rather than reading too many and going + off the end of the buffer).
  8. +
+ \param _of The \c OggOpusFile from which to read. + \param[out] _pcm A buffer in which to store the output PCM samples, as + signed native-endian 16-bit values at 48 kHz + with a nominal range of [-32768,32767). + Multiple channels are interleaved using the + Vorbis + channel ordering. + This must have room for at least \a _buf_size values. + \param _buf_size The number of values that can be stored in \a _pcm. + It is recommended that this be large enough for at + least 120 ms of data at 48 kHz per channel (5760 + values per channel). + Smaller buffers will simply return less data, possibly + consuming more memory to buffer the data internally. + libopusfile may return less data than + requested. + If so, there is no guarantee that the remaining data + in \a _pcm will be unmodified. + \param[out] _li The index of the link this data was decoded from. + You may pass NULL if you do not need this + information. + If this function fails (returning a negative value), + this parameter is left unset. + \return The number of samples read per channel on success, or a negative + value on failure. + The channel count can be retrieved on success by calling + op_head(_of,*_li). + The number of samples returned may be 0 if the buffer was too small + to store even a single sample for all channels, or if end-of-file + was reached. + The list of possible failure codes follows. + Most of them can only be returned by unseekable, chained streams + that encounter a new link. + \retval #OP_HOLE There was a hole in the data, and some samples + may have been skipped. + Call this function again to continue decoding + past the hole. + \retval #OP_EREAD An underlying read operation failed. + This may signal a truncation attack from an + source. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL An unseekable stream encountered a new link that + used a feature that is not implemented, such as + an unsupported channel family. + \retval #OP_EINVAL The stream was only partially open. + \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that + did not have any logical Opus streams in it. + \retval #OP_EBADHEADER An unseekable stream encountered a new link with a + required header packet that was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An unseekable stream encountered a new link with + an ID header that contained an unrecognized + version number. + \retval #OP_EBADPACKET Failed to properly decode the next packet. + \retval #OP_EBADLINK We failed to find data we had seen before. + \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with + a starting timestamp that failed basic validity + checks.*/ +OP_WARN_UNUSED_RESULT int op_read(OggOpusFile *_of, + opus_int16 *_pcm,int _buf_size,int *_li) OP_ARG_NONNULL(1); + +/**Reads more samples from the stream. + \note Although \a _buf_size must indicate the total number of values that + can be stored in \a _pcm, the return value is the number of samples + per channel. +
    +
  1. The channel count cannot be known a priori (reading more samples might + advance us into the next link, with a different channel count), so + \a _buf_size cannot also be in units of samples per channel,
  2. +
  3. Returning the samples per channel matches the libopus API + as closely as we're able,
  4. +
  5. Returning the total number of values instead of samples per channel + would mean the caller would need a division to compute the samples per + channel, and might worry about the possibility of getting back samples + for some channels and not others, and
  6. +
  7. This approach is relatively fool-proof: if an application passes too + small a value to \a _buf_size, they will simply get fewer samples back, + and if they assume the return value is the total number of values, then + they will simply read too few (rather than reading too many and going + off the end of the buffer).
  8. +
+ \param _of The \c OggOpusFile from which to read. + \param[out] _pcm A buffer in which to store the output PCM samples as + signed floats at 48 kHz with a nominal range of + [-1.0,1.0]. + Multiple channels are interleaved using the + Vorbis + channel ordering. + This must have room for at least \a _buf_size floats. + \param _buf_size The number of floats that can be stored in \a _pcm. + It is recommended that this be large enough for at + least 120 ms of data at 48 kHz per channel (5760 + samples per channel). + Smaller buffers will simply return less data, possibly + consuming more memory to buffer the data internally. + If less than \a _buf_size values are returned, + libopusfile makes no guarantee that the + remaining data in \a _pcm will be unmodified. + \param[out] _li The index of the link this data was decoded from. + You may pass NULL if you do not need this + information. + If this function fails (returning a negative value), + this parameter is left unset. + \return The number of samples read per channel on success, or a negative + value on failure. + The channel count can be retrieved on success by calling + op_head(_of,*_li). + The number of samples returned may be 0 if the buffer was too small + to store even a single sample for all channels, or if end-of-file + was reached. + The list of possible failure codes follows. + Most of them can only be returned by unseekable, chained streams + that encounter a new link. + \retval #OP_HOLE There was a hole in the data, and some samples + may have been skipped. + Call this function again to continue decoding + past the hole. + \retval #OP_EREAD An underlying read operation failed. + This may signal a truncation attack from an + source. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL An unseekable stream encountered a new link that + used a feature that is not implemented, such as + an unsupported channel family. + \retval #OP_EINVAL The stream was only partially open. + \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that + did not have any logical Opus streams in it. + \retval #OP_EBADHEADER An unseekable stream encountered a new link with a + required header packet that was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An unseekable stream encountered a new link with + an ID header that contained an unrecognized + version number. + \retval #OP_EBADPACKET Failed to properly decode the next packet. + \retval #OP_EBADLINK We failed to find data we had seen before. + \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with + a starting timestamp that failed basic validity + checks.*/ +OP_WARN_UNUSED_RESULT int op_read_float(OggOpusFile *_of, + float *_pcm,int _buf_size,int *_li) OP_ARG_NONNULL(1); + +/**Reads more samples from the stream and downmixes to stereo, if necessary. + This function is intended for simple players that want a uniform output + format, even if the channel count changes between links in a chained + stream. + \note \a _buf_size indicates the total number of values that can be stored + in \a _pcm, while the return value is the number of samples per + channel, even though the channel count is known, for consistency with + op_read(). + \param _of The \c OggOpusFile from which to read. + \param[out] _pcm A buffer in which to store the output PCM samples, as + signed native-endian 16-bit values at 48 kHz + with a nominal range of [-32768,32767). + The left and right channels are interleaved in the + buffer. + This must have room for at least \a _buf_size values. + \param _buf_size The number of values that can be stored in \a _pcm. + It is recommended that this be large enough for at + least 120 ms of data at 48 kHz per channel (11520 + values total). + Smaller buffers will simply return less data, possibly + consuming more memory to buffer the data internally. + If less than \a _buf_size values are returned, + libopusfile makes no guarantee that the + remaining data in \a _pcm will be unmodified. + \return The number of samples read per channel on success, or a negative + value on failure. + The number of samples returned may be 0 if the buffer was too small + to store even a single sample for both channels, or if end-of-file + was reached. + The list of possible failure codes follows. + Most of them can only be returned by unseekable, chained streams + that encounter a new link. + \retval #OP_HOLE There was a hole in the data, and some samples + may have been skipped. + Call this function again to continue decoding + past the hole. + \retval #OP_EREAD An underlying read operation failed. + This may signal a truncation attack from an + source. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL An unseekable stream encountered a new link that + used a feature that is not implemented, such as + an unsupported channel family. + \retval #OP_EINVAL The stream was only partially open. + \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that + did not have any logical Opus streams in it. + \retval #OP_EBADHEADER An unseekable stream encountered a new link with a + required header packet that was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An unseekable stream encountered a new link with + an ID header that contained an unrecognized + version number. + \retval #OP_EBADPACKET Failed to properly decode the next packet. + \retval #OP_EBADLINK We failed to find data we had seen before. + \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with + a starting timestamp that failed basic validity + checks.*/ +OP_WARN_UNUSED_RESULT int op_read_stereo(OggOpusFile *_of, + opus_int16 *_pcm,int _buf_size) OP_ARG_NONNULL(1); + +/**Reads more samples from the stream and downmixes to stereo, if necessary. + This function is intended for simple players that want a uniform output + format, even if the channel count changes between links in a chained + stream. + \note \a _buf_size indicates the total number of values that can be stored + in \a _pcm, while the return value is the number of samples per + channel, even though the channel count is known, for consistency with + op_read_float(). + \param _of The \c OggOpusFile from which to read. + \param[out] _pcm A buffer in which to store the output PCM samples, as + signed floats at 48 kHz with a nominal range of + [-1.0,1.0]. + The left and right channels are interleaved in the + buffer. + This must have room for at least \a _buf_size values. + \param _buf_size The number of values that can be stored in \a _pcm. + It is recommended that this be large enough for at + least 120 ms of data at 48 kHz per channel (11520 + values total). + Smaller buffers will simply return less data, possibly + consuming more memory to buffer the data internally. + If less than \a _buf_size values are returned, + libopusfile makes no guarantee that the + remaining data in \a _pcm will be unmodified. + \return The number of samples read per channel on success, or a negative + value on failure. + The number of samples returned may be 0 if the buffer was too small + to store even a single sample for both channels, or if end-of-file + was reached. + The list of possible failure codes follows. + Most of them can only be returned by unseekable, chained streams + that encounter a new link. + \retval #OP_HOLE There was a hole in the data, and some samples + may have been skipped. + Call this function again to continue decoding + past the hole. + \retval #OP_EREAD An underlying read operation failed. + This may signal a truncation attack from an + source. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL An unseekable stream encountered a new link that + used a feature that is not implemented, such as + an unsupported channel family. + \retval #OP_EINVAL The stream was only partially open. + \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that + that did not have any logical Opus streams in it. + \retval #OP_EBADHEADER An unseekable stream encountered a new link with a + required header packet that was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An unseekable stream encountered a new link with + an ID header that contained an unrecognized + version number. + \retval #OP_EBADPACKET Failed to properly decode the next packet. + \retval #OP_EBADLINK We failed to find data we had seen before. + \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with + a starting timestamp that failed basic validity + checks.*/ +OP_WARN_UNUSED_RESULT int op_read_float_stereo(OggOpusFile *_of, + float *_pcm,int _buf_size) OP_ARG_NONNULL(1); + +/*@}*/ +/*@}*/ + +# if OP_GNUC_PREREQ(4,0) +# pragma GCC visibility pop +# endif + +# if defined(__cplusplus) +} +# endif + +#endif diff --git a/Audio-Frameworks/bin/opusfile/OpusFile.framework/Versions/A/OpusFile b/Audio-Frameworks/bin/opusfile/OpusFile.framework/Versions/A/OpusFile new file mode 100644 index 0000000..373a89c Binary files /dev/null and b/Audio-Frameworks/bin/opusfile/OpusFile.framework/Versions/A/OpusFile differ diff --git a/Audio-Frameworks/bin/opusfile/OpusFile.framework/Versions/A/Resources/Info.plist b/Audio-Frameworks/bin/opusfile/OpusFile.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..36d47e5 Binary files /dev/null and b/Audio-Frameworks/bin/opusfile/OpusFile.framework/Versions/A/Resources/Info.plist differ diff --git a/Audio-Frameworks/bin/opusfile/OpusFile.framework/Versions/Current b/Audio-Frameworks/bin/opusfile/OpusFile.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Audio-Frameworks/bin/opusfile/OpusFile.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Audio-Frameworks/bin/opusfile/include/opusfile/opusfile.h b/Audio-Frameworks/bin/opusfile/include/opusfile/opusfile.h new file mode 100644 index 0000000..31eeaed --- /dev/null +++ b/Audio-Frameworks/bin/opusfile/include/opusfile/opusfile.h @@ -0,0 +1,1866 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE libopusfile SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE libopusfile SOURCE CODE IS (C) COPYRIGHT 1994-2012 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: stdio-based convenience library for opening/seeking/decoding + last mod: $Id: vorbisfile.h 17182 2010-04-29 03:48:32Z xiphmont $ + + ********************************************************************/ +#if !defined(_opusfile_h) +# define _opusfile_h (1) + +/**\mainpage + \section Introduction + + This is the documentation for the libopusfile C API. + + The libopusfile package provides a convenient high-level API for + decoding and basic manipulation of all Ogg Opus audio streams. + libopusfile is implemented as a layer on top of Xiph.Org's + reference + libogg + and + libopus + libraries. + + libopusfile provides several sets of built-in routines for + file/stream access, and may also use custom stream I/O routines provided by + the embedded environment. + There are built-in I/O routines provided for ANSI-compliant + stdio (FILE *), memory buffers, and URLs + (including URLs, plus optionally and URLs). + + \section Organization + + The main API is divided into several sections: + - \ref stream_open_close + - \ref stream_info + - \ref stream_decoding + - \ref stream_seeking + + Several additional sections are not tied to the main API. + - \ref stream_callbacks + - \ref header_info + - \ref error_codes + + \section Overview + + The libopusfile API always decodes files to 48 kHz. + The original sample rate is not preserved by the lossy compression, though + it is stored in the header to allow you to resample to it after decoding + (the libopusfile API does not currently provide a resampler, + but the + the + Speex resampler is a good choice if you need one). + In general, if you are playing back the audio, you should leave it at + 48 kHz, provided your audio hardware supports it. + When decoding to a file, it may be worth resampling back to the original + sample rate, so as not to surprise users who might not expect the sample + rate to change after encoding to Opus and decoding. + + Opus files can contain anywhere from 1 to 255 channels of audio. + The channel mappings for up to 8 channels are the same as the + Vorbis + mappings. + A special stereo API can convert everything to 2 channels, making it simple + to support multichannel files in a application which only has stereo + output. + Although the libopusfile ABI provides support for the theoretical + maximum number of channels, the current implementation does not support + files with more than 8 channels, as they do not have well-defined channel + mappings. + + Like all Ogg files, Opus files may be "chained". + That is, multiple Opus files may be combined into a single, longer file just + by concatenating the original files. + This is commonly done in internet radio streaming, as it allows the title + and artist to be updated each time the song changes, since each link in the + chain includes its own set of metadata. + + libopusfile fully supports chained files. + It will decode the first Opus stream found in each link of a chained file + (ignoring any other streams that might be concurrently multiplexed with it, + such as a video stream). + + The channel count can also change between links, but if your application is + not prepared to deal with this, it can use the stereo API to ensure the + audio from all links will always get decoded into a common format. + Since libopusfile always decodes to 48 kHz, you do not have to + worry about the sample rate changing between links (as was possible with + Vorbis). + This makes application support for chained files with libopusfile + very easy.*/ + +# if defined(__cplusplus) +extern "C" { +# endif + +# include +# include +# include +# include + +/*Enable special features for gcc and gcc-compatible compilers.*/ +# if !defined(OP_GNUC_PREREQ) +# if defined(__GNUC__)&&defined(__GNUC_MINOR__) +# define OP_GNUC_PREREQ(_maj,_min) \ + ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) +# else +# define OP_GNUC_PREREQ(_maj,_min) 0 +# endif +# endif + +# if OP_GNUC_PREREQ(4,0) +# pragma GCC visibility push(default) +# endif + +typedef struct OpusHead OpusHead; +typedef struct OpusTags OpusTags; +typedef struct OpusPictureTag OpusPictureTag; +typedef struct OggOpusFile OggOpusFile; + +/*Warning attributes for libopusfile functions.*/ +# if OP_GNUC_PREREQ(3,4) +# define OP_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) +# else +# define OP_WARN_UNUSED_RESULT +# endif +# if OP_GNUC_PREREQ(3,4) +# define OP_ARG_NONNULL(_x) __attribute__((__nonnull__(_x))) +# else +# define OP_ARG_NONNULL(_x) +# endif + +/**\defgroup error_codes Error Codes*/ +/*@{*/ +/**\name List of possible error codes + Many of the functions in this library return a negative error code when a + function fails. + This list provides a brief explanation of the common errors. + See each individual function for more details on what a specific error code + means in that context.*/ +/*@{*/ + +/**A request did not succeed.*/ +#define OP_FALSE (-1) +/*Currently not used externally.*/ +#define OP_EOF (-2) +/**There was a hole in the page sequence numbers (e.g., a page was corrupt or + missing).*/ +#define OP_HOLE (-3) +/**An underlying read, seek, or tell operation failed when it should have + succeeded.*/ +#define OP_EREAD (-128) +/**A NULL pointer was passed where one was unexpected, or an + internal memory allocation failed, or an internal library error was + encountered.*/ +#define OP_EFAULT (-129) +/**The stream used a feature that is not implemented, such as an unsupported + channel family.*/ +#define OP_EIMPL (-130) +/**One or more parameters to a function were invalid.*/ +#define OP_EINVAL (-131) +/**A purported Ogg Opus stream did not begin with an Ogg page, a purported + header packet did not start with one of the required strings, "OpusHead" or + "OpusTags", or a link in a chained file was encountered that did not + contain any logical Opus streams.*/ +#define OP_ENOTFORMAT (-132) +/**A required header packet was not properly formatted, contained illegal + values, or was missing altogether.*/ +#define OP_EBADHEADER (-133) +/**The ID header contained an unrecognized version number.*/ +#define OP_EVERSION (-134) +/*Currently not used at all.*/ +#define OP_ENOTAUDIO (-135) +/**An audio packet failed to decode properly. + This is usually caused by a multistream Ogg packet where the durations of + the individual Opus packets contained in it are not all the same.*/ +#define OP_EBADPACKET (-136) +/**We failed to find data we had seen before, or the bitstream structure was + sufficiently malformed that seeking to the target destination was + impossible.*/ +#define OP_EBADLINK (-137) +/**An operation that requires seeking was requested on an unseekable stream.*/ +#define OP_ENOSEEK (-138) +/**The first or last granule position of a link failed basic validity checks.*/ +#define OP_EBADTIMESTAMP (-139) + +/*@}*/ +/*@}*/ + +/**\defgroup header_info Header Information*/ +/*@{*/ + +/**The maximum number of channels in an Ogg Opus stream.*/ +#define OPUS_CHANNEL_COUNT_MAX (255) + +/**Ogg Opus bitstream information. + This contains the basic playback parameters for a stream, and corresponds to + the initial ID header packet of an Ogg Opus stream.*/ +struct OpusHead{ + /**The Ogg Opus format version, in the range 0...255. + The top 4 bits represent a "major" version, and the bottom four bits + represent backwards-compatible "minor" revisions. + The current specification describes version 1. + This library will recognize versions up through 15 as backwards compatible + with the current specification. + An earlier draft of the specification described a version 0, but the only + difference between version 1 and version 0 is that version 0 did + not specify the semantics for handling the version field.*/ + int version; + /**The number of channels, in the range 1...255.*/ + int channel_count; + /**The number of samples that should be discarded from the beginning of the + stream.*/ + unsigned pre_skip; + /**The sampling rate of the original input. + All Opus audio is coded at 48 kHz, and should also be decoded at 48 kHz + for playback (unless the target hardware does not support this sampling + rate). + However, this field may be used to resample the audio back to the original + sampling rate, for example, when saving the output to a file.*/ + opus_uint32 input_sample_rate; + /**The gain to apply to the decoded output, in dB, as a Q8 value in the range + -32768...32767. + The libopusfile API will automatically apply this gain to the + decoded output before returning it, scaling it by + pow(10,output_gain/(20.0*256)).*/ + int output_gain; + /**The channel mapping family, in the range 0...255. + Channel mapping family 0 covers mono or stereo in a single stream. + Channel mapping family 1 covers 1 to 8 channels in one or more streams, + using the Vorbis speaker assignments. + Channel mapping family 255 covers 1 to 255 channels in one or more + streams, but without any defined speaker assignment.*/ + int mapping_family; + /**The number of Opus streams in each Ogg packet, in the range 1...255.*/ + int stream_count; + /**The number of coupled Opus streams in each Ogg packet, in the range + 0...127. + This must satisfy 0 <= coupled_count <= stream_count and + coupled_count + stream_count <= 255. + The coupled streams appear first, before all uncoupled streams, in an Ogg + Opus packet.*/ + int coupled_count; + /**The mapping from coded stream channels to output channels. + Let index=mapping[k] be the value for channel k. + If index<2*coupled_count, then it refers to the left channel + from stream (index/2) if even, and the right channel from + stream (index/2) if odd. + Otherwise, it refers to the output of the uncoupled stream + (index-coupled_count).*/ + unsigned char mapping[OPUS_CHANNEL_COUNT_MAX]; +}; + +/**The metadata from an Ogg Opus stream. + + This structure holds the in-stream metadata corresponding to the 'comment' + header packet of an Ogg Opus stream. + The comment header is meant to be used much like someone jotting a quick + note on the label of a CD. + It should be a short, to the point text note that can be more than a couple + words, but not more than a short paragraph. + + The metadata is stored as a series of (tag, value) pairs, in length-encoded + string vectors, using the same format as Vorbis (without the final "framing + bit"), Theora, and Speex, except for the packet header. + The first occurrence of the '=' character delimits the tag and value. + A particular tag may occur more than once, and order is significant. + The character set encoding for the strings is always UTF-8, but the tag + names are limited to ASCII, and treated as case-insensitive. + See the Vorbis + comment header specification for details. + + In filling in this structure, libopusfile will null-terminate the + #user_comments strings for safety. + However, the bitstream format itself treats them as 8-bit clean vectors, + possibly containing NUL characters, so the #comment_lengths array should be + treated as their authoritative length. + + This structure is binary and source-compatible with a + vorbis_comment, and pointers to it may be freely cast to + vorbis_comment pointers, and vice versa. + It is provided as a separate type to avoid introducing a compile-time + dependency on the libvorbis headers.*/ +struct OpusTags{ + /**The array of comment string vectors.*/ + char **user_comments; + /**An array of the corresponding length of each vector, in bytes.*/ + int *comment_lengths; + /**The total number of comment streams.*/ + int comments; + /**The null-terminated vendor string. + This identifies the software used to encode the stream.*/ + char *vendor; +}; + +/**\name Picture tag image formats*/ +/*@{*/ + +/**The MIME type was not recognized, or the image data did not match the + declared MIME type.*/ +#define OP_PIC_FORMAT_UNKNOWN (-1) +/**The MIME type indicates the image data is really a URL.*/ +#define OP_PIC_FORMAT_URL (0) +/**The image is a JPEG.*/ +#define OP_PIC_FORMAT_JPEG (1) +/**The image is a PNG.*/ +#define OP_PIC_FORMAT_PNG (2) +/**The image is a GIF.*/ +#define OP_PIC_FORMAT_GIF (3) + +/*@}*/ + +/**The contents of a METADATA_BLOCK_PICTURE tag.*/ +struct OpusPictureTag{ + /**The picture type according to the ID3v2 APIC frame: +
    +
  1. Other
  2. +
  3. 32x32 pixels 'file icon' (PNG only)
  4. +
  5. Other file icon
  6. +
  7. Cover (front)
  8. +
  9. Cover (back)
  10. +
  11. Leaflet page
  12. +
  13. Media (e.g. label side of CD)
  14. +
  15. Lead artist/lead performer/soloist
  16. +
  17. Artist/performer
  18. +
  19. Conductor
  20. +
  21. Band/Orchestra
  22. +
  23. Composer
  24. +
  25. Lyricist/text writer
  26. +
  27. Recording Location
  28. +
  29. During recording
  30. +
  31. During performance
  32. +
  33. Movie/video screen capture
  34. +
  35. A bright colored fish
  36. +
  37. Illustration
  38. +
  39. Band/artist logotype
  40. +
  41. Publisher/Studio logotype
  42. +
+ Others are reserved and should not be used. + There may only be one each of picture type 1 and 2 in a file.*/ + opus_int32 type; + /**The MIME type of the picture, in printable ASCII characters 0x20-0x7E. + The MIME type may also be "-->" to signify that the data part + is a URL pointing to the picture instead of the picture data itself. + In this case, a terminating NUL is appended to the URL string in #data, + but #data_length is set to the length of the string excluding that + terminating NUL.*/ + char *mime_type; + /**The description of the picture, in UTF-8.*/ + char *description; + /**The width of the picture in pixels.*/ + opus_uint32 width; + /**The height of the picture in pixels.*/ + opus_uint32 height; + /**The color depth of the picture in bits-per-pixel (not + bits-per-channel).*/ + opus_uint32 depth; + /**For indexed-color pictures (e.g., GIF), the number of colors used, or 0 + for non-indexed pictures.*/ + opus_uint32 colors; + /**The length of the picture data in bytes.*/ + opus_uint32 data_length; + /**The binary picture data.*/ + unsigned char *data; + /**The format of the picture data, if known. + One of +
    +
  • #OP_PIC_FORMAT_UNKNOWN,
  • +
  • #OP_PIC_FORMAT_URL,
  • +
  • #OP_PIC_FORMAT_JPEG,
  • +
  • #OP_PIC_FORMAT_PNG,
  • +
  • #OP_PIC_FORMAT_GIF, or
  • +
.*/ + int format; +}; + +/**\name Functions for manipulating header data + + These functions manipulate the #OpusHead and #OpusTags structures, + which describe the audio parameters and tag-value metadata, respectively. + These can be used to query the headers returned by libopusfile, or + to parse Opus headers from sources other than an Ogg Opus stream, provided + they use the same format.*/ +/*@{*/ + +/**Parses the contents of the ID header packet of an Ogg Opus stream. + \param[out] _head Returns the contents of the parsed packet. + The contents of this structure are untouched on error. + This may be NULL to merely test the header + for validity. + \param[in] _data The contents of the ID header packet. + \param _len The number of bytes of data in the ID header packet. + \return 0 on success or a negative value on error. + \retval #OP_ENOTFORMAT If the data does not start with the "OpusHead" + string. + \retval #OP_EVERSION If the version field signaled a version this library + does not know how to parse. + \retval #OP_EIMPL If the channel mapping family was 255, which general + purpose players should not attempt to play. + \retval #OP_EBADHEADER If the contents of the packet otherwise violate the + Ogg Opus specification: +
    +
  • Insufficient data,
  • +
  • Too much data for the known minor versions,
  • +
  • An unrecognized channel mapping family,
  • +
  • Zero channels or too many channels,
  • +
  • Zero coded streams,
  • +
  • Too many coupled streams, or
  • +
  • An invalid channel mapping index.
  • +
*/ +OP_WARN_UNUSED_RESULT int opus_head_parse(OpusHead *_head, + const unsigned char *_data,size_t _len) OP_ARG_NONNULL(2); + +/**Converts a granule position to a sample offset for a given Ogg Opus stream. + The sample offset is simply _gp-_head->pre_skip. + Granule position values smaller than OpusHead#pre_skip correspond to audio + that should never be played, and thus have no associated sample offset. + This function returns -1 for such values. + This function also correctly handles extremely large granule positions, + which may have wrapped around to a negative number when stored in a signed + ogg_int64_t value. + \param _head The #OpusHead information from the ID header of the stream. + \param _gp The granule position to convert. + \return The sample offset associated with the given granule position + (counting at a 48 kHz sampling rate), or the special value -1 on + error (i.e., the granule position was smaller than the pre-skip + amount).*/ +ogg_int64_t opus_granule_sample(const OpusHead *_head,ogg_int64_t _gp) + OP_ARG_NONNULL(1); + +/**Parses the contents of the 'comment' header packet of an Ogg Opus stream. + \param[out] _tags An uninitialized #OpusTags structure. + This returns the contents of the parsed packet. + The contents of this structure are untouched on error. + This may be NULL to merely test the header + for validity. + \param[in] _data The contents of the 'comment' header packet. + \param _len The number of bytes of data in the 'info' header packet. + \retval 0 Success. + \retval #OP_ENOTFORMAT If the data does not start with the "OpusTags" + string. + \retval #OP_EBADHEADER If the contents of the packet otherwise violate the + Ogg Opus specification. + \retval #OP_EFAULT If there wasn't enough memory to store the tags.*/ +OP_WARN_UNUSED_RESULT int opus_tags_parse(OpusTags *_tags, + const unsigned char *_data,size_t _len) OP_ARG_NONNULL(2); + +/**Initializes an #OpusTags structure. + This should be called on a freshly allocated #OpusTags structure before + attempting to use it. + \param _tags The #OpusTags structure to initialize.*/ +void opus_tags_init(OpusTags *_tags) OP_ARG_NONNULL(1); + +/**Add a (tag, value) pair to an initialized #OpusTags structure. + \note Neither opus_tags_add() nor opus_tags_add_comment() support values + containing embedded NULs, although the bitstream format does support them. + To add such tags, you will need to manipulate the #OpusTags structure + directly. + \param _tags The #OpusTags structure to add the (tag, value) pair to. + \param _tag A NUL-terminated, case-insensitive, ASCII string containing + the tag to add (without an '=' character). + \param _value A NUL-terminated UTF-8 containing the corresponding value. + \return 0 on success, or a negative value on failure. + \retval #OP_EFAULT An internal memory allocation failed.*/ +int opus_tags_add(OpusTags *_tags,const char *_tag,const char *_value) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2) OP_ARG_NONNULL(3); + +/**Add a comment to an initialized #OpusTags structure. + \note Neither opus_tags_add_comment() nor opus_tags_add() support comments + containing embedded NULs, although the bitstream format does support them. + To add such tags, you will need to manipulate the #OpusTags structure + directly. + \param _tags The #OpusTags structure to add the comment to. + \param _comment A NUL-terminated UTF-8 string containing the comment in + "TAG=value" form. + \return 0 on success, or a negative value on failure. + \retval #OP_EFAULT An internal memory allocation failed.*/ +int opus_tags_add_comment(OpusTags *_tags,const char *_comment) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Look up a comment value by its tag. + \param _tags An initialized #OpusTags structure. + \param _tag The tag to look up. + \param _count The instance of the tag. + The same tag can appear multiple times, each with a distinct + value, so an index is required to retrieve them all. + The order in which these values appear is significant and + should be preserved. + Use opus_tags_query_count() to get the legal range for the + \a _count parameter. + \return A pointer to the queried tag's value. + This points directly to data in the #OpusTags structure. + It should not be modified or freed by the application, and + modifications to the structure may invalidate the pointer. + \retval NULL If no matching tag is found.*/ +const char *opus_tags_query(const OpusTags *_tags,const char *_tag,int _count) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Look up the number of instances of a tag. + Call this first when querying for a specific tag and then iterate over the + number of instances with separate calls to opus_tags_query() to retrieve + all the values for that tag in order. + \param _tags An initialized #OpusTags structure. + \param _tag The tag to look up. + \return The number of instances of this particular tag.*/ +int opus_tags_query_count(const OpusTags *_tags,const char *_tag) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Get the track gain from an R128_TRACK_GAIN tag, if one was specified. + This searches for the first R128_TRACK_GAIN tag with a valid signed, + 16-bit decimal integer value and returns the value. + This routine is exposed merely for convenience for applications which wish + to do something special with the track gain (i.e., display it). + If you simply wish to apply the track gain instead of the header gain, you + can use op_set_gain_offset() with an #OP_TRACK_GAIN type and no offset. + \param _tags An initialized #OpusTags structure. + \param[out] _gain_q8 The track gain, in 1/256ths of a dB. + This will lie in the range [-32768,32767], and should + be applied in addition to the header gain. + On error, no value is returned, and the previous + contents remain unchanged. + \return 0 on success, or a negative value on error. + \retval OP_EFALSE There was no track gain available in the given tags.*/ +int opus_tags_get_track_gain(const OpusTags *_tags,int *_gain_q8) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Clears the #OpusTags structure. + This should be called on an #OpusTags structure after it is no longer + needed. + It will free all memory used by the structure members. + \param _tags The #OpusTags structure to clear.*/ +void opus_tags_clear(OpusTags *_tags) OP_ARG_NONNULL(1); + +/**Parse a single METADATA_BLOCK_PICTURE tag. + This decodes the BASE64-encoded content of the tag and returns a structure + with the MIME type, description, image parameters (if known), and the + compressed image data. + If the MIME type indicates the presence of an image format we recognize + (JPEG, PNG, or GIF) and the actual image data contains the magic signature + associated with that format, then the OpusPictureTag::format field will be + set to the corresponding format. + This is provided as a convenience to avoid requiring applications to parse + the MIME type and/or do their own format detection for the commonly used + formats. + In this case, we also attempt to extract the image parameters directly from + the image data (overriding any that were present in the tag, which the + specification says applications are not meant to rely on). + The application must still provide its own support for actually decoding the + image data and, if applicable, retrieving that data from URLs. + \param[out] _pic Returns the parsed picture data. + No sanitation is done on the type, MIME type, or + description fields, so these might return invalid values. + The contents of this structure are left unmodified on + failure. + \param _tag The METADATA_BLOCK_PICTURE tag contents. + The leading "METADATA_BLOCK_PICTURE=" portion is optional, + to allow the function to be used on either directly on the + values in OpusTags::user_comments or on the return value + of opus_tags_query(). + \return 0 on success or a negative value on error. + \retval #OP_ENOTFORMAT The METADATA_BLOCK_PICTURE contents were not valid. + \retval #OP_EFAULT A memory allocation failed.*/ +int opus_picture_tag_parse(OpusPictureTag *_pic,const char *_tag) + OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Initializes an #OpusPictureTag structure. + This should be called on a freshly allocated #OpusPictureTag structure + before attempting to use it. + \param _pic The #OpusPictureTag structure to initialize.*/ +void opus_picture_tag_init(OpusPictureTag *_pic) OP_ARG_NONNULL(1); + +/**Clears the #OpusPictureTag structure. + This should be called on an #OpusPictureTag structure after it is no longer + needed. + It will free all memory used by the structure members. + \param _pic The #OpusPictureTag structure to clear.*/ +void opus_picture_tag_clear(OpusPictureTag *_pic) OP_ARG_NONNULL(1); + +/*@}*/ + +/*@}*/ + +/**\defgroup url_options URL Reading Options*/ +/*@{*/ +/**\name URL reading options + Options for op_url_stream_create() and associated functions. + These allow you to provide proxy configuration parameters, skip SSL + certificate checks, etc. + Options are processed in order, and if the same option is passed multiple + times, only the value specified by the last occurrence has an effect + (unless otherwise specified). + They may be expanded in the future.*/ +/*@{*/ + +/*These are the raw numbers used to define the request codes. + They should not be used directly.*/ +#define OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST (6464) +#define OP_HTTP_PROXY_HOST_REQUEST (6528) +#define OP_HTTP_PROXY_PORT_REQUEST (6592) +#define OP_HTTP_PROXY_USER_REQUEST (6656) +#define OP_HTTP_PROXY_PASS_REQUEST (6720) + +#define OP_URL_OPT(_request) ((_request)+(char *)0) + +/*These macros trigger compilation errors or warnings if the wrong types are + provided to one of the URL options.*/ +#define OP_CHECK_INT(_x) ((void)((_x)==(opus_int32)0),(opus_int32)(_x)) +#define OP_CHECK_CONST_CHAR_PTR(_x) ((_x)+((_x)-(const char *)(_x))) + +/**Skip the certificate check when connecting via TLS/SSL (https). + \param _b opus_int32: Whether or not to skip the certificate + check. + The check will be skipped if \a _b is non-zero, and will not be + skipped if \a _b is zero. + \hideinitializer*/ +#define OP_SSL_SKIP_CERTIFICATE_CHECK(_b) \ + OP_URL_OPT(OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST),OP_CHECK_INT(_b) + +/**Proxy connections through the given host. + If no port is specified via #OP_HTTP_PROXY_PORT, the port number defaults + to 8080 (http-alt). + All proxy parameters are ignored for non-http and non-https URLs. + \param _host const char *: The proxy server hostname. + This may be NULL to disable the use of a proxy + server. + \hideinitializer*/ +#define OP_HTTP_PROXY_HOST(_host) \ + OP_URL_OPT(OP_HTTP_PROXY_HOST_REQUEST),OP_CHECK_CONST_CHAR_PTR(_host) + +/**Use the given port when proxying connections. + This option only has an effect if #OP_HTTP_PROXY_HOST is specified with a + non-NULL \a _host. + If this option is not provided, the proxy port number defaults to 8080 + (http-alt). + All proxy parameters are ignored for non-http and non-https URLs. + \param _port opus_int32: The proxy server port. + This must be in the range 0...65535 (inclusive), or the + URL function this is passed to will fail. + \hideinitializer*/ +#define OP_HTTP_PROXY_PORT(_port) \ + OP_URL_OPT(OP_HTTP_PROXY_PORT_REQUEST),OP_CHECK_INT(_port) + +/**Use the given user name for authentication when proxying connections. + All proxy parameters are ignored for non-http and non-https URLs. + \param _user const char *: The proxy server user name. + This may be NULL to disable proxy + authentication. + A non-NULL value only has an effect + if #OP_HTTP_PROXY_HOST and #OP_HTTP_PROXY_PASS + are also specified with non-NULL + arguments. + \hideinitializer*/ +#define OP_HTTP_PROXY_USER(_user) \ + OP_URL_OPT(OP_HTTP_PROXY_USER_REQUEST),OP_CHECK_CONST_CHAR_PTR(_host) + +/**Use the given password for authentication when proxying connections. + All proxy parameters are ignored for non-http and non-https URLs. + \param _pass const char *: The proxy server password. + This may be NULL to disable proxy + authentication. + A non-NULL value only has an effect + if #OP_HTTP_PROXY_HOST and #OP_HTTP_PROXY_USER + are also specified with non-NULL + arguments. + \hideinitializer*/ +#define OP_HTTP_PROXY_PASS(_pass) \ + OP_URL_OPT(OP_HTTP_PROXY_PASS_REQUEST),OP_CHECK_CONST_CHAR_PTR(_host) + +/*@}*/ +/*@}*/ + +/**\defgroup stream_callbacks Abstract Stream Reading Interface*/ +/*@{*/ +/**\name Functions for reading from streams + These functions define the interface used to read from and seek in a stream + of data. + A stream does not need to implement seeking, but the decoder will not be + able to seek if it does not do so. + These functions also include some convenience routines for working with + standard FILE pointers, complete streams stored in a single + block of memory, or URLs.*/ +/*@{*/ + +typedef struct OpusFileCallbacks OpusFileCallbacks; + +/**Reads up to \a _nbytes bytes of data from \a _stream. + \param _stream The stream to read from. + \param[out] _ptr The buffer to store the data in. + \param _nbytes The maximum number of bytes to read. + This function may return fewer, though it will not + return zero unless it reaches end-of-file. + \return The number of bytes successfully read, or a negative value on + error.*/ +typedef int (*op_read_func)(void *_stream,unsigned char *_ptr,int _nbytes); + +/**Sets the position indicator for \a _stream. + The new position, measured in bytes, is obtained by adding \a _offset + bytes to the position specified by \a _whence. + If \a _whence is set to SEEK_SET, SEEK_CUR, or + SEEK_END, the offset is relative to the start of the stream, + the current position indicator, or end-of-file, respectively. + \retval 0 Success. + \retval -1 Seeking is not supported or an error occurred. + errno need not be set.*/ +typedef int (*op_seek_func)(void *_stream,opus_int64 _offset,int _whence); + +/**Obtains the current value of the position indicator for \a _stream. + \return The current position indicator.*/ +typedef opus_int64 (*op_tell_func)(void *_stream); + +/**Closes the underlying stream. + \retval 0 Success. + \retval EOF An error occurred. + errno need not be set.*/ +typedef int (*op_close_func)(void *_stream); + +/**The callbacks used to access non-FILE stream resources. + The function prototypes are basically the same as for the stdio functions + fread(), fseek(), ftell(), and + fclose(). + The differences are that the FILE * arguments have been + replaced with a void *, which is to be used as a pointer to + whatever internal data these functions might need, that #seek and #tell + take and return 64-bit offsets, and that #seek must return -1 if + the stream is unseekable.*/ +struct OpusFileCallbacks{ + /**Used to read data from the stream. + This must not be NULL.*/ + op_read_func read; + /**Used to seek in the stream. + This may be NULL if seeking is not implemented.*/ + op_seek_func seek; + /**Used to return the current read position in the stream. + This may be NULL if seeking is not implemented.*/ + op_tell_func tell; + /**Used to close the stream when the decoder is freed. + This may be NULL to leave the stream open.*/ + op_close_func close; +}; + +/**Opens a stream with fopen() and fills in a set of callbacks + that can be used to access it. + This is useful to avoid writing your own portable 64-bit seeking wrappers, + and also avoids cross-module linking issues on Windows, where a + FILE * must be accessed by routines defined in the same module + that opened it. + \param[out] _cb The callbacks to use for this file. + If there is an error opening the file, nothing will be + filled in here. + \param _path The path to the file to open. + On Windows, this string must be UTF-8 (to allow access to + files whose names cannot be represented in the current + MBCS code page). + All other systems use the native character encoding. + \param _mode The mode to open the file in. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_fopen(OpusFileCallbacks *_cb, + const char *_path,const char *_mode) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2) + OP_ARG_NONNULL(3); + +/**Opens a stream with fdopen() and fills in a set of callbacks + that can be used to access it. + This is useful to avoid writing your own portable 64-bit seeking wrappers, + and also avoids cross-module linking issues on Windows, where a + FILE * must be accessed by routines defined in the same module + that opened it. + \param[out] _cb The callbacks to use for this file. + If there is an error opening the file, nothing will be + filled in here. + \param _fd The file descriptor to open. + \param _mode The mode to open the file in. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_fdopen(OpusFileCallbacks *_cb, + int _fd,const char *_mode) OP_ARG_NONNULL(1) OP_ARG_NONNULL(3); + +/**Opens a stream with freopen() and fills in a set of callbacks + that can be used to access it. + This is useful to avoid writing your own portable 64-bit seeking wrappers, + and also avoids cross-module linking issues on Windows, where a + FILE * must be accessed by routines defined in the same module + that opened it. + \param[out] _cb The callbacks to use for this file. + If there is an error opening the file, nothing will be + filled in here. + \param _path The path to the file to open. + On Windows, this string must be UTF-8 (to allow access + to files whose names cannot be represented in the + current MBCS code page). + All other systems use the native character encoding. + \param _mode The mode to open the file in. + \param _stream A stream previously returned by op_fopen(), op_fdopen(), + or op_freopen(). + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_freopen(OpusFileCallbacks *_cb, + const char *_path,const char *_mode,void *_stream) OP_ARG_NONNULL(1) + OP_ARG_NONNULL(2) OP_ARG_NONNULL(3) OP_ARG_NONNULL(4); + +/**Creates a stream that reads from the given block of memory. + This block of memory must contain the complete stream to decode. + This is useful for caching small streams (e.g., sound effects) in RAM. + \param[out] _cb The callbacks to use for this stream. + If there is an error creating the stream, nothing will be + filled in here. + \param _data The block of memory to read from. + \param _size The size of the block of memory. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_mem_stream_create(OpusFileCallbacks *_cb, + const unsigned char *_data,size_t _size) OP_ARG_NONNULL(1); + +/**Creates a stream that reads from the given URL. + This function behaves identically to op_url_stream_create(), except that it + takes a va_list instead of a variable number of arguments. + It does not call the va_end macro, and because it invokes the + va_arg macro, the value of \a _ap is undefined after the call. + \param[out] _cb The callbacks to use for this stream. + If there is an error creating the stream, nothing will + be filled in here. + \param _url The URL to read from. + Currently only the , , and + schemes are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always fail. + \param[in,out] _ap A list of the \ref url_options "optional flags" to use. + This is a variable-length list of options terminated + with NULL. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_url_stream_vcreate(OpusFileCallbacks *_cb, + const char *_url,va_list _ap) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/**Creates a stream that reads from the given URL using the specified proxy. + \param[out] _cb The callbacks to use for this stream. + If there is an error creating the stream, nothing will be + filled in here. + \param _url The URL to read from. + Currently only the , , and schemes + are supported. + Both and may be disabled at compile time, + in which case opening such URLs will always fail. + \param ... The \ref url_options "optional flags" to use. + This is a variable-length list of options terminated with + NULL. + \return A stream handle to use with the callbacks, or NULL on + error.*/ +OP_WARN_UNUSED_RESULT void *op_url_stream_create(OpusFileCallbacks *_cb, + const char *_url,...) OP_ARG_NONNULL(1) OP_ARG_NONNULL(2); + +/*@}*/ +/*@}*/ + +/**\defgroup stream_open_close Opening and Closing*/ +/*@{*/ +/**\name Functions for opening and closing streams + + These functions allow you to test a stream to see if it is Opus, open it, + and close it. + Several flavors are provided for each of the built-in stream types, plus a + more general version which takes a set of application-provided callbacks.*/ +/*@{*/ + +/**Test to see if this is an Opus stream. + For good results, you will need at least 57 bytes (for a pure Opus-only + stream). + Something like 512 bytes will give more reliable results for multiplexed + streams. + This function is meant to be a quick-rejection filter. + Its purpose is not to guarantee that a stream is a valid Opus stream, but to + ensure that it looks enough like Opus that it isn't going to be recognized + as some other format (except possibly an Opus stream that is also + multiplexed with other codecs, such as video). + \param[out] _head The parsed ID header contents. + You may pass NULL if you do not need + this information. + If the function fails, the contents of this structure + remain untouched. + \param _initial_data An initial buffer of data from the start of the + stream. + \param _initial_bytes The number of bytes in \a _initial_data. + \return 0 if the data appears to be Opus, or a negative value on error. + \retval #OP_FALSE There was not enough data to tell if this was an Opus + stream or not. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL The stream used a feature that is not implemented, + such as an unsupported channel family. + \retval #OP_ENOTFORMAT If the data did not contain a recognizable ID + header for an Opus stream. + \retval #OP_EVERSION If the version field signaled a version this library + does not know how to parse. + \retval #OP_EBADHEADER The ID header was not properly formatted or contained + illegal values.*/ +int op_test(OpusHead *_head, + const unsigned char *_initial_data,size_t _initial_bytes); + +/**Open a stream from the given file path. + \param _path The path to the file to open. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + The failure code will be #OP_EFAULT if the file could not + be opened, or one of the other failure codes from + op_open_callbacks() otherwise. + \return A freshly opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_file(const char *_path,int *_error) + OP_ARG_NONNULL(1); + +/**Open a stream from a memory buffer. + \param _data The memory buffer to open. + \param _size The number of bytes in the buffer. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + See op_open_callbacks() for a full list of failure codes. + \return A freshly opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_memory(const unsigned char *_data, + size_t _size,int *_error); + +/**Open a stream from a URL. + This function behaves identically to op_open_url(), except that it + takes a va_list instead of a variable number of arguments. + It does not call the va_end macro, and because it invokes the + va_arg macro, the value of \a _ap is undefined after the call. + \param _url The URL to open. + Currently only the , , and + schemes are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always + fail. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want + the failure code. + See op_open_callbacks() for a full list of failure + codes. + \param[in,out] _ap A list of the \ref url_options "optional flags" to + use. + This is a variable-length list of options terminated + with NULL. + \return A freshly opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_vopen_url(const char *_url, + int *_error,va_list _ap) OP_ARG_NONNULL(1); + +/**Open a stream from a URL. + However, this approach will not work for live streams or HTTP/1.0 servers + (which do not support Range requets). + \param _url The URL to open. + Currently only the , , and schemes + are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always fail. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + See op_open_callbacks() for a full list of failure codes. + \param ... The \ref url_options "optional flags" to use. + This is a variable-length list of options terminated with + NULL. + \return A freshly opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_url(const char *_url, + int *_error,...) OP_ARG_NONNULL(1); + +/**Open a stream using the given set of callbacks to access it. + \param _source The stream to read from (e.g., a FILE *). + \param _cb The callbacks with which to access the stream. + read() must + be implemented. + seek() and + tell() may + be NULL, or may always return -1 to + indicate a source is unseekable, but if + seek() is + implemented and succeeds on a particular source, then + tell() must + also. + close() may + be NULL, but if it is not, it will be + called when the \c OggOpusFile is destroyed by + op_free(). + It will not be called if op_open_callbacks() fails + with an error. + \param _initial_data An initial buffer of data from the start of the + stream. + Applications can read some number of bytes from the + start of the stream to help identify this as an Opus + stream, and then provide them here to allow the + stream to be opened, even if it is unseekable. + \param _initial_bytes The number of bytes in \a _initial_data. + If the stream is seekable, its current position (as + reported by + tell() + at the start of this function) must be equal to + \a _initial_bytes. + Otherwise, seeking to absolute positions will + generate inconsistent results. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want + the failure code. + The failure code will be one of +
+
#OP_EREAD
+
An underlying read, seek, or tell operation + failed when it should have succeeded, or we failed + to find data in the stream we had seen before.
+
#OP_EFAULT
+
There was a memory allocation failure, or an + internal library error.
+
#OP_EIMPL
+
The stream used a feature that is not + implemented, such as an unsupported channel + family.
+
#OP_EINVAL
+
seek() + was implemented and succeeded on this source, but + tell() + did not, or the starting position indicator was + not equal to \a _initial_bytes.
+
#OP_ENOTFORMAT
+
The stream contained a link that did not have + any logical Opus streams in it.
+
#OP_EBADHEADER
+
A required header packet was not properly + formatted, contained illegal values, or was missing + altogether.
+
#OP_EVERSION
+
An ID header contained an unrecognized version + number.
+
#OP_EBADLINK
+
We failed to find data we had seen before after + seeking.
+
#OP_EBADTIMESTAMP
+
The first or last timestamp in a link failed + basic validity checks.
+
+ \return A freshly opened \c OggOpusFile, or NULL on error. + libopusfile does not take ownership of the source + if the call fails. + The calling application is responsible for closing the source if + this call returns an error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_open_callbacks(void *_source, + const OpusFileCallbacks *_cb,const unsigned char *_initial_data, + size_t _initial_bytes,int *_error) OP_ARG_NONNULL(2); + +/**Partially open a stream from the given file path. + \see op_test_callbacks + \param _path The path to the file to open. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + The failure code will be #OP_EFAULT if the file could not + be opened, or one of the other failure codes from + op_open_callbacks() otherwise. + \return A partially opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_file(const char *_path,int *_error) + OP_ARG_NONNULL(1); + +/**Partially open a stream from a memory buffer. + \see op_test_callbacks + \param _data The memory buffer to open. + \param _size The number of bytes in the buffer. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + See op_open_callbacks() for a full list of failure codes. + \return A partially opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_memory(const unsigned char *_data, + size_t _size,int *_error); + +/**Partially open a stream from a URL. + This function behaves identically to op_test_url(), except that it + takes a va_list instead of a variable number of arguments. + It does not call the va_end macro, and because it invokes the + va_arg macro, the value of \a _ap is undefined after the call. + \see op_test_url + \see op_test_callbacks + \param _url The URL to open. + Currently only the , , and + schemes are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always + fail. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want + the failure code. + See op_open_callbacks() for a full list of failure + codes. + \param[in,out] _ap A list of the \ref url_options "optional flags" to + use. + This is a variable-length list of options terminated + with NULL. + \return A partially opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_vtest_url(const char *_url, + int *_error,va_list _ap) OP_ARG_NONNULL(1); + +/**Partially open a stream from a URL. + \see op_test_callbacks + \param _url The URL to open. + Currently only the , , and + schemes are supported. + Both and may be disabled at compile + time, in which case opening such URLs will always fail. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want the + failure code. + See op_open_callbacks() for a full list of failure + codes. + \param ... The \ref url_options "optional flags" to use. + This is a variable-length list of options terminated + with NULL. + \return A partially opened \c OggOpusFile, or NULL on error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_url(const char *_url, + int *_error,...) OP_ARG_NONNULL(1); + +/**Partially open a stream using the given set of callbacks to access it. + This tests for Opusness and loads the headers for the first link. + It does not seek (although it tests for seekability). + You can query a partially open stream for the few pieces of basic + information returned by op_serialno(), op_channel_count(), op_head(), and + op_tags() (but only for the first link). + You may also determine if it is seekable via a call to op_seekable(). + You cannot read audio from the stream, seek, get the size or duration, + get information from links other than the first one, or even get the total + number of links until you finish opening the stream with op_test_open(). + If you do not need to do any of these things, you can dispose of it with + op_free() instead. + + This function is provided mostly to simplify porting existing code that used + libvorbisfile. + For new code, you are likely better off using op_test() instead, which + is less resource-intensive, requires less data to succeed, and imposes a + hard limit on the amount of data it examines (important for unseekable + sources, where all such data must be buffered until you are sure of the + stream type). + \param _source The stream to read from (e.g., a FILE *). + \param _cb The callbacks with which to access the stream. + read() must + be implemented. + seek() and + tell() may + be NULL, or may always return -1 to + indicate a source is unseekable, but if + seek() is + implemented and succeeds on a particular source, then + tell() must + also. + close() may + be NULL, but if it is not, it will be + called when the \c OggOpusFile is destroyed by + op_free(). + It will not be called if op_open_callbacks() fails + with an error. + \param _initial_data An initial buffer of data from the start of the + stream. + Applications can read some number of bytes from the + start of the stream to help identify this as an Opus + stream, and then provide them here to allow the + stream to be tested more thoroughly, even if it is + unseekable. + \param _initial_bytes The number of bytes in \a _initial_data. + If the stream is seekable, its current position (as + reported by + tell() + at the start of this function) must be equal to + \a _initial_bytes. + Otherwise, seeking to absolute positions will + generate inconsistent results. + \param[out] _error Returns 0 on success, or a failure code on error. + You may pass in NULL if you don't want + the failure code. + See op_open_callbacks() for a full list of failure + codes. + \return A partially opened \c OggOpusFile, or NULL on error. + libopusfile does not take ownership of the source + if the call fails. + The calling application is responsible for closing the source if + this call returns an error.*/ +OP_WARN_UNUSED_RESULT OggOpusFile *op_test_callbacks(void *_source, + const OpusFileCallbacks *_cb,const unsigned char *_initial_data, + size_t _initial_bytes,int *_error) OP_ARG_NONNULL(2); + +/**Finish opening a stream partially opened with op_test_callbacks() or one of + the associated convenience functions. + If this function fails, you are still responsible for freeing the + \c OggOpusFile with op_free(). + \param _of The \c OggOpusFile to finish opening. + \return 0 on success, or a negative value on error. + \retval #OP_EREAD An underlying read, seek, or tell operation failed + when it should have succeeded. + \retval #OP_EFAULT There was a memory allocation failure, or an + internal library error. + \retval #OP_EIMPL The stream used a feature that is not implemented, + such as an unsupported channel family. + \retval #OP_EINVAL The stream was not partially opened with + op_test_callbacks() or one of the associated + convenience functions. + \retval #OP_ENOTFORMAT The stream contained a link that did not have any + logical Opus streams in it. + \retval #OP_EBADHEADER A required header packet was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An ID header contained an unrecognized version + number. + \retval #OP_EBADLINK We failed to find data we had seen before after + seeking. + \retval #OP_EBADTIMESTAMP The first or last timestamp in a link failed basic + validity checks.*/ +int op_test_open(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Release all memory used by an \c OggOpusFile. + \param _of The \c OggOpusFile to free.*/ +void op_free(OggOpusFile *_of); + +/*@}*/ +/*@}*/ + +/**\defgroup stream_info Stream Information*/ +/*@{*/ +/**\name Functions for obtaining information about streams + + These functions allow you to get basic information about a stream, including + seekability, the number of links (for chained streams), plus the size, + duration, bitrate, header parameters, and meta information for each link + (or, where available, the stream as a whole). + Some of these (size, duration) are only available for seekable streams. + You can also query the current stream position, link, and playback time, + and instantaneous bitrate during playback. + + Some of these functions may be used successfully on the partially open + streams returned by op_test_callbacks() or one of the associated + convenience functions. + Their documention will indicate so explicitly.*/ +/*@{*/ + +/**Returns whether or not the data source being read is seekable. + This is true if +
    +
  1. The seek() and + tell() callbacks are both + non-NULL,
  2. +
  3. The seek() callback was + successfully executed at least once, and
  4. +
  5. The tell() callback was + successfully able to report the position indicator afterwards.
  6. +
+ This function may be called on partially-opened streams. + \param _of The \c OggOpusFile whose seekable status is to be returned. + \return A non-zero value if seekable, and 0 if unseekable.*/ +int op_seekable(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Returns the number of links in this chained stream. + This function may be called on partially-opened streams, but it will always + return 1. + The actual number of links is not known until the stream is fully opened. + \param _of The \c OggOpusFile from which to retrieve the link count. + \return For fully-open seekable sources, this returns the total number of + links in the whole stream. + For partially-open or unseekable sources, this always returns 1.*/ +int op_link_count(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Get the serial number of the given link in a (possibly-chained) Ogg Opus + stream. + This function may be called on partially-opened streams, but it will always + return the serial number of the Opus stream in the first link. + \param _of The \c OggOpusFile from which to retrieve the serial number. + \param _li The index of the link whose serial number should be retrieved. + Use a negative number to get the serial number of the current + link. + \return The serial number of the given link. + If \a _li is greater than the total number of links, this returns + the serial number of the last link. + If the source is not seekable, this always returns the serial number + of the current link.*/ +opus_uint32 op_serialno(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the channel count of the given link in a (possibly-chained) Ogg Opus + stream. + This is equivalent to op_head(_of,_li)->channel_count, but + is provided for convenience. + This function may be called on partially-opened streams, but it will always + return the channel count of the Opus stream in the first link. + \param _of The \c OggOpusFile from which to retrieve the channel count. + \param _li The index of the link whose channel count should be retrieved. + Use a negative number to get the channel count of the current + link. + \return The channel count of the given link. + If \a _li is greater than the total number of links, this returns + the channel count of the last link. + If the source is not seekable, this always returns the channel count + of the current link.*/ +int op_channel_count(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the total (compressed) size of the stream, or of an individual link in + a (possibly-chained) Ogg Opus stream, including all headers and Ogg muxing + overhead. + \param _of The \c OggOpusFile from which to retrieve the compressed size. + \param _li The index of the link whose compressed size should be computed. + Use a negative number to get the compressed size of the entire + stream. + \return The compressed size of the entire stream if \a _li is negative, the + compressed size of link \a _li if it is non-negative, or a negative + value on error. + The compressed size of the entire stream may be smaller than that + of the underlying source if trailing garbage was detected in the + file. + \retval #OP_EINVAL The source is not seekable (so we can't know the length), + \a _li wasn't less than the total number of links in + the stream, or the stream was only partially open.*/ +opus_int64 op_raw_total(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the total PCM length (number of samples at 48 kHz) of the stream, or of + an individual link in a (possibly-chained) Ogg Opus stream. + Users looking for op_time_total() should use op_pcm_total() + instead. + Because timestamps in Opus are fixed at 48 kHz, there is no need for a + separate function to convert this to seconds (and leaving it out avoids + introducing floating point to the API, for those that wish to avoid it). + \param _of The \c OggOpusFile from which to retrieve the PCM offset. + \param _li The index of the link whose PCM length should be computed. + Use a negative number to get the PCM length of the entire stream. + \return The PCM length of the entire stream if \a _li is negative, the PCM + length of link \a _li if it is non-negative, or a negative value on + error. + \retval #OP_EINVAL The source is not seekable (so we can't know the length), + \a _li wasn't less than the total number of links in + the stream, or the stream was only partially open.*/ +ogg_int64_t op_pcm_total(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the ID header information for the given link in a (possibly chained) Ogg + Opus stream. + This function may be called on partially-opened streams, but it will always + return the ID header information of the Opus stream in the first link. + \param _of The \c OggOpusFile from which to retrieve the ID header + information. + \param _li The index of the link whose ID header information should be + retrieved. + Use a negative number to get the ID header information of the + current link. + For an unseekable stream, \a _li is ignored, and the ID header + information for the current link is always returned, if + available. + \return The contents of the ID header for the given link.*/ +const OpusHead *op_head(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Get the comment header information for the given link in a (possibly + chained) Ogg Opus stream. + This function may be called on partially-opened streams, but it will always + return the tags from the Opus stream in the first link. + \param _of The \c OggOpusFile from which to retrieve the comment header + information. + \param _li The index of the link whose comment header information should be + retrieved. + Use a negative number to get the comment header information of + the current link. + For an unseekable stream, \a _li is ignored, and the comment + header information for the current link is always returned, if + available. + \return The contents of the comment header for the given link, or + NULL if this is an unseekable stream that encountered + an invalid link.*/ +const OpusTags *op_tags(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Retrieve the index of the current link. + This is the link that produced the data most recently read by + op_read_float() or its associated functions, or, after a seek, the link + that the seek target landed in. + Reading more data may advance the link index (even on the first read after a + seek). + \param _of The \c OggOpusFile from which to retrieve the current link index. + \return The index of the current link on success, or a negative value on + failure. + For seekable streams, this is a number between 0 and the value + returned by op_link_count(). + For unseekable streams, this value starts at 0 and increments by one + each time a new link is encountered (even though op_link_count() + always returns 1). + \retval #OP_EINVAL The stream was only partially open.*/ +int op_current_link(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Computes the bitrate for a given link in a (possibly chained) Ogg Opus + stream. + The stream must be seekable to compute the bitrate. + For unseekable streams, use op_bitrate_instant() to get periodic estimates. + \param _of The \c OggOpusFile from which to retrieve the bitrate. + \param _li The index of the link whose bitrate should be computed. + USe a negative number to get the bitrate of the whole stream. + \return The bitrate on success, or a negative value on error. + \retval #OP_EINVAL The stream was only partially open, the stream was not + seekable, or \a _li was larger than the number of + links.*/ +opus_int32 op_bitrate(OggOpusFile *_of,int _li) OP_ARG_NONNULL(1); + +/**Compute the instantaneous bitrate, measured as the ratio of bits to playable + samples decoded since a) the last call to op_bitrate_instant(), b) the last + seek, or c) the start of playback, whichever was most recent. + This will spike somewhat after a seek or at the start/end of a chain + boundary, as pre-skip, pre-roll, and end-trimming causes samples to be + decoded but not played. + \param _of The \c OggOpusFile from which to retrieve the bitrate. + \return The bitrate, in bits per second, or a negative value on error. + \retval #OP_FALSE No data has been decoded since any of the events + described above. + \retval #OP_EINVAL The stream was only partially open.*/ +opus_int32 op_bitrate_instant(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Obtain the current value of the position indicator for \a _of. + \param _of The \c OggOpusFile from which to retrieve the position indicator. + \return The byte position that is currently being read from. + \retval #OP_EINVAL The stream was only partially open.*/ +opus_int64 op_raw_tell(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/**Obtain the PCM offset of the next sample to be read. + If the stream is not properly timestamped, this might not increment by the + proper amount between reads, or even return monotonically increasing + values. + \param _of The \c OggOpusFile from which to retrieve the PCM offset. + \return The PCM offset of the next sample to be read. + \retval #OP_EINVAL The stream was only partially open.*/ +ogg_int64_t op_pcm_tell(OggOpusFile *_of) OP_ARG_NONNULL(1); + +/*@}*/ +/*@}*/ + +/**\defgroup stream_seeking Seeking*/ +/*@{*/ +/**\name Functions for seeking in Opus streams + + These functions let you seek in Opus streams, if the underlying source + support it. + Seeking is implemented for all built-in stream I/O routines, though some + individual sources may not be seekable (pipes, live HTTP streams, or HTTP + streams from a server that does not support Range requests). + + op_raw_seek() is the fastest: it is guaranteed to perform at most one + physical seek, but, since the target is a byte position, makes no guarantee + how close to a given time it will come. + op_pcm_seek() provides sample-accurate seeking. + The number of physical seeks it requires is still quite small (often 1 or + 2, even in highly variable bitrate streams). + + Seeking in Opus requires decoding some pre-roll amount before playback to + allow the internal state to converge (as if recovering from packet loss). + This is handled internally by libopusfile, but means there is + little extra overhead for decoding up to the exact position requested + (since it must decode some amount of audio anyway). + It also means that decoding after seeking may not return exactly the same + values as would be obtained by decoding the stream straight through. + However, such differences are expected to be smaller than the loss + introduced by Opus's lossy compression.*/ +/*@{*/ + +/**Seek to a byte offset relative to the compressed data. + This also scans packets to update the PCM cursor. + It will cross a logical bitstream boundary, but only if it can't get any + packets out of the tail of the link to which it seeks. + \param _of The \c OggOpusFile in which to seek. + \param _byte_offset The byte position to seek to. + \return 0 on success, or a negative error code on failure. + \retval #OP_EREAD The underlying seek operation failed. + \retval #OP_EINVAL The stream was only partially open, or the target was + outside the valid range for the stream. + \retval #OP_ENOSEEK This stream is not seekable. + \retval #OP_EBADLINK Failed to initialize a decoder for a stream for an + unknown reason.*/ +int op_raw_seek(OggOpusFile *_of,opus_int64 _byte_offset) OP_ARG_NONNULL(1); + +/**Seek to the specified PCM offset, such that decoding will begin at exactly + the requested position. + \param _of The \c OggOpusFile in which to seek. + \param _pcm_offset The PCM offset to seek to. + This is in samples at 48 kHz relative to the start of the + stream. + \return 0 on success, or a negative value on error. + \retval #OP_EREAD An underlying read or seek operation failed. + \retval #OP_EINVAL The stream was only partially open, or the target was + outside the valid range for the stream. + \retval #OP_ENOSEEK This stream is not seekable. + \retval #OP_EBADLINK We failed to find data we had seen before, or the + bitstream structure was sufficiently malformed that + seeking to the target destination was impossible.*/ +int op_pcm_seek(OggOpusFile *_of,ogg_int64_t _pcm_offset) OP_ARG_NONNULL(1); + +/*@}*/ +/*@}*/ + +/**\defgroup stream_decoding Decoding*/ +/*@{*/ +/**\name Functions for decoding audio data + + These functions retrieve actual decoded audio data from the stream. + The general functions, op_read() and op_read_float() return 16-bit or + floating-point output, both using native endian ordering. + The number of channels returned can change from link to link in a chained + stream. + There are special functions, op_read_stereo() and op_read_float_stereo(), + which always output two channels, to simplify applications which do not + wish to handle multichannel audio. + These downmix multichannel files to two channels, so they can always return + samples in the same format for every link in a chained file. + + If the rest of your audio processing chain can handle floating point, those + routines should be preferred, as floating point output avoids introducing + clipping and other issues which might be avoided entirely if, e.g., you + scale down the volume at some other stage. + However, if you intend to direct consume 16-bit samples, the conversion in + libopusfile provides noise-shaping dithering and, if compiled + against libopus 1.1 or later, soft-clipping prevention. + + libopusfile can also be configured at compile time to use the + fixed-point libopus API. + If so, libopusfile's floating-point API may also be disabled. + In that configuration, nothing in libopusfile will use any + floating-point operations, to simplify support on devices without an + adequate FPU. + + \warning HTTPS streams may be be vulnerable to truncation attacks if you do + not check the error return code from op_read_float() or its associated + functions. + If the remote peer does not close the connection gracefully (with a TLS + "close notify" message), these functions will return OP_EREAD instead of 0 + when they reach the end of the file. + If you are reading from an URL (particularly if seeking is not + supported), you should make sure to check for this error and warn the user + appropriately.*/ +/*@{*/ + +/**Gain offset type that indicates that the provided offset is relative to the + header gain. + This is the default.*/ +#define OP_HEADER_GAIN (0) + +/**Gain offset type that indicates that the provided offset is relative to the + R128_TRACK_GAIN value (if any), in addition to the header gain.*/ +#define OP_TRACK_GAIN (3008) + +/**Gain offset type that indicates that the provided offset should be used as + the gain directly, without applying any the header or track gains.*/ +#define OP_ABSOLUTE_GAIN (3009) + +/**Sets the gain to be used for decoded output. + By default, the gain in the header is applied with no additional offset. + The total gain (including header gain and/or track gain, if applicable, and + this offset), will be clamped to [-32768,32767]/256 dB. + This is more than enough to saturate or underflow 16-bit PCM. + \note The new gain will not be applied to any already buffered, decoded + output. + This means you cannot change it sample-by-sample, as at best it will be + updated packet-by-packet. + It is meant for setting a target volume level, rather than applying smooth + fades, etc. + \param _of The \c OggOpusFile on which to set the gain offset. + \param _gain_type One of #OP_HEADER_GAIN, #OP_TRACK_GAIN, or + #OP_ABSOLUTE_GAIN. + \param _gain_offset_q8 The gain offset to apply, in 1/256ths of a dB. + \return 0 on success or a negative value on error. + \retval #OP_EINVAL The \a _gain_type was unrecognized.*/ +int op_set_gain_offset(OggOpusFile *_of, + int _gain_type,opus_int32 _gain_offset_q8); + +/**Reads more samples from the stream. + \note Although \a _buf_size must indicate the total number of values that + can be stored in \a _pcm, the return value is the number of samples + per channel. + This is done because +
    +
  1. The channel count cannot be known a priori (reading more samples might + advance us into the next link, with a different channel count), so + \a _buf_size cannot also be in units of samples per channel,
  2. +
  3. Returning the samples per channel matches the libopus API + as closely as we're able,
  4. +
  5. Returning the total number of values instead of samples per channel + would mean the caller would need a division to compute the samples per + channel, and might worry about the possibility of getting back samples + for some channels and not others, and
  6. +
  7. This approach is relatively fool-proof: if an application passes too + small a value to \a _buf_size, they will simply get fewer samples back, + and if they assume the return value is the total number of values, then + they will simply read too few (rather than reading too many and going + off the end of the buffer).
  8. +
+ \param _of The \c OggOpusFile from which to read. + \param[out] _pcm A buffer in which to store the output PCM samples, as + signed native-endian 16-bit values at 48 kHz + with a nominal range of [-32768,32767). + Multiple channels are interleaved using the + Vorbis + channel ordering. + This must have room for at least \a _buf_size values. + \param _buf_size The number of values that can be stored in \a _pcm. + It is recommended that this be large enough for at + least 120 ms of data at 48 kHz per channel (5760 + values per channel). + Smaller buffers will simply return less data, possibly + consuming more memory to buffer the data internally. + libopusfile may return less data than + requested. + If so, there is no guarantee that the remaining data + in \a _pcm will be unmodified. + \param[out] _li The index of the link this data was decoded from. + You may pass NULL if you do not need this + information. + If this function fails (returning a negative value), + this parameter is left unset. + \return The number of samples read per channel on success, or a negative + value on failure. + The channel count can be retrieved on success by calling + op_head(_of,*_li). + The number of samples returned may be 0 if the buffer was too small + to store even a single sample for all channels, or if end-of-file + was reached. + The list of possible failure codes follows. + Most of them can only be returned by unseekable, chained streams + that encounter a new link. + \retval #OP_HOLE There was a hole in the data, and some samples + may have been skipped. + Call this function again to continue decoding + past the hole. + \retval #OP_EREAD An underlying read operation failed. + This may signal a truncation attack from an + source. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL An unseekable stream encountered a new link that + used a feature that is not implemented, such as + an unsupported channel family. + \retval #OP_EINVAL The stream was only partially open. + \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that + did not have any logical Opus streams in it. + \retval #OP_EBADHEADER An unseekable stream encountered a new link with a + required header packet that was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An unseekable stream encountered a new link with + an ID header that contained an unrecognized + version number. + \retval #OP_EBADPACKET Failed to properly decode the next packet. + \retval #OP_EBADLINK We failed to find data we had seen before. + \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with + a starting timestamp that failed basic validity + checks.*/ +OP_WARN_UNUSED_RESULT int op_read(OggOpusFile *_of, + opus_int16 *_pcm,int _buf_size,int *_li) OP_ARG_NONNULL(1); + +/**Reads more samples from the stream. + \note Although \a _buf_size must indicate the total number of values that + can be stored in \a _pcm, the return value is the number of samples + per channel. +
    +
  1. The channel count cannot be known a priori (reading more samples might + advance us into the next link, with a different channel count), so + \a _buf_size cannot also be in units of samples per channel,
  2. +
  3. Returning the samples per channel matches the libopus API + as closely as we're able,
  4. +
  5. Returning the total number of values instead of samples per channel + would mean the caller would need a division to compute the samples per + channel, and might worry about the possibility of getting back samples + for some channels and not others, and
  6. +
  7. This approach is relatively fool-proof: if an application passes too + small a value to \a _buf_size, they will simply get fewer samples back, + and if they assume the return value is the total number of values, then + they will simply read too few (rather than reading too many and going + off the end of the buffer).
  8. +
+ \param _of The \c OggOpusFile from which to read. + \param[out] _pcm A buffer in which to store the output PCM samples as + signed floats at 48 kHz with a nominal range of + [-1.0,1.0]. + Multiple channels are interleaved using the + Vorbis + channel ordering. + This must have room for at least \a _buf_size floats. + \param _buf_size The number of floats that can be stored in \a _pcm. + It is recommended that this be large enough for at + least 120 ms of data at 48 kHz per channel (5760 + samples per channel). + Smaller buffers will simply return less data, possibly + consuming more memory to buffer the data internally. + If less than \a _buf_size values are returned, + libopusfile makes no guarantee that the + remaining data in \a _pcm will be unmodified. + \param[out] _li The index of the link this data was decoded from. + You may pass NULL if you do not need this + information. + If this function fails (returning a negative value), + this parameter is left unset. + \return The number of samples read per channel on success, or a negative + value on failure. + The channel count can be retrieved on success by calling + op_head(_of,*_li). + The number of samples returned may be 0 if the buffer was too small + to store even a single sample for all channels, or if end-of-file + was reached. + The list of possible failure codes follows. + Most of them can only be returned by unseekable, chained streams + that encounter a new link. + \retval #OP_HOLE There was a hole in the data, and some samples + may have been skipped. + Call this function again to continue decoding + past the hole. + \retval #OP_EREAD An underlying read operation failed. + This may signal a truncation attack from an + source. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL An unseekable stream encountered a new link that + used a feature that is not implemented, such as + an unsupported channel family. + \retval #OP_EINVAL The stream was only partially open. + \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that + did not have any logical Opus streams in it. + \retval #OP_EBADHEADER An unseekable stream encountered a new link with a + required header packet that was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An unseekable stream encountered a new link with + an ID header that contained an unrecognized + version number. + \retval #OP_EBADPACKET Failed to properly decode the next packet. + \retval #OP_EBADLINK We failed to find data we had seen before. + \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with + a starting timestamp that failed basic validity + checks.*/ +OP_WARN_UNUSED_RESULT int op_read_float(OggOpusFile *_of, + float *_pcm,int _buf_size,int *_li) OP_ARG_NONNULL(1); + +/**Reads more samples from the stream and downmixes to stereo, if necessary. + This function is intended for simple players that want a uniform output + format, even if the channel count changes between links in a chained + stream. + \note \a _buf_size indicates the total number of values that can be stored + in \a _pcm, while the return value is the number of samples per + channel, even though the channel count is known, for consistency with + op_read(). + \param _of The \c OggOpusFile from which to read. + \param[out] _pcm A buffer in which to store the output PCM samples, as + signed native-endian 16-bit values at 48 kHz + with a nominal range of [-32768,32767). + The left and right channels are interleaved in the + buffer. + This must have room for at least \a _buf_size values. + \param _buf_size The number of values that can be stored in \a _pcm. + It is recommended that this be large enough for at + least 120 ms of data at 48 kHz per channel (11520 + values total). + Smaller buffers will simply return less data, possibly + consuming more memory to buffer the data internally. + If less than \a _buf_size values are returned, + libopusfile makes no guarantee that the + remaining data in \a _pcm will be unmodified. + \return The number of samples read per channel on success, or a negative + value on failure. + The number of samples returned may be 0 if the buffer was too small + to store even a single sample for both channels, or if end-of-file + was reached. + The list of possible failure codes follows. + Most of them can only be returned by unseekable, chained streams + that encounter a new link. + \retval #OP_HOLE There was a hole in the data, and some samples + may have been skipped. + Call this function again to continue decoding + past the hole. + \retval #OP_EREAD An underlying read operation failed. + This may signal a truncation attack from an + source. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL An unseekable stream encountered a new link that + used a feature that is not implemented, such as + an unsupported channel family. + \retval #OP_EINVAL The stream was only partially open. + \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that + did not have any logical Opus streams in it. + \retval #OP_EBADHEADER An unseekable stream encountered a new link with a + required header packet that was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An unseekable stream encountered a new link with + an ID header that contained an unrecognized + version number. + \retval #OP_EBADPACKET Failed to properly decode the next packet. + \retval #OP_EBADLINK We failed to find data we had seen before. + \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with + a starting timestamp that failed basic validity + checks.*/ +OP_WARN_UNUSED_RESULT int op_read_stereo(OggOpusFile *_of, + opus_int16 *_pcm,int _buf_size) OP_ARG_NONNULL(1); + +/**Reads more samples from the stream and downmixes to stereo, if necessary. + This function is intended for simple players that want a uniform output + format, even if the channel count changes between links in a chained + stream. + \note \a _buf_size indicates the total number of values that can be stored + in \a _pcm, while the return value is the number of samples per + channel, even though the channel count is known, for consistency with + op_read_float(). + \param _of The \c OggOpusFile from which to read. + \param[out] _pcm A buffer in which to store the output PCM samples, as + signed floats at 48 kHz with a nominal range of + [-1.0,1.0]. + The left and right channels are interleaved in the + buffer. + This must have room for at least \a _buf_size values. + \param _buf_size The number of values that can be stored in \a _pcm. + It is recommended that this be large enough for at + least 120 ms of data at 48 kHz per channel (11520 + values total). + Smaller buffers will simply return less data, possibly + consuming more memory to buffer the data internally. + If less than \a _buf_size values are returned, + libopusfile makes no guarantee that the + remaining data in \a _pcm will be unmodified. + \return The number of samples read per channel on success, or a negative + value on failure. + The number of samples returned may be 0 if the buffer was too small + to store even a single sample for both channels, or if end-of-file + was reached. + The list of possible failure codes follows. + Most of them can only be returned by unseekable, chained streams + that encounter a new link. + \retval #OP_HOLE There was a hole in the data, and some samples + may have been skipped. + Call this function again to continue decoding + past the hole. + \retval #OP_EREAD An underlying read operation failed. + This may signal a truncation attack from an + source. + \retval #OP_EFAULT An internal memory allocation failed. + \retval #OP_EIMPL An unseekable stream encountered a new link that + used a feature that is not implemented, such as + an unsupported channel family. + \retval #OP_EINVAL The stream was only partially open. + \retval #OP_ENOTFORMAT An unseekable stream encountered a new link that + that did not have any logical Opus streams in it. + \retval #OP_EBADHEADER An unseekable stream encountered a new link with a + required header packet that was not properly + formatted, contained illegal values, or was + missing altogether. + \retval #OP_EVERSION An unseekable stream encountered a new link with + an ID header that contained an unrecognized + version number. + \retval #OP_EBADPACKET Failed to properly decode the next packet. + \retval #OP_EBADLINK We failed to find data we had seen before. + \retval #OP_EBADTIMESTAMP An unseekable stream encountered a new link with + a starting timestamp that failed basic validity + checks.*/ +OP_WARN_UNUSED_RESULT int op_read_float_stereo(OggOpusFile *_of, + float *_pcm,int _buf_size) OP_ARG_NONNULL(1); + +/*@}*/ +/*@}*/ + +# if OP_GNUC_PREREQ(4,0) +# pragma GCC visibility pop +# endif + +# if defined(__cplusplus) +} +# endif + +#endif diff --git a/Audio-Frameworks/bin/opusfile/libopusfile.a b/Audio-Frameworks/bin/opusfile/libopusfile.a new file mode 100644 index 0000000..533cdd4 Binary files /dev/null and b/Audio-Frameworks/bin/opusfile/libopusfile.a differ diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Headers b/Audio-Frameworks/bin/taglib/TagLib.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Resources b/Audio-Frameworks/bin/taglib/TagLib.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/TagLib b/Audio-Frameworks/bin/taglib/TagLib.framework/TagLib new file mode 120000 index 0000000..2c050d4 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/TagLib @@ -0,0 +1 @@ +Versions/Current/TagLib \ No newline at end of file diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/aifffile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/aifffile.h new file mode 100644 index 0000000..a50c8ec --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/aifffile.h @@ -0,0 +1,122 @@ +/*************************************************************************** + copyright : (C) 2008 by Scott Wheeler + email : wheeler@kde.org +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_AIFFFILE_H +#define TAGLIB_AIFFFILE_H + +#include "rifffile.h" +#include "id3v2tag.h" +#include "aiffproperties.h" + +namespace TagLib { + + namespace RIFF { + + //! An implementation of AIFF metadata + + /*! + * This is implementation of AIFF metadata. + * + * This supports an ID3v2 tag as well as reading stream from the ID3 RIFF + * chunk as well as properties from the file. + */ + + namespace AIFF { + + //! An implementation of TagLib::File with AIFF specific methods + + /*! + * This implements and provides an interface for AIFF files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to AIFF files. + */ + + class TAGLIB_EXPORT File : public TagLib::RIFF::File + { + public: + /*! + * Contructs an AIFF file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an AIFF file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. + */ + virtual ID3v2::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * This method forwards to ID3v2::Tag::properties(). + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * This method forwards to ID3v2::Tag::setProperties(). + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the AIFF::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Saves the file. + */ + virtual bool save(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + + class FilePrivate; + FilePrivate *d; + }; + } + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/aiffproperties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/aiffproperties.h new file mode 100644 index 0000000..68e90b7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/aiffproperties.h @@ -0,0 +1,83 @@ +/*************************************************************************** + copyright : (C) 2008 by Scott Wheeler + email : wheeler@kde.org +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_AIFFPROPERTIES_H +#define TAGLIB_AIFFPROPERTIES_H + +#include "audioproperties.h" + +namespace TagLib { + + namespace RIFF { + + namespace AIFF { + + class File; + + //! An implementation of audio property reading for AIFF + + /*! + * This reads the data from an AIFF stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of AIFF::Properties with the data read from the + * ByteVector \a data. + */ + Properties(const ByteVector &data, ReadStyle style); + + /*! + * Destroys this AIFF::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + int sampleWidth() const; + uint sampleFrames() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(const ByteVector &data); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apefile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apefile.h new file mode 100644 index 0000000..0bdbd42 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apefile.h @@ -0,0 +1,198 @@ +/*************************************************************************** + copyright : (C) 2010 by Alex Novichkov + email : novichko@atnet.ru + + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + (original WavPack implementation) + + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + (original MPC implementation) + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_APEFILE_H +#define TAGLIB_APEFILE_H + +#include "tfile.h" +#include "taglib_export.h" +#include "apeproperties.h" + +namespace TagLib { + + class Tag; + + namespace ID3v1 { class Tag; } + namespace APE { class Tag; } + + //! An implementation of APE metadata + + /*! + * This is implementation of APE metadata. + * + * This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream + * properties from the file. + */ + + namespace APE { + + //! An implementation of TagLib::File with APE specific methods + + /*! + * This implements and provides an interface APE WavPack files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to APE files. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * This set of flags is used for various operations and is suitable for + * being OR-ed together. + */ + enum TagTypes { + //! Empty set. Matches no tag types. + NoTags = 0x0000, + //! Matches ID3v1 tags. + ID3v1 = 0x0001, + //! Matches APE tags. + APE = 0x0002, + //! Matches all tag types. + AllTags = 0xffff + }; + + /*! + * Contructs an WavPack file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an WavPack file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. This will be an APE tag, an ID3v1 tag + * or a combination of the two. + */ + virtual TagLib::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * If the file contains both an APE and an ID3v1 tag, only APE + * will be converted to the PropertyMap. + */ + PropertyMap properties() const; + + /*! + * Removes unsupported properties. Forwards to the actual Tag's + * removeUnsupportedProperties() function. + */ + void removeUnsupportedProperties(const StringList &properties); + + /*! + * Implements the unified property interface -- import function. + * As for the export, only one tag is taken into account. If the file + * has no tag at all, APE will be created. + */ + PropertyMap setProperties(const PropertyMap &); + /*! + * Returns the APE::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Saves the file. + * + * \note According to the official Monkey's Audio SDK, an APE file + * can only have either ID3V1 or APE tags, so a parameter is used here. + */ + virtual bool save(); + + /*! + * Returns a pointer to the ID3v1 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v1 tag. If \a create is true it will create + * an ID3v1 tag if one does not exist. If there is already an APE tag, the + * new ID3v1 tag will be placed after it. + * + * \note The Tag is still owned by the APE::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v1::Tag *ID3v1Tag(bool create = false); + + /*! + * Returns a pointer to the APE tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid APE tag. If \a create is true it will create + * a APE tag if one does not exist. + * + * \note The Tag is still owned by the APE::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + APE::Tag *APETag(bool create = false); + + /*! + * This will remove the tags that match the OR-ed together TagTypes from the + * file. By default it removes all tags. + * + * \note This will also invalidate pointers to the tags + * as their memory will be freed. + * \note In order to make the removal permanent save() still needs to be called + */ + void strip(int tags = AllTags); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void scan(); + long findID3v1(); + long findAPE(); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apefooter.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apefooter.h new file mode 100644 index 0000000..080f930 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apefooter.h @@ -0,0 +1,173 @@ +/*************************************************************************** + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_APEFOOTER_H +#define TAGLIB_APEFOOTER_H + +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace APE { + + //! An implementation of APE footers + + /*! + * This class implements APE footers (and headers). It attempts to follow, both + * semantically and programatically, the structure specified in + * the APE v2.0 standard. The API is based on the properties of APE footer and + * headers specified there. + */ + + class TAGLIB_EXPORT Footer + { + public: + /*! + * Constructs an empty APE footer. + */ + Footer(); + + /*! + * Constructs an APE footer based on \a data. parse() is called + * immediately. + */ + Footer(const ByteVector &data); + + /*! + * Destroys the footer. + */ + virtual ~Footer(); + + /*! + * Returns the version number. (Note: This is the 1000 or 2000.) + */ + uint version() const; + + /*! + * Returns true if a header is present in the tag. + */ + bool headerPresent() const; + + /*! + * Returns true if a footer is present in the tag. + */ + bool footerPresent() const; + + /*! + * Returns true this is actually the header. + */ + bool isHeader() const; + + /*! + * Sets whether the header should be rendered or not + */ + void setHeaderPresent(bool b) const; + + /*! + * Returns the number of items in the tag. + */ + uint itemCount() const; + + /*! + * Set the item count to \a s. + * \see itemCount() + */ + void setItemCount(uint s); + + /*! + * Returns the tag size in bytes. This is the size of the frame content and footer. + * The size of the \e entire tag will be this plus the header size, if present. + * + * \see completeTagSize() + */ + uint tagSize() const; + + /*! + * Returns the tag size, including if present, the header + * size. + * + * \see tagSize() + */ + uint completeTagSize() const; + + /*! + * Set the tag size to \a s. + * \see tagSize() + */ + void setTagSize(uint s); + + /*! + * Returns the size of the footer. Presently this is always 32 bytes. + */ + static uint size(); + + /*! + * Returns the string used to identify an APE tag inside of a file. + * Presently this is always "APETAGEX". + */ + static ByteVector fileIdentifier(); + + /*! + * Sets the data that will be used as the footer. 32 bytes, + * starting from \a data will be used. + */ + void setData(const ByteVector &data); + + /*! + * Renders the footer back to binary format. + */ + ByteVector renderFooter() const; + + /*! + * Renders the header corresponding to the footer. If headerPresent is + * set to false, it returns an empty ByteVector. + */ + ByteVector renderHeader() const; + + protected: + /*! + * Called by setData() to parse the footer data. It makes this information + * available through the public API. + */ + void parse(const ByteVector &data); + + /*! + * Called by renderFooter and renderHeader + */ + ByteVector render(bool isHeader) const; + + private: + Footer(const Footer &); + Footer &operator=(const Footer &); + + class FooterPrivate; + FooterPrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apeitem.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apeitem.h new file mode 100644 index 0000000..f7fd05e --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apeitem.h @@ -0,0 +1,217 @@ +/*************************************************************************** + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_APEITEM_H +#define TAGLIB_APEITEM_H + +#include "tbytevector.h" +#include "tstring.h" +#include "tstringlist.h" + +namespace TagLib { + + namespace APE { + + //! An implementation of APE-items + + /*! + * This class provides the features of items in the APEv2 standard. + */ + class TAGLIB_EXPORT Item + { + public: + /*! + * Enum of types an Item can have. The value of 3 is reserved. + */ + enum ItemTypes { + //! Item contains text information coded in UTF-8 + Text = 0, + //! Item contains binary information + Binary = 1, + //! Item is a locator of external stored information + Locator = 2 + }; + /*! + * Constructs an empty item. + */ + Item(); + + /*! + * Constructs a text item with \a key and \a value. + */ + // BIC: Remove this, StringList has a constructor from a single string + Item(const String &key, const String &value); + + /*! + * Constructs a text item with \a key and \a values. + */ + Item(const String &key, const StringList &values); + + /*! + * Constructs an item with \a key and \a value. + * If \a binary is true a Binary item will be created, otherwise \a value will be interpreted as text + */ + Item(const String &key, const ByteVector &value, bool binary); + + /*! + * Construct an item as a copy of \a item. + */ + Item(const Item &item); + + /*! + * Destroys the item. + */ + virtual ~Item(); + + /*! + * Copies the contents of \a item into this item. + */ + Item &operator=(const Item &item); + + /*! + * Returns the key. + */ + String key() const; + + /*! + * Returns the binary value. + * If the item type is not \a Binary, the returned contents are undefined + */ + ByteVector binaryData() const; + + /*! + * Set the binary value to \a value + * The item's type will also be set to \a Binary + */ + void setBinaryData(const ByteVector &value); + +#ifndef DO_NOT_DOCUMENT + /* Remove in next binary incompatible release */ + ByteVector value() const; +#endif + + /*! + * Sets the key for the item to \a key. + */ + void setKey(const String &key); + + /*! + * Sets the text value of the item to \a value and clears any previous contents. + * + * \see toString() + */ + void setValue(const String &value); + + /*! + * Sets the text value of the item to the list of values in \a value and clears + * any previous contents. + * + * \see toStringList() + */ + void setValues(const StringList &values); + + /*! + * Appends \a value to create (or extend) the current list of text values. + * + * \see toString() + */ + void appendValue(const String &value); + + /*! + * Appends \a values to extend the current list of text values. + * + * \see toStringList() + */ + void appendValues(const StringList &values); + + /*! + * Returns the size of the full item. + */ + int size() const; + + /*! + * Returns the value as a single string. In case of multiple strings, + * the first is returned. + */ + String toString() const; + +#ifndef DO_NOT_DOCUMENT + /* Remove in next binary incompatible release */ + StringList toStringList() const; +#endif + + /*! + * Returns the list of text values. + */ + StringList values() const; + + /*! + * Render the item to a ByteVector. + */ + ByteVector render() const; + + /*! + * Parse the item from the ByteVector \a data. + */ + void parse(const ByteVector& data); + + /*! + * Set the item to read-only. + */ + void setReadOnly(bool readOnly); + + /*! + * Return true if the item is read-only. + */ + bool isReadOnly() const; + + /*! + * Sets the type of the item to \a type. + * + * \see ItemTypes + */ + void setType(ItemTypes type); + + /*! + * Returns the type of the item. + */ + ItemTypes type() const; + + /*! + * Returns if the item has any real content. + */ + bool isEmpty() const; + + private: + class ItemPrivate; + ItemPrivate *d; + }; + } + +} + +#endif + + diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apeproperties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apeproperties.h new file mode 100644 index 0000000..f154ec3 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apeproperties.h @@ -0,0 +1,99 @@ +/*************************************************************************** + copyright : (C) 2010 by Alex Novichkov + email : novichko@atnet.ru + + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + (original WavPack implementation) + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_APEPROPERTIES_H +#define TAGLIB_APEPROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + + namespace APE { + + class File; + + //! An implementation of audio property reading for APE + + /*! + * This reads the data from an APE stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of APE::Properties with the data read from the + * ByteVector \a data. + */ + Properties(File *f, ReadStyle style = Average); + + /*! + * Destroys this APE::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns number of bits per sample. + */ + int bitsPerSample() const; + uint sampleFrames() const; + + /*! + * Returns APE version. + */ + int version() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + + long findDescriptor(); + long findID3v2(); + + void analyzeCurrent(); + void analyzeOld(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apetag.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apetag.h new file mode 100644 index 0000000..1a8c30c --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/apetag.h @@ -0,0 +1,201 @@ +/*************************************************************************** + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_APETAG_H +#define TAGLIB_APETAG_H + +#include "tag.h" +#include "tbytevector.h" +#include "tmap.h" +#include "tstring.h" +#include "taglib_export.h" + +#include "apeitem.h" + +namespace TagLib { + + class File; + + //! An implementation of the APE tagging format + + namespace APE { + + class Footer; + + /*! + * A mapping between a list of item names, or keys, and the associated item. + * + * \see APE::Tag::itemListMap() + */ + typedef Map ItemListMap; + + + //! An APE tag implementation + + class TAGLIB_EXPORT Tag : public TagLib::Tag + { + public: + /*! + * Create an APE tag with default values. + */ + Tag(); + + /*! + * Create an APE tag and parse the data in \a file with APE footer at + * \a tagOffset. + */ + Tag(TagLib::File *file, long footerLocation); + + /*! + * Destroys this Tag instance. + */ + virtual ~Tag(); + + /*! + * Renders the in memory values to a ByteVector suitable for writing to + * the file. + */ + ByteVector render() const; + + /*! + * Returns the string "APETAGEX" suitable for usage in locating the tag in a + * file. + */ + static ByteVector fileIdentifier(); + + // Reimplementations. + + virtual String title() const; + virtual String artist() const; + virtual String album() const; + virtual String comment() const; + virtual String genre() const; + virtual uint year() const; + virtual uint track() const; + + virtual void setTitle(const String &s); + virtual void setArtist(const String &s); + virtual void setAlbum(const String &s); + virtual void setComment(const String &s); + virtual void setGenre(const String &s); + virtual void setYear(uint i); + virtual void setTrack(uint i); + + /*! + * Implements the unified tag dictionary interface -- export function. + * APE tags are perfectly compatible with the dictionary interface because they + * support both arbitrary tag names and multiple values. Currently only + * APE items of type *Text* are handled by the dictionary interface; all *Binary* + * and *Locator* items will be put into the unsupportedData list and can be + * deleted on request using removeUnsupportedProperties(). The same happens + * to Text items if their key is invalid for PropertyMap (which should actually + * never happen). + * + * The only conversion done by this export function is to rename the APE tags + * TRACK to TRACKNUMBER, YEAR to DATE, and ALBUM ARTIST to ALBUMARTIST, respectively, + * in order to be compliant with the names used in other formats. + */ + PropertyMap properties() const; + + void removeUnsupportedProperties(const StringList &properties); + + /*! + * Implements the unified tag dictionary interface -- import function. The same + * comments as for the export function apply. + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns a pointer to the tag's footer. + */ + Footer *footer() const; + + /*! + * Returns a reference to the item list map. This is an ItemListMap of + * all of the items in the tag. + * + * This is the most powerfull structure for accessing the items of the tag. + * + * APE tags are case-insensitive, all keys in this map have been converted + * to upper case. + * + * \warning You should not modify this data structure directly, instead + * use setItem() and removeItem(). + */ + const ItemListMap &itemListMap() const; + + /*! + * Removes the \a key item from the tag + */ + void removeItem(const String &key); + + /*! + * Adds to the text item specified by \a key the data \a value. If \a replace + * is true, then all of the other values on the same key will be removed + * first. If a binary item exists for \a key it will be removed first. + */ + void addValue(const String &key, const String &value, bool replace = true); + + /*! + * Set the binary data for the key specified by \a item to \a value + * This will convert the item to type \a Binary if it isn't already and + * all of the other values on the same key will be removed. + */ + void setData(const String &key, const ByteVector &value); + + /*! + * Sets the \a key item to the value of \a item. If an item with the \a key is already + * present, it will be replaced. + */ + void setItem(const String &key, const Item &item); + + /*! + * Returns true if the tag does not contain any data. + */ + bool isEmpty() const; + + protected: + + /*! + * Reads from the file specified in the constructor. + */ + void read(); + + /*! + * Parses the body of the tag in \a data. + */ + void parse(const ByteVector &data); + + private: + Tag(const Tag &); + Tag &operator=(const Tag &); + + class TagPrivate; + TagPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asfattribute.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asfattribute.h new file mode 100644 index 0000000..54eb0c7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asfattribute.h @@ -0,0 +1,203 @@ +/************************************************************************** + copyright : (C) 2005-2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ASFATTRIBUTE_H +#define TAGLIB_ASFATTRIBUTE_H + +#include "tstring.h" +#include "tbytevector.h" +#include "taglib_export.h" +#include "asfpicture.h" + +namespace TagLib +{ + + namespace ASF + { + + class File; + class Picture; + + class TAGLIB_EXPORT Attribute + { + public: + + /*! + * Enum of types an Attribute can have. + */ + enum AttributeTypes { + UnicodeType = 0, + BytesType = 1, + BoolType = 2, + DWordType = 3, + QWordType = 4, + WordType = 5, + GuidType = 6 + }; + + /*! + * Constructs an empty attribute. + */ + Attribute(); + + /*! + * Constructs an attribute with \a key and a UnicodeType \a value. + */ + Attribute(const String &value); + + /*! + * Constructs an attribute with \a key and a BytesType \a value. + */ + Attribute(const ByteVector &value); + + /*! + * Constructs an attribute with \a key and a Picture \a value. + * + * This attribute is compatible with the ID3 frame, APIC. The ID3 specification for the APIC frame stipulates that, + * while there may be any number of APIC frames associated with a file, + * only one may be of type 1 and only one may be of type 2. + * + * The specification also states that the description of the picture can be no longer than 64 characters, but can be empty. + * WM/Picture attributes added with TagLib::ASF are not automatically validated to conform to ID3 specifications. + * You must add code in your application to perform validations if you want to maintain complete compatibility with ID3. + */ + Attribute(const Picture &value); + + /*! + * Constructs an attribute with \a key and a DWordType \a value. + */ + Attribute(unsigned int value); + + /*! + * Constructs an attribute with \a key and a QWordType \a value. + */ + Attribute(unsigned long long value); + + /*! + * Constructs an attribute with \a key and a WordType \a value. + */ + Attribute(unsigned short value); + + /*! + * Constructs an attribute with \a key and a BoolType \a value. + */ + Attribute(bool value); + + /*! + * Construct an attribute as a copy of \a other. + */ + Attribute(const Attribute &item); + + /*! + * Copies the contents of \a other into this item. + */ + ASF::Attribute &operator=(const Attribute &other); + + /*! + * Destroys the attribute. + */ + virtual ~Attribute(); + + /*! + * Returns type of the value. + */ + AttributeTypes type() const; + + /*! + * Returns the BoolType \a value. + */ + unsigned short toBool() const; + + /*! + * Returns the WordType \a value. + */ + unsigned short toUShort() const; + + /*! + * Returns the DWordType \a value. + */ + unsigned int toUInt() const; + + /*! + * Returns the QWordType \a value. + */ + unsigned long long toULongLong() const; + + /*! + * Returns the UnicodeType \a value. + */ + String toString() const; + + /*! + * Returns the BytesType \a value. + */ + ByteVector toByteVector() const; + + /*! + * Returns the Picture \a value. + */ + Picture toPicture() const; + + /*! + * Returns the language number, or 0 is no stream number was set. + */ + int language() const; + + /*! + * Sets the language number. + */ + void setLanguage(int value); + + /*! + * Returns the stream number, or 0 is no stream number was set. + */ + int stream() const; + + /*! + * Sets the stream number. + */ + void setStream(int value); + +#ifndef DO_NOT_DOCUMENT + /* THIS IS PRIVATE, DON'T TOUCH IT! */ + String parse(ASF::File &file, int kind = 0); +#endif + + //! Returns the size of the stored data + int dataSize() const; + + private: + friend class File; + + ByteVector render(const String &name, int kind = 0) const; + + class AttributePrivate; + AttributePrivate *d; + }; + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asffile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asffile.h new file mode 100644 index 0000000..f0acd72 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asffile.h @@ -0,0 +1,130 @@ +/************************************************************************** + copyright : (C) 2005-2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ASFFILE_H +#define TAGLIB_ASFFILE_H + +#include "tag.h" +#include "tfile.h" +#include "taglib_export.h" +#include "asfproperties.h" +#include "asftag.h" + +namespace TagLib { + + //! An implementation of ASF (WMA) metadata + namespace ASF { + + /*! + * This implements and provides an interface for ASF files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to ASF files. + */ + class TAGLIB_EXPORT File : public TagLib::File + { + public: + + /*! + * Contructs an ASF file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \note In the current implementation, both \a readProperties and + * \a propertiesStyle are ignored. + */ + File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an ASF file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \note In the current implementation, both \a readProperties and + * \a propertiesStyle are ignored. + */ + File(IOStream *stream, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns a pointer to the ASF tag of the file. + * + * ASF::Tag implements the tag interface, so this serves as the + * reimplementation of TagLib::File::tag(). + * + * \note The Tag is still owned by the ASF::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + virtual Tag *tag() const; + + /*! + * Returns the ASF audio properties for this file. + */ + virtual Properties *audioProperties() const; + + /*! + * Save the file. + * + * This returns true if the save was successful. + */ + virtual bool save(); + + private: + + int readBYTE(bool *ok = 0); + int readWORD(bool *ok = 0); + unsigned int readDWORD(bool *ok = 0); + long long readQWORD(bool *ok = 0); + static ByteVector renderString(const String &str, bool includeLength = false); + String readString(int len); + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + + friend class Attribute; + friend class Picture; + + class BaseObject; + class UnknownObject; + class FilePropertiesObject; + class StreamPropertiesObject; + class ContentDescriptionObject; + class ExtendedContentDescriptionObject; + class HeaderExtensionObject; + class MetadataObject; + class MetadataLibraryObject; + + class FilePrivate; + FilePrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asfpicture.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asfpicture.h new file mode 100644 index 0000000..aa0a060 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asfpicture.h @@ -0,0 +1,217 @@ +/************************************************************************** + copyright : (C) 2010 by Anton Sergunov + email : setosha@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef ASFPICTURE_H +#define ASFPICTURE_H + +#include "tstring.h" +#include "tbytevector.h" +#include "taglib_export.h" +#include "attachedpictureframe.h" + +namespace TagLib +{ + namespace ASF + { + + //! An ASF attached picture interface implementation + + /*! + * This is an implementation of ASF attached pictures interface. Pictures may be + * included in attributes, one per WM/Picture attribute (but there may be multiple WM/Picture + * attribute in a single tag). These pictures are usually in either JPEG or + * PNG format. + * \see Attribute::toPicture() + * \see Attribute::Attribute(const Picture& picture) + */ + class TAGLIB_EXPORT Picture { + public: + + /*! + * This describes the function or content of the picture. + */ + enum Type { + //! A type not enumerated below + Other = 0x00, + //! 32x32 PNG image that should be used as the file icon + FileIcon = 0x01, + //! File icon of a different size or format + OtherFileIcon = 0x02, + //! Front cover image of the album + FrontCover = 0x03, + //! Back cover image of the album + BackCover = 0x04, + //! Inside leaflet page of the album + LeafletPage = 0x05, + //! Image from the album itself + Media = 0x06, + //! Picture of the lead artist or soloist + LeadArtist = 0x07, + //! Picture of the artist or performer + Artist = 0x08, + //! Picture of the conductor + Conductor = 0x09, + //! Picture of the band or orchestra + Band = 0x0A, + //! Picture of the composer + Composer = 0x0B, + //! Picture of the lyricist or text writer + Lyricist = 0x0C, + //! Picture of the recording location or studio + RecordingLocation = 0x0D, + //! Picture of the artists during recording + DuringRecording = 0x0E, + //! Picture of the artists during performance + DuringPerformance = 0x0F, + //! Picture from a movie or video related to the track + MovieScreenCapture = 0x10, + //! Picture of a large, coloured fish + ColouredFish = 0x11, + //! Illustration related to the track + Illustration = 0x12, + //! Logo of the band or performer + BandLogo = 0x13, + //! Logo of the publisher (record company) + PublisherLogo = 0x14 + }; + + /*! + * Constructs an empty picture. + */ + Picture(); + + /*! + * Construct an picture as a copy of \a other. + */ + Picture(const Picture& other); + + /*! + * Destroys the picture. + */ + virtual ~Picture(); + + /*! + * Copies the contents of \a other into this picture. + */ + Picture& operator=(const Picture& other); + + /*! + * Returns true if Picture stores valid picture + */ + bool isValid() const; + + /*! + * Returns the mime type of the image. This should in most cases be + * "image/png" or "image/jpeg". + * \see setMimeType(const String &) + * \see picture() + * \see setPicture(const ByteArray&) + */ + String mimeType() const; + + /*! + * Sets the mime type of the image. This should in most cases be + * "image/png" or "image/jpeg". + * \see setMimeType(const String &) + * \see picture() + * \see setPicture(const ByteArray&) + */ + void setMimeType(const String &value); + + /*! + * Returns the type of the image. + * + * \see Type + * \see setType() + */ + Type type() const; + + /*! + * Sets the type for the image. + * + * \see Type + * \see type() + */ + void setType(const ASF::Picture::Type& t); + + /*! + * Returns a text description of the image. + * + * \see setDescription() + */ + String description() const; + + /*! + * Sets a textual description of the image to \a desc. + * + * \see description() + */ + void setDescription(const String &desc); + + /*! + * Returns the image data as a ByteVector. + * + * \note ByteVector has a data() method that returns a const char * which + * should make it easy to export this data to external programs. + * + * \see setPicture() + * \see mimeType() + */ + ByteVector picture() const; + + /*! + * Sets the image data to \a p. \a p should be of the type specified in + * this frame's mime-type specification. + * + * \see picture() + * \see mimeType() + * \see setMimeType() + */ + void setPicture(const ByteVector &p); + + /*! + * Returns picture as binary raw data \a value + */ + ByteVector render() const; + + /*! + * Returns picture as binary raw data \a value + */ + int dataSize() const; + +#ifndef DO_NOT_DOCUMENT + /* THIS IS PRIVATE, DON'T TOUCH IT! */ + void parse(const ByteVector& ); + static Picture fromInvalid(); + friend class Attribute; +#endif + private: + class PicturePrivate; + PicturePrivate *d; + }; + } +} + +#endif // ASFPICTURE_H diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asfproperties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asfproperties.h new file mode 100644 index 0000000..95730d8 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asfproperties.h @@ -0,0 +1,76 @@ +/************************************************************************** + copyright : (C) 2005-2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ASFPROPERTIES_H +#define TAGLIB_ASFPROPERTIES_H + +#include "audioproperties.h" +#include "tstring.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ASF { + + //! An implementation of ASF audio properties + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + + /*! + * Create an instance of ASF::Properties. + */ + Properties(); + + /*! + * Destroys this ASF::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + bool isEncrypted() const; + +#ifndef DO_NOT_DOCUMENT + void setLength(int value); + void setBitrate(int value); + void setSampleRate(int value); + void setChannels(int value); + void setEncrypted(bool value); +#endif + + private: + class PropertiesPrivate; + PropertiesPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asftag.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asftag.h new file mode 100644 index 0000000..6b2d2bf --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/asftag.h @@ -0,0 +1,186 @@ +/************************************************************************** + copyright : (C) 2005-2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ASFTAG_H +#define TAGLIB_ASFTAG_H + +#include "tag.h" +#include "tlist.h" +#include "tmap.h" +#include "taglib_export.h" +#include "asfattribute.h" + +namespace TagLib { + + namespace ASF { + + typedef List AttributeList; + typedef Map AttributeListMap; + + class TAGLIB_EXPORT Tag : public TagLib::Tag { + + friend class File; + + public: + + Tag(); + + virtual ~Tag(); + + /*! + * Returns the track name. + */ + virtual String title() const; + + /*! + * Returns the artist name. + */ + virtual String artist() const; + + /*! + * Returns the album name; if no album name is present in the tag + * String::null will be returned. + */ + virtual String album() const; + + /*! + * Returns the track comment. + */ + virtual String comment() const; + + /*! + * Returns the genre name; if no genre is present in the tag String::null + * will be returned. + */ + virtual String genre() const; + + /*! + * Returns the rating. + */ + virtual String rating() const; + + /*! + * Returns the genre name; if no genre is present in the tag String::null + * will be returned. + */ + virtual String copyright() const; + + /*! + * Returns the year; if there is no year set, this will return 0. + */ + virtual uint year() const; + + /*! + * Returns the track number; if there is no track number set, this will + * return 0. + */ + virtual uint track() const; + + /*! + * Sets the title to \a s. + */ + virtual void setTitle(const String &s); + + /*! + * Sets the artist to \a s. + */ + virtual void setArtist(const String &s); + + /*! + * Sets the album to \a s. If \a s is String::null then this value will be + * cleared. + */ + virtual void setAlbum(const String &s); + + /*! + * Sets the comment to \a s. + */ + virtual void setComment(const String &s); + + /*! + * Sets the rating to \a s. + */ + virtual void setRating(const String &s); + + /*! + * Sets the copyright to \a s. + */ + virtual void setCopyright(const String &s); + + /*! + * Sets the genre to \a s. + */ + virtual void setGenre(const String &s); + + /*! + * Sets the year to \a i. If \a s is 0 then this value will be cleared. + */ + virtual void setYear(uint i); + + /*! + * Sets the track to \a i. If \a s is 0 then this value will be cleared. + */ + virtual void setTrack(uint i); + + /*! + * Returns true if the tag does not contain any data. This should be + * reimplemented in subclasses that provide more than the basic tagging + * abilities in this class. + */ + virtual bool isEmpty() const; + + /*! + * Returns a reference to the item list map. This is an AttributeListMap of + * all of the items in the tag. + * + * This is the most powerfull structure for accessing the items of the tag. + */ + AttributeListMap &attributeListMap(); + + /*! + * Removes the \a key attribute from the tag + */ + void removeItem(const String &name); + + /*! + * Sets the \a key attribute to the value of \a attribute. If an attribute + * with the \a key is already present, it will be replaced. + */ + void setAttribute(const String &name, const Attribute &attribute); + + /*! + * Sets the \a key attribute to the value of \a attribute. If an attribute + * with the \a key is already present, it will be added to the list. + */ + void addAttribute(const String &name, const Attribute &attribute); + + private: + + class TagPrivate; + TagPrivate *d; + }; + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/attachedpictureframe.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/attachedpictureframe.h new file mode 100644 index 0000000..55067bd --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/attachedpictureframe.h @@ -0,0 +1,230 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ATTACHEDPICTUREFRAME_H +#define TAGLIB_ATTACHEDPICTUREFRAME_H + +#include "id3v2frame.h" +#include "id3v2header.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An ID3v2 attached picture frame implementation + + /*! + * This is an implementation of ID3v2 attached pictures. Pictures may be + * included in tags, one per APIC frame (but there may be multiple APIC + * frames in a single tag). These pictures are usually in either JPEG or + * PNG format. + */ + + class TAGLIB_EXPORT AttachedPictureFrame : public Frame + { + friend class FrameFactory; + + public: + + /*! + * This describes the function or content of the picture. + */ + enum Type { + //! A type not enumerated below + Other = 0x00, + //! 32x32 PNG image that should be used as the file icon + FileIcon = 0x01, + //! File icon of a different size or format + OtherFileIcon = 0x02, + //! Front cover image of the album + FrontCover = 0x03, + //! Back cover image of the album + BackCover = 0x04, + //! Inside leaflet page of the album + LeafletPage = 0x05, + //! Image from the album itself + Media = 0x06, + //! Picture of the lead artist or soloist + LeadArtist = 0x07, + //! Picture of the artist or performer + Artist = 0x08, + //! Picture of the conductor + Conductor = 0x09, + //! Picture of the band or orchestra + Band = 0x0A, + //! Picture of the composer + Composer = 0x0B, + //! Picture of the lyricist or text writer + Lyricist = 0x0C, + //! Picture of the recording location or studio + RecordingLocation = 0x0D, + //! Picture of the artists during recording + DuringRecording = 0x0E, + //! Picture of the artists during performance + DuringPerformance = 0x0F, + //! Picture from a movie or video related to the track + MovieScreenCapture = 0x10, + //! Picture of a large, coloured fish + ColouredFish = 0x11, + //! Illustration related to the track + Illustration = 0x12, + //! Logo of the band or performer + BandLogo = 0x13, + //! Logo of the publisher (record company) + PublisherLogo = 0x14 + }; + + /*! + * Constructs an empty picture frame. The description, content and text + * encoding should be set manually. + */ + AttachedPictureFrame(); + + /*! + * Constructs an AttachedPicture frame based on \a data. + */ + explicit AttachedPictureFrame(const ByteVector &data); + + /*! + * Destroys the AttahcedPictureFrame instance. + */ + virtual ~AttachedPictureFrame(); + + /*! + * Returns a string containing the description and mime-type + */ + virtual String toString() const; + + /*! + * Returns the text encoding used for the description. + * + * \see setTextEncoding() + * \see description() + */ + String::Type textEncoding() const; + + /*! + * Set the text encoding used for the description. + * + * \see description() + */ + void setTextEncoding(String::Type t); + + /*! + * Returns the mime type of the image. This should in most cases be + * "image/png" or "image/jpeg". + */ + String mimeType() const; + + /*! + * Sets the mime type of the image. This should in most cases be + * "image/png" or "image/jpeg". + */ + void setMimeType(const String &m); + + /*! + * Returns the type of the image. + * + * \see Type + * \see setType() + */ + Type type() const; + + /*! + * Sets the type for the image. + * + * \see Type + * \see type() + */ + void setType(Type t); + + /*! + * Returns a text description of the image. + * + * \see setDescription() + * \see textEncoding() + * \see setTextEncoding() + */ + + String description() const; + + /*! + * Sets a textual description of the image to \a desc. + * + * \see description() + * \see textEncoding() + * \see setTextEncoding() + */ + + void setDescription(const String &desc); + + /*! + * Returns the image data as a ByteVector. + * + * \note ByteVector has a data() method that returns a const char * which + * should make it easy to export this data to external programs. + * + * \see setPicture() + * \see mimeType() + */ + ByteVector picture() const; + + /*! + * Sets the image data to \a p. \a p should be of the type specified in + * this frame's mime-type specification. + * + * \see picture() + * \see mimeType() + * \see setMimeType() + */ + void setPicture(const ByteVector &p); + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + class AttachedPictureFramePrivate; + AttachedPictureFramePrivate *d; + + private: + AttachedPictureFrame(const AttachedPictureFrame &); + AttachedPictureFrame &operator=(const AttachedPictureFrame &); + AttachedPictureFrame(const ByteVector &data, Header *h); + + }; + + //! support for ID3v2.2 PIC frames + class TAGLIB_EXPORT AttachedPictureFrameV22 : public AttachedPictureFrame + { + protected: + virtual void parseFields(const ByteVector &data); + private: + AttachedPictureFrameV22(const ByteVector &data, Header *h); + friend class FrameFactory; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/audioproperties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/audioproperties.h new file mode 100644 index 0000000..e9844fa --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/audioproperties.h @@ -0,0 +1,110 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_AUDIOPROPERTIES_H +#define TAGLIB_AUDIOPROPERTIES_H + +#include "taglib_export.h" + +namespace TagLib { + + //! A simple, abstract interface to common audio properties + + /*! + * The values here are common to most audio formats. For more specific, codec + * dependant values, please see see the subclasses APIs. This is meant to + * compliment the TagLib::File and TagLib::Tag APIs in providing a simple + * interface that is sufficient for most applications. + */ + + class TAGLIB_EXPORT AudioProperties + { + public: + + /*! + * Reading audio properties from a file can sometimes be very time consuming + * and for the most accurate results can often involve reading the entire + * file. Because in many situations speed is critical or the accuracy of the + * values is not particularly important this allows the level of desired + * accuracy to be set. + */ + enum ReadStyle { + //! Read as little of the file as possible + Fast, + //! Read more of the file and make better values guesses + Average, + //! Read as much of the file as needed to report accurate values + Accurate + }; + + /*! + * Destroys this AudioProperties instance. + */ + virtual ~AudioProperties(); + + /*! + * Returns the length of the file in seconds. + */ + virtual int length() const = 0; + + /*! + * Returns the most appropriate bit rate for the file in kb/s. For constant + * bitrate formats this is simply the bitrate of the file. For variable + * bitrate formats this is either the average or nominal bitrate. + */ + virtual int bitrate() const = 0; + + /*! + * Returns the sample rate in Hz. + */ + virtual int sampleRate() const = 0; + + /*! + * Returns the number of audio channels. + */ + virtual int channels() const = 0; + + protected: + + /*! + * Construct an audio properties instance. This is protected as this class + * should not be instantiated directly, but should be instantiated via its + * subclasses and can be fetched from the FileRef or File APIs. + * + * \see ReadStyle + */ + AudioProperties(ReadStyle style); + + private: + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); + + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; + }; + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/commentsframe.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/commentsframe.h new file mode 100644 index 0000000..f65f6f0 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/commentsframe.h @@ -0,0 +1,179 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_COMMENTSFRAME_H +#define TAGLIB_COMMENTSFRAME_H + +#include "id3v2frame.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An implementation of ID3v2 comments + + /*! + * This implements the ID3v2 comment format. An ID3v2 comment concists of + * a language encoding, a description and a single text field. + */ + + class TAGLIB_EXPORT CommentsFrame : public Frame + { + friend class FrameFactory; + + public: + /*! + * Construct an empty comment frame that will use the text encoding + * \a encoding. + */ + explicit CommentsFrame(String::Type encoding = String::Latin1); + + /*! + * Construct a comment based on the data in \a data. + */ + explicit CommentsFrame(const ByteVector &data); + + /*! + * Destroys this CommentFrame instance. + */ + virtual ~CommentsFrame(); + + /*! + * Returns the text of this comment. + * + * \see text() + */ + virtual String toString() const; + + /*! + * Returns the language encoding as a 3 byte encoding as specified by + * ISO-639-2. + * + * \note Most taggers simply ignore this value. + * + * \see setLanguage() + */ + ByteVector language() const; + + /*! + * Returns the description of this comment. + * + * \note Most taggers simply ignore this value. + * + * \see setDescription() + */ + String description() const; + + /*! + * Returns the text of this comment. + * + * \see setText() + */ + String text() const; + + /*! + * Set the language using the 3 byte language code from + * ISO-639-2 to + * \a languageCode. + * + * \see language() + */ + void setLanguage(const ByteVector &languageCode); + + /*! + * Sets the description of the comment to \a s. + * + * \see decription() + */ + void setDescription(const String &s); + + /*! + * Sets the text portion of the comment to \a s. + * + * \see text() + */ + virtual void setText(const String &s); + + /*! + * Returns the text encoding that will be used in rendering this frame. + * This defaults to the type that was either specified in the constructor + * or read from the frame when parsed. + * + * \see setTextEncoding() + * \see render() + */ + String::Type textEncoding() const; + + /*! + * Sets the text encoding to be used when rendering this frame to + * \a encoding. + * + * \see textEncoding() + * \see render() + */ + void setTextEncoding(String::Type encoding); + + /*! + * Parses this frame as PropertyMap with a single key. + * - if description() is empty or "COMMENT", the key will be "COMMENT" + * - if description() is not a valid PropertyMap key, the frame will be + * marked unsupported by an entry "COMM/" in the unsupportedData() + * attribute of the returned map. + * - otherwise, the key will be "COMMENT:" + * - The single value will be the frame's text(). + */ + PropertyMap asProperties() const; + + /*! + * Comments each have a unique description. This searches for a comment + * frame with the decription \a d and returns a pointer to it. If no + * frame is found that matches the given description null is returned. + * + * \see description() + */ + static CommentsFrame *findByDescription(const Tag *tag, const String &d); + + protected: + // Reimplementations. + + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + /*! + * The constructor used by the FrameFactory. + */ + CommentsFrame(const ByteVector &data, Header *h); + CommentsFrame(const CommentsFrame &); + CommentsFrame &operator=(const CommentsFrame &); + + class CommentsFramePrivate; + CommentsFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/fileref.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/fileref.h new file mode 100644 index 0000000..0f0c21a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/fileref.h @@ -0,0 +1,263 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FILEREF_H +#define TAGLIB_FILEREF_H + +#include "tfile.h" +#include "tstringlist.h" + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + + class Tag; + + //! This class provides a simple abstraction for creating and handling files + + /*! + * FileRef exists to provide a minimal, generic and value-based wrapper around + * a File. It is lightweight and implicitly shared, and as such suitable for + * pass-by-value use. This hides some of the uglier details of TagLib::File + * and the non-generic portions of the concrete file implementations. + * + * This class is useful in a "simple usage" situation where it is desirable + * to be able to get and set some of the tag information that is similar + * across file types. + * + * Also note that it is probably a good idea to plug this into your mime + * type system rather than using the constructor that accepts a file name using + * the FileTypeResolver. + * + * \see FileTypeResolver + * \see addFileTypeResolver() + */ + + class TAGLIB_EXPORT FileRef + { + public: + + //! A class for pluggable file type resolution. + + /*! + * This class is used to add extend TagLib's very basic file name based file + * type resolution. + * + * This can be accomplished with: + * + * \code + * + * class MyFileTypeResolver : FileTypeResolver + * { + * TagLib::File *createFile(TagLib::FileName *fileName, bool, AudioProperties::ReadStyle) + * { + * if(someCheckForAnMP3File(fileName)) + * return new TagLib::MPEG::File(fileName); + * return 0; + * } + * } + * + * FileRef::addFileTypeResolver(new MyFileTypeResolver); + * + * \endcode + * + * Naturally a less contrived example would be slightly more complex. This + * can be used to plug in mime-type detection systems or to add new file types + * to TagLib. + */ + + class TAGLIB_EXPORT FileTypeResolver + { + TAGLIB_IGNORE_MISSING_DESTRUCTOR + public: + /*! + * This method must be overridden to provide an additional file type + * resolver. If the resolver is able to determine the file type it should + * return a valid File object; if not it should return 0. + * + * \note The created file is then owned by the FileRef and should not be + * deleted. Deletion will happen automatically when the FileRef passes + * out of scope. + */ + virtual File *createFile(FileName fileName, + bool readAudioProperties = true, + AudioProperties::ReadStyle + audioPropertiesStyle = AudioProperties::Average) const = 0; + }; + + /*! + * Creates a null FileRef. + */ + FileRef(); + + /*! + * Create a FileRef from \a fileName. If \a readAudioProperties is true then + * the audio properties will be read using \a audioPropertiesStyle. If + * \a readAudioProperties is false then \a audioPropertiesStyle will be + * ignored. + * + * Also see the note in the class documentation about why you may not want to + * use this method in your application. + */ + explicit FileRef(FileName fileName, + bool readAudioProperties = true, + AudioProperties::ReadStyle + audioPropertiesStyle = AudioProperties::Average); + + /*! + * Contruct a FileRef using \a file. The FileRef now takes ownership of the + * pointer and will delete the File when it passes out of scope. + */ + explicit FileRef(File *file); + + /*! + * Make a copy of \a ref. + */ + FileRef(const FileRef &ref); + + /*! + * Destroys this FileRef instance. + */ + virtual ~FileRef(); + + /*! + * Returns a pointer to represented file's tag. + * + * \warning This pointer will become invalid when this FileRef and all + * copies pass out of scope. + * + * \warning Do not cast it to any subclasses of \class Tag. + * Use tag returning methods of appropriate subclasses of \class File instead. + * + * \see File::tag() + */ + Tag *tag() const; + + /*! + * Returns the audio properties for this FileRef. If no audio properties + * were read then this will returns a null pointer. + */ + AudioProperties *audioProperties() const; + + /*! + * Returns a pointer to the file represented by this handler class. + * + * As a general rule this call should be avoided since if you need to work + * with file objects directly, you are probably better served instantiating + * the File subclasses (i.e. MPEG::File) manually and working with their APIs. + * + * This handle exists to provide a minimal, generic and value-based + * wrapper around a File. Accessing the file directly generally indicates + * a moving away from this simplicity (and into things beyond the scope of + * FileRef). + * + * \warning This pointer will become invalid when this FileRef and all + * copies pass out of scope. + */ + File *file() const; + + /*! + * Saves the file. Returns true on success. + */ + bool save(); + + /*! + * Adds a FileTypeResolver to the list of those used by TagLib. Each + * additional FileTypeResolver is added to the front of a list of resolvers + * that are tried. If the FileTypeResolver returns zero the next resolver + * is tried. + * + * Returns a pointer to the added resolver (the same one that's passed in -- + * this is mostly so that static inialializers have something to use for + * assignment). + * + * \see FileTypeResolver + */ + static const FileTypeResolver *addFileTypeResolver(const FileTypeResolver *resolver); + + /*! + * As is mentioned elsewhere in this class's documentation, the default file + * type resolution code provided by TagLib only works by comparing file + * extensions. + * + * This method returns the list of file extensions that are used by default. + * + * The extensions are all returned in lowercase, though the comparison used + * by TagLib for resolution is case-insensitive. + * + * \note This does not account for any additional file type resolvers that + * are plugged in. Also note that this is not intended to replace a propper + * mime-type resolution system, but is just here for reference. + * + * \see FileTypeResolver + */ + static StringList defaultFileExtensions(); + + /*! + * Returns true if the file (and as such other pointers) are null. + */ + bool isNull() const; + + /*! + * Assign the file pointed to by \a ref to this FileRef. + */ + FileRef &operator=(const FileRef &ref); + + /*! + * Returns true if this FileRef and \a ref point to the same File object. + */ + bool operator==(const FileRef &ref) const; + + /*! + * Returns true if this FileRef and \a ref do not point to the same File + * object. + */ + bool operator!=(const FileRef &ref) const; + + /*! + * A simple implementation of file type guessing. If \a readAudioProperties + * is true then the audio properties will be read using + * \a audioPropertiesStyle. If \a readAudioProperties is false then + * \a audioPropertiesStyle will be ignored. + * + * \note You generally shouldn't use this method, but instead the constructor + * directly. + * + * \deprecated + */ + static File *create(FileName fileName, + bool readAudioProperties = true, + AudioProperties::ReadStyle audioPropertiesStyle = AudioProperties::Average); + + + private: + class FileRefPrivate; + FileRefPrivate *d; + }; + +} // namespace TagLib + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacfile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacfile.h new file mode 100644 index 0000000..31dfebd --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacfile.h @@ -0,0 +1,258 @@ +/*************************************************************************** + copyright : (C) 2003 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FLACFILE_H +#define TAGLIB_FLACFILE_H + +#include "taglib_export.h" +#include "tfile.h" +#include "tlist.h" +#include "tag.h" + +#include "flacpicture.h" +#include "flacproperties.h" + +namespace TagLib { + + class Tag; + namespace ID3v2 { class FrameFactory; class Tag; } + namespace ID3v1 { class Tag; } + namespace Ogg { class XiphComment; } + + //! An implementation of FLAC metadata + + /*! + * This is implementation of FLAC metadata for non-Ogg FLAC files. At some + * point when Ogg / FLAC is more common there will be a similar implementation + * under the Ogg hiearchy. + * + * This supports ID3v1, ID3v2 and Xiph style comments as well as reading stream + * properties from the file. + */ + + namespace FLAC { + + //! An implementation of TagLib::File with FLAC specific methods + + /*! + * This implements and provides an interface for FLAC files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to FLAC files. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * Contructs a FLAC file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \deprecated This constructor will be dropped in favor of the one below + * in a future version. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs a FLAC file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * If this file contains and ID3v2 tag the frames will be created using + * \a frameFactory. + */ + // BIC: merge with the above constructor + File(FileName file, ID3v2::FrameFactory *frameFactory, + bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs a FLAC file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * If this file contains and ID3v2 tag the frames will be created using + * \a frameFactory. + */ + // BIC: merge with the above constructor + File(IOStream *stream, ID3v2::FrameFactory *frameFactory, + bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. This will be a union of XiphComment, + * ID3v1 and ID3v2 tags. + * + * \see ID3v2Tag() + * \see ID3v1Tag() + * \see XiphComment() + */ + virtual TagLib::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * If the file contains more than one tag (e.g. XiphComment and ID3v1), + * only the first one (in the order XiphComment, ID3v2, ID3v1) will be + * converted to the PropertyMap. + */ + PropertyMap properties() const; + + void removeUnsupportedProperties(const StringList &); + + /*! + * Implements the unified property interface -- import function. + * As with the export, only one tag is taken into account. If the file + * has no tag at all, a XiphComment will be created. + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the FLAC::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Save the file. This will primarily save the XiphComment, but + * will also keep any old ID3-tags up to date. If the file + * has no XiphComment, one will be constructed from the ID3-tags. + * + * This returns true if the save was successful. + */ + virtual bool save(); + + /*! + * Returns a pointer to the ID3v2 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v2 tag. If \a create is true it will create + * an ID3v2 tag if one does not exist. + * + * \note The Tag is still owned by the FLAC::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v2::Tag *ID3v2Tag(bool create = false); + + /*! + * Returns a pointer to the ID3v1 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v1 tag. If \a create is true it will create + * an ID3v1 tag if one does not exist. + * + * \note The Tag is still owned by the FLAC::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v1::Tag *ID3v1Tag(bool create = false); + + /*! + * Returns a pointer to the XiphComment for the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid XiphComment. If \a create is true it will create + * a XiphComment if one does not exist. + * + * \note The Tag is still owned by the FLAC::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + Ogg::XiphComment *xiphComment(bool create = false); + + /*! + * Set the ID3v2::FrameFactory to something other than the default. This + * can be used to specify the way that ID3v2 frames will be interpreted + * when + * + * \see ID3v2FrameFactory + */ + void setID3v2FrameFactory(const ID3v2::FrameFactory *factory); + + /*! + * Returns the block of data used by FLAC::Properties for parsing the + * stream properties. + * + * \deprecated This method will not be public in a future release. + */ + ByteVector streamInfoData(); // BIC: remove + + /*! + * Returns the length of the audio-stream, used by FLAC::Properties for + * calculating the bitrate. + * + * \deprecated This method will not be public in a future release. + */ + long streamLength(); // BIC: remove + + /*! + * Returns a list of pictures attached to the FLAC file. + */ + List pictureList(); + + /*! + * Removes an attached picture. If \a del is true the picture's memory + * will be freed; if it is false, it must be deleted by the user. + */ + void removePicture(Picture *picture, bool del = true); + + /*! + * Remove all attached images. + */ + void removePictures(); + + /*! + * Add a new picture to the file. The file takes ownership of the + * picture and will handle freeing its memory. + * + * \note The file will be saved only after calling save(). + */ + void addPicture(Picture *picture); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void scan(); + long findID3v2(); + long findID3v1(); + ByteVector xiphCommentData() const; + long findPaddingBreak(long nextPageOffset, long targetOffset, bool *isLast); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacmetadatablock.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacmetadatablock.h new file mode 100644 index 0000000..41bca31 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacmetadatablock.h @@ -0,0 +1,75 @@ +/************************************************************************** + copyright : (C) 2010 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FLACMETADATABLOCK_H +#define TAGLIB_FLACMETADATABLOCK_H + +#include "tlist.h" +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace FLAC { + + class TAGLIB_EXPORT MetadataBlock + { + public: + MetadataBlock(); + virtual ~MetadataBlock(); + + enum BlockType { + StreamInfo = 0, + Padding, + Application, + SeekTable, + VorbisComment, + CueSheet, + Picture + }; + + /*! + * Returns the FLAC metadata block type. + */ + virtual int code() const = 0; + + /*! + * Render the content of the block. + */ + virtual ByteVector render() const = 0; + + private: + MetadataBlock(const MetadataBlock &item); + MetadataBlock &operator=(const MetadataBlock &item); + + class MetadataBlockPrivate; + MetadataBlockPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacpicture.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacpicture.h new file mode 100644 index 0000000..b6def57 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacpicture.h @@ -0,0 +1,208 @@ +/************************************************************************** + copyright : (C) 2010 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FLACPICTURE_H +#define TAGLIB_FLACPICTURE_H + +#include "tlist.h" +#include "tstring.h" +#include "tbytevector.h" +#include "taglib_export.h" +#include "flacmetadatablock.h" + +namespace TagLib { + + namespace FLAC { + + class TAGLIB_EXPORT Picture : public MetadataBlock + { + public: + + /*! + * This describes the function or content of the picture. + */ + enum Type { + //! A type not enumerated below + Other = 0x00, + //! 32x32 PNG image that should be used as the file icon + FileIcon = 0x01, + //! File icon of a different size or format + OtherFileIcon = 0x02, + //! Front cover image of the album + FrontCover = 0x03, + //! Back cover image of the album + BackCover = 0x04, + //! Inside leaflet page of the album + LeafletPage = 0x05, + //! Image from the album itself + Media = 0x06, + //! Picture of the lead artist or soloist + LeadArtist = 0x07, + //! Picture of the artist or performer + Artist = 0x08, + //! Picture of the conductor + Conductor = 0x09, + //! Picture of the band or orchestra + Band = 0x0A, + //! Picture of the composer + Composer = 0x0B, + //! Picture of the lyricist or text writer + Lyricist = 0x0C, + //! Picture of the recording location or studio + RecordingLocation = 0x0D, + //! Picture of the artists during recording + DuringRecording = 0x0E, + //! Picture of the artists during performance + DuringPerformance = 0x0F, + //! Picture from a movie or video related to the track + MovieScreenCapture = 0x10, + //! Picture of a large, coloured fish + ColouredFish = 0x11, + //! Illustration related to the track + Illustration = 0x12, + //! Logo of the band or performer + BandLogo = 0x13, + //! Logo of the publisher (record company) + PublisherLogo = 0x14 + }; + + Picture(); + Picture(const ByteVector &data); + ~Picture(); + + /*! + * Returns the type of the image. + */ + Type type() const; + + /*! + * Sets the type of the image. + */ + void setType(Type type); + + /*! + * Returns the mime type of the image. This should in most cases be + * "image/png" or "image/jpeg". + */ + String mimeType() const; + + /*! + * Sets the mime type of the image. This should in most cases be + * "image/png" or "image/jpeg". + */ + void setMimeType(const String &m); + + /*! + * Returns a text description of the image. + */ + + String description() const; + + /*! + * Sets a textual description of the image to \a desc. + */ + + void setDescription(const String &desc); + + /*! + * Returns the width of the image. + */ + int width() const; + + /*! + * Sets the width of the image. + */ + void setWidth(int w); + + /*! + * Returns the height of the image. + */ + int height() const; + + /*! + * Sets the height of the image. + */ + void setHeight(int h); + + /*! + * Returns the color depth (in bits-per-pixel) of the image. + */ + int colorDepth() const; + + /*! + * Sets the color depth (in bits-per-pixel) of the image. + */ + void setColorDepth(int depth); + + /*! + * Returns the number of colors used on the image.. + */ + int numColors() const; + + /*! + * Sets the number of colors used on the image (for indexed images). + */ + void setNumColors(int numColors); + + /*! + * Returns the image data. + */ + ByteVector data() const; + + /*! + * Sets the image data. + */ + void setData(const ByteVector &data); + + /*! + * Returns the FLAC metadata block type. + */ + int code() const; + + /*! + * Render the content to the FLAC picture block format. + */ + ByteVector render() const; + + /*! + * Parse the picture data in the FLAC picture block format. + */ + bool parse(const ByteVector &rawData); + + private: + Picture(const Picture &item); + Picture &operator=(const Picture &item); + + class PicturePrivate; + PicturePrivate *d; + }; + + typedef List PictureList; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacproperties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacproperties.h new file mode 100644 index 0000000..c145898 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacproperties.h @@ -0,0 +1,103 @@ +/*************************************************************************** + copyright : (C) 2003 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FLACPROPERTIES_H +#define TAGLIB_FLACPROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + + namespace FLAC { + + class File; + + //! An implementation of audio property reading for FLAC + + /*! + * This reads the data from an FLAC stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of FLAC::Properties with the data read from the + * ByteVector \a data. + */ + // BIC: switch to const reference + Properties(ByteVector data, long streamLength, ReadStyle style = Average); + + /*! + * Create an instance of FLAC::Properties with the data read from the + * FLAC::File \a file. + */ + // BIC: remove + Properties(File *file, ReadStyle style = Average); + + /*! + * Destroys this FLAC::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns the sample width as read from the FLAC identification + * header. + */ + int sampleWidth() const; + + /*! + * Return the number of sample frames + */ + unsigned long long sampleFrames() const; + + /*! + * Returns the MD5 signature of the uncompressed audio stream as read + * from the stream info header header. + */ + ByteVector signature() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacunknownmetadatablock.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacunknownmetadatablock.h new file mode 100644 index 0000000..3030254 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/flacunknownmetadatablock.h @@ -0,0 +1,81 @@ +/************************************************************************** + copyright : (C) 2010 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FLACUNKNOWNMETADATABLOCK_H +#define TAGLIB_FLACUNKNOWNMETADATABLOCK_H + +#include "tlist.h" +#include "tbytevector.h" +#include "taglib_export.h" +#include "flacmetadatablock.h" + +namespace TagLib { + + namespace FLAC { + + class TAGLIB_EXPORT UnknownMetadataBlock : public MetadataBlock + { + public: + UnknownMetadataBlock(int blockType, const ByteVector &data); + ~UnknownMetadataBlock(); + + /*! + * Returns the FLAC metadata block type. + */ + int code() const; + + /*! + * Sets the FLAC metadata block type. + */ + void setCode(int code); + + /*! + * Returns the FLAC metadata block type. + */ + ByteVector data() const; + + /*! + * Sets the FLAC metadata block type. + */ + void setData(const ByteVector &data); + + /*! + * Render the content of the block. + */ + ByteVector render() const; + + private: + UnknownMetadataBlock(const MetadataBlock &item); + UnknownMetadataBlock &operator=(const MetadataBlock &item); + + class UnknownMetadataBlockPrivate; + UnknownMetadataBlockPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/generalencapsulatedobjectframe.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/generalencapsulatedobjectframe.h new file mode 100644 index 0000000..42f854c --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/generalencapsulatedobjectframe.h @@ -0,0 +1,178 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + copyright : (C) 2006 by Aaron VonderHaar + email : avh4@users.sourceforge.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_GENERALENCAPSULATEDOBJECT_H +#define TAGLIB_GENERALENCAPSULATEDOBJECT_H + +#include "id3v2frame.h" +#include "id3v2header.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An ID3v2 general encapsulated object frame implementation + + /*! + * This is an implementation of ID3v2 general encapsulated objects. + * Arbitrary binary data may be included in tags, stored in GEOB frames. + * There may be multiple GEOB frames in a single tag. Each GEOB it + * labelled with a content description (which may be blank), a required + * mime-type, and a file name (may be blank). The content description + * uniquely identifies the GEOB frame in the tag. + */ + + class TAGLIB_EXPORT GeneralEncapsulatedObjectFrame : public Frame + { + friend class FrameFactory; + + public: + + /*! + * Constructs an empty object frame. The description, file name and text + * encoding should be set manually. + */ + GeneralEncapsulatedObjectFrame(); + + /*! + * Constructs a GeneralEncapsulatedObjectFrame frame based on \a data. + * + * \warning This is \em not data for the encapsulated object, for that use + * setObject(). This constructor is used when reading the frame from the + * disk. + */ + explicit GeneralEncapsulatedObjectFrame(const ByteVector &data); + + /*! + * Destroys the GeneralEncapsulatedObjectFrame instance. + */ + virtual ~GeneralEncapsulatedObjectFrame(); + + /*! + * Returns a string containing the description, file name and mime-type + */ + virtual String toString() const; + + /*! + * Returns the text encoding used for the description and file name. + * + * \see setTextEncoding() + * \see description() + * \see fileName() + */ + String::Type textEncoding() const; + + /*! + * Set the text encoding used for the description and file name. + * + * \see description() + * \see fileName() + */ + void setTextEncoding(String::Type encoding); + + /*! + * Returns the mime type of the object. + */ + String mimeType() const; + + /*! + * Sets the mime type of the object. + */ + void setMimeType(const String &type); + + /*! + * Returns the file name of the object. + * + * \see setFileName() + */ + String fileName() const; + + /*! + * Sets the file name for the object. + * + * \see fileName() + */ + void setFileName(const String &name); + + /*! + * Returns the content description of the object. + * + * \see setDescription() + * \see textEncoding() + * \see setTextEncoding() + */ + + String description() const; + + /*! + * Sets the content description of the object to \a desc. + * + * \see description() + * \see textEncoding() + * \see setTextEncoding() + */ + + void setDescription(const String &desc); + + /*! + * Returns the object data as a ByteVector. + * + * \note ByteVector has a data() method that returns a const char * which + * should make it easy to export this data to external programs. + * + * \see setObject() + * \see mimeType() + */ + ByteVector object() const; + + /*! + * Sets the object data to \a data. \a data should be of the type specified in + * this frame's mime-type specification. + * + * \see object() + * \see mimeType() + * \see setMimeType() + */ + void setObject(const ByteVector &object); + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + GeneralEncapsulatedObjectFrame(const ByteVector &data, Header *h); + GeneralEncapsulatedObjectFrame(const GeneralEncapsulatedObjectFrame &); + GeneralEncapsulatedObjectFrame &operator=(const GeneralEncapsulatedObjectFrame &); + + class GeneralEncapsulatedObjectFramePrivate; + GeneralEncapsulatedObjectFramePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v1genres.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v1genres.h new file mode 100644 index 0000000..271f725 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v1genres.h @@ -0,0 +1,66 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V1GENRE_H +#define TAGLIB_ID3V1GENRE_H + +#include "tmap.h" +#include "tstringlist.h" +#include "taglib_export.h" + +namespace TagLib { + namespace ID3v1 { + + typedef Map GenreMap; + + /*! + * Returns the list of canonical ID3v1 genre names in the order that they + * are listed in the standard. + */ + StringList TAGLIB_EXPORT genreList(); + + /*! + * A "reverse mapping" that goes from the canonical ID3v1 genre name to the + * respective genre number. genreMap()["Rock"] == + */ + GenreMap TAGLIB_EXPORT genreMap(); + + /*! + * Returns the name of the genre at \a index in the ID3v1 genre list. If + * \a index is out of range -- less than zero or greater than 146 -- a null + * string will be returned. + */ + String TAGLIB_EXPORT genre(int index); + + /*! + * Returns the genre index for the (case sensitive) genre \a name. If the + * genre is not in the list 255 (which signifies an unknown genre in ID3v1) + * will be returned. + */ + int TAGLIB_EXPORT genreIndex(const String &name); + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v1tag.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v1tag.h new file mode 100644 index 0000000..a90ac53 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v1tag.h @@ -0,0 +1,182 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V1TAG_H +#define TAGLIB_ID3V1TAG_H + +#include "tag.h" +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + class File; + + //! An ID3v1 implementation + + namespace ID3v1 { + + //! A abstraction for the string to data encoding in ID3v1 tags. + + /*! + * ID3v1 should in theory always contain ISO-8859-1 (Latin1) data. In + * practice it does not. TagLib by default only supports ISO-8859-1 data + * in ID3v1 tags. + * + * However by subclassing this class and reimplementing parse() and render() + * and setting your reimplementation as the default with + * ID3v1::Tag::setStringHandler() you can define how you would like these + * transformations to be done. + * + * \warning It is advisable not to write non-ISO-8859-1 data to ID3v1 + * tags. Please consider disabling the writing of ID3v1 tags in the case + * that the data is not ISO-8859-1. + * + * \see ID3v1::Tag::setStringHandler() + */ + + class TAGLIB_EXPORT StringHandler + { + TAGLIB_IGNORE_MISSING_DESTRUCTOR + public: + // BIC: Add virtual destructor. + StringHandler(); + + /*! + * Decode a string from \a data. The default implementation assumes that + * \a data is an ISO-8859-1 (Latin1) character array. + */ + virtual String parse(const ByteVector &data) const; + + /*! + * Encode a ByteVector with the data from \a s. The default implementation + * assumes that \a s is an ISO-8859-1 (Latin1) string. If the string is + * does not conform to ISO-8859-1, no value is written. + * + * \warning It is recommended that you not override this method, but + * instead do not write an ID3v1 tag in the case that the data is not + * ISO-8859-1. + */ + virtual ByteVector render(const String &s) const; + }; + + //! The main class in the ID3v1 implementation + + /*! + * This is an implementation of the ID3v1 format. ID3v1 is both the simplist + * and most common of tag formats but is rather limited. Because of its + * pervasiveness and the way that applications have been written around the + * fields that it provides, the generic TagLib::Tag API is a mirror of what is + * provided by ID3v1. + * + * ID3v1 tags should generally only contain Latin1 information. However because + * many applications do not follow this rule there is now support for overriding + * the ID3v1 string handling using the ID3v1::StringHandler class. Please see + * the documentation for that class for more information. + * + * \see StringHandler + * + * \note Most fields are truncated to a maximum of 28-30 bytes. The + * truncation happens automatically when the tag is rendered. + */ + + class TAGLIB_EXPORT Tag : public TagLib::Tag + { + public: + /*! + * Create an ID3v1 tag with default values. + */ + Tag(); + + /*! + * Create an ID3v1 tag and parse the data in \a file starting at + * \a tagOffset. + */ + Tag(File *file, long tagOffset); + + /*! + * Destroys this Tag instance. + */ + virtual ~Tag(); + + /*! + * Renders the in memory values to a ByteVector suitable for writing to + * the file. + */ + ByteVector render() const; + + /*! + * Returns the string "TAG" suitable for usage in locating the tag in a + * file. + */ + static ByteVector fileIdentifier(); + + // Reimplementations. + + virtual String title() const; + virtual String artist() const; + virtual String album() const; + virtual String comment() const; + virtual String genre() const; + virtual uint year() const; + virtual uint track() const; + + virtual void setTitle(const String &s); + virtual void setArtist(const String &s); + virtual void setAlbum(const String &s); + virtual void setComment(const String &s); + virtual void setGenre(const String &s); + virtual void setYear(uint i); + virtual void setTrack(uint i); + + /*! + * Sets the string handler that decides how the ID3v1 data will be + * converted to and from binary data. + * + * \see StringHandler + */ + static void setStringHandler(const StringHandler *handler); + + protected: + /*! + * Reads from the file specified in the constructor. + */ + void read(); + /*! + * Pareses the body of the tag in \a data. + */ + void parse(const ByteVector &data); + + private: + Tag(const Tag &); + Tag &operator=(const Tag &); + + class TagPrivate; + TagPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2extendedheader.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2extendedheader.h new file mode 100644 index 0000000..d7227e9 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2extendedheader.h @@ -0,0 +1,93 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2EXTENDEDHEADER_H +#define TAGLIB_ID3V2EXTENDEDHEADER_H + +#include "taglib_export.h" +#include "tbytevector.h" +#include "taglib.h" + +namespace TagLib { + + namespace ID3v2 { + + //! ID3v2 extended header implementation + + /*! + * This class implements ID3v2 extended headers. It attempts to follow, + * both semantically and programatically, the structure specified in + * the ID3v2 standard. The API is based on the properties of ID3v2 extended + * headers specified there. If any of the terms used in this documentation + * are unclear please check the specification in the linked section. + * (Structure, 3.2) + */ + + class TAGLIB_EXPORT ExtendedHeader + { + public: + /*! + * Constructs an empty ID3v2 extended header. + */ + ExtendedHeader(); + + /*! + * Destroys the extended header. + */ + virtual ~ExtendedHeader(); + + /*! + * Returns the size of the extended header. This is variable for the + * extended header. + */ + uint size() const; + + /*! + * Sets the data that will be used as the extended header. Since the + * length is not known before the extended header has been parsed, this + * should just be a pointer to the first byte of the extended header. It + * will determine the length internally and make that available through + * size(). + */ + void setData(const ByteVector &data); + + protected: + /*! + * Called by setData() to parse the extended header data. It makes this + * information available through the public API. + */ + void parse(const ByteVector &data); + + private: + ExtendedHeader(const ExtendedHeader &); + ExtendedHeader &operator=(const ExtendedHeader &); + + class ExtendedHeaderPrivate; + ExtendedHeaderPrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2footer.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2footer.h new file mode 100644 index 0000000..1374a14 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2footer.h @@ -0,0 +1,82 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2FOOTER_H +#define TAGLIB_ID3V2FOOTER_H + +#include "taglib_export.h" +#include "tbytevector.h" + +namespace TagLib { + + namespace ID3v2 { + + class Header; + + //! ID3v2 footer implementation + + /*! + * Per the ID3v2 specification, the tag's footer is just a copy of the + * information in the header. As such there is no API for reading the + * data from the header, it can just as easily be done from the header. + * + * In fact, at this point, TagLib does not even parse the footer since + * it is not useful internally. However, if the flag to include a footer + * has been set in the ID3v2::Tag, TagLib will render a footer. + */ + + class TAGLIB_EXPORT Footer + { + public: + /*! + * Constructs an empty ID3v2 footer. + */ + Footer(); + /*! + * Destroys the footer. + */ + virtual ~Footer(); + + /*! + * Returns the size of the footer. Presently this is always 10 bytes. + */ + static uint size(); + + /*! + * Renders the footer based on the data in \a header. + */ + ByteVector render(const Header *header) const; + + private: + Footer(const Footer &); + Footer &operator=(const Footer &); + + class FooterPrivate; + FooterPrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2frame.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2frame.h new file mode 100644 index 0000000..95c4070 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2frame.h @@ -0,0 +1,509 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2FRAME_H +#define TAGLIB_ID3V2FRAME_H + +#include "tstring.h" +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + class StringList; + class PropertyMap; + + namespace ID3v2 { + + class Tag; + class FrameFactory; + + //! ID3v2 frame implementation + + /*! + * This class is the main ID3v2 frame implementation. In ID3v2, a tag is + * split between a collection of frames (which are in turn split into fields + * (Structure, 4) + * (Frames). This class provides an API for + * gathering information about and modifying ID3v2 frames. Funtionallity + * specific to a given frame type is handed in one of the many subclasses. + */ + + class TAGLIB_EXPORT Frame + { + friend class Tag; + friend class FrameFactory; + + public: + + /*! + * Creates a textual frame which corresponds to a single key in the PropertyMap + * interface. These are all (User)TextIdentificationFrames except TIPL and TMCL, + * all (User)URLLinkFrames, CommentsFrames, and UnsynchronizedLyricsFrame. + */ + static Frame *createTextualFrame(const String &key, const StringList &values); + + /*! + * Destroys this Frame instance. + */ + virtual ~Frame(); + + /*! + * Returns the Frame ID (Structure, 4) + * (Frames, 4) + */ + ByteVector frameID() const; + + /*! + * Returns the size of the frame. + */ + uint size() const; + + /*! + * Returns the size of the frame header + * + * \deprecated This is only accurate for ID3v2.3 or ID3v2.4. Please use + * the call below which accepts an ID3v2 version number. In the next + * non-binary compatible release this will be made into a non-static + * member that checks the internal ID3v2 version. + */ + static uint headerSize(); // BIC: remove and make non-static + + /*! + * Returns the size of the frame header for the given ID3v2 version. + * + * \deprecated Please see the explanation above. + */ + static uint headerSize(uint version); // BIC: remove and make non-static + + /*! + * Sets the data that will be used as the frame. Since the length is not + * known before the frame has been parsed, this should just be a pointer to + * the first byte of the frame. It will determine the length internally + * and make that available through size(). + */ + void setData(const ByteVector &data); + + /*! + * Set the text of frame in the sanest way possible. This should only be + * reimplemented in frames where there is some logical mapping to text. + * + * \note If the frame type supports multiple text encodings, this will not + * change the text encoding of the frame; the string will be converted to + * that frame's encoding. Please use the specific APIs of the frame types + * to set the encoding if that is desired. + */ + virtual void setText(const String &text); + + /*! + * This returns the textual representation of the data in the frame. + * Subclasses must reimplement this method to provide a string + * representation of the frame's data. + */ + virtual String toString() const = 0; + + /*! + * Render the frame back to its binary format in a ByteVector. + */ + ByteVector render() const; + + /*! + * Returns the text delimiter that is used between fields for the string + * type \a t. + */ + static ByteVector textDelimiter(String::Type t); + + /*! + * The string with which an instrument name is prefixed to build a key in a PropertyMap; + * used to translate PropertyMaps to TMCL frames. In the current implementation, this + * is "PERFORMER:". + */ + static const String instrumentPrefix; + /*! + * The PropertyMap key prefix which triggers the use of a COMM frame instead of a TXXX + * frame for a non-standard key. In the current implementation, this is "COMMENT:". + */ + static const String commentPrefix; + /*! + * The PropertyMap key prefix which triggers the use of a USLT frame instead of a TXXX + * frame for a non-standard key. In the current implementation, this is "LYRICS:". + */ + static const String lyricsPrefix; + /*! + * The PropertyMap key prefix which triggers the use of a WXXX frame instead of a TXX + * frame for a non-standard key. In the current implementation, this is "URL:". + */ + static const String urlPrefix; + + protected: + class Header; + + /*! + * Constructs an ID3v2 frame using \a data to read the header information. + * All other processing of \a data should be handled in a subclass. + * + * \note This need not contain anything more than a frame ID, but + * \e must constain at least that. + */ + explicit Frame(const ByteVector &data); + + /*! + * This creates an Frame using the header \a h. + * + * The ownership of this header will be assigned to the frame and the + * header will be deleted when the frame is destroyed. + */ + Frame(Header *h); + + /*! + * Returns a pointer to the frame header. + */ + Header *header() const; + + /*! + * Sets the header to \a h. If \a deleteCurrent is true, this will free + * the memory of the current header. + * + * The ownership of this header will be assigned to the frame and the + * header will be deleted when the frame is destroyed. + */ + void setHeader(Header *h, bool deleteCurrent = true); + + /*! + * Called by setData() to parse the frame data. It makes this information + * available through the public API. + */ + void parse(const ByteVector &data); + + /*! + * Called by parse() to parse the field data. It makes this information + * available through the public API. This must be overridden by the + * subclasses. + */ + virtual void parseFields(const ByteVector &data) = 0; + + /*! + * Render the field data back to a binary format in a ByteVector. This + * must be overridden by subclasses. + */ + virtual ByteVector renderFields() const = 0; + + /*! + * Returns a ByteVector containing the field data given the frame data. + * This correctly adjusts for the header size plus any additional frame + * data that's specified in the frame header flags. + */ + ByteVector fieldData(const ByteVector &frameData) const; + + /*! + * Reads a String of type \a encodiong from the ByteVector \a data. If \a + * position is passed in it is used both as the starting point and is + * updated to replect the position just after the string that has been read. + * This is useful for reading strings sequentially. + */ + String readStringField(const ByteVector &data, String::Type encoding, + int *positon = 0); + + /*! + * Checks a the list of string values to see if they can be used with the + * specified encoding and returns the recommended encoding. + */ + // BIC: remove and make non-static + static String::Type checkEncoding(const StringList &fields, + String::Type encoding); + + /*! + * Checks a the list of string values to see if they can be used with the + * specified encoding and returns the recommended encoding. This method + * also checks the ID3v2 version and makes sure the encoding can be used + * in the specified version. + */ + // BIC: remove and make non-static + static String::Type checkEncoding(const StringList &fields, + String::Type encoding, uint version); + + /*! + * Checks a the list of string values to see if they can be used with the + * specified encoding and returns the recommended encoding. This method + * also checks the ID3v2 version and makes sure the encoding can be used + * in the version specified by the frame's header. + */ + String::Type checkTextEncoding(const StringList &fields, + String::Type encoding) const; + + + /*! + * Parses the contents of this frame as PropertyMap. If that fails, the returend + * PropertyMap will be empty, and its unsupportedData() will contain this frame's + * ID. + * BIC: Will be a virtual function in future releases. + */ + PropertyMap asProperties() const; + + /*! + * Returns an appropriate ID3 frame ID for the given free-form tag key. This method + * will return ByteVector::null if no specialized translation is found. + */ + static ByteVector keyToFrameID(const String &); + + /*! + * Returns a free-form tag name for the given ID3 frame ID. Note that this does not work + * for general frame IDs such as TXXX or WXXX; in such a case String::null is returned. + */ + static String frameIDToKey(const ByteVector &); + + + /*! + * This helper function splits the PropertyMap \a original into three ProperytMaps + * \a singleFrameProperties, \a tiplProperties, and \a tmclProperties, such that: + * - \a singleFrameProperties contains only of keys which can be represented with + * exactly one ID3 frame per key. In the current implementation + * this is everything except for the fixed "involved people" keys and keys of the + * form "TextIdentificationFrame::instrumentPrefix" + "instrument", which are + * mapped to a TMCL frame. + * - \a tiplProperties will consist of those keys that are present in + * TextIdentificationFrame::involvedPeopleMap() + * - \a tmclProperties contains the "musician credits" keys which should be mapped + * to a TMCL frame + */ + static void splitProperties(const PropertyMap &original, PropertyMap &singleFrameProperties, + PropertyMap &tiplProperties, PropertyMap &tmclProperties); + + private: + Frame(const Frame &); + Frame &operator=(const Frame &); + + class FramePrivate; + friend class FramePrivate; + FramePrivate *d; + }; + + //! ID3v2 frame header implementation + + /*! + * The ID3v2 Frame Header (Structure, 4) + * + * Every ID3v2::Frame has an associated header that gives some general + * properties of the frame and also makes it possible to identify the frame + * type. + * + * As such when reading an ID3v2 tag ID3v2::FrameFactory first creates the + * frame headers and then creates the appropriate Frame subclass based on + * the type and attaches the header. + */ + + class TAGLIB_EXPORT Frame::Header + { + public: + /*! + * Construct a Frame Header based on \a data. \a data must at least + * contain a 4 byte frame ID, and optionally can contain flag data and the + * frame size. i.e. Just the frame id -- "TALB" -- is a valid value. + * + * \deprecated Please use the constructor below that accepts a version + * number. + */ + Header(const ByteVector &data, bool synchSafeInts); + + /*! + * Construct a Frame Header based on \a data. \a data must at least + * contain a 4 byte frame ID, and optionally can contain flag data and the + * frame size. i.e. Just the frame id -- "TALB" -- is a valid value. + * + * \a version should be the ID3v2 version of the tag. + */ + explicit Header(const ByteVector &data, uint version = 4); + + /*! + * Destroys this Header instance. + */ + virtual ~Header(); + + /*! + * Sets the data for the Header. + * + * \deprecated Please use the version below that accepts an ID3v2 version + * number. + */ + void setData(const ByteVector &data, bool synchSafeInts); + + /*! + * Sets the data for the Header. \a version should indicate the ID3v2 + * version number of the tag that this frame is contained in. + */ + void setData(const ByteVector &data, uint version = 4); + + /*! + * Returns the Frame ID (Structure, 4) + * (Frames, 4) + */ + ByteVector frameID() const; + + /*! + * Sets the frame's ID to \a id. Only the first four bytes of \a id will + * be used. + * + * \warning This method should in general be avoided. It exists simply to + * provide a mechanism for transforming frames from a deprecated frame type + * to a newer one -- i.e. TYER to TDRC from ID3v2.3 to ID3v2.4. + */ + void setFrameID(const ByteVector &id); + + /*! + * Returns the size of the frame data portion, as set when setData() was + * called or set explicitly via setFrameSize(). + */ + uint frameSize() const; + + /*! + * Sets the size of the frame data portion. + */ + void setFrameSize(uint size); + + /*! + * Returns the ID3v2 version of the header, as passed in from the + * construction of the header or set via setVersion(). + */ + uint version() const; + + /*! + * Sets the ID3v2 version of the header, changing has impact on the + * correct parsing/rendering of frame data. + */ + void setVersion(uint version); + + /*! + * Returns the size of the frame header in bytes. + * + * \deprecated Please use the version of this method that accepts a + * version. This is only accurate for ID3v2.3 and ID3v2.4. This will be + * removed in the next binary incompatible release (2.0) and will be + * replaced with a non-static method that checks the frame version. + */ + static uint size(); + + /*! + * Returns the size of the frame header in bytes for the ID3v2 version + * that's given. + * + * \deprecated Please see the explanation in the version above. + */ + static uint size(uint version); + + /*! + * Returns true if the flag for tag alter preservation is set. + * + * The semantics are a little backwards from what would seem natural + * (setting the preservation flag to throw away the frame), but this + * follows the ID3v2 standard. + * + * \see setTagAlterPreservation() + */ + bool tagAlterPreservation() const; + + /*! + * Sets the flag for preservation of this frame if the tag is set. If + * this is set to true the frame will not be written when the tag is + * saved. + * + * The semantics are a little backwards from what would seem natural + * (setting the preservation flag to throw away the frame), but this + * follows the ID3v2 standard. + * + * \see tagAlterPreservation() + */ + void setTagAlterPreservation(bool discard); + + /*! + * Returns true if the flag for file alter preservation is set. + * + * \note This flag is currently ignored internally in TagLib. + */ + bool fileAlterPreservation() const; + + /*! + * Returns true if the frame is meant to be read only. + * + * \note This flag is currently ignored internally in TagLib. + */ + bool readOnly() const; + + /*! + * Returns true if the flag for the grouping identifity is set. + * + * \note This flag is currently ignored internally in TagLib. + */ + bool groupingIdentity() const; + + /*! + * Returns true if compression is enabled for this frame. + * + * \note This flag is currently ignored internally in TagLib. + */ + bool compression() const; + + /*! + * Returns true if encryption is enabled for this frame. + * + * \note This flag is currently ignored internally in TagLib. + */ + bool encryption() const; + +#ifndef DO_NOT_DOCUMENT + bool unsycronisation() const; +#endif + + /*! + * Returns true if unsynchronisation is enabled for this frame. + */ + bool unsynchronisation() const; + + /*! + * Returns true if the flag for a data length indicator is set. + */ + bool dataLengthIndicator() const; + + /*! + * Render the Header back to binary format in a ByteVector. + */ + ByteVector render() const; + + /*! + * \deprecated + */ + bool frameAlterPreservation() const; + + private: + Header(const Header &); + Header &operator=(const Header &); + + class HeaderPrivate; + HeaderPrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2framefactory.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2framefactory.h new file mode 100644 index 0000000..16419c7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2framefactory.h @@ -0,0 +1,167 @@ + /*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2FRAMEFACTORY_H +#define TAGLIB_ID3V2FRAMEFACTORY_H + +#include "taglib_export.h" +#include "tbytevector.h" +#include "id3v2frame.h" +#include "id3v2header.h" + +namespace TagLib { + + namespace ID3v2 { + + class TextIdentificationFrame; + + //! A factory for creating ID3v2 frames during parsing + + /*! + * This factory abstracts away the frame creation process and instantiates + * the appropriate ID3v2::Frame subclasses based on the contents of the + * data. + * + * Reimplementing this factory is the key to adding support for frame types + * not directly supported by TagLib to your application. To do so you would + * subclass this factory reimplement createFrame(). Then by setting your + * factory to be the default factory in ID3v2::Tag constructor or with + * MPEG::File::setID3v2FrameFactory() you can implement behavior that will + * allow for new ID3v2::Frame subclasses (also provided by you) to be used. + * + * This implements both abstract factory and singleton patterns + * of which more information is available on the web and in software design + * textbooks (Notably Design Patters). + * + * \note You do not need to use this factory to create new frames to add to + * an ID3v2::Tag. You can instantiate frame subclasses directly (with new) + * and add them to a tag using ID3v2::Tag::addFrame() + * + * \see ID3v2::Tag::addFrame() + */ + + class TAGLIB_EXPORT FrameFactory + { + public: + static FrameFactory *instance(); + /*! + * Create a frame based on \a data. \a synchSafeInts should only be set + * false if we are parsing an old tag (v2.3 or older) that does not support + * synchsafe ints. + * + * \deprecated Please use the method below that accepts a ID3v2::Header + * instance in new code. + */ + Frame *createFrame(const ByteVector &data, bool synchSafeInts) const; + + /*! + * Create a frame based on \a data. \a version should indicate the ID3v2 + * version of the tag. As ID3v2.4 is the most current version of the + * standard 4 is the default. + * + * \deprecated Please use the method below that accepts a ID3v2::Header + * instance in new code. + */ + Frame *createFrame(const ByteVector &data, uint version = 4) const; + + /*! + * Create a frame based on \a data. \a tagHeader should be a valid + * ID3v2::Header instance. + */ + // BIC: make virtual + Frame *createFrame(const ByteVector &data, Header *tagHeader) const; + + /*! + * Returns the default text encoding for text frames. If setTextEncoding() + * has not been explicitly called this will only be used for new text + * frames. However, if this value has been set explicitly all frames will be + * converted to this type (unless it's explitly set differently for the + * individual frame) when being rendered. + * + * \see setDefaultTextEncoding() + */ + String::Type defaultTextEncoding() const; + + /*! + * Set the default text encoding for all text frames that are created to + * \a encoding. If no value is set the frames with either default to the + * encoding type that was parsed and new frames default to Latin1. + * + * Valid string types for ID3v2 tags are Latin1, UTF8, UTF16 and UTF16BE. + * + * \see defaultTextEncoding() + */ + void setDefaultTextEncoding(String::Type encoding); + + protected: + /*! + * Constructs a frame factory. Because this is a singleton this method is + * protected, but may be used for subclasses. + */ + FrameFactory(); + + /*! + * Destroys the frame factory. In most cases this will never be called (as + * is typical of singletons). + */ + virtual ~FrameFactory(); + + /*! + * This method checks for compliance to the current ID3v2 standard (2.4) + * and does nothing in the common case. However if a frame is found that + * is not compatible with the current standard, this method either updates + * the frame or indicates that it should be discarded. + * + * This method with return true (with or without changes to the frame) if + * this frame should be kept or false if it should be discarded. + * + * See the id3v2.4.0-changes.txt document for further information. + */ + virtual bool updateFrame(Frame::Header *header) const; + + private: + FrameFactory(const FrameFactory &); + FrameFactory &operator=(const FrameFactory &); + + /*! + * This method is used internally to convert a frame from ID \a from to ID + * \a to. If the frame matches the \a from pattern and converts the frame + * ID in the \a header or simply does nothing if the frame ID does not match. + */ + void convertFrame(const char *from, const char *to, + Frame::Header *header) const; + + void updateGenre(TextIdentificationFrame *frame) const; + + static FrameFactory factory; + + class FrameFactoryPrivate; + FrameFactoryPrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2header.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2header.h new file mode 100644 index 0000000..307ba96 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2header.h @@ -0,0 +1,175 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2HEADER_H +#define TAGLIB_ID3V2HEADER_H + +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An implementation of ID3v2 headers + + /*! + * This class implements ID3v2 headers. It attempts to follow, both + * semantically and programatically, the structure specified in + * the ID3v2 standard. The API is based on the properties of ID3v2 headers + * specified there. If any of the terms used in this documentation are + * unclear please check the specification in the linked section. + * (Structure, 3.1) + */ + + class TAGLIB_EXPORT Header + { + public: + /*! + * Constructs an empty ID3v2 header. + */ + Header(); + + /*! + * Constructs an ID3v2 header based on \a data. parse() is called + * immediately. + */ + Header(const ByteVector &data); + + /*! + * Destroys the header. + */ + virtual ~Header(); + + /*! + * Returns the major version number. (Note: This is the 4, not the 2 in + * ID3v2.4.0. The 2 is implied.) + */ + uint majorVersion() const; + + /*! + * Set the the major version number to \a version. (Note: This is + * the 4, not the 2 in ID3v2.4.0. The 2 is implied.) + * \see majorVersion() + * + * \note This is used by the internal parser; this will not change the + * version which is written and in general should not be called by API + * users. + */ + void setMajorVersion(uint version); + + /*! + * Returns the revision number. (Note: This is the 0, not the 4 in + * ID3v2.4.0. The 2 is implied.) + */ + uint revisionNumber() const; + + /*! + * Returns true if unsynchronisation has been applied to all frames. + */ + bool unsynchronisation() const; + + /*! + * Returns true if an extended header is present in the tag. + */ + bool extendedHeader() const; + + /*! + * Returns true if the experimental indicator flag is set. + */ + bool experimentalIndicator() const; + + /*! + * Returns true if a footer is present in the tag. + */ + bool footerPresent() const; + /*! + * Returns the tag size in bytes. This is the size of the frame content. + * The size of the \e entire tag will be this plus the header size (10 + * bytes) and, if present, the footer size (potentially another 10 bytes). + * + * \note This is the value as read from the header to which TagLib attempts + * to provide an API to; it was not a design decision on the part of TagLib + * to not include the mentioned portions of the tag in the \e size. + * + * \see completeTagSize() + */ + uint tagSize() const; + + /*! + * Returns the tag size, including the header and, if present, the footer + * size. + * + * \see tagSize() + */ + uint completeTagSize() const; + + /*! + * Set the tag size to \a s. + * \see tagSize() + */ + void setTagSize(uint s); + + /*! + * Returns the size of the header. Presently this is always 10 bytes. + */ + static uint size(); + + /*! + * Returns the string used to identify and ID3v2 tag inside of a file. + * Presently this is always "ID3". + */ + static ByteVector fileIdentifier(); + + /*! + * Sets the data that will be used as the header. 10 bytes, starting from + * the beginning of \a data are used. + */ + void setData(const ByteVector &data); + + /*! + * Renders the Header back to binary format. + */ + ByteVector render() const; + + protected: + /*! + * Called by setData() to parse the header data. It makes this information + * available through the public API. + */ + void parse(const ByteVector &data); + + private: + Header(const Header &); + Header &operator=(const Header &); + + class HeaderPrivate; + HeaderPrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2synchdata.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2synchdata.h new file mode 100644 index 0000000..4a1f596 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2synchdata.h @@ -0,0 +1,70 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2SYNCHDATA_H +#define TAGLIB_ID3V2SYNCHDATA_H + +#include "tbytevector.h" +#include "taglib.h" + +namespace TagLib { + + namespace ID3v2 { + + //! A few functions for ID3v2 synch safe integer conversion + + /*! + * In the ID3v2.4 standard most integer values are encoded as "synch safe" + * integers which are encoded in such a way that they will not give false + * MPEG syncs and confuse MPEG decoders. This namespace provides some + * methods for converting to and from these values to ByteVectors for + * things rendering and parsing ID3v2 data. + */ + + namespace SynchData + { + /*! + * This returns the unsigned integer value of \a data where \a data is a + * ByteVector that contains a \e synchsafe integer (Structure, + * 6.2). The default \a length of + * 4 is used if another value is not specified. + */ + TAGLIB_EXPORT uint toUInt(const ByteVector &data); + + /*! + * Returns a 4 byte (32 bit) synchsafe integer based on \a value. + */ + TAGLIB_EXPORT ByteVector fromUInt(uint value); + + /*! + * Convert the data from unsynchronized data to its original format. + */ + TAGLIB_EXPORT ByteVector decode(const ByteVector &input); + } + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2tag.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2tag.h new file mode 100644 index 0000000..94784e7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/id3v2tag.h @@ -0,0 +1,361 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2TAG_H +#define TAGLIB_ID3V2TAG_H + +#include "tag.h" +#include "tbytevector.h" +#include "tstring.h" +#include "tlist.h" +#include "tmap.h" +#include "taglib_export.h" + +#include "id3v2framefactory.h" + +namespace TagLib { + + class File; + + //! An ID3v2 implementation + + /*! + * This is a relatively complete and flexible framework for working with ID3v2 + * tags. + * + * \see ID3v2::Tag + */ + + namespace ID3v2 { + + class Header; + class ExtendedHeader; + class Footer; + + typedef List FrameList; + typedef Map FrameListMap; + + //! The main class in the ID3v2 implementation + + /*! + * This is the main class in the ID3v2 implementation. It serves two + * functions. This first, as is obvious from the public API, is to provide a + * container for the other ID3v2 related classes. In addition, through the + * read() and parse() protected methods, it provides the most basic level of + * parsing. In these methods the ID3v2 tag is extracted from the file and + * split into data components. + * + * ID3v2 tags have several parts, TagLib attempts to provide an interface + * for them all. header(), footer() and extendedHeader() corespond to those + * data structures in the ID3v2 standard and the APIs for the classes that + * they return attempt to reflect this. + * + * Also ID3v2 tags are built up from a list of frames, which are in turn + * have a header and a list of fields. TagLib provides two ways of accessing + * the list of frames that are in a given ID3v2 tag. The first is simply + * via the frameList() method. This is just a list of pointers to the frames. + * The second is a map from the frame type -- i.e. "COMM" for comments -- and + * a list of frames of that type. (In some cases ID3v2 allows for multiple + * frames of the same type, hence this being a map to a list rather than just + * a map to an individual frame.) + * + * More information on the structure of frames can be found in the ID3v2::Frame + * class. + * + * read() and parse() pass binary data to the other ID3v2 class structures, + * they do not handle parsing of flags or fields, for instace. Those are + * handled by similar functions within those classes. + * + * \note All pointers to data structures within the tag will become invalid + * when the tag is destroyed. + * + * \warning Dealing with the nasty details of ID3v2 is not for the faint of + * heart and should not be done without much meditation on the spec. It's + * rather long, but if you're planning on messing with this class and others + * that deal with the details of ID3v2 (rather than the nice, safe, abstract + * TagLib::Tag and friends), it's worth your time to familiarize yourself + * with said spec (which is distrubuted with the TagLib sources). TagLib + * tries to do most of the work, but with a little luck, you can still + * convince it to generate invalid ID3v2 tags. The APIs for ID3v2 assume a + * working knowledge of ID3v2 structure. You're been warned. + */ + + class TAGLIB_EXPORT Tag : public TagLib::Tag + { + public: + /*! + * Constructs an empty ID3v2 tag. + * + * \note You must create at least one frame for this tag to be valid. + */ + Tag(); + + /*! + * Constructs an ID3v2 tag read from \a file starting at \a tagOffset. + * \a factory specifies which FrameFactory will be used for the + * construction of new frames. + * + * \note You should be able to ignore the \a factory parameter in almost + * all situations. You would want to specify your own FrameFactory + * subclass in the case that you are extending TagLib to support additional + * frame types, which would be incorperated into your factory. + * + * \see FrameFactory + */ + Tag(File *file, long tagOffset, + const FrameFactory *factory = FrameFactory::instance()); + + /*! + * Destroys this Tag instance. + */ + virtual ~Tag(); + + // Reimplementations. + + virtual String title() const; + virtual String artist() const; + virtual String album() const; + virtual String comment() const; + virtual String genre() const; + virtual uint year() const; + virtual uint track() const; + + virtual void setTitle(const String &s); + virtual void setArtist(const String &s); + virtual void setAlbum(const String &s); + virtual void setComment(const String &s); + virtual void setGenre(const String &s); + virtual void setYear(uint i); + virtual void setTrack(uint i); + + virtual bool isEmpty() const; + + /*! + * Returns a pointer to the tag's header. + */ + Header *header() const; + + /*! + * Returns a pointer to the tag's extended header or null if there is no + * extended header. + */ + ExtendedHeader *extendedHeader() const; + + /*! + * Returns a pointer to the tag's footer or null if there is no footer. + * + * \deprecated I don't see any reason to keep this around since there's + * nothing useful to be retrieved from the footer, but well, again, I'm + * prone to change my mind, so this gets to stay around until near a + * release. + */ + Footer *footer() const; + + /*! + * Returns a reference to the frame list map. This is an FrameListMap of + * all of the frames in the tag. + * + * This is the most convenient structure for accessing the tag's frames. + * Many frame types allow multiple instances of the same frame type so this + * is a map of lists. In most cases however there will only be a single + * frame of a certain type. + * + * Let's say for instance that you wanted to access the frame for total + * beats per minute -- the TBPM frame. + * + * \code + * TagLib::MPEG::File f("foo.mp3"); + * + * // Check to make sure that it has an ID3v2 tag + * + * if(f.ID3v2Tag()) { + * + * // Get the list of frames for a specific frame type + * + * TagLib::ID3v2::FrameList l = f.ID3v2Tag()->frameListMap()["TBPM"]; + * + * if(!l.isEmpty()) + * std::cout << l.front()->toString() << std::endl; + * } + * + * \endcode + * + * \warning You should not modify this data structure directly, instead + * use addFrame() and removeFrame(). + * + * \see frameList() + */ + const FrameListMap &frameListMap() const; + + /*! + * Returns a reference to the frame list. This is an FrameList of all of + * the frames in the tag in the order that they were parsed. + * + * This can be useful if for example you want iterate over the tag's frames + * in the order that they occur in the tag. + * + * \warning You should not modify this data structure directly, instead + * use addFrame() and removeFrame(). + */ + const FrameList &frameList() const; + + /*! + * Returns the frame list for frames with the id \a frameID or an empty + * list if there are no frames of that type. This is just a convenience + * and is equivalent to: + * + * \code + * frameListMap()[frameID]; + * \endcode + * + * \see frameListMap() + */ + const FrameList &frameList(const ByteVector &frameID) const; + + /*! + * Add a frame to the tag. At this point the tag takes ownership of + * the frame and will handle freeing its memory. + * + * \note Using this method will invalidate any pointers on the list + * returned by frameList() + */ + void addFrame(Frame *frame); + + /*! + * Remove a frame from the tag. If \a del is true the frame's memory + * will be freed; if it is false, it must be deleted by the user. + * + * \note Using this method will invalidate any pointers on the list + * returned by frameList() + */ + void removeFrame(Frame *frame, bool del = true); + + /*! + * Remove all frames of type \a id from the tag and free their memory. + * + * \note Using this method will invalidate any pointers on the list + * returned by frameList() + */ + void removeFrames(const ByteVector &id); + + /*! + * Implements the unified property interface -- export function. + * This function does some work to translate the hard-specified ID3v2 + * frame types into a free-form string-to-stringlist PropertyMap: + * - if ID3v2 frame ID is known by Frame::frameIDToKey(), the returned + * key is used + * - if the frame ID is "TXXX" (user text frame), the description() is + * used as key + * - if the frame ID is "WXXX" (user url frame), + * - if the description is empty or "URL", the key "URL" is used + * - otherwise, the key "URL:" is used; + * - if the frame ID is "COMM" (comments frame), + * - if the description is empty or "COMMENT", the key "COMMENT" + * is used + * - otherwise, the key "COMMENT:" is used; + * - if the frame ID is "USLT" (unsynchronized lyrics), + * - if the description is empty or "LYRICS", the key "LYRICS" is used + * - otherwise, the key "LYRICS:" is used; + * - if the frame ID is "TIPL" (involved peoples list), and if all the + * roles defined in the frame are known in TextIdentificationFrame::involvedPeopleMap(), + * then "=" will be contained in the returned obejct for each + * - if the frame ID is "TMCL" (musician credit list), then + * "PERFORMER:=" will be contained in the returned + * PropertyMap for each defined musician + * In any other case, the unsupportedData() of the returned object will contain + * the frame's ID and, in case of a frame ID which is allowed to appear more than + * once, the description, separated by a "/". + * + */ + PropertyMap properties() const; + + /*! + * Removes unsupported frames given by \a properties. The elements of + * \a properties must be taken from properties().unsupportedData(); they + * are of one of the following forms: + * - a four-character frame ID, if the ID3 specification allows only one + * frame with that ID (thus, the frame is uniquely determined) + * - frameID + "/" + description(), when the ID is one of "TXXX", "WXXX", + * "COMM", or "USLT", + * - "UNKNOWN/" + frameID, for frames that could not be parsed by TagLib. + * In that case, *all* unknown frames with the given ID will be removed. + */ + void removeUnsupportedProperties(const StringList &properties); + + /*! + * Implements the unified property interface -- import function. + * See the comments in properties(). + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Render the tag back to binary data, suitable to be written to disk. + */ + ByteVector render() const; + + /*! + * Render the tag back to binary data, suitable to be written to disk. + * + * The \a version parameter specifies the version of the rendered + * ID3v2 tag. It can be either 4 or 3. + */ + // BIC: combine with the above method + ByteVector render(int version) const; + + protected: + /*! + * Reads data from the file specified in the constructor. It does basic + * parsing of the data in the largest chunks. It partitions the tag into + * the Header, the body of the tag (which contains the ExtendedHeader and + * frames) and Footer. + */ + void read(); + + /*! + * This is called by read to parse the body of the tag. It determines if an + * extended header exists and adds frames to the FrameListMap. + */ + void parse(const ByteVector &data); + + /*! + * Sets the value of the text frame with the Frame ID \a id to \a value. + * If the frame does not exist, it is created. + */ + void setTextFrame(const ByteVector &id, const String &value); + + void downgradeFrames(FrameList *existingFrames, FrameList *newFrames) const; + + private: + Tag(const Tag &); + Tag &operator=(const Tag &); + + class TagPrivate; + TagPrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4atom.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4atom.h new file mode 100644 index 0000000..ea5091a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4atom.h @@ -0,0 +1,111 @@ +/************************************************************************** + copyright : (C) 2007,2011 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +// This file is not part of the public API! + +#ifndef DO_NOT_DOCUMENT + +#ifndef TAGLIB_MP4ATOM_H +#define TAGLIB_MP4ATOM_H + +#include "tfile.h" +#include "tlist.h" + +namespace TagLib { + + namespace MP4 { + + class Atom; + typedef TagLib::List AtomList; + + enum AtomDataType + { + TypeImplicit = 0, // for use with tags for which no type needs to be indicated because only one type is allowed + TypeUTF8 = 1, // without any count or null terminator + TypeUTF16 = 2, // also known as UTF-16BE + TypeSJIS = 3, // deprecated unless it is needed for special Japanese characters + TypeHTML = 6, // the HTML file header specifies which HTML version + TypeXML = 7, // the XML header must identify the DTD or schemas + TypeUUID = 8, // also known as GUID; stored as 16 bytes in binary (valid as an ID) + TypeISRC = 9, // stored as UTF-8 text (valid as an ID) + TypeMI3P = 10, // stored as UTF-8 text (valid as an ID) + TypeGIF = 12, // (deprecated) a GIF image + TypeJPEG = 13, // a JPEG image + TypePNG = 14, // a PNG image + TypeURL = 15, // absolute, in UTF-8 characters + TypeDuration = 16, // in milliseconds, 32-bit integer + TypeDateTime = 17, // in UTC, counting seconds since midnight, January 1, 1904; 32 or 64-bits + TypeGenred = 18, // a list of enumerated values + TypeInteger = 21, // a signed big-endian integer with length one of { 1,2,3,4,8 } bytes + TypeRIAAPA = 24, // RIAA parental advisory; { -1=no, 1=yes, 0=unspecified }, 8-bit ingteger + TypeUPC = 25, // Universal Product Code, in text UTF-8 format (valid as an ID) + TypeBMP = 27, // Windows bitmap image + TypeUndefined = 255 // undefined + }; + + struct AtomData { + AtomData(AtomDataType type, ByteVector data) : type(type), locale(0), data(data) {} + AtomDataType type; + int locale; + ByteVector data; + }; + + typedef TagLib::List AtomDataList; + + class Atom + { + public: + Atom(File *file); + ~Atom(); + Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0); + bool path(AtomList &path, const char *name1, const char *name2 = 0, const char *name3 = 0); + AtomList findall(const char *name, bool recursive = false); + long offset; + long length; + TagLib::ByteVector name; + AtomList children; + private: + static const int numContainers = 11; + static const char *containers[11]; + }; + + //! Root-level atoms + class Atoms + { + public: + Atoms(File *file); + ~Atoms(); + Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0); + AtomList path(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0); + AtomList atoms; + }; + + } + +} + +#endif + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4coverart.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4coverart.h new file mode 100644 index 0000000..804ab78 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4coverart.h @@ -0,0 +1,74 @@ +/************************************************************************** + copyright : (C) 2009 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MP4COVERART_H +#define TAGLIB_MP4COVERART_H + +#include "tlist.h" +#include "tbytevector.h" +#include "taglib_export.h" +#include "mp4atom.h" + +namespace TagLib { + + namespace MP4 { + + class TAGLIB_EXPORT CoverArt + { + public: + /*! + * This describes the image type. + */ + enum Format { + JPEG = TypeJPEG, + PNG = TypePNG, + BMP = TypeBMP, + GIF = TypeGIF + }; + + CoverArt(Format format, const ByteVector &data); + ~CoverArt(); + + CoverArt(const CoverArt &item); + CoverArt &operator=(const CoverArt &item); + + //! Format of the image + Format format() const; + + //! The image data + ByteVector data() const; + + private: + class CoverArtPrivate; + CoverArtPrivate *d; + }; + + typedef List CoverArtList; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4file.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4file.h new file mode 100644 index 0000000..c3613f7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4file.h @@ -0,0 +1,113 @@ +/************************************************************************** + copyright : (C) 2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MP4FILE_H +#define TAGLIB_MP4FILE_H + +#include "tag.h" +#include "tfile.h" +#include "taglib_export.h" +#include "mp4properties.h" +#include "mp4tag.h" + +namespace TagLib { + + //! An implementation of MP4 (AAC, ALAC, ...) metadata + namespace MP4 { + + class Atoms; + + /*! + * This implements and provides an interface for MP4 files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to MP4 files. + */ + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * Contructs a MP4 file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \note In the current implementation, both \a readProperties and + * \a propertiesStyle are ignored. + */ + File(FileName file, bool readProperties = true, Properties::ReadStyle audioPropertiesStyle = Properties::Average); + + /*! + * Contructs a MP4 file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \note In the current implementation, both \a readProperties and + * \a propertiesStyle are ignored. + */ + File(IOStream *stream, bool readProperties = true, Properties::ReadStyle audioPropertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns a pointer to the MP4 tag of the file. + * + * MP4::Tag implements the tag interface, so this serves as the + * reimplementation of TagLib::File::tag(). + * + * \note The Tag is still owned by the MP4::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + Tag *tag() const; + + /*! + * Returns the MP4 audio properties for this file. + */ + Properties *audioProperties() const; + + /*! + * Save the file. + * + * This returns true if the save was successful. + */ + bool save(); + + private: + + void read(bool readProperties, Properties::ReadStyle audioPropertiesStyle); + bool checkValid(const MP4::AtomList &list); + + class FilePrivate; + FilePrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4item.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4item.h new file mode 100644 index 0000000..be7aa1a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4item.h @@ -0,0 +1,83 @@ +/************************************************************************** + copyright : (C) 2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MP4ITEM_H +#define TAGLIB_MP4ITEM_H + +#include "tstringlist.h" +#include "mp4coverart.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace MP4 { + + class TAGLIB_EXPORT Item + { + public: + struct IntPair { + int first, second; + }; + + Item(); + Item(const Item &item); + Item &operator=(const Item &item); + ~Item(); + + Item(int value); + Item(uchar value); + Item(uint value); + Item(long long value); + Item(bool value); + Item(int first, int second); + Item(const StringList &value); + Item(const ByteVectorList &value); + Item(const CoverArtList &value); + + void setAtomDataType(AtomDataType type); + AtomDataType atomDataType() const; + + int toInt() const; + uchar toByte() const; + uint toUInt() const; + long long toLongLong() const; + bool toBool() const; + IntPair toIntPair() const; + StringList toStringList() const; + ByteVectorList toByteVectorList() const; + CoverArtList toCoverArtList() const; + + bool isValid() const; + + private: + class ItemPrivate; + ItemPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4properties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4properties.h new file mode 100644 index 0000000..7906824 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4properties.h @@ -0,0 +1,62 @@ +/************************************************************************** + copyright : (C) 2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MP4PROPERTIES_H +#define TAGLIB_MP4PROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + + namespace MP4 { + + class Atoms; + class File; + + //! An implementation of MP4 audio properties + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + Properties(File *file, Atoms *atoms, ReadStyle style = Average); + virtual ~Properties(); + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + virtual int bitsPerSample() const; + bool isEncrypted() const; + + private: + class PropertiesPrivate; + PropertiesPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4tag.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4tag.h new file mode 100644 index 0000000..b5ea6eb --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mp4tag.h @@ -0,0 +1,112 @@ +/************************************************************************** + copyright : (C) 2007,2011 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MP4TAG_H +#define TAGLIB_MP4TAG_H + +#include "tag.h" +#include "tbytevectorlist.h" +#include "tfile.h" +#include "tmap.h" +#include "tstringlist.h" +#include "taglib_export.h" +#include "mp4atom.h" +#include "mp4item.h" + +namespace TagLib { + + namespace MP4 { + + typedef TagLib::Map ItemListMap; + + class TAGLIB_EXPORT Tag: public TagLib::Tag + { + public: + Tag(); + Tag(TagLib::File *file, Atoms *atoms); + ~Tag(); + bool save(); + + String title() const; + String artist() const; + String album() const; + String comment() const; + String genre() const; + uint year() const; + uint track() const; + + void setTitle(const String &value); + void setArtist(const String &value); + void setAlbum(const String &value); + void setComment(const String &value); + void setGenre(const String &value); + void setYear(uint value); + void setTrack(uint value); + + ItemListMap &itemListMap(); + + private: + AtomDataList parseData2(Atom *atom, TagLib::File *file, int expectedFlags = -1, bool freeForm = false); + TagLib::ByteVectorList parseData(Atom *atom, TagLib::File *file, int expectedFlags = -1, bool freeForm = false); + void parseText(Atom *atom, TagLib::File *file, int expectedFlags = 1); + void parseFreeForm(Atom *atom, TagLib::File *file); + void parseInt(Atom *atom, TagLib::File *file); + void parseByte(Atom *atom, TagLib::File *file); + void parseUInt(Atom *atom, TagLib::File *file); + void parseLongLong(Atom *atom, TagLib::File *file); + void parseGnre(Atom *atom, TagLib::File *file); + void parseIntPair(Atom *atom, TagLib::File *file); + void parseBool(Atom *atom, TagLib::File *file); + void parseCovr(Atom *atom, TagLib::File *file); + + TagLib::ByteVector padIlst(const ByteVector &data, int length = -1); + TagLib::ByteVector renderAtom(const ByteVector &name, const TagLib::ByteVector &data); + TagLib::ByteVector renderData(const ByteVector &name, int flags, const TagLib::ByteVectorList &data); + TagLib::ByteVector renderText(const ByteVector &name, Item &item, int flags = TypeUTF8); + TagLib::ByteVector renderFreeForm(const String &name, Item &item); + TagLib::ByteVector renderBool(const ByteVector &name, Item &item); + TagLib::ByteVector renderInt(const ByteVector &name, Item &item); + TagLib::ByteVector renderByte(const ByteVector &name, Item &item); + TagLib::ByteVector renderUInt(const ByteVector &name, Item &item); + TagLib::ByteVector renderLongLong(const ByteVector &name, Item &item); + TagLib::ByteVector renderIntPair(const ByteVector &name, Item &item); + TagLib::ByteVector renderIntPairNoTrailing(const ByteVector &name, Item &item); + TagLib::ByteVector renderCovr(const ByteVector &name, Item &item); + + void updateParents(AtomList &path, long delta, int ignore = 0); + void updateOffsets(long delta, long offset); + + void saveNew(TagLib::ByteVector &data); + void saveExisting(TagLib::ByteVector &data, AtomList &path); + + class TagPrivate; + TagPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpcfile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpcfile.h new file mode 100644 index 0000000..61ac6d6 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpcfile.h @@ -0,0 +1,201 @@ +/*************************************************************************** + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MPCFILE_H +#define TAGLIB_MPCFILE_H + +#include "taglib_export.h" +#include "tfile.h" +#include "tag.h" + +#include "mpcproperties.h" + +#include "tlist.h" + +namespace TagLib { + + class Tag; + + namespace ID3v1 { class Tag; } + namespace APE { class Tag; } + + //! An implementation of MPC metadata + + /*! + * This is implementation of MPC metadata. + * + * This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream + * properties from the file. ID3v2 tags are invalid in MPC-files, but will be skipped + * and ignored. + */ + + namespace MPC { + + //! An implementation of TagLib::File with MPC specific methods + + /*! + * This implements and provides an interface for MPC files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to MPC files. + * The only invalid tag combination supported is an ID3v1 tag after an APE tag. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * This set of flags is used for various operations and is suitable for + * being OR-ed together. + */ + enum TagTypes { + //! Empty set. Matches no tag types. + NoTags = 0x0000, + //! Matches ID3v1 tags. + ID3v1 = 0x0001, + //! Matches ID3v2 tags. + ID3v2 = 0x0002, + //! Matches APE tags. + APE = 0x0004, + //! Matches all tag types. + AllTags = 0xffff + }; + + /*! + * Contructs an MPC file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an MPC file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. This will be an APE tag, an ID3v1 tag + * or a combination of the two. + */ + virtual TagLib::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * If the file contains both an APE and an ID3v1 tag, only the APE + * tag will be converted to the PropertyMap. + */ + PropertyMap properties() const; + + void removeUnsupportedProperties(const StringList &properties); + + /*! + * Implements the unified property interface -- import function. + * As with the export, only one tag is taken into account. If the file + * has no tag at all, an APE tag will be created. + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the MPC::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Saves the file. + */ + virtual bool save(); + + /*! + * Returns a pointer to the ID3v1 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v1 tag. If \a create is true it will create + * an ID3v1 tag if one does not exist. If there is already an APE tag, the + * new ID3v1 tag will be placed after it. + * + * \note The Tag is still owned by the APE::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v1::Tag *ID3v1Tag(bool create = false); + + /*! + * Returns a pointer to the APE tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid APE tag. If \a create is true it will create + * a APE tag if one does not exist. If there is already an ID3v1 tag, thes + * new APE tag will be placed before it. + * + * \note The Tag is still owned by the APE::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + APE::Tag *APETag(bool create = false); + + /*! + * This will remove the tags that match the OR-ed together TagTypes from the + * file. By default it removes all tags. + * + * \warning This will also invalidate pointers to the tags + * as their memory will be freed. + * + * \note In order to make the removal permanent save() still needs to be called. + */ + void strip(int tags = AllTags); + + /*! + * \deprecated + * \see strip + */ + void remove(int tags = AllTags); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void scan(); + long findAPE(); + long findID3v1(); + long findID3v2(); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpcproperties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpcproperties.h new file mode 100644 index 0000000..adf40d8 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpcproperties.h @@ -0,0 +1,122 @@ +/*************************************************************************** + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MPCPROPERTIES_H +#define TAGLIB_MPCPROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + + namespace MPC { + + class File; + + static const uint HeaderSize = 8*7; + + //! An implementation of audio property reading for MPC + + /*! + * This reads the data from an MPC stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of MPC::Properties with the data read from the + * ByteVector \a data. + * + * This constructor is deprecated. It only works for MPC version up to 7. + */ + Properties(const ByteVector &data, long streamLength, ReadStyle style = Average); + + /*! + * Create an instance of MPC::Properties with the data read directly + * from a MPC::File. + */ + Properties(File *file, long streamLength, ReadStyle style = Average); + + /*! + * Destroys this MPC::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns the version of the bitstream (SV4-SV8) + */ + int mpcVersion() const; + uint totalFrames() const; + uint sampleFrames() const; + + /*! + * Returns the track gain as an integer value, + * to convert to dB: trackGain in dB = 64.82 - (trackGain / 256) + */ + int trackGain() const; + + /*! + * Returns the track peak as an integer value, + * to convert to dB: trackPeak in dB = trackPeak / 256 + * to convert to floating [-1..1]: trackPeak = 10^(trackPeak / 256 / 20)/32768 + */ + int trackPeak() const; + + /*! + * Returns the album gain as an integer value, + * to convert to dB: albumGain in dB = 64.82 - (albumGain / 256) + */ + int albumGain() const; + + /*! + * Returns the album peak as an integer value, + * to convert to dB: albumPeak in dB = albumPeak / 256 + * to convert to floating [-1..1]: albumPeak = 10^(albumPeak / 256 / 20)/32768 + */ + int albumPeak() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void readSV7(const ByteVector &data); + void readSV8(File *file); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpegfile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpegfile.h new file mode 100644 index 0000000..185fced --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpegfile.h @@ -0,0 +1,323 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MPEGFILE_H +#define TAGLIB_MPEGFILE_H + +#include "taglib_export.h" +#include "tfile.h" +#include "tag.h" + +#include "mpegproperties.h" + +namespace TagLib { + + namespace ID3v2 { class Tag; class FrameFactory; } + namespace ID3v1 { class Tag; } + namespace APE { class Tag; } + + //! An implementation of TagLib::File with MPEG (MP3) specific methods + + namespace MPEG { + + //! An MPEG file class with some useful methods specific to MPEG + + /*! + * This implements the generic TagLib::File API and additionally provides + * access to properties that are distinct to MPEG files, notably access + * to the different ID3 tags. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * This set of flags is used for various operations and is suitable for + * being OR-ed together. + */ + enum TagTypes { + //! Empty set. Matches no tag types. + NoTags = 0x0000, + //! Matches ID3v1 tags. + ID3v1 = 0x0001, + //! Matches ID3v2 tags. + ID3v2 = 0x0002, + //! Matches APE tags. + APE = 0x0004, + //! Matches all tag types. + AllTags = 0xffff + }; + + /*! + * Contructs an MPEG file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \deprecated This constructor will be dropped in favor of the one below + * in a future version. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an MPEG file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. The frames will be created using + * \a frameFactory. + * + * \deprecated This constructor will be dropped in favor of the one below + * in a future version. + */ + File(FileName file, ID3v2::FrameFactory *frameFactory, + bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an MPEG file from \a stream. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. The frames will be created using + * \a frameFactory. + */ + // BIC: merge with the above constructor + File(IOStream *stream, ID3v2::FrameFactory *frameFactory, + bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns a pointer to a tag that is the union of the ID3v2 and ID3v1 + * tags. The ID3v2 tag is given priority in reading the information -- if + * requested information exists in both the ID3v2 tag and the ID3v1 tag, + * the information from the ID3v2 tag will be returned. + * + * If you would like more granular control over the content of the tags, + * with the concession of generality, use the tag-type specific calls. + * + * \note As this tag is not implemented as an ID3v2 tag or an ID3v1 tag, + * but a union of the two this pointer may not be cast to the specific + * tag types. + * + * \see ID3v1Tag() + * \see ID3v2Tag() + * \see APETag() + */ + virtual Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * If the file contains more than one tag, only the + * first one (in the order ID3v2, APE, ID3v1) will be converted to the + * PropertyMap. + */ + PropertyMap properties() const; + + void removeUnsupportedProperties(const StringList &properties); + + /*! + * Implements the unified tag dictionary interface -- import function. + * As with the export, only one tag is taken into account. If the file + * has no tag at all, ID3v2 will be created. + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the MPEG::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Save the file. If at least one tag -- ID3v1 or ID3v2 -- exists this + * will duplicate its content into the other tag. This returns true + * if saving was successful. + * + * If neither exists or if both tags are empty, this will strip the tags + * from the file. + * + * This is the same as calling save(AllTags); + * + * If you would like more granular control over the content of the tags, + * with the concession of generality, use paramaterized save call below. + * + * \see save(int tags) + */ + virtual bool save(); + + /*! + * Save the file. This will attempt to save all of the tag types that are + * specified by OR-ing together TagTypes values. The save() method above + * uses AllTags. This returns true if saving was successful. + * + * This strips all tags not included in the mask, but does not modify them + * in memory, so later calls to save() which make use of these tags will + * remain valid. This also strips empty tags. + */ + bool save(int tags); + + /*! + * Save the file. This will attempt to save all of the tag types that are + * specified by OR-ing together TagTypes values. The save() method above + * uses AllTags. This returns true if saving was successful. + * + * If \a stripOthers is true this strips all tags not included in the mask, + * but does not modify them in memory, so later calls to save() which make + * use of these tags will remain valid. This also strips empty tags. + */ + // BIC: combine with the above method + bool save(int tags, bool stripOthers); + + /*! + * Save the file. This will attempt to save all of the tag types that are + * specified by OR-ing together TagTypes values. The save() method above + * uses AllTags. This returns true if saving was successful. + * + * If \a stripOthers is true this strips all tags not included in the mask, + * but does not modify them in memory, so later calls to save() which make + * use of these tags will remain valid. This also strips empty tags. + * + * The \a id3v2Version parameter specifies the version of the saved + * ID3v2 tag. It can be either 4 or 3. + */ + // BIC: combine with the above method + bool save(int tags, bool stripOthers, int id3v2Version); + + /*! + * Returns a pointer to the ID3v2 tag of the file. + * + * A tag will always be returned, regardless of whether there is a + * tag in the file or not. Use ID3v2::Tag::isEmpty() to check if + * the tag contains no data. + * + * \note The Tag is still owned by the MPEG::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v2::Tag *ID3v2Tag(bool create = false); + + /*! + * Returns a pointer to the ID3v1 tag of the file. + * + * A tag will always be returned, regardless of whether there is a + * tag in the file or not. Use Tag::isEmpty() to check if + * the tag contains no data. + * + * \note The Tag is still owned by the MPEG::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v1::Tag *ID3v1Tag(bool create = false); + + /*! + * Returns a pointer to the APE tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid APE tag. If \a create is true it will create + * an APE tag if one does not exist. + * + * \note The Tag is still owned by the MPEG::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + APE::Tag *APETag(bool create = false); + + /*! + * This will strip the tags that match the OR-ed together TagTypes from the + * file. By default it strips all tags. It returns true if the tags are + * successfully stripped. + * + * This is equivalent to strip(tags, true) + * + * \note This will also invalidate pointers to the ID3 and APE tags + * as their memory will be freed. + */ + bool strip(int tags = AllTags); + + /*! + * This will strip the tags that match the OR-ed together TagTypes from the + * file. By default it strips all tags. It returns true if the tags are + * successfully stripped. + * + * If \a freeMemory is true the ID3 and APE tags will be deleted and + * pointers to them will be invalidated. + */ + // BIC: merge with the method above + bool strip(int tags, bool freeMemory); + + /*! + * Set the ID3v2::FrameFactory to something other than the default. + * + * \see ID3v2FrameFactory + */ + void setID3v2FrameFactory(const ID3v2::FrameFactory *factory); + + /*! + * Returns the position in the file of the first MPEG frame. + */ + long firstFrameOffset(); + + /*! + * Returns the position in the file of the next MPEG frame, + * using the current position as start + */ + long nextFrameOffset(long position); + + /*! + * Returns the position in the file of the previous MPEG frame, + * using the current position as start + */ + long previousFrameOffset(long position); + + /*! + * Returns the position in the file of the last MPEG frame. + */ + long lastFrameOffset(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + long findID3v2(); + long findID3v1(); + void findAPE(); + + /*! + * MPEG frames can be recognized by the bit pattern 11111111 111, so the + * first byte is easy to check for, however checking to see if the second byte + * starts with \e 111 is a bit more tricky, hence this member function. + */ + static bool secondSynchByte(char byte); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpegheader.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpegheader.h new file mode 100644 index 0000000..020ebd0 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpegheader.h @@ -0,0 +1,166 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MPEGHEADER_H +#define TAGLIB_MPEGHEADER_H + +#include "taglib_export.h" + +namespace TagLib { + + class ByteVector; + + namespace MPEG { + + //! An implementation of MP3 frame headers + + /*! + * This is an implementation of MPEG Layer III headers. The API follows more + * or less the binary format of these headers. I've used + * this + * document as a reference. + */ + + class TAGLIB_EXPORT Header + { + public: + /*! + * Parses an MPEG header based on \a data. + */ + Header(const ByteVector &data); + + /*! + * Does a shallow copy of \a h. + */ + Header(const Header &h); + + /*! + * Destroys this Header instance. + */ + virtual ~Header(); + + /*! + * Returns true if the frame is at least an appropriate size and has + * legal values. + */ + bool isValid() const; + + /*! + * The MPEG Version. + */ + enum Version { + //! MPEG Version 1 + Version1 = 0, + //! MPEG Version 2 + Version2 = 1, + //! MPEG Version 2.5 + Version2_5 = 2 + }; + + /*! + * Returns the MPEG Version of the header. + */ + Version version() const; + + /*! + * Returns the layer version. This will be between the values 1-3. + */ + int layer() const; + + /*! + * Returns true if the MPEG protection bit is enabled. + */ + bool protectionEnabled() const; + + /*! + * Returns the bitrate encoded in the header. + */ + int bitrate() const; + + /*! + * Returns the sample rate in Hz. + */ + int sampleRate() const; + + /*! + * Returns true if the frame is padded. + */ + bool isPadded() const; + + /*! + * There are a few combinations or one or two channel audio that are + * possible: + */ + enum ChannelMode { + //! Stereo + Stereo = 0, + //! Stereo + JointStereo = 1, + //! Dual Mono + DualChannel = 2, + //! Mono + SingleChannel = 3 + }; + + /*! + * Returns the channel mode for this frame. + */ + ChannelMode channelMode() const; + + /*! + * Returns true if the copyrighted bit is set. + */ + bool isCopyrighted() const; + + /*! + * Returns true if the "original" bit is set. + */ + bool isOriginal() const; + + /*! + * Returns the frame length. + */ + int frameLength() const; + + /*! + * Returns the number of frames per sample. + */ + int samplesPerFrame() const; + + /*! + * Makes a shallow copy of the header. + */ + Header &operator=(const Header &h); + + private: + void parse(const ByteVector &data); + + class HeaderPrivate; + HeaderPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpegproperties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpegproperties.h new file mode 100644 index 0000000..72e594f --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/mpegproperties.h @@ -0,0 +1,118 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MPEGPROPERTIES_H +#define TAGLIB_MPEGPROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +#include "mpegheader.h" + +namespace TagLib { + + namespace MPEG { + + class File; + class XingHeader; + + //! An implementation of audio property reading for MP3 + + /*! + * This reads the data from an MPEG Layer III stream found in the + * AudioProperties API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of MPEG::Properties with the data read from the + * MPEG::File \a file. + */ + Properties(File *file, ReadStyle style = Average); + + /*! + * Destroys this MPEG Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns a pointer to the XingHeader if one exists or null if no + * XingHeader was found. + */ + + const XingHeader *xingHeader() const; + + /*! + * Returns the MPEG Version of the file. + */ + Header::Version version() const; + + /*! + * Returns the layer version. This will be between the values 1-3. + */ + int layer() const; + + /*! + * Returns true if the MPEG protection bit is enabled. + */ + bool protectionEnabled() const; + + /*! + * Returns the channel mode for this frame. + */ + Header::ChannelMode channelMode() const; + + /*! + * Returns true if the copyrighted bit is set. + */ + bool isCopyrighted() const; + + /*! + * Returns true if the "original" bit is set. + */ + bool isOriginal() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/oggfile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/oggfile.h new file mode 100644 index 0000000..1ecf2b9 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/oggfile.h @@ -0,0 +1,123 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#include "taglib_export.h" +#include "tfile.h" +#include "tbytevectorlist.h" + +#ifndef TAGLIB_OGGFILE_H +#define TAGLIB_OGGFILE_H + +namespace TagLib { + + //! A namespace for the classes used by Ogg-based metadata files + + namespace Ogg { + + class PageHeader; + + //! An implementation of TagLib::File with some helpers for Ogg based formats + + /*! + * This is an implementation of Ogg file page and packet rendering and is of + * use to Ogg based formats. While the API is small this handles the + * non-trivial details of breaking up an Ogg stream into packets and makes + * these available (via subclassing) to the codec meta data implementations. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + virtual ~File(); + + /*! + * Returns the packet contents for the i-th packet (starting from zero) + * in the Ogg bitstream. + * + * \warning The requires reading at least the packet header for every page + * up to the requested page. + */ + ByteVector packet(uint i); + + /*! + * Sets the packet with index \a i to the value \a p. + */ + void setPacket(uint i, const ByteVector &p); + + /*! + * Returns a pointer to the PageHeader for the first page in the stream or + * null if the page could not be found. + */ + const PageHeader *firstPageHeader(); + + /*! + * Returns a pointer to the PageHeader for the last page in the stream or + * null if the page could not be found. + */ + const PageHeader *lastPageHeader(); + + virtual bool save(); + + protected: + /*! + * Contructs an Ogg file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \note This constructor is protected since Ogg::File shouldn't be + * instantiated directly but rather should be used through the codec + * specific subclasses. + */ + File(FileName file); + + /*! + * Contructs an Ogg file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \note This constructor is protected since Ogg::File shouldn't be + * instantiated directly but rather should be used through the codec + * specific subclasses. + */ + File(IOStream *stream); + + private: + File(const File &); + File &operator=(const File &); + + /*! + * Reads the next page and updates the internal "current page" pointer. + */ + bool nextPage(); + void writePageGroup(const List &group); + + class FilePrivate; + FilePrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/oggflacfile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/oggflacfile.h new file mode 100644 index 0000000..d437379 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/oggflacfile.h @@ -0,0 +1,126 @@ +/*************************************************************************** + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_OGGFLACFILE_H +#define TAGLIB_OGGFLACFILE_H + +#include "taglib_export.h" +#include "oggfile.h" +#include "xiphcomment.h" + +#include "flacproperties.h" + +namespace TagLib { + + class Tag; + + namespace Ogg { + + //! An implementation of Ogg FLAC metadata + + /*! + * This is implementation of FLAC metadata for Ogg FLAC files. For "pure" + * FLAC files look under the FLAC hiearchy. + * + * Unlike "pure" FLAC-files, Ogg FLAC only supports Xiph-comments, + * while the audio-properties are the same. + */ + namespace FLAC { + + using TagLib::FLAC::Properties; + + //! An implementation of TagLib::File with Ogg/FLAC specific methods + + /*! + * This implements and provides an interface for Ogg/FLAC files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to Ogg FLAC files. + */ + + class TAGLIB_EXPORT File : public Ogg::File + { + public: + /*! + * Contructs an Ogg/FLAC file from \a file. If \a readProperties is true + * the file's audio properties will also be read using \a propertiesStyle. + * If false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an Ogg/FLAC file from \a file. If \a readProperties is true + * the file's audio properties will also be read using \a propertiesStyle. + * If false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. This will always be a XiphComment. + */ + virtual XiphComment *tag() const; + + /*! + * Returns the FLAC::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Save the file. This will primarily save and update the XiphComment. + * Returns true if the save is successful. + */ + virtual bool save(); + + /*! + * Returns the length of the audio-stream, used by FLAC::Properties for + * calculating the bitrate. + */ + long streamLength(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void scan(); + ByteVector streamInfoData(); + ByteVector xiphCommentData(); + + class FilePrivate; + FilePrivate *d; + }; + } // namespace FLAC + } // namespace Ogg +} // namespace TagLib + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/oggpage.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/oggpage.h new file mode 100644 index 0000000..e9f4840 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/oggpage.h @@ -0,0 +1,211 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_OGGPAGE_H +#define TAGLIB_OGGPAGE_H + +#include "taglib_export.h" +#include "tbytevectorlist.h" + +namespace TagLib { + + namespace Ogg { + + class File; + class PageHeader; + + //! An implementation of Ogg pages + + /*! + * This is an implementation of the pages that make up an Ogg stream. + * This handles parsing pages and breaking them down into packets and handles + * the details of packets spanning multiple pages and pages that contiain + * multiple packets. + * + * In most Xiph.org formats the comments are found in the first few packets, + * this however is a reasonably complete implementation of Ogg pages that + * could potentially be useful for non-meta data purposes. + */ + + class TAGLIB_EXPORT Page + { + public: + /*! + * Read an Ogg page from the \a file at the position \a pageOffset. + */ + Page(File *file, long pageOffset); + + virtual ~Page(); + + /*! + * Returns the page's position within the file (in bytes). + */ + long fileOffset() const; + + /*! + * Returns a pointer to the header for this page. This pointer will become + * invalid when the page is deleted. + */ + const PageHeader *header() const; + + /*! + * Returns a copy of the page with \a sequenceNumber set as sequence number. + * + * \see header() + * \see PageHeader::setPageSequenceNumber() + */ + Page* getCopyWithNewPageSequenceNumber(int sequenceNumber); + + /*! + * Returns the index of the first packet wholly or partially contained in + * this page. + * + * \see setFirstPacketIndex() + */ + int firstPacketIndex() const; + + /*! + * Sets the index of the first packet in the page. + * + * \see firstPacketIndex() + */ + void setFirstPacketIndex(int index); + + /*! + * When checking to see if a page contains a given packet this set of flags + * represents the possible values for that packets status in the page. + * + * \see containsPacket() + */ + enum ContainsPacketFlags { + //! No part of the packet is contained in the page + DoesNotContainPacket = 0x0000, + //! The packet is wholly contained in the page + CompletePacket = 0x0001, + //! The page starts with the given packet + BeginsWithPacket = 0x0002, + //! The page ends with the given packet + EndsWithPacket = 0x0004 + }; + + /*! + * Checks to see if the specified \a packet is contained in the current + * page. + * + * \see ContainsPacketFlags + */ + ContainsPacketFlags containsPacket(int index) const; + + /*! + * Returns the number of packets (whole or partial) in this page. + */ + uint packetCount() const; + + /*! + * Returns a list of the packets in this page. + * + * \note Either or both the first and last packets may be only partial. + * \see PageHeader::firstPacketContinued() + */ + ByteVectorList packets() const; + + /*! + * Returns the size of the page in bytes. + */ + int size() const; + + ByteVector render() const; + + /*! + * Defines a strategy for pagination, or grouping pages into Ogg packets, + * for use with pagination methods. + * + * \note Yes, I'm aware that this is not a canonical "Strategy Pattern", + * the term was simply convenient. + */ + enum PaginationStrategy { + /*! + * Attempt to put the specified set of packets into a single Ogg packet. + * If the sum of the packet data is greater than will fit into a single + * Ogg page -- 65280 bytes -- this will fall back to repagination using + * the recommended page sizes. + */ + SinglePagePerGroup, + /*! + * Split the packet or group of packets into pages that conform to the + * sizes recommended in the Ogg standard. + */ + Repaginate + }; + + /*! + * Pack \a packets into Ogg pages using the \a strategy for pagination. + * The page number indicater inside of the rendered packets will start + * with \a firstPage and be incremented for each page rendered. + * \a containsLastPacket should be set to true if \a packets contains the + * last page in the stream and will set the appropriate flag in the last + * rendered Ogg page's header. \a streamSerialNumber should be set to + * the serial number for this stream. + * + * \note The "absolute granule position" is currently always zeroed using + * this method as this suffices for the comment headers. + * + * \warning The pages returned by this method must be deleted by the user. + * You can use List::setAutoDelete(true) to set these pages to be + * automatically deleted when this list passes out of scope. + * + * \see PaginationStrategy + * \see List::setAutoDelete() + */ + static List paginate(const ByteVectorList &packets, + PaginationStrategy strategy, + uint streamSerialNumber, + int firstPage, + bool firstPacketContinued = false, + bool lastPacketCompleted = true, + bool containsLastPacket = false); + + protected: + /*! + * Creates an Ogg packet based on the data in \a packets. The page number + * for each page will be set to \a pageNumber. + */ + Page(const ByteVectorList &packets, + uint streamSerialNumber, + int pageNumber, + bool firstPacketContinued = false, + bool lastPacketCompleted = true, + bool containsLastPacket = false); + + private: + Page(const Page &); + Page &operator=(const Page &); + + class PagePrivate; + PagePrivate *d; + }; + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/oggpageheader.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/oggpageheader.h new file mode 100644 index 0000000..742710a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/oggpageheader.h @@ -0,0 +1,232 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_OGGPAGEHEADER_H +#define TAGLIB_OGGPAGEHEADER_H + +#include "tlist.h" +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace Ogg { + + class File; + + //! An implementation of the page headers associated with each Ogg::Page + + /*! + * This class implements Ogg page headers which contain the information + * about Ogg pages needed to break them into packets which can be passed on + * to the codecs. + */ + + class TAGLIB_EXPORT PageHeader + { + public: + /*! + * Reads a PageHeader from \a file starting at \a pageOffset. The defaults + * create a page with no (and as such, invalid) data that must be set + * later. + */ + PageHeader(File *file = 0, long pageOffset = -1); + + /*! + * Deletes this instance of the PageHeader. + */ + virtual ~PageHeader(); + + /*! + * Returns true if the header parsed properly and is valid. + */ + bool isValid() const; + + /*! + * Ogg pages contain a list of packets (which are used by the contained + * codecs). The sizes of these pages is encoded in the page header. This + * returns a list of the packet sizes in bytes. + * + * \see setPacketSizes() + */ + List packetSizes() const; + + /*! + * Sets the sizes of the packets in this page to \a sizes. Internally this + * updates the lacing values in the header. + * + * \see packetSizes() + */ + void setPacketSizes(const List &sizes); + + /*! + * Some packets can be continued across multiple pages. If the + * first packet in the current page is a continuation this will return + * true. If this is page starts with a new packet this will return false. + * + * \see lastPacketCompleted() + * \see setFirstPacketContinued() + */ + bool firstPacketContinued() const; + + /*! + * Sets the internal flag indicating if the first packet in this page is + * continued to \a continued. + * + * \see firstPacketContinued() + */ + void setFirstPacketContinued(bool continued); + + /*! + * Returns true if the last packet of this page is completely contained in + * this page. + * + * \see firstPacketContinued() + * \see setLastPacketCompleted() + */ + bool lastPacketCompleted() const; + + /*! + * Sets the internal flag indicating if the last packet in this page is + * complete to \a completed. + * + * \see lastPacketCompleted() + */ + void setLastPacketCompleted(bool completed); + + /*! + * This returns true if this is the first page of the Ogg (logical) stream. + * + * \see setFirstPageOfStream() + */ + bool firstPageOfStream() const; + + /*! + * Marks this page as the first page of the Ogg stream. + * + * \see firstPageOfStream() + */ + void setFirstPageOfStream(bool first); + + /*! + * This returns true if this is the last page of the Ogg (logical) stream. + * + * \see setLastPageOfStream() + */ + bool lastPageOfStream() const; + + /*! + * Marks this page as the last page of the Ogg stream. + * + * \see lastPageOfStream() + */ + void setLastPageOfStream(bool last); + + /*! + * A special value of containing the position of the packet to be + * interpreted by the codec. In the case of Vorbis this contains the PCM + * value and is used to calculate the length of the stream. + * + * \see setAbsoluteGranularPosition() + */ + long long absoluteGranularPosition() const; + + /*! + * A special value of containing the position of the packet to be + * interpreted by the codec. It is only supported here so that it may be + * coppied from one page to another. + * + * \see absoluteGranularPosition() + */ + void setAbsoluteGranularPosition(long long agp); + + /*! + * Every Ogg logical stream is given a random serial number which is common + * to every page in that logical stream. This returns the serial number of + * the stream associated with this packet. + * + * \see setStreamSerialNumber() + */ + uint streamSerialNumber() const; + + /*! + * Every Ogg logical stream is given a random serial number which is common + * to every page in that logical stream. This sets this pages serial + * number. This method should be used when adding new pages to a logical + * stream. + * + * \see streamSerialNumber() + */ + void setStreamSerialNumber(uint n); + + /*! + * Returns the index of the page within the Ogg stream. This helps make it + * possible to determine if pages have been lost. + * + * \see setPageSequenceNumber() + */ + int pageSequenceNumber() const; + + /*! + * Sets the page's position in the stream to \a sequenceNumber. + * + * \see pageSequenceNumber() + */ + void setPageSequenceNumber(int sequenceNumber); + + /*! + * Returns the complete header size. + */ + int size() const; + + /*! + * Returns the size of the data portion of the page -- i.e. the size of the + * page less the header size. + */ + int dataSize() const; + + /*! + * Render the page header to binary data. + * + * \note The checksum -- bytes 22 - 25 -- will be left empty and must be + * filled in when rendering the entire page. + */ + ByteVector render() const; + + private: + PageHeader(const PageHeader &); + PageHeader &operator=(const PageHeader &); + + void read(); + ByteVector lacingValues() const; + + class PageHeaderPrivate; + PageHeaderPrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/popularimeterframe.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/popularimeterframe.h new file mode 100644 index 0000000..d39f1aa --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/popularimeterframe.h @@ -0,0 +1,132 @@ +/*************************************************************************** + copyright : (C) 2008 by Lukas Lalinsky + email : lalinsky@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_POPULARIMETERFRAME_H +#define TAGLIB_POPULARIMETERFRAME_H + +#include "id3v2frame.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An implementation of ID3v2 "popularimeter" + + /*! + * This implements the ID3v2 popularimeter (POPM frame). It concists of + * an email, a rating and an optional counter. + */ + + class TAGLIB_EXPORT PopularimeterFrame : public Frame + { + friend class FrameFactory; + + public: + /*! + * Construct an empty popularimeter frame. + */ + explicit PopularimeterFrame(); + + /*! + * Construct a popularimeter based on the data in \a data. + */ + explicit PopularimeterFrame(const ByteVector &data); + + /*! + * Destroys this PopularimeterFrame instance. + */ + virtual ~PopularimeterFrame(); + + /*! + * Returns the text of this popularimeter. + * + * \see text() + */ + virtual String toString() const; + + /*! + * Returns the email. + * + * \see setEmail() + */ + String email() const; + + /*! + * Set the email. + * + * \see email() + */ + void setEmail(const String &email); + + /*! + * Returns the rating. + * + * \see setRating() + */ + int rating() const; + + /*! + * Set the rating. + * + * \see rating() + */ + void setRating(int rating); + + /*! + * Returns the counter. + * + * \see setCounter() + */ + uint counter() const; + + /*! + * Set the counter. + * + * \see counter() + */ + void setCounter(uint counter); + + protected: + // Reimplementations. + + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + /*! + * The constructor used by the FrameFactory. + */ + PopularimeterFrame(const ByteVector &data, Header *h); + PopularimeterFrame(const PopularimeterFrame &); + PopularimeterFrame &operator=(const PopularimeterFrame &); + + class PopularimeterFramePrivate; + PopularimeterFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/privateframe.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/privateframe.h new file mode 100644 index 0000000..06f82f3 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/privateframe.h @@ -0,0 +1,111 @@ +/*************************************************************************** + copyright : (C) 2008 by Serkan Kalyoncu + copyright : (C) 2008 by Scott Wheeler + email : wheeler@kde.org +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_PRIVATEFRAME_H +#define TAGLIB_PRIVATEFRAME_H + +#include "id3v2frame.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An implementation of ID3v2 privateframe + + class TAGLIB_EXPORT PrivateFrame : public Frame + { + friend class FrameFactory; + + public: + /*! + * Construct an empty private frame. + */ + PrivateFrame(); + + /*! + * Construct a private frame based on the data in \a data. + * + * \note This is the constructor used when parsing the frame from a file. + */ + explicit PrivateFrame(const ByteVector &data); + + /*! + * Destroys this private frame instance. + */ + virtual ~PrivateFrame(); + + /*! + * Returns the text of this private frame, currently just the owner. + * + * \see text() + */ + virtual String toString() const; + + /*! + * \return The owner of the private frame. + * \note This should contain an email address or link to a website. + */ + String owner() const; + + /*! + * + */ + ByteVector data() const; + + /*! + * Sets the owner of the frame to \a s. + * \note This should contain an email address or link to a website. + */ + void setOwner(const String &s); + + /*! + * + */ + void setData(const ByteVector &v); + + protected: + // Reimplementations. + + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + /*! + * The constructor used by the FrameFactory. + */ + PrivateFrame(const ByteVector &data, Header *h); + + PrivateFrame(const PrivateFrame &); + PrivateFrame &operator=(const PrivateFrame &); + + class PrivateFramePrivate; + PrivateFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/relativevolumeframe.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/relativevolumeframe.h new file mode 100644 index 0000000..dad4e7d --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/relativevolumeframe.h @@ -0,0 +1,274 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_RELATIVEVOLUMEFRAME_H +#define TAGLIB_RELATIVEVOLUMEFRAME_H + +#include "tlist.h" +#include "id3v2frame.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An ID3v2 relative volume adjustment frame implementation + + /*! + * This is an implementation of ID3v2 relative volume adjustment. The + * presence of this frame makes it possible to specify an increase in volume + * for an audio file or specific audio tracks in that file. + * + * Multiple relative volume adjustment frames may be present in the tag + * each with a unique identification and describing volume adjustment for + * different channel types. + */ + + class TAGLIB_EXPORT RelativeVolumeFrame : public Frame + { + friend class FrameFactory; + + public: + + /*! + * This indicates the type of volume adjustment that should be applied. + */ + enum ChannelType { + //! A type not enumerated below + Other = 0x00, + //! The master volume for the track + MasterVolume = 0x01, + //! The front right audio channel + FrontRight = 0x02, + //! The front left audio channel + FrontLeft = 0x03, + //! The back right audio channel + BackRight = 0x04, + //! The back left audio channel + BackLeft = 0x05, + //! The front center audio channel + FrontCentre = 0x06, + //! The back center audio channel + BackCentre = 0x07, + //! The subwoofer audio channel + Subwoofer = 0x08 + }; + + //! Struct that stores the relevant values for ID3v2 peak volume + + /*! + * The peak volume is described as a series of bits that is padded to fill + * a block of bytes. These two values should always be updated in tandem. + */ + struct PeakVolume + { + /*! + * Constructs an empty peak volume description. + */ + PeakVolume() : bitsRepresentingPeak(0) {} + /*! + * The number of bits (in the range of 0 to 255) used to describe the + * peak volume. + */ + unsigned char bitsRepresentingPeak; + /*! + * The array of bits (represented as a series of bytes) used to describe + * the peak volume. + */ + ByteVector peakVolume; + }; + + /*! + * Constructs a RelativeVolumeFrame. The relevant data should be set + * manually. + */ + RelativeVolumeFrame(); + + /*! + * Constructs a RelativeVolumeFrame based on the contents of \a data. + */ + RelativeVolumeFrame(const ByteVector &data); + + /*! + * Destroys the RelativeVolumeFrame instance. + */ + virtual ~RelativeVolumeFrame(); + + /*! + * Returns the frame's identification. + * + * \see identification() + */ + virtual String toString() const; + + /*! + * Returns a list of channels with information currently in the frame. + */ + List channels() const; + + /*! + * \deprecated Always returns master volume. + */ + ChannelType channelType() const; + + /*! + * \deprecated This method no longer has any effect. + */ + void setChannelType(ChannelType t); + + /* + * There was a terrible API goof here, and while this can't be changed to + * the way it appears below for binary compaibility reasons, let's at + * least pretend that it looks clean. + */ + +#ifdef DOXYGEN + + /*! + * Returns the relative volume adjustment "index". As indicated by the + * ID3v2 standard this is a 16-bit signed integer that reflects the + * decibils of adjustment when divided by 512. + * + * This defaults to returning the value for the master volume channel if + * available and returns 0 if the specified channel does not exist. + * + * \see setVolumeAdjustmentIndex() + * \see volumeAjustment() + */ + short volumeAdjustmentIndex(ChannelType type = MasterVolume) const; + + /*! + * Set the volume adjustment to \a index. As indicated by the ID3v2 + * standard this is a 16-bit signed integer that reflects the decibils of + * adjustment when divided by 512. + * + * By default this sets the value for the master volume. + * + * \see volumeAdjustmentIndex() + * \see setVolumeAjustment() + */ + void setVolumeAdjustmentIndex(short index, ChannelType type = MasterVolume); + + /*! + * Returns the relative volume adjustment in decibels. + * + * \note Because this is actually stored internally as an "index" to this + * value the value returned by this method may not be identical to the + * value set using setVolumeAdjustment(). + * + * This defaults to returning the value for the master volume channel if + * available and returns 0 if the specified channel does not exist. + * + * \see setVolumeAdjustment() + * \see volumeAdjustmentIndex() + */ + float volumeAdjustment(ChannelType type = MasterVolume) const; + + /*! + * Set the relative volume adjustment in decibels to \a adjustment. + * + * By default this sets the value for the master volume. + * + * \note Because this is actually stored internally as an "index" to this + * value the value set by this method may not be identical to the one + * returned by volumeAdjustment(). + * + * \see setVolumeAdjustment() + * \see volumeAdjustmentIndex() + */ + void setVolumeAdjustment(float adjustment, ChannelType type = MasterVolume); + + /*! + * Returns the peak volume (represented as a length and a string of bits). + * + * This defaults to returning the value for the master volume channel if + * available and returns 0 if the specified channel does not exist. + * + * \see setPeakVolume() + */ + PeakVolume peakVolume(ChannelType type = MasterVolume) const; + + /*! + * Sets the peak volume to \a peak. + * + * By default this sets the value for the master volume. + * + * \see peakVolume() + */ + void setPeakVolume(const PeakVolume &peak, ChannelType type = MasterVolume); + +#else + + // BIC: Combine each of the following pairs of functions (or maybe just + // rework this junk altogether). + + short volumeAdjustmentIndex(ChannelType type) const; + short volumeAdjustmentIndex() const; + + void setVolumeAdjustmentIndex(short index, ChannelType type); + void setVolumeAdjustmentIndex(short index); + + float volumeAdjustment(ChannelType type) const; + float volumeAdjustment() const; + + void setVolumeAdjustment(float adjustment, ChannelType type); + void setVolumeAdjustment(float adjustment); + + PeakVolume peakVolume(ChannelType type) const; + PeakVolume peakVolume() const; + + void setPeakVolume(const PeakVolume &peak, ChannelType type); + void setPeakVolume(const PeakVolume &peak); + +#endif + + /*! + * Returns the identification for this frame. + */ + String identification() const; + + /*! + * Sets the identification of the frame to \a s. The string + * is used to identify the situation and/or device where this + * adjustment should apply. + */ + void setIdentification(const String &s); + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + RelativeVolumeFrame(const ByteVector &data, Header *h); + RelativeVolumeFrame(const RelativeVolumeFrame &); + RelativeVolumeFrame &operator=(const RelativeVolumeFrame &); + + class RelativeVolumeFramePrivate; + RelativeVolumeFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/rifffile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/rifffile.h new file mode 100644 index 0000000..e418dbb --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/rifffile.h @@ -0,0 +1,122 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_RIFFFILE_H +#define TAGLIB_RIFFFILE_H + +#include "taglib_export.h" +#include "tfile.h" + +namespace TagLib { + + //! An implementation of TagLib::File with RIFF specific methods + + namespace RIFF { + + //! An RIFF file class with some useful methods specific to RIFF + + /*! + * This implements the generic TagLib::File API and additionally provides + * access to properties that are distinct to RIFF files, notably access + * to the different ID3 tags. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + protected: + + enum Endianness { BigEndian, LittleEndian }; + + File(FileName file, Endianness endianness); + File(IOStream *stream, Endianness endianness); + + /*! + * \return The size of the main RIFF chunk. + */ + uint riffSize() const; + + /*! + * \return The number of chunks in the file. + */ + uint chunkCount() const; + + /*! + * \return The offset within the file for the selected chunk number. + */ + uint chunkOffset(uint i) const; + + /*! + * \return The size of the chunk data. + */ + uint chunkDataSize(uint i) const; + + /*! + * \return The size of the padding after the chunk (can be either 0 or 1). + */ + uint chunkPadding(uint i) const; + + /*! + * \return The name of the specified chunk, for instance, "COMM" or "ID3 " + */ + ByteVector chunkName(uint i) const; + + /*! + * Reads the chunk data from the file and returns it. + * + * \note This \e will move the read pointer for the file. + */ + ByteVector chunkData(uint i); + + /*! + * Sets the data for the chunk \a name to \a data. If a chunk with the + * given name already exists it will be overwritten, otherwise it will be + * created after the existing chunks. + * + * \warning This will update the file immediately. + */ + void setChunkData(const ByteVector &name, const ByteVector &data); + + private: + File(const File &); + File &operator=(const File &); + + void read(); + void writeChunk(const ByteVector &name, const ByteVector &data, + ulong offset, ulong replace = 0, + uint leadingPadding = 0); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/speexfile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/speexfile.h new file mode 100644 index 0000000..c14cf2a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/speexfile.h @@ -0,0 +1,107 @@ +/*************************************************************************** + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + (original Vorbis implementation) +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_SPEEXFILE_H +#define TAGLIB_SPEEXFILE_H + +#include "oggfile.h" +#include "xiphcomment.h" + +#include "speexproperties.h" + +namespace TagLib { + + namespace Ogg { + + //! A namespace containing classes for Speex metadata + + namespace Speex { + + //! An implementation of Ogg::File with Speex specific methods + + /*! + * This is the central class in the Ogg Speex metadata processing collection + * of classes. It's built upon Ogg::File which handles processing of the Ogg + * logical bitstream and breaking it down into pages which are handled by + * the codec implementations, in this case Speex specifically. + */ + + class TAGLIB_EXPORT File : public Ogg::File + { + public: + /*! + * Contructs a Speex file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs a Speex file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the XiphComment for this file. XiphComment implements the tag + * interface, so this serves as the reimplementation of + * TagLib::File::tag(). + */ + virtual Ogg::XiphComment *tag() const; + + /*! + * Returns the Speex::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + virtual bool save(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + + class FilePrivate; + FilePrivate *d; + }; + } + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/speexproperties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/speexproperties.h new file mode 100644 index 0000000..4720bd8 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/speexproperties.h @@ -0,0 +1,89 @@ +/*************************************************************************** + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + (original Vorbis implementation) +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_SPEEXPROPERTIES_H +#define TAGLIB_SPEEXPROPERTIES_H + +#include "audioproperties.h" + +namespace TagLib { + + namespace Ogg { + + namespace Speex { + + class File; + + //! An implementation of audio property reading for Ogg Speex + + /*! + * This reads the data from an Ogg Speex stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of Speex::Properties with the data read from the + * Speex::File \a file. + */ + Properties(File *file, ReadStyle style = Average); + + /*! + * Destroys this Speex::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns the Speex version, currently "0" (as specified by the spec). + */ + int speexVersion() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tag.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tag.h new file mode 100644 index 0000000..76c9a82 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tag.h @@ -0,0 +1,201 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_TAG_H +#define TAGLIB_TAG_H + +#include "taglib_export.h" +#include "tstring.h" + +namespace TagLib { + + //! A simple, generic interface to common audio meta data fields + + /*! + * This is an attempt to abstract away the difference in the meta data formats + * of various audio codecs and tagging schemes. As such it is generally a + * subset of what is available in the specific formats but should be suitable + * for most applications. This is meant to compliment the generic APIs found + * in TagLib::AudioProperties, TagLib::File and TagLib::FileRef. + */ + + class PropertyMap; + + class TAGLIB_EXPORT Tag + { + public: + + /*! + * Detroys this Tag instance. + */ + virtual ~Tag(); + + /*! + * Exports the tags of the file as dictionary mapping (human readable) tag + * names (Strings) to StringLists of tag values. + * The default implementation in this class considers only the usual built-in + * tags (artist, album, ...) and only one value per key. + */ + PropertyMap properties() const; + + /*! + * Removes unsupported properties, or a subset of them, from the tag. + * The parameter \a properties must contain only entries from + * properties().unsupportedData(). + * BIC: Will become virtual in future releases. Currently the non-virtual + * standard implementation of TagLib::Tag does nothing, since there are + * no unsupported elements. + */ + void removeUnsupportedProperties(const StringList& properties); + + /*! + * Sets the tags of this File to those specified in \a properties. This default + * implementation sets only the tags for which setter methods exist in this class + * (artist, album, ...), and only one value per key; the rest will be contained + * in the returned PropertyMap. + */ + PropertyMap setProperties(const PropertyMap &properties); + + /*! + * Returns the track name; if no track name is present in the tag + * String::null will be returned. + */ + virtual String title() const = 0; + + /*! + * Returns the artist name; if no artist name is present in the tag + * String::null will be returned. + */ + virtual String artist() const = 0; + + /*! + * Returns the album name; if no album name is present in the tag + * String::null will be returned. + */ + virtual String album() const = 0; + + /*! + * Returns the track comment; if no comment is present in the tag + * String::null will be returned. + */ + virtual String comment() const = 0; + + /*! + * Returns the genre name; if no genre is present in the tag String::null + * will be returned. + */ + virtual String genre() const = 0; + + /*! + * Returns the year; if there is no year set, this will return 0. + */ + virtual uint year() const = 0; + + /*! + * Returns the track number; if there is no track number set, this will + * return 0. + */ + virtual uint track() const = 0; + + /*! + * Sets the title to \a s. If \a s is String::null then this value will be + * cleared. + */ + virtual void setTitle(const String &s) = 0; + + /*! + * Sets the artist to \a s. If \a s is String::null then this value will be + * cleared. + */ + virtual void setArtist(const String &s) = 0; + + /*! + * Sets the album to \a s. If \a s is String::null then this value will be + * cleared. + */ + virtual void setAlbum(const String &s) = 0; + + /*! + * Sets the comment to \a s. If \a s is String::null then this value will be + * cleared. + */ + virtual void setComment(const String &s) = 0; + + /*! + * Sets the genre to \a s. If \a s is String::null then this value will be + * cleared. For tag formats that use a fixed set of genres, the appropriate + * value will be selected based on a string comparison. A list of available + * genres for those formats should be available in that type's + * implementation. + */ + virtual void setGenre(const String &s) = 0; + + /*! + * Sets the year to \a i. If \a s is 0 then this value will be cleared. + */ + virtual void setYear(uint i) = 0; + + /*! + * Sets the track to \a i. If \a s is 0 then this value will be cleared. + */ + virtual void setTrack(uint i) = 0; + + /*! + * Returns true if the tag does not contain any data. This should be + * reimplemented in subclasses that provide more than the basic tagging + * abilities in this class. + */ + virtual bool isEmpty() const; + + /*! + * Copies the generic data from one tag to another. + * + * \note This will no affect any of the lower level details of the tag. For + * instance if any of the tag type specific data (maybe a URL for a band) is + * set, this will not modify or copy that. This just copies using the API + * in this class. + * + * If \a overwrite is true then the values will be unconditionally copied. + * If false only empty values will be overwritten. + */ + static void duplicate(const Tag *source, Tag *target, bool overwrite = true); + + protected: + /*! + * Construct a Tag. This is protected since tags should only be instantiated + * through subclasses. + */ + Tag(); + + private: + Tag(const Tag &); + Tag &operator=(const Tag &); + + class TagPrivate; + TagPrivate *d; + }; +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/taglib.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/taglib.h new file mode 100644 index 0000000..dda9c83 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/taglib.h @@ -0,0 +1,226 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_H +#define TAGLIB_H + +#define TAGLIB_MAJOR_VERSION 1 +#define TAGLIB_MINOR_VERSION 7 +#define TAGLIB_PATCH_VERSION 0 + +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 1)) +#define TAGLIB_IGNORE_MISSING_DESTRUCTOR _Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"") +#else +#define TAGLIB_IGNORE_MISSING_DESTRUCTOR +#endif + +#if (defined(_MSC_VER) && _MSC_VER >= 1600) +#define TAGLIB_CONSTRUCT_BITSET(x) static_cast(x) +#else +#define TAGLIB_CONSTRUCT_BITSET(x) static_cast(x) +#endif + +#include + +#ifdef __APPLE__ +# include +# define TAGLIB_ATOMIC_MAC +#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define NOMINMAX +# include +# define TAGLIB_ATOMIC_WIN +#elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 401) \ + && (defined(__i386__) || defined(__i486__) || defined(__i586__) || \ + defined(__i686__) || defined(__x86_64) || defined(__ia64)) \ + && !defined(__INTEL_COMPILER) +# define TAGLIB_ATOMIC_GCC +#elif defined(__ia64) && defined(__INTEL_COMPILER) +# include +# define TAGLIB_ATOMIC_GCC +#endif + +//! A namespace for all TagLib related classes and functions + +/*! + * This namespace contains everything in TagLib. For projects working with + * TagLib extensively it may be convenient to add a + * \code + * using namespace TagLib; + * \endcode + */ + +namespace TagLib { + + class String; + + typedef wchar_t wchar; + typedef unsigned char uchar; + typedef unsigned short ushort; + typedef unsigned int uint; + typedef unsigned long ulong; + + /*! + * Unfortunately std::wstring isn't defined on some systems, (i.e. GCC < 3) + * so I'm providing something here that should be constant. + */ + typedef std::basic_string wstring; + +#ifndef DO_NOT_DOCUMENT // Tell Doxygen to skip this class. + /*! + * \internal + * This is just used as a base class for shared classes in TagLib. + * + * \warning This is not part of the TagLib public API! + */ + + class RefCounter + { + public: + RefCounter() : refCount(1) {} + +#ifdef TAGLIB_ATOMIC_MAC + void ref() { OSAtomicIncrement32Barrier(const_cast(&refCount)); } + bool deref() { return ! OSAtomicDecrement32Barrier(const_cast(&refCount)); } + int32_t count() { return refCount; } + private: + volatile int32_t refCount; +#elif defined(TAGLIB_ATOMIC_WIN) + void ref() { InterlockedIncrement(&refCount); } + bool deref() { return ! InterlockedDecrement(&refCount); } + long count() { return refCount; } + private: + volatile long refCount; +#elif defined(TAGLIB_ATOMIC_GCC) + void ref() { __sync_add_and_fetch(&refCount, 1); } + bool deref() { return ! __sync_sub_and_fetch(&refCount, 1); } + int count() { return refCount; } + private: + volatile int refCount; +#else + void ref() { refCount++; } + bool deref() { return ! --refCount; } + int count() { return refCount; } + private: + uint refCount; +#endif + + }; + +#endif // DO_NOT_DOCUMENT + +} + +/*! + * \mainpage TagLib + * + * \section intro Introduction + * + * TagLib is a library for reading and editing audio meta data, commonly know as \e tags. + * + * Features: + * - A clean, high level, C++ API to handling audio meta data. + * - Format specific APIs for advanced API users. + * - ID3v1, ID3v2, APE, FLAC, Xiph, iTunes-style MP4 and WMA tag formats. + * - MP3, MPC, FLAC, MP4, ASF, AIFF, WAV, TrueAudio, WavPack, Ogg FLAC, Ogg Vorbis and Speex file formats. + * - Basic audio file properties such as length, sample rate, etc. + * - Long term binary and source compatibility. + * - Extensible design, notably the ability to add other formats or extend current formats as a library user. + * - Full support for unicode and internationalized tags. + * - Dual MPL and + * LGPL licenses. + * - No external toolkit dependancies. + * + * \section why Why TagLib? + * + * TagLib originally was written to provide an updated and improved ID3v2 implementation in C++ for use + * in a variety of Open Source projects. Since development began in 2002 and the 1.0 release in 2004 + * it has expanded to cover a wide variety of tag and file formats and is used in a wide variety of + * Open Source and proprietary applications. It now supports a variety of UNIXes, including Apple's OS + * X, as well as Microsoft Windows. + * + * \section commercial Usage in Commercial Applications + * + * TagLib's licenses \e do allow usage within propriety (\e closed) applications, however TagLib is \e not + * public domain. Please note the requirements of the LGPL or MPL, and adhere to at least one of them. + * In simple terms, you must at a minimum note your usage of TagLib, note the licensing terms of TagLib and + * if you make changes to TagLib publish them. Please review the licenses above before using TagLib in your + * software. Note that you may choose either the MPL or the LGPL, you do not have to fulfill the + * requirements of both. + * + * \section installing Installing TagLib + * + * Please see the TagLib website for the latest + * downloads. + * + * TagLib can be built using the CMake build system. TagLib installs a taglib-config and pkg-config file to + * make it easier to integrate into various build systems. Note that TagLib's include install directory \e must + * be included in the header include path. Simply adding will \e not work. + * + * \section start Getting Started + * + * TagLib provides both simple, abstract APIs which make it possible to ignore the differences between tagging + * formats and format specific APIs which allow programmers to work with the features of specific tagging + * schemes. There is a similar abstraction mechanism for AudioProperties. + * + * The best place to start is with the Class Hierarchy linked at the top of the page. The File and + * AudioProperties classes and their subclasses are the core of TagLib. The FileRef class is also a convenient + * way for using a value-based handle. + * + * \note When working with FileRef please consider that it has only the most basic (extension-based) file + * type resolution. Please see its documentation on how to plug in more advanced file type resolution. (Such + * resolution may be part of later TagLib releases by default.) + * + * Here's a very simple example with TagLib: + * + * \code + * + * TagLib::FileRef f("Latex Solar Beef.mp3"); + * TagLib::String artist = f.tag()->artist(); // artist == "Frank Zappa" + * + * f.tag()->setAlbum("Fillmore East"); + * f.save(); + * + * TagLib::FileRef g("Free City Rhymes.ogg"); + * TagLib::String album = g.tag()->album(); // album == "NYC Ghosts & Flowers" + * + * g.tag()->setTrack(1); + * g.save(); + * + * \endcode + * + * More examples can be found in the \e examples directory of the source distribution. + * + * \section Contact + * + * Questions about TagLib should be directed to the TagLib mailing list, not directly to the author. + * + * - TagLib Homepage + * - TagLib Mailing List (taglib-devel@kde.org) + * + * \author Scott Wheeler et al. + * + */ + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/taglib_export.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/taglib_export.h new file mode 100644 index 0000000..3e86855 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/taglib_export.h @@ -0,0 +1,47 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_EXPORT_H +#define TAGLIB_EXPORT_H + +#if defined(TAGLIB_STATIC) +#define TAGLIB_EXPORT +#elif (defined(_WIN32) || defined(_WIN64)) +#ifdef MAKE_TAGLIB_LIB +#define TAGLIB_EXPORT __declspec(dllexport) +#else +#define TAGLIB_EXPORT __declspec(dllimport) +#endif +#elif defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 1) +#define TAGLIB_EXPORT __attribute__ ((visibility("default"))) +#else +#define TAGLIB_EXPORT +#endif + +#ifndef TAGLIB_NO_CONFIG +#include "taglib_config.h" +#endif + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tagunion.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tagunion.h new file mode 100644 index 0000000..e94d523 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tagunion.h @@ -0,0 +1,95 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_TAGUNION_H +#define TAGLIB_TAGUNION_H + +#include "tag.h" + +#ifndef DO_NOT_DOCUMENT + +namespace TagLib { + + /*! + * \internal + */ + + class TagUnion : public Tag + { + public: + + enum AccessType { Read, Write }; + + /*! + * Creates a TagLib::Tag that is the union of \a first, \a second, and + * \a third. The TagUnion takes ownership of these tags and will handle + * their deletion. + */ + TagUnion(Tag *first = 0, Tag *second = 0, Tag *third = 0); + + virtual ~TagUnion(); + + Tag *operator[](int index) const; + Tag *tag(int index) const; + + void set(int index, Tag *tag); + + virtual String title() const; + virtual String artist() const; + virtual String album() const; + virtual String comment() const; + virtual String genre() const; + virtual uint year() const; + virtual uint track() const; + + virtual void setTitle(const String &s); + virtual void setArtist(const String &s); + virtual void setAlbum(const String &s); + virtual void setComment(const String &s); + virtual void setGenre(const String &s); + virtual void setYear(uint i); + virtual void setTrack(uint i); + virtual bool isEmpty() const; + + template T *access(int index, bool create) + { + if(!create || tag(index)) + return static_cast(tag(index)); + + set(index, new T); + return static_cast(tag(index)); + } + + private: + TagUnion(const Tag &); + TagUnion &operator=(const Tag &); + + class TagUnionPrivate; + TagUnionPrivate *d; + }; +} + +#endif +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tbytevector.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tbytevector.h new file mode 100644 index 0000000..0c58326 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tbytevector.h @@ -0,0 +1,425 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_BYTEVECTOR_H +#define TAGLIB_BYTEVECTOR_H + +#include "taglib.h" +#include "taglib_export.h" + +#include +#include + +namespace TagLib { + + //! A byte vector + + /*! + * This class provides a byte vector with some methods that are useful for + * tagging purposes. Many of the search functions are tailored to what is + * useful for finding tag related paterns in a data array. + */ + + class TAGLIB_EXPORT ByteVector + { + public: +#ifndef DO_NOT_DOCUMENT + typedef std::vector::iterator Iterator; + typedef std::vector::const_iterator ConstIterator; +#endif + + /*! + * Constructs an empty byte vector. + */ + ByteVector(); + + /*! + * Construct a vector of size \a size with all values set to \a value by + * default. + */ + ByteVector(uint size, char value = 0); + + /*! + * Contructs a byte vector that is a copy of \a v. + */ + ByteVector(const ByteVector &v); + + /*! + * Contructs a byte vector that contains \a c. + */ + ByteVector(char c); + + /*! + * Constructs a byte vector that copies \a data for up to \a length bytes. + */ + ByteVector(const char *data, uint length); + + /*! + * Constructs a byte vector that copies \a data up to the first null + * byte. The behavior is undefined if \a data is not null terminated. + * This is particularly useful for constructing byte arrays from string + * constants. + */ + ByteVector(const char *data); + + /*! + * Destroys this ByteVector instance. + */ + virtual ~ByteVector(); + + /*! + * Sets the data for the byte array using the first \a length bytes of \a data + */ + ByteVector &setData(const char *data, uint length); + + /*! + * Sets the data for the byte array copies \a data up to the first null + * byte. The behavior is undefined if \a data is not null terminated. + */ + ByteVector &setData(const char *data); + + /*! + * Returns a pointer to the internal data structure. + * + * \warning Care should be taken when modifying this data structure as it is + * easy to corrupt the ByteVector when doing so. Specifically, while the + * data may be changed, its length may not be. + */ + char *data(); + + /*! + * Returns a pointer to the internal data structure which may not be modified. + */ + const char *data() const; + + /*! + * Returns a byte vector made up of the bytes starting at \a index and + * for \a length bytes. If \a length is not specified it will return the bytes + * from \a index to the end of the vector. + */ + ByteVector mid(uint index, uint length = 0xffffffff) const; + + /*! + * This essentially performs the same as operator[](), but instead of causing + * a runtime error if the index is out of bounds, it will return a null byte. + */ + char at(uint index) const; + + /*! + * Searches the ByteVector for \a pattern starting at \a offset and returns + * the offset. Returns -1 if the pattern was not found. If \a byteAlign is + * specified the pattern will only be matched if it starts on a byte divisible + * by \a byteAlign (starting from \a offset). + */ + int find(const ByteVector &pattern, uint offset = 0, int byteAlign = 1) const; + + /*! + * Searches the ByteVector for \a pattern starting from either the end of the + * vector or \a offset and returns the offset. Returns -1 if the pattern was + * not found. If \a byteAlign is specified the pattern will only be matched + * if it starts on a byte divisible by \a byteAlign (starting from \a offset). + */ + int rfind(const ByteVector &pattern, uint offset = 0, int byteAlign = 1) const; + + /*! + * Checks to see if the vector contains the \a pattern starting at position + * \a offset. Optionally, if you only want to search for part of the pattern + * you can specify an offset within the pattern to start from. Also, you can + * specify to only check for the first \a patternLength bytes of \a pattern with + * the \a patternLength argument. + */ + bool containsAt(const ByteVector &pattern, uint offset, uint patternOffset = 0, uint patternLength = 0xffffffff) const; + + /*! + * Returns true if the vector starts with \a pattern. + */ + bool startsWith(const ByteVector &pattern) const; + + /*! + * Returns true if the vector ends with \a pattern. + */ + bool endsWith(const ByteVector &pattern) const; + + /*! + * Replaces \a pattern with \a with and returns a reference to the ByteVector + * after the operation. This \e does modify the vector. + */ + ByteVector &replace(const ByteVector &pattern, const ByteVector &with); + + /*! + * Checks for a partial match of \a pattern at the end of the vector. It + * returns the offset of the partial match within the vector, or -1 if the + * pattern is not found. This method is particularly useful when searching for + * patterns that start in one vector and end in another. When combined with + * startsWith() it can be used to find a pattern that overlaps two buffers. + * + * \note This will not match the complete pattern at the end of the string; use + * endsWith() for that. + */ + int endsWithPartialMatch(const ByteVector &pattern) const; + + /*! + * Appends \a v to the end of the ByteVector. + */ + ByteVector &append(const ByteVector &v); + + /*! + * Clears the data. + */ + ByteVector &clear(); + + /*! + * Returns the size of the array. + */ + uint size() const; + + /*! + * Resize the vector to \a size. If the vector is currently less than + * \a size, pad the remaining spaces with \a padding. Returns a reference + * to the resized vector. + */ + ByteVector &resize(uint size, char padding = 0); + + /*! + * Returns an Iterator that points to the front of the vector. + */ + Iterator begin(); + + /*! + * Returns a ConstIterator that points to the front of the vector. + */ + ConstIterator begin() const; + + /*! + * Returns an Iterator that points to the back of the vector. + */ + Iterator end(); + + /*! + * Returns a ConstIterator that points to the back of the vector. + */ + ConstIterator end() const; + + /*! + * Returns true if the vector is null. + * + * \note A vector may be empty without being null. + * \see isEmpty() + */ + bool isNull() const; + + /*! + * Returns true if the ByteVector is empty. + * + * \see size() + * \see isNull() + */ + bool isEmpty() const; + + /*! + * Returns a CRC checksum of the byte vector's data. + */ + uint checksum() const; + + /*! + * Converts the first 4 bytes of the vector to an unsigned integer. + * + * If \a mostSignificantByteFirst is true this will operate left to right + * evaluating the integer. For example if \a mostSignificantByteFirst is + * true then $00 $00 $00 $01 == 0x00000001 == 1, if false, $01 00 00 00 == + * 0x01000000 == 1. + * + * \see fromUInt() + */ + uint toUInt(bool mostSignificantByteFirst = true) const; + + /*! + * Converts the first 2 bytes of the vector to a short. + * + * If \a mostSignificantByteFirst is true this will operate left to right + * evaluating the integer. For example if \a mostSignificantByteFirst is + * true then $00 $01 == 0x0001 == 1, if false, $01 00 == 0x01000000 == 1. + * + * \see fromShort() + */ + short toShort(bool mostSignificantByteFirst = true) const; + + /*! + * Converts the first 2 bytes of the vector to a unsigned short. + * + * If \a mostSignificantByteFirst is true this will operate left to right + * evaluating the integer. For example if \a mostSignificantByteFirst is + * true then $00 $01 == 0x0001 == 1, if false, $01 00 == 0x01000000 == 1. + * + * \see fromShort() + */ + unsigned short toUShort(bool mostSignificantByteFirst = true) const; + + /*! + * Converts the first 8 bytes of the vector to a (signed) long long. + * + * If \a mostSignificantByteFirst is true this will operate left to right + * evaluating the integer. For example if \a mostSignificantByteFirst is + * true then $00 00 00 00 00 00 00 01 == 0x0000000000000001 == 1, + * if false, $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1. + * + * \see fromUInt() + */ + long long toLongLong(bool mostSignificantByteFirst = true) const; + + /*! + * Creates a 4 byte ByteVector based on \a value. If + * \a mostSignificantByteFirst is true, then this will operate left to right + * in building the ByteVector. For example if \a mostSignificantByteFirst is + * true then $00 00 00 01 == 0x00000001 == 1, if false, $01 00 00 00 == + * 0x01000000 == 1. + * + * \see toUInt() + */ + static ByteVector fromUInt(uint value, bool mostSignificantByteFirst = true); + + /*! + * Creates a 2 byte ByteVector based on \a value. If + * \a mostSignificantByteFirst is true, then this will operate left to right + * in building the ByteVector. For example if \a mostSignificantByteFirst is + * true then $00 01 == 0x0001 == 1, if false, $01 00 == 0x0100 == 1. + * + * \see toShort() + */ + static ByteVector fromShort(short value, bool mostSignificantByteFirst = true); + + /*! + * Creates a 8 byte ByteVector based on \a value. If + * \a mostSignificantByteFirst is true, then this will operate left to right + * in building the ByteVector. For example if \a mostSignificantByteFirst is + * true then $00 00 00 01 == 0x0000000000000001 == 1, if false, + * $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1. + * + * \see toLongLong() + */ + static ByteVector fromLongLong(long long value, bool mostSignificantByteFirst = true); + + /*! + * Returns a ByteVector based on the CString \a s. + */ + static ByteVector fromCString(const char *s, uint length = 0xffffffff); + + /*! + * Returns a const refernence to the byte at \a index. + */ + const char &operator[](int index) const; + + /*! + * Returns a reference to the byte at \a index. + */ + char &operator[](int index); + + /*! + * Returns true if this ByteVector and \a v are equal. + */ + bool operator==(const ByteVector &v) const; + + /*! + * Returns true if this ByteVector and \a v are not equal. + */ + bool operator!=(const ByteVector &v) const; + + /*! + * Returns true if this ByteVector and the null terminated C string \a s + * contain the same data. + */ + bool operator==(const char *s) const; + + /*! + * Returns true if this ByteVector and the null terminated C string \a s + * do not contain the same data. + */ + bool operator!=(const char *s) const; + + /*! + * Returns true if this ByteVector is less than \a v. The value of the + * vectors is determined by evaluating the character from left to right, and + * in the event one vector is a superset of the other, the size is used. + */ + bool operator<(const ByteVector &v) const; + + /*! + * Returns true if this ByteVector is greater than \a v. + */ + bool operator>(const ByteVector &v) const; + + /*! + * Returns a vector that is \a v appended to this vector. + */ + ByteVector operator+(const ByteVector &v) const; + + /*! + * Copies ByteVector \a v. + */ + ByteVector &operator=(const ByteVector &v); + + /*! + * Copies ByteVector \a v. + */ + ByteVector &operator=(char c); + + /*! + * Copies ByteVector \a v. + */ + ByteVector &operator=(const char *data); + + /*! + * A static, empty ByteVector which is convenient and fast (since returning + * an empty or "null" value does not require instantiating a new ByteVector). + */ + static ByteVector null; + + /*! + * Returns a hex-encoded copy of the byte vector. + */ + ByteVector toHex() const; + + protected: + /* + * If this ByteVector is being shared via implicit sharing, do a deep copy + * of the data and separate from the shared members. This should be called + * by all non-const subclass members. + */ + void detach(); + + private: + class ByteVectorPrivate; + ByteVectorPrivate *d; + }; + +} + +/*! + * \relates TagLib::ByteVector + * Streams the ByteVector \a v to the output stream \a s. + */ +TAGLIB_EXPORT std::ostream &operator<<(std::ostream &s, const TagLib::ByteVector &v); + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tbytevectorlist.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tbytevectorlist.h new file mode 100644 index 0000000..5852583 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tbytevectorlist.h @@ -0,0 +1,91 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_BYTEVECTORLIST_H +#define TAGLIB_BYTEVECTORLIST_H + +#include "taglib_export.h" +#include "tbytevector.h" +#include "tlist.h" + +namespace TagLib { + + //! A list of ByteVectors + + /*! + * A List specialization with some handy features useful for ByteVectors. + */ + + class TAGLIB_EXPORT ByteVectorList : public List + { + public: + + /*! + * Construct an empty ByteVectorList. + */ + ByteVectorList(); + + /*! + * Destroys this ByteVectorList instance. + */ + virtual ~ByteVectorList(); + + /*! + * Make a shallow, implicitly shared, copy of \a l. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + ByteVectorList(const ByteVectorList &l); + + /*! + * Convert the ByteVectorList to a ByteVector separated by \a separator. By + * default a space is used. + */ + ByteVector toByteVector(const ByteVector &separator = " ") const; + + /*! + * Splits the ByteVector \a v into several strings at \a pattern. This will + * not include the pattern in the returned ByteVectors. + */ + static ByteVectorList split(const ByteVector &v, const ByteVector &pattern, + int byteAlign = 1); + /*! + * Splits the ByteVector \a v into several strings at \a pattern. This will + * not include the pattern in the returned ByteVectors. \a max is the + * maximum number of entries that will be separated. If \a max for instance + * is 2 then a maximum of 1 match will be found and the vector will be split + * on that match. + */ + // BIC: merge with the function above + static ByteVectorList split(const ByteVector &v, const ByteVector &pattern, + int byteAlign, int max); + private: + class ByteVectorListPrivate; + ByteVectorListPrivate *d; + }; + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tbytevectorstream.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tbytevectorstream.h new file mode 100644 index 0000000..456b854 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tbytevectorstream.h @@ -0,0 +1,145 @@ +/*************************************************************************** + copyright : (C) 2011 by Lukas Lalinsky + email : lalinsky@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_BYTEVECTORSTREAM_H +#define TAGLIB_BYTEVECTORSTREAM_H + +#include "taglib_export.h" +#include "taglib.h" +#include "tbytevector.h" +#include "tiostream.h" + +namespace TagLib { + + class String; + class Tag; + class AudioProperties; + + //! In-memory Stream class using ByteVector for its storage. + + class TAGLIB_EXPORT ByteVectorStream : public IOStream + { + public: + /*! + * Construct a File object and opens the \a file. \a file should be a + * be a C-string in the local file system encoding. + */ + ByteVectorStream(const ByteVector &data); + + /*! + * Destroys this ByteVectorStream instance. + */ + virtual ~ByteVectorStream(); + + /*! + * Returns the file name in the local file system encoding. + */ + FileName name() const; + + /*! + * Reads a block of size \a length at the current get pointer. + */ + ByteVector readBlock(ulong length); + + /*! + * Attempts to write the block \a data at the current get pointer. If the + * file is currently only opened read only -- i.e. readOnly() returns true -- + * this attempts to reopen the file in read/write mode. + * + * \note This should be used instead of using the streaming output operator + * for a ByteVector. And even this function is significantly slower than + * doing output with a char[]. + */ + void writeBlock(const ByteVector &data); + + /*! + * Insert \a data at position \a start in the file overwriting \a replace + * bytes of the original content. + * + * \note This method is slow since it requires rewriting all of the file + * after the insertion point. + */ + void insert(const ByteVector &data, ulong start = 0, ulong replace = 0); + + /*! + * Removes a block of the file starting a \a start and continuing for + * \a length bytes. + * + * \note This method is slow since it involves rewriting all of the file + * after the removed portion. + */ + void removeBlock(ulong start = 0, ulong length = 0); + + /*! + * Returns true if the file is read only (or if the file can not be opened). + */ + bool readOnly() const; + + /*! + * Since the file can currently only be opened as an argument to the + * constructor (sort-of by design), this returns if that open succeeded. + */ + bool isOpen() const; + + /*! + * Move the I/O pointer to \a offset in the file from position \a p. This + * defaults to seeking from the beginning of the file. + * + * \see Position + */ + void seek(long offset, Position p = Beginning); + + /*! + * Reset the end-of-file and error flags on the file. + */ + void clear(); + + /*! + * Returns the current offset within the file. + */ + long tell() const; + + /*! + * Returns the length of the file. + */ + long length(); + + /*! + * Truncates the file to a \a length. + */ + void truncate(long length); + + ByteVector *data(); + + protected: + + private: + class ByteVectorStreamPrivate; + ByteVectorStreamPrivate *d; + }; + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tdebug.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tdebug.h new file mode 100644 index 0000000..5204fe7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tdebug.h @@ -0,0 +1,71 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_DEBUG_H +#define TAGLIB_DEBUG_H + +namespace TagLib { + + class String; + class ByteVector; + +#ifndef DO_NOT_DOCUMENT +#ifndef NDEBUG + + /*! + * A simple function that prints debugging output to cerr if debugging is + * not disabled. + * + * \warning Do not use this outside of TagLib, it could lead to undefined + * symbols in your build if TagLib is built with NDEBUG defined and your + * application is not. + * + * \internal + */ + void debug(const String &s); + + /*! + * For debugging binary data. + * + * \warning Do not use this outside of TagLib, it could lead to undefined + * symbols in your build if TagLib is built with NDEBUG defined and your + * application is not. + * + * \internal + */ + void debugData(const ByteVector &v); + +#else + + // Define these to an empty statement if debugging is disabled. + +#define debug(x) +#define debugData(x) + +#endif +#endif +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/textidentificationframe.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/textidentificationframe.h new file mode 100644 index 0000000..58ed63e --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/textidentificationframe.h @@ -0,0 +1,313 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_TEXTIDENTIFICATIONFRAME_H +#define TAGLIB_TEXTIDENTIFICATIONFRAME_H + +#include "tstringlist.h" +#include "tmap.h" +#include "taglib_export.h" + +#include "id3v2frame.h" + +namespace TagLib { + + namespace ID3v2 { + + class Tag; + typedef Map KeyConversionMap; + + //! An ID3v2 text identification frame implementation + + /*! + * This is an implementation of the most common type of ID3v2 frame -- text + * identification frames. There are a number of variations on this. Those + * enumerated in the ID3v2.4 standard are: + * + *
    + *
  • TALB Album/Movie/Show title
  • + *
  • TBPM BPM (beats per minute)
  • + *
  • TCOM Composer
  • + *
  • TCON Content type
  • + *
  • TCOP Copyright message
  • + *
  • TDEN Encoding time
  • + *
  • TDLY Playlist delay
  • + *
  • TDOR Original release time
  • + *
  • TDRC Recording time
  • + *
  • TDRL Release time
  • + *
  • TDTG Tagging time
  • + *
  • TENC Encoded by
  • + *
  • TEXT Lyricist/Text writer
  • + *
  • TFLT File type
  • + *
  • TIPL Involved people list
  • + *
  • TIT1 Content group description
  • + *
  • TIT2 Title/songname/content description
  • + *
  • TIT3 Subtitle/Description refinement
  • + *
  • TKEY Initial key
  • + *
  • TLAN Language(s)
  • + *
  • TLEN Length
  • + *
  • TMCL Musician credits list
  • + *
  • TMED Media type
  • + *
  • TMOO Mood
  • + *
  • TOAL Original album/movie/show title
  • + *
  • TOFN Original filename
  • + *
  • TOLY Original lyricist(s)/text writer(s)
  • + *
  • TOPE Original artist(s)/performer(s)
  • + *
  • TOWN File owner/licensee
  • + *
  • TPE1 Lead performer(s)/Soloist(s)
  • + *
  • TPE2 Band/orchestra/accompaniment
  • + *
  • TPE3 Conductor/performer refinement
  • + *
  • TPE4 Interpreted, remixed, or otherwise modified by
  • + *
  • TPOS Part of a set
  • + *
  • TPRO Produced notice
  • + *
  • TPUB Publisher
  • + *
  • TRCK Track number/Position in set
  • + *
  • TRSN Internet radio station name
  • + *
  • TRSO Internet radio station owner
  • + *
  • TSOA Album sort order
  • + *
  • TSOP Performer sort order
  • + *
  • TSOT Title sort order
  • + *
  • TSRC ISRC (international standard recording code)
  • + *
  • TSSE Software/Hardware and settings used for encoding
  • + *
  • TSST Set subtitle
  • + *
+ * + * The ID3v2 Frames document gives a description of each of these formats + * and the expected order of strings in each. ID3v2::Header::frameID() can + * be used to determine the frame type. + * + * \note If non-Latin1 compatible strings are used with this class, even if + * the text encoding is set to Latin1, the frame will be written using UTF8 + * (with the encoding flag appropriately set in the output). + */ + + class TAGLIB_EXPORT TextIdentificationFrame : public Frame + { + friend class FrameFactory; + + public: + /*! + * Construct an empty frame of type \a type. Uses \a encoding as the + * default text encoding. + * + * \note In this case you must specify the text encoding as it + * resolves the ambiguity between constructors. + * + * \note Please see the note in the class description regarding Latin1. + */ + TextIdentificationFrame(const ByteVector &type, String::Type encoding); + + /*! + * This is a dual purpose constructor. \a data can either be binary data + * that should be parsed or (at a minimum) the frame ID. + */ + explicit TextIdentificationFrame(const ByteVector &data); + + /*! + * This is a special factory method to create a TIPL (involved people list) + * frame from the given \a properties. Will parse key=[list of values] data + * into the TIPL format as specified in the ID3 standard. + */ + static TextIdentificationFrame *createTIPLFrame(const PropertyMap &properties); + + /*! + * This is a special factory method to create a TMCL (musician credits list) + * frame from the given \a properties. Will parse key=[list of values] data + * into the TMCL format as specified in the ID3 standard, where key should be + * of the form instrumentPrefix:instrument. + */ + static TextIdentificationFrame *createTMCLFrame(const PropertyMap &properties); + /*! + * Destroys this TextIdentificationFrame instance. + */ + virtual ~TextIdentificationFrame(); + + /*! + * Text identification frames are a list of string fields. + * + * This function will accept either a StringList or a String (using the + * StringList constructor that accepts a single String). + * + * \note This will not change the text encoding of the frame even if the + * strings passed in are not of the same encoding. Please use + * setEncoding(s.type()) if you wish to change the encoding of the frame. + */ + void setText(const StringList &l); + + // Reimplementations. + + virtual void setText(const String &s); + virtual String toString() const; + + /*! + * Returns the text encoding that will be used in rendering this frame. + * This defaults to the type that was either specified in the constructor + * or read from the frame when parsed. + * + * \note Please see the note in the class description regarding Latin1. + * + * \see setTextEncoding() + * \see render() + */ + String::Type textEncoding() const; + + /*! + * Sets the text encoding to be used when rendering this frame to + * \a encoding. + * + * \note Please see the note in the class description regarding Latin1. + * + * \see textEncoding() + * \see render() + */ + void setTextEncoding(String::Type encoding); + + /*! + * Returns a list of the strings in this frame. + */ + StringList fieldList() const; + + /*! + * Returns a KeyConversionMap mapping a role as it would be used in a PropertyMap + * to the corresponding key used in a TIPL ID3 frame to describe that role. + */ + static const KeyConversionMap &involvedPeopleMap(); + + PropertyMap asProperties() const; + + protected: + // Reimplementations. + + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + /*! + * The constructor used by the FrameFactory. + */ + TextIdentificationFrame(const ByteVector &data, Header *h); + + private: + TextIdentificationFrame(const TextIdentificationFrame &); + TextIdentificationFrame &operator=(const TextIdentificationFrame &); + + /*! + * Parses the special structure of a TIPL frame + * Only the whitelisted roles "ARRANGER", "ENGINEER", "PRODUCER", + * "DJMIXER" (ID3: "DJ-MIX") and "MIXER" (ID3: "MIX") are allowed. + */ + PropertyMap makeTIPLProperties() const; + /*! + * Parses the special structure of a TMCL frame. + */ + PropertyMap makeTMCLProperties() const; + class TextIdentificationFramePrivate; + TextIdentificationFramePrivate *d; + }; + + /*! + * This is a specialization of text identification frames that allows for + * user defined entries. Each entry has a description in addition to the + * normal list of fields that a text identification frame has. + * + * This description identifies the frame and must be unique. + */ + + //! An ID3v2 custom text identification frame implementationx + + class TAGLIB_EXPORT UserTextIdentificationFrame : public TextIdentificationFrame + { + friend class FrameFactory; + + public: + /*! + * Constructs an empty user defined text identification frame. For this to be + * a useful frame both a description and text must be set. + */ + explicit UserTextIdentificationFrame(String::Type encoding = String::Latin1); + + /*! + * Creates a frame based on \a data. + */ + explicit UserTextIdentificationFrame(const ByteVector &data); + + /*! + * Creates a user defined text identification frame with the given \a description + * and \a values. + */ + UserTextIdentificationFrame(const String &description, const StringList &values, String::Type encoding = String::UTF8); + + virtual String toString() const; + + /*! + * Returns the description for this frame. + */ + String description() const; + + /*! + * Sets the description of the frame to \a s. \a s must be unique. You can + * check for the presence of another user defined text frame of the same type + * using find() and testing for null. + */ + void setDescription(const String &s); + + StringList fieldList() const; + void setText(const String &text); + void setText(const StringList &fields); + + /*! + * A UserTextIdentificationFrame is parsed into a PropertyMap as follows: + * - the key is the frame's description, uppercased + * - if the description contains '::', only the substring after that + * separator is considered as key (compatibility with exfalso) + * - if the above rules don't yield a valid key (e.g. containing non-ASCII + * characters), the returned map will contain an entry "TXXX/" + * in its unsupportedData() list. + * - The values will be copies of the fieldList(). + * - If the description() appears as value in fieldList(), it will be omitted + * in the value list, in order to be compatible with TagLib which copies + * the description() into the fieldList(). + */ + PropertyMap asProperties() const; + + /*! + * Searches for the user defined text frame with the description \a description + * in \a tag. This returns null if no matching frames were found. + */ + static UserTextIdentificationFrame *find(Tag *tag, const String &description); + + private: + UserTextIdentificationFrame(const ByteVector &data, Header *h); + UserTextIdentificationFrame(const TextIdentificationFrame &); + UserTextIdentificationFrame &operator=(const UserTextIdentificationFrame &); + + void checkFields(); + + class UserTextIdentificationFramePrivate; + UserTextIdentificationFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tfile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tfile.h new file mode 100644 index 0000000..7df774a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tfile.h @@ -0,0 +1,295 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FILE_H +#define TAGLIB_FILE_H + +#include "taglib_export.h" +#include "taglib.h" +#include "tag.h" +#include "tbytevector.h" +#include "tiostream.h" + +namespace TagLib { + + class String; + class Tag; + class AudioProperties; + class PropertyMap; + + //! A file class with some useful methods for tag manipulation + + /*! + * This class is a basic file class with some methods that are particularly + * useful for tag editors. It has methods to take advantage of + * ByteVector and a binary search method for finding patterns in a file. + */ + + class TAGLIB_EXPORT File + { + public: + /*! + * Position in the file used for seeking. + */ + enum Position { + //! Seek from the beginning of the file. + Beginning, + //! Seek from the current position in the file. + Current, + //! Seek from the end of the file. + End + }; + + /*! + * Destroys this File instance. + */ + virtual ~File(); + + /*! + * Returns the file name in the local file system encoding. + */ + FileName name() const; + + /*! + * Returns a pointer to this file's tag. This should be reimplemented in + * the concrete subclasses. + */ + virtual Tag *tag() const = 0; + + /*! + * Exports the tags of the file as dictionary mapping (human readable) tag + * names (Strings) to StringLists of tag values. Calls the according specialization + * in the File subclasses. + * For each metadata object of the file that could not be parsed into the PropertyMap + * format, the returend map's unsupportedData() list will contain one entry identifying + * that object (e.g. the frame type for ID3v2 tags). Use removeUnsupportedProperties() + * to remove (a subset of) them. + * BIC: Will be made virtual in future releases. + */ + PropertyMap properties() const; + + /*! + * Removes unsupported properties, or a subset of them, from the file's metadata. + * The parameter \a properties must contain only entries from + * properties().unsupportedData(). + * BIC: Will be mad virtual in future releases. + */ + void removeUnsupportedProperties(const StringList& properties); + + /*! + * Sets the tags of this File to those specified in \a properties. Calls the + * according specialization method in the subclasses of File to do the translation + * into the format-specific details. + * If some value(s) could not be written imported to the specific metadata format, + * the returned PropertyMap will contain those value(s). Otherwise it will be empty, + * indicating that no problems occured. + * BIC: will become pure virtual in the future + */ + PropertyMap setProperties(const PropertyMap &properties); + /*! + * Returns a pointer to this file's audio properties. This should be + * reimplemented in the concrete subclasses. If no audio properties were + * read then this will return a null pointer. + */ + virtual AudioProperties *audioProperties() const = 0; + + /*! + * Save the file and its associated tags. This should be reimplemented in + * the concrete subclasses. Returns true if the save succeeds. + * + * \warning On UNIX multiple processes are able to write to the same file at + * the same time. This can result in serious file corruption. If you are + * developing a program that makes use of TagLib from multiple processes you + * must insure that you are only doing writes to a particular file from one + * of them. + */ + virtual bool save() = 0; + + /*! + * Reads a block of size \a length at the current get pointer. + */ + ByteVector readBlock(ulong length); + + /*! + * Attempts to write the block \a data at the current get pointer. If the + * file is currently only opened read only -- i.e. readOnly() returns true -- + * this attempts to reopen the file in read/write mode. + * + * \note This should be used instead of using the streaming output operator + * for a ByteVector. And even this function is significantly slower than + * doing output with a char[]. + */ + void writeBlock(const ByteVector &data); + + /*! + * Returns the offset in the file that \a pattern occurs at or -1 if it can + * not be found. If \a before is set, the search will only continue until the + * pattern \a before is found. This is useful for tagging purposes to search + * for a tag before the synch frame. + * + * Searching starts at \a fromOffset, which defaults to the beginning of the + * file. + * + * \note This has the practial limitation that \a pattern can not be longer + * than the buffer size used by readBlock(). Currently this is 1024 bytes. + */ + long find(const ByteVector &pattern, + long fromOffset = 0, + const ByteVector &before = ByteVector::null); + + /*! + * Returns the offset in the file that \a pattern occurs at or -1 if it can + * not be found. If \a before is set, the search will only continue until the + * pattern \a before is found. This is useful for tagging purposes to search + * for a tag before the synch frame. + * + * Searching starts at \a fromOffset and proceeds from the that point to the + * beginning of the file and defaults to the end of the file. + * + * \note This has the practial limitation that \a pattern can not be longer + * than the buffer size used by readBlock(). Currently this is 1024 bytes. + */ + long rfind(const ByteVector &pattern, + long fromOffset = 0, + const ByteVector &before = ByteVector::null); + + /*! + * Insert \a data at position \a start in the file overwriting \a replace + * bytes of the original content. + * + * \note This method is slow since it requires rewriting all of the file + * after the insertion point. + */ + void insert(const ByteVector &data, ulong start = 0, ulong replace = 0); + + /*! + * Removes a block of the file starting a \a start and continuing for + * \a length bytes. + * + * \note This method is slow since it involves rewriting all of the file + * after the removed portion. + */ + void removeBlock(ulong start = 0, ulong length = 0); + + /*! + * Returns true if the file is read only (or if the file can not be opened). + */ + bool readOnly() const; + + /*! + * Since the file can currently only be opened as an argument to the + * constructor (sort-of by design), this returns if that open succeeded. + */ + bool isOpen() const; + + /*! + * Returns true if the file is open and readble. + */ + bool isValid() const; + + /*! + * Move the I/O pointer to \a offset in the file from position \a p. This + * defaults to seeking from the beginning of the file. + * + * \see Position + */ + void seek(long offset, Position p = Beginning); + + /*! + * Reset the end-of-file and error flags on the file. + */ + void clear(); + + /*! + * Returns the current offset within the file. + */ + long tell() const; + + /*! + * Returns the length of the file. + */ + long length(); + + /*! + * Returns true if \a file can be opened for reading. If the file does not + * exist, this will return false. + * + * \deprecated + */ + static bool isReadable(const char *file); + + /*! + * Returns true if \a file can be opened for writing. + * + * \deprecated + */ + static bool isWritable(const char *name); + + protected: + /*! + * Construct a File object and opens the \a file. \a file should be a + * be a C-string in the local file system encoding. + * + * \note Constructor is protected since this class should only be + * instantiated through subclasses. + */ + File(FileName file); + + /*! + * Construct a File object and use the \a stream instance. + * + * \note Constructor is protected since this class should only be + * instantiated through subclasses. + */ + File(IOStream *stream); + + /*! + * Marks the file as valid or invalid. + * + * \see isValid() + */ + void setValid(bool valid); + + /*! + * Truncates the file to a \a length. + */ + void truncate(long length); + + /*! + * Returns the buffer size that is used for internal buffering. + */ + static uint bufferSize(); + + private: + File(const File &); + File &operator=(const File &); + + class FilePrivate; + FilePrivate *d; + }; + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tfilestream.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tfilestream.h new file mode 100644 index 0000000..fa113b7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tfilestream.h @@ -0,0 +1,154 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FILESTREAM_H +#define TAGLIB_FILESTREAM_H + +#include "taglib_export.h" +#include "taglib.h" +#include "tbytevector.h" +#include "tiostream.h" + +namespace TagLib { + + class String; + class Tag; + class AudioProperties; + + //! A file class with some useful methods for tag manipulation + + /*! + * This class is a basic file class with some methods that are particularly + * useful for tag editors. It has methods to take advantage of + * ByteVector and a binary search method for finding patterns in a file. + */ + + class TAGLIB_EXPORT FileStream : public IOStream + { + public: + /*! + * Construct a File object and opens the \a file. \a file should be a + * be a C-string in the local file system encoding. + */ + FileStream(FileName file, bool openReadOnly = false); + + /*! + * Destroys this FileStream instance. + */ + virtual ~FileStream(); + + /*! + * Returns the file name in the local file system encoding. + */ + FileName name() const; + + /*! + * Reads a block of size \a length at the current get pointer. + */ + ByteVector readBlock(ulong length); + + /*! + * Attempts to write the block \a data at the current get pointer. If the + * file is currently only opened read only -- i.e. readOnly() returns true -- + * this attempts to reopen the file in read/write mode. + * + * \note This should be used instead of using the streaming output operator + * for a ByteVector. And even this function is significantly slower than + * doing output with a char[]. + */ + void writeBlock(const ByteVector &data); + + /*! + * Insert \a data at position \a start in the file overwriting \a replace + * bytes of the original content. + * + * \note This method is slow since it requires rewriting all of the file + * after the insertion point. + */ + void insert(const ByteVector &data, ulong start = 0, ulong replace = 0); + + /*! + * Removes a block of the file starting a \a start and continuing for + * \a length bytes. + * + * \note This method is slow since it involves rewriting all of the file + * after the removed portion. + */ + void removeBlock(ulong start = 0, ulong length = 0); + + /*! + * Returns true if the file is read only (or if the file can not be opened). + */ + bool readOnly() const; + + /*! + * Since the file can currently only be opened as an argument to the + * constructor (sort-of by design), this returns if that open succeeded. + */ + bool isOpen() const; + + /*! + * Move the I/O pointer to \a offset in the file from position \a p. This + * defaults to seeking from the beginning of the file. + * + * \see Position + */ + void seek(long offset, Position p = Beginning); + + /*! + * Reset the end-of-file and error flags on the file. + */ + void clear(); + + /*! + * Returns the current offset within the file. + */ + long tell() const; + + /*! + * Returns the length of the file. + */ + long length(); + + /*! + * Truncates the file to a \a length. + */ + void truncate(long length); + + protected: + + /*! + * Returns the buffer size that is used for internal buffering. + */ + static uint bufferSize(); + + private: + class FileStreamPrivate; + FileStreamPrivate *d; + }; + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tiostream.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tiostream.h new file mode 100644 index 0000000..3e7de22 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tiostream.h @@ -0,0 +1,160 @@ +/*************************************************************************** + copyright : (C) 2011 by Lukas Lalinsky + email : lalinsky@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_IOSTREAM_H +#define TAGLIB_IOSTREAM_H + +#include "taglib_export.h" +#include "taglib.h" +#include "tbytevector.h" + +namespace TagLib { + +#ifdef _WIN32 + class TAGLIB_EXPORT FileName + { + public: + FileName(const wchar_t *name) : m_wname(name) {} + FileName(const char *name) : m_name(name) {} + operator const wchar_t *() const { return m_wname.c_str(); } + operator const char *() const { return m_name.c_str(); } + private: + std::string m_name; + std::wstring m_wname; + }; +#else + typedef const char *FileName; +#endif + + //! An abstract class that provides operations on a sequence of bytes + + class TAGLIB_EXPORT IOStream + { + public: + /*! + * Position in the file used for seeking. + */ + enum Position { + //! Seek from the beginning of the file. + Beginning, + //! Seek from the current position in the file. + Current, + //! Seek from the end of the file. + End + }; + + IOStream(); + + /*! + * Destroys this IOStream instance. + */ + virtual ~IOStream(); + + /*! + * Returns the stream name in the local file system encoding. + */ + virtual FileName name() const = 0; + + /*! + * Reads a block of size \a length at the current get pointer. + */ + virtual ByteVector readBlock(ulong length) = 0; + + /*! + * Attempts to write the block \a data at the current get pointer. If the + * file is currently only opened read only -- i.e. readOnly() returns true -- + * this attempts to reopen the file in read/write mode. + * + * \note This should be used instead of using the streaming output operator + * for a ByteVector. And even this function is significantly slower than + * doing output with a char[]. + */ + virtual void writeBlock(const ByteVector &data) = 0; + + /*! + * Insert \a data at position \a start in the file overwriting \a replace + * bytes of the original content. + * + * \note This method is slow since it requires rewriting all of the file + * after the insertion point. + */ + virtual void insert(const ByteVector &data, ulong start = 0, ulong replace = 0) = 0; + + /*! + * Removes a block of the file starting a \a start and continuing for + * \a length bytes. + * + * \note This method is slow since it involves rewriting all of the file + * after the removed portion. + */ + virtual void removeBlock(ulong start = 0, ulong length = 0) = 0; + + /*! + * Returns true if the file is read only (or if the file can not be opened). + */ + virtual bool readOnly() const = 0; + + /*! + * Since the file can currently only be opened as an argument to the + * constructor (sort-of by design), this returns if that open succeeded. + */ + virtual bool isOpen() const = 0; + + /*! + * Move the I/O pointer to \a offset in the stream from position \a p. This + * defaults to seeking from the beginning of the stream. + * + * \see Position + */ + virtual void seek(long offset, Position p = Beginning) = 0; + + /*! + * Reset the end-of-stream and error flags on the stream. + */ + virtual void clear(); + + /*! + * Returns the current offset within the stream. + */ + virtual long tell() const = 0; + + /*! + * Returns the length of the stream. + */ + virtual long length() = 0; + + /*! + * Truncates the stream to a \a length. + */ + virtual void truncate(long length) = 0; + + private: + IOStream(const IOStream &); + IOStream &operator=(const IOStream &); + }; + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tlist.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tlist.h new file mode 100644 index 0000000..0099dad --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tlist.h @@ -0,0 +1,257 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_LIST_H +#define TAGLIB_LIST_H + +#include "taglib.h" + +#include + +namespace TagLib { + + //! A generic, implicitly shared list. + + /*! + * This is basic generic list that's somewhere between a std::list and a + * QValueList. This class is implicitly shared. For example: + * + * \code + * + * TagLib::List l = someOtherIntList; + * + * \endcode + * + * The above example is very cheap. This also makes lists suitable for the + * return types of functions. The above example will just copy a pointer rather + * than copying the data in the list. When your \e shared list's data changes, + * only \e then will the data be copied. + */ + + template class List + { + public: +#ifndef DO_NOT_DOCUMENT + typedef typename std::list::iterator Iterator; + typedef typename std::list::const_iterator ConstIterator; +#endif + + /*! + * Constructs an empty list. + */ + List(); + + /*! + * Make a shallow, implicitly shared, copy of \a l. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + List(const List &l); + + /*! + * Destroys this List instance. If auto deletion is enabled and this list + * contains a pointer type all of the memebers are also deleted. + */ + virtual ~List(); + + /*! + * Returns an STL style iterator to the beginning of the list. See + * std::list::const_iterator for the semantics. + */ + Iterator begin(); + + /*! + * Returns an STL style constant iterator to the beginning of the list. See + * std::list::iterator for the semantics. + */ + ConstIterator begin() const; + + /*! + * Returns an STL style iterator to the end of the list. See + * std::list::iterator for the semantics. + */ + Iterator end(); + + /*! + * Returns an STL style constant iterator to the end of the list. See + * std::list::const_iterator for the semantics. + */ + ConstIterator end() const; + + /*! + * Inserts a copy of \a value before \a it. + */ + Iterator insert(Iterator it, const T &value); + + /*! + * Inserts the \a value into the list. This assumes that the list is + * currently sorted. If \a unique is true then the value will not + * be inserted if it is already in the list. + */ + List &sortedInsert(const T &value, bool unique = false); + + /*! + * Appends \a item to the end of the list and returns a reference to the + * list. + */ + List &append(const T &item); + + /*! + * Appends all of the values in \a l to the end of the list and returns a + * reference to the list. + */ + List &append(const List &l); + + /*! + * Prepends \a item to the beginning list and returns a reference to the + * list. + */ + List &prepend(const T &item); + + /*! + * Prepends all of the items in \a l to the beginning list and returns a + * reference to the list. + */ + List &prepend(const List &l); + + /*! + * Clears the list. If auto deletion is enabled and this list contains a + * pointer type the members are also deleted. + * + * \see setAutoDelete() + */ + List &clear(); + + /*! + * Returns the number of elements in the list. + */ + uint size() const; + bool isEmpty() const; + + /*! + * Find the first occurrence of \a value. + */ + Iterator find(const T &value); + + /*! + * Find the first occurrence of \a value. + */ + ConstIterator find(const T &value) const; + + /*! + * Returns true if the list contains \a value. + */ + bool contains(const T &value) const; + + /*! + * Erase the item at \a it from the list. + */ + Iterator erase(Iterator it); + + /*! + * Returns a reference to the first item in the list. + */ + const T &front() const; + + /*! + * Returns a reference to the first item in the list. + */ + T &front(); + + /*! + * Returns a reference to the last item in the list. + */ + const T &back() const; + + /*! + * Returns a reference to the last item in the list. + */ + T &back(); + + /*! + * Auto delete the members of the list when the last reference to the list + * passes out of scope. This will have no effect on lists which do not + * contain a pointer type. + * + * \note This relies on partial template instantiation -- most modern C++ + * compilers should now support this. + */ + void setAutoDelete(bool autoDelete); + + /*! + * Returns a reference to item \a i in the list. + * + * \warning This method is slow. Use iterators to loop through the list. + */ + T &operator[](uint i); + + /*! + * Returns a const reference to item \a i in the list. + * + * \warning This method is slow. Use iterators to loop through the list. + */ + const T &operator[](uint i) const; + + /*! + * Make a shallow, implicitly shared, copy of \a l. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + List &operator=(const List &l); + + /*! + * Compares this list with \a l and returns true if all of the elements are + * the same. + */ + bool operator==(const List &l) const; + + /*! + * Compares this list with \a l and returns true if the lists differ. + */ + bool operator!=(const List &l) const; + + protected: + /* + * If this List is being shared via implicit sharing, do a deep copy of the + * data and separate from the shared members. This should be called by all + * non-const subclass members. + */ + void detach(); + + private: +#ifndef DO_NOT_DOCUMENT + template class ListPrivate; + ListPrivate *d; +#endif + }; + +} + +// Since GCC doesn't support the "export" keyword, we have to include the +// implementation. + +#include "tlist.tcc" + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tlist.tcc b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tlist.tcc new file mode 100644 index 0000000..37817f0 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tlist.tcc @@ -0,0 +1,322 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#include + +namespace TagLib { + +//////////////////////////////////////////////////////////////////////////////// +// public members +//////////////////////////////////////////////////////////////////////////////// + +// The functionality of List::setAutoDelete() is implemented here partial +// template specialization. This is implemented in such a way that calling +// setAutoDelete() on non-pointer types will simply have no effect. + +// A base for the generic and specialized private class types. New +// non-templatized members should be added here. + +class ListPrivateBase : public RefCounter +{ +public: + ListPrivateBase() : autoDelete(false) {} + bool autoDelete; +}; + +// A generic implementation + +template +template class List::ListPrivate : public ListPrivateBase +{ +public: + ListPrivate() : ListPrivateBase() {} + ListPrivate(const std::list &l) : ListPrivateBase(), list(l) {} + void clear() { + list.clear(); + } + std::list list; +}; + +// A partial specialization for all pointer types that implements the +// setAutoDelete() functionality. + +template +template class List::ListPrivate : public ListPrivateBase +{ +public: + ListPrivate() : ListPrivateBase() {} + ListPrivate(const std::list &l) : ListPrivateBase(), list(l) {} + ~ListPrivate() { + clear(); + } + void clear() { + if(autoDelete) { + typename std::list::const_iterator it = list.begin(); + for(; it != list.end(); ++it) + delete *it; + } + list.clear(); + } + std::list list; +}; + +//////////////////////////////////////////////////////////////////////////////// +// public members +//////////////////////////////////////////////////////////////////////////////// + +template +List::List() +{ + d = new ListPrivate; +} + +template +List::List(const List &l) : d(l.d) +{ + d->ref(); +} + +template +List::~List() +{ + if(d->deref()) + delete d; +} + +template +typename List::Iterator List::begin() +{ + detach(); + return d->list.begin(); +} + +template +typename List::ConstIterator List::begin() const +{ + return d->list.begin(); +} + +template +typename List::Iterator List::end() +{ + detach(); + return d->list.end(); +} + +template +typename List::ConstIterator List::end() const +{ + return d->list.end(); +} + +template +typename List::Iterator List::insert(Iterator it, const T &item) +{ + detach(); + return d->list.insert(it, item); +} + +template +List &List::sortedInsert(const T &value, bool unique) +{ + detach(); + Iterator it = begin(); + while(it != end() && *it < value) + ++it; + if(unique && it != end() && *it == value) + return *this; + insert(it, value); + return *this; +} + +template +List &List::append(const T &item) +{ + detach(); + d->list.push_back(item); + return *this; +} + +template +List &List::append(const List &l) +{ + detach(); + d->list.insert(d->list.end(), l.begin(), l.end()); + return *this; +} + +template +List &List::prepend(const T &item) +{ + detach(); + d->list.push_front(item); + return *this; +} + +template +List &List::prepend(const List &l) +{ + detach(); + d->list.insert(d->list.begin(), l.begin(), l.end()); + return *this; +} + +template +List &List::clear() +{ + detach(); + d->clear(); + return *this; +} + +template +TagLib::uint List::size() const +{ + return d->list.size(); +} + +template +bool List::isEmpty() const +{ + return d->list.empty(); +} + +template +typename List::Iterator List::find(const T &value) +{ + return std::find(d->list.begin(), d->list.end(), value); +} + +template +typename List::ConstIterator List::find(const T &value) const +{ + return std::find(d->list.begin(), d->list.end(), value); +} + +template +bool List::contains(const T &value) const +{ + return std::find(d->list.begin(), d->list.end(), value) != d->list.end(); +} + +template +typename List::Iterator List::erase(Iterator it) +{ + return d->list.erase(it); +} + +template +const T &List::front() const +{ + return d->list.front(); +} + +template +T &List::front() +{ + detach(); + return d->list.front(); +} + +template +const T &List::back() const +{ + return d->list.back(); +} + +template +void List::setAutoDelete(bool autoDelete) +{ + d->autoDelete = autoDelete; +} + +template +T &List::back() +{ + detach(); + return d->list.back(); +} + +template +T &List::operator[](uint i) +{ + Iterator it = d->list.begin(); + + for(uint j = 0; j < i; j++) + ++it; + + return *it; +} + +template +const T &List::operator[](uint i) const +{ + ConstIterator it = d->list.begin(); + + for(uint j = 0; j < i; j++) + ++it; + + return *it; +} + +template +List &List::operator=(const List &l) +{ + if(&l == this) + return *this; + + if(d->deref()) + delete d; + d = l.d; + d->ref(); + return *this; +} + +template +bool List::operator==(const List &l) const +{ + return d->list == l.d->list; +} + +template +bool List::operator!=(const List &l) const +{ + return d->list != l.d->list; +} + +//////////////////////////////////////////////////////////////////////////////// +// protected members +//////////////////////////////////////////////////////////////////////////////// + +template +void List::detach() +{ + if(d->count() > 1) { + d->deref(); + d = new ListPrivate(d->list); + } +} + +} // namespace TagLib diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tmap.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tmap.h new file mode 100644 index 0000000..a7d9930 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tmap.h @@ -0,0 +1,199 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MAP_H +#define TAGLIB_MAP_H + +#include + +#include "taglib.h" + +namespace TagLib { + + //! A generic, implicitly shared map. + + /*! + * This implements a standard map container that associates a key with a value + * and has fast key-based lookups. This map is also implicitly shared making + * it suitable for pass-by-value usage. + */ + + template class Map + { + public: +#ifndef DO_NOT_DOCUMENT +#ifdef WANT_CLASS_INSTANTIATION_OF_MAP + // Some STL implementations get snippy over the use of the + // class keyword to distinguish different templates; Sun Studio + // in particular finds multiple specializations in certain rare + // cases and complains about that. GCC doesn't seem to mind, + // and uses the typedefs further below without the class keyword. + // Not all the specializations of Map can use the class keyword + // (when T is not actually a class type), so don't apply this + // generally. + typedef typename std::map::iterator Iterator; + typedef typename std::map::const_iterator ConstIterator; +#else + typedef typename std::map::iterator Iterator; + typedef typename std::map::const_iterator ConstIterator; +#endif +#endif + + /*! + * Constructs an empty Map. + */ + Map(); + + /*! + * Make a shallow, implicitly shared, copy of \a m. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + Map(const Map &m); + + /*! + * Destroys this instance of the Map. + */ + virtual ~Map(); + + /*! + * Returns an STL style iterator to the beginning of the map. See + * std::map::iterator for the semantics. + */ + Iterator begin(); + + /*! + * Returns an STL style iterator to the beginning of the map. See + * std::map::const_iterator for the semantics. + */ + ConstIterator begin() const; + + /*! + * Returns an STL style iterator to the end of the map. See + * std::map::iterator for the semantics. + */ + Iterator end(); + + /*! + * Returns an STL style iterator to the end of the map. See + * std::map::const_iterator for the semantics. + */ + ConstIterator end() const; + + /*! + * Inserts \a value under \a key in the map. If a value for \a key already + * exists it will be overwritten. + */ + Map &insert(const Key &key, const T &value); + + /*! + * Removes all of the elements from elements from the map. This however + * will not delete pointers if the mapped type is a pointer type. + */ + Map &clear(); + + /*! + * The number of elements in the map. + * + * \see isEmpty() + */ + uint size() const; + + /*! + * Returns true if the map is empty. + * + * \see size() + */ + bool isEmpty() const; + + /*! + * Find the first occurrence of \a key. + */ + Iterator find(const Key &key); + + /*! + * Find the first occurrence of \a key. + */ + ConstIterator find(const Key &key) const; + + /*! + * Returns true if the map contains an instance of \a key. + */ + bool contains(const Key &key) const; + + /*! + * Erase the item at \a it from the list. + */ + Map &erase(Iterator it); + + /*! + * Erase the item with \a key from the list. + */ + Map &erase(const Key &key); + + /*! + * Returns a reference to the value associated with \a key. + * + * \note This has undefined behavior if the key is not present in the map. + */ + const T &operator[](const Key &key) const; + + /*! + * Returns a reference to the value associated with \a key. + * + * \note This has undefined behavior if the key is not present in the map. + */ + T &operator[](const Key &key); + + /*! + * Make a shallow, implicitly shared, copy of \a m. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + Map &operator=(const Map &m); + + protected: + /* + * If this List is being shared via implicit sharing, do a deep copy of the + * data and separate from the shared members. This should be called by all + * non-const subclass members. + */ + void detach(); + + private: +#ifndef DO_NOT_DOCUMENT + template class MapPrivate; + MapPrivate *d; +#endif + }; + +} + +// Since GCC doesn't support the "export" keyword, we have to include the +// implementation. + +#include "tmap.tcc" + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tmap.tcc b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tmap.tcc new file mode 100644 index 0000000..0f2b993 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tmap.tcc @@ -0,0 +1,196 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +namespace TagLib { + +//////////////////////////////////////////////////////////////////////////////// +// public members +//////////////////////////////////////////////////////////////////////////////// + +template +template +class Map::MapPrivate : public RefCounter +{ +public: + MapPrivate() : RefCounter() {} +#ifdef WANT_CLASS_INSTANTIATION_OF_MAP + MapPrivate(const std::map& m) : RefCounter(), map(m) {} + std::map map; +#else + MapPrivate(const std::map& m) : RefCounter(), map(m) {} + std::map map; +#endif +}; + +template +Map::Map() +{ + d = new MapPrivate; +} + +template +Map::Map(const Map &m) : d(m.d) +{ + d->ref(); +} + +template +Map::~Map() +{ + if(d->deref()) + delete(d); +} + +template +typename Map::Iterator Map::begin() +{ + detach(); + return d->map.begin(); +} + +template +typename Map::ConstIterator Map::begin() const +{ + return d->map.begin(); +} + +template +typename Map::Iterator Map::end() +{ + detach(); + return d->map.end(); +} + +template +typename Map::ConstIterator Map::end() const +{ + return d->map.end(); +} + +template +Map &Map::insert(const Key &key, const T &value) +{ + detach(); + d->map[key] = value; + return *this; +} + +template +Map &Map::clear() +{ + detach(); + d->map.clear(); + return *this; +} + +template +bool Map::isEmpty() const +{ + return d->map.empty(); +} + +template +typename Map::Iterator Map::find(const Key &key) +{ + detach(); + return d->map.find(key); +} + +template +typename Map::ConstIterator Map::find(const Key &key) const +{ + return d->map.find(key); +} + +template +bool Map::contains(const Key &key) const +{ + return d->map.find(key) != d->map.end(); +} + +template +Map &Map::erase(Iterator it) +{ + detach(); + d->map.erase(it); + return *this; +} + +template +Map &Map::erase(const Key &key) +{ + detach(); + Iterator it = d->map.find(key); + if(it != d->map.end()) + d->map.erase(it); + return *this; +} + +template +TagLib::uint Map::size() const +{ + return d->map.size(); +} + +template +const T &Map::operator[](const Key &key) const +{ + return d->map[key]; +} + +template +T &Map::operator[](const Key &key) +{ + detach(); + return d->map[key]; +} + +template +Map &Map::operator=(const Map &m) +{ + if(&m == this) + return *this; + + if(d->deref()) + delete(d); + d = m.d; + d->ref(); + return *this; +} + +//////////////////////////////////////////////////////////////////////////////// +// protected members +//////////////////////////////////////////////////////////////////////////////// + +template +void Map::detach() +{ + if(d->count() > 1) { + d->deref(); + d = new MapPrivate(d->map); + } +} + +} // namespace TagLib diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tpropertymap.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tpropertymap.h new file mode 100644 index 0000000..b955739 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tpropertymap.h @@ -0,0 +1,184 @@ +/*************************************************************************** + copyright : (C) 2012 by Michael Helmling + email : helmling@mathematik.uni-kl.de + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef PROPERTYMAP_H_ +#define PROPERTYMAP_H_ + +#include "tmap.h" +#include "tstringlist.h" + +namespace TagLib { + + typedef Map SimplePropertyMap; + + //! A map for format-independent tag representations. + + /*! + * This map implements a generic representation of textual audio metadata + * ("tags") realized as pairs of a case-insensitive key + * and a nonempty list of corresponding values, each value being an an arbitrary + * unicode String. + * The key has the same restrictions as in the vorbis comment specification, + * i.e. it must contain at least one character; all printable ASCII characters + * except '=' and '~' are allowed. + * + * In order to be safe with other formats, keep these additional restrictions in mind: + * + * - APE only allows keys from 2 to 16 printable ASCII characters (including space), + * with the exception of these strings: ID3, TAG, OggS, MP+ + * + */ + + class TAGLIB_EXPORT PropertyMap: public SimplePropertyMap + { + public: + + typedef SimplePropertyMap::Iterator Iterator; + typedef SimplePropertyMap::ConstIterator ConstIterator; + + PropertyMap(); + + PropertyMap(const PropertyMap &m); + + /*! + * Creates a PropertyMap initialized from a SimplePropertyMap. Copies all + * entries from \a m that have valid keys. + * Invalid keys will be appended to the unsupportedData() list. + */ + PropertyMap(const SimplePropertyMap &m); + + virtual ~PropertyMap(); + + /*! + * Inserts \a values under \a key in the map. If \a key already exists, + * then \values will be appended to the existing StringList. + * The returned value indicates success, i.e. whether \a key is a + * valid key. + */ + bool insert(const String &key, const StringList &values); + + /*! + * Replaces any existing values for \a key with the given \a values, + * and simply insert them if \a key did not exist before. + * The returned value indicates success, i.e. whether \a key is a + * valid key. + */ + bool replace(const String &key, const StringList &values); + + /*! + * Find the first occurrence of \a key. + */ + Iterator find(const String &key); + + /*! + * Find the first occurrence of \a key. + */ + ConstIterator find(const String &key) const; + + /*! + * Returns true if the map contains values for \a key. + */ + bool contains(const String &key) const; + + /*! + * Returns true if this map contains all keys of \a other + * and the values coincide for that keys. Does not take + * the unsupportedData list into account. + */ + bool contains(const PropertyMap &other) const; + + /*! + * Erase the \a key and its values from the map. + */ + PropertyMap &erase(const String &key); + + /*! + * Erases from this map all keys that appear in \a other. + */ + PropertyMap &erase(const PropertyMap &other); + + /*! + * Merge the contents of \a other into this PropertyMap. + * If a key is contained in both maps, the values of the second + * are appended to that of the first. + * The unsupportedData() lists are concatenated as well. + */ + PropertyMap &merge(const PropertyMap &other); + + /*! + * Returns a reference to the value associated with \a key. + * + * \note: This has undefined behavior if the key is not valid or not + * present in the map. + */ + const StringList &operator[](const String &key) const; + + /*! + * Returns a reference to the value associated with \a key. + * + * \note: This has undefined behavior if the key is not valid or not + * present in the map. + */ + StringList &operator[](const String &key); + + /*! + * Returns true if and only if \other has the same contents as this map. + */ + bool operator==(const PropertyMap &other) const; + + /*! + * Returns false if and only \other has the same contents as this map. + */ + bool operator!=(const PropertyMap &other) const; + + /*! + * If a PropertyMap is read from a File object using File::properties(), + * the StringList returned from this function will represent metadata + * that could not be parsed into the PropertyMap representation. This could + * be e.g. binary data, unknown ID3 frames, etc. + * You can remove items from the returned list, which tells TagLib to remove + * those unsupported elements if you call File::setProperties() with the + * same PropertyMap as argument. + */ + StringList &unsupportedData(); + const StringList &unsupportedData() const; + + /*! + * Removes all entries which have an empty value list. + */ + void removeEmpty(); + + String toString() const; + + /*! + * Converts \a proposed into another String suitable to be used as + * a key, or returns String::null if this is not possible. + */ + static String prepareKey(const String &proposed); + + private: + + + StringList unsupported; + }; + +} +#endif /* PROPERTYMAP_H_ */ diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/trueaudiofile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/trueaudiofile.h new file mode 100644 index 0000000..9b0378f --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/trueaudiofile.h @@ -0,0 +1,212 @@ +/*************************************************************************** + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + (original MPC implementation) + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_TRUEAUDIOFILE_H +#define TAGLIB_TRUEAUDIOFILE_H + +#include "tfile.h" +#include "trueaudioproperties.h" + +namespace TagLib { + + class Tag; + + namespace ID3v2 { class Tag; class FrameFactory; } + namespace ID3v1 { class Tag; } + + //! An implementation of TrueAudio metadata + + /*! + * This is implementation of TrueAudio metadata. + * + * This supports ID3v1 and ID3v2 tags as well as reading stream + * properties from the file. + */ + + namespace TrueAudio { + + //! An implementation of TagLib::File with TrueAudio specific methods + + /*! + * This implements and provides an interface for TrueAudio files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to TrueAudio files. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * This set of flags is used for various operations and is suitable for + * being OR-ed together. + */ + enum TagTypes { + //! Empty set. Matches no tag types. + NoTags = 0x0000, + //! Matches ID3v1 tags. + ID3v1 = 0x0001, + //! Matches ID3v2 tags. + ID3v2 = 0x0002, + //! Matches all tag types. + AllTags = 0xffff + }; + + /*! + * Contructs an TrueAudio file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an TrueAudio file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. The frames will be created using + * \a frameFactory. + */ + File(FileName file, ID3v2::FrameFactory *frameFactory, + bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an TrueAudio file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an TrueAudio file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. The frames will be created using + * \a frameFactory. + */ + File(IOStream *stream, ID3v2::FrameFactory *frameFactory, + bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. + */ + virtual TagLib::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * If the file contains both ID3v1 and v2 tags, only ID3v2 will be + * converted to the PropertyMap. + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * As with the export, only one tag is taken into account. If the file + * has no tag at all, ID3v2 will be created. + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the TrueAudio::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Set the ID3v2::FrameFactory to something other than the default. + * + * \see ID3v2FrameFactory + */ + void setID3v2FrameFactory(const ID3v2::FrameFactory *factory); + + /*! + * Saves the file. + */ + virtual bool save(); + + /*! + * Returns a pointer to the ID3v2 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v2 tag. If \a create is true it will create + * an ID3v1 tag if one does not exist. If there is already an APE tag, the + * new ID3v1 tag will be placed after it. + * + * \note The Tag is still owned by the TrueAudio::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v1::Tag *ID3v1Tag(bool create = false); + + /*! + * Returns a pointer to the ID3v1 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v1 tag. If \a create is true it will create + * an ID3v1 tag if one does not exist. If there is already an APE tag, the + * new ID3v1 tag will be placed after it. + * + * \note The Tag is still owned by the TrueAudio::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v2::Tag *ID3v2Tag(bool create = false); + + /*! + * This will remove the tags that match the OR-ed together TagTypes from the + * file. By default it removes all tags. + * + * \note This will also invalidate pointers to the tags + * as their memory will be freed. + * \note In order to make the removal permanent save() still needs to be called + */ + void strip(int tags = AllTags); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void scan(); + long findID3v1(); + long findID3v2(); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/trueaudioproperties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/trueaudioproperties.h new file mode 100644 index 0000000..126b678 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/trueaudioproperties.h @@ -0,0 +1,98 @@ +/*************************************************************************** + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + (original MPC implementation) + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_TRUEAUDIOPROPERTIES_H +#define TAGLIB_TRUEAUDIOPROPERTIES_H + +#include "audioproperties.h" + +namespace TagLib { + + namespace TrueAudio { + + class File; + + static const uint HeaderSize = 18; + + //! An implementation of audio property reading for TrueAudio + + /*! + * This reads the data from an TrueAudio stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of TrueAudio::Properties with the data read from the + * ByteVector \a data. + */ + Properties(const ByteVector &data, long streamLength, ReadStyle style = Average); + + /*! + * Destroys this TrueAudio::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns number of bits per sample. + */ + int bitsPerSample() const; + + /*! + * Returns the total number of sample frames + */ + uint sampleFrames() const; + + /*! + * Returns the major version number. + */ + int ttaVersion() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tstring.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tstring.h new file mode 100644 index 0000000..759a175 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tstring.h @@ -0,0 +1,496 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_STRING_H +#define TAGLIB_STRING_H + +#include "taglib_export.h" +#include "taglib.h" +#include "tbytevector.h" + +#include +#include + +/*! + * \relates TagLib::String + * + * Converts a QString to a TagLib::String without a requirement to link to Qt. + * + * \note consider conversion via usual char-by-char for loop to avoid UTF16->UTF8->UTF16 + * conversion happening in the background + */ +#define QStringToTString(s) TagLib::String(s.utf8().data(), TagLib::String::UTF8) + +/*! + * \relates TagLib::String + * + * Converts a TagLib::String to a QString without a requirement to link to Qt. + * + * \note consider conversion via usual char-by-char for loop to avoid UTF16->UTF8->UTF16 + * conversion happening in the background + * + */ +#define TStringToQString(s) QString::fromUtf8(s.toCString(true)) + +namespace TagLib { + + class StringList; + + //! A \e wide string class suitable for unicode. + + /*! + * This is an implicitly shared \e wide string. For storage it uses + * TagLib::wstring, but as this is an implementation detail this of + * course could change. Strings are stored internally as UTF-16BE. (Without + * the BOM (Byte Order Mark) + * + * The use of implicit sharing means that copying a string is cheap, the only + * \e cost comes into play when the copy is modified. Prior to that the string + * just has a pointer to the data of the \e parent String. This also makes + * this class suitable as a function return type. + * + * In addition to adding implicit sharing, this class keeps track of four + * possible encodings, which are the four supported by the ID3v2 standard. + */ + + class TAGLIB_EXPORT String + { + public: + +#ifndef DO_NOT_DOCUMENT + typedef std::basic_string::iterator Iterator; + typedef std::basic_string::const_iterator ConstIterator; +#endif + + /** + * The four types of string encodings supported by the ID3v2 specification. + * ID3v1 is assumed to be Latin1 and Ogg Vorbis comments use UTF8. + */ + enum Type { + /*! + * IS08859-1, or Latin1 encoding. 8 bit characters. + */ + Latin1 = 0, + /*! + * UTF16 with a byte order mark. 16 bit characters. + */ + UTF16 = 1, + /*! + * UTF16 big endian. 16 bit characters. This is the encoding used + * internally by TagLib. + */ + UTF16BE = 2, + /*! + * UTF8 encoding. Characters are usually 8 bits but can be up to 32. + */ + UTF8 = 3, + /*! + * UTF16 little endian. 16 bit characters. + */ + UTF16LE = 4 + }; + + /*! + * Constructs an empty String. + */ + String(); + + /*! + * Make a shallow, implicitly shared, copy of \a s. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + String(const String &s); + + /*! + * Makes a deep copy of the data in \a s. + * + * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when + * used with other codecs it will simply print a warning and exit. + */ + String(const std::string &s, Type t = Latin1); + + /*! + * Makes a deep copy of the data in \a s. + */ + String(const wstring &s, Type t = UTF16BE); + + /*! + * Makes a deep copy of the data in \a s. + */ + String(const wchar_t *s, Type t = UTF16BE); + + /*! + * Makes a deep copy of the data in \a c. + * + * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when + * used with other codecs it will simply print a warning and exit. + */ + String(char c, Type t = Latin1); + + /*! + * Makes a deep copy of the data in \a c. + */ + String(wchar_t c, Type t = Latin1); + + + /*! + * Makes a deep copy of the data in \a s. + * + * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when + * used with other codecs it will simply print a warning and exit. + */ + String(const char *s, Type t = Latin1); + + /*! + * Makes a deep copy of the data in \a s. + * + * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when + * used with other codecs it will simply print a warning and exit. + */ + String(const ByteVector &v, Type t = Latin1); + + /*! + * Destroys this String instance. + */ + virtual ~String(); + + /*! + * If \a unicode if false (the default) this will return a \e Latin1 encoded + * std::string. If it is true the returned std::wstring will be UTF-8 + * encoded. + */ + std::string to8Bit(bool unicode = false) const; + + /*! + * Returns a wstring version of the TagLib string as a wide string. + */ + wstring toWString() const; + + /*! + * Creates and returns a C-String based on the data. This string is still + * owned by the String (class) and as such should not be deleted by the user. + * + * If \a unicode if false (the default) this string will be encoded in + * \e Latin1. If it is true the returned C-String will be UTF-8 encoded. + * + * This string remains valid until the String instance is destroyed or + * another export method is called. + * + * \warning This however has the side effect that this C-String will remain + * in memory in addition to other memory that is consumed by the + * String instance. So, this method should not be used on large strings or + * where memory is critical. + */ + const char *toCString(bool unicode = false) const; + + /*! + * Returns an iterator pointing to the beginning of the string. + */ + Iterator begin(); + + /*! + * Returns a const iterator pointing to the beginning of the string. + */ + ConstIterator begin() const; + + /*! + * Returns an iterator pointing to the end of the string (the position + * after the last character). + */ + Iterator end(); + + /*! + * Returns a const iterator pointing to the end of the string (the position + * after the last character). + */ + ConstIterator end() const; + + /*! + * Finds the first occurrence of pattern \a s in this string starting from + * \a offset. If the pattern is not found, -1 is returned. + */ + int find(const String &s, int offset = 0) const; + + /*! + * Finds the last occurrence of pattern \a s in this string, searched backwards, + * either from the end of the string or starting from \a offset. If the pattern + * is not found, -1 is returned. + */ + int rfind(const String &s, int offset = -1) const; + + /*! + * Splits the string on each occurrence of \a separator. + */ + StringList split(const String &separator = " ") const; + + /*! + * Returns true if the strings starts with the substring \a s. + */ + bool startsWith(const String &s) const; + + /*! + * Extract a substring from this string starting at \a position and + * continuing for \a n characters. + */ + String substr(uint position, uint n = 0xffffffff) const; + + /*! + * Append \a s to the current string and return a reference to the current + * string. + */ + String &append(const String &s); + + /*! + * Returns an upper case version of the string. + * + * \warning This only works for the characters in US-ASCII, i.e. A-Z. + */ + String upper() const; + + /*! + * Returns the size of the string. + */ + uint size() const; + + /*! + * Returns the length of the string. Equivalent to size(). + */ + uint length() const; + + /*! + * Returns true if the string is empty. + * + * \see isNull() + */ + bool isEmpty() const; + + /*! + * Returns true if this string is null -- i.e. it is a copy of the + * String::null string. + * + * \note A string can be empty and not null. + * \see isEmpty() + */ + bool isNull() const; + + /*! + * Returns a ByteVector containing the string's data. If \a t is Latin1 or + * UTF8, this will return a vector of 8 bit characters, otherwise it will use + * 16 bit characters. + */ + ByteVector data(Type t) const; + + /*! + * Convert the string to an integer. + * + * Returns the integer if the conversion was successfull or 0 if the + * string does not represent a number. + */ + // BIC: merge with the method below + int toInt() const; + + /*! + * Convert the string to an integer. + * + * If the conversion was successfull, it sets the value of \a *ok to + * true and returns the integer. Otherwise it sets \a *ok to false + * and the result is undefined. + */ + int toInt(bool *ok) const; + + /*! + * Returns a string with the leading and trailing whitespace stripped. + */ + String stripWhiteSpace() const; + + /*! + * Returns true if the file only uses characters required by Latin1. + */ + bool isLatin1() const; + + /*! + * Returns true if the file only uses characters required by (7-bit) ASCII. + */ + bool isAscii() const; + + /*! + * Converts the base-10 integer \a n to a string. + */ + static String number(int n); + + /*! + * Returns a reference to the character at position \a i. + */ + wchar &operator[](int i); + + /*! + * Returns a const reference to the character at position \a i. + */ + const wchar &operator[](int i) const; + + /*! + * Compares each character of the String with each character of \a s and + * returns true if the strings match. + */ + bool operator==(const String &s) const; + + /*! + * Compares each character of the String with each character of \a s and + * returns false if the strings match. + */ + bool operator!=(const String &s) const; + + /*! + * Appends \a s to the end of the String. + */ + String &operator+=(const String &s); + + /*! + * Appends \a s to the end of the String. + */ + String &operator+=(const wchar_t* s); + + /*! + * Appends \a s to the end of the String. + */ + String &operator+=(const char* s); + + /*! + * Appends \a s to the end of the String. + */ + String &operator+=(wchar_t c); + + /*! + * Appends \a c to the end of the String. + */ + String &operator+=(char c); + + /*! + * Performs a shallow, implicitly shared, copy of \a s, overwriting the + * String's current data. + */ + String &operator=(const String &s); + + /*! + * Performs a deep copy of the data in \a s. + */ + String &operator=(const std::string &s); + + /*! + * Performs a deep copy of the data in \a s. + */ + String &operator=(const wstring &s); + + /*! + * Performs a deep copy of the data in \a s. + */ + String &operator=(const wchar_t *s); + + /*! + * Performs a deep copy of the data in \a s. + */ + String &operator=(char c); + + /*! + * Performs a deep copy of the data in \a s. + */ + String &operator=(wchar_t c); + + /*! + * Performs a deep copy of the data in \a s. + */ + String &operator=(const char *s); + + /*! + * Performs a deep copy of the data in \a v. + */ + String &operator=(const ByteVector &v); + + /*! + * To be able to use this class in a Map, this operator needed to be + * implemented. Returns true if \a s is less than this string in a bytewise + * comparison. + */ + bool operator<(const String &s) const; + + /*! + * A null string provided for convenience. + */ + static String null; + + protected: + /*! + * If this String is being shared via implicit sharing, do a deep copy of the + * data and separate from the shared members. This should be called by all + * non-const subclass members. + */ + void detach(); + + private: + /*! + * This checks to see if the string is in \e UTF-16 (with BOM) or \e UTF-8 + * format and if so converts it to \e UTF-16BE for internal use. \e Latin1 + * does not require conversion since it is a subset of \e UTF-16BE and + * \e UTF16-BE requires no conversion since it is used internally. + */ + void prepare(Type t); + + class StringPrivate; + StringPrivate *d; + }; + +} + +/*! + * \relates TagLib::String + * + * Concatenates \a s1 and \a s2 and returns the result as a string. + */ +TAGLIB_EXPORT const TagLib::String operator+(const TagLib::String &s1, const TagLib::String &s2); + +/*! + * \relates TagLib::String + * + * Concatenates \a s1 and \a s2 and returns the result as a string. + */ +TAGLIB_EXPORT const TagLib::String operator+(const char *s1, const TagLib::String &s2); + +/*! + * \relates TagLib::String + * + * Concatenates \a s1 and \a s2 and returns the result as a string. + */ +TAGLIB_EXPORT const TagLib::String operator+(const TagLib::String &s1, const char *s2); + + +/*! + * \relates TagLib::String + * + * Send the string to an output stream. + */ +TAGLIB_EXPORT std::ostream &operator<<(std::ostream &s, const TagLib::String &str); + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tstringlist.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tstringlist.h new file mode 100644 index 0000000..f94b50f --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/tstringlist.h @@ -0,0 +1,115 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_STRINGLIST_H +#define TAGLIB_STRINGLIST_H + +#include "tstring.h" +#include "tlist.h" +#include "tbytevectorlist.h" +#include "taglib_export.h" + +#include + +namespace TagLib { + + //! A list of strings + + /*! + * This is a spcialization of the List class with some members convention for + * string operations. + */ + + class TAGLIB_EXPORT StringList : public List + { + public: + + /*! + * Constructs an empty StringList. + */ + StringList(); + + /*! + * Make a shallow, implicitly shared, copy of \a l. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + StringList(const StringList &l); + + /*! + * Constructs a StringList with \a s as a member. + */ + StringList(const String &s); + + /*! + * Makes a deep copy of the data in \a vl. + * + * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when + * used with other codecs it will simply print a warning and exit. + */ + StringList(const ByteVectorList &vl, String::Type t = String::Latin1); + + /*! + * Destroys this StringList instance. + */ + virtual ~StringList(); + + /*! + * Concatenate the list of strings into one string separated by \a separator. + */ + String toString(const String &separator = " ") const; + + /*! + * Appends \a s to the end of the list and returns a reference to the + * list. + */ + StringList &append(const String &s); + + /*! + * Appends all of the values in \a l to the end of the list and returns a + * reference to the list. + */ + StringList &append(const StringList &l); + + /*! + * Splits the String \a s into several strings at \a pattern. This will not include + * the pattern in the returned strings. + */ + static StringList split(const String &s, const String &pattern); + + private: + class StringListPrivate; + StringListPrivate *d; + }; + +} + +/*! + * \related TagLib::StringList + * Send the StringList to an output stream. + */ +std::ostream &operator<<(std::ostream &s, const TagLib::StringList &l); + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/unicode.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/unicode.h new file mode 100644 index 0000000..cf7eb3c --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/unicode.h @@ -0,0 +1,149 @@ +#ifndef TAGLIB_UNICODE_H +#define TAGLIB_UNICODE_H + +/******************************************************************************* + * * + * THIS FILE IS INCLUDED IN TAGLIB, BUT IS NOT COPYRIGHTED BY THE TAGLIB * + * AUTHORS, NOT PART OF THE TAGLIB API AND COULD GO AWAY AT ANY POINT IN TIME. * + * AS SUCH IT SHOULD BE CONSIERED FOR INTERNAL USE ONLY. * + * * + *******************************************************************************/ + +#ifndef DO_NOT_DOCUMENT // tell Doxygen not to document this header + +/* + * Copyright 2001 Unicode, Inc. + * + * Disclaimer + * + * This source code is provided as is by Unicode, Inc. No claims are + * made as to fitness for any particular purpose. No warranties of any + * kind are expressed or implied. The recipient agrees to determine + * applicability of information provided. If this file has been + * purchased on magnetic or optical media from Unicode, Inc., the + * sole remedy for any claim will be exchange of defective media + * within 90 days of receipt. + * + * Limitations on Rights to Redistribute This Code + * + * Unicode, Inc. hereby grants the right to freely use the information + * supplied in this file in the creation of products supporting the + * Unicode Standard, and to make copies of this file in any form + * for internal or external distribution as long as this notice + * remains attached. + */ + +/* + * This file has been modified by Scott Wheeler to remove + * the UTF32 conversion functions and to place the appropriate functions + * in their own C++ namespace. + */ + +/* --------------------------------------------------------------------- + + Conversions between UTF32, UTF-16, and UTF-8. Header file. + + Several functions are included here, forming a complete set of + conversions between the three formats. UTF-7 is not included + here, but is handled in a separate source file. + + Each of these routines takes pointers to input buffers and output + buffers. The input buffers are const. + + Each routine converts the text between *sourceStart and sourceEnd, + putting the result into the buffer between *targetStart and + targetEnd. Note: the end pointers are *after* the last item: e.g. + *(sourceEnd - 1) is the last item. + + The return result indicates whether the conversion was successful, + and if not, whether the problem was in the source or target buffers. + (Only the first encountered problem is indicated.) + + After the conversion, *sourceStart and *targetStart are both + updated to point to the end of last text successfully converted in + the respective buffers. + + Input parameters: + sourceStart - pointer to a pointer to the source buffer. + The contents of this are modified on return so that + it points at the next thing to be converted. + targetStart - similarly, pointer to pointer to the target buffer. + sourceEnd, targetEnd - respectively pointers to the ends of the + two buffers, for overflow checking only. + + These conversion functions take a ConversionFlags argument. When this + flag is set to strict, both irregular sequences and isolated surrogates + will cause an error. When the flag is set to lenient, both irregular + sequences and isolated surrogates are converted. + + Whether the flag is strict or lenient, all illegal sequences will cause + an error return. This includes sequences such as: , , + or in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code + must check for illegal sequences. + + When the flag is set to lenient, characters over 0x10FFFF are converted + to the replacement character; otherwise (when the flag is set to strict) + they constitute an error. + + Output parameters: + The value "sourceIllegal" is returned from some routines if the input + sequence is malformed. When "sourceIllegal" is returned, the source + value will point to the illegal value that caused the problem. E.g., + in UTF-8 when a sequence is malformed, it points to the start of the + malformed sequence. + + Author: Mark E. Davis, 1994. + Rev History: Rick McGowan, fixes & updates May 2001. + Fixes & updates, Sept 2001. + +------------------------------------------------------------------------ */ + +/* --------------------------------------------------------------------- + The following 4 definitions are compiler-specific. + The C standard does not guarantee that wchar_t has at least + 16 bits, so wchar_t is no less portable than unsigned short! + All should be unsigned values to avoid sign extension during + bit mask & shift operations. +------------------------------------------------------------------------ */ + +/* Some fundamental constants */ +#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD +#define UNI_MAX_BMP (UTF32)0x0000FFFF +#define UNI_MAX_UTF16 (UTF32)0x0010FFFF +#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF + +namespace Unicode { + +typedef unsigned long UTF32; /* at least 32 bits */ +typedef unsigned short UTF16; /* at least 16 bits */ +typedef unsigned char UTF8; /* typically 8 bits */ +typedef unsigned char Boolean; /* 0 or 1 */ + +typedef enum { + conversionOK = 0, /* conversion successful */ + sourceExhausted = 1, /* partial character in source, but hit end */ + targetExhausted = 2, /* insuff. room in target for conversion */ + sourceIllegal = 3 /* source sequence is illegal/malformed */ +} ConversionResult; + +typedef enum { + strictConversion = 0, + lenientConversion +} ConversionFlags; + +ConversionResult ConvertUTF8toUTF16 ( + const UTF8** sourceStart, const UTF8* sourceEnd, + UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); + +ConversionResult ConvertUTF16toUTF8 ( + const UTF16** sourceStart, const UTF16* sourceEnd, + UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); + +Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); + +} // namespace Unicode + +/* --------------------------------------------------------------------- */ + +#endif +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/uniquefileidentifierframe.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/uniquefileidentifierframe.h new file mode 100644 index 0000000..0cf4b8f --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/uniquefileidentifierframe.h @@ -0,0 +1,113 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_UNIQUEFILEIDENTIFIERFRAME +#define TAGLIB_UNIQUEFILEIDENTIFIERFRAME + +#include "id3v2frame.h" + +namespace TagLib { + + namespace ID3v2 { + + /*! + * This is an implementation of ID3v2 unique file identifier frames. This + * frame is used to identify the file in an arbitrary database identified + * by the owner field. + */ + + //! An implementation of ID3v2 unique identifier frames + + class TAGLIB_EXPORT UniqueFileIdentifierFrame : public ID3v2::Frame + { + friend class FrameFactory; + + public: + /*! + * Creates a uniqe file identifier frame based on \a data. + */ + UniqueFileIdentifierFrame(const ByteVector &data); + + /*! + * Creates a unique file identifier frame with the owner \a owner and + * the identification \a id. + */ + UniqueFileIdentifierFrame(const String &owner, const ByteVector &id); + + /*! + * Destroys the frame. + */ + ~UniqueFileIdentifierFrame(); + + /*! + * Returns the owner for the frame; essentially this is the key for + * determining which identification scheme this key belongs to. This + * will usually either be an email address or URL for the person or tool + * used to create the unique identifier. + * + * \see setOwner() + */ + String owner() const; + + /*! + * Returns the unique identifier. Though sometimes this is a text string + * it also may be binary data and as much should be assumed when handling + * it. + */ + ByteVector identifier() const; + + /*! + * Sets the owner of the identification scheme to \a s. + * + * \see owner() + */ + void setOwner(const String &s); + + /*! + * Sets the unique file identifier to \a v. + * + * \see identifier() + */ + void setIdentifier(const ByteVector &v); + + virtual String toString() const; + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + UniqueFileIdentifierFrame(const UniqueFileIdentifierFrame &); + UniqueFileIdentifierFrame &operator=(const UniqueFileIdentifierFrame &); + + UniqueFileIdentifierFrame(const ByteVector &data, Header *h); + + class UniqueFileIdentifierFramePrivate; + UniqueFileIdentifierFramePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/unknownframe.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/unknownframe.h new file mode 100644 index 0000000..6559f4e --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/unknownframe.h @@ -0,0 +1,79 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_UNKNOWNFRAME_H +#define TAGLIB_UNKNOWNFRAME_H + +#include "id3v2frame.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! A frame type \e unknown to TagLib. + + /*! + * This class represents a frame type not known (or more often simply + * unimplemented) in TagLib. This is here provide a basic API for + * manipulating the binary data of unknown frames and to provide a means + * of rendering such \e unknown frames. + * + * Please note that a cleaner way of handling frame types that TagLib + * does not understand is to subclass ID3v2::Frame and ID3v2::FrameFactory + * to have your frame type supported through the standard ID3v2 mechanism. + */ + + class TAGLIB_EXPORT UnknownFrame : public Frame + { + friend class FrameFactory; + + public: + UnknownFrame(const ByteVector &data); + virtual ~UnknownFrame(); + + virtual String toString() const; + + /*! + * Returns the field data (everything but the header) for this frame. + */ + ByteVector data() const; + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + UnknownFrame(const ByteVector &data, Header *h); + UnknownFrame(const UnknownFrame &); + UnknownFrame &operator=(const UnknownFrame &); + + class UnknownFramePrivate; + UnknownFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/unsynchronizedlyricsframe.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/unsynchronizedlyricsframe.h new file mode 100644 index 0000000..3af354f --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/unsynchronizedlyricsframe.h @@ -0,0 +1,179 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + copyright : (C) 2006 by Urs Fleisch + email : ufleisch@users.sourceforge.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_UNSYNCHRONIZEDLYRICSFRAME_H +#define TAGLIB_UNSYNCHRONIZEDLYRICSFRAME_H + +#include "id3v2frame.h" + +namespace TagLib { + + namespace ID3v2 { + + //! ID3v2 unsynchronized lyrics frame + /*! + * An implementation of ID3v2 unsynchronized lyrics. + */ + class TAGLIB_EXPORT UnsynchronizedLyricsFrame : public Frame + { + friend class FrameFactory; + + public: + /*! + * Construct an empty unsynchronized lyrics frame that will use the text encoding + * \a encoding. + */ + explicit UnsynchronizedLyricsFrame(String::Type encoding = String::Latin1); + + /*! + * Construct a unsynchronized lyrics frame based on the data in \a data. + */ + explicit UnsynchronizedLyricsFrame(const ByteVector &data); + + /*! + * Destroys this UnsynchronizedLyricsFrame instance. + */ + virtual ~UnsynchronizedLyricsFrame(); + + /*! + * Returns the text of this unsynchronized lyrics frame. + * + * \see text() + */ + virtual String toString() const; + + /*! + * Returns the language encoding as a 3 byte encoding as specified by + * ISO-639-2. + * + * \note Most taggers simply ignore this value. + * + * \see setLanguage() + */ + ByteVector language() const; + + /*! + * Returns the description of this unsynchronized lyrics frame. + * + * \note Most taggers simply ignore this value. + * + * \see setDescription() + */ + String description() const; + + /*! + * Returns the text of this unsynchronized lyrics frame. + * + * \see setText() + */ + String text() const; + + /*! + * Set the language using the 3 byte language code from + * ISO-639-2 to + * \a languageCode. + * + * \see language() + */ + void setLanguage(const ByteVector &languageCode); + + /*! + * Sets the description of the unsynchronized lyrics frame to \a s. + * + * \see decription() + */ + void setDescription(const String &s); + + /*! + * Sets the text portion of the unsynchronized lyrics frame to \a s. + * + * \see text() + */ + virtual void setText(const String &s); + + /*! + * Returns the text encoding that will be used in rendering this frame. + * This defaults to the type that was either specified in the constructor + * or read from the frame when parsed. + * + * \see setTextEncoding() + * \see render() + */ + String::Type textEncoding() const; + + /*! + * Sets the text encoding to be used when rendering this frame to + * \a encoding. + * + * \see textEncoding() + * \see render() + */ + void setTextEncoding(String::Type encoding); + + + /*! Parses this frame as PropertyMap with a single key. + * - if description() is empty or "LYRICS", the key will be "LYRICS" + * - if description() is not a valid PropertyMap key, the frame will be + * marked unsupported by an entry "USLT/" in the unsupportedData() + * attribute of the returned map. + * - otherwise, the key will be "LYRICS:" + * - The single value will be the frame's text(). + * Note that currently the language() field is not supported by the PropertyMap + * interface. + */ + PropertyMap asProperties() const; + + /*! + * LyricsFrames each have a unique description. This searches for a lyrics + * frame with the decription \a d and returns a pointer to it. If no + * frame is found that matches the given description null is returned. + * + * \see description() + */ + static UnsynchronizedLyricsFrame *findByDescription(const Tag *tag, const String &d); + + protected: + // Reimplementations. + + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + /*! + * The constructor used by the FrameFactory. + */ + UnsynchronizedLyricsFrame(const ByteVector &data, Header *h); + UnsynchronizedLyricsFrame(const UnsynchronizedLyricsFrame &); + UnsynchronizedLyricsFrame &operator=(const UnsynchronizedLyricsFrame &); + + class UnsynchronizedLyricsFramePrivate; + UnsynchronizedLyricsFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/urllinkframe.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/urllinkframe.h new file mode 100644 index 0000000..7ac966b --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/urllinkframe.h @@ -0,0 +1,189 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + copyright : (C) 2006 by Urs Fleisch + email : ufleisch@users.sourceforge.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_URLLINKFRAME_H +#define TAGLIB_URLLINKFRAME_H + +#include "id3v2frame.h" + +namespace TagLib { + + namespace ID3v2 { + + //! ID3v2 URL frame + /*! + * An implementation of ID3v2 URL link frames. + */ + class TAGLIB_EXPORT UrlLinkFrame : public Frame + { + friend class FrameFactory; + + public: + /*! + * This is a dual purpose constructor. \a data can either be binary data + * that should be parsed or (at a minimum) the frame ID. + */ + explicit UrlLinkFrame(const ByteVector &data); + + /*! + * Destroys this UrlLinkFrame instance. + */ + virtual ~UrlLinkFrame(); + + /*! + * Returns the URL. + */ + virtual String url() const; + + /*! + * Sets the URL to \a s. + */ + virtual void setUrl(const String &s); + + // Reimplementations. + + virtual void setText(const String &s); + virtual String toString() const; + PropertyMap asProperties() const; + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + /*! + * The constructor used by the FrameFactory. + */ + UrlLinkFrame(const ByteVector &data, Header *h); + + private: + UrlLinkFrame(const UrlLinkFrame &); + UrlLinkFrame &operator=(const UrlLinkFrame &); + + class UrlLinkFramePrivate; + UrlLinkFramePrivate *d; + }; + + //! ID3v2 User defined URL frame + + /*! + * This is a specialization of URL link frames that allows for + * user defined entries. Each entry has a description in addition to the + * normal list of fields that a URL link frame has. + * + * This description identifies the frame and must be unique. + */ + class TAGLIB_EXPORT UserUrlLinkFrame : public UrlLinkFrame + { + friend class FrameFactory; + + public: + /*! + * Constructs an empty user defined URL link frame. For this to be + * a useful frame both a description and text must be set. + */ + explicit UserUrlLinkFrame(String::Type encoding = String::Latin1); + + /*! + * This is a dual purpose constructor. \a data can either be binary data + * that should be parsed or (at a minimum) the frame ID. + */ + explicit UserUrlLinkFrame(const ByteVector &data); + + /*! + * Destroys this UserUrlLinkFrame instance. + */ + virtual ~UserUrlLinkFrame(); + + // Reimplementations. + + virtual String toString() const; + + /*! + * Returns the text encoding that will be used in rendering this frame. + * This defaults to the type that was either specified in the constructor + * or read from the frame when parsed. + * + * \see setTextEncoding() + * \see render() + */ + String::Type textEncoding() const; + + /*! + * Sets the text encoding to be used when rendering this frame to + * \a encoding. + * + * \see textEncoding() + * \see render() + */ + void setTextEncoding(String::Type encoding); + + /*! + * Returns the description for this frame. + */ + String description() const; + + /*! + * Sets the description of the frame to \a s. \a s must be unique. + */ + void setDescription(const String &s); + + /*! + * Parses the UserUrlLinkFrame as PropertyMap. The description() is taken as key, + * and the URL as single value. + * - if description() is empty, the key will be "URL". + * - otherwise, if description() is not a valid key (e.g. containing non-ASCII + * characters), the returned map will contain an entry "WXXX/" + * in its unsupportedData() list. + */ + PropertyMap asProperties() const; + + /*! + * Searches for the user defined url frame with the description \a description + * in \a tag. This returns null if no matching frames were found. + */ + static UserUrlLinkFrame *find(Tag *tag, const String &description); + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + /*! + * The constructor used by the FrameFactory. + */ + UserUrlLinkFrame(const ByteVector &data, Header *h); + + private: + UserUrlLinkFrame(const UserUrlLinkFrame &); + UserUrlLinkFrame &operator=(const UserUrlLinkFrame &); + + class UserUrlLinkFramePrivate; + UserUrlLinkFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/vorbisfile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/vorbisfile.h new file mode 100644 index 0000000..15c29d9 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/vorbisfile.h @@ -0,0 +1,139 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_VORBISFILE_H +#define TAGLIB_VORBISFILE_H + +#include "taglib_export.h" +#include "oggfile.h" +#include "xiphcomment.h" + +#include "vorbisproperties.h" + +namespace TagLib { + +/* + * This is just to make this appear to be in the Ogg namespace in the + * documentation. The typedef below will make this work with the current code. + * In the next BIC version of TagLib this will be really moved into the Ogg + * namespace. + */ + +#ifdef DOXYGEN + namespace Ogg { +#endif + + //! A namespace containing classes for Vorbis metadata + + namespace Vorbis { + + + //! An implementation of Ogg::File with Vorbis specific methods + + /*! + * This is the central class in the Ogg Vorbis metadata processing collection + * of classes. It's built upon Ogg::File which handles processing of the Ogg + * logical bitstream and breaking it down into pages which are handled by + * the codec implementations, in this case Vorbis specifically. + */ + + class TAGLIB_EXPORT File : public Ogg::File + { + public: + /*! + * Contructs a Vorbis file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs a Vorbis file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the XiphComment for this file. XiphComment implements the tag + * interface, so this serves as the reimplementation of + * TagLib::File::tag(). + */ + virtual Ogg::XiphComment *tag() const; + + + /*! + * Implements the unified property interface -- export function. + * This forwards directly to XiphComment::properties(). + */ + PropertyMap properties() const; + + /*! + * Implements the unified tag dictionary interface -- import function. + * Like properties(), this is a forwarder to the file's XiphComment. + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the Vorbis::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + virtual bool save(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + + class FilePrivate; + FilePrivate *d; + }; + } + +/* + * To keep compatibility with the current version put Vorbis in the Ogg namespace + * only in the docs and provide a typedef to make it work. In the next BIC + * version this will be removed and it will only exist in the Ogg namespace. + */ + +#ifdef DOXYGEN + } +#else + namespace Ogg { namespace Vorbis { typedef TagLib::Vorbis::File File; } } +#endif + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/vorbisproperties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/vorbisproperties.h new file mode 100644 index 0000000..de46985 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/vorbisproperties.h @@ -0,0 +1,125 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_VORBISPROPERTIES_H +#define TAGLIB_VORBISPROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + +/* + * This is just to make this appear to be in the Ogg namespace in the + * documentation. The typedef below will make this work with the current code. + * In the next BIC version of TagLib this will be really moved into the Ogg + * namespace. + */ + +#ifdef DOXYGEN + namespace Ogg { +#endif + + namespace Vorbis { + + class File; + + //! An implementation of audio property reading for Ogg Vorbis + + /*! + * This reads the data from an Ogg Vorbis stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of Vorbis::Properties with the data read from the + * Vorbis::File \a file. + */ + Properties(File *file, ReadStyle style = Average); + + /*! + * Destroys this VorbisProperties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns the Vorbis version, currently "0" (as specified by the spec). + */ + int vorbisVersion() const; + + /*! + * Returns the maximum bitrate as read from the Vorbis identification + * header. + */ + int bitrateMaximum() const; + + /*! + * Returns the nominal bitrate as read from the Vorbis identification + * header. + */ + int bitrateNominal() const; + + /*! + * Returns the minimum bitrate as read from the Vorbis identification + * header. + */ + int bitrateMinimum() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } + +/* + * To keep compatibility with the current version put Vorbis in the Ogg namespace + * only in the docs and provide a typedef to make it work. In the next BIC + * version this will be removed and it will only exist in the Ogg namespace. + */ + +#ifdef DOXYGEN + } +#else + namespace Ogg { namespace Vorbis { typedef TagLib::AudioProperties AudioProperties; } } +#endif + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/wavfile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/wavfile.h new file mode 100644 index 0000000..861f3f7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/wavfile.h @@ -0,0 +1,122 @@ +/*************************************************************************** + copyright : (C) 2008 by Scott Wheeler + email : wheeler@kde.org +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_WAVFILE_H +#define TAGLIB_WAVFILE_H + +#include "rifffile.h" +#include "id3v2tag.h" +#include "wavproperties.h" + +namespace TagLib { + + namespace RIFF { + + //! An implementation of WAV metadata + + /*! + * This is implementation of WAV metadata. + * + * This supports an ID3v2 tag as well as reading stream from the ID3 RIFF + * chunk as well as properties from the file. + */ + + namespace WAV { + + //! An implementation of TagLib::File with WAV specific methods + + /*! + * This implements and provides an interface for WAV files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to WAV files. + */ + + class TAGLIB_EXPORT File : public TagLib::RIFF::File + { + public: + /*! + * Contructs an WAV file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an WAV file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. + */ + virtual ID3v2::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * This method forwards to ID3v2::Tag::properties(). + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * This method forwards to ID3v2::Tag::setProperties(). + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the WAV::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Saves the file. + */ + virtual bool save(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + + class FilePrivate; + FilePrivate *d; + }; + } + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/wavpackfile.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/wavpackfile.h new file mode 100644 index 0000000..02bac02 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/wavpackfile.h @@ -0,0 +1,186 @@ +/*************************************************************************** + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + (original MPC implementation) + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_WVFILE_H +#define TAGLIB_WVFILE_H + +#include "tfile.h" +#include "taglib_export.h" +#include "wavpackproperties.h" + +namespace TagLib { + + class Tag; + + namespace ID3v1 { class Tag; } + namespace APE { class Tag; } + + //! An implementation of WavPack metadata + + /*! + * This is implementation of WavPack metadata. + * + * This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream + * properties from the file. + */ + + namespace WavPack { + + //! An implementation of TagLib::File with WavPack specific methods + + /*! + * This implements and provides an interface for WavPack files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to WavPack files. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * This set of flags is used for various operations and is suitable for + * being OR-ed together. + */ + enum TagTypes { + //! Empty set. Matches no tag types. + NoTags = 0x0000, + //! Matches ID3v1 tags. + ID3v1 = 0x0001, + //! Matches APE tags. + APE = 0x0002, + //! Matches all tag types. + AllTags = 0xffff + }; + + /*! + * Contructs an WavPack file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an WavPack file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. This will be an APE tag, an ID3v1 tag + * or a combination of the two. + */ + virtual TagLib::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * If the file contains both an APE and an ID3v1 tag, only APE + * will be converted to the PropertyMap. + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * As for the export, only one tag is taken into account. If the file + * has no tag at all, APE will be created. + */ + PropertyMap setProperties(const PropertyMap&); + + /*! + * Returns the MPC::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Saves the file. + */ + virtual bool save(); + + /*! + * Returns a pointer to the ID3v1 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v1 tag. If \a create is true it will create + * an ID3v1 tag if one does not exist. If there is already an APE tag, the + * new ID3v1 tag will be placed after it. + * + * \note The Tag is still owned by the APE::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v1::Tag *ID3v1Tag(bool create = false); + + /*! + * Returns a pointer to the APE tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid APE tag. If \a create is true it will create + * a APE tag if one does not exist. + * + * \note The Tag is still owned by the APE::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + APE::Tag *APETag(bool create = false); + + /*! + * This will remove the tags that match the OR-ed together TagTypes from the + * file. By default it removes all tags. + * + * \note This will also invalidate pointers to the tags + * as their memory will be freed. + * \note In order to make the removal permanent save() still needs to be called + */ + void strip(int tags = AllTags); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void scan(); + long findID3v1(); + long findAPE(); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/wavpackproperties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/wavpackproperties.h new file mode 100644 index 0000000..bd2209d --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/wavpackproperties.h @@ -0,0 +1,105 @@ +/*************************************************************************** + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + (original MPC implementation) + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_WVPROPERTIES_H +#define TAGLIB_WVPROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + + namespace WavPack { + + class File; + + static const uint HeaderSize = 32; + + //! An implementation of audio property reading for WavPack + + /*! + * This reads the data from an WavPack stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of WavPack::Properties with the data read from the + * ByteVector \a data. + * + * \deprecated This constructor will be dropped in favor of the one below + * in a future version. + */ + Properties(const ByteVector &data, long streamLength, ReadStyle style = Average); + + /*! + * Create an instance of WavPack::Properties. + */ + // BIC: merge with the above constructor + Properties(File *file, long streamLength, ReadStyle style = Average); + + /*! + * Destroys this WavPack::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns number of bits per sample. + */ + int bitsPerSample() const; + uint sampleFrames() const; + + /*! + * Returns WavPack version. + */ + int version() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + unsigned int seekFinalIndex(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/wavproperties.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/wavproperties.h new file mode 100644 index 0000000..2023f53 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/wavproperties.h @@ -0,0 +1,92 @@ +/*************************************************************************** + copyright : (C) 2008 by Scott Wheeler + email : wheeler@kde.org +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_WAVPROPERTIES_H +#define TAGLIB_WAVPROPERTIES_H + +#include "taglib.h" +#include "audioproperties.h" + +namespace TagLib { + + class ByteVector; + + namespace RIFF { + + namespace WAV { + + class File; + + //! An implementation of audio property reading for WAV + + /*! + * This reads the data from an WAV stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of WAV::Properties with the data read from the + * ByteVector \a data. + */ + Properties(const ByteVector &data, ReadStyle style); + + /*! + * Create an instance of WAV::Properties with the data read from the + * ByteVector \a data and the length calculated using \a streamLength. + */ + Properties(const ByteVector &data, uint streamLength, ReadStyle style); + + /*! + * Destroys this WAV::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + int sampleWidth() const; + uint sampleFrames() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(const ByteVector &data); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/xingheader.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/xingheader.h new file mode 100644 index 0000000..ffe7494 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/xingheader.h @@ -0,0 +1,100 @@ +/*************************************************************************** + copyright : (C) 2003 by Ismael Orenstein + email : orenstein@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_XINGHEADER_H +#define TAGLIB_XINGHEADER_H + +#include "mpegheader.h" +#include "taglib_export.h" + +namespace TagLib { + + class ByteVector; + + namespace MPEG { + + //! An implementation of the Xing VBR headers + + /*! + * This is a minimalistic implementation of the Xing VBR headers. Xing + * headers are often added to VBR (variable bit rate) MP3 streams to make it + * easy to compute the length and quality of a VBR stream. Our implementation + * is only concerned with the total size of the stream (so that we can + * calculate the total playing time and the average bitrate). It uses + * this text + * and the XMMS sources as references. + */ + + class TAGLIB_EXPORT XingHeader + { + public: + /*! + * Parses a Xing header based on \a data. The data must be at least 16 + * bytes long (anything longer than this is discarded). + */ + XingHeader(const ByteVector &data); + + /*! + * Destroy this XingHeader instance. + */ + virtual ~XingHeader(); + + /*! + * Returns true if the data was parsed properly and if there is a valid + * Xing header present. + */ + bool isValid() const; + + /*! + * Returns the total number of frames. + */ + uint totalFrames() const; + + /*! + * Returns the total size of stream in bytes. + */ + uint totalSize() const; + + /*! + * Returns the offset for the start of this Xing header, given the + * version and channels of the frame + */ + // BIC: rename to offset() + static int xingHeaderOffset(TagLib::MPEG::Header::Version v, + TagLib::MPEG::Header::ChannelMode c); + + private: + XingHeader(const XingHeader &); + XingHeader &operator=(const XingHeader &); + + void parse(const ByteVector &data); + + class XingHeaderPrivate; + XingHeaderPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/xiphcomment.h b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/xiphcomment.h new file mode 100644 index 0000000..3b44086 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Headers/xiphcomment.h @@ -0,0 +1,217 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_VORBISCOMMENT_H +#define TAGLIB_VORBISCOMMENT_H + +#include "tag.h" +#include "tlist.h" +#include "tmap.h" +#include "tstring.h" +#include "tstringlist.h" +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace Ogg { + + /*! + * A mapping between a list of field names, or keys, and a list of values + * associated with that field. + * + * \see XiphComment::fieldListMap() + */ + typedef Map FieldListMap; + + //! Ogg Vorbis comment implementation + + /*! + * This class is an implementation of the Ogg Vorbis comment specification, + * to be found in section 5 of the Ogg Vorbis specification. Because this + * format is also used in other (currently unsupported) Xiph.org formats, it + * has been made part of a generic implementation rather than being limited + * to strictly Vorbis. + * + * Vorbis comments are a simple vector of keys and values, called fields. + * Multiple values for a given key are supported. + * + * \see fieldListMap() + */ + + class TAGLIB_EXPORT XiphComment : public TagLib::Tag + { + public: + /*! + * Constructs an empty Vorbis comment. + */ + XiphComment(); + + /*! + * Constructs a Vorbis comment from \a data. + */ + XiphComment(const ByteVector &data); + + /*! + * Destroys this instance of the XiphComment. + */ + virtual ~XiphComment(); + + virtual String title() const; + virtual String artist() const; + virtual String album() const; + virtual String comment() const; + virtual String genre() const; + virtual uint year() const; + virtual uint track() const; + + virtual void setTitle(const String &s); + virtual void setArtist(const String &s); + virtual void setAlbum(const String &s); + virtual void setComment(const String &s); + virtual void setGenre(const String &s); + virtual void setYear(uint i); + virtual void setTrack(uint i); + + virtual bool isEmpty() const; + + /*! + * Returns the number of fields present in the comment. + */ + uint fieldCount() const; + + /*! + * Returns a reference to the map of field lists. Because Xiph comments + * support multiple fields with the same key, a pure Map would not work. + * As such this is a Map of string lists, keyed on the comment field name. + * + * The standard set of Xiph/Vorbis fields (which may or may not be + * contained in any specific comment) is: + * + *
    + *
  • TITLE
  • + *
  • VERSION
  • + *
  • ALBUM
  • + *
  • ARTIST
  • + *
  • PERFORMER
  • + *
  • COPYRIGHT
  • + *
  • ORGANIZATION
  • + *
  • DESCRIPTION
  • + *
  • GENRE
  • + *
  • DATE
  • + *
  • LOCATION
  • + *
  • CONTACT
  • + *
  • ISRC
  • + *
+ * + * For a more detailed description of these fields, please see the Ogg + * Vorbis specification, section 5.2.2.1. + * + * \note The Ogg Vorbis comment specification does allow these key values + * to be either upper or lower case. However, it is conventional for them + * to be upper case. As such, TagLib, when parsing a Xiph/Vorbis comment, + * converts all fields to uppercase. When you are using this data + * structure, you will need to specify the field name in upper case. + * + * \warning You should not modify this data structure directly, instead + * use addField() and removeField(). + */ + const FieldListMap &fieldListMap() const; + + /*! + * Implements the unified property interface -- export function. + * The result is a one-to-one match of the Xiph comment, since it is + * completely compatible with the property interface (in fact, a Xiph + * comment is nothing more than a map from tag names to list of values, + * as is the dict interface). + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * The tags from the given map will be stored one-to-one in the file. + */ + PropertyMap setProperties(const PropertyMap&); + + /*! + * Returns the vendor ID of the Ogg Vorbis encoder. libvorbis 1.0 as the + * most common case always returns "Xiph.Org libVorbis I 20020717". + */ + String vendorID() const; + + /*! + * Add the field specified by \a key with the data \a value. If \a replace + * is true, then all of the other fields with the same key will be removed + * first. + * + * If the field value is empty, the field will be removed. + */ + void addField(const String &key, const String &value, bool replace = true); + + /*! + * Remove the field specified by \a key with the data \a value. If + * \a value is null, all of the fields with the given key will be removed. + */ + void removeField(const String &key, const String &value = String::null); + + /*! + * Returns true if the field is contained within the comment. + * + * \note This is safer than checking for membership in the FieldListMap. + */ + bool contains(const String &key) const; + + /*! + * Renders the comment to a ByteVector suitable for inserting into a file. + */ + ByteVector render() const; // BIC: remove and merge with below + + /*! + * Renders the comment to a ByteVector suitable for inserting into a file. + * + * If \a addFramingBit is true the standard Vorbis comment framing bit will + * be appended. However some formats (notably FLAC) do not work with this + * in place. + */ + ByteVector render(bool addFramingBit) const; + + protected: + /*! + * Reads the tag from the file specified in the constructor and fills the + * FieldListMap. + */ + void parse(const ByteVector &data); + + private: + XiphComment(const XiphComment &); + XiphComment &operator=(const XiphComment &); + + class XiphCommentPrivate; + XiphCommentPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/Info.plist b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..33e4024 Binary files /dev/null and b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/Info.plist differ diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/id3v2.2.0.txt b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/id3v2.2.0.txt new file mode 100644 index 0000000..a69bddd --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/id3v2.2.0.txt @@ -0,0 +1,1660 @@ + +Informal standard M. Nilsson +Document: id3v2-00.txt 26th March 1998 + + + ID3 tag version 2 + +Status of this document + + This document is an Informal standard and is released so that + implementors could have a set standard before the formal standard is + set. The formal standard will use another version number if not + identical to what is described in this document. The contents in this + document may change for clarifications but never for added or altered + functionallity. + + Distribution of this document is unlimited. + + +Abstract + + The recent gain of popularity for MPEG layer III audio files on the + internet forced a standardised way of storing information about an + audio file within itself to determinate its origin and contents. + + Today the most accepted way to do this is with the so called ID3 tag, + which is simple but very limited and in some cases very unsuitable. + The ID3 tag has very limited space in every field, very limited + numbers of fields, not expandable or upgradeable and is placed at the + end of a the file, which is unsuitable for streaming audio. This draft + is an attempt to answer these issues with a new version of the ID3 + tag. + + +1. Table of contents + + 2. Conventions in this document + 3. ID3v2 overview + 3.1. ID3v2 header + 3.2. ID3v2 frames overview + 4. Declared ID3v2 frames + 4.1. Unique file identifier + 4.2. Text information frames + 4.2.1. Text information frames - details + 4.2.2. User defined text information frame + 4.3. URL link frames + 4.3.1. URL link frames - details + 4.3.2. User defined URL link frame + 4.4. Involved people list + 4.5. Music CD Identifier + 4.6. Event timing codes + 4.7. MPEG location lookup table + 4.8. Synced tempo codes + 4.9. Unsychronised lyrics/text transcription + 4.10. Synchronised lyrics/text + 4.11. Comments + 4.12. Relative volume adjustment + 4.13. Equalisation + 4.14. Reverb + 4.15. Attached picture + 4.16. General encapsulated object + 4.17. Play counter + 4.18. Popularimeter + 4.19. Recommended buffer size + 4.20. Encrypted meta frame + 4.21. Audio encryption + 4.22. Linked information + 5. The 'unsynchronisation scheme' + 6. Copyright + 7. References + 8. Appendix + A. Appendix A - ID3-Tag Specification V1.1 + A.1. Overview + A.2. ID3v1 Implementation + A.3. Genre List + A.4. Track addition - ID3v1.1 + 9. Author's Address + + +2. Conventions in this document + + In the examples, text within "" is a text string exactly as it appears + in a file. Numbers preceded with $ are hexadecimal and numbers + preceded with % are binary. $xx is used to indicate a byte with + unknown content. %x is used to indicate a bit with unknown content. + The most significant bit (MSB) of a byte is called 'bit 7' and the + least significant bit (LSB) is called 'bit 0'. + + A tag is the whole tag described in this document. A frame is a block + of information in the tag. The tag consists of a header, frames and + optional padding. A field is a piece of information; one value, a + string etc. A numeric string is a string that consists of the + characters 0-9 only. + + +3. ID3v2 overview + + The two biggest design goals were to be able to implement ID3v2 + without disturbing old software too much and that ID3v2 should be + expandable. + + The first criterion is met by the simple fact that the MPEG [MPEG] + decoding software uses a syncsignal, embedded in the audiostream, to + 'lock on to' the audio. Since the ID3v2 tag doesn't contain a valid + syncsignal, no software will attempt to play the tag. If, for any + reason, coincidence make a syncsignal appear within the tag it will be + taken care of by the 'unsynchronisation scheme' described in section + 5. + + The second criterion has made a more noticeable impact on the design + of the ID3v2 tag. It is constructed as a container for several + information blocks, called frames, whose format need not be known to + the software that encounters them. At the start of every frame there + is an identifier that explains the frames's format and content, and a + size descriptor that allows software to skip unknown frames. + + If a total revision of the ID3v2 tag should be needed, there is a + version number and a size descriptor in the ID3v2 header. + + The ID3 tag described in this document is mainly targeted to files + encoded with MPEG-2 layer I, MPEG-2 layer II, MPEG-2 layer III and + MPEG-2.5, but may work with other types of encoded audio. + + The bitorder in ID3v2 is most significant bit first (MSB). The + byteorder in multibyte numbers is most significant byte first (e.g. + $12345678 would be encoded $12 34 56 78). + + It is permitted to include padding after all the final frame (at the + end of the ID3 tag), making the size of all the frames together + smaller than the size given in the head of the tag. A possible purpose + of this padding is to allow for adding a few additional frames or + enlarge existing frames within the tag without having to rewrite the + entire file. The value of the padding bytes must be $00. + + +3.1. ID3v2 header + + The ID3v2 tag header, which should be the first information in the + file, is 10 bytes as follows: + + ID3/file identifier "ID3" + ID3 version $02 00 + ID3 flags %xx000000 + ID3 size 4 * %0xxxxxxx + + The first three bytes of the tag are always "ID3" to indicate that + this is an ID3 tag, directly followed by the two version bytes. The + first byte of ID3 version is it's major version, while the second byte + is its revision number. All revisions are backwards compatible while + major versions are not. If software with ID3v2 and below support + should encounter version three or higher it should simply ignore the + whole tag. Version and revision will never be $FF. + + The first bit (bit 7) in the 'ID3 flags' is indicating whether or not + unsynchronisation is used (see section 5 for details); a set bit + indicates usage. + + The second bit (bit 6) is indicating whether or not compression is + used; a set bit indicates usage. Since no compression scheme has been + decided yet, the ID3 decoder (for now) should just ignore the entire + tag if the compression bit is set. + + The ID3 tag size is encoded with four bytes where the first bit (bit + 7) is set to zero in every byte, making a total of 28 bits. The zeroed + bits are ignored, so a 257 bytes long tag is represented as $00 00 02 + 01. + + The ID3 tag size is the size of the complete tag after + unsychronisation, including padding, excluding the header (total tag + size - 10). The reason to use 28 bits (representing up to 256MB) for + size description is that we don't want to run out of space here. + + A ID3v2 tag can be detected with the following pattern: + $49 44 33 yy yy xx zz zz zz zz + Where yy is less than $FF, xx is the 'flags' byte and zz is less than + $80. + + +3.2. ID3v2 frames overview + + The headers of the frames are similar in their construction. They + consist of one three character identifier (capital A-Z and 0-9) and + one three byte size field, making a total of six bytes. The header is + excluded from the size. Identifiers beginning with "X", "Y" and "Z" + are for experimental use and free for everyone to use. Have in mind + that someone else might have used the same identifier as you. All + other identifiers are either used or reserved for future use. + + The three character frame identifier is followed by a three byte size + descriptor, making a total header size of six bytes in every frame. + The size is calculated as framesize excluding frame identifier and + size descriptor (frame size - 6). + + There is no fixed order of the frames' appearance in the tag, although + it is desired that the frames are arranged in order of significance + concerning the recognition of the file. An example of such order: + UFI, MCI, TT2 ... + + A tag must contain at least one frame. A frame must be at least 1 byte + big, excluding the 6-byte header. + + If nothing else is said a string is represented as ISO-8859-1 + [ISO-8859-1] characters in the range $20 - $FF. All unicode strings + [UNICODE] use 16-bit unicode 2.0 (ISO/IEC 10646-1:1993, UCS-2). All + numeric strings are always encoded as ISO-8859-1. Terminated strings + are terminated with $00 if encoded with ISO-8859-1 and $00 00 if + encoded as unicode. If nothing else is said newline character is + forbidden. In ISO-8859-1 a new line is represented, when allowed, with + $0A only. Frames that allow different types of text encoding have a + text encoding description byte directly after the frame size. If + ISO-8859-1 is used this byte should be $00, if unicode is used it + should be $01. + + The three byte language field is used to describe the language of the + frame's content, according to ISO-639-2 [ISO-639-2]. + + All URLs [URL] may be relative, e.g. "picture.png", "../doc.txt". + + If a frame is longer than it should be, e.g. having more fields than + specified in this document, that indicates that additions to the + frame have been made in a later version of the ID3 standard. This + is reflected by the revision number in the header of the tag. + + +4. Declared ID3v2 frames + + The following frames are declared in this draft. + + 4.19 BUF Recommended buffer size + + 4.17 CNT Play counter + 4.11 COM Comments + 4.21 CRA Audio encryption + 4.20 CRM Encrypted meta frame + + 4.6 ETC Event timing codes + 4.13 EQU Equalization + + 4.16 GEO General encapsulated object + + 4.4 IPL Involved people list + + 4.22 LNK Linked information + + 4.5 MCI Music CD Identifier + 4.7 MLL MPEG location lookup table + + 4.15 PIC Attached picture + 4.18 POP Popularimeter + + 4.14 REV Reverb + 4.12 RVA Relative volume adjustment + + 4.10 SLT Synchronized lyric/text + 4.8 STC Synced tempo codes + + 4.2.1 TAL Album/Movie/Show title + 4.2.1 TBP BPM (Beats Per Minute) + 4.2.1 TCM Composer + 4.2.1 TCO Content type + 4.2.1 TCR Copyright message + 4.2.1 TDA Date + 4.2.1 TDY Playlist delay + 4.2.1 TEN Encoded by + 4.2.1 TFT File type + 4.2.1 TIM Time + 4.2.1 TKE Initial key + 4.2.1 TLA Language(s) + 4.2.1 TLE Length + 4.2.1 TMT Media type + 4.2.1 TOA Original artist(s)/performer(s) + 4.2.1 TOF Original filename + 4.2.1 TOL Original Lyricist(s)/text writer(s) + 4.2.1 TOR Original release year + 4.2.1 TOT Original album/Movie/Show title + 4.2.1 TP1 Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group + 4.2.1 TP2 Band/Orchestra/Accompaniment + 4.2.1 TP3 Conductor/Performer refinement + 4.2.1 TP4 Interpreted, remixed, or otherwise modified by + 4.2.1 TPA Part of a set + 4.2.1 TPB Publisher + 4.2.1 TRC ISRC (International Standard Recording Code) + 4.2.1 TRD Recording dates + 4.2.1 TRK Track number/Position in set + 4.2.1 TSI Size + 4.2.1 TSS Software/hardware and settings used for encoding + 4.2.1 TT1 Content group description + 4.2.1 TT2 Title/Songname/Content description + 4.2.1 TT3 Subtitle/Description refinement + 4.2.1 TXT Lyricist/text writer + 4.2.2 TXX User defined text information frame + 4.2.1 TYE Year + + 4.1 UFI Unique file identifier + 4.9 ULT Unsychronized lyric/text transcription + + 4.3.1 WAF Official audio file webpage + 4.3.1 WAR Official artist/performer webpage + 4.3.1 WAS Official audio source webpage + 4.3.1 WCM Commercial information + 4.3.1 WCP Copyright/Legal information + 4.3.1 WPB Publishers official webpage + 4.3.2 WXX User defined URL link frame + + +4.1. Unique file identifier + + This frame's purpose is to be able to identify the audio file in a + database that may contain more information relevant to the content. + Since standardisation of such a database is beyond this document, all + frames begin with a null-terminated string with a URL [URL] containing + an email address, or a link to a location where an email address can + be found, that belongs to the organisation responsible for this + specific database implementation. Questions regarding the database + should be sent to the indicated email address. The URL should not be + used for the actual database queries. If a $00 is found directly after + the 'Frame size' the whole frame should be ignored, and preferably be + removed. The 'Owner identifier' is then followed by the actual + identifier, which may be up to 64 bytes. There may be more than one + "UFI" frame in a tag, but only one with the same 'Owner identifier'. + + Unique file identifier "UFI" + Frame size $xx xx xx + Owner identifier $00 + Identifier + + +4.2. Text information frames + + The text information frames are the most important frames, containing + information like artist, album and more. There may only be one text + information frame of its kind in an tag. If the textstring is followed + by a termination ($00 (00)) all the following information should be + ignored and not be displayed. All the text information frames have the + following format: + + Text information identifier "T00" - "TZZ" , excluding "TXX", + described in 4.2.2. + Frame size $xx xx xx + Text encoding $xx + Information + + +4.2.1. Text information frames - details + + TT1 + The 'Content group description' frame is used if the sound belongs to + a larger category of sounds/music. For example, classical music is + often sorted in different musical sections (e.g. "Piano Concerto", + "Weather - Hurricane"). + + TT2 + The 'Title/Songname/Content description' frame is the actual name of + the piece (e.g. "Adagio", "Hurricane Donna"). + + TT3 + The 'Subtitle/Description refinement' frame is used for information + directly related to the contents title (e.g. "Op. 16" or "Performed + live at wembley"). + + TP1 + The 'Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group' is + used for the main artist(s). They are seperated with the "/" + character. + + TP2 + The 'Band/Orchestra/Accompaniment' frame is used for additional + information about the performers in the recording. + + TP3 + The 'Conductor' frame is used for the name of the conductor. + + TP4 + The 'Interpreted, remixed, or otherwise modified by' frame contains + more information about the people behind a remix and similar + interpretations of another existing piece. + + TCM + The 'Composer(s)' frame is intended for the name of the composer(s). + They are seperated with the "/" character. + + TXT + The 'Lyricist(s)/text writer(s)' frame is intended for the writer(s) + of the text or lyrics in the recording. They are seperated with the + "/" character. + + TLA + The 'Language(s)' frame should contain the languages of the text or + lyrics in the audio file. The language is represented with three + characters according to ISO-639-2. If more than one language is used + in the text their language codes should follow according to their + usage. + + TCO + The content type, which previously (in ID3v1.1, see appendix A) was + stored as a one byte numeric value only, is now a numeric string. You + may use one or several of the types as ID3v1.1 did or, since the + category list would be impossible to maintain with accurate and up to + date categories, define your own. + References to the ID3v1 genres can be made by, as first byte, enter + "(" followed by a number from the genres list (section A.3.) and + ended with a ")" character. This is optionally followed by a + refinement, e.g. "(21)" or "(4)Eurodisco". Several references can be + made in the same frame, e.g. "(51)(39)". If the refinement should + begin with a "(" character it should be replaced with "((", e.g. "((I + can figure out any genre)" or "(55)((I think...)". The following new + content types is defined in ID3v2 and is implemented in the same way + as the numerig content types, e.g. "(RX)". + + RX Remix + CR Cover + + TAL + The 'Album/Movie/Show title' frame is intended for the title of the + recording(/source of sound) which the audio in the file is taken from. + + TPA + The 'Part of a set' frame is a numeric string that describes which + part of a set the audio came from. This frame is used if the source + described in the "TAL" frame is divided into several mediums, e.g. a + double CD. The value may be extended with a "/" character and a + numeric string containing the total number of parts in the set. E.g. + "1/2". + + TRK + The 'Track number/Position in set' frame is a numeric string + containing the order number of the audio-file on its original + recording. This may be extended with a "/" character and a numeric + string containing the total numer of tracks/elements on the original + recording. E.g. "4/9". + + TRC + The 'ISRC' frame should contian the International Standard Recording + Code [ISRC]. + + TYE + The 'Year' frame is a numeric string with a year of the recording. + This frames is always four characters long (until the year 10000). + + TDA + The 'Date' frame is a numeric string in the DDMM format containing + the date for the recording. This field is always four characters + long. + + TIM + The 'Time' frame is a numeric string in the HHMM format containing + the time for the recording. This field is always four characters + long. + + TRD + The 'Recording dates' frame is a intended to be used as complement to + the "TYE", "TDA" and "TIM" frames. E.g. "4th-7th June, 12th June" in + combination with the "TYE" frame. + + TMT + The 'Media type' frame describes from which media the sound + originated. This may be a textstring or a reference to the predefined + media types found in the list below. References are made within "(" + and ")" and are optionally followed by a text refinement, e.g. "(MC) + with four channels". If a text refinement should begin with a "(" + character it should be replaced with "((" in the same way as in the + "TCO" frame. Predefined refinements is appended after the media type, + e.g. "(CD/S)" or "(VID/PAL/VHS)". + + DIG Other digital media + /A Analog transfer from media + + ANA Other analog media + /WAC Wax cylinder + /8CA 8-track tape cassette + + CD CD + /A Analog transfer from media + /DD DDD + /AD ADD + /AA AAD + + LD Laserdisc + /A Analog transfer from media + + TT Turntable records + /33 33.33 rpm + /45 45 rpm + /71 71.29 rpm + /76 76.59 rpm + /78 78.26 rpm + /80 80 rpm + + MD MiniDisc + /A Analog transfer from media + + DAT DAT + /A Analog transfer from media + /1 standard, 48 kHz/16 bits, linear + /2 mode 2, 32 kHz/16 bits, linear + /3 mode 3, 32 kHz/12 bits, nonlinear, low speed + /4 mode 4, 32 kHz/12 bits, 4 channels + /5 mode 5, 44.1 kHz/16 bits, linear + /6 mode 6, 44.1 kHz/16 bits, 'wide track' play + + DCC DCC + /A Analog transfer from media + + DVD DVD + /A Analog transfer from media + + TV Television + /PAL PAL + /NTSC NTSC + /SECAM SECAM + + VID Video + /PAL PAL + /NTSC NTSC + /SECAM SECAM + /VHS VHS + /SVHS S-VHS + /BETA BETAMAX + + RAD Radio + /FM FM + /AM AM + /LW LW + /MW MW + + TEL Telephone + /I ISDN + + MC MC (normal cassette) + /4 4.75 cm/s (normal speed for a two sided cassette) + /9 9.5 cm/s + /I Type I cassette (ferric/normal) + /II Type II cassette (chrome) + /III Type III cassette (ferric chrome) + /IV Type IV cassette (metal) + + REE Reel + /9 9.5 cm/s + /19 19 cm/s + /38 38 cm/s + /76 76 cm/s + /I Type I cassette (ferric/normal) + /II Type II cassette (chrome) + /III Type III cassette (ferric chrome) + /IV Type IV cassette (metal) + + TFT + The 'File type' frame indicates which type of audio this tag defines. + The following type and refinements are defined: + + MPG MPEG Audio + /1 MPEG 2 layer I + /2 MPEG 2 layer II + /3 MPEG 2 layer III + /2.5 MPEG 2.5 + /AAC Advanced audio compression + + but other types may be used, not for these types though. This is used + in a similar way to the predefined types in the "TMT" frame, but + without parenthesis. If this frame is not present audio type is + assumed to be "MPG". + + TBP + BPM is short for beats per minute, and is easily computed by + dividing the number of beats in a musical piece with its length. To + get a more accurate result, do the BPM calculation on the main-part + only. To acquire best result measure the time between each beat and + calculate individual BPM for each beat and use the median value as + result. BPM is an integer and represented as a numerical string. + + TCR + The 'Copyright message' frame, which must begin with a year and a + space character (making five characters), is intended for the + copyright holder of the original sound, not the audio file itself. The + absence of this frame means only that the copyright information is + unavailable or has been removed, and must not be interpreted to mean + that the sound is public domain. Every time this field is displayed + the field must be preceded with "Copyright " (C) " ", where (C) is one + character showing a C in a circle. + + TPB + The 'Publisher' frame simply contains the name of the label or + publisher. + + TEN + The 'Encoded by' frame contains the name of the person or + organisation that encoded the audio file. This field may contain a + copyright message, if the audio file also is copyrighted by the + encoder. + + TSS + The 'Software/hardware and settings used for encoding' frame + includes the used audio encoder and its settings when the file was + encoded. Hardware refers to hardware encoders, not the computer on + which a program was run. + + TOF + The 'Original filename' frame contains the preferred filename for the + file, since some media doesn't allow the desired length of the + filename. The filename is case sensitive and includes its suffix. + + TLE + The 'Length' frame contains the length of the audiofile in + milliseconds, represented as a numeric string. + + TSI + The 'Size' frame contains the size of the audiofile in bytes + excluding the tag, represented as a numeric string. + + TDY + The 'Playlist delay' defines the numbers of milliseconds of silence + between every song in a playlist. The player should use the "ETC" + frame, if present, to skip initial silence and silence at the end of + the audio to match the 'Playlist delay' time. The time is represented + as a numeric string. + + TKE + The 'Initial key' frame contains the musical key in which the sound + starts. It is represented as a string with a maximum length of three + characters. The ground keys are represented with "A","B","C","D","E", + "F" and "G" and halfkeys represented with "b" and "#". Minor is + represented as "m". Example "Cbm". Off key is represented with an "o" + only. + + TOT + The 'Original album/Movie/Show title' frame is intended for the title + of the original recording(/source of sound), if for example the music + in the file should be a cover of a previously released song. + + TOA + The 'Original artist(s)/performer(s)' frame is intended for the + performer(s) of the original recording, if for example the music in + the file should be a cover of a previously released song. The + performers are seperated with the "/" character. + + TOL + The 'Original Lyricist(s)/text writer(s)' frame is intended for the + text writer(s) of the original recording, if for example the music in + the file should be a cover of a previously released song. The text + writers are seperated with the "/" character. + + TOR + The 'Original release year' frame is intended for the year when the + original recording, if for example the music in the file should be a + cover of a previously released song, was released. The field is + formatted as in the "TDY" frame. + + +4.2.2. User defined text information frame + + This frame is intended for one-string text information concerning the + audiofile in a similar way to the other "T"xx frames. The frame body + consists of a description of the string, represented as a terminated + string, followed by the actual string. There may be more than one + "TXX" frame in each tag, but only one with the same description. + + User defined... "TXX" + Frame size $xx xx xx + Text encoding $xx + Description $00 (00) + Value + + +4.3. URL link frames + + With these frames dynamic data such as webpages with touring + information, price information or plain ordinary news can be added to + the tag. There may only be one URL [URL] link frame of its kind in an + tag, except when stated otherwise in the frame description. If the + textstring is followed by a termination ($00 (00)) all the following + information should be ignored and not be displayed. All URL link + frames have the following format: + + URL link frame "W00" - "WZZ" , excluding "WXX" + (described in 4.3.2.) + Frame size $xx xx xx + URL + + +4.3.1. URL link frames - details + + WAF + The 'Official audio file webpage' frame is a URL pointing at a file + specific webpage. + + WAR + The 'Official artist/performer webpage' frame is a URL pointing at + the artists official webpage. There may be more than one "WAR" frame + in a tag if the audio contains more than one performer. + + WAS + The 'Official audio source webpage' frame is a URL pointing at the + official webpage for the source of the audio file, e.g. a movie. + + WCM + The 'Commercial information' frame is a URL pointing at a webpage + with information such as where the album can be bought. There may be + more than one "WCM" frame in a tag. + + WCP + The 'Copyright/Legal information' frame is a URL pointing at a + webpage where the terms of use and ownership of the file is described. + + WPB + The 'Publishers official webpage' frame is a URL pointing at the + official wepage for the publisher. + + +4.3.2. User defined URL link frame + + This frame is intended for URL [URL] links concerning the audiofile in + a similar way to the other "W"xx frames. The frame body consists of a + description of the string, represented as a terminated string, + followed by the actual URL. The URL is always encoded with ISO-8859-1 + [ISO-8859-1]. There may be more than one "WXX" frame in each tag, but + only one with the same description. + + User defined... "WXX" + Frame size $xx xx xx + Text encoding $xx + Description $00 (00) + URL + + +4.4. Involved people list + + Since there might be a lot of people contributing to an audio file in + various ways, such as musicians and technicians, the 'Text + information frames' are often insufficient to list everyone involved + in a project. The 'Involved people list' is a frame containing the + names of those involved, and how they were involved. The body simply + contains a terminated string with the involvement directly followed by + a terminated string with the involvee followed by a new involvement + and so on. There may only be one "IPL" frame in each tag. + + Involved people list "IPL" + Frame size $xx xx xx + Text encoding $xx + People list strings + + +4.5. Music CD Identifier + + This frame is intended for music that comes from a CD, so that the CD + can be identified in databases such as the CDDB [CDDB]. The frame + consists of a binary dump of the Table Of Contents, TOC, from the CD, + which is a header of 4 bytes and then 8 bytes/track on the CD making a + maximum of 804 bytes. This frame requires a present and valid "TRK" + frame. There may only be one "MCI" frame in each tag. + + Music CD identifier "MCI" + Frame size $xx xx xx + CD TOC + + +4.6. Event timing codes + + This frame allows synchronisation with key events in a song or sound. + The head is: + + Event timing codes "ETC" + Frame size $xx xx xx + Time stamp format $xx + + Where time stamp format is: + + $01 Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit + $02 Absolute time, 32 bit sized, using milliseconds as unit + + Abolute time means that every stamp contains the time from the + beginning of the file. + + Followed by a list of key events in the following format: + + Type of event $xx + Time stamp $xx (xx ...) + + The 'Time stamp' is set to zero if directly at the beginning of the + sound or after the previous event. All events should be sorted in + chronological order. The type of event is as follows: + + $00 padding (has no meaning) + $01 end of initial silence + $02 intro start + $03 mainpart start + $04 outro start + $05 outro end + $06 verse begins + $07 refrain begins + $08 interlude + $09 theme start + $0A variation + $0B key change + $0C time change + $0D unwanted noise (Snap, Crackle & Pop) + + $0E-$DF reserved for future use + + $E0-$EF not predefined sync 0-F + + $F0-$FC reserved for future use + + $FD audio end (start of silence) + $FE audio file ends + $FF one more byte of events follows (all the following bytes with + the value $FF have the same function) + + The 'Not predefined sync's ($E0-EF) are for user events. You might + want to synchronise your music to something, like setting of an + explosion on-stage, turning on your screensaver etc. + + There may only be one "ETC" frame in each tag. + + +4.7. MPEG location lookup table + + To increase performance and accuracy of jumps within a MPEG [MPEG] + audio file, frames with timecodes in different locations in the file + might be useful. The ID3 frame includes references that the software + can use to calculate positions in the file. After the frame header is + a descriptor of how much the 'frame counter' should increase for every + reference. If this value is two then the first reference points out + the second frame, the 2nd reference the 4th frame, the 3rd reference + the 6th frame etc. In a similar way the 'bytes between reference' and + 'milliseconds between reference' points out bytes and milliseconds + respectively. + + Each reference consists of two parts; a certain number of bits, as + defined in 'bits for bytes deviation', that describes the difference + between what is said in 'bytes between reference' and the reality and + a certain number of bits, as defined in 'bits for milliseconds + deviation', that describes the difference between what is said in + 'milliseconds between reference' and the reality. The number of bits + in every reference, i.e. 'bits for bytes deviation'+'bits for + milliseconds deviation', must be a multiple of four. There may only be + one "MLL" frame in each tag. + + Location lookup table "MLL" + ID3 frame size $xx xx xx + MPEG frames between reference $xx xx + Bytes between reference $xx xx xx + Milliseconds between reference $xx xx xx + Bits for bytes deviation $xx + Bits for milliseconds dev. $xx + + Then for every reference the following data is included; + + Deviation in bytes %xxx.... + Deviation in milliseconds %xxx.... + + +4.8. Synced tempo codes + + For a more accurate description of the tempo of a musical piece this + frame might be used. After the header follows one byte describing + which time stamp format should be used. Then follows one or more tempo + codes. Each tempo code consists of one tempo part and one time part. + The tempo is in BPM described with one or two bytes. If the first byte + has the value $FF, one more byte follows, which is added to the first + giving a range from 2 - 510 BPM, since $00 and $01 is reserved. $00 is + used to describe a beat-free time period, which is not the same as a + music-free time period. $01 is used to indicate one single beat-stroke + followed by a beat-free period. + + The tempo descriptor is followed by a time stamp. Every time the tempo + in the music changes, a tempo descriptor may indicate this for the + player. All tempo descriptors should be sorted in chronological order. + The first beat-stroke in a time-period is at the same time as the beat + description occurs. There may only be one "STC" frame in each tag. + + Synced tempo codes "STC" + Frame size $xx xx xx + Time stamp format $xx + Tempo data + + Where time stamp format is: + + $01 Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit + $02 Absolute time, 32 bit sized, using milliseconds as unit + + Abolute time means that every stamp contains the time from the + beginning of the file. + + +4.9. Unsychronised lyrics/text transcription + + This frame contains the lyrics of the song or a text transcription of + other vocal activities. The head includes an encoding descriptor and + a content descriptor. The body consists of the actual text. The + 'Content descriptor' is a terminated string. If no descriptor is + entered, 'Content descriptor' is $00 (00) only. Newline characters + are allowed in the text. Maximum length for the descriptor is 64 + bytes. There may be more than one lyrics/text frame in each tag, but + only one with the same language and content descriptor. + + Unsynced lyrics/text "ULT" + Frame size $xx xx xx + Text encoding $xx + Language $xx xx xx + Content descriptor $00 (00) + Lyrics/text + + +4.10. Synchronised lyrics/text + + This is another way of incorporating the words, said or sung lyrics, + in the audio file as text, this time, however, in sync with the audio. + It might also be used to describing events e.g. occurring on a stage + or on the screen in sync with the audio. The header includes a content + descriptor, represented with as terminated textstring. If no + descriptor is entered, 'Content descriptor' is $00 (00) only. + + Synced lyrics/text "SLT" + Frame size $xx xx xx + Text encoding $xx + Language $xx xx xx + Time stamp format $xx + Content type $xx + Content descriptor $00 (00) + + + Encoding: $00 ISO-8859-1 [ISO-8859-1] character set is used => $00 + is sync identifier. + $01 Unicode [UNICODE] character set is used => $00 00 is + sync identifier. + + Content type: $00 is other + $01 is lyrics + $02 is text transcription + $03 is movement/part name (e.g. "Adagio") + $04 is events (e.g. "Don Quijote enters the stage") + $05 is chord (e.g. "Bb F Fsus") + + Time stamp format is: + + $01 Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit + $02 Absolute time, 32 bit sized, using milliseconds as unit + + Abolute time means that every stamp contains the time from the + beginning of the file. + + The text that follows the frame header differs from that of the + unsynchronised lyrics/text transcription in one major way. Each + syllable (or whatever size of text is considered to be convenient by + the encoder) is a null terminated string followed by a time stamp + denoting where in the sound file it belongs. Each sync thus has the + following structure: + + Terminated text to be synced (typically a syllable) + Sync identifier (terminator to above string) $00 (00) + Time stamp $xx (xx ...) + + The 'time stamp' is set to zero or the whole sync is omitted if + located directly at the beginning of the sound. All time stamps should + be sorted in chronological order. The sync can be considered as a + validator of the subsequent string. + + Newline characters are allowed in all "SLT" frames and should be used + after every entry (name, event etc.) in a frame with the content type + $03 - $04. + + A few considerations regarding whitespace characters: Whitespace + separating words should mark the beginning of a new word, thus + occurring in front of the first syllable of a new word. This is also + valid for new line characters. A syllable followed by a comma should + not be broken apart with a sync (both the syllable and the comma + should be before the sync). + + An example: The "ULT" passage + + "Strangers in the night" $0A "Exchanging glances" + + would be "SLT" encoded as: + + "Strang" $00 xx xx "ers" $00 xx xx " in" $00 xx xx " the" $00 xx xx + " night" $00 xx xx 0A "Ex" $00 xx xx "chang" $00 xx xx "ing" $00 xx + xx "glan" $00 xx xx "ces" $00 xx xx + + There may be more than one "SLT" frame in each tag, but only one with + the same language and content descriptor. + + +4.11. Comments + + This frame replaces the old 30-character comment field in ID3v1. It + consists of a frame head followed by encoding, language and content + descriptors and is ended with the actual comment as a text string. + Newline characters are allowed in the comment text string. There may + be more than one comment frame in each tag, but only one with the same + language and content descriptor. + + Comment "COM" + Frame size $xx xx xx + Text encoding $xx + Language $xx xx xx + Short content description $00 (00) + The actual text + + +4.12. Relative volume adjustment + + This is a more subjective function than the previous ones. It allows + the user to say how much he wants to increase/decrease the volume on + each channel while the file is played. The purpose is to be able to + align all files to a reference volume, so that you don't have to + change the volume constantly. This frame may also be used to balance + adjust the audio. If the volume peak levels are known then this could + be described with the 'Peak volume right' and 'Peak volume left' + field. If Peakvolume is not known these fields could be left zeroed + or completely omitted. There may only be one "RVA" frame in each + tag. + + Relative volume adjustment "RVA" + Frame size $xx xx xx + Increment/decrement %000000xx + Bits used for volume descr. $xx + Relative volume change, right $xx xx (xx ...) + Relative volume change, left $xx xx (xx ...) + Peak volume right $xx xx (xx ...) + Peak volume left $xx xx (xx ...) + + In the increment/decrement field bit 0 is used to indicate the right + channel and bit 1 is used to indicate the left channel. 1 is + increment and 0 is decrement. + + The 'bits used for volume description' field is normally $10 (16 bits) + for MPEG 2 layer I, II and III [MPEG] and MPEG 2.5. This value may not + be $00. The volume is always represented with whole bytes, padded in + the beginning (highest bits) when 'bits used for volume description' + is not a multiple of eight. + + +4.13. Equalisation + + This is another subjective, alignment frame. It allows the user to + predefine an equalisation curve within the audio file. There may only + be one "EQU" frame in each tag. + + Equalisation "EQU" + Frame size $xx xx xx + Adjustment bits $xx + + The 'adjustment bits' field defines the number of bits used for + representation of the adjustment. This is normally $10 (16 bits) for + MPEG 2 layer I, II and III [MPEG] and MPEG 2.5. This value may not be + $00. + + This is followed by 2 bytes + ('adjustment bits' rounded up to the + nearest byte) for every equalisation band in the following format, + giving a frequency range of 0 - 32767Hz: + + Increment/decrement %x (MSB of the Frequency) + Frequency (lower 15 bits) + Adjustment $xx (xx ...) + + The increment/decrement bit is 1 for increment and 0 for decrement. + The equalisation bands should be ordered increasingly with reference + to frequency. All frequencies don't have to be declared. Adjustments + with the value $00 should be omitted. A frequency should only be + described once in the frame. + + +4.14. Reverb + + Yet another subjective one. You may here adjust echoes of different + kinds. Reverb left/right is the delay between every bounce in ms. + Reverb bounces left/right is the number of bounces that should be + made. $FF equals an infinite number of bounces. Feedback is the amount + of volume that should be returned to the next echo bounce. $00 is 0%, + $FF is 100%. If this value were $7F, there would be 50% volume + reduction on the first bounce, yet 50% on the second and so on. Left + to left means the sound from the left bounce to be played in the left + speaker, while left to right means sound from the left bounce to be + played in the right speaker. + + 'Premix left to right' is the amount of left sound to be mixed in the + right before any reverb is applied, where $00 id 0% and $FF is 100%. + 'Premix right to left' does the same thing, but right to left. Setting + both premix to $FF would result in a mono output (if the reverb is + applied symmetric). There may only be one "REV" frame in each tag. + + Reverb settings "REV" + Frame size $00 00 0C + Reverb left (ms) $xx xx + Reverb right (ms) $xx xx + Reverb bounces, left $xx + Reverb bounces, right $xx + Reverb feedback, left to left $xx + Reverb feedback, left to right $xx + Reverb feedback, right to right $xx + Reverb feedback, right to left $xx + Premix left to right $xx + Premix right to left $xx + + +4.15. Attached picture + + This frame contains a picture directly related to the audio file. + Image format is preferably "PNG" [PNG] or "JPG" [JFIF]. Description + is a short description of the picture, represented as a terminated + textstring. The description has a maximum length of 64 characters, + but may be empty. There may be several pictures attached to one file, + each in their individual "PIC" frame, but only one with the same + content descriptor. There may only be one picture with the picture + type declared as picture type $01 and $02 respectively. There is a + possibility to put only a link to the image file by using the 'image + format' "-->" and having a complete URL [URL] instead of picture data. + The use of linked files should however be used restrictively since + there is the risk of separation of files. + + Attached picture "PIC" + Frame size $xx xx xx + Text encoding $xx + Image format $xx xx xx + Picture type $xx + Description $00 (00) + Picture data + + + Picture type: $00 Other + $01 32x32 pixels 'file icon' (PNG only) + $02 Other file icon + $03 Cover (front) + $04 Cover (back) + $05 Leaflet page + $06 Media (e.g. lable side of CD) + $07 Lead artist/lead performer/soloist + $08 Artist/performer + $09 Conductor + $0A Band/Orchestra + $0B Composer + $0C Lyricist/text writer + $0D Recording Location + $0E During recording + $0F During performance + $10 Movie/video screen capture + $11 A bright coloured fish + $12 Illustration + $13 Band/artist logotype + $14 Publisher/Studio logotype + + +4.16. General encapsulated object + + In this frame any type of file can be encapsulated. After the header, + 'Frame size' and 'Encoding' follows 'MIME type' [MIME] and 'Filename' + for the encapsulated object, both represented as terminated strings + encoded with ISO 8859-1 [ISO-8859-1]. The filename is case sensitive. + Then follows a content description as terminated string, encoded as + 'Encoding'. The last thing in the frame is the actual object. The + first two strings may be omitted, leaving only their terminations. + MIME type is always an ISO-8859-1 text string. There may be more than + one "GEO" frame in each tag, but only one with the same content + descriptor. + + General encapsulated object "GEO" + Frame size $xx xx xx + Text encoding $xx + MIME type $00 + Filename $00 (00) + Content description $00 (00) + Encapsulated object + + +4.17. Play counter + + This is simply a counter of the number of times a file has been + played. The value is increased by one every time the file begins to + play. There may only be one "CNT" frame in each tag. When the counter + reaches all one's, one byte is inserted in front of the counter thus + making the counter eight bits bigger. The counter must be at least + 32-bits long to begin with. + + Play counter "CNT" + Frame size $xx xx xx + Counter $xx xx xx xx (xx ...) + + +4.18. Popularimeter + + The purpose of this frame is to specify how good an audio file is. + Many interesting applications could be found to this frame such as a + playlist that features better audiofiles more often than others or it + could be used to profile a persons taste and find other 'good' files + by comparing people's profiles. The frame is very simple. It contains + the email address to the user, one rating byte and a four byte play + counter, intended to be increased with one for every time the file is + played. The email is a terminated string. The rating is 1-255 where + 1 is worst and 255 is best. 0 is unknown. If no personal counter is + wanted it may be omitted. When the counter reaches all one's, one + byte is inserted in front of the counter thus making the counter + eight bits bigger in the same away as the play counter ("CNT"). + There may be more than one "POP" frame in each tag, but only one with + the same email address. + + Popularimeter "POP" + Frame size $xx xx xx + Email to user $00 + Rating $xx + Counter $xx xx xx xx (xx ...) + + +4.19. Recommended buffer size + + Sometimes the server from which a audio file is streamed is aware of + transmission or coding problems resulting in interruptions in the + audio stream. In these cases, the size of the buffer can be + recommended by the server using this frame. If the 'embedded info + flag' is true (1) then this indicates that an ID3 tag with the + maximum size described in 'Buffer size' may occur in the audiostream. + In such case the tag should reside between two MPEG [MPEG] frames, if + the audio is MPEG encoded. If the position of the next tag is known, + 'offset to next tag' may be used. The offset is calculated from the + end of tag in which this frame resides to the first byte of the header + in the next. This field may be omitted. Embedded tags is currently not + recommended since this could render unpredictable behaviour from + present software/hardware. The 'Buffer size' should be kept to a + minimum. There may only be one "BUF" frame in each tag. + + Recommended buffer size "BUF" + Frame size $xx xx xx + Buffer size $xx xx xx + Embedded info flag %0000000x + Offset to next tag $xx xx xx xx + + +4.20. Encrypted meta frame + + This frame contains one or more encrypted frames. This enables + protection of copyrighted information such as pictures and text, that + people might want to pay extra for. Since standardisation of such an + encryption scheme is beyond this document, all "CRM" frames begin with + a terminated string with a URL [URL] containing an email address, or a + link to a location where an email adress can be found, that belongs to + the organisation responsible for this specific encrypted meta frame. + + Questions regarding the encrypted frame should be sent to the + indicated email address. If a $00 is found directly after the 'Frame + size', the whole frame should be ignored, and preferably be removed. + The 'Owner identifier' is then followed by a short content description + and explanation as to why it's encrypted. After the + 'content/explanation' description, the actual encrypted block follows. + + When an ID3v2 decoder encounters a "CRM" frame, it should send the + datablock to the 'plugin' with the corresponding 'owner identifier' + and expect to receive either a datablock with one or several ID3v2 + frames after each other or an error. There may be more than one "CRM" + frames in a tag, but only one with the same 'owner identifier'. + + Encrypted meta frame "CRM" + Frame size $xx xx xx + Owner identifier $00 (00) + Content/explanation $00 (00) + Encrypted datablock + + +4.21. Audio encryption + + This frame indicates if the actual audio stream is encrypted, and by + whom. Since standardisation of such encrypion scheme is beyond this + document, all "CRA" frames begin with a terminated string with a + URL containing an email address, or a link to a location where an + email address can be found, that belongs to the organisation + responsible for this specific encrypted audio file. Questions + regarding the encrypted audio should be sent to the email address + specified. If a $00 is found directly after the 'Frame size' and the + audiofile indeed is encrypted, the whole file may be considered + useless. + + After the 'Owner identifier', a pointer to an unencrypted part of the + audio can be specified. The 'Preview start' and 'Preview length' is + described in frames. If no part is unencrypted, these fields should be + left zeroed. After the 'preview length' field follows optionally a + datablock required for decryption of the audio. There may be more than + one "CRA" frames in a tag, but only one with the same 'Owner + identifier'. + + Audio encryption "CRA" + Frame size $xx xx xx + Owner identifier $00 (00) + Preview start $xx xx + Preview length $xx xx + Encryption info + + +4.22. Linked information + + To keep space waste as low as possible this frame may be used to link + information from another ID3v2 tag that might reside in another audio + file or alone in a binary file. It is recommended that this method is + only used when the files are stored on a CD-ROM or other circumstances + when the risk of file seperation is low. The frame contains a frame + identifier, which is the frame that should be linked into this tag, a + URL [URL] field, where a reference to the file where the frame is + given, and additional ID data, if needed. Data should be retrieved + from the first tag found in the file to which this link points. There + may be more than one "LNK" frame in a tag, but only one with the same + contents. A linked frame is to be considered as part of the tag and + has the same restrictions as if it was a physical part of the tag + (i.e. only one "REV" frame allowed, whether it's linked or not). + + Linked information "LNK" + Frame size $xx xx xx + Frame identifier $xx xx xx + URL $00 (00) + Additional ID data + + Frames that may be linked and need no additional data are "IPL", + "MCI", "ETC", "LLT", "STC", "RVA", "EQU", "REV", "BUF", the text + information frames and the URL link frames. + + The "TXX", "PIC", "GEO", "CRM" and "CRA" frames may be linked with the + content descriptor as additional ID data. + + The "COM", "SLT" and "ULT" frames may be linked with three bytes of + language descriptor directly followed by a content descriptor as + additional ID data. + + +5. The 'unsynchronisation scheme' + + The only purpose of the 'unsychronisation scheme' is to make the ID3v2 + tag as compatible as possible with existing software. There is no use + in 'unsynchronising' tags if the file is only to be processed by new + software. Unsynchronisation may only be made with MPEG 2 layer I, II + and III and MPEG 2.5 files. + + Whenever a false synchronisation is found within the tag, one zeroed + byte is inserted after the first false synchronisation byte. The + format of a correct sync that should be altered by ID3 encoders is as + follows: + + %11111111 111xxxxx + + And should be replaced with: + + %11111111 00000000 111xxxxx + + This has the side effect that all $FF 00 combinations have to be + altered, so they won't be affected by the decoding process. Therefore + all the $FF 00 combinations have to be replaced with the $FF 00 00 + combination during the unsynchonisation. + + To indicate usage of the unsynchronisation, the first bit in 'ID3 + flags' should be set. This bit should only be set if the tag + contained a, now corrected, false synchronisation. The bit should + only be clear if the tag does not contain any false synchronisations. + + Do bear in mind, that if a compression scheme is used by the encoder, + the unsyncronisation scheme should be applied *afterwards*. When + decoding a compressed, 'unsyncronised' file, the 'unsyncronisation + scheme' should be parsed first, compression afterwards. + + +6. Copyright + + Copyright (C) Martin Nilsson 1998. All Rights Reserved. + + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it + or assist in its implementation may be prepared, copied, published + and distributed, in whole or in part, without restriction of any + kind, provided that a reference to this document is included on all + such copies and derivative works. However, this document itself may + not be modified in any way and reissued as the original document. + + The limited permissions granted above are perpetual and will not be + revoked. + + This document and the information contained herein is provided on an + "AS IS" basis and THE AUTHORS DISCLAIMS ALL WARRANTIES, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE + INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED + WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + + +7. References + + [CDDB] Compact Disc Data Base + + + + [ISO-639-2] ISO/FDIS 639-2. + Codes for the representation of names of languages, Part 2: Alpha-3 + code. Technical committee / subcommittee: TC 37 / SC 2 + + [ISO-8859-1] ISO/IEC DIS 8859-1. + 8-bit single-byte coded graphic character sets, Part 1: Latin + alphabet No. 1. Technical committee / subcommittee: JTC 1 / SC 2 + + [ISRC] ISO 3901:1986 + International Standard Recording Code (ISRC). + Technical committee / subcommittee: TC 46 / SC 9 + + [JFIF] JPEG File Interchange Format, version 1.02 + + + + [MIME] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part One: Format of Internet Message Bodies", + RFC 2045, November 1996. + + + + [MPEG] ISO/IEC 11172-3:1993. + Coding of moving pictures and associated audio for digital storage + media at up to about 1,5 Mbit/s, Part 3: Audio. + Technical committee / subcommittee: JTC 1 / SC 29 + and + ISO/IEC 13818-3:1995 + Generic coding of moving pictures and associated audio information, + Part 3: Audio. + Technical committee / subcommittee: JTC 1 / SC 29 + and + ISO/IEC DIS 13818-3 + Generic coding of moving pictures and associated audio information, + Part 3: Audio (Revision of ISO/IEC 13818-3:1995) + + + [PNG] Portable Network Graphics, version 1.0 + + + + [UNICODE] ISO/IEC 10646-1:1993. + Universal Multiple-Octet Coded Character Set (UCS), Part 1: + Architecture and Basic Multilingual Plane. Technical committee + / subcommittee: JTC 1 / SC 2 + + + + [URL] T. Berners-Lee, L. Masinter & M. McCahill, "Uniform Resource + Locators (URL).", RFC 1738, December 1994. + + + + +8. Appendix + + +A. Appendix A - ID3-Tag Specification V1.1 + + ID3-Tag Specification V1.1 (12 dec 1997) by Michael Mutschler + , edited for space and clarity + reasons. + + +A.1. Overview + + The ID3-Tag is an information field for MPEG Layer 3 audio files. + Since a standalone MP3 doesn't provide a method of storing other + information than those directly needed for replay reasons, the + ID3-tag was invented by Eric Kemp in 1996. + + A revision from ID3v1 to ID3v1.1 was made by Michael Mutschler to + support track number information is described in A.4. + + +A.2. ID3v1 Implementation + + The Information is stored in the last 128 bytes of an MP3. The Tag + has got the following fields, and the offsets given here, are from + 0-127. + + Field Length Offsets + Tag 3 0-2 + Songname 30 3-32 + Artist 30 33-62 + Album 30 63-92 + Year 4 93-96 + Comment 30 97-126 + Genre 1 127 + + + The string-fields contain ASCII-data, coded in ISO-Latin 1 codepage. + Strings which are smaller than the field length are padded with zero- + bytes. + + Tag: The tag is valid if this field contains the string "TAG". This + has to be uppercase! + + Songname: This field contains the title of the MP3 (string as + above). + + Artist: This field contains the artist of the MP3 (string as above). + + Album: this field contains the album where the MP3 comes from + (string as above). + + Year: this field contains the year when this song has originally + been released (string as above). + + Comment: this field contains a comment for the MP3 (string as + above). Revision to this field has been made in ID3v1.1. See + A.4. + + Genre: this byte contains the offset of a genre in a predefined + list the byte is treated as an unsigned byte. The offset is + starting from 0. See A.3. + + +A.3. Genre List + + The following genres is defined in ID3v1 + + 0.Blues + 1.Classic Rock + 2.Country + 3.Dance + 4.Disco + 5.Funk + 6.Grunge + 7.Hip-Hop + 8.Jazz + 9.Metal + 10.New Age + 11.Oldies + 12.Other + 13.Pop + 14.R&B + 15.Rap + 16.Reggae + 17.Rock + 18.Techno + 19.Industrial + 20.Alternative + 21.Ska + 22.Death Metal + 23.Pranks + 24.Soundtrack + 25.Euro-Techno + 26.Ambient + 27.Trip-Hop + 28.Vocal + 29.Jazz+Funk + 30.Fusion + 31.Trance + 32.Classical + 33.Instrumental + 34.Acid + 35.House + 36.Game + 37.Sound Clip + 38.Gospel + 39.Noise + 40.AlternRock + 41.Bass + 42.Soul + 43.Punk + 44.Space + 45.Meditative + 46.Instrumental Pop + 47.Instrumental Rock + 48.Ethnic + 49.Gothic + 50.Darkwave + 51.Techno-Industrial + 52.Electronic + 53.Pop-Folk + 54.Eurodance + 55.Dream + 56.Southern Rock + 57.Comedy + 58.Cult + 59.Gangsta + 60.Top 40 + 61.Christian Rap + 62.Pop/Funk + 63.Jungle + 64.Native American + 65.Cabaret + 66.New Wave + 67.Psychadelic + 68.Rave + 69.Showtunes + 70.Trailer + 71.Lo-Fi + 72.Tribal + 73.Acid Punk + 74.Acid Jazz + 75.Polka + 76.Retro + 77.Musical + 78.Rock & Roll + 79.Hard Rock + + The following genres are Winamp extensions + + 80.Folk + 81.Folk-Rock + 82.National Folk + 83.Swing + 84.Fast Fusion + 85.Bebob + 86.Latin + 87.Revival + 88.Celtic + 89.Bluegrass + 90.Avantgarde + 91.Gothic Rock + 92.Progressive Rock + 93.Psychedelic Rock + 94.Symphonic Rock + 95.Slow Rock + 96.Big Band + 97.Chorus + 98.Easy Listening + 99.Acoustic + 100.Humour + 101.Speech + 102.Chanson + 103.Opera + 104.Chamber Music + 105.Sonata + 106.Symphony + 107.Booty Bass + 108.Primus + 109.Porn Groove + 110.Satire + 111.Slow Jam + 112.Club + 113.Tango + 114.Samba + 115.Folklore + 116.Ballad + 117.Power Ballad + 118.Rhythmic Soul + 119.Freestyle + 120.Duet + 121.Punk Rock + 122.Drum Solo + 123.A capella + 124.Euro-House + 125.Dance Hall + + +A.4. Track addition - ID3v1.1 + + In ID3v1.1, Michael Mutschler revised the specification of the + comment field in order to implement the track number. The new format + of the comment field is a 28 character string followed by a mandatory + null ($00) character and the original album tracknumber stored as an + unsigned byte-size integer. In such cases where the 29th byte is not + the null character or when the 30th is a null character, the + tracknumber is to be considered undefined. + + +9. Author's Address + + Martin Nilsson + Rydsvägen 246 C. 30 + S-584 34 Linköping + Sweden + + Email: nilsson@id3.org + + Co-authors: + + Johan Sundström Email: johan@id3.org + + diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/id3v2.3.0.txt b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/id3v2.3.0.txt new file mode 100644 index 0000000..b4ed763 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/id3v2.3.0.txt @@ -0,0 +1,2022 @@ +Informal standard M. Nilsson +Document: id3v2.3.0.txt 3rd February 1999 + + + ID3 tag version 2.3.0 + +Status of this document + + This document is an informal standard and replaces the ID3v2.2.0 + standard [ID3v2]. The informal standard is released so that + implementors could have a set standard before a formal standard is + set. The formal standard will use another version or revision number + if not identical to what is described in this document. The contents + in this document may change for clarifications but never for added or + altered functionallity. + + Distribution of this document is unlimited. + + +Abstract + + This document describes the ID3v2.3.0, which is a more developed + version of the ID3v2 informal standard [ID3v2] (version 2.2.0), + evolved from the ID3 tagging system. The ID3v2 offers a flexible way + of storing information about an audio file within itself to determine + its origin and contents. The information may be technical + information, such as equalisation curves, as well as related meta + information, such as title, performer, copyright etc. + + +1. Table of contents + + 2. Conventions in this document + 3. ID3v2 overview + 3.1. ID3v2 header + 3.2. ID3v2 extended header + 3.3. ID3v2 frames overview + 3.3.1. Frame header flags + 3.3.2. Default flags + 4. Declared ID3v2 frames + 4.1. Unique file identifier + 4.2. Text information frames + 4.2.1. Text information frames - details + 4.2.2. User defined text information frame + 4.3. URL link frames + 4.3.1. URL link frames - details + 4.3.2. User defined URL link frame + 4.4. Involved people list + 4.5. Music CD Identifier + 4.6. Event timing codes + 4.7. MPEG location lookup table + 4.8. Synced tempo codes + 4.9. Unsychronised lyrics/text transcription + 4.10. Synchronised lyrics/text + 4.11. Comments + 4.12. Relative volume adjustment + 4.13. Equalisation + 4.14. Reverb + 4.15. Attached picture + 4.16. General encapsulated object + 4.17. Play counter + 4.18. Popularimeter + 4.19. Recommended buffer size + 4.20. Audio encryption + 4.21. Linked information + 4.22. Position synchronisation frame + 4.23. Terms of use + 4.24. Ownership frame + 4.25. Commercial frame + 4.26. Encryption method registration + 4.27. Group identification registration + 4.28. Private frame + 5. The 'unsynchronisation scheme' + 6. Copyright + 7. References + 8. Appendix + A. Appendix A - Genre List from ID3v1 + 9. Author's Address + + +2. Conventions in this document + + In the examples, text within "" is a text string exactly as it + appears in a file. Numbers preceded with $ are hexadecimal and + numbers preceded with % are binary. $xx is used to indicate a byte + with unknown content. %x is used to indicate a bit with unknown + content. The most significant bit (MSB) of a byte is called 'bit 7' + and the least significant bit (LSB) is called 'bit 0'. + + A tag is the whole tag described in this document. A frame is a block + of information in the tag. The tag consists of a header, frames and + optional padding. A field is a piece of information; one value, a + string etc. A numeric string is a string that consists of the + characters 0-9 only. + + +3. ID3v2 overview + + The two biggest design goals were to be able to implement ID3v2 + without disturbing old software too much and that ID3v2 should be + as flexible and expandable as possible. + + The first criterion is met by the simple fact that the MPEG [MPEG] + decoding software uses a syncsignal, embedded in the audiostream, to + 'lock on to' the audio. Since the ID3v2 tag doesn't contain a valid + syncsignal, no software will attempt to play the tag. If, for any + reason, coincidence make a syncsignal appear within the tag it will + be taken care of by the 'unsynchronisation scheme' described in + section 5. + + The second criterion has made a more noticeable impact on the design + of the ID3v2 tag. It is constructed as a container for several + information blocks, called frames, whose format need not be known to + the software that encounters them. At the start of every frame there + is an identifier that explains the frames' format and content, and a + size descriptor that allows software to skip unknown frames. + + If a total revision of the ID3v2 tag should be needed, there is a + version number and a size descriptor in the ID3v2 header. + + The ID3 tag described in this document is mainly targeted at files + encoded with MPEG-1/2 layer I, MPEG-1/2 layer II, MPEG-1/2 layer III + and MPEG-2.5, but may work with other types of encoded audio. + + The bitorder in ID3v2 is most significant bit first (MSB). The + byteorder in multibyte numbers is most significant byte first (e.g. + $12345678 would be encoded $12 34 56 78). + + It is permitted to include padding after all the final frame (at the + end of the ID3 tag), making the size of all the frames together + smaller than the size given in the head of the tag. A possible + purpose of this padding is to allow for adding a few additional + frames or enlarge existing frames within the tag without having to + rewrite the entire file. The value of the padding bytes must be $00. + + +3.1. ID3v2 header + + The ID3v2 tag header, which should be the first information in the + file, is 10 bytes as follows: + + ID3v2/file identifier "ID3" + ID3v2 version $03 00 + ID3v2 flags %abc00000 + ID3v2 size 4 * %0xxxxxxx + + The first three bytes of the tag are always "ID3" to indicate that + this is an ID3v2 tag, directly followed by the two version bytes. The + first byte of ID3v2 version is it's major version, while the second + byte is its revision number. In this case this is ID3v2.3.0. All + revisions are backwards compatible while major versions are not. If + software with ID3v2.2.0 and below support should encounter version + three or higher it should simply ignore the whole tag. Version and + revision will never be $FF. + + The version is followed by one the ID3v2 flags field, of which + currently only three flags are used. + + + a - Unsynchronisation + + Bit 7 in the 'ID3v2 flags' indicates whether or not + unsynchronisation is used (see section 5 for details); a set bit + indicates usage. + + + b - Extended header + + The second bit (bit 6) indicates whether or not the header is + followed by an extended header. The extended header is described in + section 3.2. + + + c - Experimental indicator + + The third bit (bit 5) should be used as an 'experimental + indicator'. This flag should always be set when the tag is in an + experimental stage. + + All the other flags should be cleared. If one of these undefined + flags are set that might mean that the tag is not readable for a + parser that does not know the flags function. + + The ID3v2 tag size is encoded with four bytes where the most + significant bit (bit 7) is set to zero in every byte, making a total + of 28 bits. The zeroed bits are ignored, so a 257 bytes long tag is + represented as $00 00 02 01. + + The ID3v2 tag size is the size of the complete tag after + unsychronisation, including padding, excluding the header but not + excluding the extended header (total tag size - 10). Only 28 bits + (representing up to 256MB) are used in the size description to avoid + the introducuction of 'false syncsignals'. + + An ID3v2 tag can be detected with the following pattern: + $49 44 33 yy yy xx zz zz zz zz + Where yy is less than $FF, xx is the 'flags' byte and zz is less than + $80. + + +3.2. ID3v2 extended header + + The extended header contains information that is not vital to the + correct parsing of the tag information, hence the extended header is + optional. + + Extended header size $xx xx xx xx + Extended Flags $xx xx + Size of padding $xx xx xx xx + + Where the 'Extended header size', currently 6 or 10 bytes, excludes + itself. The 'Size of padding' is simply the total tag size excluding + the frames and the headers, in other words the padding. The extended + header is considered separate from the header proper, and as such is + subject to unsynchronisation. + + The extended flags are a secondary flag set which describes further + attributes of the tag. These attributes are currently defined as + follows + + %x0000000 00000000 + + + x - CRC data present + + If this flag is set four bytes of CRC-32 data is appended to the + extended header. The CRC should be calculated before + unsynchronisation on the data between the extended header and the + padding, i.e. the frames and only the frames. + + Total frame CRC $xx xx xx xx + + +3.3. ID3v2 frame overview + + As the tag consists of a tag header and a tag body with one or more + frames, all the frames consists of a frame header followed by one or + more fields containing the actual information. The layout of the + frame header: + + Frame ID $xx xx xx xx (four characters) + Size $xx xx xx xx + Flags $xx xx + + The frame ID made out of the characters capital A-Z and 0-9. + Identifiers beginning with "X", "Y" and "Z" are for experimental use + and free for everyone to use, without the need to set the + experimental bit in the tag header. Have in mind that someone else + might have used the same identifier as you. All other identifiers are + either used or reserved for future use. + + The frame ID is followed by a size descriptor, making a total header + size of ten bytes in every frame. The size is calculated as frame + size excluding frame header (frame size - 10). + + In the frame header the size descriptor is followed by two flags + bytes. These flags are described in section 3.3.1. + + There is no fixed order of the frames' appearance in the tag, + although it is desired that the frames are arranged in order of + significance concerning the recognition of the file. An example of + such order: UFID, TIT2, MCDI, TRCK ... + + A tag must contain at least one frame. A frame must be at least 1 + byte big, excluding the header. + + If nothing else is said a string is represented as ISO-8859-1 + [ISO-8859-1] characters in the range $20 - $FF. Such strings are + represented as , or if newlines are + allowed, in the frame descriptions. All Unicode strings [UNICODE] use + 16-bit unicode 2.0 (ISO/IEC 10646-1:1993, UCS-2). Unicode strings + must begin with the Unicode BOM ($FF FE or $FE FF) to identify the + byte order. + + All numeric strings and URLs [URL] are always encoded as ISO-8859-1. + Terminated strings are terminated with $00 if encoded with ISO-8859-1 + and $00 00 if encoded as unicode. If nothing else is said newline + character is forbidden. In ISO-8859-1 a new line is represented, when + allowed, with $0A only. Frames that allow different types of text + encoding have a text encoding description byte directly after the + frame size. If ISO-8859-1 is used this byte should be $00, if Unicode + is used it should be $01. Strings dependent on encoding is + represented as , or if newlines are allowed. Any empty + Unicode strings which are NULL-terminated may have the Unicode BOM + followed by a Unicode NULL ($FF FE 00 00 or $FE FF 00 00). + + The three byte language field is used to describe the language of the + frame's content, according to ISO-639-2 [ISO-639-2]. + + All URLs [URL] may be relative, e.g. "picture.png", "../doc.txt". + + If a frame is longer than it should be, e.g. having more fields than + specified in this document, that indicates that additions to the + frame have been made in a later version of the ID3v2 standard. This + is reflected by the revision number in the header of the tag. + + +3.3.1. Frame header flags + + In the frame header the size descriptor is followed by two flags + bytes. All unused flags must be cleared. The first byte is for + 'status messages' and the second byte is for encoding purposes. If an + unknown flag is set in the first byte the frame may not be changed + without the bit cleared. If an unknown flag is set in the second byte + it is likely to not be readable. The flags field is defined as + follows. + + %abc00000 %ijk00000 + + + a - Tag alter preservation + + This flag tells the software what to do with this frame if it is + unknown and the tag is altered in any way. This applies to all + kinds of alterations, including adding more padding and reordering + the frames. + + 0 Frame should be preserved. + 1 Frame should be discarded. + + + b - File alter preservation + + This flag tells the software what to do with this frame if it is + unknown and the file, excluding the tag, is altered. This does not + apply when the audio is completely replaced with other audio data. + + 0 Frame should be preserved. + 1 Frame should be discarded. + + + c - Read only + + This flag, if set, tells the software that the contents of this + frame is intended to be read only. Changing the contents might + break something, e.g. a signature. If the contents are changed, + without knowledge in why the frame was flagged read only and + without taking the proper means to compensate, e.g. recalculating + the signature, the bit should be cleared. + + + i - Compression + + This flag indicates whether or not the frame is compressed. + + 0 Frame is not compressed. + 1 Frame is compressed using zlib [zlib] with 4 bytes for + 'decompressed size' appended to the frame header. + + + j - Encryption + + This flag indicates wether or not the frame is enrypted. If set + one byte indicating with which method it was encrypted will be + appended to the frame header. See section 4.26. for more + information about encryption method registration. + + 0 Frame is not encrypted. + 1 Frame is encrypted. + + + k - Grouping identity + + This flag indicates whether or not this frame belongs in a group + with other frames. If set a group identifier byte is added to the + frame header. Every frame with the same group identifier belongs + to the same group. + + 0 Frame does not contain group information + 1 Frame contains group information + + + Some flags indicates that the frame header is extended with + additional information. This information will be added to the frame + header in the same order as the flags indicating the additions. I.e. + the four bytes of decompressed size will preceed the encryption + method byte. These additions to the frame header, while not included + in the frame header size but are included in the 'frame size' field, + are not subject to encryption or compression. + + +3.3.2. Default flags + + The default settings for the frames described in this document can be + divided into the following classes. The flags may be set differently + if found more suitable by the software. + + 1. Discarded if tag is altered, discarded if file is altered. + + None. + + 2. Discarded if tag is altered, preserved if file is altered. + + None. + + 3. Preserved if tag is altered, discarded if file is altered. + + AENC, ETCO, EQUA, MLLT, POSS, SYLT, SYTC, RVAD, TENC, TLEN, TSIZ + + 4. Preserved if tag is altered, preserved if file is altered. + + The rest of the frames. + + +4. Declared ID3v2 frames + + The following frames are declared in this draft. + + 4.21 AENC Audio encryption + 4.15 APIC Attached picture + + 4.11 COMM Comments + 4.25 COMR Commercial frame + + 4.26 ENCR Encryption method registration + 4.13 EQUA Equalization + 4.6 ETCO Event timing codes + + 4.16 GEOB General encapsulated object + 4.27 GRID Group identification registration + + 4.4 IPLS Involved people list + + 4.21 LINK Linked information + + 4.5 MCDI Music CD identifier + 4.7 MLLT MPEG location lookup table + + 4.24 OWNE Ownership frame + + 4.28. PRIV Private frame + 4.17 PCNT Play counter + 4.18 POPM Popularimeter + 4.22 POSS Position synchronisation frame + + 4.19 RBUF Recommended buffer size + 4.12 RVAD Relative volume adjustment + 4.14 RVRB Reverb + + 4.10 SYLT Synchronized lyric/text + 4.8 SYTC Synchronized tempo codes + + 4.2.1 TALB Album/Movie/Show title + 4.2.1 TBPM BPM (beats per minute) + 4.2.1 TCOM Composer + 4.2.1 TCON Content type + 4.2.1 TCOP Copyright message + 4.2.1 TDAT Date + 4.2.1 TDLY Playlist delay + 4.2.1 TENC Encoded by + 4.2.1 TEXT Lyricist/Text writer + 4.2.1 TFLT File type + 4.2.1 TIME Time + 4.2.1 TIT1 Content group description + 4.2.1 TIT2 Title/songname/content description + 4.2.1 TIT3 Subtitle/Description refinement + 4.2.1 TKEY Initial key + 4.2.1 TLAN Language(s) + 4.2.1 TLEN Length + 4.2.1 TMED Media type + 4.2.1 TOAL Original album/movie/show title + 4.2.1 TOFN Original filename + 4.2.1 TOLY Original lyricist(s)/text writer(s) + 4.2.1 TOPE Original artist(s)/performer(s) + 4.2.1 TORY Original release year + 4.2.1 TOWN File owner/licensee + 4.2.1 TPE1 Lead performer(s)/Soloist(s) + 4.2.1 TPE2 Band/orchestra/accompaniment + 4.2.1 TPE3 Conductor/performer refinement + 4.2.1 TPE4 Interpreted, remixed, or otherwise modified by + 4.2.1 TPOS Part of a set + 4.2.1 TPUB Publisher + 4.2.1 TRCK Track number/Position in set + 4.2.1 TRDA Recording dates + 4.2.1 TRSN Internet radio station name + 4.2.1 TRSO Internet radio station owner + 4.2.1 TSIZ Size + 4.2.1 TSRC ISRC (international standard recording code) + 4.2.1 TSSE Software/Hardware and settings used for encoding + 4.2.1 TYER Year + 4.2.2 TXXX User defined text information frame + + 4.1 UFID Unique file identifier + 4.23 USER Terms of use + 4.9 USLT Unsychronized lyric/text transcription + + 4.3.1 WCOM Commercial information + 4.3.1 WCOP Copyright/Legal information + 4.3.1 WOAF Official audio file webpage + 4.3.1 WOAR Official artist/performer webpage + 4.3.1 WOAS Official audio source webpage + 4.3.1 WORS Official internet radio station homepage + 4.3.1 WPAY Payment + 4.3.1 WPUB Publishers official webpage + 4.3.2 WXXX User defined URL link frame + + +4.1. Unique file identifier + + This frame's purpose is to be able to identify the audio file in a + database that may contain more information relevant to the content. + Since standardisation of such a database is beyond this document, all + frames begin with a null-terminated string with a URL [URL] + containing an email address, or a link to a location where an email + address can be found, that belongs to the organisation responsible + for this specific database implementation. Questions regarding the + database should be sent to the indicated email address. The URL + should not be used for the actual database queries. The string + "http://www.id3.org/dummy/ufid.html" should be used for tests. + Software that isn't told otherwise may safely remove such frames. The + 'Owner identifier' must be non-empty (more than just a termination). + The 'Owner identifier' is then followed by the actual identifier, + which may be up to 64 bytes. There may be more than one "UFID" frame + in a tag, but only one with the same 'Owner identifier'. + +
+ Owner identifier $00 + Identifier + + +4.2. Text information frames + + The text information frames are the most important frames, containing + information like artist, album and more. There may only be one text + information frame of its kind in an tag. If the textstring is + followed by a termination ($00 (00)) all the following information + should be ignored and not be displayed. All text frame identifiers + begin with "T". Only text frame identifiers begin with "T", with the + exception of the "TXXX" frame. All the text information frames have + the following format: + +
+ Text encoding $xx + Information + + +4.2.1. Text information frames - details + + TALB + The 'Album/Movie/Show title' frame is intended for the title of the + recording(/source of sound) which the audio in the file is taken + from. + + TBPM + The 'BPM' frame contains the number of beats per minute in the + mainpart of the audio. The BPM is an integer and represented as a + numerical string. + + TCOM + The 'Composer(s)' frame is intended for the name of the composer(s). + They are seperated with the "/" character. + + TCON + The 'Content type', which previously was stored as a one byte numeric + value only, is now a numeric string. You may use one or several of + the types as ID3v1.1 did or, since the category list would be + impossible to maintain with accurate and up to date categories, + define your own. + + References to the ID3v1 genres can be made by, as first byte, enter + "(" followed by a number from the genres list (appendix A.) and + ended with a ")" character. This is optionally followed by a + refinement, e.g. "(21)" or "(4)Eurodisco". Several references can be + made in the same frame, e.g. "(51)(39)". If the refinement should + begin with a "(" character it should be replaced with "((", e.g. "((I + can figure out any genre)" or "(55)((I think...)". The following new + content types is defined in ID3v2 and is implemented in the same way + as the numerig content types, e.g. "(RX)". + + RX Remix + CR Cover + + TCOP + The 'Copyright message' frame, which must begin with a year and a + space character (making five characters), is intended for the + copyright holder of the original sound, not the audio file itself. + The absence of this frame means only that the copyright information + is unavailable or has been removed, and must not be interpreted to + mean that the sound is public domain. Every time this field is + displayed the field must be preceded with "Copyright " (C) " ", where + (C) is one character showing a C in a circle. + + TDAT + The 'Date' frame is a numeric string in the DDMM format containing + the date for the recording. This field is always four characters + long. + + TDLY + The 'Playlist delay' defines the numbers of milliseconds of silence + between every song in a playlist. The player should use the "ETC" + frame, if present, to skip initial silence and silence at the end of + the audio to match the 'Playlist delay' time. The time is represented + as a numeric string. + + TENC + The 'Encoded by' frame contains the name of the person or + organisation that encoded the audio file. This field may contain a + copyright message, if the audio file also is copyrighted by the + encoder. + + TEXT + The 'Lyricist(s)/Text writer(s)' frame is intended for the writer(s) + of the text or lyrics in the recording. They are seperated with the + "/" character. + + TFLT + The 'File type' frame indicates which type of audio this tag defines. + The following type and refinements are defined: + + MPG MPEG Audio + /1 MPEG 1/2 layer I + /2 MPEG 1/2 layer II + /3 MPEG 1/2 layer III + /2.5 MPEG 2.5 + /AAC Advanced audio compression + VQF Transform-domain Weighted Interleave Vector Quantization + PCM Pulse Code Modulated audio + + but other types may be used, not for these types though. This is used + in a similar way to the predefined types in the "TMED" frame, but + without parentheses. If this frame is not present audio type is + assumed to be "MPG". + + TIME + The 'Time' frame is a numeric string in the HHMM format containing + the time for the recording. This field is always four characters + long. + + TIT1 + The 'Content group description' frame is used if the sound belongs to + a larger category of sounds/music. For example, classical music is + often sorted in different musical sections (e.g. "Piano Concerto", + "Weather - Hurricane"). + + TIT2 + The 'Title/Songname/Content description' frame is the actual name of + the piece (e.g. "Adagio", "Hurricane Donna"). + + TIT3 + The 'Subtitle/Description refinement' frame is used for information + directly related to the contents title (e.g. "Op. 16" or "Performed + live at Wembley"). + + TKEY + The 'Initial key' frame contains the musical key in which the sound + starts. It is represented as a string with a maximum length of three + characters. The ground keys are represented with "A","B","C","D","E", + "F" and "G" and halfkeys represented with "b" and "#". Minor is + represented as "m". Example "Cbm". Off key is represented with an "o" + only. + + TLAN + The 'Language(s)' frame should contain the languages of the text or + lyrics spoken or sung in the audio. The language is represented with + three characters according to ISO-639-2. If more than one language is + used in the text their language codes should follow according to + their usage. + + TLEN + The 'Length' frame contains the length of the audiofile in + milliseconds, represented as a numeric string. + + TMED + The 'Media type' frame describes from which media the sound + originated. This may be a text string or a reference to the + predefined media types found in the list below. References are made + within "(" and ")" and are optionally followed by a text refinement, + e.g. "(MC) with four channels". If a text refinement should begin + with a "(" character it should be replaced with "((" in the same way + as in the "TCO" frame. Predefined refinements is appended after the + media type, e.g. "(CD/A)" or "(VID/PAL/VHS)". + + DIG Other digital media + /A Analog transfer from media + + ANA Other analog media + /WAC Wax cylinder + /8CA 8-track tape cassette + + CD CD + /A Analog transfer from media + /DD DDD + /AD ADD + /AA AAD + + LD Laserdisc + /A Analog transfer from media + + TT Turntable records + /33 33.33 rpm + /45 45 rpm + /71 71.29 rpm + /76 76.59 rpm + /78 78.26 rpm + /80 80 rpm + + MD MiniDisc + /A Analog transfer from media + + DAT DAT + /A Analog transfer from media + /1 standard, 48 kHz/16 bits, linear + /2 mode 2, 32 kHz/16 bits, linear + /3 mode 3, 32 kHz/12 bits, nonlinear, low speed + /4 mode 4, 32 kHz/12 bits, 4 channels + /5 mode 5, 44.1 kHz/16 bits, linear + /6 mode 6, 44.1 kHz/16 bits, 'wide track' play + + DCC DCC + /A Analog transfer from media + + DVD DVD + /A Analog transfer from media + + TV Television + /PAL PAL + /NTSC NTSC + /SECAM SECAM + + VID Video + /PAL PAL + /NTSC NTSC + /SECAM SECAM + /VHS VHS + /SVHS S-VHS + /BETA BETAMAX + + RAD Radio + /FM FM + /AM AM + /LW LW + /MW MW + + TEL Telephone + /I ISDN + + MC MC (normal cassette) + /4 4.75 cm/s (normal speed for a two sided cassette) + /9 9.5 cm/s + /I Type I cassette (ferric/normal) + /II Type II cassette (chrome) + /III Type III cassette (ferric chrome) + /IV Type IV cassette (metal) + + REE Reel + /9 9.5 cm/s + /19 19 cm/s + /38 38 cm/s + /76 76 cm/s + /I Type I cassette (ferric/normal) + /II Type II cassette (chrome) + /III Type III cassette (ferric chrome) + /IV Type IV cassette (metal) + + TOAL + The 'Original album/movie/show title' frame is intended for the title + of the original recording (or source of sound), if for example the + music in the file should be a cover of a previously released song. + + TOFN + The 'Original filename' frame contains the preferred filename for the + file, since some media doesn't allow the desired length of the + filename. The filename is case sensitive and includes its suffix. + + TOLY + The 'Original lyricist(s)/text writer(s)' frame is intended for the + text writer(s) of the original recording, if for example the music in + the file should be a cover of a previously released song. The text + writers are seperated with the "/" character. + + TOPE + The 'Original artist(s)/performer(s)' frame is intended for the + performer(s) of the original recording, if for example the music in + the file should be a cover of a previously released song. The + performers are seperated with the "/" character. + + TORY + The 'Original release year' frame is intended for the year when the + original recording, if for example the music in the file should be a + cover of a previously released song, was released. The field is + formatted as in the "TYER" frame. + + TOWN + The 'File owner/licensee' frame contains the name of the owner or + licensee of the file and it's contents. + + TPE1 + The 'Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group' is + used for the main artist(s). They are seperated with the "/" + character. + + TPE2 + The 'Band/Orchestra/Accompaniment' frame is used for additional + information about the performers in the recording. + + TPE3 + The 'Conductor' frame is used for the name of the conductor. + + TPE4 + The 'Interpreted, remixed, or otherwise modified by' frame contains + more information about the people behind a remix and similar + interpretations of another existing piece. + + TPOS + The 'Part of a set' frame is a numeric string that describes which + part of a set the audio came from. This frame is used if the source + described in the "TALB" frame is divided into several mediums, e.g. a + double CD. The value may be extended with a "/" character and a + numeric string containing the total number of parts in the set. E.g. + "1/2". + + TPUB + The 'Publisher' frame simply contains the name of the label or + publisher. + + TRCK + The 'Track number/Position in set' frame is a numeric string + containing the order number of the audio-file on its original + recording. This may be extended with a "/" character and a numeric + string containing the total numer of tracks/elements on the original + recording. E.g. "4/9". + + TRDA + The 'Recording dates' frame is a intended to be used as complement to + the "TYER", "TDAT" and "TIME" frames. E.g. "4th-7th June, 12th June" + in combination with the "TYER" frame. + + TRSN + The 'Internet radio station name' frame contains the name of the + internet radio station from which the audio is streamed. + + TRSO + The 'Internet radio station owner' frame contains the name of the + owner of the internet radio station from which the audio is + streamed. + + TSIZ + The 'Size' frame contains the size of the audiofile in bytes, + excluding the ID3v2 tag, represented as a numeric string. + + TSRC + The 'ISRC' frame should contain the International Standard Recording + Code [ISRC] (12 characters). + + TSSE + The 'Software/Hardware and settings used for encoding' frame + includes the used audio encoder and its settings when the file was + encoded. Hardware refers to hardware encoders, not the computer on + which a program was run. + + TYER + The 'Year' frame is a numeric string with a year of the recording. + This frames is always four characters long (until the year 10000). + + +4.2.2. User defined text information frame + + This frame is intended for one-string text information concerning the + audiofile in a similar way to the other "T"-frames. The frame body + consists of a description of the string, represented as a terminated + string, followed by the actual string. There may be more than one + "TXXX" frame in each tag, but only one with the same description. + +
+ Text encoding $xx + Description $00 (00) + Value + + +4.3. URL link frames + + With these frames dynamic data such as webpages with touring + information, price information or plain ordinary news can be added to + the tag. There may only be one URL [URL] link frame of its kind in an + tag, except when stated otherwise in the frame description. If the + textstring is followed by a termination ($00 (00)) all the following + information should be ignored and not be displayed. All URL link + frame identifiers begins with "W". Only URL link frame identifiers + begins with "W". All URL link frames have the following format: + +
+ URL + + +4.3.1. URL link frames - details + + WCOM + The 'Commercial information' frame is a URL pointing at a webpage + with information such as where the album can be bought. There may be + more than one "WCOM" frame in a tag, but not with the same content. + + WCOP + The 'Copyright/Legal information' frame is a URL pointing at a + webpage where the terms of use and ownership of the file is + described. + + WOAF + The 'Official audio file webpage' frame is a URL pointing at a file + specific webpage. + + WOAR + The 'Official artist/performer webpage' frame is a URL pointing at + the artists official webpage. There may be more than one "WOAR" frame + in a tag if the audio contains more than one performer, but not with + the same content. + + WOAS + The 'Official audio source webpage' frame is a URL pointing at the + official webpage for the source of the audio file, e.g. a movie. + + WORS + The 'Official internet radio station homepage' contains a URL + pointing at the homepage of the internet radio station. + + WPAY + The 'Payment' frame is a URL pointing at a webpage that will handle + the process of paying for this file. + + WPUB + The 'Publishers official webpage' frame is a URL pointing at the + official wepage for the publisher. + + +4.3.2. User defined URL link frame + + This frame is intended for URL [URL] links concerning the audiofile + in a similar way to the other "W"-frames. The frame body consists + of a description of the string, represented as a terminated string, + followed by the actual URL. The URL is always encoded with ISO-8859-1 + [ISO-8859-1]. There may be more than one "WXXX" frame in each tag, + but only one with the same description. + +
+ Text encoding $xx + Description $00 (00) + URL + + +4.4. Involved people list + + Since there might be a lot of people contributing to an audio file in + various ways, such as musicians and technicians, the 'Text + information frames' are often insufficient to list everyone involved + in a project. The 'Involved people list' is a frame containing the + names of those involved, and how they were involved. The body simply + contains a terminated string with the involvement directly followed + by a terminated string with the involvee followed by a new + involvement and so on. There may only be one "IPLS" frame in each + tag. + +
+ Text encoding $xx + People list strings + + +4.5. Music CD identifier + + This frame is intended for music that comes from a CD, so that the CD + can be identified in databases such as the CDDB [CDDB]. The frame + consists of a binary dump of the Table Of Contents, TOC, from the CD, + which is a header of 4 bytes and then 8 bytes/track on the CD plus 8 + bytes for the 'lead out' making a maximum of 804 bytes. The offset to + the beginning of every track on the CD should be described with a + four bytes absolute CD-frame address per track, and not with absolute + time. This frame requires a present and valid "TRCK" frame, even if + the CD's only got one track. There may only be one "MCDI" frame in + each tag. + +
+ CD TOC + + +4.6. Event timing codes + + This frame allows synchronisation with key events in a song or sound. + The header is: + +
+ Time stamp format $xx + + Where time stamp format is: + + $01 Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit + $02 Absolute time, 32 bit sized, using milliseconds as unit + + Abolute time means that every stamp contains the time from the + beginning of the file. + + Followed by a list of key events in the following format: + + Type of event $xx + Time stamp $xx (xx ...) + + The 'Time stamp' is set to zero if directly at the beginning of the + sound or after the previous event. All events should be sorted in + chronological order. The type of event is as follows: + + $00 padding (has no meaning) + $01 end of initial silence + $02 intro start + $03 mainpart start + $04 outro start + $05 outro end + $06 verse start + $07 refrain start + $08 interlude start + $09 theme start + $0A variation start + $0B key change + $0C time change + $0D momentary unwanted noise (Snap, Crackle & Pop) + $0E sustained noise + $0F sustained noise end + $10 intro end + $11 mainpart end + $12 verse end + $13 refrain end + $14 theme end + + $15-$DF reserved for future use + + $E0-$EF not predefined sync 0-F + + $F0-$FC reserved for future use + + $FD audio end (start of silence) + $FE audio file ends + $FF one more byte of events follows (all the following bytes with + the value $FF have the same function) + + Terminating the start events such as "intro start" is not required. + The 'Not predefined sync's ($E0-EF) are for user events. You might + want to synchronise your music to something, like setting of an + explosion on-stage, turning on your screensaver etc. + + There may only be one "ETCO" frame in each tag. + + +4.7. MPEG location lookup table + + To increase performance and accuracy of jumps within a MPEG [MPEG] + audio file, frames with timecodes in different locations in the file + might be useful. The ID3v2 frame includes references that the + software can use to calculate positions in the file. After the frame + header is a descriptor of how much the 'frame counter' should + increase for every reference. If this value is two then the first + reference points out the second frame, the 2nd reference the 4th + frame, the 3rd reference the 6th frame etc. In a similar way the + 'bytes between reference' and 'milliseconds between reference' points + out bytes and milliseconds respectively. + + Each reference consists of two parts; a certain number of bits, as + defined in 'bits for bytes deviation', that describes the difference + between what is said in 'bytes between reference' and the reality and + a certain number of bits, as defined in 'bits for milliseconds + deviation', that describes the difference between what is said in + 'milliseconds between reference' and the reality. The number of bits + in every reference, i.e. 'bits for bytes deviation'+'bits for + milliseconds deviation', must be a multiple of four. There may only + be one "MLLT" frame in each tag. + +
+ MPEG frames between reference $xx xx + Bytes between reference $xx xx xx + Milliseconds between reference $xx xx xx + Bits for bytes deviation $xx + Bits for milliseconds dev. $xx + + Then for every reference the following data is included; + + Deviation in bytes %xxx.... + Deviation in milliseconds %xxx.... + + +4.8. Synchronised tempo codes + + For a more accurate description of the tempo of a musical piece this + frame might be used. After the header follows one byte describing + which time stamp format should be used. Then follows one or more + tempo codes. Each tempo code consists of one tempo part and one time + part. The tempo is in BPM described with one or two bytes. If the + first byte has the value $FF, one more byte follows, which is added + to the first giving a range from 2 - 510 BPM, since $00 and $01 is + reserved. $00 is used to describe a beat-free time period, which is + not the same as a music-free time period. $01 is used to indicate one + single beat-stroke followed by a beat-free period. + + The tempo descriptor is followed by a time stamp. Every time the + tempo in the music changes, a tempo descriptor may indicate this for + the player. All tempo descriptors should be sorted in chronological + order. The first beat-stroke in a time-period is at the same time as + the beat description occurs. There may only be one "SYTC" frame in + each tag. + +
+ Time stamp format $xx + Tempo data + + Where time stamp format is: + + $01 Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit + $02 Absolute time, 32 bit sized, using milliseconds as unit + + Abolute time means that every stamp contains the time from the + beginning of the file. + + +4.9. Unsychronised lyrics/text transcription + + This frame contains the lyrics of the song or a text transcription of + other vocal activities. The head includes an encoding descriptor and + a content descriptor. The body consists of the actual text. The + 'Content descriptor' is a terminated string. If no descriptor is + entered, 'Content descriptor' is $00 (00) only. Newline characters + are allowed in the text. There may be more than one 'Unsynchronised + lyrics/text transcription' frame in each tag, but only one with the + same language and content descriptor. + +
+ Text encoding $xx + Language $xx xx xx + Content descriptor $00 (00) + Lyrics/text + + +4.10. Synchronised lyrics/text + + This is another way of incorporating the words, said or sung lyrics, + in the audio file as text, this time, however, in sync with the + audio. It might also be used to describing events e.g. occurring on a + stage or on the screen in sync with the audio. The header includes a + content descriptor, represented with as terminated textstring. If no + descriptor is entered, 'Content descriptor' is $00 (00) only. + +
+ Text encoding $xx + Language $xx xx xx + Time stamp format $xx + Content type $xx + Content descriptor $00 (00) + + + Encoding: $00 ISO-8859-1 [ISO-8859-1] character set is used => $00 + is sync identifier. + $01 Unicode [UNICODE] character set is used => $00 00 is + sync identifier. + + Content type: $00 is other + $01 is lyrics + $02 is text transcription + $03 is movement/part name (e.g. "Adagio") + $04 is events (e.g. "Don Quijote enters the stage") + $05 is chord (e.g. "Bb F Fsus") + $06 is trivia/'pop up' information + + Time stamp format is: + + $01 Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit + $02 Absolute time, 32 bit sized, using milliseconds as unit + + Abolute time means that every stamp contains the time from the + beginning of the file. + + The text that follows the frame header differs from that of the + unsynchronised lyrics/text transcription in one major way. Each + syllable (or whatever size of text is considered to be convenient by + the encoder) is a null terminated string followed by a time stamp + denoting where in the sound file it belongs. Each sync thus has the + following structure: + + Terminated text to be synced (typically a syllable) + Sync identifier (terminator to above string) $00 (00) + Time stamp $xx (xx ...) + + The 'time stamp' is set to zero or the whole sync is omitted if + located directly at the beginning of the sound. All time stamps + should be sorted in chronological order. The sync can be considered + as a validator of the subsequent string. + + Newline ($0A) characters are allowed in all "SYLT" frames and should + be used after every entry (name, event etc.) in a frame with the + content type $03 - $04. + + A few considerations regarding whitespace characters: Whitespace + separating words should mark the beginning of a new word, thus + occurring in front of the first syllable of a new word. This is also + valid for new line characters. A syllable followed by a comma should + not be broken apart with a sync (both the syllable and the comma + should be before the sync). + + An example: The "USLT" passage + + "Strangers in the night" $0A "Exchanging glances" + + would be "SYLT" encoded as: + + "Strang" $00 xx xx "ers" $00 xx xx " in" $00 xx xx " the" $00 xx xx + " night" $00 xx xx 0A "Ex" $00 xx xx "chang" $00 xx xx "ing" $00 xx + xx "glan" $00 xx xx "ces" $00 xx xx + + There may be more than one "SYLT" frame in each tag, but only one + with the same language and content descriptor. + + +4.11. Comments + + This frame is indended for any kind of full text information that + does not fit in any other frame. It consists of a frame header + followed by encoding, language and content descriptors and is ended + with the actual comment as a text string. Newline characters are + allowed in the comment text string. There may be more than one + comment frame in each tag, but only one with the same language and + content descriptor. + +
+ Text encoding $xx + Language $xx xx xx + Short content descrip. $00 (00) + The actual text + + +4.12. Relative volume adjustment + + This is a more subjective function than the previous ones. It allows + the user to say how much he wants to increase/decrease the volume on + each channel while the file is played. The purpose is to be able to + align all files to a reference volume, so that you don't have to + change the volume constantly. This frame may also be used to balance + adjust the audio. If the volume peak levels are known then this could + be described with the 'Peak volume right' and 'Peak volume left' + field. If Peakvolume is not known these fields could be left zeroed + or, if no other data follows, be completely omitted. There may only + be one "RVAD" frame in each tag. + +
+ Increment/decrement %00xxxxxx + Bits used for volume descr. $xx + Relative volume change, right $xx xx (xx ...) + Relative volume change, left $xx xx (xx ...) + Peak volume right $xx xx (xx ...) + Peak volume left $xx xx (xx ...) + + In the increment/decrement field bit 0 is used to indicate the right + channel and bit 1 is used to indicate the left channel. 1 is + increment and 0 is decrement. + + The 'bits used for volume description' field is normally $10 (16 + bits) for MPEG 2 layer I, II and III [MPEG] and MPEG 2.5. This value + may not be $00. The volume is always represented with whole bytes, + padded in the beginning (highest bits) when 'bits used for volume + description' is not a multiple of eight. + + This datablock is then optionally followed by a volume definition for + the left and right back channels. If this information is appended to + the frame the first two channels will be treated as front channels. + In the increment/decrement field bit 2 is used to indicate the right + back channel and bit 3 for the left back channel. + + Relative volume change, right back $xx xx (xx ...) + Relative volume change, left back $xx xx (xx ...) + Peak volume right back $xx xx (xx ...) + Peak volume left back $xx xx (xx ...) + + If the center channel adjustment is present the following is appended + to the existing frame, after the left and right back channels. The + center channel is represented by bit 4 in the increase/decrease + field. + + Relative volume change, center $xx xx (xx ...) + Peak volume center $xx xx (xx ...) + + If the bass channel adjustment is present the following is appended + to the existing frame, after the center channel. The bass channel is + represented by bit 5 in the increase/decrease field. + + Relative volume change, bass $xx xx (xx ...) + Peak volume bass $xx xx (xx ...) + + +4.13. Equalisation + + This is another subjective, alignment frame. It allows the user to + predefine an equalisation curve within the audio file. There may only + be one "EQUA" frame in each tag. + +
+ Adjustment bits $xx + + The 'adjustment bits' field defines the number of bits used for + representation of the adjustment. This is normally $10 (16 bits) for + MPEG 2 layer I, II and III [MPEG] and MPEG 2.5. This value may not be + $00. + + This is followed by 2 bytes + ('adjustment bits' rounded up to the + nearest byte) for every equalisation band in the following format, + giving a frequency range of 0 - 32767Hz: + + Increment/decrement %x (MSB of the Frequency) + Frequency (lower 15 bits) + Adjustment $xx (xx ...) + + The increment/decrement bit is 1 for increment and 0 for decrement. + The equalisation bands should be ordered increasingly with reference + to frequency. All frequencies don't have to be declared. The + equalisation curve in the reading software should be interpolated + between the values in this frame. Three equal adjustments for three + subsequent frequencies. A frequency should only be described once in + the frame. + + +4.14. Reverb + + Yet another subjective one. You may here adjust echoes of different + kinds. Reverb left/right is the delay between every bounce in ms. + Reverb bounces left/right is the number of bounces that should be + made. $FF equals an infinite number of bounces. Feedback is the + amount of volume that should be returned to the next echo bounce. $00 + is 0%, $FF is 100%. If this value were $7F, there would be 50% volume + reduction on the first bounce, 50% of that on the second and so on. + Left to left means the sound from the left bounce to be played in the + left speaker, while left to right means sound from the left bounce to + be played in the right speaker. + + 'Premix left to right' is the amount of left sound to be mixed in the + right before any reverb is applied, where $00 id 0% and $FF is 100%. + 'Premix right to left' does the same thing, but right to left. + Setting both premix to $FF would result in a mono output (if the + reverb is applied symmetric). There may only be one "RVRB" frame in + each tag. + +
+ Reverb left (ms) $xx xx + Reverb right (ms) $xx xx + Reverb bounces, left $xx + Reverb bounces, right $xx + Reverb feedback, left to left $xx + Reverb feedback, left to right $xx + Reverb feedback, right to right $xx + Reverb feedback, right to left $xx + Premix left to right $xx + Premix right to left $xx + + +4.15. Attached picture + + This frame contains a picture directly related to the audio file. + Image format is the MIME type and subtype [MIME] for the image. In + the event that the MIME media type name is omitted, "image/" will be + implied. The "image/png" [PNG] or "image/jpeg" [JFIF] picture format + should be used when interoperability is wanted. Description is a + short description of the picture, represented as a terminated + textstring. The description has a maximum length of 64 characters, + but may be empty. There may be several pictures attached to one file, + each in their individual "APIC" frame, but only one with the same + content descriptor. There may only be one picture with the picture + type declared as picture type $01 and $02 respectively. There is the + possibility to put only a link to the image file by using the 'MIME + type' "-->" and having a complete URL [URL] instead of picture data. + The use of linked files should however be used sparingly since there + is the risk of separation of files. + +
+ Text encoding $xx + MIME type $00 + Picture type $xx + Description $00 (00) + Picture data + + + Picture type: $00 Other + $01 32x32 pixels 'file icon' (PNG only) + $02 Other file icon + $03 Cover (front) + $04 Cover (back) + $05 Leaflet page + $06 Media (e.g. lable side of CD) + $07 Lead artist/lead performer/soloist + $08 Artist/performer + $09 Conductor + $0A Band/Orchestra + $0B Composer + $0C Lyricist/text writer + $0D Recording Location + $0E During recording + $0F During performance + $10 Movie/video screen capture + $11 A bright coloured fish + $12 Illustration + $13 Band/artist logotype + $14 Publisher/Studio logotype + + +4.16. General encapsulated object + + In this frame any type of file can be encapsulated. After the header, + 'Frame size' and 'Encoding' follows 'MIME type' [MIME] represented as + as a terminated string encoded with ISO 8859-1 [ISO-8859-1]. The + filename is case sensitive and is encoded as 'Encoding'. Then follows + a content description as terminated string, encoded as 'Encoding'. + The last thing in the frame is the actual object. The first two + strings may be omitted, leaving only their terminations. MIME type is + always an ISO-8859-1 text string. There may be more than one "GEOB" + frame in each tag, but only one with the same content descriptor. + +
+ Text encoding $xx + MIME type $00 + Filename $00 (00) + Content description $00 (00) + Encapsulated object + + +4.17. Play counter + + This is simply a counter of the number of times a file has been + played. The value is increased by one every time the file begins to + play. There may only be one "PCNT" frame in each tag. When the + counter reaches all one's, one byte is inserted in front of the + counter thus making the counter eight bits bigger. The counter must + be at least 32-bits long to begin with. + +
+ Counter $xx xx xx xx (xx ...) + + +4.18. Popularimeter + + The purpose of this frame is to specify how good an audio file is. + Many interesting applications could be found to this frame such as a + playlist that features better audiofiles more often than others or it + could be used to profile a person's taste and find other 'good' files + by comparing people's profiles. The frame is very simple. It contains + the email address to the user, one rating byte and a four byte play + counter, intended to be increased with one for every time the file is + played. The email is a terminated string. The rating is 1-255 where + 1 is worst and 255 is best. 0 is unknown. If no personal counter is + wanted it may be omitted. When the counter reaches all one's, one + byte is inserted in front of the counter thus making the counter + eight bits bigger in the same away as the play counter ("PCNT"). + There may be more than one "POPM" frame in each tag, but only one + with the same email address. + +
+ Email to user $00 + Rating $xx + Counter $xx xx xx xx (xx ...) + + +4.19. Recommended buffer size + + Sometimes the server from which a audio file is streamed is aware of + transmission or coding problems resulting in interruptions in the + audio stream. In these cases, the size of the buffer can be + recommended by the server using this frame. If the 'embedded info + flag' is true (1) then this indicates that an ID3 tag with the + maximum size described in 'Buffer size' may occur in the audiostream. + In such case the tag should reside between two MPEG [MPEG] frames, if + the audio is MPEG encoded. If the position of the next tag is known, + 'offset to next tag' may be used. The offset is calculated from the + end of tag in which this frame resides to the first byte of the + header in the next. This field may be omitted. Embedded tags are + generally not recommended since this could render unpredictable + behaviour from present software/hardware. + + For applications like streaming audio it might be an idea to embed + tags into the audio stream though. If the clients connects to + individual connections like HTTP and there is a possibility to begin + every transmission with a tag, then this tag should include a + 'recommended buffer size' frame. If the client is connected to a + arbitrary point in the stream, such as radio or multicast, then the + 'recommended buffer size' frame should be included in every tag. + Every tag that is picked up after the initial/first tag is to be + considered as an update of the previous one. E.g. if there is a + "TIT2" frame in the first received tag and one in the second tag, + then the first should be 'replaced' with the second. + + The 'Buffer size' should be kept to a minimum. There may only be one + "RBUF" frame in each tag. + +
+ Buffer size $xx xx xx + Embedded info flag %0000000x + Offset to next tag $xx xx xx xx + + +4.20. Audio encryption + + This frame indicates if the actual audio stream is encrypted, and by + whom. Since standardisation of such encrypion scheme is beyond this + document, all "AENC" frames begin with a terminated string with a + URL containing an email address, or a link to a location where an + email address can be found, that belongs to the organisation + responsible for this specific encrypted audio file. Questions + regarding the encrypted audio should be sent to the email address + specified. If a $00 is found directly after the 'Frame size' and the + audiofile indeed is encrypted, the whole file may be considered + useless. + + After the 'Owner identifier', a pointer to an unencrypted part of the + audio can be specified. The 'Preview start' and 'Preview length' is + described in frames. If no part is unencrypted, these fields should + be left zeroed. After the 'preview length' field follows optionally a + datablock required for decryption of the audio. There may be more + than one "AENC" frames in a tag, but only one with the same 'Owner + identifier'. + +
+ Owner identifier $00 + Preview start $xx xx + Preview length $xx xx + Encryption info + + +4.21. Linked information + + To keep space waste as low as possible this frame may be used to link + information from another ID3v2 tag that might reside in another audio + file or alone in a binary file. It is recommended that this method is + only used when the files are stored on a CD-ROM or other + circumstances when the risk of file seperation is low. The frame + contains a frame identifier, which is the frame that should be linked + into this tag, a URL [URL] field, where a reference to the file where + the frame is given, and additional ID data, if needed. Data should be + retrieved from the first tag found in the file to which this link + points. There may be more than one "LINK" frame in a tag, but only + one with the same contents. A linked frame is to be considered as + part of the tag and has the same restrictions as if it was a physical + part of the tag (i.e. only one "RVRB" frame allowed, whether it's + linked or not). + +
+ Frame identifier $xx xx xx + URL $00 + ID and additional data + + Frames that may be linked and need no additional data are "IPLS", + "MCID", "ETCO", "MLLT", "SYTC", "RVAD", "EQUA", "RVRB", "RBUF", the + text information frames and the URL link frames. + + The "TXXX", "APIC", "GEOB" and "AENC" frames may be linked with + the content descriptor as additional ID data. + + The "COMM", "SYLT" and "USLT" frames may be linked with three bytes + of language descriptor directly followed by a content descriptor as + additional ID data. + + +4.22. Position synchronisation frame + + This frame delivers information to the listener of how far into the + audio stream he picked up; in effect, it states the time offset of + the first frame in the stream. The frame layout is: + + + Time stamp format $xx + Position $xx (xx ...) + + Where time stamp format is: + + $01 Absolute time, 32 bit sized, using MPEG frames as unit + $02 Absolute time, 32 bit sized, using milliseconds as unit + + and position is where in the audio the listener starts to receive, + i.e. the beginning of the next frame. If this frame is used in the + beginning of a file the value is always 0. There may only be one + "POSS" frame in each tag. + + +4.23. Terms of use frame + + This frame contains a brief description of the terms of use and + ownership of the file. More detailed information concerning the legal + terms might be available through the "WCOP" frame. Newlines are + allowed in the text. There may only be one "USER" frame in a tag. + +
+ Text encoding $xx + Language $xx xx xx + The actual text + + +4.24. Ownership frame + + The ownership frame might be used as a reminder of a made transaction + or, if signed, as proof. Note that the "USER" and "TOWN" frames are + good to use in conjunction with this one. The frame begins, after the + frame ID, size and encoding fields, with a 'price payed' field. The + first three characters of this field contains the currency used for + the transaction, encoded according to ISO 4217 [ISO-4217] alphabetic + currency code. Concatenated to this is the actual price payed, as a + numerical string using "." as the decimal separator. Next is an 8 + character date string (YYYYMMDD) followed by a string with the name + of the seller as the last field in the frame. There may only be one + "OWNE" frame in a tag. + +
+ Text encoding $xx + Price payed $00 + Date of purch. + Seller + + +4.25. Commercial frame + + This frame enables several competing offers in the same tag by + bundling all needed information. That makes this frame rather complex + but it's an easier solution than if one tries to achieve the same + result with several frames. The frame begins, after the frame ID, + size and encoding fields, with a price string field. A price is + constructed by one three character currency code, encoded according + to ISO 4217 [ISO-4217] alphabetic currency code, followed by a + numerical value where "." is used as decimal seperator. In the price + string several prices may be concatenated, seperated by a "/" + character, but there may only be one currency of each type. + + The price string is followed by an 8 character date string in the + format YYYYMMDD, describing for how long the price is valid. After + that is a contact URL, with which the user can contact the seller, + followed by a one byte 'received as' field. It describes how the + audio is delivered when bought according to the following list: + + $00 Other + $01 Standard CD album with other songs + $02 Compressed audio on CD + $03 File over the Internet + $04 Stream over the Internet + $05 As note sheets + $06 As note sheets in a book with other sheets + $07 Music on other media + $08 Non-musical merchandise + + Next follows a terminated string with the name of the seller followed + by a terminated string with a short description of the product. The + last thing is the ability to include a company logotype. The first of + them is the 'Picture MIME type' field containing information about + which picture format is used. In the event that the MIME media type + name is omitted, "image/" will be implied. Currently only "image/png" + and "image/jpeg" are allowed. This format string is followed by the + binary picture data. This two last fields may be omitted if no + picture is to attach. + +
+ Text encoding $xx + Price string $00 + Valid until + Contact URL $00 + Received as $xx + Name of seller $00 (00) + Description $00 (00) + Picture MIME type $00 + Seller logo + + +4.26. Encryption method registration + + To identify with which method a frame has been encrypted the + encryption method must be registered in the tag with this frame. The + 'Owner identifier' is a null-terminated string with a URL [URL] + containing an email address, or a link to a location where an email + address can be found, that belongs to the organisation responsible + for this specific encryption method. Questions regarding the + encryption method should be sent to the indicated email address. The + 'Method symbol' contains a value that is associated with this method + throughout the whole tag. Values below $80 are reserved. The 'Method + symbol' may optionally be followed by encryption specific data. There + may be several "ENCR" frames in a tag but only one containing the + same symbol and only one containing the same owner identifier. The + method must be used somewhere in the tag. See section 3.3.1, flag j + for more information. + +
+ Owner identifier $00 + Method symbol $xx + Encryption data + + +4.27. Group identification registration + + This frame enables grouping of otherwise unrelated frames. This can + be used when some frames are to be signed. To identify which frames + belongs to a set of frames a group identifier must be registered in + the tag with this frame. The 'Owner identifier' is a null-terminated + string with a URL [URL] containing an email address, or a link to a + location where an email address can be found, that belongs to the + organisation responsible for this grouping. Questions regarding the + grouping should be sent to the indicated email address. The 'Group + symbol' contains a value that associates the frame with this group + throughout the whole tag. Values below $80 are reserved. The 'Group + symbol' may optionally be followed by some group specific data, e.g. + a digital signature. There may be several "GRID" frames in a tag but + only one containing the same symbol and only one containing the same + owner identifier. The group symbol must be used somewhere in the tag. + See section 3.3.1, flag j for more information. + +
+ Owner identifier $00 + Group symbol $xx + Group dependent data + + +4.28. Private frame + + This frame is used to contain information from a software producer + that its program uses and does not fit into the other frames. The + frame consists of an 'Owner identifier' string and the binary data. + The 'Owner identifier' is a null-terminated string with a URL [URL] + containing an email address, or a link to a location where an email + address can be found, that belongs to the organisation responsible + for the frame. Questions regarding the frame should be sent to the + indicated email address. The tag may contain more than one "PRIV" + frame but only with different contents. It is recommended to keep the + number of "PRIV" frames as low as possible. + +
+ Owner identifier $00 + The private data + + +5. The 'unsynchronisation scheme' + + The only purpose of the 'unsynchronisation scheme' is to make the + ID3v2 tag as compatible as possible with existing software. There is + no use in 'unsynchronising' tags if the file is only to be processed + by new software. Unsynchronisation may only be made with MPEG 2 layer + I, II and III and MPEG 2.5 files. + + Whenever a false synchronisation is found within the tag, one zeroed + byte is inserted after the first false synchronisation byte. The + format of a correct sync that should be altered by ID3 encoders is as + follows: + + %11111111 111xxxxx + + And should be replaced with: + + %11111111 00000000 111xxxxx + + This has the side effect that all $FF 00 combinations have to be + altered, so they won't be affected by the decoding process. Therefore + all the $FF 00 combinations have to be replaced with the $FF 00 00 + combination during the unsynchronisation. + + To indicate usage of the unsynchronisation, the first bit in 'ID3 + flags' should be set. This bit should only be set if the tag + contains a, now corrected, false synchronisation. The bit should + only be clear if the tag does not contain any false synchronisations. + + Do bear in mind, that if a compression scheme is used by the encoder, + the unsynchronisation scheme should be applied *afterwards*. When + decoding a compressed, 'unsynchronised' file, the 'unsynchronisation + scheme' should be parsed first, decompression afterwards. + + If the last byte in the tag is $FF, and there is a need to eliminate + false synchronisations in the tag, at least one byte of padding + should be added. + + +6. Copyright + + Copyright (C) Martin Nilsson 1998. All Rights Reserved. + + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it + or assist in its implementation may be prepared, copied, published + and distributed, in whole or in part, without restriction of any + kind, provided that a reference to this document is included on all + such copies and derivative works. However, this document itself may + not be modified in any way and reissued as the original document. + + The limited permissions granted above are perpetual and will not be + revoked. + + This document and the information contained herein is provided on an + "AS IS" basis and THE AUTHORS DISCLAIMS ALL WARRANTIES, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF + THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED + WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + + +7. References + + [CDDB] Compact Disc Data Base + + http://www.cddb.com + + [ID3v2] Martin Nilsson, "ID3v2 informal standard". + + http://www.id3lib.org/id3/id3v2-00.txt + + [ISO-639-2] ISO/FDIS 639-2. + Codes for the representation of names of languages, Part 2: Alpha-3 + code. Technical committee / subcommittee: TC 37 / SC 2 + + [ISO-4217] ISO 4217:1995. + Codes for the representation of currencies and funds. + Technical committee / subcommittee: TC 68 + + [ISO-8859-1] ISO/IEC DIS 8859-1. + 8-bit single-byte coded graphic character sets, Part 1: Latin + alphabet No. 1. Technical committee / subcommittee: JTC 1 / SC 2 + + [ISRC] ISO 3901:1986 + International Standard Recording Code (ISRC). + Technical committee / subcommittee: TC 46 / SC 9 + + [JFIF] JPEG File Interchange Format, version 1.02 + + http://www.w3.org/Graphics/JPEG/jfif.txt">http://www.w3.org/Graphics/JPEG/jfif.txt + + [MIME] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part One: Format of Internet Message Bodies", + RFC 2045, November 1996. + + ftp://ftp.isi.edu/in-notes/rfc2045.txt">ftp://ftp.isi.edu/in-notes/rfc2045.txt + + [MPEG] ISO/IEC 11172-3:1993. + Coding of moving pictures and associated audio for digital storage + media at up to about 1,5 Mbit/s, Part 3: Audio. + Technical committee / subcommittee: JTC 1 / SC 29 + and + ISO/IEC 13818-3:1995 + Generic coding of moving pictures and associated audio information, + Part 3: Audio. + Technical committee / subcommittee: JTC 1 / SC 29 + and + ISO/IEC DIS 13818-3 + Generic coding of moving pictures and associated audio information, + Part 3: Audio (Revision of ISO/IEC 13818-3:1995) + + + [PNG] Portable Network Graphics, version 1.0 + + http://www.w3.org/TR/REC-png-multi.html + + [UNICODE] ISO/IEC 10646-1:1993. + Universal Multiple-Octet Coded Character Set (UCS), Part 1: + Architecture and Basic Multilingual Plane. + Technical committee / subcommittee: JTC 1 / SC 2 + + http://www.unicode.org/ + + [URL] T. Berners-Lee, L. Masinter & M. McCahill, "Uniform Resource + Locators (URL).", RFC 1738, December 1994. + + ftp://ftp.isi.edu/in-notes/rfc1738.txt + + [ZLIB] P. Deutsch, Aladdin Enterprises & J-L. Gailly, "ZLIB + Compressed + Data Format Specification version 3.3", RFC 1950, May 1996. + + ftp://ftp.isi.edu/in-notes/rfc1950.txt + + +8. Appendix + + +A. Appendix A - Genre List from ID3v1 + + The following genres is defined in ID3v1 + + 0.Blues + 1.Classic Rock + 2.Country + 3.Dance + 4.Disco + 5.Funk + 6.Grunge + 7.Hip-Hop + 8.Jazz + 9.Metal + 10.New Age + 11.Oldies + 12.Other + 13.Pop + 14.R&B + 15.Rap + 16.Reggae + 17.Rock + 18.Techno + 19.Industrial + 20.Alternative + 21.Ska + 22.Death Metal + 23.Pranks + 24.Soundtrack + 25.Euro-Techno + 26.Ambient + 27.Trip-Hop + 28.Vocal + 29.Jazz+Funk + 30.Fusion + 31.Trance + 32.Classical + 33.Instrumental + 34.Acid + 35.House + 36.Game + 37.Sound Clip + 38.Gospel + 39.Noise + 40.AlternRock + 41.Bass + 42.Soul + 43.Punk + 44.Space + 45.Meditative + 46.Instrumental Pop + 47.Instrumental Rock + 48.Ethnic + 49.Gothic + 50.Darkwave + 51.Techno-Industrial + 52.Electronic + 53.Pop-Folk + 54.Eurodance + 55.Dream + 56.Southern Rock + 57.Comedy + 58.Cult + 59.Gangsta + 60.Top 40 + 61.Christian Rap + 62.Pop/Funk + 63.Jungle + 64.Native American + 65.Cabaret + 66.New Wave + 67.Psychadelic + 68.Rave + 69.Showtunes + 70.Trailer + 71.Lo-Fi + 72.Tribal + 73.Acid Punk + 74.Acid Jazz + 75.Polka + 76.Retro + 77.Musical + 78.Rock & Roll + 79.Hard Rock + + The following genres are Winamp extensions + + 80.Folk + 81.Folk-Rock + 82.National Folk + 83.Swing + 84.Fast Fusion + 85.Bebob + 86.Latin + 87.Revival + 88.Celtic + 89.Bluegrass + 90.Avantgarde + 91.Gothic Rock + 92.Progressive Rock + 93.Psychedelic Rock + 94.Symphonic Rock + 95.Slow Rock + 96.Big Band + 97.Chorus + 98.Easy Listening + 99.Acoustic + 100.Humour + 101.Speech + 102.Chanson + 103.Opera + 104.Chamber Music + 105.Sonata + 106.Symphony + 107.Booty Bass + 108.Primus + 109.Porn Groove + 110.Satire + 111.Slow Jam + 112.Club + 113.Tango + 114.Samba + 115.Folklore + 116.Ballad + 117.Power Ballad + 118.Rhythmic Soul + 119.Freestyle + 120.Duet + 121.Punk Rock + 122.Drum Solo + 123.Acapella + 124.Euro-House + 125.Dance Hall + + +9. Author's Address + + Written by + + Martin Nilsson + Rydsvägen 246 C. 30 + S-584 34 Linköping + Sweden + + Email: nilsson@id3.org + + + Edited by + + Dirk Mahoney + 57 Pechey Street + Chermside Q + Australia 4032 + + Email: dirk@id3.org + + + Johan Sundström + Alsättersgatan 5 A. 34 + S-584 35 Linköping + Sweden + + Email: johan@id3.org diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/id3v2.4.0-frames.txt b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/id3v2.4.0-frames.txt new file mode 100644 index 0000000..74a21be --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/id3v2.4.0-frames.txt @@ -0,0 +1,1734 @@ +$Id$ + +Informal standard M. Nilsson +Document: id3v2.4.0-frames.txt 1st November 2000 + + + ID3 tag version 2.4.0 - Native Frames + +Status of this document + + This document is an informal standard and replaces the ID3v2.3.0 + standard [ID3v2]. A formal standard will use another revision number + even if the content is identical to document. The contents in this + document may change for clarifications but never for added or altered + functionallity. + + Distribution of this document is unlimited. + + +Abstract + + This document describes the frames natively supported by ID3v2.4.0, + which is a revised version of the ID3v2 informal standard [ID3v2.3.0] + version 2.3.0. The ID3v2 offers a flexible way of storing audio meta + information within audio file itself. The information may be + technical information, such as equalisation curves, as well as title, + performer, copyright etc. + + ID3v2.4.0 is meant to be as close as possible to ID3v2.3.0 in order + to allow for implementations to be revised as easily as possible. + + +1. Table of contents + + 2. Conventions in this document + 3. Default flags + 4. Declared ID3v2 frames + 4.1. Unique file identifier + 4.2. Text information frames + 4.2.1. Identification frames + 4.2.2. Involved persons frames + 4.2.3. Derived and subjective properties frames + 4.2.4. Rights and license frames + 4.2.5. Other text frames + 4.2.6. User defined text information frame + 4.3. URL link frames + 4.3.1. URL link frames - details + 4.3.2. User defined URL link frame + 4.4. Music CD Identifier + 4.5. Event timing codes + 4.6. MPEG location lookup table + 4.7. Synced tempo codes + 4.8. Unsynchronised lyrics/text transcription + 4.9. Synchronised lyrics/text + 4.10. Comments + 4.11. Relative volume adjustment (2) + 4.12. Equalisation (2) + 4.13. Reverb + 4.14. Attached picture + 4.15. General encapsulated object + 4.16. Play counter + 4.17. Popularimeter + 4.18. Recommended buffer size + 4.19. Audio encryption + 4.20. Linked information + 4.21. Position synchronisation frame + 4.22. Terms of use + 4.23. Ownership frame + 4.24. Commercial frame + 4.25. Encryption method registration + 4.26. Group identification registration + 4.27. Private frame + 4.28. Signature frame + 4.29. Seek frame + 4.30. Audio seek point index + 5. Copyright + 6. References + 7. Appendix + A. Appendix A - Genre List from ID3v1 + 8. Author's Address + + +2. Conventions in this document + + Text within "" is a text string exactly as it appears in a tag. + Numbers preceded with $ are hexadecimal and numbers preceded with % + are binary. $xx is used to indicate a byte with unknown content. %x + is used to indicate a bit with unknown content. The most significant + bit (MSB) of a byte is called 'bit 7' and the least significant bit + (LSB) is called 'bit 0'. + + A tag is the whole tag described the ID3v2 main structure document + [ID3v2-strct]. A frame is a block of information in the tag. The tag + consists of a header, frames and optional padding. A field is a piece + of information; one value, a string etc. A numeric string is a string + that consists of the characters "0123456789" only. + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + document are to be interpreted as described in RFC 2119 [KEYWORDS]. + + +3. Default flags + + The default settings for the frames described in this document can be + divided into the following classes. The flags may be set differently + if found more suitable by the software. + + 1. Discarded if tag is altered, discarded if file is altered. + + None. + + 2. Discarded if tag is altered, preserved if file is altered. + + None. + + 3. Preserved if tag is altered, discarded if file is altered. + + ASPI, AENC, ETCO, EQU2, MLLT, POSS, SEEK, SYLT, SYTC, RVA2, TENC, + TLEN + + 4. Preserved if tag is altered, preserved if file is altered. + + The rest of the frames. + + +4. Declared ID3v2 frames + + The following frames are declared in this draft. + + 4.19 AENC Audio encryption + 4.14 APIC Attached picture + 4.30 ASPI Audio seek point index + + 4.10 COMM Comments + 4.24 COMR Commercial frame + + 4.25 ENCR Encryption method registration + 4.12 EQU2 Equalisation (2) + 4.5 ETCO Event timing codes + + 4.15 GEOB General encapsulated object + 4.26 GRID Group identification registration + + 4.20 LINK Linked information + + 4.4 MCDI Music CD identifier + 4.6 MLLT MPEG location lookup table + + 4.23 OWNE Ownership frame + + 4.27 PRIV Private frame + 4.16 PCNT Play counter + 4.17 POPM Popularimeter + 4.21 POSS Position synchronisation frame + + 4.18 RBUF Recommended buffer size + 4.11 RVA2 Relative volume adjustment (2) + 4.13 RVRB Reverb + + 4.29 SEEK Seek frame + 4.28 SIGN Signature frame + 4.9 SYLT Synchronised lyric/text + 4.7 SYTC Synchronised tempo codes + + 4.2.1 TALB Album/Movie/Show title + 4.2.3 TBPM BPM (beats per minute) + 4.2.2 TCOM Composer + 4.2.3 TCON Content type + 4.2.4 TCOP Copyright message + 4.2.5 TDEN Encoding time + 4.2.5 TDLY Playlist delay + 4.2.5 TDOR Original release time + 4.2.5 TDRC Recording time + 4.2.5 TDRL Release time + 4.2.5 TDTG Tagging time + 4.2.2 TENC Encoded by + 4.2.2 TEXT Lyricist/Text writer + 4.2.3 TFLT File type + 4.2.2 TIPL Involved people list + 4.2.1 TIT1 Content group description + 4.2.1 TIT2 Title/songname/content description + 4.2.1 TIT3 Subtitle/Description refinement + 4.2.3 TKEY Initial key + 4.2.3 TLAN Language(s) + 4.2.3 TLEN Length + 4.2.2 TMCL Musician credits list + 4.2.3 TMED Media type + 4.2.3 TMOO Mood + 4.2.1 TOAL Original album/movie/show title + 4.2.5 TOFN Original filename + 4.2.2 TOLY Original lyricist(s)/text writer(s) + 4.2.2 TOPE Original artist(s)/performer(s) + 4.2.4 TOWN File owner/licensee + 4.2.2 TPE1 Lead performer(s)/Soloist(s) + 4.2.2 TPE2 Band/orchestra/accompaniment + 4.2.2 TPE3 Conductor/performer refinement + 4.2.2 TPE4 Interpreted, remixed, or otherwise modified by + 4.2.1 TPOS Part of a set + 4.2.4 TPRO Produced notice + 4.2.4 TPUB Publisher + 4.2.1 TRCK Track number/Position in set + 4.2.4 TRSN Internet radio station name + 4.2.4 TRSO Internet radio station owner + 4.2.5 TSOA Album sort order + 4.2.5 TSOP Performer sort order + 4.2.5 TSOT Title sort order + 4.2.1 TSRC ISRC (international standard recording code) + 4.2.5 TSSE Software/Hardware and settings used for encoding + 4.2.1 TSST Set subtitle + 4.2.2 TXXX User defined text information frame + + 4.1 UFID Unique file identifier + 4.22 USER Terms of use + 4.8 USLT Unsynchronised lyric/text transcription + + 4.3.1 WCOM Commercial information + 4.3.1 WCOP Copyright/Legal information + 4.3.1 WOAF Official audio file webpage + 4.3.1 WOAR Official artist/performer webpage + 4.3.1 WOAS Official audio source webpage + 4.3.1 WORS Official Internet radio station homepage + 4.3.1 WPAY Payment + 4.3.1 WPUB Publishers official webpage + 4.3.2 WXXX User defined URL link frame + + +4.1. Unique file identifier + + This frame's purpose is to be able to identify the audio file in a + database, that may provide more information relevant to the content. + Since standardisation of such a database is beyond this document, all + UFID frames begin with an 'owner identifier' field. It is a null- + terminated string with a URL [URL] containing an email address, or a + link to a location where an email address can be found, that belongs + to the organisation responsible for this specific database + implementation. Questions regarding the database should be sent to + the indicated email address. The URL should not be used for the + actual database queries. The string + "http://www.id3.org/dummy/ufid.html" should be used for tests. The + 'Owner identifier' must be non-empty (more than just a termination). + The 'Owner identifier' is then followed by the actual identifier, + which may be up to 64 bytes. There may be more than one "UFID" frame + in a tag, but only one with the same 'Owner identifier'. + +
+ Owner identifier $00 + Identifier + + +4.2. Text information frames + + The text information frames are often the most important frames, + containing information like artist, album and more. There may only be + one text information frame of its kind in an tag. All text + information frames supports multiple strings, stored as a null + separated list, where null is reperesented by the termination code + for the charater encoding. All text frame identifiers begin with "T". + Only text frame identifiers begin with "T", with the exception of the + "TXXX" frame. All the text information frames have the following + format: + +
+ Text encoding $xx + Information + + +4.2.1. Identification frames + + TIT1 + The 'Content group description' frame is used if the sound belongs to + a larger category of sounds/music. For example, classical music is + often sorted in different musical sections (e.g. "Piano Concerto", + "Weather - Hurricane"). + + TIT2 + The 'Title/Songname/Content description' frame is the actual name of + the piece (e.g. "Adagio", "Hurricane Donna"). + + TIT3 + The 'Subtitle/Description refinement' frame is used for information + directly related to the contents title (e.g. "Op. 16" or "Performed + live at Wembley"). + + TALB + The 'Album/Movie/Show title' frame is intended for the title of the + recording (or source of sound) from which the audio in the file is + taken. + + TOAL + The 'Original album/movie/show title' frame is intended for the title + of the original recording (or source of sound), if for example the + music in the file should be a cover of a previously released song. + + TRCK + The 'Track number/Position in set' frame is a numeric string + containing the order number of the audio-file on its original + recording. This MAY be extended with a "/" character and a numeric + string containing the total number of tracks/elements on the original + recording. E.g. "4/9". + + TPOS + The 'Part of a set' frame is a numeric string that describes which + part of a set the audio came from. This frame is used if the source + described in the "TALB" frame is divided into several mediums, e.g. a + double CD. The value MAY be extended with a "/" character and a + numeric string containing the total number of parts in the set. E.g. + "1/2". + + TSST + The 'Set subtitle' frame is intended for the subtitle of the part of + a set this track belongs to. + + TSRC + The 'ISRC' frame should contain the International Standard Recording + Code [ISRC] (12 characters). + + +4.2.2. Involved persons frames + + TPE1 + The 'Lead artist/Lead performer/Soloist/Performing group' is + used for the main artist. + + TPE2 + The 'Band/Orchestra/Accompaniment' frame is used for additional + information about the performers in the recording. + + TPE3 + The 'Conductor' frame is used for the name of the conductor. + + TPE4 + The 'Interpreted, remixed, or otherwise modified by' frame contains + more information about the people behind a remix and similar + interpretations of another existing piece. + + TOPE + The 'Original artist/performer' frame is intended for the performer + of the original recording, if for example the music in the file + should be a cover of a previously released song. + + TEXT + The 'Lyricist/Text writer' frame is intended for the writer of the + text or lyrics in the recording. + + TOLY + The 'Original lyricist/text writer' frame is intended for the + text writer of the original recording, if for example the music in + the file should be a cover of a previously released song. + + TCOM + The 'Composer' frame is intended for the name of the composer. + + TMCL + The 'Musician credits list' is intended as a mapping between + instruments and the musician that played it. Every odd field is an + instrument and every even is an artist or a comma delimited list of + artists. + + TIPL + The 'Involved people list' is very similar to the musician credits + list, but maps between functions, like producer, and names. + + TENC + The 'Encoded by' frame contains the name of the person or + organisation that encoded the audio file. This field may contain a + copyright message, if the audio file also is copyrighted by the + encoder. + + +4.2.3. Derived and subjective properties frames + + TBPM + The 'BPM' frame contains the number of beats per minute in the + main part of the audio. The BPM is an integer and represented as a + numerical string. + + TLEN + The 'Length' frame contains the length of the audio file in + milliseconds, represented as a numeric string. + + TKEY + The 'Initial key' frame contains the musical key in which the sound + starts. It is represented as a string with a maximum length of three + characters. The ground keys are represented with "A","B","C","D","E", + "F" and "G" and halfkeys represented with "b" and "#". Minor is + represented as "m", e.g. "Dbm" $00. Off key is represented with an + "o" only. + + TLAN + The 'Language' frame should contain the languages of the text or + lyrics spoken or sung in the audio. The language is represented with + three characters according to ISO-639-2 [ISO-639-2]. If more than one + language is used in the text their language codes should follow + according to the amount of their usage, e.g. "eng" $00 "sve" $00. + + TCON + The 'Content type', which ID3v1 was stored as a one byte numeric + value only, is now a string. You may use one or several of the ID3v1 + types as numerical strings, or, since the category list would be + impossible to maintain with accurate and up to date categories, + define your own. Example: "21" $00 "Eurodisco" $00 + + You may also use any of the following keywords: + + RX Remix + CR Cover + + TFLT + The 'File type' frame indicates which type of audio this tag defines. + The following types and refinements are defined: + + MIME MIME type follows + MPG MPEG Audio + /1 MPEG 1/2 layer I + /2 MPEG 1/2 layer II + /3 MPEG 1/2 layer III + /2.5 MPEG 2.5 + /AAC Advanced audio compression + VQF Transform-domain Weighted Interleave Vector Quantisation + PCM Pulse Code Modulated audio + + but other types may be used, but not for these types though. This is + used in a similar way to the predefined types in the "TMED" frame, + but without parentheses. If this frame is not present audio type is + assumed to be "MPG". + + TMED + The 'Media type' frame describes from which media the sound + originated. This may be a text string or a reference to the + predefined media types found in the list below. Example: + "VID/PAL/VHS" $00. + + DIG Other digital media + /A Analogue transfer from media + + ANA Other analogue media + /WAC Wax cylinder + /8CA 8-track tape cassette + + CD CD + /A Analogue transfer from media + /DD DDD + /AD ADD + /AA AAD + + LD Laserdisc + + TT Turntable records + /33 33.33 rpm + /45 45 rpm + /71 71.29 rpm + /76 76.59 rpm + /78 78.26 rpm + /80 80 rpm + + MD MiniDisc + /A Analogue transfer from media + + DAT DAT + /A Analogue transfer from media + /1 standard, 48 kHz/16 bits, linear + /2 mode 2, 32 kHz/16 bits, linear + /3 mode 3, 32 kHz/12 bits, non-linear, low speed + /4 mode 4, 32 kHz/12 bits, 4 channels + /5 mode 5, 44.1 kHz/16 bits, linear + /6 mode 6, 44.1 kHz/16 bits, 'wide track' play + + DCC DCC + /A Analogue transfer from media + + DVD DVD + /A Analogue transfer from media + + TV Television + /PAL PAL + /NTSC NTSC + /SECAM SECAM + + VID Video + /PAL PAL + /NTSC NTSC + /SECAM SECAM + /VHS VHS + /SVHS S-VHS + /BETA BETAMAX + + RAD Radio + /FM FM + /AM AM + /LW LW + /MW MW + + TEL Telephone + /I ISDN + + MC MC (normal cassette) + /4 4.75 cm/s (normal speed for a two sided cassette) + /9 9.5 cm/s + /I Type I cassette (ferric/normal) + /II Type II cassette (chrome) + /III Type III cassette (ferric chrome) + /IV Type IV cassette (metal) + + REE Reel + /9 9.5 cm/s + /19 19 cm/s + /38 38 cm/s + /76 76 cm/s + /I Type I cassette (ferric/normal) + /II Type II cassette (chrome) + /III Type III cassette (ferric chrome) + /IV Type IV cassette (metal) + + TMOO + The 'Mood' frame is intended to reflect the mood of the audio with a + few keywords, e.g. "Romantic" or "Sad". + + +4.2.4. Rights and license frames + + TCOP + The 'Copyright message' frame, in which the string must begin with a + year and a space character (making five characters), is intended for + the copyright holder of the original sound, not the audio file + itself. The absence of this frame means only that the copyright + information is unavailable or has been removed, and must not be + interpreted to mean that the audio is public domain. Every time this + field is displayed the field must be preceded with "Copyright " (C) " + ", where (C) is one character showing a C in a circle. + + TPRO + The 'Produced notice' frame, in which the string must begin with a + year and a space character (making five characters), is intended for + the production copyright holder of the original sound, not the audio + file itself. The absence of this frame means only that the production + copyright information is unavailable or has been removed, and must + not be interpreted to mean that the audio is public domain. Every + time this field is displayed the field must be preceded with + "Produced " (P) " ", where (P) is one character showing a P in a + circle. + + TPUB + The 'Publisher' frame simply contains the name of the label or + publisher. + + TOWN + The 'File owner/licensee' frame contains the name of the owner or + licensee of the file and it's contents. + + TRSN + The 'Internet radio station name' frame contains the name of the + internet radio station from which the audio is streamed. + + TRSO + The 'Internet radio station owner' frame contains the name of the + owner of the internet radio station from which the audio is + streamed. + +4.2.5. Other text frames + + TOFN + The 'Original filename' frame contains the preferred filename for the + file, since some media doesn't allow the desired length of the + filename. The filename is case sensitive and includes its suffix. + + TDLY + The 'Playlist delay' defines the numbers of milliseconds of silence + that should be inserted before this audio. The value zero indicates + that this is a part of a multifile audio track that should be played + continuously. + + TDEN + The 'Encoding time' frame contains a timestamp describing when the + audio was encoded. Timestamp format is described in the ID3v2 + structure document [ID3v2-strct]. + + TDOR + The 'Original release time' frame contains a timestamp describing + when the original recording of the audio was released. Timestamp + format is described in the ID3v2 structure document [ID3v2-strct]. + + TDRC + The 'Recording time' frame contains a timestamp describing when the + audio was recorded. Timestamp format is described in the ID3v2 + structure document [ID3v2-strct]. + + TDRL + The 'Release time' frame contains a timestamp describing when the + audio was first released. Timestamp format is described in the ID3v2 + structure document [ID3v2-strct]. + + TDTG + The 'Tagging time' frame contains a timestamp describing then the + audio was tagged. Timestamp format is described in the ID3v2 + structure document [ID3v2-strct]. + + TSSE + The 'Software/Hardware and settings used for encoding' frame + includes the used audio encoder and its settings when the file was + encoded. Hardware refers to hardware encoders, not the computer on + which a program was run. + + TSOA + The 'Album sort order' frame defines a string which should be used + instead of the album name (TALB) for sorting purposes. E.g. an album + named "A Soundtrack" might preferably be sorted as "Soundtrack". + + TSOP + The 'Performer sort order' frame defines a string which should be + used instead of the performer (TPE2) for sorting purposes. + + TSOT + The 'Title sort order' frame defines a string which should be used + instead of the title (TIT2) for sorting purposes. + + +4.2.6. User defined text information frame + + This frame is intended for one-string text information concerning the + audio file in a similar way to the other "T"-frames. The frame body + consists of a description of the string, represented as a terminated + string, followed by the actual string. There may be more than one + "TXXX" frame in each tag, but only one with the same description. + +
+ Text encoding $xx + Description $00 (00) + Value + + +4.3. URL link frames + + With these frames dynamic data such as webpages with touring + information, price information or plain ordinary news can be added to + the tag. There may only be one URL [URL] link frame of its kind in an + tag, except when stated otherwise in the frame description. If the + text string is followed by a string termination, all the following + information should be ignored and not be displayed. All URL link + frame identifiers begins with "W". Only URL link frame identifiers + begins with "W", except for "WXXX". All URL link frames have the + following format: + +
+ URL + + +4.3.1. URL link frames - details + + WCOM + The 'Commercial information' frame is a URL pointing at a webpage + with information such as where the album can be bought. There may be + more than one "WCOM" frame in a tag, but not with the same content. + + WCOP + The 'Copyright/Legal information' frame is a URL pointing at a + webpage where the terms of use and ownership of the file is + described. + + WOAF + The 'Official audio file webpage' frame is a URL pointing at a file + specific webpage. + + WOAR + The 'Official artist/performer webpage' frame is a URL pointing at + the artists official webpage. There may be more than one "WOAR" frame + in a tag if the audio contains more than one performer, but not with + the same content. + + WOAS + The 'Official audio source webpage' frame is a URL pointing at the + official webpage for the source of the audio file, e.g. a movie. + + WORS + The 'Official Internet radio station homepage' contains a URL + pointing at the homepage of the internet radio station. + + WPAY + The 'Payment' frame is a URL pointing at a webpage that will handle + the process of paying for this file. + + WPUB + The 'Publishers official webpage' frame is a URL pointing at the + official webpage for the publisher. + + +4.3.2. User defined URL link frame + + This frame is intended for URL [URL] links concerning the audio file + in a similar way to the other "W"-frames. The frame body consists + of a description of the string, represented as a terminated string, + followed by the actual URL. The URL is always encoded with ISO-8859-1 + [ISO-8859-1]. There may be more than one "WXXX" frame in each tag, + but only one with the same description. + +
+ Text encoding $xx + Description $00 (00) + URL + + +4.4. Music CD identifier + + This frame is intended for music that comes from a CD, so that the CD + can be identified in databases such as the CDDB [CDDB]. The frame + consists of a binary dump of the Table Of Contents, TOC, from the CD, + which is a header of 4 bytes and then 8 bytes/track on the CD plus 8 + bytes for the 'lead out', making a maximum of 804 bytes. The offset + to the beginning of every track on the CD should be described with a + four bytes absolute CD-frame address per track, and not with absolute + time. When this frame is used the presence of a valid "TRCK" frame is + REQUIRED, even if the CD's only got one track. It is recommended that + this frame is always added to tags originating from CDs. There may + only be one "MCDI" frame in each tag. + +
+ CD TOC + + +4.5. Event timing codes + + This frame allows synchronisation with key events in the audio. The + header is: + +
+ Time stamp format $xx + + Where time stamp format is: + + $01 Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit + $02 Absolute time, 32 bit sized, using milliseconds as unit + + Absolute time means that every stamp contains the time from the + beginning of the file. + + Followed by a list of key events in the following format: + + Type of event $xx + Time stamp $xx (xx ...) + + The 'Time stamp' is set to zero if directly at the beginning of the + sound or after the previous event. All events MUST be sorted in + chronological order. The type of event is as follows: + + $00 padding (has no meaning) + $01 end of initial silence + $02 intro start + $03 main part start + $04 outro start + $05 outro end + $06 verse start + $07 refrain start + $08 interlude start + $09 theme start + $0A variation start + $0B key change + $0C time change + $0D momentary unwanted noise (Snap, Crackle & Pop) + $0E sustained noise + $0F sustained noise end + $10 intro end + $11 main part end + $12 verse end + $13 refrain end + $14 theme end + $15 profanity + $16 profanity end + + $17-$DF reserved for future use + + $E0-$EF not predefined synch 0-F + + $F0-$FC reserved for future use + + $FD audio end (start of silence) + $FE audio file ends + $FF one more byte of events follows (all the following bytes with + the value $FF have the same function) + + Terminating the start events such as "intro start" is OPTIONAL. The + 'Not predefined synch's ($E0-EF) are for user events. You might want + to synchronise your music to something, like setting off an explosion + on-stage, activating a screensaver etc. + + There may only be one "ETCO" frame in each tag. + + +4.6. MPEG location lookup table + + To increase performance and accuracy of jumps within a MPEG [MPEG] + audio file, frames with time codes in different locations in the file + might be useful. This ID3v2 frame includes references that the + software can use to calculate positions in the file. After the frame + header follows a descriptor of how much the 'frame counter' should be + increased for every reference. If this value is two then the first + reference points out the second frame, the 2nd reference the 4th + frame, the 3rd reference the 6th frame etc. In a similar way the + 'bytes between reference' and 'milliseconds between reference' points + out bytes and milliseconds respectively. + + Each reference consists of two parts; a certain number of bits, as + defined in 'bits for bytes deviation', that describes the difference + between what is said in 'bytes between reference' and the reality and + a certain number of bits, as defined in 'bits for milliseconds + deviation', that describes the difference between what is said in + 'milliseconds between reference' and the reality. The number of bits + in every reference, i.e. 'bits for bytes deviation'+'bits for + milliseconds deviation', must be a multiple of four. There may only + be one "MLLT" frame in each tag. + +
+ MPEG frames between reference $xx xx + Bytes between reference $xx xx xx + Milliseconds between reference $xx xx xx + Bits for bytes deviation $xx + Bits for milliseconds dev. $xx + + Then for every reference the following data is included; + + Deviation in bytes %xxx.... + Deviation in milliseconds %xxx.... + + +4.7. Synchronised tempo codes + + For a more accurate description of the tempo of a musical piece, this + frame might be used. After the header follows one byte describing + which time stamp format should be used. Then follows one or more + tempo codes. Each tempo code consists of one tempo part and one time + part. The tempo is in BPM described with one or two bytes. If the + first byte has the value $FF, one more byte follows, which is added + to the first giving a range from 2 - 510 BPM, since $00 and $01 is + reserved. $00 is used to describe a beat-free time period, which is + not the same as a music-free time period. $01 is used to indicate one + single beat-stroke followed by a beat-free period. + + The tempo descriptor is followed by a time stamp. Every time the + tempo in the music changes, a tempo descriptor may indicate this for + the player. All tempo descriptors MUST be sorted in chronological + order. The first beat-stroke in a time-period is at the same time as + the beat description occurs. There may only be one "SYTC" frame in + each tag. + +
+ Time stamp format $xx + Tempo data + + Where time stamp format is: + + $01 Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit + $02 Absolute time, 32 bit sized, using milliseconds as unit + + Absolute time means that every stamp contains the time from the + beginning of the file. + + +4.8. Unsynchronised lyrics/text transcription + + This frame contains the lyrics of the song or a text transcription of + other vocal activities. The head includes an encoding descriptor and + a content descriptor. The body consists of the actual text. The + 'Content descriptor' is a terminated string. If no descriptor is + entered, 'Content descriptor' is $00 (00) only. Newline characters + are allowed in the text. There may be more than one 'Unsynchronised + lyrics/text transcription' frame in each tag, but only one with the + same language and content descriptor. + +
+ Text encoding $xx + Language $xx xx xx + Content descriptor $00 (00) + Lyrics/text + + +4.9. Synchronised lyrics/text + + This is another way of incorporating the words, said or sung lyrics, + in the audio file as text, this time, however, in sync with the + audio. It might also be used to describing events e.g. occurring on a + stage or on the screen in sync with the audio. The header includes a + content descriptor, represented with as terminated text string. If no + descriptor is entered, 'Content descriptor' is $00 (00) only. + +
+ Text encoding $xx + Language $xx xx xx + Time stamp format $xx + Content type $xx + Content descriptor $00 (00) + + Content type: $00 is other + $01 is lyrics + $02 is text transcription + $03 is movement/part name (e.g. "Adagio") + $04 is events (e.g. "Don Quijote enters the stage") + $05 is chord (e.g. "Bb F Fsus") + $06 is trivia/'pop up' information + $07 is URLs to webpages + $08 is URLs to images + + Time stamp format: + + $01 Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit + $02 Absolute time, 32 bit sized, using milliseconds as unit + + Absolute time means that every stamp contains the time from the + beginning of the file. + + The text that follows the frame header differs from that of the + unsynchronised lyrics/text transcription in one major way. Each + syllable (or whatever size of text is considered to be convenient by + the encoder) is a null terminated string followed by a time stamp + denoting where in the sound file it belongs. Each sync thus has the + following structure: + + Terminated text to be synced (typically a syllable) + Sync identifier (terminator to above string) $00 (00) + Time stamp $xx (xx ...) + + The 'time stamp' is set to zero or the whole sync is omitted if + located directly at the beginning of the sound. All time stamps + should be sorted in chronological order. The sync can be considered + as a validator of the subsequent string. + + Newline characters are allowed in all "SYLT" frames and MUST be used + after every entry (name, event etc.) in a frame with the content type + $03 - $04. + + A few considerations regarding whitespace characters: Whitespace + separating words should mark the beginning of a new word, thus + occurring in front of the first syllable of a new word. This is also + valid for new line characters. A syllable followed by a comma should + not be broken apart with a sync (both the syllable and the comma + should be before the sync). + + An example: The "USLT" passage + + "Strangers in the night" $0A "Exchanging glances" + + would be "SYLT" encoded as: + + "Strang" $00 xx xx "ers" $00 xx xx " in" $00 xx xx " the" $00 xx xx + " night" $00 xx xx 0A "Ex" $00 xx xx "chang" $00 xx xx "ing" $00 xx + xx "glan" $00 xx xx "ces" $00 xx xx + + There may be more than one "SYLT" frame in each tag, but only one + with the same language and content descriptor. + + +4.10. Comments + + This frame is intended for any kind of full text information that + does not fit in any other frame. It consists of a frame header + followed by encoding, language and content descriptors and is ended + with the actual comment as a text string. Newline characters are + allowed in the comment text string. There may be more than one + comment frame in each tag, but only one with the same language and + content descriptor. + +
+ Text encoding $xx + Language $xx xx xx + Short content descrip. $00 (00) + The actual text + + +4.11. Relative volume adjustment (2) + + This is a more subjective frame than the previous ones. It allows the + user to say how much he wants to increase/decrease the volume on each + channel when the file is played. The purpose is to be able to align + all files to a reference volume, so that you don't have to change the + volume constantly. This frame may also be used to balance adjust the + audio. The volume adjustment is encoded as a fixed point decibel + value, 16 bit signed integer representing (adjustment*512), giving + +/- 64 dB with a precision of 0.001953125 dB. E.g. +2 dB is stored as + $04 00 and -2 dB is $FC 00. There may be more than one "RVA2" frame + in each tag, but only one with the same identification string. + +
+ Identification $00 + + The 'identification' string is used to identify the situation and/or + device where this adjustment should apply. The following is then + repeated for every channel + + Type of channel $xx + Volume adjustment $xx xx + Bits representing peak $xx + Peak volume $xx (xx ...) + + + Type of channel: $00 Other + $01 Master volume + $02 Front right + $03 Front left + $04 Back right + $05 Back left + $06 Front centre + $07 Back centre + $08 Subwoofer + + Bits representing peak can be any number between 0 and 255. 0 means + that there is no peak volume field. The peak volume field is always + padded to whole bytes, setting the most significant bits to zero. + + +4.12. Equalisation (2) + + This is another subjective, alignment frame. It allows the user to + predefine an equalisation curve within the audio file. There may be + more than one "EQU2" frame in each tag, but only one with the same + identification string. + +
+ Interpolation method $xx + Identification $00 + + The 'interpolation method' describes which method is preferred when + an interpolation between the adjustment point that follows. The + following methods are currently defined: + + $00 Band + No interpolation is made. A jump from one adjustment level to + another occurs in the middle between two adjustment points. + $01 Linear + Interpolation between adjustment points is linear. + + The 'identification' string is used to identify the situation and/or + device where this adjustment should apply. The following is then + repeated for every adjustment point + + Frequency $xx xx + Volume adjustment $xx xx + + The frequency is stored in units of 1/2 Hz, giving it a range from 0 + to 32767 Hz. + + The volume adjustment is encoded as a fixed point decibel value, 16 + bit signed integer representing (adjustment*512), giving +/- 64 dB + with a precision of 0.001953125 dB. E.g. +2 dB is stored as $04 00 + and -2 dB is $FC 00. + + Adjustment points should be ordered by frequency and one frequency + should only be described once in the frame. + + +4.13. Reverb + + Yet another subjective frame, with which you can adjust echoes of + different kinds. Reverb left/right is the delay between every bounce + in ms. Reverb bounces left/right is the number of bounces that should + be made. $FF equals an infinite number of bounces. Feedback is the + amount of volume that should be returned to the next echo bounce. $00 + is 0%, $FF is 100%. If this value were $7F, there would be 50% volume + reduction on the first bounce, 50% of that on the second and so on. + Left to left means the sound from the left bounce to be played in the + left speaker, while left to right means sound from the left bounce to + be played in the right speaker. + + 'Premix left to right' is the amount of left sound to be mixed in the + right before any reverb is applied, where $00 id 0% and $FF is 100%. + 'Premix right to left' does the same thing, but right to left. + Setting both premix to $FF would result in a mono output (if the + reverb is applied symmetric). There may only be one "RVRB" frame in + each tag. + +
+ Reverb left (ms) $xx xx + Reverb right (ms) $xx xx + Reverb bounces, left $xx + Reverb bounces, right $xx + Reverb feedback, left to left $xx + Reverb feedback, left to right $xx + Reverb feedback, right to right $xx + Reverb feedback, right to left $xx + Premix left to right $xx + Premix right to left $xx + + +4.14. Attached picture + + This frame contains a picture directly related to the audio file. + Image format is the MIME type and subtype [MIME] for the image. In + the event that the MIME media type name is omitted, "image/" will be + implied. The "image/png" [PNG] or "image/jpeg" [JFIF] picture format + should be used when interoperability is wanted. Description is a + short description of the picture, represented as a terminated + text string. There may be several pictures attached to one file, each + in their individual "APIC" frame, but only one with the same content + descriptor. There may only be one picture with the picture type + declared as picture type $01 and $02 respectively. There is the + possibility to put only a link to the image file by using the 'MIME + type' "-->" and having a complete URL [URL] instead of picture data. + The use of linked files should however be used sparingly since there + is the risk of separation of files. + +
+ Text encoding $xx + MIME type $00 + Picture type $xx + Description $00 (00) + Picture data + + + Picture type: $00 Other + $01 32x32 pixels 'file icon' (PNG only) + $02 Other file icon + $03 Cover (front) + $04 Cover (back) + $05 Leaflet page + $06 Media (e.g. label side of CD) + $07 Lead artist/lead performer/soloist + $08 Artist/performer + $09 Conductor + $0A Band/Orchestra + $0B Composer + $0C Lyricist/text writer + $0D Recording Location + $0E During recording + $0F During performance + $10 Movie/video screen capture + $11 A bright coloured fish + $12 Illustration + $13 Band/artist logotype + $14 Publisher/Studio logotype + + +4.15. General encapsulated object + + In this frame any type of file can be encapsulated. After the header, + 'Frame size' and 'Encoding' follows 'MIME type' [MIME] represented as + as a terminated string encoded with ISO 8859-1 [ISO-8859-1]. The + filename is case sensitive and is encoded as 'Encoding'. Then follows + a content description as terminated string, encoded as 'Encoding'. + The last thing in the frame is the actual object. The first two + strings may be omitted, leaving only their terminations. MIME type is + always an ISO-8859-1 text string. There may be more than one "GEOB" + frame in each tag, but only one with the same content descriptor. + +
+ Text encoding $xx + MIME type $00 + Filename $00 (00) + Content description $00 (00) + Encapsulated object + + +4.16. Play counter + + This is simply a counter of the number of times a file has been + played. The value is increased by one every time the file begins to + play. There may only be one "PCNT" frame in each tag. When the + counter reaches all one's, one byte is inserted in front of the + counter thus making the counter eight bits bigger. The counter must + be at least 32-bits long to begin with. + +
+ Counter $xx xx xx xx (xx ...) + + +4.17. Popularimeter + + The purpose of this frame is to specify how good an audio file is. + Many interesting applications could be found to this frame such as a + playlist that features better audio files more often than others or + it could be used to profile a person's taste and find other 'good' + files by comparing people's profiles. The frame contains the email + address to the user, one rating byte and a four byte play counter, + intended to be increased with one for every time the file is played. + The email is a terminated string. The rating is 1-255 where 1 is + worst and 255 is best. 0 is unknown. If no personal counter is wanted + it may be omitted. When the counter reaches all one's, one byte is + inserted in front of the counter thus making the counter eight bits + bigger in the same away as the play counter ("PCNT"). There may be + more than one "POPM" frame in each tag, but only one with the same + email address. + +
+ Email to user $00 + Rating $xx + Counter $xx xx xx xx (xx ...) + + +4.18. Recommended buffer size + + Sometimes the server from which an audio file is streamed is aware of + transmission or coding problems resulting in interruptions in the + audio stream. In these cases, the size of the buffer can be + recommended by the server using this frame. If the 'embedded info + flag' is true (1) then this indicates that an ID3 tag with the + maximum size described in 'Buffer size' may occur in the audio + stream. In such case the tag should reside between two MPEG [MPEG] + frames, if the audio is MPEG encoded. If the position of the next tag + is known, 'offset to next tag' may be used. The offset is calculated + from the end of tag in which this frame resides to the first byte of + the header in the next. This field may be omitted. Embedded tags are + generally not recommended since this could render unpredictable + behaviour from present software/hardware. + + For applications like streaming audio it might be an idea to embed + tags into the audio stream though. If the clients connects to + individual connections like HTTP and there is a possibility to begin + every transmission with a tag, then this tag should include a + 'recommended buffer size' frame. If the client is connected to a + arbitrary point in the stream, such as radio or multicast, then the + 'recommended buffer size' frame SHOULD be included in every tag. + + The 'Buffer size' should be kept to a minimum. There may only be one + "RBUF" frame in each tag. + +
+ Buffer size $xx xx xx + Embedded info flag %0000000x + Offset to next tag $xx xx xx xx + + +4.19. Audio encryption + + This frame indicates if the actual audio stream is encrypted, and by + whom. Since standardisation of such encryption scheme is beyond this + document, all "AENC" frames begin with a terminated string with a + URL containing an email address, or a link to a location where an + email address can be found, that belongs to the organisation + responsible for this specific encrypted audio file. Questions + regarding the encrypted audio should be sent to the email address + specified. If a $00 is found directly after the 'Frame size' and the + audio file indeed is encrypted, the whole file may be considered + useless. + + After the 'Owner identifier', a pointer to an unencrypted part of the + audio can be specified. The 'Preview start' and 'Preview length' is + described in frames. If no part is unencrypted, these fields should + be left zeroed. After the 'preview length' field follows optionally a + data block required for decryption of the audio. There may be more + than one "AENC" frames in a tag, but only one with the same 'Owner + identifier'. + +
+ Owner identifier $00 + Preview start $xx xx + Preview length $xx xx + Encryption info + + +4.20. Linked information + + To keep information duplication as low as possible this frame may be + used to link information from another ID3v2 tag that might reside in + another audio file or alone in a binary file. It is RECOMMENDED that + this method is only used when the files are stored on a CD-ROM or + other circumstances when the risk of file separation is low. The + frame contains a frame identifier, which is the frame that should be + linked into this tag, a URL [URL] field, where a reference to the + file where the frame is given, and additional ID data, if needed. + Data should be retrieved from the first tag found in the file to + which this link points. There may be more than one "LINK" frame in a + tag, but only one with the same contents. A linked frame is to be + considered as part of the tag and has the same restrictions as if it + was a physical part of the tag (i.e. only one "RVRB" frame allowed, + whether it's linked or not). + +
+ Frame identifier $xx xx xx xx + URL $00 + ID and additional data + + Frames that may be linked and need no additional data are "ASPI", + "ETCO", "EQU2", "MCID", "MLLT", "OWNE", "RVA2", "RVRB", "SYTC", the + text information frames and the URL link frames. + + The "AENC", "APIC", "GEOB" and "TXXX" frames may be linked with + the content descriptor as additional ID data. + + The "USER" frame may be linked with the language field as additional + ID data. + + The "PRIV" frame may be linked with the owner identifier as + additional ID data. + + The "COMM", "SYLT" and "USLT" frames may be linked with three bytes + of language descriptor directly followed by a content descriptor as + additional ID data. + + +4.21. Position synchronisation frame + + This frame delivers information to the listener of how far into the + audio stream he picked up; in effect, it states the time offset from + the first frame in the stream. The frame layout is: + + + Time stamp format $xx + Position $xx (xx ...) + + Where time stamp format is: + + $01 Absolute time, 32 bit sized, using MPEG frames as unit + $02 Absolute time, 32 bit sized, using milliseconds as unit + + and position is where in the audio the listener starts to receive, + i.e. the beginning of the next frame. If this frame is used in the + beginning of a file the value is always 0. There may only be one + "POSS" frame in each tag. + + +4.22. Terms of use frame + + This frame contains a brief description of the terms of use and + ownership of the file. More detailed information concerning the legal + terms might be available through the "WCOP" frame. Newlines are + allowed in the text. There may be more than one 'Terms of use' frame + in a tag, but only one with the same 'Language'. + +
+ Text encoding $xx + Language $xx xx xx + The actual text + + +4.23. Ownership frame + + The ownership frame might be used as a reminder of a made transaction + or, if signed, as proof. Note that the "USER" and "TOWN" frames are + good to use in conjunction with this one. The frame begins, after the + frame ID, size and encoding fields, with a 'price paid' field. The + first three characters of this field contains the currency used for + the transaction, encoded according to ISO 4217 [ISO-4217] alphabetic + currency code. Concatenated to this is the actual price paid, as a + numerical string using "." as the decimal separator. Next is an 8 + character date string (YYYYMMDD) followed by a string with the name + of the seller as the last field in the frame. There may only be one + "OWNE" frame in a tag. + +
+ Text encoding $xx + Price paid $00 + Date of purch. + Seller + + +4.24. Commercial frame + + This frame enables several competing offers in the same tag by + bundling all needed information. That makes this frame rather complex + but it's an easier solution than if one tries to achieve the same + result with several frames. The frame begins, after the frame ID, + size and encoding fields, with a price string field. A price is + constructed by one three character currency code, encoded according + to ISO 4217 [ISO-4217] alphabetic currency code, followed by a + numerical value where "." is used as decimal separator. In the price + string several prices may be concatenated, separated by a "/" + character, but there may only be one currency of each type. + + The price string is followed by an 8 character date string in the + format YYYYMMDD, describing for how long the price is valid. After + that is a contact URL, with which the user can contact the seller, + followed by a one byte 'received as' field. It describes how the + audio is delivered when bought according to the following list: + + $00 Other + $01 Standard CD album with other songs + $02 Compressed audio on CD + $03 File over the Internet + $04 Stream over the Internet + $05 As note sheets + $06 As note sheets in a book with other sheets + $07 Music on other media + $08 Non-musical merchandise + + Next follows a terminated string with the name of the seller followed + by a terminated string with a short description of the product. The + last thing is the ability to include a company logotype. The first of + them is the 'Picture MIME type' field containing information about + which picture format is used. In the event that the MIME media type + name is omitted, "image/" will be implied. Currently only "image/png" + and "image/jpeg" are allowed. This format string is followed by the + binary picture data. This two last fields may be omitted if no + picture is attached. There may be more than one 'commercial frame' in + a tag, but no two may be identical. + +
+ Text encoding $xx + Price string $00 + Valid until + Contact URL $00 + Received as $xx + Name of seller $00 (00) + Description $00 (00) + Picture MIME type $00 + Seller logo + + +4.25. Encryption method registration + + To identify with which method a frame has been encrypted the + encryption method must be registered in the tag with this frame. The + 'Owner identifier' is a null-terminated string with a URL [URL] + containing an email address, or a link to a location where an email + address can be found, that belongs to the organisation responsible + for this specific encryption method. Questions regarding the + encryption method should be sent to the indicated email address. The + 'Method symbol' contains a value that is associated with this method + throughout the whole tag, in the range $80-F0. All other values are + reserved. The 'Method symbol' may optionally be followed by + encryption specific data. There may be several "ENCR" frames in a tag + but only one containing the same symbol and only one containing the + same owner identifier. The method must be used somewhere in the tag. + See the description of the frame encryption flag in the ID3v2 + structure document [ID3v2-strct] for more information. + +
+ Owner identifier $00 + Method symbol $xx + Encryption data + + +4.26. Group identification registration + + This frame enables grouping of otherwise unrelated frames. This can + be used when some frames are to be signed. To identify which frames + belongs to a set of frames a group identifier must be registered in + the tag with this frame. The 'Owner identifier' is a null-terminated + string with a URL [URL] containing an email address, or a link to a + location where an email address can be found, that belongs to the + organisation responsible for this grouping. Questions regarding the + grouping should be sent to the indicated email address. The 'Group + symbol' contains a value that associates the frame with this group + throughout the whole tag, in the range $80-F0. All other values are + reserved. The 'Group symbol' may optionally be followed by some group + specific data, e.g. a digital signature. There may be several "GRID" + frames in a tag but only one containing the same symbol and only one + containing the same owner identifier. The group symbol must be used + somewhere in the tag. See the description of the frame grouping flag + in the ID3v2 structure document [ID3v2-strct] for more information. + +
+ Owner identifier $00 + Group symbol $xx + Group dependent data + + +4.27. Private frame + + This frame is used to contain information from a software producer + that its program uses and does not fit into the other frames. The + frame consists of an 'Owner identifier' string and the binary data. + The 'Owner identifier' is a null-terminated string with a URL [URL] + containing an email address, or a link to a location where an email + address can be found, that belongs to the organisation responsible + for the frame. Questions regarding the frame should be sent to the + indicated email address. The tag may contain more than one "PRIV" + frame but only with different contents. + +
+ Owner identifier $00 + The private data + + +4.28. Signature frame + + This frame enables a group of frames, grouped with the 'Group + identification registration', to be signed. Although signatures can + reside inside the registration frame, it might be desired to store + the signature elsewhere, e.g. in watermarks. There may be more than + one 'signature frame' in a tag, but no two may be identical. + +
+ Group symbol $xx + Signature + + +4.29. Seek frame + + This frame indicates where other tags in a file/stream can be found. + The 'minimum offset to next tag' is calculated from the end of this + tag to the beginning of the next. There may only be one 'seek frame' + in a tag. + +
+ Minimum offset to next tag $xx xx xx xx + + +4.30. Audio seek point index + + Audio files with variable bit rates are intrinsically difficult to + deal with in the case of seeking within the file. The ASPI frame + makes seeking easier by providing a list a seek points within the + audio file. The seek points are a fractional offset within the audio + data, providing a starting point from which to find an appropriate + point to start decoding. The presence of an ASPI frame requires the + existence of a TLEN frame, indicating the duration of the file in + milliseconds. There may only be one 'audio seek point index' frame in + a tag. + +
+ Indexed data start (S) $xx xx xx xx + Indexed data length (L) $xx xx xx xx + Number of index points (N) $xx xx + Bits per index point (b) $xx + + Then for every index point the following data is included; + + Fraction at index (Fi) $xx (xx) + + 'Indexed data start' is a byte offset from the beginning of the file. + 'Indexed data length' is the byte length of the audio data being + indexed. 'Number of index points' is the number of index points, as + the name implies. The recommended number is 100. 'Bits per index + point' is 8 or 16, depending on the chosen precision. 8 bits works + well for short files (less than 5 minutes of audio), while 16 bits is + advantageous for long files. 'Fraction at index' is the numerator of + the fraction representing a relative position in the data. The + denominator is 2 to the power of b. + + Here are the algorithms to be used in the calculation. The known data + must be the offset of the start of the indexed data (S), the offset + of the end of the indexed data (E), the number of index points (N), + the offset at index i (Oi). We calculate the fraction at index i + (Fi). + + Oi is the offset of the frame whose start is soonest after the point + for which the time offset is (i/N * duration). + + The frame data should be calculated as follows: + + Fi = Oi/L * 2^b (rounded down to the nearest integer) + + Offset calculation should be calculated as follows from data in the + frame: + + Oi = (Fi/2^b)*L (rounded up to the nearest integer) + + +5. Copyright + + Copyright (C) Martin Nilsson 2000. All Rights Reserved. + + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it + or assist in its implementation may be prepared, copied, published + and distributed, in whole or in part, without restriction of any + kind, provided that a reference to this document is included on all + such copies and derivative works. However, this document itself may + not be modified in any way and reissued as the original document. + + The limited permissions granted above are perpetual and will not be + revoked. + + This document and the information contained herein is provided on an + "AS IS" basis and THE AUTHORS DISCLAIMS ALL WARRANTIES, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF + THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED + WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + + +6. References + + [CDDB] Compact Disc Data Base + + + + [ID3v2.3.0] Martin Nilsson, "ID3v2 informal standard". + + + + [ID3v2-strct] Martin Nilsson, + "ID3 tag version 2.4.0 - Main Structure" + + + + [ISO-639-2] ISO/FDIS 639-2. + Codes for the representation of names of languages, Part 2: Alpha-3 + code. Technical committee / subcommittee: TC 37 / SC 2 + + [ISO-4217] ISO 4217:1995. + Codes for the representation of currencies and funds. + Technical committee / subcommittee: TC 68 + + [ISO-8859-1] ISO/IEC DIS 8859-1. + 8-bit single-byte coded graphic character sets, Part 1: Latin + alphabet No. 1. Technical committee / subcommittee: JTC 1 / SC 2 + + [ISRC] ISO 3901:1986 + International Standard Recording Code (ISRC). + Technical committee / subcommittee: TC 46 / SC 9 + + [JFIF] JPEG File Interchange Format, version 1.02 + + + + [KEYWORDS] S. Bradner, 'Key words for use in RFCs to Indicate + Requirement Levels', RFC 2119, March 1997. + + + + [MIME] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part One: Format of Internet Message Bodies", + RFC 2045, November 1996. + + + + [MPEG] ISO/IEC 11172-3:1993. + Coding of moving pictures and associated audio for digital storage + media at up to about 1,5 Mbit/s, Part 3: Audio. + Technical committee / subcommittee: JTC 1 / SC 29 + and + ISO/IEC 13818-3:1995 + Generic coding of moving pictures and associated audio information, + Part 3: Audio. + Technical committee / subcommittee: JTC 1 / SC 29 + and + ISO/IEC DIS 13818-3 + Generic coding of moving pictures and associated audio information, + Part 3: Audio (Revision of ISO/IEC 13818-3:1995) + + + [PNG] Portable Network Graphics, version 1.0 + + + + [URL] T. Berners-Lee, L. Masinter & M. McCahill, "Uniform Resource + Locators (URL).", RFC 1738, December 1994. + + + + [ZLIB] P. Deutsch, Aladdin Enterprises & J-L. Gailly, "ZLIB + Compressed + Data Format Specification version 3.3", RFC 1950, May 1996. + + + + +7. Appendix + + +A. Appendix A - Genre List from ID3v1 + + The following genres is defined in ID3v1 + + 0.Blues + 1.Classic Rock + 2.Country + 3.Dance + 4.Disco + 5.Funk + 6.Grunge + 7.Hip-Hop + 8.Jazz + 9.Metal + 10.New Age + 11.Oldies + 12.Other + 13.Pop + 14.R&B + 15.Rap + 16.Reggae + 17.Rock + 18.Techno + 19.Industrial + 20.Alternative + 21.Ska + 22.Death Metal + 23.Pranks + 24.Soundtrack + 25.Euro-Techno + 26.Ambient + 27.Trip-Hop + 28.Vocal + 29.Jazz+Funk + 30.Fusion + 31.Trance + 32.Classical + 33.Instrumental + 34.Acid + 35.House + 36.Game + 37.Sound Clip + 38.Gospel + 39.Noise + 40.AlternRock + 41.Bass + 42.Soul + 43.Punk + 44.Space + 45.Meditative + 46.Instrumental Pop + 47.Instrumental Rock + 48.Ethnic + 49.Gothic + 50.Darkwave + 51.Techno-Industrial + 52.Electronic + 53.Pop-Folk + 54.Eurodance + 55.Dream + 56.Southern Rock + 57.Comedy + 58.Cult + 59.Gangsta + 60.Top 40 + 61.Christian Rap + 62.Pop/Funk + 63.Jungle + 64.Native American + 65.Cabaret + 66.New Wave + 67.Psychadelic + 68.Rave + 69.Showtunes + 70.Trailer + 71.Lo-Fi + 72.Tribal + 73.Acid Punk + 74.Acid Jazz + 75.Polka + 76.Retro + 77.Musical + 78.Rock & Roll + 79.Hard Rock + + +8. Author's Address + + Written by + + Martin Nilsson + Rydsvägen 246 C. 30 + SE-584 34 Linköping + Sweden + + Email: nilsson@id3.org diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/id3v2.4.0-structure.txt b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/id3v2.4.0-structure.txt new file mode 100644 index 0000000..5fa156a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/Resources/id3v2.4.0-structure.txt @@ -0,0 +1,733 @@ + +Informal standard M. Nilsson +Document: id3v2.4.0-structure.txt 16 September 2001 + + + ID3 tag version 2.4.0 - Main Structure + +Status of this document + + This document is an informal standard and replaces the ID3v2.3.0 + standard [ID3v2]. A formal standard will use another revision number + even if the content is identical to document. The contents in this + document may change for clarifications but never for added or altered + functionallity. + + Distribution of this document is unlimited. + + +Abstract + + This document describes the main structure of ID3v2.4.0, which is a + revised version of the ID3v2 informal standard [ID3v2] version + 2.3.0. The ID3v2 offers a flexible way of storing audio meta + information within the audio file itself. The information may be + technical information, such as equalisation curves, as well as + title, performer, copyright etc. + + ID3v2.4.0 is meant to be as close as possible to ID3v2.3.0 in order + to allow for implementations to be revised as easily as possible. + + +1. Table of contents + + Status of this document + Abstract + 1. Table of contents + 2. Conventions in this document + 2. Standard overview + 3. ID3v2 overview + 3.1. ID3v2 header + 3.2. ID3v2 extended header + 3.3. Padding + 3.4. ID3v2 footer + 4. ID3v2 frames overview + 4.1. Frame header flags + 4.1.1. Frame status flags + 4.1.2. Frame format flags + 5. Tag location + 6. Unsynchronisation + 6.1. The unsynchronisation scheme + 6.2. Synchsafe integers + 7. Copyright + 8. References + 9. Author's Address + + +2. Conventions in this document + + Text within "" is a text string exactly as it appears in a tag. + Numbers preceded with $ are hexadecimal and numbers preceded with % + are binary. $xx is used to indicate a byte with unknown content. %x + is used to indicate a bit with unknown content. The most significant + bit (MSB) of a byte is called 'bit 7' and the least significant bit + (LSB) is called 'bit 0'. + + A tag is the whole tag described in this document. A frame is a block + of information in the tag. The tag consists of a header, frames and + optional padding. A field is a piece of information; one value, a + string etc. A numeric string is a string that consists of the + characters "0123456789" only. + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + document are to be interpreted as described in RFC 2119 [KEYWORDS]. + + +3. ID3v2 overview + + ID3v2 is a general tagging format for audio, which makes it possible + to store meta data about the audio inside the audio file itself. The + ID3 tag described in this document is mainly targeted at files + encoded with MPEG-1/2 layer I, MPEG-1/2 layer II, MPEG-1/2 layer III + and MPEG-2.5, but may work with other types of encoded audio or as a + stand alone format for audio meta data. + + ID3v2 is designed to be as flexible and expandable as possible to + meet new meta information needs that might arise. To achieve that + ID3v2 is constructed as a container for several information blocks, + called frames, whose format need not be known to the software that + encounters them. At the start of every frame is an unique and + predefined identifier, a size descriptor that allows software to skip + unknown frames and a flags field. The flags describes encoding + details and if the frame should remain in the tag, should it be + unknown to the software, if the file is altered. + + The bitorder in ID3v2 is most significant bit first (MSB). The + byteorder in multibyte numbers is most significant byte first (e.g. + $12345678 would be encoded $12 34 56 78), also known as big endian + and network byte order. + + Overall tag structure: + + +-----------------------------+ + | Header (10 bytes) | + +-----------------------------+ + | Extended Header | + | (variable length, OPTIONAL) | + +-----------------------------+ + | Frames (variable length) | + +-----------------------------+ + | Padding | + | (variable length, OPTIONAL) | + +-----------------------------+ + | Footer (10 bytes, OPTIONAL) | + +-----------------------------+ + + In general, padding and footer are mutually exclusive. See details in + sections 3.3, 3.4 and 5. + + +3.1. ID3v2 header + + The first part of the ID3v2 tag is the 10 byte tag header, laid out + as follows: + + ID3v2/file identifier "ID3" + ID3v2 version $04 00 + ID3v2 flags %abcd0000 + ID3v2 size 4 * %0xxxxxxx + + The first three bytes of the tag are always "ID3", to indicate that + this is an ID3v2 tag, directly followed by the two version bytes. The + first byte of ID3v2 version is its major version, while the second + byte is its revision number. In this case this is ID3v2.4.0. All + revisions are backwards compatible while major versions are not. If + software with ID3v2.4.0 and below support should encounter version + five or higher it should simply ignore the whole tag. Version or + revision will never be $FF. + + The version is followed by the ID3v2 flags field, of which currently + four flags are used. + + + a - Unsynchronisation + + Bit 7 in the 'ID3v2 flags' indicates whether or not + unsynchronisation is applied on all frames (see section 6.1 for + details); a set bit indicates usage. + + + b - Extended header + + The second bit (bit 6) indicates whether or not the header is + followed by an extended header. The extended header is described in + section 3.2. A set bit indicates the presence of an extended + header. + + + c - Experimental indicator + + The third bit (bit 5) is used as an 'experimental indicator'. This + flag SHALL always be set when the tag is in an experimental stage. + + + d - Footer present + + Bit 4 indicates that a footer (section 3.4) is present at the very + end of the tag. A set bit indicates the presence of a footer. + + + All the other flags MUST be cleared. If one of these undefined flags + are set, the tag might not be readable for a parser that does not + know the flags function. + + The ID3v2 tag size is stored as a 32 bit synchsafe integer (section + 6.2), making a total of 28 effective bits (representing up to 256MB). + + The ID3v2 tag size is the sum of the byte length of the extended + header, the padding and the frames after unsynchronisation. If a + footer is present this equals to ('total size' - 20) bytes, otherwise + ('total size' - 10) bytes. + + An ID3v2 tag can be detected with the following pattern: + $49 44 33 yy yy xx zz zz zz zz + Where yy is less than $FF, xx is the 'flags' byte and zz is less than + $80. + + +3.2. Extended header + + The extended header contains information that can provide further + insight in the structure of the tag, but is not vital to the correct + parsing of the tag information; hence the extended header is + optional. + + Extended header size 4 * %0xxxxxxx + Number of flag bytes $01 + Extended Flags $xx + + Where the 'Extended header size' is the size of the whole extended + header, stored as a 32 bit synchsafe integer. An extended header can + thus never have a size of fewer than six bytes. + + The extended flags field, with its size described by 'number of flag + bytes', is defined as: + + %0bcd0000 + + Each flag that is set in the extended header has data attached, which + comes in the order in which the flags are encountered (i.e. the data + for flag 'b' comes before the data for flag 'c'). Unset flags cannot + have any attached data. All unknown flags MUST be unset and their + corresponding data removed when a tag is modified. + + Every set flag's data starts with a length byte, which contains a + value between 0 and 127 ($00 - $7f), followed by data that has the + field length indicated by the length byte. If a flag has no attached + data, the value $00 is used as length byte. + + + b - Tag is an update + + If this flag is set, the present tag is an update of a tag found + earlier in the present file or stream. If frames defined as unique + are found in the present tag, they are to override any + corresponding ones found in the earlier tag. This flag has no + corresponding data. + + Flag data length $00 + + c - CRC data present + + If this flag is set, a CRC-32 [ISO-3309] data is included in the + extended header. The CRC is calculated on all the data between the + header and footer as indicated by the header's tag length field, + minus the extended header. Note that this includes the padding (if + there is any), but excludes the footer. The CRC-32 is stored as an + 35 bit synchsafe integer, leaving the upper four bits always + zeroed. + + Flag data length $05 + Total frame CRC 5 * %0xxxxxxx + + d - Tag restrictions + + For some applications it might be desired to restrict a tag in more + ways than imposed by the ID3v2 specification. Note that the + presence of these restrictions does not affect how the tag is + decoded, merely how it was restricted before encoding. If this flag + is set the tag is restricted as follows: + + Flag data length $01 + Restrictions %ppqrrstt + + p - Tag size restrictions + + 00 No more than 128 frames and 1 MB total tag size. + 01 No more than 64 frames and 128 KB total tag size. + 10 No more than 32 frames and 40 KB total tag size. + 11 No more than 32 frames and 4 KB total tag size. + + q - Text encoding restrictions + + 0 No restrictions + 1 Strings are only encoded with ISO-8859-1 [ISO-8859-1] or + UTF-8 [UTF-8]. + + r - Text fields size restrictions + + 00 No restrictions + 01 No string is longer than 1024 characters. + 10 No string is longer than 128 characters. + 11 No string is longer than 30 characters. + + Note that nothing is said about how many bytes is used to + represent those characters, since it is encoding dependent. If a + text frame consists of more than one string, the sum of the + strungs is restricted as stated. + + s - Image encoding restrictions + + 0 No restrictions + 1 Images are encoded only with PNG [PNG] or JPEG [JFIF]. + + t - Image size restrictions + + 00 No restrictions + 01 All images are 256x256 pixels or smaller. + 10 All images are 64x64 pixels or smaller. + 11 All images are exactly 64x64 pixels, unless required + otherwise. + + +3.3. Padding + + It is OPTIONAL to include padding after the final frame (at the end + of the ID3 tag), making the size of all the frames together smaller + than the size given in the tag header. A possible purpose of this + padding is to allow for adding a few additional frames or enlarge + existing frames within the tag without having to rewrite the entire + file. The value of the padding bytes must be $00. A tag MUST NOT have + any padding between the frames or between the tag header and the + frames. Furthermore it MUST NOT have any padding when a tag footer is + added to the tag. + + +3.4. ID3v2 footer + + To speed up the process of locating an ID3v2 tag when searching from + the end of a file, a footer can be added to the tag. It is REQUIRED + to add a footer to an appended tag, i.e. a tag located after all + audio data. The footer is a copy of the header, but with a different + identifier. + + ID3v2 identifier "3DI" + ID3v2 version $04 00 + ID3v2 flags %abcd0000 + ID3v2 size 4 * %0xxxxxxx + + +4. ID3v2 frame overview + + All ID3v2 frames consists of one frame header followed by one or more + fields containing the actual information. The header is always 10 + bytes and laid out as follows: + + Frame ID $xx xx xx xx (four characters) + Size 4 * %0xxxxxxx + Flags $xx xx + + The frame ID is made out of the characters capital A-Z and 0-9. + Identifiers beginning with "X", "Y" and "Z" are for experimental + frames and free for everyone to use, without the need to set the + experimental bit in the tag header. Bear in mind that someone else + might have used the same identifier as you. All other identifiers are + either used or reserved for future use. + + The frame ID is followed by a size descriptor containing the size of + the data in the final frame, after encryption, compression and + unsynchronisation. The size is excluding the frame header ('total + frame size' - 10 bytes) and stored as a 32 bit synchsafe integer. + + In the frame header the size descriptor is followed by two flag + bytes. These flags are described in section 4.1. + + There is no fixed order of the frames' appearance in the tag, + although it is desired that the frames are arranged in order of + significance concerning the recognition of the file. An example of + such order: UFID, TIT2, MCDI, TRCK ... + + A tag MUST contain at least one frame. A frame must be at least 1 + byte big, excluding the header. + + If nothing else is said, strings, including numeric strings and URLs + [URL], are represented as ISO-8859-1 [ISO-8859-1] characters in the + range $20 - $FF. Such strings are represented in frame descriptions + as , or if newlines are allowed. If + nothing else is said newline character is forbidden. In ISO-8859-1 a + newline is represented, when allowed, with $0A only. + + Frames that allow different types of text encoding contains a text + encoding description byte. Possible encodings: + + $00 ISO-8859-1 [ISO-8859-1]. Terminated with $00. + $01 UTF-16 [UTF-16] encoded Unicode [UNICODE] with BOM. All + strings in the same frame SHALL have the same byteorder. + Terminated with $00 00. + $02 UTF-16BE [UTF-16] encoded Unicode [UNICODE] without BOM. + Terminated with $00 00. + $03 UTF-8 [UTF-8] encoded Unicode [UNICODE]. Terminated with $00. + + Strings dependent on encoding are represented in frame descriptions + as , or if newlines are allowed. Any empty strings of + type $01 which are NULL-terminated may have the Unicode BOM followed + by a Unicode NULL ($FF FE 00 00 or $FE FF 00 00). + + The timestamp fields are based on a subset of ISO 8601. When being as + precise as possible the format of a time string is + yyyy-MM-ddTHH:mm:ss (year, "-", month, "-", day, "T", hour (out of + 24), ":", minutes, ":", seconds), but the precision may be reduced by + removing as many time indicators as wanted. Hence valid timestamps + are + yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddTHH, yyyy-MM-ddTHH:mm and + yyyy-MM-ddTHH:mm:ss. All time stamps are UTC. For durations, use + the slash character as described in 8601, and for multiple non- + contiguous dates, use multiple strings, if allowed by the frame + definition. + + The three byte language field, present in several frames, is used to + describe the language of the frame's content, according to ISO-639-2 + [ISO-639-2]. The language should be represented in lower case. If the + language is not known the string "XXX" should be used. + + All URLs [URL] MAY be relative, e.g. "picture.png", "../doc.txt". + + If a frame is longer than it should be, e.g. having more fields than + specified in this document, that indicates that additions to the + frame have been made in a later version of the ID3v2 standard. This + is reflected by the revision number in the header of the tag. + + +4.1. Frame header flags + + In the frame header the size descriptor is followed by two flag + bytes. All unused flags MUST be cleared. The first byte is for + 'status messages' and the second byte is a format description. If an + unknown flag is set in the first byte the frame MUST NOT be changed + without that bit cleared. If an unknown flag is set in the second + byte the frame is likely to not be readable. Some flags in the second + byte indicates that extra information is added to the header. These + fields of extra information is ordered as the flags that indicates + them. The flags field is defined as follows (l and o left out because + ther resemblence to one and zero): + + %0abc0000 %0h00kmnp + + Some frame format flags indicate that additional information fields + are added to the frame. This information is added after the frame + header and before the frame data in the same order as the flags that + indicates them. I.e. the four bytes of decompressed size will precede + the encryption method byte. These additions affects the 'frame size' + field, but are not subject to encryption or compression. + + The default status flags setting for a frame is, unless stated + otherwise, 'preserved if tag is altered' and 'preserved if file is + altered', i.e. %00000000. + + +4.1.1. Frame status flags + + a - Tag alter preservation + + This flag tells the tag parser what to do with this frame if it is + unknown and the tag is altered in any way. This applies to all + kinds of alterations, including adding more padding and reordering + the frames. + + 0 Frame should be preserved. + 1 Frame should be discarded. + + + b - File alter preservation + + This flag tells the tag parser what to do with this frame if it is + unknown and the file, excluding the tag, is altered. This does not + apply when the audio is completely replaced with other audio data. + + 0 Frame should be preserved. + 1 Frame should be discarded. + + + c - Read only + + This flag, if set, tells the software that the contents of this + frame are intended to be read only. Changing the contents might + break something, e.g. a signature. If the contents are changed, + without knowledge of why the frame was flagged read only and + without taking the proper means to compensate, e.g. recalculating + the signature, the bit MUST be cleared. + + +4.1.2. Frame format flags + + h - Grouping identity + + This flag indicates whether or not this frame belongs in a group + with other frames. If set, a group identifier byte is added to the + frame. Every frame with the same group identifier belongs to the + same group. + + 0 Frame does not contain group information + 1 Frame contains group information + + + k - Compression + + This flag indicates whether or not the frame is compressed. + A 'Data Length Indicator' byte MUST be included in the frame. + + 0 Frame is not compressed. + 1 Frame is compressed using zlib [zlib] deflate method. + If set, this requires the 'Data Length Indicator' bit + to be set as well. + + + m - Encryption + + This flag indicates whether or not the frame is encrypted. If set, + one byte indicating with which method it was encrypted will be + added to the frame. See description of the ENCR frame for more + information about encryption method registration. Encryption + should be done after compression. Whether or not setting this flag + requires the presence of a 'Data Length Indicator' depends on the + specific algorithm used. + + 0 Frame is not encrypted. + 1 Frame is encrypted. + + n - Unsynchronisation + + This flag indicates whether or not unsynchronisation was applied + to this frame. See section 6 for details on unsynchronisation. + If this flag is set all data from the end of this header to the + end of this frame has been unsynchronised. Although desirable, the + presence of a 'Data Length Indicator' is not made mandatory by + unsynchronisation. + + 0 Frame has not been unsynchronised. + 1 Frame has been unsyrchronised. + + p - Data length indicator + + This flag indicates that a data length indicator has been added to + the frame. The data length indicator is the value one would write + as the 'Frame length' if all of the frame format flags were + zeroed, represented as a 32 bit synchsafe integer. + + 0 There is no Data Length Indicator. + 1 A data length Indicator has been added to the frame. + + +5. Tag location + + The default location of an ID3v2 tag is prepended to the audio so + that players can benefit from the information when the data is + streamed. It is however possible to append the tag, or make a + prepend/append combination. When deciding upon where an unembedded + tag should be located, the following order of preference SHOULD be + considered. + + 1. Prepend the tag. + + 2. Prepend a tag with all vital information and add a second tag at + the end of the file, before tags from other tagging systems. The + first tag is required to have a SEEK frame. + + 3. Add a tag at the end of the file, before tags from other tagging + systems. + + In case 2 and 3 the tag can simply be appended if no other known tags + are present. The suggested method to find ID3v2 tags are: + + 1. Look for a prepended tag using the pattern found in section 3.1. + + 2. If a SEEK frame was found, use its values to guide further + searching. + + 3. Look for a tag footer, scanning from the back of the file. + + For every new tag that is found, the old tag should be discarded + unless the update flag in the extended header (section 3.2) is set. + + +6. Unsynchronisation + + The only purpose of unsynchronisation is to make the ID3v2 tag as + compatible as possible with existing software and hardware. There is + no use in 'unsynchronising' tags if the file is only to be processed + only by ID3v2 aware software and hardware. Unsynchronisation is only + useful with tags in MPEG 1/2 layer I, II and III, MPEG 2.5 and AAC + files. + + +6.1. The unsynchronisation scheme + + Whenever a false synchronisation is found within the tag, one zeroed + byte is inserted after the first false synchronisation byte. The + format of synchronisations that should be altered by ID3 encoders is + as follows: + + %11111111 111xxxxx + + and should be replaced with: + + %11111111 00000000 111xxxxx + + This has the side effect that all $FF 00 combinations have to be + altered, so they will not be affected by the decoding process. + Therefore all the $FF 00 combinations have to be replaced with the + $FF 00 00 combination during the unsynchronisation. + + To indicate usage of the unsynchronisation, the unsynchronisation + flag in the frame header should be set. This bit MUST be set if the + frame was altered by the unsynchronisation and SHOULD NOT be set if + unaltered. If all frames in the tag are unsynchronised the + unsynchronisation flag in the tag header SHOULD be set. It MUST NOT + be set if the tag has a frame which is not unsynchronised. + + Assume the first byte of the audio to be $FF. The special case when + the last byte of the last frame is $FF and no padding nor footer is + used will then introduce a false synchronisation. This can be solved + by adding a footer, adding padding or unsynchronising the frame and + add $00 to the end of the frame data, thus adding more byte to the + frame size than a normal unsynchronisation would. Although not + preferred, it is allowed to apply the last method on all frames + ending with $FF. + + It is preferred that the tag is either completely unsynchronised or + not unsynchronised at all. A completely unsynchronised tag has no + false synchonisations in it, as defined above, and does not end with + $FF. A completely non-unsynchronised tag contains no unsynchronised + frames, and thus the unsynchronisation flag in the header is cleared. + + Do bear in mind, that if compression or encryption is used, the + unsynchronisation scheme MUST be applied afterwards. When decoding an + unsynchronised frame, the unsynchronisation scheme MUST be reversed + first, encryption and decompression afterwards. + + +6.2. Synchsafe integers + + In some parts of the tag it is inconvenient to use the + unsychronisation scheme because the size of unsynchronised data is + not known in advance, which is particularly problematic with size + descriptors. The solution in ID3v2 is to use synchsafe integers, in + which there can never be any false synchs. Synchsafe integers are + integers that keep its highest bit (bit 7) zeroed, making seven bits + out of eight available. Thus a 32 bit synchsafe integer can store 28 + bits of information. + + Example: + + 255 (%11111111) encoded as a 16 bit synchsafe integer is 383 + (%00000001 01111111). + + +7. Copyright + + Copyright (C) Martin Nilsson 2000. All Rights Reserved. + + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it + or assist in its implementation may be prepared, copied, published + and distributed, in whole or in part, without restriction of any + kind, provided that a reference to this document is included on all + such copies and derivative works. However, this document itself may + not be modified in any way and reissued as the original document. + + The limited permissions granted above are perpetual and will not be + revoked. + + This document and the information contained herein is provided on an + 'AS IS' basis and THE AUTHORS DISCLAIMS ALL WARRANTIES, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF + THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED + WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + + +8. References + + [ID3v2] Martin Nilsson, 'ID3v2 informal standard'. + + + + [ISO-639-2] ISO/FDIS 639-2. + 'Codes for the representation of names of languages, Part 2: Alpha-3 + code.' Technical committee / subcommittee: TC 37 / SC 2 + + [ISO-3309] ISO 3309 + 'Information Processing Systems--Data Communication High-Level Data + Link Control Procedure--Frame Structure', IS 3309, October 1984, 3rd + Edition. + + [ISO-8859-1] ISO/IEC DIS 8859-1. + '8-bit single-byte coded graphic character sets, Part 1: Latin + alphabet No. 1.' Technical committee / subcommittee: JTC 1 / SC 2 + + [JFIF] 'JPEG File Interchange Format, version 1.02' + + + + [KEYWORDS] S. Bradner, 'Key words for use in RFCs to Indicate + Requirement Levels', RFC 2119, March 1997. + + + + [MPEG] ISO/IEC 11172-3:1993. + 'Coding of moving pictures and associated audio for digital storage + media at up to about 1,5 Mbit/s, Part 3: Audio.' + Technical committee / subcommittee: JTC 1 / SC 29 + and + ISO/IEC 13818-3:1995 + 'Generic coding of moving pictures and associated audio information, + Part 3: Audio.' + Technical committee / subcommittee: JTC 1 / SC 29 + and + ISO/IEC DIS 13818-3 + 'Generic coding of moving pictures and associated audio information, + Part 3: Audio (Revision of ISO/IEC 13818-3:1995)' + + [PNG] 'Portable Network Graphics, version 1.0' + + + + [UNICODE] The Unicode Consortium, + 'The Unicode Standard Version 3.0', ISBN 0-201-61633-5. + + + + [URL] T. Berners-Lee, L. Masinter & M. McCahill, 'Uniform Resource + Locators (URL)', RFC 1738, December 1994. + + + + [UTF-8] F. Yergeau, 'UTF-8, a transformation format of ISO 10646', + RFC 2279, January 1998. + + + + [UTF-16] F. Yergeau, 'UTF-16, an encoding of ISO 10646', RFC 2781, + February 2000. + + + + [ZLIB] P. Deutsch, Aladdin Enterprises & J-L. Gailly, 'ZLIB + Compressed Data Format Specification version 3.3', RFC 1950, + May 1996. + + + + +9. Author's Address + + Written by + + Martin Nilsson + Rydsvägen 246 C. 30 + SE-584 34 Linköping + Sweden + + Email: nilsson@id3.org + diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/TagLib b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/TagLib new file mode 100644 index 0000000..ac07013 Binary files /dev/null and b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/A/TagLib differ diff --git a/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/Current b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/TagLib.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Audio-Frameworks/bin/taglib/headers/ape/apefile.h b/Audio-Frameworks/bin/taglib/headers/ape/apefile.h new file mode 100644 index 0000000..0bdbd42 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ape/apefile.h @@ -0,0 +1,198 @@ +/*************************************************************************** + copyright : (C) 2010 by Alex Novichkov + email : novichko@atnet.ru + + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + (original WavPack implementation) + + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + (original MPC implementation) + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_APEFILE_H +#define TAGLIB_APEFILE_H + +#include "tfile.h" +#include "taglib_export.h" +#include "apeproperties.h" + +namespace TagLib { + + class Tag; + + namespace ID3v1 { class Tag; } + namespace APE { class Tag; } + + //! An implementation of APE metadata + + /*! + * This is implementation of APE metadata. + * + * This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream + * properties from the file. + */ + + namespace APE { + + //! An implementation of TagLib::File with APE specific methods + + /*! + * This implements and provides an interface APE WavPack files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to APE files. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * This set of flags is used for various operations and is suitable for + * being OR-ed together. + */ + enum TagTypes { + //! Empty set. Matches no tag types. + NoTags = 0x0000, + //! Matches ID3v1 tags. + ID3v1 = 0x0001, + //! Matches APE tags. + APE = 0x0002, + //! Matches all tag types. + AllTags = 0xffff + }; + + /*! + * Contructs an WavPack file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an WavPack file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. This will be an APE tag, an ID3v1 tag + * or a combination of the two. + */ + virtual TagLib::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * If the file contains both an APE and an ID3v1 tag, only APE + * will be converted to the PropertyMap. + */ + PropertyMap properties() const; + + /*! + * Removes unsupported properties. Forwards to the actual Tag's + * removeUnsupportedProperties() function. + */ + void removeUnsupportedProperties(const StringList &properties); + + /*! + * Implements the unified property interface -- import function. + * As for the export, only one tag is taken into account. If the file + * has no tag at all, APE will be created. + */ + PropertyMap setProperties(const PropertyMap &); + /*! + * Returns the APE::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Saves the file. + * + * \note According to the official Monkey's Audio SDK, an APE file + * can only have either ID3V1 or APE tags, so a parameter is used here. + */ + virtual bool save(); + + /*! + * Returns a pointer to the ID3v1 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v1 tag. If \a create is true it will create + * an ID3v1 tag if one does not exist. If there is already an APE tag, the + * new ID3v1 tag will be placed after it. + * + * \note The Tag is still owned by the APE::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v1::Tag *ID3v1Tag(bool create = false); + + /*! + * Returns a pointer to the APE tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid APE tag. If \a create is true it will create + * a APE tag if one does not exist. + * + * \note The Tag is still owned by the APE::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + APE::Tag *APETag(bool create = false); + + /*! + * This will remove the tags that match the OR-ed together TagTypes from the + * file. By default it removes all tags. + * + * \note This will also invalidate pointers to the tags + * as their memory will be freed. + * \note In order to make the removal permanent save() still needs to be called + */ + void strip(int tags = AllTags); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void scan(); + long findID3v1(); + long findAPE(); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/ape/apefooter.h b/Audio-Frameworks/bin/taglib/headers/ape/apefooter.h new file mode 100644 index 0000000..080f930 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ape/apefooter.h @@ -0,0 +1,173 @@ +/*************************************************************************** + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_APEFOOTER_H +#define TAGLIB_APEFOOTER_H + +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace APE { + + //! An implementation of APE footers + + /*! + * This class implements APE footers (and headers). It attempts to follow, both + * semantically and programatically, the structure specified in + * the APE v2.0 standard. The API is based on the properties of APE footer and + * headers specified there. + */ + + class TAGLIB_EXPORT Footer + { + public: + /*! + * Constructs an empty APE footer. + */ + Footer(); + + /*! + * Constructs an APE footer based on \a data. parse() is called + * immediately. + */ + Footer(const ByteVector &data); + + /*! + * Destroys the footer. + */ + virtual ~Footer(); + + /*! + * Returns the version number. (Note: This is the 1000 or 2000.) + */ + uint version() const; + + /*! + * Returns true if a header is present in the tag. + */ + bool headerPresent() const; + + /*! + * Returns true if a footer is present in the tag. + */ + bool footerPresent() const; + + /*! + * Returns true this is actually the header. + */ + bool isHeader() const; + + /*! + * Sets whether the header should be rendered or not + */ + void setHeaderPresent(bool b) const; + + /*! + * Returns the number of items in the tag. + */ + uint itemCount() const; + + /*! + * Set the item count to \a s. + * \see itemCount() + */ + void setItemCount(uint s); + + /*! + * Returns the tag size in bytes. This is the size of the frame content and footer. + * The size of the \e entire tag will be this plus the header size, if present. + * + * \see completeTagSize() + */ + uint tagSize() const; + + /*! + * Returns the tag size, including if present, the header + * size. + * + * \see tagSize() + */ + uint completeTagSize() const; + + /*! + * Set the tag size to \a s. + * \see tagSize() + */ + void setTagSize(uint s); + + /*! + * Returns the size of the footer. Presently this is always 32 bytes. + */ + static uint size(); + + /*! + * Returns the string used to identify an APE tag inside of a file. + * Presently this is always "APETAGEX". + */ + static ByteVector fileIdentifier(); + + /*! + * Sets the data that will be used as the footer. 32 bytes, + * starting from \a data will be used. + */ + void setData(const ByteVector &data); + + /*! + * Renders the footer back to binary format. + */ + ByteVector renderFooter() const; + + /*! + * Renders the header corresponding to the footer. If headerPresent is + * set to false, it returns an empty ByteVector. + */ + ByteVector renderHeader() const; + + protected: + /*! + * Called by setData() to parse the footer data. It makes this information + * available through the public API. + */ + void parse(const ByteVector &data); + + /*! + * Called by renderFooter and renderHeader + */ + ByteVector render(bool isHeader) const; + + private: + Footer(const Footer &); + Footer &operator=(const Footer &); + + class FooterPrivate; + FooterPrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/ape/apeitem.h b/Audio-Frameworks/bin/taglib/headers/ape/apeitem.h new file mode 100644 index 0000000..f7fd05e --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ape/apeitem.h @@ -0,0 +1,217 @@ +/*************************************************************************** + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_APEITEM_H +#define TAGLIB_APEITEM_H + +#include "tbytevector.h" +#include "tstring.h" +#include "tstringlist.h" + +namespace TagLib { + + namespace APE { + + //! An implementation of APE-items + + /*! + * This class provides the features of items in the APEv2 standard. + */ + class TAGLIB_EXPORT Item + { + public: + /*! + * Enum of types an Item can have. The value of 3 is reserved. + */ + enum ItemTypes { + //! Item contains text information coded in UTF-8 + Text = 0, + //! Item contains binary information + Binary = 1, + //! Item is a locator of external stored information + Locator = 2 + }; + /*! + * Constructs an empty item. + */ + Item(); + + /*! + * Constructs a text item with \a key and \a value. + */ + // BIC: Remove this, StringList has a constructor from a single string + Item(const String &key, const String &value); + + /*! + * Constructs a text item with \a key and \a values. + */ + Item(const String &key, const StringList &values); + + /*! + * Constructs an item with \a key and \a value. + * If \a binary is true a Binary item will be created, otherwise \a value will be interpreted as text + */ + Item(const String &key, const ByteVector &value, bool binary); + + /*! + * Construct an item as a copy of \a item. + */ + Item(const Item &item); + + /*! + * Destroys the item. + */ + virtual ~Item(); + + /*! + * Copies the contents of \a item into this item. + */ + Item &operator=(const Item &item); + + /*! + * Returns the key. + */ + String key() const; + + /*! + * Returns the binary value. + * If the item type is not \a Binary, the returned contents are undefined + */ + ByteVector binaryData() const; + + /*! + * Set the binary value to \a value + * The item's type will also be set to \a Binary + */ + void setBinaryData(const ByteVector &value); + +#ifndef DO_NOT_DOCUMENT + /* Remove in next binary incompatible release */ + ByteVector value() const; +#endif + + /*! + * Sets the key for the item to \a key. + */ + void setKey(const String &key); + + /*! + * Sets the text value of the item to \a value and clears any previous contents. + * + * \see toString() + */ + void setValue(const String &value); + + /*! + * Sets the text value of the item to the list of values in \a value and clears + * any previous contents. + * + * \see toStringList() + */ + void setValues(const StringList &values); + + /*! + * Appends \a value to create (or extend) the current list of text values. + * + * \see toString() + */ + void appendValue(const String &value); + + /*! + * Appends \a values to extend the current list of text values. + * + * \see toStringList() + */ + void appendValues(const StringList &values); + + /*! + * Returns the size of the full item. + */ + int size() const; + + /*! + * Returns the value as a single string. In case of multiple strings, + * the first is returned. + */ + String toString() const; + +#ifndef DO_NOT_DOCUMENT + /* Remove in next binary incompatible release */ + StringList toStringList() const; +#endif + + /*! + * Returns the list of text values. + */ + StringList values() const; + + /*! + * Render the item to a ByteVector. + */ + ByteVector render() const; + + /*! + * Parse the item from the ByteVector \a data. + */ + void parse(const ByteVector& data); + + /*! + * Set the item to read-only. + */ + void setReadOnly(bool readOnly); + + /*! + * Return true if the item is read-only. + */ + bool isReadOnly() const; + + /*! + * Sets the type of the item to \a type. + * + * \see ItemTypes + */ + void setType(ItemTypes type); + + /*! + * Returns the type of the item. + */ + ItemTypes type() const; + + /*! + * Returns if the item has any real content. + */ + bool isEmpty() const; + + private: + class ItemPrivate; + ItemPrivate *d; + }; + } + +} + +#endif + + diff --git a/Audio-Frameworks/bin/taglib/headers/ape/apeproperties.h b/Audio-Frameworks/bin/taglib/headers/ape/apeproperties.h new file mode 100644 index 0000000..f154ec3 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ape/apeproperties.h @@ -0,0 +1,99 @@ +/*************************************************************************** + copyright : (C) 2010 by Alex Novichkov + email : novichko@atnet.ru + + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + (original WavPack implementation) + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_APEPROPERTIES_H +#define TAGLIB_APEPROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + + namespace APE { + + class File; + + //! An implementation of audio property reading for APE + + /*! + * This reads the data from an APE stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of APE::Properties with the data read from the + * ByteVector \a data. + */ + Properties(File *f, ReadStyle style = Average); + + /*! + * Destroys this APE::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns number of bits per sample. + */ + int bitsPerSample() const; + uint sampleFrames() const; + + /*! + * Returns APE version. + */ + int version() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + + long findDescriptor(); + long findID3v2(); + + void analyzeCurrent(); + void analyzeOld(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/ape/apetag.h b/Audio-Frameworks/bin/taglib/headers/ape/apetag.h new file mode 100644 index 0000000..1a8c30c --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ape/apetag.h @@ -0,0 +1,201 @@ +/*************************************************************************** + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_APETAG_H +#define TAGLIB_APETAG_H + +#include "tag.h" +#include "tbytevector.h" +#include "tmap.h" +#include "tstring.h" +#include "taglib_export.h" + +#include "apeitem.h" + +namespace TagLib { + + class File; + + //! An implementation of the APE tagging format + + namespace APE { + + class Footer; + + /*! + * A mapping between a list of item names, or keys, and the associated item. + * + * \see APE::Tag::itemListMap() + */ + typedef Map ItemListMap; + + + //! An APE tag implementation + + class TAGLIB_EXPORT Tag : public TagLib::Tag + { + public: + /*! + * Create an APE tag with default values. + */ + Tag(); + + /*! + * Create an APE tag and parse the data in \a file with APE footer at + * \a tagOffset. + */ + Tag(TagLib::File *file, long footerLocation); + + /*! + * Destroys this Tag instance. + */ + virtual ~Tag(); + + /*! + * Renders the in memory values to a ByteVector suitable for writing to + * the file. + */ + ByteVector render() const; + + /*! + * Returns the string "APETAGEX" suitable for usage in locating the tag in a + * file. + */ + static ByteVector fileIdentifier(); + + // Reimplementations. + + virtual String title() const; + virtual String artist() const; + virtual String album() const; + virtual String comment() const; + virtual String genre() const; + virtual uint year() const; + virtual uint track() const; + + virtual void setTitle(const String &s); + virtual void setArtist(const String &s); + virtual void setAlbum(const String &s); + virtual void setComment(const String &s); + virtual void setGenre(const String &s); + virtual void setYear(uint i); + virtual void setTrack(uint i); + + /*! + * Implements the unified tag dictionary interface -- export function. + * APE tags are perfectly compatible with the dictionary interface because they + * support both arbitrary tag names and multiple values. Currently only + * APE items of type *Text* are handled by the dictionary interface; all *Binary* + * and *Locator* items will be put into the unsupportedData list and can be + * deleted on request using removeUnsupportedProperties(). The same happens + * to Text items if their key is invalid for PropertyMap (which should actually + * never happen). + * + * The only conversion done by this export function is to rename the APE tags + * TRACK to TRACKNUMBER, YEAR to DATE, and ALBUM ARTIST to ALBUMARTIST, respectively, + * in order to be compliant with the names used in other formats. + */ + PropertyMap properties() const; + + void removeUnsupportedProperties(const StringList &properties); + + /*! + * Implements the unified tag dictionary interface -- import function. The same + * comments as for the export function apply. + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns a pointer to the tag's footer. + */ + Footer *footer() const; + + /*! + * Returns a reference to the item list map. This is an ItemListMap of + * all of the items in the tag. + * + * This is the most powerfull structure for accessing the items of the tag. + * + * APE tags are case-insensitive, all keys in this map have been converted + * to upper case. + * + * \warning You should not modify this data structure directly, instead + * use setItem() and removeItem(). + */ + const ItemListMap &itemListMap() const; + + /*! + * Removes the \a key item from the tag + */ + void removeItem(const String &key); + + /*! + * Adds to the text item specified by \a key the data \a value. If \a replace + * is true, then all of the other values on the same key will be removed + * first. If a binary item exists for \a key it will be removed first. + */ + void addValue(const String &key, const String &value, bool replace = true); + + /*! + * Set the binary data for the key specified by \a item to \a value + * This will convert the item to type \a Binary if it isn't already and + * all of the other values on the same key will be removed. + */ + void setData(const String &key, const ByteVector &value); + + /*! + * Sets the \a key item to the value of \a item. If an item with the \a key is already + * present, it will be replaced. + */ + void setItem(const String &key, const Item &item); + + /*! + * Returns true if the tag does not contain any data. + */ + bool isEmpty() const; + + protected: + + /*! + * Reads from the file specified in the constructor. + */ + void read(); + + /*! + * Parses the body of the tag in \a data. + */ + void parse(const ByteVector &data); + + private: + Tag(const Tag &); + Tag &operator=(const Tag &); + + class TagPrivate; + TagPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/asf/asfattribute.h b/Audio-Frameworks/bin/taglib/headers/asf/asfattribute.h new file mode 100644 index 0000000..54eb0c7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/asf/asfattribute.h @@ -0,0 +1,203 @@ +/************************************************************************** + copyright : (C) 2005-2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ASFATTRIBUTE_H +#define TAGLIB_ASFATTRIBUTE_H + +#include "tstring.h" +#include "tbytevector.h" +#include "taglib_export.h" +#include "asfpicture.h" + +namespace TagLib +{ + + namespace ASF + { + + class File; + class Picture; + + class TAGLIB_EXPORT Attribute + { + public: + + /*! + * Enum of types an Attribute can have. + */ + enum AttributeTypes { + UnicodeType = 0, + BytesType = 1, + BoolType = 2, + DWordType = 3, + QWordType = 4, + WordType = 5, + GuidType = 6 + }; + + /*! + * Constructs an empty attribute. + */ + Attribute(); + + /*! + * Constructs an attribute with \a key and a UnicodeType \a value. + */ + Attribute(const String &value); + + /*! + * Constructs an attribute with \a key and a BytesType \a value. + */ + Attribute(const ByteVector &value); + + /*! + * Constructs an attribute with \a key and a Picture \a value. + * + * This attribute is compatible with the ID3 frame, APIC. The ID3 specification for the APIC frame stipulates that, + * while there may be any number of APIC frames associated with a file, + * only one may be of type 1 and only one may be of type 2. + * + * The specification also states that the description of the picture can be no longer than 64 characters, but can be empty. + * WM/Picture attributes added with TagLib::ASF are not automatically validated to conform to ID3 specifications. + * You must add code in your application to perform validations if you want to maintain complete compatibility with ID3. + */ + Attribute(const Picture &value); + + /*! + * Constructs an attribute with \a key and a DWordType \a value. + */ + Attribute(unsigned int value); + + /*! + * Constructs an attribute with \a key and a QWordType \a value. + */ + Attribute(unsigned long long value); + + /*! + * Constructs an attribute with \a key and a WordType \a value. + */ + Attribute(unsigned short value); + + /*! + * Constructs an attribute with \a key and a BoolType \a value. + */ + Attribute(bool value); + + /*! + * Construct an attribute as a copy of \a other. + */ + Attribute(const Attribute &item); + + /*! + * Copies the contents of \a other into this item. + */ + ASF::Attribute &operator=(const Attribute &other); + + /*! + * Destroys the attribute. + */ + virtual ~Attribute(); + + /*! + * Returns type of the value. + */ + AttributeTypes type() const; + + /*! + * Returns the BoolType \a value. + */ + unsigned short toBool() const; + + /*! + * Returns the WordType \a value. + */ + unsigned short toUShort() const; + + /*! + * Returns the DWordType \a value. + */ + unsigned int toUInt() const; + + /*! + * Returns the QWordType \a value. + */ + unsigned long long toULongLong() const; + + /*! + * Returns the UnicodeType \a value. + */ + String toString() const; + + /*! + * Returns the BytesType \a value. + */ + ByteVector toByteVector() const; + + /*! + * Returns the Picture \a value. + */ + Picture toPicture() const; + + /*! + * Returns the language number, or 0 is no stream number was set. + */ + int language() const; + + /*! + * Sets the language number. + */ + void setLanguage(int value); + + /*! + * Returns the stream number, or 0 is no stream number was set. + */ + int stream() const; + + /*! + * Sets the stream number. + */ + void setStream(int value); + +#ifndef DO_NOT_DOCUMENT + /* THIS IS PRIVATE, DON'T TOUCH IT! */ + String parse(ASF::File &file, int kind = 0); +#endif + + //! Returns the size of the stored data + int dataSize() const; + + private: + friend class File; + + ByteVector render(const String &name, int kind = 0) const; + + class AttributePrivate; + AttributePrivate *d; + }; + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/asf/asffile.h b/Audio-Frameworks/bin/taglib/headers/asf/asffile.h new file mode 100644 index 0000000..f0acd72 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/asf/asffile.h @@ -0,0 +1,130 @@ +/************************************************************************** + copyright : (C) 2005-2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ASFFILE_H +#define TAGLIB_ASFFILE_H + +#include "tag.h" +#include "tfile.h" +#include "taglib_export.h" +#include "asfproperties.h" +#include "asftag.h" + +namespace TagLib { + + //! An implementation of ASF (WMA) metadata + namespace ASF { + + /*! + * This implements and provides an interface for ASF files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to ASF files. + */ + class TAGLIB_EXPORT File : public TagLib::File + { + public: + + /*! + * Contructs an ASF file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \note In the current implementation, both \a readProperties and + * \a propertiesStyle are ignored. + */ + File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an ASF file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \note In the current implementation, both \a readProperties and + * \a propertiesStyle are ignored. + */ + File(IOStream *stream, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns a pointer to the ASF tag of the file. + * + * ASF::Tag implements the tag interface, so this serves as the + * reimplementation of TagLib::File::tag(). + * + * \note The Tag is still owned by the ASF::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + virtual Tag *tag() const; + + /*! + * Returns the ASF audio properties for this file. + */ + virtual Properties *audioProperties() const; + + /*! + * Save the file. + * + * This returns true if the save was successful. + */ + virtual bool save(); + + private: + + int readBYTE(bool *ok = 0); + int readWORD(bool *ok = 0); + unsigned int readDWORD(bool *ok = 0); + long long readQWORD(bool *ok = 0); + static ByteVector renderString(const String &str, bool includeLength = false); + String readString(int len); + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + + friend class Attribute; + friend class Picture; + + class BaseObject; + class UnknownObject; + class FilePropertiesObject; + class StreamPropertiesObject; + class ContentDescriptionObject; + class ExtendedContentDescriptionObject; + class HeaderExtensionObject; + class MetadataObject; + class MetadataLibraryObject; + + class FilePrivate; + FilePrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/asf/asfpicture.h b/Audio-Frameworks/bin/taglib/headers/asf/asfpicture.h new file mode 100644 index 0000000..aa0a060 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/asf/asfpicture.h @@ -0,0 +1,217 @@ +/************************************************************************** + copyright : (C) 2010 by Anton Sergunov + email : setosha@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef ASFPICTURE_H +#define ASFPICTURE_H + +#include "tstring.h" +#include "tbytevector.h" +#include "taglib_export.h" +#include "attachedpictureframe.h" + +namespace TagLib +{ + namespace ASF + { + + //! An ASF attached picture interface implementation + + /*! + * This is an implementation of ASF attached pictures interface. Pictures may be + * included in attributes, one per WM/Picture attribute (but there may be multiple WM/Picture + * attribute in a single tag). These pictures are usually in either JPEG or + * PNG format. + * \see Attribute::toPicture() + * \see Attribute::Attribute(const Picture& picture) + */ + class TAGLIB_EXPORT Picture { + public: + + /*! + * This describes the function or content of the picture. + */ + enum Type { + //! A type not enumerated below + Other = 0x00, + //! 32x32 PNG image that should be used as the file icon + FileIcon = 0x01, + //! File icon of a different size or format + OtherFileIcon = 0x02, + //! Front cover image of the album + FrontCover = 0x03, + //! Back cover image of the album + BackCover = 0x04, + //! Inside leaflet page of the album + LeafletPage = 0x05, + //! Image from the album itself + Media = 0x06, + //! Picture of the lead artist or soloist + LeadArtist = 0x07, + //! Picture of the artist or performer + Artist = 0x08, + //! Picture of the conductor + Conductor = 0x09, + //! Picture of the band or orchestra + Band = 0x0A, + //! Picture of the composer + Composer = 0x0B, + //! Picture of the lyricist or text writer + Lyricist = 0x0C, + //! Picture of the recording location or studio + RecordingLocation = 0x0D, + //! Picture of the artists during recording + DuringRecording = 0x0E, + //! Picture of the artists during performance + DuringPerformance = 0x0F, + //! Picture from a movie or video related to the track + MovieScreenCapture = 0x10, + //! Picture of a large, coloured fish + ColouredFish = 0x11, + //! Illustration related to the track + Illustration = 0x12, + //! Logo of the band or performer + BandLogo = 0x13, + //! Logo of the publisher (record company) + PublisherLogo = 0x14 + }; + + /*! + * Constructs an empty picture. + */ + Picture(); + + /*! + * Construct an picture as a copy of \a other. + */ + Picture(const Picture& other); + + /*! + * Destroys the picture. + */ + virtual ~Picture(); + + /*! + * Copies the contents of \a other into this picture. + */ + Picture& operator=(const Picture& other); + + /*! + * Returns true if Picture stores valid picture + */ + bool isValid() const; + + /*! + * Returns the mime type of the image. This should in most cases be + * "image/png" or "image/jpeg". + * \see setMimeType(const String &) + * \see picture() + * \see setPicture(const ByteArray&) + */ + String mimeType() const; + + /*! + * Sets the mime type of the image. This should in most cases be + * "image/png" or "image/jpeg". + * \see setMimeType(const String &) + * \see picture() + * \see setPicture(const ByteArray&) + */ + void setMimeType(const String &value); + + /*! + * Returns the type of the image. + * + * \see Type + * \see setType() + */ + Type type() const; + + /*! + * Sets the type for the image. + * + * \see Type + * \see type() + */ + void setType(const ASF::Picture::Type& t); + + /*! + * Returns a text description of the image. + * + * \see setDescription() + */ + String description() const; + + /*! + * Sets a textual description of the image to \a desc. + * + * \see description() + */ + void setDescription(const String &desc); + + /*! + * Returns the image data as a ByteVector. + * + * \note ByteVector has a data() method that returns a const char * which + * should make it easy to export this data to external programs. + * + * \see setPicture() + * \see mimeType() + */ + ByteVector picture() const; + + /*! + * Sets the image data to \a p. \a p should be of the type specified in + * this frame's mime-type specification. + * + * \see picture() + * \see mimeType() + * \see setMimeType() + */ + void setPicture(const ByteVector &p); + + /*! + * Returns picture as binary raw data \a value + */ + ByteVector render() const; + + /*! + * Returns picture as binary raw data \a value + */ + int dataSize() const; + +#ifndef DO_NOT_DOCUMENT + /* THIS IS PRIVATE, DON'T TOUCH IT! */ + void parse(const ByteVector& ); + static Picture fromInvalid(); + friend class Attribute; +#endif + private: + class PicturePrivate; + PicturePrivate *d; + }; + } +} + +#endif // ASFPICTURE_H diff --git a/Audio-Frameworks/bin/taglib/headers/asf/asfproperties.h b/Audio-Frameworks/bin/taglib/headers/asf/asfproperties.h new file mode 100644 index 0000000..95730d8 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/asf/asfproperties.h @@ -0,0 +1,76 @@ +/************************************************************************** + copyright : (C) 2005-2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ASFPROPERTIES_H +#define TAGLIB_ASFPROPERTIES_H + +#include "audioproperties.h" +#include "tstring.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ASF { + + //! An implementation of ASF audio properties + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + + /*! + * Create an instance of ASF::Properties. + */ + Properties(); + + /*! + * Destroys this ASF::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + bool isEncrypted() const; + +#ifndef DO_NOT_DOCUMENT + void setLength(int value); + void setBitrate(int value); + void setSampleRate(int value); + void setChannels(int value); + void setEncrypted(bool value); +#endif + + private: + class PropertiesPrivate; + PropertiesPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/asf/asftag.h b/Audio-Frameworks/bin/taglib/headers/asf/asftag.h new file mode 100644 index 0000000..6b2d2bf --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/asf/asftag.h @@ -0,0 +1,186 @@ +/************************************************************************** + copyright : (C) 2005-2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ASFTAG_H +#define TAGLIB_ASFTAG_H + +#include "tag.h" +#include "tlist.h" +#include "tmap.h" +#include "taglib_export.h" +#include "asfattribute.h" + +namespace TagLib { + + namespace ASF { + + typedef List AttributeList; + typedef Map AttributeListMap; + + class TAGLIB_EXPORT Tag : public TagLib::Tag { + + friend class File; + + public: + + Tag(); + + virtual ~Tag(); + + /*! + * Returns the track name. + */ + virtual String title() const; + + /*! + * Returns the artist name. + */ + virtual String artist() const; + + /*! + * Returns the album name; if no album name is present in the tag + * String::null will be returned. + */ + virtual String album() const; + + /*! + * Returns the track comment. + */ + virtual String comment() const; + + /*! + * Returns the genre name; if no genre is present in the tag String::null + * will be returned. + */ + virtual String genre() const; + + /*! + * Returns the rating. + */ + virtual String rating() const; + + /*! + * Returns the genre name; if no genre is present in the tag String::null + * will be returned. + */ + virtual String copyright() const; + + /*! + * Returns the year; if there is no year set, this will return 0. + */ + virtual uint year() const; + + /*! + * Returns the track number; if there is no track number set, this will + * return 0. + */ + virtual uint track() const; + + /*! + * Sets the title to \a s. + */ + virtual void setTitle(const String &s); + + /*! + * Sets the artist to \a s. + */ + virtual void setArtist(const String &s); + + /*! + * Sets the album to \a s. If \a s is String::null then this value will be + * cleared. + */ + virtual void setAlbum(const String &s); + + /*! + * Sets the comment to \a s. + */ + virtual void setComment(const String &s); + + /*! + * Sets the rating to \a s. + */ + virtual void setRating(const String &s); + + /*! + * Sets the copyright to \a s. + */ + virtual void setCopyright(const String &s); + + /*! + * Sets the genre to \a s. + */ + virtual void setGenre(const String &s); + + /*! + * Sets the year to \a i. If \a s is 0 then this value will be cleared. + */ + virtual void setYear(uint i); + + /*! + * Sets the track to \a i. If \a s is 0 then this value will be cleared. + */ + virtual void setTrack(uint i); + + /*! + * Returns true if the tag does not contain any data. This should be + * reimplemented in subclasses that provide more than the basic tagging + * abilities in this class. + */ + virtual bool isEmpty() const; + + /*! + * Returns a reference to the item list map. This is an AttributeListMap of + * all of the items in the tag. + * + * This is the most powerfull structure for accessing the items of the tag. + */ + AttributeListMap &attributeListMap(); + + /*! + * Removes the \a key attribute from the tag + */ + void removeItem(const String &name); + + /*! + * Sets the \a key attribute to the value of \a attribute. If an attribute + * with the \a key is already present, it will be replaced. + */ + void setAttribute(const String &name, const Attribute &attribute); + + /*! + * Sets the \a key attribute to the value of \a attribute. If an attribute + * with the \a key is already present, it will be added to the list. + */ + void addAttribute(const String &name, const Attribute &attribute); + + private: + + class TagPrivate; + TagPrivate *d; + }; + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/audioproperties.h b/Audio-Frameworks/bin/taglib/headers/audioproperties.h new file mode 100644 index 0000000..e9844fa --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/audioproperties.h @@ -0,0 +1,110 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_AUDIOPROPERTIES_H +#define TAGLIB_AUDIOPROPERTIES_H + +#include "taglib_export.h" + +namespace TagLib { + + //! A simple, abstract interface to common audio properties + + /*! + * The values here are common to most audio formats. For more specific, codec + * dependant values, please see see the subclasses APIs. This is meant to + * compliment the TagLib::File and TagLib::Tag APIs in providing a simple + * interface that is sufficient for most applications. + */ + + class TAGLIB_EXPORT AudioProperties + { + public: + + /*! + * Reading audio properties from a file can sometimes be very time consuming + * and for the most accurate results can often involve reading the entire + * file. Because in many situations speed is critical or the accuracy of the + * values is not particularly important this allows the level of desired + * accuracy to be set. + */ + enum ReadStyle { + //! Read as little of the file as possible + Fast, + //! Read more of the file and make better values guesses + Average, + //! Read as much of the file as needed to report accurate values + Accurate + }; + + /*! + * Destroys this AudioProperties instance. + */ + virtual ~AudioProperties(); + + /*! + * Returns the length of the file in seconds. + */ + virtual int length() const = 0; + + /*! + * Returns the most appropriate bit rate for the file in kb/s. For constant + * bitrate formats this is simply the bitrate of the file. For variable + * bitrate formats this is either the average or nominal bitrate. + */ + virtual int bitrate() const = 0; + + /*! + * Returns the sample rate in Hz. + */ + virtual int sampleRate() const = 0; + + /*! + * Returns the number of audio channels. + */ + virtual int channels() const = 0; + + protected: + + /*! + * Construct an audio properties instance. This is protected as this class + * should not be instantiated directly, but should be instantiated via its + * subclasses and can be fetched from the FileRef or File APIs. + * + * \see ReadStyle + */ + AudioProperties(ReadStyle style); + + private: + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); + + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; + }; + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/fileref.h b/Audio-Frameworks/bin/taglib/headers/fileref.h new file mode 100644 index 0000000..0f0c21a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/fileref.h @@ -0,0 +1,263 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FILEREF_H +#define TAGLIB_FILEREF_H + +#include "tfile.h" +#include "tstringlist.h" + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + + class Tag; + + //! This class provides a simple abstraction for creating and handling files + + /*! + * FileRef exists to provide a minimal, generic and value-based wrapper around + * a File. It is lightweight and implicitly shared, and as such suitable for + * pass-by-value use. This hides some of the uglier details of TagLib::File + * and the non-generic portions of the concrete file implementations. + * + * This class is useful in a "simple usage" situation where it is desirable + * to be able to get and set some of the tag information that is similar + * across file types. + * + * Also note that it is probably a good idea to plug this into your mime + * type system rather than using the constructor that accepts a file name using + * the FileTypeResolver. + * + * \see FileTypeResolver + * \see addFileTypeResolver() + */ + + class TAGLIB_EXPORT FileRef + { + public: + + //! A class for pluggable file type resolution. + + /*! + * This class is used to add extend TagLib's very basic file name based file + * type resolution. + * + * This can be accomplished with: + * + * \code + * + * class MyFileTypeResolver : FileTypeResolver + * { + * TagLib::File *createFile(TagLib::FileName *fileName, bool, AudioProperties::ReadStyle) + * { + * if(someCheckForAnMP3File(fileName)) + * return new TagLib::MPEG::File(fileName); + * return 0; + * } + * } + * + * FileRef::addFileTypeResolver(new MyFileTypeResolver); + * + * \endcode + * + * Naturally a less contrived example would be slightly more complex. This + * can be used to plug in mime-type detection systems or to add new file types + * to TagLib. + */ + + class TAGLIB_EXPORT FileTypeResolver + { + TAGLIB_IGNORE_MISSING_DESTRUCTOR + public: + /*! + * This method must be overridden to provide an additional file type + * resolver. If the resolver is able to determine the file type it should + * return a valid File object; if not it should return 0. + * + * \note The created file is then owned by the FileRef and should not be + * deleted. Deletion will happen automatically when the FileRef passes + * out of scope. + */ + virtual File *createFile(FileName fileName, + bool readAudioProperties = true, + AudioProperties::ReadStyle + audioPropertiesStyle = AudioProperties::Average) const = 0; + }; + + /*! + * Creates a null FileRef. + */ + FileRef(); + + /*! + * Create a FileRef from \a fileName. If \a readAudioProperties is true then + * the audio properties will be read using \a audioPropertiesStyle. If + * \a readAudioProperties is false then \a audioPropertiesStyle will be + * ignored. + * + * Also see the note in the class documentation about why you may not want to + * use this method in your application. + */ + explicit FileRef(FileName fileName, + bool readAudioProperties = true, + AudioProperties::ReadStyle + audioPropertiesStyle = AudioProperties::Average); + + /*! + * Contruct a FileRef using \a file. The FileRef now takes ownership of the + * pointer and will delete the File when it passes out of scope. + */ + explicit FileRef(File *file); + + /*! + * Make a copy of \a ref. + */ + FileRef(const FileRef &ref); + + /*! + * Destroys this FileRef instance. + */ + virtual ~FileRef(); + + /*! + * Returns a pointer to represented file's tag. + * + * \warning This pointer will become invalid when this FileRef and all + * copies pass out of scope. + * + * \warning Do not cast it to any subclasses of \class Tag. + * Use tag returning methods of appropriate subclasses of \class File instead. + * + * \see File::tag() + */ + Tag *tag() const; + + /*! + * Returns the audio properties for this FileRef. If no audio properties + * were read then this will returns a null pointer. + */ + AudioProperties *audioProperties() const; + + /*! + * Returns a pointer to the file represented by this handler class. + * + * As a general rule this call should be avoided since if you need to work + * with file objects directly, you are probably better served instantiating + * the File subclasses (i.e. MPEG::File) manually and working with their APIs. + * + * This handle exists to provide a minimal, generic and value-based + * wrapper around a File. Accessing the file directly generally indicates + * a moving away from this simplicity (and into things beyond the scope of + * FileRef). + * + * \warning This pointer will become invalid when this FileRef and all + * copies pass out of scope. + */ + File *file() const; + + /*! + * Saves the file. Returns true on success. + */ + bool save(); + + /*! + * Adds a FileTypeResolver to the list of those used by TagLib. Each + * additional FileTypeResolver is added to the front of a list of resolvers + * that are tried. If the FileTypeResolver returns zero the next resolver + * is tried. + * + * Returns a pointer to the added resolver (the same one that's passed in -- + * this is mostly so that static inialializers have something to use for + * assignment). + * + * \see FileTypeResolver + */ + static const FileTypeResolver *addFileTypeResolver(const FileTypeResolver *resolver); + + /*! + * As is mentioned elsewhere in this class's documentation, the default file + * type resolution code provided by TagLib only works by comparing file + * extensions. + * + * This method returns the list of file extensions that are used by default. + * + * The extensions are all returned in lowercase, though the comparison used + * by TagLib for resolution is case-insensitive. + * + * \note This does not account for any additional file type resolvers that + * are plugged in. Also note that this is not intended to replace a propper + * mime-type resolution system, but is just here for reference. + * + * \see FileTypeResolver + */ + static StringList defaultFileExtensions(); + + /*! + * Returns true if the file (and as such other pointers) are null. + */ + bool isNull() const; + + /*! + * Assign the file pointed to by \a ref to this FileRef. + */ + FileRef &operator=(const FileRef &ref); + + /*! + * Returns true if this FileRef and \a ref point to the same File object. + */ + bool operator==(const FileRef &ref) const; + + /*! + * Returns true if this FileRef and \a ref do not point to the same File + * object. + */ + bool operator!=(const FileRef &ref) const; + + /*! + * A simple implementation of file type guessing. If \a readAudioProperties + * is true then the audio properties will be read using + * \a audioPropertiesStyle. If \a readAudioProperties is false then + * \a audioPropertiesStyle will be ignored. + * + * \note You generally shouldn't use this method, but instead the constructor + * directly. + * + * \deprecated + */ + static File *create(FileName fileName, + bool readAudioProperties = true, + AudioProperties::ReadStyle audioPropertiesStyle = AudioProperties::Average); + + + private: + class FileRefPrivate; + FileRefPrivate *d; + }; + +} // namespace TagLib + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/flac/flacfile.h b/Audio-Frameworks/bin/taglib/headers/flac/flacfile.h new file mode 100644 index 0000000..31dfebd --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/flac/flacfile.h @@ -0,0 +1,258 @@ +/*************************************************************************** + copyright : (C) 2003 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FLACFILE_H +#define TAGLIB_FLACFILE_H + +#include "taglib_export.h" +#include "tfile.h" +#include "tlist.h" +#include "tag.h" + +#include "flacpicture.h" +#include "flacproperties.h" + +namespace TagLib { + + class Tag; + namespace ID3v2 { class FrameFactory; class Tag; } + namespace ID3v1 { class Tag; } + namespace Ogg { class XiphComment; } + + //! An implementation of FLAC metadata + + /*! + * This is implementation of FLAC metadata for non-Ogg FLAC files. At some + * point when Ogg / FLAC is more common there will be a similar implementation + * under the Ogg hiearchy. + * + * This supports ID3v1, ID3v2 and Xiph style comments as well as reading stream + * properties from the file. + */ + + namespace FLAC { + + //! An implementation of TagLib::File with FLAC specific methods + + /*! + * This implements and provides an interface for FLAC files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to FLAC files. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * Contructs a FLAC file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \deprecated This constructor will be dropped in favor of the one below + * in a future version. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs a FLAC file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * If this file contains and ID3v2 tag the frames will be created using + * \a frameFactory. + */ + // BIC: merge with the above constructor + File(FileName file, ID3v2::FrameFactory *frameFactory, + bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs a FLAC file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * If this file contains and ID3v2 tag the frames will be created using + * \a frameFactory. + */ + // BIC: merge with the above constructor + File(IOStream *stream, ID3v2::FrameFactory *frameFactory, + bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. This will be a union of XiphComment, + * ID3v1 and ID3v2 tags. + * + * \see ID3v2Tag() + * \see ID3v1Tag() + * \see XiphComment() + */ + virtual TagLib::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * If the file contains more than one tag (e.g. XiphComment and ID3v1), + * only the first one (in the order XiphComment, ID3v2, ID3v1) will be + * converted to the PropertyMap. + */ + PropertyMap properties() const; + + void removeUnsupportedProperties(const StringList &); + + /*! + * Implements the unified property interface -- import function. + * As with the export, only one tag is taken into account. If the file + * has no tag at all, a XiphComment will be created. + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the FLAC::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Save the file. This will primarily save the XiphComment, but + * will also keep any old ID3-tags up to date. If the file + * has no XiphComment, one will be constructed from the ID3-tags. + * + * This returns true if the save was successful. + */ + virtual bool save(); + + /*! + * Returns a pointer to the ID3v2 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v2 tag. If \a create is true it will create + * an ID3v2 tag if one does not exist. + * + * \note The Tag is still owned by the FLAC::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v2::Tag *ID3v2Tag(bool create = false); + + /*! + * Returns a pointer to the ID3v1 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v1 tag. If \a create is true it will create + * an ID3v1 tag if one does not exist. + * + * \note The Tag is still owned by the FLAC::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v1::Tag *ID3v1Tag(bool create = false); + + /*! + * Returns a pointer to the XiphComment for the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid XiphComment. If \a create is true it will create + * a XiphComment if one does not exist. + * + * \note The Tag is still owned by the FLAC::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + Ogg::XiphComment *xiphComment(bool create = false); + + /*! + * Set the ID3v2::FrameFactory to something other than the default. This + * can be used to specify the way that ID3v2 frames will be interpreted + * when + * + * \see ID3v2FrameFactory + */ + void setID3v2FrameFactory(const ID3v2::FrameFactory *factory); + + /*! + * Returns the block of data used by FLAC::Properties for parsing the + * stream properties. + * + * \deprecated This method will not be public in a future release. + */ + ByteVector streamInfoData(); // BIC: remove + + /*! + * Returns the length of the audio-stream, used by FLAC::Properties for + * calculating the bitrate. + * + * \deprecated This method will not be public in a future release. + */ + long streamLength(); // BIC: remove + + /*! + * Returns a list of pictures attached to the FLAC file. + */ + List pictureList(); + + /*! + * Removes an attached picture. If \a del is true the picture's memory + * will be freed; if it is false, it must be deleted by the user. + */ + void removePicture(Picture *picture, bool del = true); + + /*! + * Remove all attached images. + */ + void removePictures(); + + /*! + * Add a new picture to the file. The file takes ownership of the + * picture and will handle freeing its memory. + * + * \note The file will be saved only after calling save(). + */ + void addPicture(Picture *picture); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void scan(); + long findID3v2(); + long findID3v1(); + ByteVector xiphCommentData() const; + long findPaddingBreak(long nextPageOffset, long targetOffset, bool *isLast); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/flac/flacmetadatablock.h b/Audio-Frameworks/bin/taglib/headers/flac/flacmetadatablock.h new file mode 100644 index 0000000..41bca31 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/flac/flacmetadatablock.h @@ -0,0 +1,75 @@ +/************************************************************************** + copyright : (C) 2010 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FLACMETADATABLOCK_H +#define TAGLIB_FLACMETADATABLOCK_H + +#include "tlist.h" +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace FLAC { + + class TAGLIB_EXPORT MetadataBlock + { + public: + MetadataBlock(); + virtual ~MetadataBlock(); + + enum BlockType { + StreamInfo = 0, + Padding, + Application, + SeekTable, + VorbisComment, + CueSheet, + Picture + }; + + /*! + * Returns the FLAC metadata block type. + */ + virtual int code() const = 0; + + /*! + * Render the content of the block. + */ + virtual ByteVector render() const = 0; + + private: + MetadataBlock(const MetadataBlock &item); + MetadataBlock &operator=(const MetadataBlock &item); + + class MetadataBlockPrivate; + MetadataBlockPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/flac/flacpicture.h b/Audio-Frameworks/bin/taglib/headers/flac/flacpicture.h new file mode 100644 index 0000000..b6def57 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/flac/flacpicture.h @@ -0,0 +1,208 @@ +/************************************************************************** + copyright : (C) 2010 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FLACPICTURE_H +#define TAGLIB_FLACPICTURE_H + +#include "tlist.h" +#include "tstring.h" +#include "tbytevector.h" +#include "taglib_export.h" +#include "flacmetadatablock.h" + +namespace TagLib { + + namespace FLAC { + + class TAGLIB_EXPORT Picture : public MetadataBlock + { + public: + + /*! + * This describes the function or content of the picture. + */ + enum Type { + //! A type not enumerated below + Other = 0x00, + //! 32x32 PNG image that should be used as the file icon + FileIcon = 0x01, + //! File icon of a different size or format + OtherFileIcon = 0x02, + //! Front cover image of the album + FrontCover = 0x03, + //! Back cover image of the album + BackCover = 0x04, + //! Inside leaflet page of the album + LeafletPage = 0x05, + //! Image from the album itself + Media = 0x06, + //! Picture of the lead artist or soloist + LeadArtist = 0x07, + //! Picture of the artist or performer + Artist = 0x08, + //! Picture of the conductor + Conductor = 0x09, + //! Picture of the band or orchestra + Band = 0x0A, + //! Picture of the composer + Composer = 0x0B, + //! Picture of the lyricist or text writer + Lyricist = 0x0C, + //! Picture of the recording location or studio + RecordingLocation = 0x0D, + //! Picture of the artists during recording + DuringRecording = 0x0E, + //! Picture of the artists during performance + DuringPerformance = 0x0F, + //! Picture from a movie or video related to the track + MovieScreenCapture = 0x10, + //! Picture of a large, coloured fish + ColouredFish = 0x11, + //! Illustration related to the track + Illustration = 0x12, + //! Logo of the band or performer + BandLogo = 0x13, + //! Logo of the publisher (record company) + PublisherLogo = 0x14 + }; + + Picture(); + Picture(const ByteVector &data); + ~Picture(); + + /*! + * Returns the type of the image. + */ + Type type() const; + + /*! + * Sets the type of the image. + */ + void setType(Type type); + + /*! + * Returns the mime type of the image. This should in most cases be + * "image/png" or "image/jpeg". + */ + String mimeType() const; + + /*! + * Sets the mime type of the image. This should in most cases be + * "image/png" or "image/jpeg". + */ + void setMimeType(const String &m); + + /*! + * Returns a text description of the image. + */ + + String description() const; + + /*! + * Sets a textual description of the image to \a desc. + */ + + void setDescription(const String &desc); + + /*! + * Returns the width of the image. + */ + int width() const; + + /*! + * Sets the width of the image. + */ + void setWidth(int w); + + /*! + * Returns the height of the image. + */ + int height() const; + + /*! + * Sets the height of the image. + */ + void setHeight(int h); + + /*! + * Returns the color depth (in bits-per-pixel) of the image. + */ + int colorDepth() const; + + /*! + * Sets the color depth (in bits-per-pixel) of the image. + */ + void setColorDepth(int depth); + + /*! + * Returns the number of colors used on the image.. + */ + int numColors() const; + + /*! + * Sets the number of colors used on the image (for indexed images). + */ + void setNumColors(int numColors); + + /*! + * Returns the image data. + */ + ByteVector data() const; + + /*! + * Sets the image data. + */ + void setData(const ByteVector &data); + + /*! + * Returns the FLAC metadata block type. + */ + int code() const; + + /*! + * Render the content to the FLAC picture block format. + */ + ByteVector render() const; + + /*! + * Parse the picture data in the FLAC picture block format. + */ + bool parse(const ByteVector &rawData); + + private: + Picture(const Picture &item); + Picture &operator=(const Picture &item); + + class PicturePrivate; + PicturePrivate *d; + }; + + typedef List PictureList; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/flac/flacproperties.h b/Audio-Frameworks/bin/taglib/headers/flac/flacproperties.h new file mode 100644 index 0000000..c145898 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/flac/flacproperties.h @@ -0,0 +1,103 @@ +/*************************************************************************** + copyright : (C) 2003 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FLACPROPERTIES_H +#define TAGLIB_FLACPROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + + namespace FLAC { + + class File; + + //! An implementation of audio property reading for FLAC + + /*! + * This reads the data from an FLAC stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of FLAC::Properties with the data read from the + * ByteVector \a data. + */ + // BIC: switch to const reference + Properties(ByteVector data, long streamLength, ReadStyle style = Average); + + /*! + * Create an instance of FLAC::Properties with the data read from the + * FLAC::File \a file. + */ + // BIC: remove + Properties(File *file, ReadStyle style = Average); + + /*! + * Destroys this FLAC::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns the sample width as read from the FLAC identification + * header. + */ + int sampleWidth() const; + + /*! + * Return the number of sample frames + */ + unsigned long long sampleFrames() const; + + /*! + * Returns the MD5 signature of the uncompressed audio stream as read + * from the stream info header header. + */ + ByteVector signature() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/flac/flacunknownmetadatablock.h b/Audio-Frameworks/bin/taglib/headers/flac/flacunknownmetadatablock.h new file mode 100644 index 0000000..3030254 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/flac/flacunknownmetadatablock.h @@ -0,0 +1,81 @@ +/************************************************************************** + copyright : (C) 2010 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FLACUNKNOWNMETADATABLOCK_H +#define TAGLIB_FLACUNKNOWNMETADATABLOCK_H + +#include "tlist.h" +#include "tbytevector.h" +#include "taglib_export.h" +#include "flacmetadatablock.h" + +namespace TagLib { + + namespace FLAC { + + class TAGLIB_EXPORT UnknownMetadataBlock : public MetadataBlock + { + public: + UnknownMetadataBlock(int blockType, const ByteVector &data); + ~UnknownMetadataBlock(); + + /*! + * Returns the FLAC metadata block type. + */ + int code() const; + + /*! + * Sets the FLAC metadata block type. + */ + void setCode(int code); + + /*! + * Returns the FLAC metadata block type. + */ + ByteVector data() const; + + /*! + * Sets the FLAC metadata block type. + */ + void setData(const ByteVector &data); + + /*! + * Render the content of the block. + */ + ByteVector render() const; + + private: + UnknownMetadataBlock(const MetadataBlock &item); + UnknownMetadataBlock &operator=(const MetadataBlock &item); + + class UnknownMetadataBlockPrivate; + UnknownMetadataBlockPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/it/itfile.h b/Audio-Frameworks/bin/taglib/headers/it/itfile.h new file mode 100644 index 0000000..9c50774 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/it/itfile.h @@ -0,0 +1,102 @@ +/*************************************************************************** + copyright : (C) 2011 by Mathias Panzenböck + email : grosser.meister.morti@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef TAGLIB_ITFILE_H +#define TAGLIB_ITFILE_H + +#include "tfile.h" +#include "audioproperties.h" +#include "taglib_export.h" +#include "modfilebase.h" +#include "modtag.h" +#include "itproperties.h" + +namespace TagLib { + + namespace IT { + + class TAGLIB_EXPORT File : public Mod::FileBase { + public: + /*! + * Contructs a Impulse Tracker file from \a file. If \a readProperties + * is true the file's audio properties will also be read using + * \a propertiesStyle. If false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + AudioProperties::ReadStyle propertiesStyle = + AudioProperties::Average); + + /*! + * Contructs a Impulse Tracker file from \a stream. If \a readProperties + * is true the file's audio properties will also be read using + * \a propertiesStyle. If false, \a propertiesStyle is ignored. + */ + File(IOStream *stram, bool readProperties = true, + AudioProperties::ReadStyle propertiesStyle = + AudioProperties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + Mod::Tag *tag() const; + + /*! + * Forwards to Mod::Tag::properties(). + * BIC: will be removed once File::toDict() is made virtual + */ + PropertyMap properties() const; + + /*! + * Forwards to Mod::Tag::setProperties(). + * BIC: will be removed once File::setProperties() is made virtual + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the IT::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + IT::Properties *audioProperties() const; + + /*! + * Save the file. + * This is the same as calling save(AllTags); + * + * \note Saving Impulse Tracker tags is not supported. + */ + bool save(); + + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/it/itproperties.h b/Audio-Frameworks/bin/taglib/headers/it/itproperties.h new file mode 100644 index 0000000..da2a7c4 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/it/itproperties.h @@ -0,0 +1,101 @@ +/*************************************************************************** + copyright : (C) 2011 by Mathias Panzenböck + email : grosser.meister.morti@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef TAGLIB_ITPROPERTIES_H +#define TAGLIB_ITPROPERTIES_H + +#include "taglib.h" +#include "audioproperties.h" + +namespace TagLib { + namespace IT { + class TAGLIB_EXPORT Properties : public AudioProperties { + friend class File; + public: + /*! Flag bits. */ + enum { + Stereo = 1, + Vol0MixOptimizations = 2, + UseInstruments = 4, + LinearSlides = 8, + OldEffects = 16, + LinkEffects = 32, + UseMidiPitchController = 64, + RequestEmbeddedMidiConf = 128 + }; + + /*! Special bits. */ + enum { + MessageAttached = 1, + MidiConfEmbedded = 8 + }; + + Properties(AudioProperties::ReadStyle propertiesStyle); + virtual ~Properties(); + + int length() const; + int bitrate() const; + int sampleRate() const; + int channels() const; + + ushort lengthInPatterns() const; + bool stereo() const; + ushort instrumentCount() const; + ushort sampleCount() const; + ushort patternCount() const; + ushort version() const; + ushort compatibleVersion() const; + ushort flags() const; + ushort special() const; + uchar globalVolume() const; + uchar mixVolume() const; + uchar tempo() const; + uchar bpmSpeed() const; + uchar panningSeparation() const; + uchar pitchWheelDepth() const; + + void setChannels(int channels); + void setLengthInPatterns(ushort lengthInPatterns); + void setInstrumentCount(ushort instrumentCount); + void setSampleCount (ushort sampleCount); + void setPatternCount(ushort patternCount); + void setVersion (ushort version); + void setCompatibleVersion(ushort compatibleVersion); + void setFlags (ushort flags); + void setSpecial (ushort special); + void setGlobalVolume(uchar globalVolume); + void setMixVolume (uchar mixVolume); + void setTempo (uchar tempo); + void setBpmSpeed (uchar bpmSpeed); + void setPanningSeparation(uchar panningSeparation); + void setPitchWheelDepth (uchar pitchWheelDepth); + + private: + Properties(const Properties&); + Properties &operator=(const Properties&); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mod/modfile.h b/Audio-Frameworks/bin/taglib/headers/mod/modfile.h new file mode 100644 index 0000000..9e79659 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mod/modfile.h @@ -0,0 +1,103 @@ +/*************************************************************************** + copyright : (C) 2011 by Mathias Panzenböck + email : grosser.meister.morti@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef TAGLIB_MODFILE_H +#define TAGLIB_MODFILE_H + +#include "tfile.h" +#include "audioproperties.h" +#include "taglib_export.h" +#include "modfilebase.h" +#include "modtag.h" +#include "modproperties.h" + +namespace TagLib { + + namespace Mod { + + class TAGLIB_EXPORT File : public TagLib::Mod::FileBase + { + public: + /*! + * Contructs a Protracker file from \a file. If \a readProperties + * is true the file's audio properties will also be read using + * \a propertiesStyle. If false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + AudioProperties::ReadStyle propertiesStyle = + AudioProperties::Average); + + /*! + * Contructs a Protracker file from \a stream. If \a readProperties + * is true the file's audio properties will also be read using + * \a propertiesStyle. If false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + AudioProperties::ReadStyle propertiesStyle = + AudioProperties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + Mod::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * Forwards to Mod::Tag::properties(). + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * Forwards to Mod::Tag::setProperties(). + */ + PropertyMap setProperties(const PropertyMap &); + /*! + * Returns the Mod::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + Mod::Properties *audioProperties() const; + + /*! + * Save the file. + * This is the same as calling save(AllTags); + * + * \note Saving Protracker tags is not supported. + */ + bool save(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties); + + class FilePrivate; + FilePrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mod/modfilebase.h b/Audio-Frameworks/bin/taglib/headers/mod/modfilebase.h new file mode 100644 index 0000000..383bde1 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mod/modfilebase.h @@ -0,0 +1,62 @@ +/*************************************************************************** + copyright : (C) 2011 by Mathias Panzenböck + email : grosser.meister.morti@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef TAGLIB_MODFILEBASE_H +#define TAGLIB_MODFILEBASE_H + +#include "taglib.h" +#include "tfile.h" +#include "tstring.h" +#include "tlist.h" +#include "taglib_export.h" + +#include + +namespace TagLib { + + namespace Mod { + + class TAGLIB_EXPORT FileBase : public TagLib::File + { + protected: + FileBase(FileName file); + FileBase(IOStream *stream); + + void writeString(const String &s, ulong size, char padding = 0); + void writeByte(uchar byte); + void writeU16L(ushort number); + void writeU32L(ulong number); + void writeU16B(ushort number); + void writeU32B(ulong number); + + bool readString(String &s, ulong size); + bool readByte(uchar &byte); + bool readU16L(ushort &number); + bool readU32L(ulong &number); + bool readU16B(ushort &number); + bool readU32B(ulong &number); + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mod/modfileprivate.h b/Audio-Frameworks/bin/taglib/headers/mod/modfileprivate.h new file mode 100644 index 0000000..19a3001 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mod/modfileprivate.h @@ -0,0 +1,67 @@ +/*************************************************************************** + copyright : (C) 2011 by Mathias Panzenböck + email : grosser.meister.morti@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef TAGLIB_MODFILEPRIVATE_H +#define TAGLIB_MODFILEPRIVATE_H + +// some helper-macros only used internally by (s3m|it|xm)file.cpp +#define READ_ASSERT(cond) \ + if(!(cond)) \ + { \ + setValid(false); \ + return; \ + } + +#define READ(setter,type,read) \ + { \ + type number; \ + READ_ASSERT(read(number)); \ + setter(number); \ + } + +#define READ_BYTE(setter) READ(setter,uchar,readByte) +#define READ_U16L(setter) READ(setter,ushort,readU16L) +#define READ_U32L(setter) READ(setter,ulong,readU32L) +#define READ_U16B(setter) READ(setter,ushort,readU16B) +#define READ_U32B(setter) READ(setter,ulong,readU32B) + +#define READ_STRING(setter,size) \ + { \ + String s; \ + READ_ASSERT(readString(s, size)); \ + setter(s); \ + } + +#define READ_AS(type,name,read) \ + type name = 0; \ + READ_ASSERT(read(name)); + +#define READ_BYTE_AS(name) READ_AS(uchar,name,readByte) +#define READ_U16L_AS(name) READ_AS(ushort,name,readU16L) +#define READ_U32L_AS(name) READ_AS(ulong,name,readU32L) +#define READ_U16B_AS(name) READ_AS(ushort,name,readU16B) +#define READ_U32B_AS(name) READ_AS(ulong,name,readU32B) + +#define READ_STRING_AS(name,size) \ + String name; \ + READ_ASSERT(readString(name, size)); + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mod/modproperties.h b/Audio-Frameworks/bin/taglib/headers/mod/modproperties.h new file mode 100644 index 0000000..d50353a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mod/modproperties.h @@ -0,0 +1,65 @@ +/*************************************************************************** + copyright : (C) 2011 by Mathias Panzenböck + email : grosser.meister.morti@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef TAGLIB_MODPROPERTIES_H +#define TAGLIB_MODPROPERTIES_H + +#include "taglib.h" +#include "audioproperties.h" + +namespace TagLib { + + namespace Mod { + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + Properties(AudioProperties::ReadStyle propertiesStyle); + virtual ~Properties(); + + int length() const; + int bitrate() const; + int sampleRate() const; + int channels() const; + + uint instrumentCount() const; + uchar lengthInPatterns() const; + + void setChannels(int channels); + + void setInstrumentCount(uint sampleCount); + void setLengthInPatterns(uchar lengthInPatterns); + + private: + friend class File; + + Properties(const Properties&); + Properties &operator=(const Properties&); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mod/modtag.h b/Audio-Frameworks/bin/taglib/headers/mod/modtag.h new file mode 100644 index 0000000..f33e33f --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mod/modtag.h @@ -0,0 +1,190 @@ +/*************************************************************************** + copyright : (C) 2011 by Mathias Panzenböck + email : grosser.meister.morti@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef TAGLIB_MODTAG_H +#define TAGLIB_MODTAG_H + +#include "tag.h" + +namespace TagLib { + + namespace Mod { + + /*! + * Tags for module files (Mod, S3M, IT, XM). + * + * Note that only the \a title is supported as such by most + * module file formats. Except for XM files the \a trackerName + * is derived from the file format or the flavour of the file + * format. For XM files it is stored in the file. + * + * The \a comment tag is not strictly supported by module files, + * but it is common practice to abuse instrument/sample/pattern + * names as multiline comments. TagLib does so as well. + */ + class TAGLIB_EXPORT Tag : public TagLib::Tag + { + public: + Tag(); + virtual ~Tag(); + + /*! + * Returns the track name; if no track name is present in the tag + * String::null will be returned. + */ + String title() const; + + /*! + * Not supported by module files. Therefore always returns String::null. + */ + String artist() const; + + /*! + * Not supported by module files. Therefore always returns String::null. + */ + String album() const; + + /*! + * Returns the track comment derived from the instrument/sample/pattern + * names; if no comment is present in the tag String::null will be + * returned. + */ + String comment() const; + + /*! + * Not supported by module files. Therefore always returns String::null. + */ + String genre() const; + + /*! + * Not supported by module files. Therefore always returns 0. + */ + uint year() const; + + /*! + * Not supported by module files. Therefore always returns 0. + */ + uint track() const; + + /*! + * Returns the name of the tracker used to create/edit the module file. + * Only XM files store this tag to the file as such, for other formats + * (Mod, S3M, IT) this is derived from the file type or the flavour of + * the file type. Therefore only XM files might have an empty + * (String::null) tracker name. + */ + String trackerName() const; + + /*! + * Sets the title to \a title. If \a title is String::null then this + * value will be cleared. + * + * The length limits per file type are (1 characetr = 1 byte): + * Mod 20 characters, S3M 27 characters, IT 25 characters and XM 20 + * characters. + */ + void setTitle(const String &title); + + /*! + * Not supported by module files and therefore ignored. + */ + void setArtist(const String &artist); + + /*! + * Not supported by module files and therefore ignored. + */ + void setAlbum(const String &album); + + /*! + * Sets the comment to \a comment. If \a comment is String::null then + * this value will be cleared. + * + * Note that module file formats don't actually support a comment tag. + * Instead the names of instruments/patterns/samples are abused as + * a multiline comment. Because of this the number of lines in a + * module file is fixed to the number of instruments/patterns/samples. + * + * Also note that the instrument/pattern/sample name length is limited + * an thus the line length in comments are limited. Too big comments + * will be truncated. + * + * The line length limits per file type are (1 characetr = 1 byte): + * Mod 22 characters, S3M 27 characters, IT 25 characters and XM 22 + * characters. + */ + void setComment(const String &comment); + + /*! + * Not supported by module files and therefore ignored. + */ + void setGenre(const String &genre); + + /*! + * Not supported by module files and therefore ignored. + */ + void setYear(uint year); + + /*! + * Not supported by module files and therefore ignored. + */ + void setTrack(uint track); + + /*! + * Sets the tracker name to \a trackerName. If \a trackerName is + * String::null then this value will be cleared. + * + * Note that only XM files support this tag. Setting the + * tracker name for other module file formats will be ignored. + * + * The length of this tag is limited to 20 characters (1 character + * = 1 byte). + */ + void setTrackerName(const String &trackerName); + + /*! + * Implements the unified property interface -- export function. + * Since the module tag is very limited, the exported map is as well. + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * Because of the limitations of the module file tag, any tags besides + * COMMENT, TITLE and, if it is an XM file, TRACKERNAME, will be + * returened. Additionally, if the map contains tags with multiple values, + * all but the first will be contained in the returned map of unsupported + * properties. + */ + PropertyMap setProperties(const PropertyMap &); + + private: + Tag(const Tag &); + Tag &operator=(const Tag &); + + class TagPrivate; + TagPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mp4/mp4atom.h b/Audio-Frameworks/bin/taglib/headers/mp4/mp4atom.h new file mode 100644 index 0000000..ea5091a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mp4/mp4atom.h @@ -0,0 +1,111 @@ +/************************************************************************** + copyright : (C) 2007,2011 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +// This file is not part of the public API! + +#ifndef DO_NOT_DOCUMENT + +#ifndef TAGLIB_MP4ATOM_H +#define TAGLIB_MP4ATOM_H + +#include "tfile.h" +#include "tlist.h" + +namespace TagLib { + + namespace MP4 { + + class Atom; + typedef TagLib::List AtomList; + + enum AtomDataType + { + TypeImplicit = 0, // for use with tags for which no type needs to be indicated because only one type is allowed + TypeUTF8 = 1, // without any count or null terminator + TypeUTF16 = 2, // also known as UTF-16BE + TypeSJIS = 3, // deprecated unless it is needed for special Japanese characters + TypeHTML = 6, // the HTML file header specifies which HTML version + TypeXML = 7, // the XML header must identify the DTD or schemas + TypeUUID = 8, // also known as GUID; stored as 16 bytes in binary (valid as an ID) + TypeISRC = 9, // stored as UTF-8 text (valid as an ID) + TypeMI3P = 10, // stored as UTF-8 text (valid as an ID) + TypeGIF = 12, // (deprecated) a GIF image + TypeJPEG = 13, // a JPEG image + TypePNG = 14, // a PNG image + TypeURL = 15, // absolute, in UTF-8 characters + TypeDuration = 16, // in milliseconds, 32-bit integer + TypeDateTime = 17, // in UTC, counting seconds since midnight, January 1, 1904; 32 or 64-bits + TypeGenred = 18, // a list of enumerated values + TypeInteger = 21, // a signed big-endian integer with length one of { 1,2,3,4,8 } bytes + TypeRIAAPA = 24, // RIAA parental advisory; { -1=no, 1=yes, 0=unspecified }, 8-bit ingteger + TypeUPC = 25, // Universal Product Code, in text UTF-8 format (valid as an ID) + TypeBMP = 27, // Windows bitmap image + TypeUndefined = 255 // undefined + }; + + struct AtomData { + AtomData(AtomDataType type, ByteVector data) : type(type), locale(0), data(data) {} + AtomDataType type; + int locale; + ByteVector data; + }; + + typedef TagLib::List AtomDataList; + + class Atom + { + public: + Atom(File *file); + ~Atom(); + Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0); + bool path(AtomList &path, const char *name1, const char *name2 = 0, const char *name3 = 0); + AtomList findall(const char *name, bool recursive = false); + long offset; + long length; + TagLib::ByteVector name; + AtomList children; + private: + static const int numContainers = 11; + static const char *containers[11]; + }; + + //! Root-level atoms + class Atoms + { + public: + Atoms(File *file); + ~Atoms(); + Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0); + AtomList path(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0); + AtomList atoms; + }; + + } + +} + +#endif + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mp4/mp4coverart.h b/Audio-Frameworks/bin/taglib/headers/mp4/mp4coverart.h new file mode 100644 index 0000000..804ab78 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mp4/mp4coverart.h @@ -0,0 +1,74 @@ +/************************************************************************** + copyright : (C) 2009 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MP4COVERART_H +#define TAGLIB_MP4COVERART_H + +#include "tlist.h" +#include "tbytevector.h" +#include "taglib_export.h" +#include "mp4atom.h" + +namespace TagLib { + + namespace MP4 { + + class TAGLIB_EXPORT CoverArt + { + public: + /*! + * This describes the image type. + */ + enum Format { + JPEG = TypeJPEG, + PNG = TypePNG, + BMP = TypeBMP, + GIF = TypeGIF + }; + + CoverArt(Format format, const ByteVector &data); + ~CoverArt(); + + CoverArt(const CoverArt &item); + CoverArt &operator=(const CoverArt &item); + + //! Format of the image + Format format() const; + + //! The image data + ByteVector data() const; + + private: + class CoverArtPrivate; + CoverArtPrivate *d; + }; + + typedef List CoverArtList; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mp4/mp4file.h b/Audio-Frameworks/bin/taglib/headers/mp4/mp4file.h new file mode 100644 index 0000000..c3613f7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mp4/mp4file.h @@ -0,0 +1,113 @@ +/************************************************************************** + copyright : (C) 2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MP4FILE_H +#define TAGLIB_MP4FILE_H + +#include "tag.h" +#include "tfile.h" +#include "taglib_export.h" +#include "mp4properties.h" +#include "mp4tag.h" + +namespace TagLib { + + //! An implementation of MP4 (AAC, ALAC, ...) metadata + namespace MP4 { + + class Atoms; + + /*! + * This implements and provides an interface for MP4 files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to MP4 files. + */ + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * Contructs a MP4 file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \note In the current implementation, both \a readProperties and + * \a propertiesStyle are ignored. + */ + File(FileName file, bool readProperties = true, Properties::ReadStyle audioPropertiesStyle = Properties::Average); + + /*! + * Contructs a MP4 file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \note In the current implementation, both \a readProperties and + * \a propertiesStyle are ignored. + */ + File(IOStream *stream, bool readProperties = true, Properties::ReadStyle audioPropertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns a pointer to the MP4 tag of the file. + * + * MP4::Tag implements the tag interface, so this serves as the + * reimplementation of TagLib::File::tag(). + * + * \note The Tag is still owned by the MP4::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + Tag *tag() const; + + /*! + * Returns the MP4 audio properties for this file. + */ + Properties *audioProperties() const; + + /*! + * Save the file. + * + * This returns true if the save was successful. + */ + bool save(); + + private: + + void read(bool readProperties, Properties::ReadStyle audioPropertiesStyle); + bool checkValid(const MP4::AtomList &list); + + class FilePrivate; + FilePrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mp4/mp4item.h b/Audio-Frameworks/bin/taglib/headers/mp4/mp4item.h new file mode 100644 index 0000000..be7aa1a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mp4/mp4item.h @@ -0,0 +1,83 @@ +/************************************************************************** + copyright : (C) 2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MP4ITEM_H +#define TAGLIB_MP4ITEM_H + +#include "tstringlist.h" +#include "mp4coverart.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace MP4 { + + class TAGLIB_EXPORT Item + { + public: + struct IntPair { + int first, second; + }; + + Item(); + Item(const Item &item); + Item &operator=(const Item &item); + ~Item(); + + Item(int value); + Item(uchar value); + Item(uint value); + Item(long long value); + Item(bool value); + Item(int first, int second); + Item(const StringList &value); + Item(const ByteVectorList &value); + Item(const CoverArtList &value); + + void setAtomDataType(AtomDataType type); + AtomDataType atomDataType() const; + + int toInt() const; + uchar toByte() const; + uint toUInt() const; + long long toLongLong() const; + bool toBool() const; + IntPair toIntPair() const; + StringList toStringList() const; + ByteVectorList toByteVectorList() const; + CoverArtList toCoverArtList() const; + + bool isValid() const; + + private: + class ItemPrivate; + ItemPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mp4/mp4properties.h b/Audio-Frameworks/bin/taglib/headers/mp4/mp4properties.h new file mode 100644 index 0000000..7906824 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mp4/mp4properties.h @@ -0,0 +1,62 @@ +/************************************************************************** + copyright : (C) 2007 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MP4PROPERTIES_H +#define TAGLIB_MP4PROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + + namespace MP4 { + + class Atoms; + class File; + + //! An implementation of MP4 audio properties + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + Properties(File *file, Atoms *atoms, ReadStyle style = Average); + virtual ~Properties(); + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + virtual int bitsPerSample() const; + bool isEncrypted() const; + + private: + class PropertiesPrivate; + PropertiesPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mp4/mp4tag.h b/Audio-Frameworks/bin/taglib/headers/mp4/mp4tag.h new file mode 100644 index 0000000..b5ea6eb --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mp4/mp4tag.h @@ -0,0 +1,112 @@ +/************************************************************************** + copyright : (C) 2007,2011 by Lukáš Lalinský + email : lalinsky@gmail.com + **************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MP4TAG_H +#define TAGLIB_MP4TAG_H + +#include "tag.h" +#include "tbytevectorlist.h" +#include "tfile.h" +#include "tmap.h" +#include "tstringlist.h" +#include "taglib_export.h" +#include "mp4atom.h" +#include "mp4item.h" + +namespace TagLib { + + namespace MP4 { + + typedef TagLib::Map ItemListMap; + + class TAGLIB_EXPORT Tag: public TagLib::Tag + { + public: + Tag(); + Tag(TagLib::File *file, Atoms *atoms); + ~Tag(); + bool save(); + + String title() const; + String artist() const; + String album() const; + String comment() const; + String genre() const; + uint year() const; + uint track() const; + + void setTitle(const String &value); + void setArtist(const String &value); + void setAlbum(const String &value); + void setComment(const String &value); + void setGenre(const String &value); + void setYear(uint value); + void setTrack(uint value); + + ItemListMap &itemListMap(); + + private: + AtomDataList parseData2(Atom *atom, TagLib::File *file, int expectedFlags = -1, bool freeForm = false); + TagLib::ByteVectorList parseData(Atom *atom, TagLib::File *file, int expectedFlags = -1, bool freeForm = false); + void parseText(Atom *atom, TagLib::File *file, int expectedFlags = 1); + void parseFreeForm(Atom *atom, TagLib::File *file); + void parseInt(Atom *atom, TagLib::File *file); + void parseByte(Atom *atom, TagLib::File *file); + void parseUInt(Atom *atom, TagLib::File *file); + void parseLongLong(Atom *atom, TagLib::File *file); + void parseGnre(Atom *atom, TagLib::File *file); + void parseIntPair(Atom *atom, TagLib::File *file); + void parseBool(Atom *atom, TagLib::File *file); + void parseCovr(Atom *atom, TagLib::File *file); + + TagLib::ByteVector padIlst(const ByteVector &data, int length = -1); + TagLib::ByteVector renderAtom(const ByteVector &name, const TagLib::ByteVector &data); + TagLib::ByteVector renderData(const ByteVector &name, int flags, const TagLib::ByteVectorList &data); + TagLib::ByteVector renderText(const ByteVector &name, Item &item, int flags = TypeUTF8); + TagLib::ByteVector renderFreeForm(const String &name, Item &item); + TagLib::ByteVector renderBool(const ByteVector &name, Item &item); + TagLib::ByteVector renderInt(const ByteVector &name, Item &item); + TagLib::ByteVector renderByte(const ByteVector &name, Item &item); + TagLib::ByteVector renderUInt(const ByteVector &name, Item &item); + TagLib::ByteVector renderLongLong(const ByteVector &name, Item &item); + TagLib::ByteVector renderIntPair(const ByteVector &name, Item &item); + TagLib::ByteVector renderIntPairNoTrailing(const ByteVector &name, Item &item); + TagLib::ByteVector renderCovr(const ByteVector &name, Item &item); + + void updateParents(AtomList &path, long delta, int ignore = 0); + void updateOffsets(long delta, long offset); + + void saveNew(TagLib::ByteVector &data); + void saveExisting(TagLib::ByteVector &data, AtomList &path); + + class TagPrivate; + TagPrivate *d; + }; + + } + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpc/mpcfile.h b/Audio-Frameworks/bin/taglib/headers/mpc/mpcfile.h new file mode 100644 index 0000000..61ac6d6 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpc/mpcfile.h @@ -0,0 +1,201 @@ +/*************************************************************************** + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MPCFILE_H +#define TAGLIB_MPCFILE_H + +#include "taglib_export.h" +#include "tfile.h" +#include "tag.h" + +#include "mpcproperties.h" + +#include "tlist.h" + +namespace TagLib { + + class Tag; + + namespace ID3v1 { class Tag; } + namespace APE { class Tag; } + + //! An implementation of MPC metadata + + /*! + * This is implementation of MPC metadata. + * + * This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream + * properties from the file. ID3v2 tags are invalid in MPC-files, but will be skipped + * and ignored. + */ + + namespace MPC { + + //! An implementation of TagLib::File with MPC specific methods + + /*! + * This implements and provides an interface for MPC files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to MPC files. + * The only invalid tag combination supported is an ID3v1 tag after an APE tag. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * This set of flags is used for various operations and is suitable for + * being OR-ed together. + */ + enum TagTypes { + //! Empty set. Matches no tag types. + NoTags = 0x0000, + //! Matches ID3v1 tags. + ID3v1 = 0x0001, + //! Matches ID3v2 tags. + ID3v2 = 0x0002, + //! Matches APE tags. + APE = 0x0004, + //! Matches all tag types. + AllTags = 0xffff + }; + + /*! + * Contructs an MPC file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an MPC file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. This will be an APE tag, an ID3v1 tag + * or a combination of the two. + */ + virtual TagLib::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * If the file contains both an APE and an ID3v1 tag, only the APE + * tag will be converted to the PropertyMap. + */ + PropertyMap properties() const; + + void removeUnsupportedProperties(const StringList &properties); + + /*! + * Implements the unified property interface -- import function. + * As with the export, only one tag is taken into account. If the file + * has no tag at all, an APE tag will be created. + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the MPC::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Saves the file. + */ + virtual bool save(); + + /*! + * Returns a pointer to the ID3v1 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v1 tag. If \a create is true it will create + * an ID3v1 tag if one does not exist. If there is already an APE tag, the + * new ID3v1 tag will be placed after it. + * + * \note The Tag is still owned by the APE::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v1::Tag *ID3v1Tag(bool create = false); + + /*! + * Returns a pointer to the APE tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid APE tag. If \a create is true it will create + * a APE tag if one does not exist. If there is already an ID3v1 tag, thes + * new APE tag will be placed before it. + * + * \note The Tag is still owned by the APE::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + APE::Tag *APETag(bool create = false); + + /*! + * This will remove the tags that match the OR-ed together TagTypes from the + * file. By default it removes all tags. + * + * \warning This will also invalidate pointers to the tags + * as their memory will be freed. + * + * \note In order to make the removal permanent save() still needs to be called. + */ + void strip(int tags = AllTags); + + /*! + * \deprecated + * \see strip + */ + void remove(int tags = AllTags); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void scan(); + long findAPE(); + long findID3v1(); + long findID3v2(); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpc/mpcproperties.h b/Audio-Frameworks/bin/taglib/headers/mpc/mpcproperties.h new file mode 100644 index 0000000..adf40d8 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpc/mpcproperties.h @@ -0,0 +1,122 @@ +/*************************************************************************** + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MPCPROPERTIES_H +#define TAGLIB_MPCPROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + + namespace MPC { + + class File; + + static const uint HeaderSize = 8*7; + + //! An implementation of audio property reading for MPC + + /*! + * This reads the data from an MPC stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of MPC::Properties with the data read from the + * ByteVector \a data. + * + * This constructor is deprecated. It only works for MPC version up to 7. + */ + Properties(const ByteVector &data, long streamLength, ReadStyle style = Average); + + /*! + * Create an instance of MPC::Properties with the data read directly + * from a MPC::File. + */ + Properties(File *file, long streamLength, ReadStyle style = Average); + + /*! + * Destroys this MPC::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns the version of the bitstream (SV4-SV8) + */ + int mpcVersion() const; + uint totalFrames() const; + uint sampleFrames() const; + + /*! + * Returns the track gain as an integer value, + * to convert to dB: trackGain in dB = 64.82 - (trackGain / 256) + */ + int trackGain() const; + + /*! + * Returns the track peak as an integer value, + * to convert to dB: trackPeak in dB = trackPeak / 256 + * to convert to floating [-1..1]: trackPeak = 10^(trackPeak / 256 / 20)/32768 + */ + int trackPeak() const; + + /*! + * Returns the album gain as an integer value, + * to convert to dB: albumGain in dB = 64.82 - (albumGain / 256) + */ + int albumGain() const; + + /*! + * Returns the album peak as an integer value, + * to convert to dB: albumPeak in dB = albumPeak / 256 + * to convert to floating [-1..1]: albumPeak = 10^(albumPeak / 256 / 20)/32768 + */ + int albumPeak() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void readSV7(const ByteVector &data); + void readSV8(File *file); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v1/id3v1genres.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v1/id3v1genres.h new file mode 100644 index 0000000..271f725 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v1/id3v1genres.h @@ -0,0 +1,66 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V1GENRE_H +#define TAGLIB_ID3V1GENRE_H + +#include "tmap.h" +#include "tstringlist.h" +#include "taglib_export.h" + +namespace TagLib { + namespace ID3v1 { + + typedef Map GenreMap; + + /*! + * Returns the list of canonical ID3v1 genre names in the order that they + * are listed in the standard. + */ + StringList TAGLIB_EXPORT genreList(); + + /*! + * A "reverse mapping" that goes from the canonical ID3v1 genre name to the + * respective genre number. genreMap()["Rock"] == + */ + GenreMap TAGLIB_EXPORT genreMap(); + + /*! + * Returns the name of the genre at \a index in the ID3v1 genre list. If + * \a index is out of range -- less than zero or greater than 146 -- a null + * string will be returned. + */ + String TAGLIB_EXPORT genre(int index); + + /*! + * Returns the genre index for the (case sensitive) genre \a name. If the + * genre is not in the list 255 (which signifies an unknown genre in ID3v1) + * will be returned. + */ + int TAGLIB_EXPORT genreIndex(const String &name); + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v1/id3v1tag.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v1/id3v1tag.h new file mode 100644 index 0000000..a90ac53 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v1/id3v1tag.h @@ -0,0 +1,182 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V1TAG_H +#define TAGLIB_ID3V1TAG_H + +#include "tag.h" +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + class File; + + //! An ID3v1 implementation + + namespace ID3v1 { + + //! A abstraction for the string to data encoding in ID3v1 tags. + + /*! + * ID3v1 should in theory always contain ISO-8859-1 (Latin1) data. In + * practice it does not. TagLib by default only supports ISO-8859-1 data + * in ID3v1 tags. + * + * However by subclassing this class and reimplementing parse() and render() + * and setting your reimplementation as the default with + * ID3v1::Tag::setStringHandler() you can define how you would like these + * transformations to be done. + * + * \warning It is advisable not to write non-ISO-8859-1 data to ID3v1 + * tags. Please consider disabling the writing of ID3v1 tags in the case + * that the data is not ISO-8859-1. + * + * \see ID3v1::Tag::setStringHandler() + */ + + class TAGLIB_EXPORT StringHandler + { + TAGLIB_IGNORE_MISSING_DESTRUCTOR + public: + // BIC: Add virtual destructor. + StringHandler(); + + /*! + * Decode a string from \a data. The default implementation assumes that + * \a data is an ISO-8859-1 (Latin1) character array. + */ + virtual String parse(const ByteVector &data) const; + + /*! + * Encode a ByteVector with the data from \a s. The default implementation + * assumes that \a s is an ISO-8859-1 (Latin1) string. If the string is + * does not conform to ISO-8859-1, no value is written. + * + * \warning It is recommended that you not override this method, but + * instead do not write an ID3v1 tag in the case that the data is not + * ISO-8859-1. + */ + virtual ByteVector render(const String &s) const; + }; + + //! The main class in the ID3v1 implementation + + /*! + * This is an implementation of the ID3v1 format. ID3v1 is both the simplist + * and most common of tag formats but is rather limited. Because of its + * pervasiveness and the way that applications have been written around the + * fields that it provides, the generic TagLib::Tag API is a mirror of what is + * provided by ID3v1. + * + * ID3v1 tags should generally only contain Latin1 information. However because + * many applications do not follow this rule there is now support for overriding + * the ID3v1 string handling using the ID3v1::StringHandler class. Please see + * the documentation for that class for more information. + * + * \see StringHandler + * + * \note Most fields are truncated to a maximum of 28-30 bytes. The + * truncation happens automatically when the tag is rendered. + */ + + class TAGLIB_EXPORT Tag : public TagLib::Tag + { + public: + /*! + * Create an ID3v1 tag with default values. + */ + Tag(); + + /*! + * Create an ID3v1 tag and parse the data in \a file starting at + * \a tagOffset. + */ + Tag(File *file, long tagOffset); + + /*! + * Destroys this Tag instance. + */ + virtual ~Tag(); + + /*! + * Renders the in memory values to a ByteVector suitable for writing to + * the file. + */ + ByteVector render() const; + + /*! + * Returns the string "TAG" suitable for usage in locating the tag in a + * file. + */ + static ByteVector fileIdentifier(); + + // Reimplementations. + + virtual String title() const; + virtual String artist() const; + virtual String album() const; + virtual String comment() const; + virtual String genre() const; + virtual uint year() const; + virtual uint track() const; + + virtual void setTitle(const String &s); + virtual void setArtist(const String &s); + virtual void setAlbum(const String &s); + virtual void setComment(const String &s); + virtual void setGenre(const String &s); + virtual void setYear(uint i); + virtual void setTrack(uint i); + + /*! + * Sets the string handler that decides how the ID3v1 data will be + * converted to and from binary data. + * + * \see StringHandler + */ + static void setStringHandler(const StringHandler *handler); + + protected: + /*! + * Reads from the file specified in the constructor. + */ + void read(); + /*! + * Pareses the body of the tag in \a data. + */ + void parse(const ByteVector &data); + + private: + Tag(const Tag &); + Tag &operator=(const Tag &); + + class TagPrivate; + TagPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/attachedpictureframe.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/attachedpictureframe.h new file mode 100644 index 0000000..55067bd --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/attachedpictureframe.h @@ -0,0 +1,230 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ATTACHEDPICTUREFRAME_H +#define TAGLIB_ATTACHEDPICTUREFRAME_H + +#include "id3v2frame.h" +#include "id3v2header.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An ID3v2 attached picture frame implementation + + /*! + * This is an implementation of ID3v2 attached pictures. Pictures may be + * included in tags, one per APIC frame (but there may be multiple APIC + * frames in a single tag). These pictures are usually in either JPEG or + * PNG format. + */ + + class TAGLIB_EXPORT AttachedPictureFrame : public Frame + { + friend class FrameFactory; + + public: + + /*! + * This describes the function or content of the picture. + */ + enum Type { + //! A type not enumerated below + Other = 0x00, + //! 32x32 PNG image that should be used as the file icon + FileIcon = 0x01, + //! File icon of a different size or format + OtherFileIcon = 0x02, + //! Front cover image of the album + FrontCover = 0x03, + //! Back cover image of the album + BackCover = 0x04, + //! Inside leaflet page of the album + LeafletPage = 0x05, + //! Image from the album itself + Media = 0x06, + //! Picture of the lead artist or soloist + LeadArtist = 0x07, + //! Picture of the artist or performer + Artist = 0x08, + //! Picture of the conductor + Conductor = 0x09, + //! Picture of the band or orchestra + Band = 0x0A, + //! Picture of the composer + Composer = 0x0B, + //! Picture of the lyricist or text writer + Lyricist = 0x0C, + //! Picture of the recording location or studio + RecordingLocation = 0x0D, + //! Picture of the artists during recording + DuringRecording = 0x0E, + //! Picture of the artists during performance + DuringPerformance = 0x0F, + //! Picture from a movie or video related to the track + MovieScreenCapture = 0x10, + //! Picture of a large, coloured fish + ColouredFish = 0x11, + //! Illustration related to the track + Illustration = 0x12, + //! Logo of the band or performer + BandLogo = 0x13, + //! Logo of the publisher (record company) + PublisherLogo = 0x14 + }; + + /*! + * Constructs an empty picture frame. The description, content and text + * encoding should be set manually. + */ + AttachedPictureFrame(); + + /*! + * Constructs an AttachedPicture frame based on \a data. + */ + explicit AttachedPictureFrame(const ByteVector &data); + + /*! + * Destroys the AttahcedPictureFrame instance. + */ + virtual ~AttachedPictureFrame(); + + /*! + * Returns a string containing the description and mime-type + */ + virtual String toString() const; + + /*! + * Returns the text encoding used for the description. + * + * \see setTextEncoding() + * \see description() + */ + String::Type textEncoding() const; + + /*! + * Set the text encoding used for the description. + * + * \see description() + */ + void setTextEncoding(String::Type t); + + /*! + * Returns the mime type of the image. This should in most cases be + * "image/png" or "image/jpeg". + */ + String mimeType() const; + + /*! + * Sets the mime type of the image. This should in most cases be + * "image/png" or "image/jpeg". + */ + void setMimeType(const String &m); + + /*! + * Returns the type of the image. + * + * \see Type + * \see setType() + */ + Type type() const; + + /*! + * Sets the type for the image. + * + * \see Type + * \see type() + */ + void setType(Type t); + + /*! + * Returns a text description of the image. + * + * \see setDescription() + * \see textEncoding() + * \see setTextEncoding() + */ + + String description() const; + + /*! + * Sets a textual description of the image to \a desc. + * + * \see description() + * \see textEncoding() + * \see setTextEncoding() + */ + + void setDescription(const String &desc); + + /*! + * Returns the image data as a ByteVector. + * + * \note ByteVector has a data() method that returns a const char * which + * should make it easy to export this data to external programs. + * + * \see setPicture() + * \see mimeType() + */ + ByteVector picture() const; + + /*! + * Sets the image data to \a p. \a p should be of the type specified in + * this frame's mime-type specification. + * + * \see picture() + * \see mimeType() + * \see setMimeType() + */ + void setPicture(const ByteVector &p); + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + class AttachedPictureFramePrivate; + AttachedPictureFramePrivate *d; + + private: + AttachedPictureFrame(const AttachedPictureFrame &); + AttachedPictureFrame &operator=(const AttachedPictureFrame &); + AttachedPictureFrame(const ByteVector &data, Header *h); + + }; + + //! support for ID3v2.2 PIC frames + class TAGLIB_EXPORT AttachedPictureFrameV22 : public AttachedPictureFrame + { + protected: + virtual void parseFields(const ByteVector &data); + private: + AttachedPictureFrameV22(const ByteVector &data, Header *h); + friend class FrameFactory; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/commentsframe.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/commentsframe.h new file mode 100644 index 0000000..f65f6f0 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/commentsframe.h @@ -0,0 +1,179 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_COMMENTSFRAME_H +#define TAGLIB_COMMENTSFRAME_H + +#include "id3v2frame.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An implementation of ID3v2 comments + + /*! + * This implements the ID3v2 comment format. An ID3v2 comment concists of + * a language encoding, a description and a single text field. + */ + + class TAGLIB_EXPORT CommentsFrame : public Frame + { + friend class FrameFactory; + + public: + /*! + * Construct an empty comment frame that will use the text encoding + * \a encoding. + */ + explicit CommentsFrame(String::Type encoding = String::Latin1); + + /*! + * Construct a comment based on the data in \a data. + */ + explicit CommentsFrame(const ByteVector &data); + + /*! + * Destroys this CommentFrame instance. + */ + virtual ~CommentsFrame(); + + /*! + * Returns the text of this comment. + * + * \see text() + */ + virtual String toString() const; + + /*! + * Returns the language encoding as a 3 byte encoding as specified by + * ISO-639-2. + * + * \note Most taggers simply ignore this value. + * + * \see setLanguage() + */ + ByteVector language() const; + + /*! + * Returns the description of this comment. + * + * \note Most taggers simply ignore this value. + * + * \see setDescription() + */ + String description() const; + + /*! + * Returns the text of this comment. + * + * \see setText() + */ + String text() const; + + /*! + * Set the language using the 3 byte language code from + * ISO-639-2 to + * \a languageCode. + * + * \see language() + */ + void setLanguage(const ByteVector &languageCode); + + /*! + * Sets the description of the comment to \a s. + * + * \see decription() + */ + void setDescription(const String &s); + + /*! + * Sets the text portion of the comment to \a s. + * + * \see text() + */ + virtual void setText(const String &s); + + /*! + * Returns the text encoding that will be used in rendering this frame. + * This defaults to the type that was either specified in the constructor + * or read from the frame when parsed. + * + * \see setTextEncoding() + * \see render() + */ + String::Type textEncoding() const; + + /*! + * Sets the text encoding to be used when rendering this frame to + * \a encoding. + * + * \see textEncoding() + * \see render() + */ + void setTextEncoding(String::Type encoding); + + /*! + * Parses this frame as PropertyMap with a single key. + * - if description() is empty or "COMMENT", the key will be "COMMENT" + * - if description() is not a valid PropertyMap key, the frame will be + * marked unsupported by an entry "COMM/" in the unsupportedData() + * attribute of the returned map. + * - otherwise, the key will be "COMMENT:" + * - The single value will be the frame's text(). + */ + PropertyMap asProperties() const; + + /*! + * Comments each have a unique description. This searches for a comment + * frame with the decription \a d and returns a pointer to it. If no + * frame is found that matches the given description null is returned. + * + * \see description() + */ + static CommentsFrame *findByDescription(const Tag *tag, const String &d); + + protected: + // Reimplementations. + + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + /*! + * The constructor used by the FrameFactory. + */ + CommentsFrame(const ByteVector &data, Header *h); + CommentsFrame(const CommentsFrame &); + CommentsFrame &operator=(const CommentsFrame &); + + class CommentsFramePrivate; + CommentsFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/generalencapsulatedobjectframe.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/generalencapsulatedobjectframe.h new file mode 100644 index 0000000..42f854c --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/generalencapsulatedobjectframe.h @@ -0,0 +1,178 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + copyright : (C) 2006 by Aaron VonderHaar + email : avh4@users.sourceforge.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_GENERALENCAPSULATEDOBJECT_H +#define TAGLIB_GENERALENCAPSULATEDOBJECT_H + +#include "id3v2frame.h" +#include "id3v2header.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An ID3v2 general encapsulated object frame implementation + + /*! + * This is an implementation of ID3v2 general encapsulated objects. + * Arbitrary binary data may be included in tags, stored in GEOB frames. + * There may be multiple GEOB frames in a single tag. Each GEOB it + * labelled with a content description (which may be blank), a required + * mime-type, and a file name (may be blank). The content description + * uniquely identifies the GEOB frame in the tag. + */ + + class TAGLIB_EXPORT GeneralEncapsulatedObjectFrame : public Frame + { + friend class FrameFactory; + + public: + + /*! + * Constructs an empty object frame. The description, file name and text + * encoding should be set manually. + */ + GeneralEncapsulatedObjectFrame(); + + /*! + * Constructs a GeneralEncapsulatedObjectFrame frame based on \a data. + * + * \warning This is \em not data for the encapsulated object, for that use + * setObject(). This constructor is used when reading the frame from the + * disk. + */ + explicit GeneralEncapsulatedObjectFrame(const ByteVector &data); + + /*! + * Destroys the GeneralEncapsulatedObjectFrame instance. + */ + virtual ~GeneralEncapsulatedObjectFrame(); + + /*! + * Returns a string containing the description, file name and mime-type + */ + virtual String toString() const; + + /*! + * Returns the text encoding used for the description and file name. + * + * \see setTextEncoding() + * \see description() + * \see fileName() + */ + String::Type textEncoding() const; + + /*! + * Set the text encoding used for the description and file name. + * + * \see description() + * \see fileName() + */ + void setTextEncoding(String::Type encoding); + + /*! + * Returns the mime type of the object. + */ + String mimeType() const; + + /*! + * Sets the mime type of the object. + */ + void setMimeType(const String &type); + + /*! + * Returns the file name of the object. + * + * \see setFileName() + */ + String fileName() const; + + /*! + * Sets the file name for the object. + * + * \see fileName() + */ + void setFileName(const String &name); + + /*! + * Returns the content description of the object. + * + * \see setDescription() + * \see textEncoding() + * \see setTextEncoding() + */ + + String description() const; + + /*! + * Sets the content description of the object to \a desc. + * + * \see description() + * \see textEncoding() + * \see setTextEncoding() + */ + + void setDescription(const String &desc); + + /*! + * Returns the object data as a ByteVector. + * + * \note ByteVector has a data() method that returns a const char * which + * should make it easy to export this data to external programs. + * + * \see setObject() + * \see mimeType() + */ + ByteVector object() const; + + /*! + * Sets the object data to \a data. \a data should be of the type specified in + * this frame's mime-type specification. + * + * \see object() + * \see mimeType() + * \see setMimeType() + */ + void setObject(const ByteVector &object); + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + GeneralEncapsulatedObjectFrame(const ByteVector &data, Header *h); + GeneralEncapsulatedObjectFrame(const GeneralEncapsulatedObjectFrame &); + GeneralEncapsulatedObjectFrame &operator=(const GeneralEncapsulatedObjectFrame &); + + class GeneralEncapsulatedObjectFramePrivate; + GeneralEncapsulatedObjectFramePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/popularimeterframe.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/popularimeterframe.h new file mode 100644 index 0000000..d39f1aa --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/popularimeterframe.h @@ -0,0 +1,132 @@ +/*************************************************************************** + copyright : (C) 2008 by Lukas Lalinsky + email : lalinsky@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_POPULARIMETERFRAME_H +#define TAGLIB_POPULARIMETERFRAME_H + +#include "id3v2frame.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An implementation of ID3v2 "popularimeter" + + /*! + * This implements the ID3v2 popularimeter (POPM frame). It concists of + * an email, a rating and an optional counter. + */ + + class TAGLIB_EXPORT PopularimeterFrame : public Frame + { + friend class FrameFactory; + + public: + /*! + * Construct an empty popularimeter frame. + */ + explicit PopularimeterFrame(); + + /*! + * Construct a popularimeter based on the data in \a data. + */ + explicit PopularimeterFrame(const ByteVector &data); + + /*! + * Destroys this PopularimeterFrame instance. + */ + virtual ~PopularimeterFrame(); + + /*! + * Returns the text of this popularimeter. + * + * \see text() + */ + virtual String toString() const; + + /*! + * Returns the email. + * + * \see setEmail() + */ + String email() const; + + /*! + * Set the email. + * + * \see email() + */ + void setEmail(const String &email); + + /*! + * Returns the rating. + * + * \see setRating() + */ + int rating() const; + + /*! + * Set the rating. + * + * \see rating() + */ + void setRating(int rating); + + /*! + * Returns the counter. + * + * \see setCounter() + */ + uint counter() const; + + /*! + * Set the counter. + * + * \see counter() + */ + void setCounter(uint counter); + + protected: + // Reimplementations. + + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + /*! + * The constructor used by the FrameFactory. + */ + PopularimeterFrame(const ByteVector &data, Header *h); + PopularimeterFrame(const PopularimeterFrame &); + PopularimeterFrame &operator=(const PopularimeterFrame &); + + class PopularimeterFramePrivate; + PopularimeterFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/privateframe.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/privateframe.h new file mode 100644 index 0000000..06f82f3 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/privateframe.h @@ -0,0 +1,111 @@ +/*************************************************************************** + copyright : (C) 2008 by Serkan Kalyoncu + copyright : (C) 2008 by Scott Wheeler + email : wheeler@kde.org +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_PRIVATEFRAME_H +#define TAGLIB_PRIVATEFRAME_H + +#include "id3v2frame.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An implementation of ID3v2 privateframe + + class TAGLIB_EXPORT PrivateFrame : public Frame + { + friend class FrameFactory; + + public: + /*! + * Construct an empty private frame. + */ + PrivateFrame(); + + /*! + * Construct a private frame based on the data in \a data. + * + * \note This is the constructor used when parsing the frame from a file. + */ + explicit PrivateFrame(const ByteVector &data); + + /*! + * Destroys this private frame instance. + */ + virtual ~PrivateFrame(); + + /*! + * Returns the text of this private frame, currently just the owner. + * + * \see text() + */ + virtual String toString() const; + + /*! + * \return The owner of the private frame. + * \note This should contain an email address or link to a website. + */ + String owner() const; + + /*! + * + */ + ByteVector data() const; + + /*! + * Sets the owner of the frame to \a s. + * \note This should contain an email address or link to a website. + */ + void setOwner(const String &s); + + /*! + * + */ + void setData(const ByteVector &v); + + protected: + // Reimplementations. + + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + /*! + * The constructor used by the FrameFactory. + */ + PrivateFrame(const ByteVector &data, Header *h); + + PrivateFrame(const PrivateFrame &); + PrivateFrame &operator=(const PrivateFrame &); + + class PrivateFramePrivate; + PrivateFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/relativevolumeframe.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/relativevolumeframe.h new file mode 100644 index 0000000..dad4e7d --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/relativevolumeframe.h @@ -0,0 +1,274 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_RELATIVEVOLUMEFRAME_H +#define TAGLIB_RELATIVEVOLUMEFRAME_H + +#include "tlist.h" +#include "id3v2frame.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An ID3v2 relative volume adjustment frame implementation + + /*! + * This is an implementation of ID3v2 relative volume adjustment. The + * presence of this frame makes it possible to specify an increase in volume + * for an audio file or specific audio tracks in that file. + * + * Multiple relative volume adjustment frames may be present in the tag + * each with a unique identification and describing volume adjustment for + * different channel types. + */ + + class TAGLIB_EXPORT RelativeVolumeFrame : public Frame + { + friend class FrameFactory; + + public: + + /*! + * This indicates the type of volume adjustment that should be applied. + */ + enum ChannelType { + //! A type not enumerated below + Other = 0x00, + //! The master volume for the track + MasterVolume = 0x01, + //! The front right audio channel + FrontRight = 0x02, + //! The front left audio channel + FrontLeft = 0x03, + //! The back right audio channel + BackRight = 0x04, + //! The back left audio channel + BackLeft = 0x05, + //! The front center audio channel + FrontCentre = 0x06, + //! The back center audio channel + BackCentre = 0x07, + //! The subwoofer audio channel + Subwoofer = 0x08 + }; + + //! Struct that stores the relevant values for ID3v2 peak volume + + /*! + * The peak volume is described as a series of bits that is padded to fill + * a block of bytes. These two values should always be updated in tandem. + */ + struct PeakVolume + { + /*! + * Constructs an empty peak volume description. + */ + PeakVolume() : bitsRepresentingPeak(0) {} + /*! + * The number of bits (in the range of 0 to 255) used to describe the + * peak volume. + */ + unsigned char bitsRepresentingPeak; + /*! + * The array of bits (represented as a series of bytes) used to describe + * the peak volume. + */ + ByteVector peakVolume; + }; + + /*! + * Constructs a RelativeVolumeFrame. The relevant data should be set + * manually. + */ + RelativeVolumeFrame(); + + /*! + * Constructs a RelativeVolumeFrame based on the contents of \a data. + */ + RelativeVolumeFrame(const ByteVector &data); + + /*! + * Destroys the RelativeVolumeFrame instance. + */ + virtual ~RelativeVolumeFrame(); + + /*! + * Returns the frame's identification. + * + * \see identification() + */ + virtual String toString() const; + + /*! + * Returns a list of channels with information currently in the frame. + */ + List channels() const; + + /*! + * \deprecated Always returns master volume. + */ + ChannelType channelType() const; + + /*! + * \deprecated This method no longer has any effect. + */ + void setChannelType(ChannelType t); + + /* + * There was a terrible API goof here, and while this can't be changed to + * the way it appears below for binary compaibility reasons, let's at + * least pretend that it looks clean. + */ + +#ifdef DOXYGEN + + /*! + * Returns the relative volume adjustment "index". As indicated by the + * ID3v2 standard this is a 16-bit signed integer that reflects the + * decibils of adjustment when divided by 512. + * + * This defaults to returning the value for the master volume channel if + * available and returns 0 if the specified channel does not exist. + * + * \see setVolumeAdjustmentIndex() + * \see volumeAjustment() + */ + short volumeAdjustmentIndex(ChannelType type = MasterVolume) const; + + /*! + * Set the volume adjustment to \a index. As indicated by the ID3v2 + * standard this is a 16-bit signed integer that reflects the decibils of + * adjustment when divided by 512. + * + * By default this sets the value for the master volume. + * + * \see volumeAdjustmentIndex() + * \see setVolumeAjustment() + */ + void setVolumeAdjustmentIndex(short index, ChannelType type = MasterVolume); + + /*! + * Returns the relative volume adjustment in decibels. + * + * \note Because this is actually stored internally as an "index" to this + * value the value returned by this method may not be identical to the + * value set using setVolumeAdjustment(). + * + * This defaults to returning the value for the master volume channel if + * available and returns 0 if the specified channel does not exist. + * + * \see setVolumeAdjustment() + * \see volumeAdjustmentIndex() + */ + float volumeAdjustment(ChannelType type = MasterVolume) const; + + /*! + * Set the relative volume adjustment in decibels to \a adjustment. + * + * By default this sets the value for the master volume. + * + * \note Because this is actually stored internally as an "index" to this + * value the value set by this method may not be identical to the one + * returned by volumeAdjustment(). + * + * \see setVolumeAdjustment() + * \see volumeAdjustmentIndex() + */ + void setVolumeAdjustment(float adjustment, ChannelType type = MasterVolume); + + /*! + * Returns the peak volume (represented as a length and a string of bits). + * + * This defaults to returning the value for the master volume channel if + * available and returns 0 if the specified channel does not exist. + * + * \see setPeakVolume() + */ + PeakVolume peakVolume(ChannelType type = MasterVolume) const; + + /*! + * Sets the peak volume to \a peak. + * + * By default this sets the value for the master volume. + * + * \see peakVolume() + */ + void setPeakVolume(const PeakVolume &peak, ChannelType type = MasterVolume); + +#else + + // BIC: Combine each of the following pairs of functions (or maybe just + // rework this junk altogether). + + short volumeAdjustmentIndex(ChannelType type) const; + short volumeAdjustmentIndex() const; + + void setVolumeAdjustmentIndex(short index, ChannelType type); + void setVolumeAdjustmentIndex(short index); + + float volumeAdjustment(ChannelType type) const; + float volumeAdjustment() const; + + void setVolumeAdjustment(float adjustment, ChannelType type); + void setVolumeAdjustment(float adjustment); + + PeakVolume peakVolume(ChannelType type) const; + PeakVolume peakVolume() const; + + void setPeakVolume(const PeakVolume &peak, ChannelType type); + void setPeakVolume(const PeakVolume &peak); + +#endif + + /*! + * Returns the identification for this frame. + */ + String identification() const; + + /*! + * Sets the identification of the frame to \a s. The string + * is used to identify the situation and/or device where this + * adjustment should apply. + */ + void setIdentification(const String &s); + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + RelativeVolumeFrame(const ByteVector &data, Header *h); + RelativeVolumeFrame(const RelativeVolumeFrame &); + RelativeVolumeFrame &operator=(const RelativeVolumeFrame &); + + class RelativeVolumeFramePrivate; + RelativeVolumeFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/textidentificationframe.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/textidentificationframe.h new file mode 100644 index 0000000..58ed63e --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/textidentificationframe.h @@ -0,0 +1,313 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_TEXTIDENTIFICATIONFRAME_H +#define TAGLIB_TEXTIDENTIFICATIONFRAME_H + +#include "tstringlist.h" +#include "tmap.h" +#include "taglib_export.h" + +#include "id3v2frame.h" + +namespace TagLib { + + namespace ID3v2 { + + class Tag; + typedef Map KeyConversionMap; + + //! An ID3v2 text identification frame implementation + + /*! + * This is an implementation of the most common type of ID3v2 frame -- text + * identification frames. There are a number of variations on this. Those + * enumerated in the ID3v2.4 standard are: + * + *
    + *
  • TALB Album/Movie/Show title
  • + *
  • TBPM BPM (beats per minute)
  • + *
  • TCOM Composer
  • + *
  • TCON Content type
  • + *
  • TCOP Copyright message
  • + *
  • TDEN Encoding time
  • + *
  • TDLY Playlist delay
  • + *
  • TDOR Original release time
  • + *
  • TDRC Recording time
  • + *
  • TDRL Release time
  • + *
  • TDTG Tagging time
  • + *
  • TENC Encoded by
  • + *
  • TEXT Lyricist/Text writer
  • + *
  • TFLT File type
  • + *
  • TIPL Involved people list
  • + *
  • TIT1 Content group description
  • + *
  • TIT2 Title/songname/content description
  • + *
  • TIT3 Subtitle/Description refinement
  • + *
  • TKEY Initial key
  • + *
  • TLAN Language(s)
  • + *
  • TLEN Length
  • + *
  • TMCL Musician credits list
  • + *
  • TMED Media type
  • + *
  • TMOO Mood
  • + *
  • TOAL Original album/movie/show title
  • + *
  • TOFN Original filename
  • + *
  • TOLY Original lyricist(s)/text writer(s)
  • + *
  • TOPE Original artist(s)/performer(s)
  • + *
  • TOWN File owner/licensee
  • + *
  • TPE1 Lead performer(s)/Soloist(s)
  • + *
  • TPE2 Band/orchestra/accompaniment
  • + *
  • TPE3 Conductor/performer refinement
  • + *
  • TPE4 Interpreted, remixed, or otherwise modified by
  • + *
  • TPOS Part of a set
  • + *
  • TPRO Produced notice
  • + *
  • TPUB Publisher
  • + *
  • TRCK Track number/Position in set
  • + *
  • TRSN Internet radio station name
  • + *
  • TRSO Internet radio station owner
  • + *
  • TSOA Album sort order
  • + *
  • TSOP Performer sort order
  • + *
  • TSOT Title sort order
  • + *
  • TSRC ISRC (international standard recording code)
  • + *
  • TSSE Software/Hardware and settings used for encoding
  • + *
  • TSST Set subtitle
  • + *
+ * + * The ID3v2 Frames document gives a description of each of these formats + * and the expected order of strings in each. ID3v2::Header::frameID() can + * be used to determine the frame type. + * + * \note If non-Latin1 compatible strings are used with this class, even if + * the text encoding is set to Latin1, the frame will be written using UTF8 + * (with the encoding flag appropriately set in the output). + */ + + class TAGLIB_EXPORT TextIdentificationFrame : public Frame + { + friend class FrameFactory; + + public: + /*! + * Construct an empty frame of type \a type. Uses \a encoding as the + * default text encoding. + * + * \note In this case you must specify the text encoding as it + * resolves the ambiguity between constructors. + * + * \note Please see the note in the class description regarding Latin1. + */ + TextIdentificationFrame(const ByteVector &type, String::Type encoding); + + /*! + * This is a dual purpose constructor. \a data can either be binary data + * that should be parsed or (at a minimum) the frame ID. + */ + explicit TextIdentificationFrame(const ByteVector &data); + + /*! + * This is a special factory method to create a TIPL (involved people list) + * frame from the given \a properties. Will parse key=[list of values] data + * into the TIPL format as specified in the ID3 standard. + */ + static TextIdentificationFrame *createTIPLFrame(const PropertyMap &properties); + + /*! + * This is a special factory method to create a TMCL (musician credits list) + * frame from the given \a properties. Will parse key=[list of values] data + * into the TMCL format as specified in the ID3 standard, where key should be + * of the form instrumentPrefix:instrument. + */ + static TextIdentificationFrame *createTMCLFrame(const PropertyMap &properties); + /*! + * Destroys this TextIdentificationFrame instance. + */ + virtual ~TextIdentificationFrame(); + + /*! + * Text identification frames are a list of string fields. + * + * This function will accept either a StringList or a String (using the + * StringList constructor that accepts a single String). + * + * \note This will not change the text encoding of the frame even if the + * strings passed in are not of the same encoding. Please use + * setEncoding(s.type()) if you wish to change the encoding of the frame. + */ + void setText(const StringList &l); + + // Reimplementations. + + virtual void setText(const String &s); + virtual String toString() const; + + /*! + * Returns the text encoding that will be used in rendering this frame. + * This defaults to the type that was either specified in the constructor + * or read from the frame when parsed. + * + * \note Please see the note in the class description regarding Latin1. + * + * \see setTextEncoding() + * \see render() + */ + String::Type textEncoding() const; + + /*! + * Sets the text encoding to be used when rendering this frame to + * \a encoding. + * + * \note Please see the note in the class description regarding Latin1. + * + * \see textEncoding() + * \see render() + */ + void setTextEncoding(String::Type encoding); + + /*! + * Returns a list of the strings in this frame. + */ + StringList fieldList() const; + + /*! + * Returns a KeyConversionMap mapping a role as it would be used in a PropertyMap + * to the corresponding key used in a TIPL ID3 frame to describe that role. + */ + static const KeyConversionMap &involvedPeopleMap(); + + PropertyMap asProperties() const; + + protected: + // Reimplementations. + + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + /*! + * The constructor used by the FrameFactory. + */ + TextIdentificationFrame(const ByteVector &data, Header *h); + + private: + TextIdentificationFrame(const TextIdentificationFrame &); + TextIdentificationFrame &operator=(const TextIdentificationFrame &); + + /*! + * Parses the special structure of a TIPL frame + * Only the whitelisted roles "ARRANGER", "ENGINEER", "PRODUCER", + * "DJMIXER" (ID3: "DJ-MIX") and "MIXER" (ID3: "MIX") are allowed. + */ + PropertyMap makeTIPLProperties() const; + /*! + * Parses the special structure of a TMCL frame. + */ + PropertyMap makeTMCLProperties() const; + class TextIdentificationFramePrivate; + TextIdentificationFramePrivate *d; + }; + + /*! + * This is a specialization of text identification frames that allows for + * user defined entries. Each entry has a description in addition to the + * normal list of fields that a text identification frame has. + * + * This description identifies the frame and must be unique. + */ + + //! An ID3v2 custom text identification frame implementationx + + class TAGLIB_EXPORT UserTextIdentificationFrame : public TextIdentificationFrame + { + friend class FrameFactory; + + public: + /*! + * Constructs an empty user defined text identification frame. For this to be + * a useful frame both a description and text must be set. + */ + explicit UserTextIdentificationFrame(String::Type encoding = String::Latin1); + + /*! + * Creates a frame based on \a data. + */ + explicit UserTextIdentificationFrame(const ByteVector &data); + + /*! + * Creates a user defined text identification frame with the given \a description + * and \a values. + */ + UserTextIdentificationFrame(const String &description, const StringList &values, String::Type encoding = String::UTF8); + + virtual String toString() const; + + /*! + * Returns the description for this frame. + */ + String description() const; + + /*! + * Sets the description of the frame to \a s. \a s must be unique. You can + * check for the presence of another user defined text frame of the same type + * using find() and testing for null. + */ + void setDescription(const String &s); + + StringList fieldList() const; + void setText(const String &text); + void setText(const StringList &fields); + + /*! + * A UserTextIdentificationFrame is parsed into a PropertyMap as follows: + * - the key is the frame's description, uppercased + * - if the description contains '::', only the substring after that + * separator is considered as key (compatibility with exfalso) + * - if the above rules don't yield a valid key (e.g. containing non-ASCII + * characters), the returned map will contain an entry "TXXX/" + * in its unsupportedData() list. + * - The values will be copies of the fieldList(). + * - If the description() appears as value in fieldList(), it will be omitted + * in the value list, in order to be compatible with TagLib which copies + * the description() into the fieldList(). + */ + PropertyMap asProperties() const; + + /*! + * Searches for the user defined text frame with the description \a description + * in \a tag. This returns null if no matching frames were found. + */ + static UserTextIdentificationFrame *find(Tag *tag, const String &description); + + private: + UserTextIdentificationFrame(const ByteVector &data, Header *h); + UserTextIdentificationFrame(const TextIdentificationFrame &); + UserTextIdentificationFrame &operator=(const UserTextIdentificationFrame &); + + void checkFields(); + + class UserTextIdentificationFramePrivate; + UserTextIdentificationFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/uniquefileidentifierframe.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/uniquefileidentifierframe.h new file mode 100644 index 0000000..0cf4b8f --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/uniquefileidentifierframe.h @@ -0,0 +1,113 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_UNIQUEFILEIDENTIFIERFRAME +#define TAGLIB_UNIQUEFILEIDENTIFIERFRAME + +#include "id3v2frame.h" + +namespace TagLib { + + namespace ID3v2 { + + /*! + * This is an implementation of ID3v2 unique file identifier frames. This + * frame is used to identify the file in an arbitrary database identified + * by the owner field. + */ + + //! An implementation of ID3v2 unique identifier frames + + class TAGLIB_EXPORT UniqueFileIdentifierFrame : public ID3v2::Frame + { + friend class FrameFactory; + + public: + /*! + * Creates a uniqe file identifier frame based on \a data. + */ + UniqueFileIdentifierFrame(const ByteVector &data); + + /*! + * Creates a unique file identifier frame with the owner \a owner and + * the identification \a id. + */ + UniqueFileIdentifierFrame(const String &owner, const ByteVector &id); + + /*! + * Destroys the frame. + */ + ~UniqueFileIdentifierFrame(); + + /*! + * Returns the owner for the frame; essentially this is the key for + * determining which identification scheme this key belongs to. This + * will usually either be an email address or URL for the person or tool + * used to create the unique identifier. + * + * \see setOwner() + */ + String owner() const; + + /*! + * Returns the unique identifier. Though sometimes this is a text string + * it also may be binary data and as much should be assumed when handling + * it. + */ + ByteVector identifier() const; + + /*! + * Sets the owner of the identification scheme to \a s. + * + * \see owner() + */ + void setOwner(const String &s); + + /*! + * Sets the unique file identifier to \a v. + * + * \see identifier() + */ + void setIdentifier(const ByteVector &v); + + virtual String toString() const; + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + UniqueFileIdentifierFrame(const UniqueFileIdentifierFrame &); + UniqueFileIdentifierFrame &operator=(const UniqueFileIdentifierFrame &); + + UniqueFileIdentifierFrame(const ByteVector &data, Header *h); + + class UniqueFileIdentifierFramePrivate; + UniqueFileIdentifierFramePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/unknownframe.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/unknownframe.h new file mode 100644 index 0000000..6559f4e --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/unknownframe.h @@ -0,0 +1,79 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_UNKNOWNFRAME_H +#define TAGLIB_UNKNOWNFRAME_H + +#include "id3v2frame.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! A frame type \e unknown to TagLib. + + /*! + * This class represents a frame type not known (or more often simply + * unimplemented) in TagLib. This is here provide a basic API for + * manipulating the binary data of unknown frames and to provide a means + * of rendering such \e unknown frames. + * + * Please note that a cleaner way of handling frame types that TagLib + * does not understand is to subclass ID3v2::Frame and ID3v2::FrameFactory + * to have your frame type supported through the standard ID3v2 mechanism. + */ + + class TAGLIB_EXPORT UnknownFrame : public Frame + { + friend class FrameFactory; + + public: + UnknownFrame(const ByteVector &data); + virtual ~UnknownFrame(); + + virtual String toString() const; + + /*! + * Returns the field data (everything but the header) for this frame. + */ + ByteVector data() const; + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + UnknownFrame(const ByteVector &data, Header *h); + UnknownFrame(const UnknownFrame &); + UnknownFrame &operator=(const UnknownFrame &); + + class UnknownFramePrivate; + UnknownFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/unsynchronizedlyricsframe.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/unsynchronizedlyricsframe.h new file mode 100644 index 0000000..3af354f --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/unsynchronizedlyricsframe.h @@ -0,0 +1,179 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + copyright : (C) 2006 by Urs Fleisch + email : ufleisch@users.sourceforge.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_UNSYNCHRONIZEDLYRICSFRAME_H +#define TAGLIB_UNSYNCHRONIZEDLYRICSFRAME_H + +#include "id3v2frame.h" + +namespace TagLib { + + namespace ID3v2 { + + //! ID3v2 unsynchronized lyrics frame + /*! + * An implementation of ID3v2 unsynchronized lyrics. + */ + class TAGLIB_EXPORT UnsynchronizedLyricsFrame : public Frame + { + friend class FrameFactory; + + public: + /*! + * Construct an empty unsynchronized lyrics frame that will use the text encoding + * \a encoding. + */ + explicit UnsynchronizedLyricsFrame(String::Type encoding = String::Latin1); + + /*! + * Construct a unsynchronized lyrics frame based on the data in \a data. + */ + explicit UnsynchronizedLyricsFrame(const ByteVector &data); + + /*! + * Destroys this UnsynchronizedLyricsFrame instance. + */ + virtual ~UnsynchronizedLyricsFrame(); + + /*! + * Returns the text of this unsynchronized lyrics frame. + * + * \see text() + */ + virtual String toString() const; + + /*! + * Returns the language encoding as a 3 byte encoding as specified by + * ISO-639-2. + * + * \note Most taggers simply ignore this value. + * + * \see setLanguage() + */ + ByteVector language() const; + + /*! + * Returns the description of this unsynchronized lyrics frame. + * + * \note Most taggers simply ignore this value. + * + * \see setDescription() + */ + String description() const; + + /*! + * Returns the text of this unsynchronized lyrics frame. + * + * \see setText() + */ + String text() const; + + /*! + * Set the language using the 3 byte language code from + * ISO-639-2 to + * \a languageCode. + * + * \see language() + */ + void setLanguage(const ByteVector &languageCode); + + /*! + * Sets the description of the unsynchronized lyrics frame to \a s. + * + * \see decription() + */ + void setDescription(const String &s); + + /*! + * Sets the text portion of the unsynchronized lyrics frame to \a s. + * + * \see text() + */ + virtual void setText(const String &s); + + /*! + * Returns the text encoding that will be used in rendering this frame. + * This defaults to the type that was either specified in the constructor + * or read from the frame when parsed. + * + * \see setTextEncoding() + * \see render() + */ + String::Type textEncoding() const; + + /*! + * Sets the text encoding to be used when rendering this frame to + * \a encoding. + * + * \see textEncoding() + * \see render() + */ + void setTextEncoding(String::Type encoding); + + + /*! Parses this frame as PropertyMap with a single key. + * - if description() is empty or "LYRICS", the key will be "LYRICS" + * - if description() is not a valid PropertyMap key, the frame will be + * marked unsupported by an entry "USLT/" in the unsupportedData() + * attribute of the returned map. + * - otherwise, the key will be "LYRICS:" + * - The single value will be the frame's text(). + * Note that currently the language() field is not supported by the PropertyMap + * interface. + */ + PropertyMap asProperties() const; + + /*! + * LyricsFrames each have a unique description. This searches for a lyrics + * frame with the decription \a d and returns a pointer to it. If no + * frame is found that matches the given description null is returned. + * + * \see description() + */ + static UnsynchronizedLyricsFrame *findByDescription(const Tag *tag, const String &d); + + protected: + // Reimplementations. + + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + private: + /*! + * The constructor used by the FrameFactory. + */ + UnsynchronizedLyricsFrame(const ByteVector &data, Header *h); + UnsynchronizedLyricsFrame(const UnsynchronizedLyricsFrame &); + UnsynchronizedLyricsFrame &operator=(const UnsynchronizedLyricsFrame &); + + class UnsynchronizedLyricsFramePrivate; + UnsynchronizedLyricsFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/urllinkframe.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/urllinkframe.h new file mode 100644 index 0000000..7ac966b --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/frames/urllinkframe.h @@ -0,0 +1,189 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + copyright : (C) 2006 by Urs Fleisch + email : ufleisch@users.sourceforge.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_URLLINKFRAME_H +#define TAGLIB_URLLINKFRAME_H + +#include "id3v2frame.h" + +namespace TagLib { + + namespace ID3v2 { + + //! ID3v2 URL frame + /*! + * An implementation of ID3v2 URL link frames. + */ + class TAGLIB_EXPORT UrlLinkFrame : public Frame + { + friend class FrameFactory; + + public: + /*! + * This is a dual purpose constructor. \a data can either be binary data + * that should be parsed or (at a minimum) the frame ID. + */ + explicit UrlLinkFrame(const ByteVector &data); + + /*! + * Destroys this UrlLinkFrame instance. + */ + virtual ~UrlLinkFrame(); + + /*! + * Returns the URL. + */ + virtual String url() const; + + /*! + * Sets the URL to \a s. + */ + virtual void setUrl(const String &s); + + // Reimplementations. + + virtual void setText(const String &s); + virtual String toString() const; + PropertyMap asProperties() const; + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + /*! + * The constructor used by the FrameFactory. + */ + UrlLinkFrame(const ByteVector &data, Header *h); + + private: + UrlLinkFrame(const UrlLinkFrame &); + UrlLinkFrame &operator=(const UrlLinkFrame &); + + class UrlLinkFramePrivate; + UrlLinkFramePrivate *d; + }; + + //! ID3v2 User defined URL frame + + /*! + * This is a specialization of URL link frames that allows for + * user defined entries. Each entry has a description in addition to the + * normal list of fields that a URL link frame has. + * + * This description identifies the frame and must be unique. + */ + class TAGLIB_EXPORT UserUrlLinkFrame : public UrlLinkFrame + { + friend class FrameFactory; + + public: + /*! + * Constructs an empty user defined URL link frame. For this to be + * a useful frame both a description and text must be set. + */ + explicit UserUrlLinkFrame(String::Type encoding = String::Latin1); + + /*! + * This is a dual purpose constructor. \a data can either be binary data + * that should be parsed or (at a minimum) the frame ID. + */ + explicit UserUrlLinkFrame(const ByteVector &data); + + /*! + * Destroys this UserUrlLinkFrame instance. + */ + virtual ~UserUrlLinkFrame(); + + // Reimplementations. + + virtual String toString() const; + + /*! + * Returns the text encoding that will be used in rendering this frame. + * This defaults to the type that was either specified in the constructor + * or read from the frame when parsed. + * + * \see setTextEncoding() + * \see render() + */ + String::Type textEncoding() const; + + /*! + * Sets the text encoding to be used when rendering this frame to + * \a encoding. + * + * \see textEncoding() + * \see render() + */ + void setTextEncoding(String::Type encoding); + + /*! + * Returns the description for this frame. + */ + String description() const; + + /*! + * Sets the description of the frame to \a s. \a s must be unique. + */ + void setDescription(const String &s); + + /*! + * Parses the UserUrlLinkFrame as PropertyMap. The description() is taken as key, + * and the URL as single value. + * - if description() is empty, the key will be "URL". + * - otherwise, if description() is not a valid key (e.g. containing non-ASCII + * characters), the returned map will contain an entry "WXXX/" + * in its unsupportedData() list. + */ + PropertyMap asProperties() const; + + /*! + * Searches for the user defined url frame with the description \a description + * in \a tag. This returns null if no matching frames were found. + */ + static UserUrlLinkFrame *find(Tag *tag, const String &description); + + protected: + virtual void parseFields(const ByteVector &data); + virtual ByteVector renderFields() const; + + /*! + * The constructor used by the FrameFactory. + */ + UserUrlLinkFrame(const ByteVector &data, Header *h); + + private: + UserUrlLinkFrame(const UserUrlLinkFrame &); + UserUrlLinkFrame &operator=(const UserUrlLinkFrame &); + + class UserUrlLinkFramePrivate; + UserUrlLinkFramePrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2extendedheader.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2extendedheader.h new file mode 100644 index 0000000..d7227e9 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2extendedheader.h @@ -0,0 +1,93 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2EXTENDEDHEADER_H +#define TAGLIB_ID3V2EXTENDEDHEADER_H + +#include "taglib_export.h" +#include "tbytevector.h" +#include "taglib.h" + +namespace TagLib { + + namespace ID3v2 { + + //! ID3v2 extended header implementation + + /*! + * This class implements ID3v2 extended headers. It attempts to follow, + * both semantically and programatically, the structure specified in + * the ID3v2 standard. The API is based on the properties of ID3v2 extended + * headers specified there. If any of the terms used in this documentation + * are unclear please check the specification in the linked section. + * (Structure, 3.2) + */ + + class TAGLIB_EXPORT ExtendedHeader + { + public: + /*! + * Constructs an empty ID3v2 extended header. + */ + ExtendedHeader(); + + /*! + * Destroys the extended header. + */ + virtual ~ExtendedHeader(); + + /*! + * Returns the size of the extended header. This is variable for the + * extended header. + */ + uint size() const; + + /*! + * Sets the data that will be used as the extended header. Since the + * length is not known before the extended header has been parsed, this + * should just be a pointer to the first byte of the extended header. It + * will determine the length internally and make that available through + * size(). + */ + void setData(const ByteVector &data); + + protected: + /*! + * Called by setData() to parse the extended header data. It makes this + * information available through the public API. + */ + void parse(const ByteVector &data); + + private: + ExtendedHeader(const ExtendedHeader &); + ExtendedHeader &operator=(const ExtendedHeader &); + + class ExtendedHeaderPrivate; + ExtendedHeaderPrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2footer.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2footer.h new file mode 100644 index 0000000..1374a14 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2footer.h @@ -0,0 +1,82 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2FOOTER_H +#define TAGLIB_ID3V2FOOTER_H + +#include "taglib_export.h" +#include "tbytevector.h" + +namespace TagLib { + + namespace ID3v2 { + + class Header; + + //! ID3v2 footer implementation + + /*! + * Per the ID3v2 specification, the tag's footer is just a copy of the + * information in the header. As such there is no API for reading the + * data from the header, it can just as easily be done from the header. + * + * In fact, at this point, TagLib does not even parse the footer since + * it is not useful internally. However, if the flag to include a footer + * has been set in the ID3v2::Tag, TagLib will render a footer. + */ + + class TAGLIB_EXPORT Footer + { + public: + /*! + * Constructs an empty ID3v2 footer. + */ + Footer(); + /*! + * Destroys the footer. + */ + virtual ~Footer(); + + /*! + * Returns the size of the footer. Presently this is always 10 bytes. + */ + static uint size(); + + /*! + * Renders the footer based on the data in \a header. + */ + ByteVector render(const Header *header) const; + + private: + Footer(const Footer &); + Footer &operator=(const Footer &); + + class FooterPrivate; + FooterPrivate *d; + }; + + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2frame.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2frame.h new file mode 100644 index 0000000..95c4070 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2frame.h @@ -0,0 +1,509 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2FRAME_H +#define TAGLIB_ID3V2FRAME_H + +#include "tstring.h" +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + class StringList; + class PropertyMap; + + namespace ID3v2 { + + class Tag; + class FrameFactory; + + //! ID3v2 frame implementation + + /*! + * This class is the main ID3v2 frame implementation. In ID3v2, a tag is + * split between a collection of frames (which are in turn split into fields + * (Structure, 4) + * (Frames). This class provides an API for + * gathering information about and modifying ID3v2 frames. Funtionallity + * specific to a given frame type is handed in one of the many subclasses. + */ + + class TAGLIB_EXPORT Frame + { + friend class Tag; + friend class FrameFactory; + + public: + + /*! + * Creates a textual frame which corresponds to a single key in the PropertyMap + * interface. These are all (User)TextIdentificationFrames except TIPL and TMCL, + * all (User)URLLinkFrames, CommentsFrames, and UnsynchronizedLyricsFrame. + */ + static Frame *createTextualFrame(const String &key, const StringList &values); + + /*! + * Destroys this Frame instance. + */ + virtual ~Frame(); + + /*! + * Returns the Frame ID (Structure, 4) + * (Frames, 4) + */ + ByteVector frameID() const; + + /*! + * Returns the size of the frame. + */ + uint size() const; + + /*! + * Returns the size of the frame header + * + * \deprecated This is only accurate for ID3v2.3 or ID3v2.4. Please use + * the call below which accepts an ID3v2 version number. In the next + * non-binary compatible release this will be made into a non-static + * member that checks the internal ID3v2 version. + */ + static uint headerSize(); // BIC: remove and make non-static + + /*! + * Returns the size of the frame header for the given ID3v2 version. + * + * \deprecated Please see the explanation above. + */ + static uint headerSize(uint version); // BIC: remove and make non-static + + /*! + * Sets the data that will be used as the frame. Since the length is not + * known before the frame has been parsed, this should just be a pointer to + * the first byte of the frame. It will determine the length internally + * and make that available through size(). + */ + void setData(const ByteVector &data); + + /*! + * Set the text of frame in the sanest way possible. This should only be + * reimplemented in frames where there is some logical mapping to text. + * + * \note If the frame type supports multiple text encodings, this will not + * change the text encoding of the frame; the string will be converted to + * that frame's encoding. Please use the specific APIs of the frame types + * to set the encoding if that is desired. + */ + virtual void setText(const String &text); + + /*! + * This returns the textual representation of the data in the frame. + * Subclasses must reimplement this method to provide a string + * representation of the frame's data. + */ + virtual String toString() const = 0; + + /*! + * Render the frame back to its binary format in a ByteVector. + */ + ByteVector render() const; + + /*! + * Returns the text delimiter that is used between fields for the string + * type \a t. + */ + static ByteVector textDelimiter(String::Type t); + + /*! + * The string with which an instrument name is prefixed to build a key in a PropertyMap; + * used to translate PropertyMaps to TMCL frames. In the current implementation, this + * is "PERFORMER:". + */ + static const String instrumentPrefix; + /*! + * The PropertyMap key prefix which triggers the use of a COMM frame instead of a TXXX + * frame for a non-standard key. In the current implementation, this is "COMMENT:". + */ + static const String commentPrefix; + /*! + * The PropertyMap key prefix which triggers the use of a USLT frame instead of a TXXX + * frame for a non-standard key. In the current implementation, this is "LYRICS:". + */ + static const String lyricsPrefix; + /*! + * The PropertyMap key prefix which triggers the use of a WXXX frame instead of a TXX + * frame for a non-standard key. In the current implementation, this is "URL:". + */ + static const String urlPrefix; + + protected: + class Header; + + /*! + * Constructs an ID3v2 frame using \a data to read the header information. + * All other processing of \a data should be handled in a subclass. + * + * \note This need not contain anything more than a frame ID, but + * \e must constain at least that. + */ + explicit Frame(const ByteVector &data); + + /*! + * This creates an Frame using the header \a h. + * + * The ownership of this header will be assigned to the frame and the + * header will be deleted when the frame is destroyed. + */ + Frame(Header *h); + + /*! + * Returns a pointer to the frame header. + */ + Header *header() const; + + /*! + * Sets the header to \a h. If \a deleteCurrent is true, this will free + * the memory of the current header. + * + * The ownership of this header will be assigned to the frame and the + * header will be deleted when the frame is destroyed. + */ + void setHeader(Header *h, bool deleteCurrent = true); + + /*! + * Called by setData() to parse the frame data. It makes this information + * available through the public API. + */ + void parse(const ByteVector &data); + + /*! + * Called by parse() to parse the field data. It makes this information + * available through the public API. This must be overridden by the + * subclasses. + */ + virtual void parseFields(const ByteVector &data) = 0; + + /*! + * Render the field data back to a binary format in a ByteVector. This + * must be overridden by subclasses. + */ + virtual ByteVector renderFields() const = 0; + + /*! + * Returns a ByteVector containing the field data given the frame data. + * This correctly adjusts for the header size plus any additional frame + * data that's specified in the frame header flags. + */ + ByteVector fieldData(const ByteVector &frameData) const; + + /*! + * Reads a String of type \a encodiong from the ByteVector \a data. If \a + * position is passed in it is used both as the starting point and is + * updated to replect the position just after the string that has been read. + * This is useful for reading strings sequentially. + */ + String readStringField(const ByteVector &data, String::Type encoding, + int *positon = 0); + + /*! + * Checks a the list of string values to see if they can be used with the + * specified encoding and returns the recommended encoding. + */ + // BIC: remove and make non-static + static String::Type checkEncoding(const StringList &fields, + String::Type encoding); + + /*! + * Checks a the list of string values to see if they can be used with the + * specified encoding and returns the recommended encoding. This method + * also checks the ID3v2 version and makes sure the encoding can be used + * in the specified version. + */ + // BIC: remove and make non-static + static String::Type checkEncoding(const StringList &fields, + String::Type encoding, uint version); + + /*! + * Checks a the list of string values to see if they can be used with the + * specified encoding and returns the recommended encoding. This method + * also checks the ID3v2 version and makes sure the encoding can be used + * in the version specified by the frame's header. + */ + String::Type checkTextEncoding(const StringList &fields, + String::Type encoding) const; + + + /*! + * Parses the contents of this frame as PropertyMap. If that fails, the returend + * PropertyMap will be empty, and its unsupportedData() will contain this frame's + * ID. + * BIC: Will be a virtual function in future releases. + */ + PropertyMap asProperties() const; + + /*! + * Returns an appropriate ID3 frame ID for the given free-form tag key. This method + * will return ByteVector::null if no specialized translation is found. + */ + static ByteVector keyToFrameID(const String &); + + /*! + * Returns a free-form tag name for the given ID3 frame ID. Note that this does not work + * for general frame IDs such as TXXX or WXXX; in such a case String::null is returned. + */ + static String frameIDToKey(const ByteVector &); + + + /*! + * This helper function splits the PropertyMap \a original into three ProperytMaps + * \a singleFrameProperties, \a tiplProperties, and \a tmclProperties, such that: + * - \a singleFrameProperties contains only of keys which can be represented with + * exactly one ID3 frame per key. In the current implementation + * this is everything except for the fixed "involved people" keys and keys of the + * form "TextIdentificationFrame::instrumentPrefix" + "instrument", which are + * mapped to a TMCL frame. + * - \a tiplProperties will consist of those keys that are present in + * TextIdentificationFrame::involvedPeopleMap() + * - \a tmclProperties contains the "musician credits" keys which should be mapped + * to a TMCL frame + */ + static void splitProperties(const PropertyMap &original, PropertyMap &singleFrameProperties, + PropertyMap &tiplProperties, PropertyMap &tmclProperties); + + private: + Frame(const Frame &); + Frame &operator=(const Frame &); + + class FramePrivate; + friend class FramePrivate; + FramePrivate *d; + }; + + //! ID3v2 frame header implementation + + /*! + * The ID3v2 Frame Header (Structure, 4) + * + * Every ID3v2::Frame has an associated header that gives some general + * properties of the frame and also makes it possible to identify the frame + * type. + * + * As such when reading an ID3v2 tag ID3v2::FrameFactory first creates the + * frame headers and then creates the appropriate Frame subclass based on + * the type and attaches the header. + */ + + class TAGLIB_EXPORT Frame::Header + { + public: + /*! + * Construct a Frame Header based on \a data. \a data must at least + * contain a 4 byte frame ID, and optionally can contain flag data and the + * frame size. i.e. Just the frame id -- "TALB" -- is a valid value. + * + * \deprecated Please use the constructor below that accepts a version + * number. + */ + Header(const ByteVector &data, bool synchSafeInts); + + /*! + * Construct a Frame Header based on \a data. \a data must at least + * contain a 4 byte frame ID, and optionally can contain flag data and the + * frame size. i.e. Just the frame id -- "TALB" -- is a valid value. + * + * \a version should be the ID3v2 version of the tag. + */ + explicit Header(const ByteVector &data, uint version = 4); + + /*! + * Destroys this Header instance. + */ + virtual ~Header(); + + /*! + * Sets the data for the Header. + * + * \deprecated Please use the version below that accepts an ID3v2 version + * number. + */ + void setData(const ByteVector &data, bool synchSafeInts); + + /*! + * Sets the data for the Header. \a version should indicate the ID3v2 + * version number of the tag that this frame is contained in. + */ + void setData(const ByteVector &data, uint version = 4); + + /*! + * Returns the Frame ID (Structure, 4) + * (Frames, 4) + */ + ByteVector frameID() const; + + /*! + * Sets the frame's ID to \a id. Only the first four bytes of \a id will + * be used. + * + * \warning This method should in general be avoided. It exists simply to + * provide a mechanism for transforming frames from a deprecated frame type + * to a newer one -- i.e. TYER to TDRC from ID3v2.3 to ID3v2.4. + */ + void setFrameID(const ByteVector &id); + + /*! + * Returns the size of the frame data portion, as set when setData() was + * called or set explicitly via setFrameSize(). + */ + uint frameSize() const; + + /*! + * Sets the size of the frame data portion. + */ + void setFrameSize(uint size); + + /*! + * Returns the ID3v2 version of the header, as passed in from the + * construction of the header or set via setVersion(). + */ + uint version() const; + + /*! + * Sets the ID3v2 version of the header, changing has impact on the + * correct parsing/rendering of frame data. + */ + void setVersion(uint version); + + /*! + * Returns the size of the frame header in bytes. + * + * \deprecated Please use the version of this method that accepts a + * version. This is only accurate for ID3v2.3 and ID3v2.4. This will be + * removed in the next binary incompatible release (2.0) and will be + * replaced with a non-static method that checks the frame version. + */ + static uint size(); + + /*! + * Returns the size of the frame header in bytes for the ID3v2 version + * that's given. + * + * \deprecated Please see the explanation in the version above. + */ + static uint size(uint version); + + /*! + * Returns true if the flag for tag alter preservation is set. + * + * The semantics are a little backwards from what would seem natural + * (setting the preservation flag to throw away the frame), but this + * follows the ID3v2 standard. + * + * \see setTagAlterPreservation() + */ + bool tagAlterPreservation() const; + + /*! + * Sets the flag for preservation of this frame if the tag is set. If + * this is set to true the frame will not be written when the tag is + * saved. + * + * The semantics are a little backwards from what would seem natural + * (setting the preservation flag to throw away the frame), but this + * follows the ID3v2 standard. + * + * \see tagAlterPreservation() + */ + void setTagAlterPreservation(bool discard); + + /*! + * Returns true if the flag for file alter preservation is set. + * + * \note This flag is currently ignored internally in TagLib. + */ + bool fileAlterPreservation() const; + + /*! + * Returns true if the frame is meant to be read only. + * + * \note This flag is currently ignored internally in TagLib. + */ + bool readOnly() const; + + /*! + * Returns true if the flag for the grouping identifity is set. + * + * \note This flag is currently ignored internally in TagLib. + */ + bool groupingIdentity() const; + + /*! + * Returns true if compression is enabled for this frame. + * + * \note This flag is currently ignored internally in TagLib. + */ + bool compression() const; + + /*! + * Returns true if encryption is enabled for this frame. + * + * \note This flag is currently ignored internally in TagLib. + */ + bool encryption() const; + +#ifndef DO_NOT_DOCUMENT + bool unsycronisation() const; +#endif + + /*! + * Returns true if unsynchronisation is enabled for this frame. + */ + bool unsynchronisation() const; + + /*! + * Returns true if the flag for a data length indicator is set. + */ + bool dataLengthIndicator() const; + + /*! + * Render the Header back to binary format in a ByteVector. + */ + ByteVector render() const; + + /*! + * \deprecated + */ + bool frameAlterPreservation() const; + + private: + Header(const Header &); + Header &operator=(const Header &); + + class HeaderPrivate; + HeaderPrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2framefactory.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2framefactory.h new file mode 100644 index 0000000..16419c7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2framefactory.h @@ -0,0 +1,167 @@ + /*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2FRAMEFACTORY_H +#define TAGLIB_ID3V2FRAMEFACTORY_H + +#include "taglib_export.h" +#include "tbytevector.h" +#include "id3v2frame.h" +#include "id3v2header.h" + +namespace TagLib { + + namespace ID3v2 { + + class TextIdentificationFrame; + + //! A factory for creating ID3v2 frames during parsing + + /*! + * This factory abstracts away the frame creation process and instantiates + * the appropriate ID3v2::Frame subclasses based on the contents of the + * data. + * + * Reimplementing this factory is the key to adding support for frame types + * not directly supported by TagLib to your application. To do so you would + * subclass this factory reimplement createFrame(). Then by setting your + * factory to be the default factory in ID3v2::Tag constructor or with + * MPEG::File::setID3v2FrameFactory() you can implement behavior that will + * allow for new ID3v2::Frame subclasses (also provided by you) to be used. + * + * This implements both abstract factory and singleton patterns + * of which more information is available on the web and in software design + * textbooks (Notably Design Patters). + * + * \note You do not need to use this factory to create new frames to add to + * an ID3v2::Tag. You can instantiate frame subclasses directly (with new) + * and add them to a tag using ID3v2::Tag::addFrame() + * + * \see ID3v2::Tag::addFrame() + */ + + class TAGLIB_EXPORT FrameFactory + { + public: + static FrameFactory *instance(); + /*! + * Create a frame based on \a data. \a synchSafeInts should only be set + * false if we are parsing an old tag (v2.3 or older) that does not support + * synchsafe ints. + * + * \deprecated Please use the method below that accepts a ID3v2::Header + * instance in new code. + */ + Frame *createFrame(const ByteVector &data, bool synchSafeInts) const; + + /*! + * Create a frame based on \a data. \a version should indicate the ID3v2 + * version of the tag. As ID3v2.4 is the most current version of the + * standard 4 is the default. + * + * \deprecated Please use the method below that accepts a ID3v2::Header + * instance in new code. + */ + Frame *createFrame(const ByteVector &data, uint version = 4) const; + + /*! + * Create a frame based on \a data. \a tagHeader should be a valid + * ID3v2::Header instance. + */ + // BIC: make virtual + Frame *createFrame(const ByteVector &data, Header *tagHeader) const; + + /*! + * Returns the default text encoding for text frames. If setTextEncoding() + * has not been explicitly called this will only be used for new text + * frames. However, if this value has been set explicitly all frames will be + * converted to this type (unless it's explitly set differently for the + * individual frame) when being rendered. + * + * \see setDefaultTextEncoding() + */ + String::Type defaultTextEncoding() const; + + /*! + * Set the default text encoding for all text frames that are created to + * \a encoding. If no value is set the frames with either default to the + * encoding type that was parsed and new frames default to Latin1. + * + * Valid string types for ID3v2 tags are Latin1, UTF8, UTF16 and UTF16BE. + * + * \see defaultTextEncoding() + */ + void setDefaultTextEncoding(String::Type encoding); + + protected: + /*! + * Constructs a frame factory. Because this is a singleton this method is + * protected, but may be used for subclasses. + */ + FrameFactory(); + + /*! + * Destroys the frame factory. In most cases this will never be called (as + * is typical of singletons). + */ + virtual ~FrameFactory(); + + /*! + * This method checks for compliance to the current ID3v2 standard (2.4) + * and does nothing in the common case. However if a frame is found that + * is not compatible with the current standard, this method either updates + * the frame or indicates that it should be discarded. + * + * This method with return true (with or without changes to the frame) if + * this frame should be kept or false if it should be discarded. + * + * See the id3v2.4.0-changes.txt document for further information. + */ + virtual bool updateFrame(Frame::Header *header) const; + + private: + FrameFactory(const FrameFactory &); + FrameFactory &operator=(const FrameFactory &); + + /*! + * This method is used internally to convert a frame from ID \a from to ID + * \a to. If the frame matches the \a from pattern and converts the frame + * ID in the \a header or simply does nothing if the frame ID does not match. + */ + void convertFrame(const char *from, const char *to, + Frame::Header *header) const; + + void updateGenre(TextIdentificationFrame *frame) const; + + static FrameFactory factory; + + class FrameFactoryPrivate; + FrameFactoryPrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2header.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2header.h new file mode 100644 index 0000000..307ba96 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2header.h @@ -0,0 +1,175 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2HEADER_H +#define TAGLIB_ID3V2HEADER_H + +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace ID3v2 { + + //! An implementation of ID3v2 headers + + /*! + * This class implements ID3v2 headers. It attempts to follow, both + * semantically and programatically, the structure specified in + * the ID3v2 standard. The API is based on the properties of ID3v2 headers + * specified there. If any of the terms used in this documentation are + * unclear please check the specification in the linked section. + * (Structure, 3.1) + */ + + class TAGLIB_EXPORT Header + { + public: + /*! + * Constructs an empty ID3v2 header. + */ + Header(); + + /*! + * Constructs an ID3v2 header based on \a data. parse() is called + * immediately. + */ + Header(const ByteVector &data); + + /*! + * Destroys the header. + */ + virtual ~Header(); + + /*! + * Returns the major version number. (Note: This is the 4, not the 2 in + * ID3v2.4.0. The 2 is implied.) + */ + uint majorVersion() const; + + /*! + * Set the the major version number to \a version. (Note: This is + * the 4, not the 2 in ID3v2.4.0. The 2 is implied.) + * \see majorVersion() + * + * \note This is used by the internal parser; this will not change the + * version which is written and in general should not be called by API + * users. + */ + void setMajorVersion(uint version); + + /*! + * Returns the revision number. (Note: This is the 0, not the 4 in + * ID3v2.4.0. The 2 is implied.) + */ + uint revisionNumber() const; + + /*! + * Returns true if unsynchronisation has been applied to all frames. + */ + bool unsynchronisation() const; + + /*! + * Returns true if an extended header is present in the tag. + */ + bool extendedHeader() const; + + /*! + * Returns true if the experimental indicator flag is set. + */ + bool experimentalIndicator() const; + + /*! + * Returns true if a footer is present in the tag. + */ + bool footerPresent() const; + /*! + * Returns the tag size in bytes. This is the size of the frame content. + * The size of the \e entire tag will be this plus the header size (10 + * bytes) and, if present, the footer size (potentially another 10 bytes). + * + * \note This is the value as read from the header to which TagLib attempts + * to provide an API to; it was not a design decision on the part of TagLib + * to not include the mentioned portions of the tag in the \e size. + * + * \see completeTagSize() + */ + uint tagSize() const; + + /*! + * Returns the tag size, including the header and, if present, the footer + * size. + * + * \see tagSize() + */ + uint completeTagSize() const; + + /*! + * Set the tag size to \a s. + * \see tagSize() + */ + void setTagSize(uint s); + + /*! + * Returns the size of the header. Presently this is always 10 bytes. + */ + static uint size(); + + /*! + * Returns the string used to identify and ID3v2 tag inside of a file. + * Presently this is always "ID3". + */ + static ByteVector fileIdentifier(); + + /*! + * Sets the data that will be used as the header. 10 bytes, starting from + * the beginning of \a data are used. + */ + void setData(const ByteVector &data); + + /*! + * Renders the Header back to binary format. + */ + ByteVector render() const; + + protected: + /*! + * Called by setData() to parse the header data. It makes this information + * available through the public API. + */ + void parse(const ByteVector &data); + + private: + Header(const Header &); + Header &operator=(const Header &); + + class HeaderPrivate; + HeaderPrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2synchdata.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2synchdata.h new file mode 100644 index 0000000..4a1f596 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2synchdata.h @@ -0,0 +1,70 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2SYNCHDATA_H +#define TAGLIB_ID3V2SYNCHDATA_H + +#include "tbytevector.h" +#include "taglib.h" + +namespace TagLib { + + namespace ID3v2 { + + //! A few functions for ID3v2 synch safe integer conversion + + /*! + * In the ID3v2.4 standard most integer values are encoded as "synch safe" + * integers which are encoded in such a way that they will not give false + * MPEG syncs and confuse MPEG decoders. This namespace provides some + * methods for converting to and from these values to ByteVectors for + * things rendering and parsing ID3v2 data. + */ + + namespace SynchData + { + /*! + * This returns the unsigned integer value of \a data where \a data is a + * ByteVector that contains a \e synchsafe integer (Structure, + * 6.2). The default \a length of + * 4 is used if another value is not specified. + */ + TAGLIB_EXPORT uint toUInt(const ByteVector &data); + + /*! + * Returns a 4 byte (32 bit) synchsafe integer based on \a value. + */ + TAGLIB_EXPORT ByteVector fromUInt(uint value); + + /*! + * Convert the data from unsynchronized data to its original format. + */ + TAGLIB_EXPORT ByteVector decode(const ByteVector &input); + } + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2tag.h b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2tag.h new file mode 100644 index 0000000..94784e7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/id3v2/id3v2tag.h @@ -0,0 +1,361 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_ID3V2TAG_H +#define TAGLIB_ID3V2TAG_H + +#include "tag.h" +#include "tbytevector.h" +#include "tstring.h" +#include "tlist.h" +#include "tmap.h" +#include "taglib_export.h" + +#include "id3v2framefactory.h" + +namespace TagLib { + + class File; + + //! An ID3v2 implementation + + /*! + * This is a relatively complete and flexible framework for working with ID3v2 + * tags. + * + * \see ID3v2::Tag + */ + + namespace ID3v2 { + + class Header; + class ExtendedHeader; + class Footer; + + typedef List FrameList; + typedef Map FrameListMap; + + //! The main class in the ID3v2 implementation + + /*! + * This is the main class in the ID3v2 implementation. It serves two + * functions. This first, as is obvious from the public API, is to provide a + * container for the other ID3v2 related classes. In addition, through the + * read() and parse() protected methods, it provides the most basic level of + * parsing. In these methods the ID3v2 tag is extracted from the file and + * split into data components. + * + * ID3v2 tags have several parts, TagLib attempts to provide an interface + * for them all. header(), footer() and extendedHeader() corespond to those + * data structures in the ID3v2 standard and the APIs for the classes that + * they return attempt to reflect this. + * + * Also ID3v2 tags are built up from a list of frames, which are in turn + * have a header and a list of fields. TagLib provides two ways of accessing + * the list of frames that are in a given ID3v2 tag. The first is simply + * via the frameList() method. This is just a list of pointers to the frames. + * The second is a map from the frame type -- i.e. "COMM" for comments -- and + * a list of frames of that type. (In some cases ID3v2 allows for multiple + * frames of the same type, hence this being a map to a list rather than just + * a map to an individual frame.) + * + * More information on the structure of frames can be found in the ID3v2::Frame + * class. + * + * read() and parse() pass binary data to the other ID3v2 class structures, + * they do not handle parsing of flags or fields, for instace. Those are + * handled by similar functions within those classes. + * + * \note All pointers to data structures within the tag will become invalid + * when the tag is destroyed. + * + * \warning Dealing with the nasty details of ID3v2 is not for the faint of + * heart and should not be done without much meditation on the spec. It's + * rather long, but if you're planning on messing with this class and others + * that deal with the details of ID3v2 (rather than the nice, safe, abstract + * TagLib::Tag and friends), it's worth your time to familiarize yourself + * with said spec (which is distrubuted with the TagLib sources). TagLib + * tries to do most of the work, but with a little luck, you can still + * convince it to generate invalid ID3v2 tags. The APIs for ID3v2 assume a + * working knowledge of ID3v2 structure. You're been warned. + */ + + class TAGLIB_EXPORT Tag : public TagLib::Tag + { + public: + /*! + * Constructs an empty ID3v2 tag. + * + * \note You must create at least one frame for this tag to be valid. + */ + Tag(); + + /*! + * Constructs an ID3v2 tag read from \a file starting at \a tagOffset. + * \a factory specifies which FrameFactory will be used for the + * construction of new frames. + * + * \note You should be able to ignore the \a factory parameter in almost + * all situations. You would want to specify your own FrameFactory + * subclass in the case that you are extending TagLib to support additional + * frame types, which would be incorperated into your factory. + * + * \see FrameFactory + */ + Tag(File *file, long tagOffset, + const FrameFactory *factory = FrameFactory::instance()); + + /*! + * Destroys this Tag instance. + */ + virtual ~Tag(); + + // Reimplementations. + + virtual String title() const; + virtual String artist() const; + virtual String album() const; + virtual String comment() const; + virtual String genre() const; + virtual uint year() const; + virtual uint track() const; + + virtual void setTitle(const String &s); + virtual void setArtist(const String &s); + virtual void setAlbum(const String &s); + virtual void setComment(const String &s); + virtual void setGenre(const String &s); + virtual void setYear(uint i); + virtual void setTrack(uint i); + + virtual bool isEmpty() const; + + /*! + * Returns a pointer to the tag's header. + */ + Header *header() const; + + /*! + * Returns a pointer to the tag's extended header or null if there is no + * extended header. + */ + ExtendedHeader *extendedHeader() const; + + /*! + * Returns a pointer to the tag's footer or null if there is no footer. + * + * \deprecated I don't see any reason to keep this around since there's + * nothing useful to be retrieved from the footer, but well, again, I'm + * prone to change my mind, so this gets to stay around until near a + * release. + */ + Footer *footer() const; + + /*! + * Returns a reference to the frame list map. This is an FrameListMap of + * all of the frames in the tag. + * + * This is the most convenient structure for accessing the tag's frames. + * Many frame types allow multiple instances of the same frame type so this + * is a map of lists. In most cases however there will only be a single + * frame of a certain type. + * + * Let's say for instance that you wanted to access the frame for total + * beats per minute -- the TBPM frame. + * + * \code + * TagLib::MPEG::File f("foo.mp3"); + * + * // Check to make sure that it has an ID3v2 tag + * + * if(f.ID3v2Tag()) { + * + * // Get the list of frames for a specific frame type + * + * TagLib::ID3v2::FrameList l = f.ID3v2Tag()->frameListMap()["TBPM"]; + * + * if(!l.isEmpty()) + * std::cout << l.front()->toString() << std::endl; + * } + * + * \endcode + * + * \warning You should not modify this data structure directly, instead + * use addFrame() and removeFrame(). + * + * \see frameList() + */ + const FrameListMap &frameListMap() const; + + /*! + * Returns a reference to the frame list. This is an FrameList of all of + * the frames in the tag in the order that they were parsed. + * + * This can be useful if for example you want iterate over the tag's frames + * in the order that they occur in the tag. + * + * \warning You should not modify this data structure directly, instead + * use addFrame() and removeFrame(). + */ + const FrameList &frameList() const; + + /*! + * Returns the frame list for frames with the id \a frameID or an empty + * list if there are no frames of that type. This is just a convenience + * and is equivalent to: + * + * \code + * frameListMap()[frameID]; + * \endcode + * + * \see frameListMap() + */ + const FrameList &frameList(const ByteVector &frameID) const; + + /*! + * Add a frame to the tag. At this point the tag takes ownership of + * the frame and will handle freeing its memory. + * + * \note Using this method will invalidate any pointers on the list + * returned by frameList() + */ + void addFrame(Frame *frame); + + /*! + * Remove a frame from the tag. If \a del is true the frame's memory + * will be freed; if it is false, it must be deleted by the user. + * + * \note Using this method will invalidate any pointers on the list + * returned by frameList() + */ + void removeFrame(Frame *frame, bool del = true); + + /*! + * Remove all frames of type \a id from the tag and free their memory. + * + * \note Using this method will invalidate any pointers on the list + * returned by frameList() + */ + void removeFrames(const ByteVector &id); + + /*! + * Implements the unified property interface -- export function. + * This function does some work to translate the hard-specified ID3v2 + * frame types into a free-form string-to-stringlist PropertyMap: + * - if ID3v2 frame ID is known by Frame::frameIDToKey(), the returned + * key is used + * - if the frame ID is "TXXX" (user text frame), the description() is + * used as key + * - if the frame ID is "WXXX" (user url frame), + * - if the description is empty or "URL", the key "URL" is used + * - otherwise, the key "URL:" is used; + * - if the frame ID is "COMM" (comments frame), + * - if the description is empty or "COMMENT", the key "COMMENT" + * is used + * - otherwise, the key "COMMENT:" is used; + * - if the frame ID is "USLT" (unsynchronized lyrics), + * - if the description is empty or "LYRICS", the key "LYRICS" is used + * - otherwise, the key "LYRICS:" is used; + * - if the frame ID is "TIPL" (involved peoples list), and if all the + * roles defined in the frame are known in TextIdentificationFrame::involvedPeopleMap(), + * then "=" will be contained in the returned obejct for each + * - if the frame ID is "TMCL" (musician credit list), then + * "PERFORMER:=" will be contained in the returned + * PropertyMap for each defined musician + * In any other case, the unsupportedData() of the returned object will contain + * the frame's ID and, in case of a frame ID which is allowed to appear more than + * once, the description, separated by a "/". + * + */ + PropertyMap properties() const; + + /*! + * Removes unsupported frames given by \a properties. The elements of + * \a properties must be taken from properties().unsupportedData(); they + * are of one of the following forms: + * - a four-character frame ID, if the ID3 specification allows only one + * frame with that ID (thus, the frame is uniquely determined) + * - frameID + "/" + description(), when the ID is one of "TXXX", "WXXX", + * "COMM", or "USLT", + * - "UNKNOWN/" + frameID, for frames that could not be parsed by TagLib. + * In that case, *all* unknown frames with the given ID will be removed. + */ + void removeUnsupportedProperties(const StringList &properties); + + /*! + * Implements the unified property interface -- import function. + * See the comments in properties(). + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Render the tag back to binary data, suitable to be written to disk. + */ + ByteVector render() const; + + /*! + * Render the tag back to binary data, suitable to be written to disk. + * + * The \a version parameter specifies the version of the rendered + * ID3v2 tag. It can be either 4 or 3. + */ + // BIC: combine with the above method + ByteVector render(int version) const; + + protected: + /*! + * Reads data from the file specified in the constructor. It does basic + * parsing of the data in the largest chunks. It partitions the tag into + * the Header, the body of the tag (which contains the ExtendedHeader and + * frames) and Footer. + */ + void read(); + + /*! + * This is called by read to parse the body of the tag. It determines if an + * extended header exists and adds frames to the FrameListMap. + */ + void parse(const ByteVector &data); + + /*! + * Sets the value of the text frame with the Frame ID \a id to \a value. + * If the frame does not exist, it is created. + */ + void setTextFrame(const ByteVector &id, const String &value); + + void downgradeFrames(FrameList *existingFrames, FrameList *newFrames) const; + + private: + Tag(const Tag &); + Tag &operator=(const Tag &); + + class TagPrivate; + TagPrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/mpegfile.h b/Audio-Frameworks/bin/taglib/headers/mpeg/mpegfile.h new file mode 100644 index 0000000..185fced --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/mpegfile.h @@ -0,0 +1,323 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MPEGFILE_H +#define TAGLIB_MPEGFILE_H + +#include "taglib_export.h" +#include "tfile.h" +#include "tag.h" + +#include "mpegproperties.h" + +namespace TagLib { + + namespace ID3v2 { class Tag; class FrameFactory; } + namespace ID3v1 { class Tag; } + namespace APE { class Tag; } + + //! An implementation of TagLib::File with MPEG (MP3) specific methods + + namespace MPEG { + + //! An MPEG file class with some useful methods specific to MPEG + + /*! + * This implements the generic TagLib::File API and additionally provides + * access to properties that are distinct to MPEG files, notably access + * to the different ID3 tags. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * This set of flags is used for various operations and is suitable for + * being OR-ed together. + */ + enum TagTypes { + //! Empty set. Matches no tag types. + NoTags = 0x0000, + //! Matches ID3v1 tags. + ID3v1 = 0x0001, + //! Matches ID3v2 tags. + ID3v2 = 0x0002, + //! Matches APE tags. + APE = 0x0004, + //! Matches all tag types. + AllTags = 0xffff + }; + + /*! + * Contructs an MPEG file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \deprecated This constructor will be dropped in favor of the one below + * in a future version. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an MPEG file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. The frames will be created using + * \a frameFactory. + * + * \deprecated This constructor will be dropped in favor of the one below + * in a future version. + */ + File(FileName file, ID3v2::FrameFactory *frameFactory, + bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an MPEG file from \a stream. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. The frames will be created using + * \a frameFactory. + */ + // BIC: merge with the above constructor + File(IOStream *stream, ID3v2::FrameFactory *frameFactory, + bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns a pointer to a tag that is the union of the ID3v2 and ID3v1 + * tags. The ID3v2 tag is given priority in reading the information -- if + * requested information exists in both the ID3v2 tag and the ID3v1 tag, + * the information from the ID3v2 tag will be returned. + * + * If you would like more granular control over the content of the tags, + * with the concession of generality, use the tag-type specific calls. + * + * \note As this tag is not implemented as an ID3v2 tag or an ID3v1 tag, + * but a union of the two this pointer may not be cast to the specific + * tag types. + * + * \see ID3v1Tag() + * \see ID3v2Tag() + * \see APETag() + */ + virtual Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * If the file contains more than one tag, only the + * first one (in the order ID3v2, APE, ID3v1) will be converted to the + * PropertyMap. + */ + PropertyMap properties() const; + + void removeUnsupportedProperties(const StringList &properties); + + /*! + * Implements the unified tag dictionary interface -- import function. + * As with the export, only one tag is taken into account. If the file + * has no tag at all, ID3v2 will be created. + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the MPEG::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Save the file. If at least one tag -- ID3v1 or ID3v2 -- exists this + * will duplicate its content into the other tag. This returns true + * if saving was successful. + * + * If neither exists or if both tags are empty, this will strip the tags + * from the file. + * + * This is the same as calling save(AllTags); + * + * If you would like more granular control over the content of the tags, + * with the concession of generality, use paramaterized save call below. + * + * \see save(int tags) + */ + virtual bool save(); + + /*! + * Save the file. This will attempt to save all of the tag types that are + * specified by OR-ing together TagTypes values. The save() method above + * uses AllTags. This returns true if saving was successful. + * + * This strips all tags not included in the mask, but does not modify them + * in memory, so later calls to save() which make use of these tags will + * remain valid. This also strips empty tags. + */ + bool save(int tags); + + /*! + * Save the file. This will attempt to save all of the tag types that are + * specified by OR-ing together TagTypes values. The save() method above + * uses AllTags. This returns true if saving was successful. + * + * If \a stripOthers is true this strips all tags not included in the mask, + * but does not modify them in memory, so later calls to save() which make + * use of these tags will remain valid. This also strips empty tags. + */ + // BIC: combine with the above method + bool save(int tags, bool stripOthers); + + /*! + * Save the file. This will attempt to save all of the tag types that are + * specified by OR-ing together TagTypes values. The save() method above + * uses AllTags. This returns true if saving was successful. + * + * If \a stripOthers is true this strips all tags not included in the mask, + * but does not modify them in memory, so later calls to save() which make + * use of these tags will remain valid. This also strips empty tags. + * + * The \a id3v2Version parameter specifies the version of the saved + * ID3v2 tag. It can be either 4 or 3. + */ + // BIC: combine with the above method + bool save(int tags, bool stripOthers, int id3v2Version); + + /*! + * Returns a pointer to the ID3v2 tag of the file. + * + * A tag will always be returned, regardless of whether there is a + * tag in the file or not. Use ID3v2::Tag::isEmpty() to check if + * the tag contains no data. + * + * \note The Tag is still owned by the MPEG::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v2::Tag *ID3v2Tag(bool create = false); + + /*! + * Returns a pointer to the ID3v1 tag of the file. + * + * A tag will always be returned, regardless of whether there is a + * tag in the file or not. Use Tag::isEmpty() to check if + * the tag contains no data. + * + * \note The Tag is still owned by the MPEG::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v1::Tag *ID3v1Tag(bool create = false); + + /*! + * Returns a pointer to the APE tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid APE tag. If \a create is true it will create + * an APE tag if one does not exist. + * + * \note The Tag is still owned by the MPEG::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + APE::Tag *APETag(bool create = false); + + /*! + * This will strip the tags that match the OR-ed together TagTypes from the + * file. By default it strips all tags. It returns true if the tags are + * successfully stripped. + * + * This is equivalent to strip(tags, true) + * + * \note This will also invalidate pointers to the ID3 and APE tags + * as their memory will be freed. + */ + bool strip(int tags = AllTags); + + /*! + * This will strip the tags that match the OR-ed together TagTypes from the + * file. By default it strips all tags. It returns true if the tags are + * successfully stripped. + * + * If \a freeMemory is true the ID3 and APE tags will be deleted and + * pointers to them will be invalidated. + */ + // BIC: merge with the method above + bool strip(int tags, bool freeMemory); + + /*! + * Set the ID3v2::FrameFactory to something other than the default. + * + * \see ID3v2FrameFactory + */ + void setID3v2FrameFactory(const ID3v2::FrameFactory *factory); + + /*! + * Returns the position in the file of the first MPEG frame. + */ + long firstFrameOffset(); + + /*! + * Returns the position in the file of the next MPEG frame, + * using the current position as start + */ + long nextFrameOffset(long position); + + /*! + * Returns the position in the file of the previous MPEG frame, + * using the current position as start + */ + long previousFrameOffset(long position); + + /*! + * Returns the position in the file of the last MPEG frame. + */ + long lastFrameOffset(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + long findID3v2(); + long findID3v1(); + void findAPE(); + + /*! + * MPEG frames can be recognized by the bit pattern 11111111 111, so the + * first byte is easy to check for, however checking to see if the second byte + * starts with \e 111 is a bit more tricky, hence this member function. + */ + static bool secondSynchByte(char byte); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/mpegheader.h b/Audio-Frameworks/bin/taglib/headers/mpeg/mpegheader.h new file mode 100644 index 0000000..020ebd0 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/mpegheader.h @@ -0,0 +1,166 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MPEGHEADER_H +#define TAGLIB_MPEGHEADER_H + +#include "taglib_export.h" + +namespace TagLib { + + class ByteVector; + + namespace MPEG { + + //! An implementation of MP3 frame headers + + /*! + * This is an implementation of MPEG Layer III headers. The API follows more + * or less the binary format of these headers. I've used + * this + * document as a reference. + */ + + class TAGLIB_EXPORT Header + { + public: + /*! + * Parses an MPEG header based on \a data. + */ + Header(const ByteVector &data); + + /*! + * Does a shallow copy of \a h. + */ + Header(const Header &h); + + /*! + * Destroys this Header instance. + */ + virtual ~Header(); + + /*! + * Returns true if the frame is at least an appropriate size and has + * legal values. + */ + bool isValid() const; + + /*! + * The MPEG Version. + */ + enum Version { + //! MPEG Version 1 + Version1 = 0, + //! MPEG Version 2 + Version2 = 1, + //! MPEG Version 2.5 + Version2_5 = 2 + }; + + /*! + * Returns the MPEG Version of the header. + */ + Version version() const; + + /*! + * Returns the layer version. This will be between the values 1-3. + */ + int layer() const; + + /*! + * Returns true if the MPEG protection bit is enabled. + */ + bool protectionEnabled() const; + + /*! + * Returns the bitrate encoded in the header. + */ + int bitrate() const; + + /*! + * Returns the sample rate in Hz. + */ + int sampleRate() const; + + /*! + * Returns true if the frame is padded. + */ + bool isPadded() const; + + /*! + * There are a few combinations or one or two channel audio that are + * possible: + */ + enum ChannelMode { + //! Stereo + Stereo = 0, + //! Stereo + JointStereo = 1, + //! Dual Mono + DualChannel = 2, + //! Mono + SingleChannel = 3 + }; + + /*! + * Returns the channel mode for this frame. + */ + ChannelMode channelMode() const; + + /*! + * Returns true if the copyrighted bit is set. + */ + bool isCopyrighted() const; + + /*! + * Returns true if the "original" bit is set. + */ + bool isOriginal() const; + + /*! + * Returns the frame length. + */ + int frameLength() const; + + /*! + * Returns the number of frames per sample. + */ + int samplesPerFrame() const; + + /*! + * Makes a shallow copy of the header. + */ + Header &operator=(const Header &h); + + private: + void parse(const ByteVector &data); + + class HeaderPrivate; + HeaderPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/mpegproperties.h b/Audio-Frameworks/bin/taglib/headers/mpeg/mpegproperties.h new file mode 100644 index 0000000..72e594f --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/mpegproperties.h @@ -0,0 +1,118 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MPEGPROPERTIES_H +#define TAGLIB_MPEGPROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +#include "mpegheader.h" + +namespace TagLib { + + namespace MPEG { + + class File; + class XingHeader; + + //! An implementation of audio property reading for MP3 + + /*! + * This reads the data from an MPEG Layer III stream found in the + * AudioProperties API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of MPEG::Properties with the data read from the + * MPEG::File \a file. + */ + Properties(File *file, ReadStyle style = Average); + + /*! + * Destroys this MPEG Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns a pointer to the XingHeader if one exists or null if no + * XingHeader was found. + */ + + const XingHeader *xingHeader() const; + + /*! + * Returns the MPEG Version of the file. + */ + Header::Version version() const; + + /*! + * Returns the layer version. This will be between the values 1-3. + */ + int layer() const; + + /*! + * Returns true if the MPEG protection bit is enabled. + */ + bool protectionEnabled() const; + + /*! + * Returns the channel mode for this frame. + */ + Header::ChannelMode channelMode() const; + + /*! + * Returns true if the copyrighted bit is set. + */ + bool isCopyrighted() const; + + /*! + * Returns true if the "original" bit is set. + */ + bool isOriginal() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/mpeg/xingheader.h b/Audio-Frameworks/bin/taglib/headers/mpeg/xingheader.h new file mode 100644 index 0000000..ffe7494 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/mpeg/xingheader.h @@ -0,0 +1,100 @@ +/*************************************************************************** + copyright : (C) 2003 by Ismael Orenstein + email : orenstein@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_XINGHEADER_H +#define TAGLIB_XINGHEADER_H + +#include "mpegheader.h" +#include "taglib_export.h" + +namespace TagLib { + + class ByteVector; + + namespace MPEG { + + //! An implementation of the Xing VBR headers + + /*! + * This is a minimalistic implementation of the Xing VBR headers. Xing + * headers are often added to VBR (variable bit rate) MP3 streams to make it + * easy to compute the length and quality of a VBR stream. Our implementation + * is only concerned with the total size of the stream (so that we can + * calculate the total playing time and the average bitrate). It uses + * this text + * and the XMMS sources as references. + */ + + class TAGLIB_EXPORT XingHeader + { + public: + /*! + * Parses a Xing header based on \a data. The data must be at least 16 + * bytes long (anything longer than this is discarded). + */ + XingHeader(const ByteVector &data); + + /*! + * Destroy this XingHeader instance. + */ + virtual ~XingHeader(); + + /*! + * Returns true if the data was parsed properly and if there is a valid + * Xing header present. + */ + bool isValid() const; + + /*! + * Returns the total number of frames. + */ + uint totalFrames() const; + + /*! + * Returns the total size of stream in bytes. + */ + uint totalSize() const; + + /*! + * Returns the offset for the start of this Xing header, given the + * version and channels of the frame + */ + // BIC: rename to offset() + static int xingHeaderOffset(TagLib::MPEG::Header::Version v, + TagLib::MPEG::Header::ChannelMode c); + + private: + XingHeader(const XingHeader &); + XingHeader &operator=(const XingHeader &); + + void parse(const ByteVector &data); + + class XingHeaderPrivate; + XingHeaderPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/ogg/flac/oggflacfile.h b/Audio-Frameworks/bin/taglib/headers/ogg/flac/oggflacfile.h new file mode 100644 index 0000000..d437379 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ogg/flac/oggflacfile.h @@ -0,0 +1,126 @@ +/*************************************************************************** + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_OGGFLACFILE_H +#define TAGLIB_OGGFLACFILE_H + +#include "taglib_export.h" +#include "oggfile.h" +#include "xiphcomment.h" + +#include "flacproperties.h" + +namespace TagLib { + + class Tag; + + namespace Ogg { + + //! An implementation of Ogg FLAC metadata + + /*! + * This is implementation of FLAC metadata for Ogg FLAC files. For "pure" + * FLAC files look under the FLAC hiearchy. + * + * Unlike "pure" FLAC-files, Ogg FLAC only supports Xiph-comments, + * while the audio-properties are the same. + */ + namespace FLAC { + + using TagLib::FLAC::Properties; + + //! An implementation of TagLib::File with Ogg/FLAC specific methods + + /*! + * This implements and provides an interface for Ogg/FLAC files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to Ogg FLAC files. + */ + + class TAGLIB_EXPORT File : public Ogg::File + { + public: + /*! + * Contructs an Ogg/FLAC file from \a file. If \a readProperties is true + * the file's audio properties will also be read using \a propertiesStyle. + * If false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an Ogg/FLAC file from \a file. If \a readProperties is true + * the file's audio properties will also be read using \a propertiesStyle. + * If false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. This will always be a XiphComment. + */ + virtual XiphComment *tag() const; + + /*! + * Returns the FLAC::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Save the file. This will primarily save and update the XiphComment. + * Returns true if the save is successful. + */ + virtual bool save(); + + /*! + * Returns the length of the audio-stream, used by FLAC::Properties for + * calculating the bitrate. + */ + long streamLength(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void scan(); + ByteVector streamInfoData(); + ByteVector xiphCommentData(); + + class FilePrivate; + FilePrivate *d; + }; + } // namespace FLAC + } // namespace Ogg +} // namespace TagLib + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/ogg/oggfile.h b/Audio-Frameworks/bin/taglib/headers/ogg/oggfile.h new file mode 100644 index 0000000..1ecf2b9 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ogg/oggfile.h @@ -0,0 +1,123 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#include "taglib_export.h" +#include "tfile.h" +#include "tbytevectorlist.h" + +#ifndef TAGLIB_OGGFILE_H +#define TAGLIB_OGGFILE_H + +namespace TagLib { + + //! A namespace for the classes used by Ogg-based metadata files + + namespace Ogg { + + class PageHeader; + + //! An implementation of TagLib::File with some helpers for Ogg based formats + + /*! + * This is an implementation of Ogg file page and packet rendering and is of + * use to Ogg based formats. While the API is small this handles the + * non-trivial details of breaking up an Ogg stream into packets and makes + * these available (via subclassing) to the codec meta data implementations. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + virtual ~File(); + + /*! + * Returns the packet contents for the i-th packet (starting from zero) + * in the Ogg bitstream. + * + * \warning The requires reading at least the packet header for every page + * up to the requested page. + */ + ByteVector packet(uint i); + + /*! + * Sets the packet with index \a i to the value \a p. + */ + void setPacket(uint i, const ByteVector &p); + + /*! + * Returns a pointer to the PageHeader for the first page in the stream or + * null if the page could not be found. + */ + const PageHeader *firstPageHeader(); + + /*! + * Returns a pointer to the PageHeader for the last page in the stream or + * null if the page could not be found. + */ + const PageHeader *lastPageHeader(); + + virtual bool save(); + + protected: + /*! + * Contructs an Ogg file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \note This constructor is protected since Ogg::File shouldn't be + * instantiated directly but rather should be used through the codec + * specific subclasses. + */ + File(FileName file); + + /*! + * Contructs an Ogg file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + * + * \note This constructor is protected since Ogg::File shouldn't be + * instantiated directly but rather should be used through the codec + * specific subclasses. + */ + File(IOStream *stream); + + private: + File(const File &); + File &operator=(const File &); + + /*! + * Reads the next page and updates the internal "current page" pointer. + */ + bool nextPage(); + void writePageGroup(const List &group); + + class FilePrivate; + FilePrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/ogg/oggpage.h b/Audio-Frameworks/bin/taglib/headers/ogg/oggpage.h new file mode 100644 index 0000000..e9f4840 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ogg/oggpage.h @@ -0,0 +1,211 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_OGGPAGE_H +#define TAGLIB_OGGPAGE_H + +#include "taglib_export.h" +#include "tbytevectorlist.h" + +namespace TagLib { + + namespace Ogg { + + class File; + class PageHeader; + + //! An implementation of Ogg pages + + /*! + * This is an implementation of the pages that make up an Ogg stream. + * This handles parsing pages and breaking them down into packets and handles + * the details of packets spanning multiple pages and pages that contiain + * multiple packets. + * + * In most Xiph.org formats the comments are found in the first few packets, + * this however is a reasonably complete implementation of Ogg pages that + * could potentially be useful for non-meta data purposes. + */ + + class TAGLIB_EXPORT Page + { + public: + /*! + * Read an Ogg page from the \a file at the position \a pageOffset. + */ + Page(File *file, long pageOffset); + + virtual ~Page(); + + /*! + * Returns the page's position within the file (in bytes). + */ + long fileOffset() const; + + /*! + * Returns a pointer to the header for this page. This pointer will become + * invalid when the page is deleted. + */ + const PageHeader *header() const; + + /*! + * Returns a copy of the page with \a sequenceNumber set as sequence number. + * + * \see header() + * \see PageHeader::setPageSequenceNumber() + */ + Page* getCopyWithNewPageSequenceNumber(int sequenceNumber); + + /*! + * Returns the index of the first packet wholly or partially contained in + * this page. + * + * \see setFirstPacketIndex() + */ + int firstPacketIndex() const; + + /*! + * Sets the index of the first packet in the page. + * + * \see firstPacketIndex() + */ + void setFirstPacketIndex(int index); + + /*! + * When checking to see if a page contains a given packet this set of flags + * represents the possible values for that packets status in the page. + * + * \see containsPacket() + */ + enum ContainsPacketFlags { + //! No part of the packet is contained in the page + DoesNotContainPacket = 0x0000, + //! The packet is wholly contained in the page + CompletePacket = 0x0001, + //! The page starts with the given packet + BeginsWithPacket = 0x0002, + //! The page ends with the given packet + EndsWithPacket = 0x0004 + }; + + /*! + * Checks to see if the specified \a packet is contained in the current + * page. + * + * \see ContainsPacketFlags + */ + ContainsPacketFlags containsPacket(int index) const; + + /*! + * Returns the number of packets (whole or partial) in this page. + */ + uint packetCount() const; + + /*! + * Returns a list of the packets in this page. + * + * \note Either or both the first and last packets may be only partial. + * \see PageHeader::firstPacketContinued() + */ + ByteVectorList packets() const; + + /*! + * Returns the size of the page in bytes. + */ + int size() const; + + ByteVector render() const; + + /*! + * Defines a strategy for pagination, or grouping pages into Ogg packets, + * for use with pagination methods. + * + * \note Yes, I'm aware that this is not a canonical "Strategy Pattern", + * the term was simply convenient. + */ + enum PaginationStrategy { + /*! + * Attempt to put the specified set of packets into a single Ogg packet. + * If the sum of the packet data is greater than will fit into a single + * Ogg page -- 65280 bytes -- this will fall back to repagination using + * the recommended page sizes. + */ + SinglePagePerGroup, + /*! + * Split the packet or group of packets into pages that conform to the + * sizes recommended in the Ogg standard. + */ + Repaginate + }; + + /*! + * Pack \a packets into Ogg pages using the \a strategy for pagination. + * The page number indicater inside of the rendered packets will start + * with \a firstPage and be incremented for each page rendered. + * \a containsLastPacket should be set to true if \a packets contains the + * last page in the stream and will set the appropriate flag in the last + * rendered Ogg page's header. \a streamSerialNumber should be set to + * the serial number for this stream. + * + * \note The "absolute granule position" is currently always zeroed using + * this method as this suffices for the comment headers. + * + * \warning The pages returned by this method must be deleted by the user. + * You can use List::setAutoDelete(true) to set these pages to be + * automatically deleted when this list passes out of scope. + * + * \see PaginationStrategy + * \see List::setAutoDelete() + */ + static List paginate(const ByteVectorList &packets, + PaginationStrategy strategy, + uint streamSerialNumber, + int firstPage, + bool firstPacketContinued = false, + bool lastPacketCompleted = true, + bool containsLastPacket = false); + + protected: + /*! + * Creates an Ogg packet based on the data in \a packets. The page number + * for each page will be set to \a pageNumber. + */ + Page(const ByteVectorList &packets, + uint streamSerialNumber, + int pageNumber, + bool firstPacketContinued = false, + bool lastPacketCompleted = true, + bool containsLastPacket = false); + + private: + Page(const Page &); + Page &operator=(const Page &); + + class PagePrivate; + PagePrivate *d; + }; + } +} +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/ogg/oggpageheader.h b/Audio-Frameworks/bin/taglib/headers/ogg/oggpageheader.h new file mode 100644 index 0000000..742710a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ogg/oggpageheader.h @@ -0,0 +1,232 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_OGGPAGEHEADER_H +#define TAGLIB_OGGPAGEHEADER_H + +#include "tlist.h" +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace Ogg { + + class File; + + //! An implementation of the page headers associated with each Ogg::Page + + /*! + * This class implements Ogg page headers which contain the information + * about Ogg pages needed to break them into packets which can be passed on + * to the codecs. + */ + + class TAGLIB_EXPORT PageHeader + { + public: + /*! + * Reads a PageHeader from \a file starting at \a pageOffset. The defaults + * create a page with no (and as such, invalid) data that must be set + * later. + */ + PageHeader(File *file = 0, long pageOffset = -1); + + /*! + * Deletes this instance of the PageHeader. + */ + virtual ~PageHeader(); + + /*! + * Returns true if the header parsed properly and is valid. + */ + bool isValid() const; + + /*! + * Ogg pages contain a list of packets (which are used by the contained + * codecs). The sizes of these pages is encoded in the page header. This + * returns a list of the packet sizes in bytes. + * + * \see setPacketSizes() + */ + List packetSizes() const; + + /*! + * Sets the sizes of the packets in this page to \a sizes. Internally this + * updates the lacing values in the header. + * + * \see packetSizes() + */ + void setPacketSizes(const List &sizes); + + /*! + * Some packets can be continued across multiple pages. If the + * first packet in the current page is a continuation this will return + * true. If this is page starts with a new packet this will return false. + * + * \see lastPacketCompleted() + * \see setFirstPacketContinued() + */ + bool firstPacketContinued() const; + + /*! + * Sets the internal flag indicating if the first packet in this page is + * continued to \a continued. + * + * \see firstPacketContinued() + */ + void setFirstPacketContinued(bool continued); + + /*! + * Returns true if the last packet of this page is completely contained in + * this page. + * + * \see firstPacketContinued() + * \see setLastPacketCompleted() + */ + bool lastPacketCompleted() const; + + /*! + * Sets the internal flag indicating if the last packet in this page is + * complete to \a completed. + * + * \see lastPacketCompleted() + */ + void setLastPacketCompleted(bool completed); + + /*! + * This returns true if this is the first page of the Ogg (logical) stream. + * + * \see setFirstPageOfStream() + */ + bool firstPageOfStream() const; + + /*! + * Marks this page as the first page of the Ogg stream. + * + * \see firstPageOfStream() + */ + void setFirstPageOfStream(bool first); + + /*! + * This returns true if this is the last page of the Ogg (logical) stream. + * + * \see setLastPageOfStream() + */ + bool lastPageOfStream() const; + + /*! + * Marks this page as the last page of the Ogg stream. + * + * \see lastPageOfStream() + */ + void setLastPageOfStream(bool last); + + /*! + * A special value of containing the position of the packet to be + * interpreted by the codec. In the case of Vorbis this contains the PCM + * value and is used to calculate the length of the stream. + * + * \see setAbsoluteGranularPosition() + */ + long long absoluteGranularPosition() const; + + /*! + * A special value of containing the position of the packet to be + * interpreted by the codec. It is only supported here so that it may be + * coppied from one page to another. + * + * \see absoluteGranularPosition() + */ + void setAbsoluteGranularPosition(long long agp); + + /*! + * Every Ogg logical stream is given a random serial number which is common + * to every page in that logical stream. This returns the serial number of + * the stream associated with this packet. + * + * \see setStreamSerialNumber() + */ + uint streamSerialNumber() const; + + /*! + * Every Ogg logical stream is given a random serial number which is common + * to every page in that logical stream. This sets this pages serial + * number. This method should be used when adding new pages to a logical + * stream. + * + * \see streamSerialNumber() + */ + void setStreamSerialNumber(uint n); + + /*! + * Returns the index of the page within the Ogg stream. This helps make it + * possible to determine if pages have been lost. + * + * \see setPageSequenceNumber() + */ + int pageSequenceNumber() const; + + /*! + * Sets the page's position in the stream to \a sequenceNumber. + * + * \see pageSequenceNumber() + */ + void setPageSequenceNumber(int sequenceNumber); + + /*! + * Returns the complete header size. + */ + int size() const; + + /*! + * Returns the size of the data portion of the page -- i.e. the size of the + * page less the header size. + */ + int dataSize() const; + + /*! + * Render the page header to binary data. + * + * \note The checksum -- bytes 22 - 25 -- will be left empty and must be + * filled in when rendering the entire page. + */ + ByteVector render() const; + + private: + PageHeader(const PageHeader &); + PageHeader &operator=(const PageHeader &); + + void read(); + ByteVector lacingValues() const; + + class PageHeaderPrivate; + PageHeaderPrivate *d; + }; + + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/ogg/speex/speexfile.h b/Audio-Frameworks/bin/taglib/headers/ogg/speex/speexfile.h new file mode 100644 index 0000000..c14cf2a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ogg/speex/speexfile.h @@ -0,0 +1,107 @@ +/*************************************************************************** + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + (original Vorbis implementation) +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_SPEEXFILE_H +#define TAGLIB_SPEEXFILE_H + +#include "oggfile.h" +#include "xiphcomment.h" + +#include "speexproperties.h" + +namespace TagLib { + + namespace Ogg { + + //! A namespace containing classes for Speex metadata + + namespace Speex { + + //! An implementation of Ogg::File with Speex specific methods + + /*! + * This is the central class in the Ogg Speex metadata processing collection + * of classes. It's built upon Ogg::File which handles processing of the Ogg + * logical bitstream and breaking it down into pages which are handled by + * the codec implementations, in this case Speex specifically. + */ + + class TAGLIB_EXPORT File : public Ogg::File + { + public: + /*! + * Contructs a Speex file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs a Speex file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the XiphComment for this file. XiphComment implements the tag + * interface, so this serves as the reimplementation of + * TagLib::File::tag(). + */ + virtual Ogg::XiphComment *tag() const; + + /*! + * Returns the Speex::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + virtual bool save(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + + class FilePrivate; + FilePrivate *d; + }; + } + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/ogg/speex/speexproperties.h b/Audio-Frameworks/bin/taglib/headers/ogg/speex/speexproperties.h new file mode 100644 index 0000000..4720bd8 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ogg/speex/speexproperties.h @@ -0,0 +1,89 @@ +/*************************************************************************** + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + (original Vorbis implementation) +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_SPEEXPROPERTIES_H +#define TAGLIB_SPEEXPROPERTIES_H + +#include "audioproperties.h" + +namespace TagLib { + + namespace Ogg { + + namespace Speex { + + class File; + + //! An implementation of audio property reading for Ogg Speex + + /*! + * This reads the data from an Ogg Speex stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of Speex::Properties with the data read from the + * Speex::File \a file. + */ + Properties(File *file, ReadStyle style = Average); + + /*! + * Destroys this Speex::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns the Speex version, currently "0" (as specified by the spec). + */ + int speexVersion() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/ogg/vorbis/vorbisfile.h b/Audio-Frameworks/bin/taglib/headers/ogg/vorbis/vorbisfile.h new file mode 100644 index 0000000..15c29d9 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ogg/vorbis/vorbisfile.h @@ -0,0 +1,139 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_VORBISFILE_H +#define TAGLIB_VORBISFILE_H + +#include "taglib_export.h" +#include "oggfile.h" +#include "xiphcomment.h" + +#include "vorbisproperties.h" + +namespace TagLib { + +/* + * This is just to make this appear to be in the Ogg namespace in the + * documentation. The typedef below will make this work with the current code. + * In the next BIC version of TagLib this will be really moved into the Ogg + * namespace. + */ + +#ifdef DOXYGEN + namespace Ogg { +#endif + + //! A namespace containing classes for Vorbis metadata + + namespace Vorbis { + + + //! An implementation of Ogg::File with Vorbis specific methods + + /*! + * This is the central class in the Ogg Vorbis metadata processing collection + * of classes. It's built upon Ogg::File which handles processing of the Ogg + * logical bitstream and breaking it down into pages which are handled by + * the codec implementations, in this case Vorbis specifically. + */ + + class TAGLIB_EXPORT File : public Ogg::File + { + public: + /*! + * Contructs a Vorbis file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs a Vorbis file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the XiphComment for this file. XiphComment implements the tag + * interface, so this serves as the reimplementation of + * TagLib::File::tag(). + */ + virtual Ogg::XiphComment *tag() const; + + + /*! + * Implements the unified property interface -- export function. + * This forwards directly to XiphComment::properties(). + */ + PropertyMap properties() const; + + /*! + * Implements the unified tag dictionary interface -- import function. + * Like properties(), this is a forwarder to the file's XiphComment. + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the Vorbis::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + virtual bool save(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + + class FilePrivate; + FilePrivate *d; + }; + } + +/* + * To keep compatibility with the current version put Vorbis in the Ogg namespace + * only in the docs and provide a typedef to make it work. In the next BIC + * version this will be removed and it will only exist in the Ogg namespace. + */ + +#ifdef DOXYGEN + } +#else + namespace Ogg { namespace Vorbis { typedef TagLib::Vorbis::File File; } } +#endif + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/ogg/vorbis/vorbisproperties.h b/Audio-Frameworks/bin/taglib/headers/ogg/vorbis/vorbisproperties.h new file mode 100644 index 0000000..de46985 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ogg/vorbis/vorbisproperties.h @@ -0,0 +1,125 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_VORBISPROPERTIES_H +#define TAGLIB_VORBISPROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + +/* + * This is just to make this appear to be in the Ogg namespace in the + * documentation. The typedef below will make this work with the current code. + * In the next BIC version of TagLib this will be really moved into the Ogg + * namespace. + */ + +#ifdef DOXYGEN + namespace Ogg { +#endif + + namespace Vorbis { + + class File; + + //! An implementation of audio property reading for Ogg Vorbis + + /*! + * This reads the data from an Ogg Vorbis stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of Vorbis::Properties with the data read from the + * Vorbis::File \a file. + */ + Properties(File *file, ReadStyle style = Average); + + /*! + * Destroys this VorbisProperties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns the Vorbis version, currently "0" (as specified by the spec). + */ + int vorbisVersion() const; + + /*! + * Returns the maximum bitrate as read from the Vorbis identification + * header. + */ + int bitrateMaximum() const; + + /*! + * Returns the nominal bitrate as read from the Vorbis identification + * header. + */ + int bitrateNominal() const; + + /*! + * Returns the minimum bitrate as read from the Vorbis identification + * header. + */ + int bitrateMinimum() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } + +/* + * To keep compatibility with the current version put Vorbis in the Ogg namespace + * only in the docs and provide a typedef to make it work. In the next BIC + * version this will be removed and it will only exist in the Ogg namespace. + */ + +#ifdef DOXYGEN + } +#else + namespace Ogg { namespace Vorbis { typedef TagLib::AudioProperties AudioProperties; } } +#endif + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/ogg/xiphcomment.h b/Audio-Frameworks/bin/taglib/headers/ogg/xiphcomment.h new file mode 100644 index 0000000..3b44086 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/ogg/xiphcomment.h @@ -0,0 +1,217 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_VORBISCOMMENT_H +#define TAGLIB_VORBISCOMMENT_H + +#include "tag.h" +#include "tlist.h" +#include "tmap.h" +#include "tstring.h" +#include "tstringlist.h" +#include "tbytevector.h" +#include "taglib_export.h" + +namespace TagLib { + + namespace Ogg { + + /*! + * A mapping between a list of field names, or keys, and a list of values + * associated with that field. + * + * \see XiphComment::fieldListMap() + */ + typedef Map FieldListMap; + + //! Ogg Vorbis comment implementation + + /*! + * This class is an implementation of the Ogg Vorbis comment specification, + * to be found in section 5 of the Ogg Vorbis specification. Because this + * format is also used in other (currently unsupported) Xiph.org formats, it + * has been made part of a generic implementation rather than being limited + * to strictly Vorbis. + * + * Vorbis comments are a simple vector of keys and values, called fields. + * Multiple values for a given key are supported. + * + * \see fieldListMap() + */ + + class TAGLIB_EXPORT XiphComment : public TagLib::Tag + { + public: + /*! + * Constructs an empty Vorbis comment. + */ + XiphComment(); + + /*! + * Constructs a Vorbis comment from \a data. + */ + XiphComment(const ByteVector &data); + + /*! + * Destroys this instance of the XiphComment. + */ + virtual ~XiphComment(); + + virtual String title() const; + virtual String artist() const; + virtual String album() const; + virtual String comment() const; + virtual String genre() const; + virtual uint year() const; + virtual uint track() const; + + virtual void setTitle(const String &s); + virtual void setArtist(const String &s); + virtual void setAlbum(const String &s); + virtual void setComment(const String &s); + virtual void setGenre(const String &s); + virtual void setYear(uint i); + virtual void setTrack(uint i); + + virtual bool isEmpty() const; + + /*! + * Returns the number of fields present in the comment. + */ + uint fieldCount() const; + + /*! + * Returns a reference to the map of field lists. Because Xiph comments + * support multiple fields with the same key, a pure Map would not work. + * As such this is a Map of string lists, keyed on the comment field name. + * + * The standard set of Xiph/Vorbis fields (which may or may not be + * contained in any specific comment) is: + * + *
    + *
  • TITLE
  • + *
  • VERSION
  • + *
  • ALBUM
  • + *
  • ARTIST
  • + *
  • PERFORMER
  • + *
  • COPYRIGHT
  • + *
  • ORGANIZATION
  • + *
  • DESCRIPTION
  • + *
  • GENRE
  • + *
  • DATE
  • + *
  • LOCATION
  • + *
  • CONTACT
  • + *
  • ISRC
  • + *
+ * + * For a more detailed description of these fields, please see the Ogg + * Vorbis specification, section 5.2.2.1. + * + * \note The Ogg Vorbis comment specification does allow these key values + * to be either upper or lower case. However, it is conventional for them + * to be upper case. As such, TagLib, when parsing a Xiph/Vorbis comment, + * converts all fields to uppercase. When you are using this data + * structure, you will need to specify the field name in upper case. + * + * \warning You should not modify this data structure directly, instead + * use addField() and removeField(). + */ + const FieldListMap &fieldListMap() const; + + /*! + * Implements the unified property interface -- export function. + * The result is a one-to-one match of the Xiph comment, since it is + * completely compatible with the property interface (in fact, a Xiph + * comment is nothing more than a map from tag names to list of values, + * as is the dict interface). + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * The tags from the given map will be stored one-to-one in the file. + */ + PropertyMap setProperties(const PropertyMap&); + + /*! + * Returns the vendor ID of the Ogg Vorbis encoder. libvorbis 1.0 as the + * most common case always returns "Xiph.Org libVorbis I 20020717". + */ + String vendorID() const; + + /*! + * Add the field specified by \a key with the data \a value. If \a replace + * is true, then all of the other fields with the same key will be removed + * first. + * + * If the field value is empty, the field will be removed. + */ + void addField(const String &key, const String &value, bool replace = true); + + /*! + * Remove the field specified by \a key with the data \a value. If + * \a value is null, all of the fields with the given key will be removed. + */ + void removeField(const String &key, const String &value = String::null); + + /*! + * Returns true if the field is contained within the comment. + * + * \note This is safer than checking for membership in the FieldListMap. + */ + bool contains(const String &key) const; + + /*! + * Renders the comment to a ByteVector suitable for inserting into a file. + */ + ByteVector render() const; // BIC: remove and merge with below + + /*! + * Renders the comment to a ByteVector suitable for inserting into a file. + * + * If \a addFramingBit is true the standard Vorbis comment framing bit will + * be appended. However some formats (notably FLAC) do not work with this + * in place. + */ + ByteVector render(bool addFramingBit) const; + + protected: + /*! + * Reads the tag from the file specified in the constructor and fills the + * FieldListMap. + */ + void parse(const ByteVector &data); + + private: + XiphComment(const XiphComment &); + XiphComment &operator=(const XiphComment &); + + class XiphCommentPrivate; + XiphCommentPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/riff/aiff/aifffile.h b/Audio-Frameworks/bin/taglib/headers/riff/aiff/aifffile.h new file mode 100644 index 0000000..a50c8ec --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/riff/aiff/aifffile.h @@ -0,0 +1,122 @@ +/*************************************************************************** + copyright : (C) 2008 by Scott Wheeler + email : wheeler@kde.org +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_AIFFFILE_H +#define TAGLIB_AIFFFILE_H + +#include "rifffile.h" +#include "id3v2tag.h" +#include "aiffproperties.h" + +namespace TagLib { + + namespace RIFF { + + //! An implementation of AIFF metadata + + /*! + * This is implementation of AIFF metadata. + * + * This supports an ID3v2 tag as well as reading stream from the ID3 RIFF + * chunk as well as properties from the file. + */ + + namespace AIFF { + + //! An implementation of TagLib::File with AIFF specific methods + + /*! + * This implements and provides an interface for AIFF files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to AIFF files. + */ + + class TAGLIB_EXPORT File : public TagLib::RIFF::File + { + public: + /*! + * Contructs an AIFF file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an AIFF file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. + */ + virtual ID3v2::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * This method forwards to ID3v2::Tag::properties(). + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * This method forwards to ID3v2::Tag::setProperties(). + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the AIFF::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Saves the file. + */ + virtual bool save(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + + class FilePrivate; + FilePrivate *d; + }; + } + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/riff/aiff/aiffproperties.h b/Audio-Frameworks/bin/taglib/headers/riff/aiff/aiffproperties.h new file mode 100644 index 0000000..68e90b7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/riff/aiff/aiffproperties.h @@ -0,0 +1,83 @@ +/*************************************************************************** + copyright : (C) 2008 by Scott Wheeler + email : wheeler@kde.org +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_AIFFPROPERTIES_H +#define TAGLIB_AIFFPROPERTIES_H + +#include "audioproperties.h" + +namespace TagLib { + + namespace RIFF { + + namespace AIFF { + + class File; + + //! An implementation of audio property reading for AIFF + + /*! + * This reads the data from an AIFF stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of AIFF::Properties with the data read from the + * ByteVector \a data. + */ + Properties(const ByteVector &data, ReadStyle style); + + /*! + * Destroys this AIFF::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + int sampleWidth() const; + uint sampleFrames() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(const ByteVector &data); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/riff/rifffile.h b/Audio-Frameworks/bin/taglib/headers/riff/rifffile.h new file mode 100644 index 0000000..e418dbb --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/riff/rifffile.h @@ -0,0 +1,122 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_RIFFFILE_H +#define TAGLIB_RIFFFILE_H + +#include "taglib_export.h" +#include "tfile.h" + +namespace TagLib { + + //! An implementation of TagLib::File with RIFF specific methods + + namespace RIFF { + + //! An RIFF file class with some useful methods specific to RIFF + + /*! + * This implements the generic TagLib::File API and additionally provides + * access to properties that are distinct to RIFF files, notably access + * to the different ID3 tags. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + protected: + + enum Endianness { BigEndian, LittleEndian }; + + File(FileName file, Endianness endianness); + File(IOStream *stream, Endianness endianness); + + /*! + * \return The size of the main RIFF chunk. + */ + uint riffSize() const; + + /*! + * \return The number of chunks in the file. + */ + uint chunkCount() const; + + /*! + * \return The offset within the file for the selected chunk number. + */ + uint chunkOffset(uint i) const; + + /*! + * \return The size of the chunk data. + */ + uint chunkDataSize(uint i) const; + + /*! + * \return The size of the padding after the chunk (can be either 0 or 1). + */ + uint chunkPadding(uint i) const; + + /*! + * \return The name of the specified chunk, for instance, "COMM" or "ID3 " + */ + ByteVector chunkName(uint i) const; + + /*! + * Reads the chunk data from the file and returns it. + * + * \note This \e will move the read pointer for the file. + */ + ByteVector chunkData(uint i); + + /*! + * Sets the data for the chunk \a name to \a data. If a chunk with the + * given name already exists it will be overwritten, otherwise it will be + * created after the existing chunks. + * + * \warning This will update the file immediately. + */ + void setChunkData(const ByteVector &name, const ByteVector &data); + + private: + File(const File &); + File &operator=(const File &); + + void read(); + void writeChunk(const ByteVector &name, const ByteVector &data, + ulong offset, ulong replace = 0, + uint leadingPadding = 0); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/riff/wav/wavfile.h b/Audio-Frameworks/bin/taglib/headers/riff/wav/wavfile.h new file mode 100644 index 0000000..861f3f7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/riff/wav/wavfile.h @@ -0,0 +1,122 @@ +/*************************************************************************** + copyright : (C) 2008 by Scott Wheeler + email : wheeler@kde.org +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_WAVFILE_H +#define TAGLIB_WAVFILE_H + +#include "rifffile.h" +#include "id3v2tag.h" +#include "wavproperties.h" + +namespace TagLib { + + namespace RIFF { + + //! An implementation of WAV metadata + + /*! + * This is implementation of WAV metadata. + * + * This supports an ID3v2 tag as well as reading stream from the ID3 RIFF + * chunk as well as properties from the file. + */ + + namespace WAV { + + //! An implementation of TagLib::File with WAV specific methods + + /*! + * This implements and provides an interface for WAV files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to WAV files. + */ + + class TAGLIB_EXPORT File : public TagLib::RIFF::File + { + public: + /*! + * Contructs an WAV file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an WAV file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. + */ + virtual ID3v2::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * This method forwards to ID3v2::Tag::properties(). + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * This method forwards to ID3v2::Tag::setProperties(). + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the WAV::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Saves the file. + */ + virtual bool save(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + + class FilePrivate; + FilePrivate *d; + }; + } + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/riff/wav/wavproperties.h b/Audio-Frameworks/bin/taglib/headers/riff/wav/wavproperties.h new file mode 100644 index 0000000..2023f53 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/riff/wav/wavproperties.h @@ -0,0 +1,92 @@ +/*************************************************************************** + copyright : (C) 2008 by Scott Wheeler + email : wheeler@kde.org +***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_WAVPROPERTIES_H +#define TAGLIB_WAVPROPERTIES_H + +#include "taglib.h" +#include "audioproperties.h" + +namespace TagLib { + + class ByteVector; + + namespace RIFF { + + namespace WAV { + + class File; + + //! An implementation of audio property reading for WAV + + /*! + * This reads the data from an WAV stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of WAV::Properties with the data read from the + * ByteVector \a data. + */ + Properties(const ByteVector &data, ReadStyle style); + + /*! + * Create an instance of WAV::Properties with the data read from the + * ByteVector \a data and the length calculated using \a streamLength. + */ + Properties(const ByteVector &data, uint streamLength, ReadStyle style); + + /*! + * Destroys this WAV::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + int sampleWidth() const; + uint sampleFrames() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(const ByteVector &data); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/s3m/s3mfile.h b/Audio-Frameworks/bin/taglib/headers/s3m/s3mfile.h new file mode 100644 index 0000000..0605b2b --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/s3m/s3mfile.h @@ -0,0 +1,101 @@ +/*************************************************************************** + copyright : (C) 2011 by Mathias Panzenböck + email : grosser.meister.morti@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef TAGLIB_S3MFILE_H +#define TAGLIB_S3MFILE_H + +#include "tfile.h" +#include "audioproperties.h" +#include "taglib_export.h" +#include "modfilebase.h" +#include "modtag.h" +#include "s3mproperties.h" + +namespace TagLib { + + namespace S3M { + + class TAGLIB_EXPORT File : public Mod::FileBase { + public: + /*! + * Contructs a ScreamTracker III file from \a file. If \a readProperties + * is true the file's audio properties will also be read using + * \a propertiesStyle. If false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + AudioProperties::ReadStyle propertiesStyle = + AudioProperties::Average); + + /*! + * Contructs a ScreamTracker III file from \a stream. If \a readProperties + * is true the file's audio properties will also be read using + * \a propertiesStyle. If false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + AudioProperties::ReadStyle propertiesStyle = + AudioProperties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + Mod::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * Forwards to Mod::Tag::properties(). + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * Forwards to Mod::Tag::setProperties(). + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the S3M::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + S3M::Properties *audioProperties() const; + + /*! + * Save the file. + * This is the same as calling save(AllTags); + * + * \note Saving ScreamTracker III tags is not supported. + */ + bool save(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/s3m/s3mproperties.h b/Audio-Frameworks/bin/taglib/headers/s3m/s3mproperties.h new file mode 100644 index 0000000..6e9f1d2 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/s3m/s3mproperties.h @@ -0,0 +1,88 @@ +/*************************************************************************** + copyright : (C) 2011 by Mathias Panzenböck + email : grosser.meister.morti@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef TAGLIB_S3MPROPERTIES_H +#define TAGLIB_S3MPROPERTIES_H + +#include "taglib.h" +#include "audioproperties.h" + +namespace TagLib { + namespace S3M { + class TAGLIB_EXPORT Properties : public AudioProperties { + friend class File; + public: + /*! Flag bits. */ + enum { + ST2Vibrato = 1, + ST2Tempo = 2, + AmigaSlides = 4, + Vol0MixOptimizations = 8, + AmigaLimits = 16, + EnableFilter = 32, + CustomData = 128 + }; + + Properties(AudioProperties::ReadStyle propertiesStyle); + virtual ~Properties(); + + int length() const; + int bitrate() const; + int sampleRate() const; + int channels() const; + + ushort lengthInPatterns() const; + bool stereo() const; + ushort sampleCount() const; + ushort patternCount() const; + ushort flags() const; + ushort trackerVersion() const; + ushort fileFormatVersion() const; + uchar globalVolume() const; + uchar masterVolume() const; + uchar tempo() const; + uchar bpmSpeed() const; + + void setChannels(int channels); + + void setLengthInPatterns (ushort lengthInPatterns); + void setStereo (bool stereo); + void setSampleCount (ushort sampleCount); + void setPatternCount (ushort patternCount); + void setFlags (ushort flags); + void setTrackerVersion (ushort trackerVersion); + void setFileFormatVersion(ushort fileFormatVersion); + void setGlobalVolume (uchar globalVolume); + void setMasterVolume (uchar masterVolume); + void setTempo (uchar tempo); + void setBpmSpeed (uchar bpmSpeed); + + private: + Properties(const Properties&); + Properties &operator=(const Properties&); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/tag.h b/Audio-Frameworks/bin/taglib/headers/tag.h new file mode 100644 index 0000000..76c9a82 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/tag.h @@ -0,0 +1,201 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_TAG_H +#define TAGLIB_TAG_H + +#include "taglib_export.h" +#include "tstring.h" + +namespace TagLib { + + //! A simple, generic interface to common audio meta data fields + + /*! + * This is an attempt to abstract away the difference in the meta data formats + * of various audio codecs and tagging schemes. As such it is generally a + * subset of what is available in the specific formats but should be suitable + * for most applications. This is meant to compliment the generic APIs found + * in TagLib::AudioProperties, TagLib::File and TagLib::FileRef. + */ + + class PropertyMap; + + class TAGLIB_EXPORT Tag + { + public: + + /*! + * Detroys this Tag instance. + */ + virtual ~Tag(); + + /*! + * Exports the tags of the file as dictionary mapping (human readable) tag + * names (Strings) to StringLists of tag values. + * The default implementation in this class considers only the usual built-in + * tags (artist, album, ...) and only one value per key. + */ + PropertyMap properties() const; + + /*! + * Removes unsupported properties, or a subset of them, from the tag. + * The parameter \a properties must contain only entries from + * properties().unsupportedData(). + * BIC: Will become virtual in future releases. Currently the non-virtual + * standard implementation of TagLib::Tag does nothing, since there are + * no unsupported elements. + */ + void removeUnsupportedProperties(const StringList& properties); + + /*! + * Sets the tags of this File to those specified in \a properties. This default + * implementation sets only the tags for which setter methods exist in this class + * (artist, album, ...), and only one value per key; the rest will be contained + * in the returned PropertyMap. + */ + PropertyMap setProperties(const PropertyMap &properties); + + /*! + * Returns the track name; if no track name is present in the tag + * String::null will be returned. + */ + virtual String title() const = 0; + + /*! + * Returns the artist name; if no artist name is present in the tag + * String::null will be returned. + */ + virtual String artist() const = 0; + + /*! + * Returns the album name; if no album name is present in the tag + * String::null will be returned. + */ + virtual String album() const = 0; + + /*! + * Returns the track comment; if no comment is present in the tag + * String::null will be returned. + */ + virtual String comment() const = 0; + + /*! + * Returns the genre name; if no genre is present in the tag String::null + * will be returned. + */ + virtual String genre() const = 0; + + /*! + * Returns the year; if there is no year set, this will return 0. + */ + virtual uint year() const = 0; + + /*! + * Returns the track number; if there is no track number set, this will + * return 0. + */ + virtual uint track() const = 0; + + /*! + * Sets the title to \a s. If \a s is String::null then this value will be + * cleared. + */ + virtual void setTitle(const String &s) = 0; + + /*! + * Sets the artist to \a s. If \a s is String::null then this value will be + * cleared. + */ + virtual void setArtist(const String &s) = 0; + + /*! + * Sets the album to \a s. If \a s is String::null then this value will be + * cleared. + */ + virtual void setAlbum(const String &s) = 0; + + /*! + * Sets the comment to \a s. If \a s is String::null then this value will be + * cleared. + */ + virtual void setComment(const String &s) = 0; + + /*! + * Sets the genre to \a s. If \a s is String::null then this value will be + * cleared. For tag formats that use a fixed set of genres, the appropriate + * value will be selected based on a string comparison. A list of available + * genres for those formats should be available in that type's + * implementation. + */ + virtual void setGenre(const String &s) = 0; + + /*! + * Sets the year to \a i. If \a s is 0 then this value will be cleared. + */ + virtual void setYear(uint i) = 0; + + /*! + * Sets the track to \a i. If \a s is 0 then this value will be cleared. + */ + virtual void setTrack(uint i) = 0; + + /*! + * Returns true if the tag does not contain any data. This should be + * reimplemented in subclasses that provide more than the basic tagging + * abilities in this class. + */ + virtual bool isEmpty() const; + + /*! + * Copies the generic data from one tag to another. + * + * \note This will no affect any of the lower level details of the tag. For + * instance if any of the tag type specific data (maybe a URL for a band) is + * set, this will not modify or copy that. This just copies using the API + * in this class. + * + * If \a overwrite is true then the values will be unconditionally copied. + * If false only empty values will be overwritten. + */ + static void duplicate(const Tag *source, Tag *target, bool overwrite = true); + + protected: + /*! + * Construct a Tag. This is protected since tags should only be instantiated + * through subclasses. + */ + Tag(); + + private: + Tag(const Tag &); + Tag &operator=(const Tag &); + + class TagPrivate; + TagPrivate *d; + }; +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/taglib_export.h b/Audio-Frameworks/bin/taglib/headers/taglib_export.h new file mode 100644 index 0000000..3e86855 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/taglib_export.h @@ -0,0 +1,47 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_EXPORT_H +#define TAGLIB_EXPORT_H + +#if defined(TAGLIB_STATIC) +#define TAGLIB_EXPORT +#elif (defined(_WIN32) || defined(_WIN64)) +#ifdef MAKE_TAGLIB_LIB +#define TAGLIB_EXPORT __declspec(dllexport) +#else +#define TAGLIB_EXPORT __declspec(dllimport) +#endif +#elif defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 1) +#define TAGLIB_EXPORT __attribute__ ((visibility("default"))) +#else +#define TAGLIB_EXPORT +#endif + +#ifndef TAGLIB_NO_CONFIG +#include "taglib_config.h" +#endif + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/tagunion.h b/Audio-Frameworks/bin/taglib/headers/tagunion.h new file mode 100644 index 0000000..e94d523 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/tagunion.h @@ -0,0 +1,95 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_TAGUNION_H +#define TAGLIB_TAGUNION_H + +#include "tag.h" + +#ifndef DO_NOT_DOCUMENT + +namespace TagLib { + + /*! + * \internal + */ + + class TagUnion : public Tag + { + public: + + enum AccessType { Read, Write }; + + /*! + * Creates a TagLib::Tag that is the union of \a first, \a second, and + * \a third. The TagUnion takes ownership of these tags and will handle + * their deletion. + */ + TagUnion(Tag *first = 0, Tag *second = 0, Tag *third = 0); + + virtual ~TagUnion(); + + Tag *operator[](int index) const; + Tag *tag(int index) const; + + void set(int index, Tag *tag); + + virtual String title() const; + virtual String artist() const; + virtual String album() const; + virtual String comment() const; + virtual String genre() const; + virtual uint year() const; + virtual uint track() const; + + virtual void setTitle(const String &s); + virtual void setArtist(const String &s); + virtual void setAlbum(const String &s); + virtual void setComment(const String &s); + virtual void setGenre(const String &s); + virtual void setYear(uint i); + virtual void setTrack(uint i); + virtual bool isEmpty() const; + + template T *access(int index, bool create) + { + if(!create || tag(index)) + return static_cast(tag(index)); + + set(index, new T); + return static_cast(tag(index)); + } + + private: + TagUnion(const Tag &); + TagUnion &operator=(const Tag &); + + class TagUnionPrivate; + TagUnionPrivate *d; + }; +} + +#endif +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/taglib.h b/Audio-Frameworks/bin/taglib/headers/toolkit/taglib.h new file mode 100644 index 0000000..dda9c83 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/taglib.h @@ -0,0 +1,226 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_H +#define TAGLIB_H + +#define TAGLIB_MAJOR_VERSION 1 +#define TAGLIB_MINOR_VERSION 7 +#define TAGLIB_PATCH_VERSION 0 + +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 1)) +#define TAGLIB_IGNORE_MISSING_DESTRUCTOR _Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"") +#else +#define TAGLIB_IGNORE_MISSING_DESTRUCTOR +#endif + +#if (defined(_MSC_VER) && _MSC_VER >= 1600) +#define TAGLIB_CONSTRUCT_BITSET(x) static_cast(x) +#else +#define TAGLIB_CONSTRUCT_BITSET(x) static_cast(x) +#endif + +#include + +#ifdef __APPLE__ +# include +# define TAGLIB_ATOMIC_MAC +#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define NOMINMAX +# include +# define TAGLIB_ATOMIC_WIN +#elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 401) \ + && (defined(__i386__) || defined(__i486__) || defined(__i586__) || \ + defined(__i686__) || defined(__x86_64) || defined(__ia64)) \ + && !defined(__INTEL_COMPILER) +# define TAGLIB_ATOMIC_GCC +#elif defined(__ia64) && defined(__INTEL_COMPILER) +# include +# define TAGLIB_ATOMIC_GCC +#endif + +//! A namespace for all TagLib related classes and functions + +/*! + * This namespace contains everything in TagLib. For projects working with + * TagLib extensively it may be convenient to add a + * \code + * using namespace TagLib; + * \endcode + */ + +namespace TagLib { + + class String; + + typedef wchar_t wchar; + typedef unsigned char uchar; + typedef unsigned short ushort; + typedef unsigned int uint; + typedef unsigned long ulong; + + /*! + * Unfortunately std::wstring isn't defined on some systems, (i.e. GCC < 3) + * so I'm providing something here that should be constant. + */ + typedef std::basic_string wstring; + +#ifndef DO_NOT_DOCUMENT // Tell Doxygen to skip this class. + /*! + * \internal + * This is just used as a base class for shared classes in TagLib. + * + * \warning This is not part of the TagLib public API! + */ + + class RefCounter + { + public: + RefCounter() : refCount(1) {} + +#ifdef TAGLIB_ATOMIC_MAC + void ref() { OSAtomicIncrement32Barrier(const_cast(&refCount)); } + bool deref() { return ! OSAtomicDecrement32Barrier(const_cast(&refCount)); } + int32_t count() { return refCount; } + private: + volatile int32_t refCount; +#elif defined(TAGLIB_ATOMIC_WIN) + void ref() { InterlockedIncrement(&refCount); } + bool deref() { return ! InterlockedDecrement(&refCount); } + long count() { return refCount; } + private: + volatile long refCount; +#elif defined(TAGLIB_ATOMIC_GCC) + void ref() { __sync_add_and_fetch(&refCount, 1); } + bool deref() { return ! __sync_sub_and_fetch(&refCount, 1); } + int count() { return refCount; } + private: + volatile int refCount; +#else + void ref() { refCount++; } + bool deref() { return ! --refCount; } + int count() { return refCount; } + private: + uint refCount; +#endif + + }; + +#endif // DO_NOT_DOCUMENT + +} + +/*! + * \mainpage TagLib + * + * \section intro Introduction + * + * TagLib is a library for reading and editing audio meta data, commonly know as \e tags. + * + * Features: + * - A clean, high level, C++ API to handling audio meta data. + * - Format specific APIs for advanced API users. + * - ID3v1, ID3v2, APE, FLAC, Xiph, iTunes-style MP4 and WMA tag formats. + * - MP3, MPC, FLAC, MP4, ASF, AIFF, WAV, TrueAudio, WavPack, Ogg FLAC, Ogg Vorbis and Speex file formats. + * - Basic audio file properties such as length, sample rate, etc. + * - Long term binary and source compatibility. + * - Extensible design, notably the ability to add other formats or extend current formats as a library user. + * - Full support for unicode and internationalized tags. + * - Dual MPL and + * LGPL licenses. + * - No external toolkit dependancies. + * + * \section why Why TagLib? + * + * TagLib originally was written to provide an updated and improved ID3v2 implementation in C++ for use + * in a variety of Open Source projects. Since development began in 2002 and the 1.0 release in 2004 + * it has expanded to cover a wide variety of tag and file formats and is used in a wide variety of + * Open Source and proprietary applications. It now supports a variety of UNIXes, including Apple's OS + * X, as well as Microsoft Windows. + * + * \section commercial Usage in Commercial Applications + * + * TagLib's licenses \e do allow usage within propriety (\e closed) applications, however TagLib is \e not + * public domain. Please note the requirements of the LGPL or MPL, and adhere to at least one of them. + * In simple terms, you must at a minimum note your usage of TagLib, note the licensing terms of TagLib and + * if you make changes to TagLib publish them. Please review the licenses above before using TagLib in your + * software. Note that you may choose either the MPL or the LGPL, you do not have to fulfill the + * requirements of both. + * + * \section installing Installing TagLib + * + * Please see the TagLib website for the latest + * downloads. + * + * TagLib can be built using the CMake build system. TagLib installs a taglib-config and pkg-config file to + * make it easier to integrate into various build systems. Note that TagLib's include install directory \e must + * be included in the header include path. Simply adding will \e not work. + * + * \section start Getting Started + * + * TagLib provides both simple, abstract APIs which make it possible to ignore the differences between tagging + * formats and format specific APIs which allow programmers to work with the features of specific tagging + * schemes. There is a similar abstraction mechanism for AudioProperties. + * + * The best place to start is with the Class Hierarchy linked at the top of the page. The File and + * AudioProperties classes and their subclasses are the core of TagLib. The FileRef class is also a convenient + * way for using a value-based handle. + * + * \note When working with FileRef please consider that it has only the most basic (extension-based) file + * type resolution. Please see its documentation on how to plug in more advanced file type resolution. (Such + * resolution may be part of later TagLib releases by default.) + * + * Here's a very simple example with TagLib: + * + * \code + * + * TagLib::FileRef f("Latex Solar Beef.mp3"); + * TagLib::String artist = f.tag()->artist(); // artist == "Frank Zappa" + * + * f.tag()->setAlbum("Fillmore East"); + * f.save(); + * + * TagLib::FileRef g("Free City Rhymes.ogg"); + * TagLib::String album = g.tag()->album(); // album == "NYC Ghosts & Flowers" + * + * g.tag()->setTrack(1); + * g.save(); + * + * \endcode + * + * More examples can be found in the \e examples directory of the source distribution. + * + * \section Contact + * + * Questions about TagLib should be directed to the TagLib mailing list, not directly to the author. + * + * - TagLib Homepage + * - TagLib Mailing List (taglib-devel@kde.org) + * + * \author Scott Wheeler et al. + * + */ + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tbytevector.h b/Audio-Frameworks/bin/taglib/headers/toolkit/tbytevector.h new file mode 100644 index 0000000..0c58326 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tbytevector.h @@ -0,0 +1,425 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_BYTEVECTOR_H +#define TAGLIB_BYTEVECTOR_H + +#include "taglib.h" +#include "taglib_export.h" + +#include +#include + +namespace TagLib { + + //! A byte vector + + /*! + * This class provides a byte vector with some methods that are useful for + * tagging purposes. Many of the search functions are tailored to what is + * useful for finding tag related paterns in a data array. + */ + + class TAGLIB_EXPORT ByteVector + { + public: +#ifndef DO_NOT_DOCUMENT + typedef std::vector::iterator Iterator; + typedef std::vector::const_iterator ConstIterator; +#endif + + /*! + * Constructs an empty byte vector. + */ + ByteVector(); + + /*! + * Construct a vector of size \a size with all values set to \a value by + * default. + */ + ByteVector(uint size, char value = 0); + + /*! + * Contructs a byte vector that is a copy of \a v. + */ + ByteVector(const ByteVector &v); + + /*! + * Contructs a byte vector that contains \a c. + */ + ByteVector(char c); + + /*! + * Constructs a byte vector that copies \a data for up to \a length bytes. + */ + ByteVector(const char *data, uint length); + + /*! + * Constructs a byte vector that copies \a data up to the first null + * byte. The behavior is undefined if \a data is not null terminated. + * This is particularly useful for constructing byte arrays from string + * constants. + */ + ByteVector(const char *data); + + /*! + * Destroys this ByteVector instance. + */ + virtual ~ByteVector(); + + /*! + * Sets the data for the byte array using the first \a length bytes of \a data + */ + ByteVector &setData(const char *data, uint length); + + /*! + * Sets the data for the byte array copies \a data up to the first null + * byte. The behavior is undefined if \a data is not null terminated. + */ + ByteVector &setData(const char *data); + + /*! + * Returns a pointer to the internal data structure. + * + * \warning Care should be taken when modifying this data structure as it is + * easy to corrupt the ByteVector when doing so. Specifically, while the + * data may be changed, its length may not be. + */ + char *data(); + + /*! + * Returns a pointer to the internal data structure which may not be modified. + */ + const char *data() const; + + /*! + * Returns a byte vector made up of the bytes starting at \a index and + * for \a length bytes. If \a length is not specified it will return the bytes + * from \a index to the end of the vector. + */ + ByteVector mid(uint index, uint length = 0xffffffff) const; + + /*! + * This essentially performs the same as operator[](), but instead of causing + * a runtime error if the index is out of bounds, it will return a null byte. + */ + char at(uint index) const; + + /*! + * Searches the ByteVector for \a pattern starting at \a offset and returns + * the offset. Returns -1 if the pattern was not found. If \a byteAlign is + * specified the pattern will only be matched if it starts on a byte divisible + * by \a byteAlign (starting from \a offset). + */ + int find(const ByteVector &pattern, uint offset = 0, int byteAlign = 1) const; + + /*! + * Searches the ByteVector for \a pattern starting from either the end of the + * vector or \a offset and returns the offset. Returns -1 if the pattern was + * not found. If \a byteAlign is specified the pattern will only be matched + * if it starts on a byte divisible by \a byteAlign (starting from \a offset). + */ + int rfind(const ByteVector &pattern, uint offset = 0, int byteAlign = 1) const; + + /*! + * Checks to see if the vector contains the \a pattern starting at position + * \a offset. Optionally, if you only want to search for part of the pattern + * you can specify an offset within the pattern to start from. Also, you can + * specify to only check for the first \a patternLength bytes of \a pattern with + * the \a patternLength argument. + */ + bool containsAt(const ByteVector &pattern, uint offset, uint patternOffset = 0, uint patternLength = 0xffffffff) const; + + /*! + * Returns true if the vector starts with \a pattern. + */ + bool startsWith(const ByteVector &pattern) const; + + /*! + * Returns true if the vector ends with \a pattern. + */ + bool endsWith(const ByteVector &pattern) const; + + /*! + * Replaces \a pattern with \a with and returns a reference to the ByteVector + * after the operation. This \e does modify the vector. + */ + ByteVector &replace(const ByteVector &pattern, const ByteVector &with); + + /*! + * Checks for a partial match of \a pattern at the end of the vector. It + * returns the offset of the partial match within the vector, or -1 if the + * pattern is not found. This method is particularly useful when searching for + * patterns that start in one vector and end in another. When combined with + * startsWith() it can be used to find a pattern that overlaps two buffers. + * + * \note This will not match the complete pattern at the end of the string; use + * endsWith() for that. + */ + int endsWithPartialMatch(const ByteVector &pattern) const; + + /*! + * Appends \a v to the end of the ByteVector. + */ + ByteVector &append(const ByteVector &v); + + /*! + * Clears the data. + */ + ByteVector &clear(); + + /*! + * Returns the size of the array. + */ + uint size() const; + + /*! + * Resize the vector to \a size. If the vector is currently less than + * \a size, pad the remaining spaces with \a padding. Returns a reference + * to the resized vector. + */ + ByteVector &resize(uint size, char padding = 0); + + /*! + * Returns an Iterator that points to the front of the vector. + */ + Iterator begin(); + + /*! + * Returns a ConstIterator that points to the front of the vector. + */ + ConstIterator begin() const; + + /*! + * Returns an Iterator that points to the back of the vector. + */ + Iterator end(); + + /*! + * Returns a ConstIterator that points to the back of the vector. + */ + ConstIterator end() const; + + /*! + * Returns true if the vector is null. + * + * \note A vector may be empty without being null. + * \see isEmpty() + */ + bool isNull() const; + + /*! + * Returns true if the ByteVector is empty. + * + * \see size() + * \see isNull() + */ + bool isEmpty() const; + + /*! + * Returns a CRC checksum of the byte vector's data. + */ + uint checksum() const; + + /*! + * Converts the first 4 bytes of the vector to an unsigned integer. + * + * If \a mostSignificantByteFirst is true this will operate left to right + * evaluating the integer. For example if \a mostSignificantByteFirst is + * true then $00 $00 $00 $01 == 0x00000001 == 1, if false, $01 00 00 00 == + * 0x01000000 == 1. + * + * \see fromUInt() + */ + uint toUInt(bool mostSignificantByteFirst = true) const; + + /*! + * Converts the first 2 bytes of the vector to a short. + * + * If \a mostSignificantByteFirst is true this will operate left to right + * evaluating the integer. For example if \a mostSignificantByteFirst is + * true then $00 $01 == 0x0001 == 1, if false, $01 00 == 0x01000000 == 1. + * + * \see fromShort() + */ + short toShort(bool mostSignificantByteFirst = true) const; + + /*! + * Converts the first 2 bytes of the vector to a unsigned short. + * + * If \a mostSignificantByteFirst is true this will operate left to right + * evaluating the integer. For example if \a mostSignificantByteFirst is + * true then $00 $01 == 0x0001 == 1, if false, $01 00 == 0x01000000 == 1. + * + * \see fromShort() + */ + unsigned short toUShort(bool mostSignificantByteFirst = true) const; + + /*! + * Converts the first 8 bytes of the vector to a (signed) long long. + * + * If \a mostSignificantByteFirst is true this will operate left to right + * evaluating the integer. For example if \a mostSignificantByteFirst is + * true then $00 00 00 00 00 00 00 01 == 0x0000000000000001 == 1, + * if false, $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1. + * + * \see fromUInt() + */ + long long toLongLong(bool mostSignificantByteFirst = true) const; + + /*! + * Creates a 4 byte ByteVector based on \a value. If + * \a mostSignificantByteFirst is true, then this will operate left to right + * in building the ByteVector. For example if \a mostSignificantByteFirst is + * true then $00 00 00 01 == 0x00000001 == 1, if false, $01 00 00 00 == + * 0x01000000 == 1. + * + * \see toUInt() + */ + static ByteVector fromUInt(uint value, bool mostSignificantByteFirst = true); + + /*! + * Creates a 2 byte ByteVector based on \a value. If + * \a mostSignificantByteFirst is true, then this will operate left to right + * in building the ByteVector. For example if \a mostSignificantByteFirst is + * true then $00 01 == 0x0001 == 1, if false, $01 00 == 0x0100 == 1. + * + * \see toShort() + */ + static ByteVector fromShort(short value, bool mostSignificantByteFirst = true); + + /*! + * Creates a 8 byte ByteVector based on \a value. If + * \a mostSignificantByteFirst is true, then this will operate left to right + * in building the ByteVector. For example if \a mostSignificantByteFirst is + * true then $00 00 00 01 == 0x0000000000000001 == 1, if false, + * $01 00 00 00 00 00 00 00 == 0x0100000000000000 == 1. + * + * \see toLongLong() + */ + static ByteVector fromLongLong(long long value, bool mostSignificantByteFirst = true); + + /*! + * Returns a ByteVector based on the CString \a s. + */ + static ByteVector fromCString(const char *s, uint length = 0xffffffff); + + /*! + * Returns a const refernence to the byte at \a index. + */ + const char &operator[](int index) const; + + /*! + * Returns a reference to the byte at \a index. + */ + char &operator[](int index); + + /*! + * Returns true if this ByteVector and \a v are equal. + */ + bool operator==(const ByteVector &v) const; + + /*! + * Returns true if this ByteVector and \a v are not equal. + */ + bool operator!=(const ByteVector &v) const; + + /*! + * Returns true if this ByteVector and the null terminated C string \a s + * contain the same data. + */ + bool operator==(const char *s) const; + + /*! + * Returns true if this ByteVector and the null terminated C string \a s + * do not contain the same data. + */ + bool operator!=(const char *s) const; + + /*! + * Returns true if this ByteVector is less than \a v. The value of the + * vectors is determined by evaluating the character from left to right, and + * in the event one vector is a superset of the other, the size is used. + */ + bool operator<(const ByteVector &v) const; + + /*! + * Returns true if this ByteVector is greater than \a v. + */ + bool operator>(const ByteVector &v) const; + + /*! + * Returns a vector that is \a v appended to this vector. + */ + ByteVector operator+(const ByteVector &v) const; + + /*! + * Copies ByteVector \a v. + */ + ByteVector &operator=(const ByteVector &v); + + /*! + * Copies ByteVector \a v. + */ + ByteVector &operator=(char c); + + /*! + * Copies ByteVector \a v. + */ + ByteVector &operator=(const char *data); + + /*! + * A static, empty ByteVector which is convenient and fast (since returning + * an empty or "null" value does not require instantiating a new ByteVector). + */ + static ByteVector null; + + /*! + * Returns a hex-encoded copy of the byte vector. + */ + ByteVector toHex() const; + + protected: + /* + * If this ByteVector is being shared via implicit sharing, do a deep copy + * of the data and separate from the shared members. This should be called + * by all non-const subclass members. + */ + void detach(); + + private: + class ByteVectorPrivate; + ByteVectorPrivate *d; + }; + +} + +/*! + * \relates TagLib::ByteVector + * Streams the ByteVector \a v to the output stream \a s. + */ +TAGLIB_EXPORT std::ostream &operator<<(std::ostream &s, const TagLib::ByteVector &v); + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tbytevectorlist.h b/Audio-Frameworks/bin/taglib/headers/toolkit/tbytevectorlist.h new file mode 100644 index 0000000..5852583 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tbytevectorlist.h @@ -0,0 +1,91 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_BYTEVECTORLIST_H +#define TAGLIB_BYTEVECTORLIST_H + +#include "taglib_export.h" +#include "tbytevector.h" +#include "tlist.h" + +namespace TagLib { + + //! A list of ByteVectors + + /*! + * A List specialization with some handy features useful for ByteVectors. + */ + + class TAGLIB_EXPORT ByteVectorList : public List + { + public: + + /*! + * Construct an empty ByteVectorList. + */ + ByteVectorList(); + + /*! + * Destroys this ByteVectorList instance. + */ + virtual ~ByteVectorList(); + + /*! + * Make a shallow, implicitly shared, copy of \a l. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + ByteVectorList(const ByteVectorList &l); + + /*! + * Convert the ByteVectorList to a ByteVector separated by \a separator. By + * default a space is used. + */ + ByteVector toByteVector(const ByteVector &separator = " ") const; + + /*! + * Splits the ByteVector \a v into several strings at \a pattern. This will + * not include the pattern in the returned ByteVectors. + */ + static ByteVectorList split(const ByteVector &v, const ByteVector &pattern, + int byteAlign = 1); + /*! + * Splits the ByteVector \a v into several strings at \a pattern. This will + * not include the pattern in the returned ByteVectors. \a max is the + * maximum number of entries that will be separated. If \a max for instance + * is 2 then a maximum of 1 match will be found and the vector will be split + * on that match. + */ + // BIC: merge with the function above + static ByteVectorList split(const ByteVector &v, const ByteVector &pattern, + int byteAlign, int max); + private: + class ByteVectorListPrivate; + ByteVectorListPrivate *d; + }; + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tbytevectorstream.h b/Audio-Frameworks/bin/taglib/headers/toolkit/tbytevectorstream.h new file mode 100644 index 0000000..456b854 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tbytevectorstream.h @@ -0,0 +1,145 @@ +/*************************************************************************** + copyright : (C) 2011 by Lukas Lalinsky + email : lalinsky@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_BYTEVECTORSTREAM_H +#define TAGLIB_BYTEVECTORSTREAM_H + +#include "taglib_export.h" +#include "taglib.h" +#include "tbytevector.h" +#include "tiostream.h" + +namespace TagLib { + + class String; + class Tag; + class AudioProperties; + + //! In-memory Stream class using ByteVector for its storage. + + class TAGLIB_EXPORT ByteVectorStream : public IOStream + { + public: + /*! + * Construct a File object and opens the \a file. \a file should be a + * be a C-string in the local file system encoding. + */ + ByteVectorStream(const ByteVector &data); + + /*! + * Destroys this ByteVectorStream instance. + */ + virtual ~ByteVectorStream(); + + /*! + * Returns the file name in the local file system encoding. + */ + FileName name() const; + + /*! + * Reads a block of size \a length at the current get pointer. + */ + ByteVector readBlock(ulong length); + + /*! + * Attempts to write the block \a data at the current get pointer. If the + * file is currently only opened read only -- i.e. readOnly() returns true -- + * this attempts to reopen the file in read/write mode. + * + * \note This should be used instead of using the streaming output operator + * for a ByteVector. And even this function is significantly slower than + * doing output with a char[]. + */ + void writeBlock(const ByteVector &data); + + /*! + * Insert \a data at position \a start in the file overwriting \a replace + * bytes of the original content. + * + * \note This method is slow since it requires rewriting all of the file + * after the insertion point. + */ + void insert(const ByteVector &data, ulong start = 0, ulong replace = 0); + + /*! + * Removes a block of the file starting a \a start and continuing for + * \a length bytes. + * + * \note This method is slow since it involves rewriting all of the file + * after the removed portion. + */ + void removeBlock(ulong start = 0, ulong length = 0); + + /*! + * Returns true if the file is read only (or if the file can not be opened). + */ + bool readOnly() const; + + /*! + * Since the file can currently only be opened as an argument to the + * constructor (sort-of by design), this returns if that open succeeded. + */ + bool isOpen() const; + + /*! + * Move the I/O pointer to \a offset in the file from position \a p. This + * defaults to seeking from the beginning of the file. + * + * \see Position + */ + void seek(long offset, Position p = Beginning); + + /*! + * Reset the end-of-file and error flags on the file. + */ + void clear(); + + /*! + * Returns the current offset within the file. + */ + long tell() const; + + /*! + * Returns the length of the file. + */ + long length(); + + /*! + * Truncates the file to a \a length. + */ + void truncate(long length); + + ByteVector *data(); + + protected: + + private: + class ByteVectorStreamPrivate; + ByteVectorStreamPrivate *d; + }; + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tdebug.h b/Audio-Frameworks/bin/taglib/headers/toolkit/tdebug.h new file mode 100644 index 0000000..5204fe7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tdebug.h @@ -0,0 +1,71 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_DEBUG_H +#define TAGLIB_DEBUG_H + +namespace TagLib { + + class String; + class ByteVector; + +#ifndef DO_NOT_DOCUMENT +#ifndef NDEBUG + + /*! + * A simple function that prints debugging output to cerr if debugging is + * not disabled. + * + * \warning Do not use this outside of TagLib, it could lead to undefined + * symbols in your build if TagLib is built with NDEBUG defined and your + * application is not. + * + * \internal + */ + void debug(const String &s); + + /*! + * For debugging binary data. + * + * \warning Do not use this outside of TagLib, it could lead to undefined + * symbols in your build if TagLib is built with NDEBUG defined and your + * application is not. + * + * \internal + */ + void debugData(const ByteVector &v); + +#else + + // Define these to an empty statement if debugging is disabled. + +#define debug(x) +#define debugData(x) + +#endif +#endif +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tfile.h b/Audio-Frameworks/bin/taglib/headers/toolkit/tfile.h new file mode 100644 index 0000000..7df774a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tfile.h @@ -0,0 +1,295 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FILE_H +#define TAGLIB_FILE_H + +#include "taglib_export.h" +#include "taglib.h" +#include "tag.h" +#include "tbytevector.h" +#include "tiostream.h" + +namespace TagLib { + + class String; + class Tag; + class AudioProperties; + class PropertyMap; + + //! A file class with some useful methods for tag manipulation + + /*! + * This class is a basic file class with some methods that are particularly + * useful for tag editors. It has methods to take advantage of + * ByteVector and a binary search method for finding patterns in a file. + */ + + class TAGLIB_EXPORT File + { + public: + /*! + * Position in the file used for seeking. + */ + enum Position { + //! Seek from the beginning of the file. + Beginning, + //! Seek from the current position in the file. + Current, + //! Seek from the end of the file. + End + }; + + /*! + * Destroys this File instance. + */ + virtual ~File(); + + /*! + * Returns the file name in the local file system encoding. + */ + FileName name() const; + + /*! + * Returns a pointer to this file's tag. This should be reimplemented in + * the concrete subclasses. + */ + virtual Tag *tag() const = 0; + + /*! + * Exports the tags of the file as dictionary mapping (human readable) tag + * names (Strings) to StringLists of tag values. Calls the according specialization + * in the File subclasses. + * For each metadata object of the file that could not be parsed into the PropertyMap + * format, the returend map's unsupportedData() list will contain one entry identifying + * that object (e.g. the frame type for ID3v2 tags). Use removeUnsupportedProperties() + * to remove (a subset of) them. + * BIC: Will be made virtual in future releases. + */ + PropertyMap properties() const; + + /*! + * Removes unsupported properties, or a subset of them, from the file's metadata. + * The parameter \a properties must contain only entries from + * properties().unsupportedData(). + * BIC: Will be mad virtual in future releases. + */ + void removeUnsupportedProperties(const StringList& properties); + + /*! + * Sets the tags of this File to those specified in \a properties. Calls the + * according specialization method in the subclasses of File to do the translation + * into the format-specific details. + * If some value(s) could not be written imported to the specific metadata format, + * the returned PropertyMap will contain those value(s). Otherwise it will be empty, + * indicating that no problems occured. + * BIC: will become pure virtual in the future + */ + PropertyMap setProperties(const PropertyMap &properties); + /*! + * Returns a pointer to this file's audio properties. This should be + * reimplemented in the concrete subclasses. If no audio properties were + * read then this will return a null pointer. + */ + virtual AudioProperties *audioProperties() const = 0; + + /*! + * Save the file and its associated tags. This should be reimplemented in + * the concrete subclasses. Returns true if the save succeeds. + * + * \warning On UNIX multiple processes are able to write to the same file at + * the same time. This can result in serious file corruption. If you are + * developing a program that makes use of TagLib from multiple processes you + * must insure that you are only doing writes to a particular file from one + * of them. + */ + virtual bool save() = 0; + + /*! + * Reads a block of size \a length at the current get pointer. + */ + ByteVector readBlock(ulong length); + + /*! + * Attempts to write the block \a data at the current get pointer. If the + * file is currently only opened read only -- i.e. readOnly() returns true -- + * this attempts to reopen the file in read/write mode. + * + * \note This should be used instead of using the streaming output operator + * for a ByteVector. And even this function is significantly slower than + * doing output with a char[]. + */ + void writeBlock(const ByteVector &data); + + /*! + * Returns the offset in the file that \a pattern occurs at or -1 if it can + * not be found. If \a before is set, the search will only continue until the + * pattern \a before is found. This is useful for tagging purposes to search + * for a tag before the synch frame. + * + * Searching starts at \a fromOffset, which defaults to the beginning of the + * file. + * + * \note This has the practial limitation that \a pattern can not be longer + * than the buffer size used by readBlock(). Currently this is 1024 bytes. + */ + long find(const ByteVector &pattern, + long fromOffset = 0, + const ByteVector &before = ByteVector::null); + + /*! + * Returns the offset in the file that \a pattern occurs at or -1 if it can + * not be found. If \a before is set, the search will only continue until the + * pattern \a before is found. This is useful for tagging purposes to search + * for a tag before the synch frame. + * + * Searching starts at \a fromOffset and proceeds from the that point to the + * beginning of the file and defaults to the end of the file. + * + * \note This has the practial limitation that \a pattern can not be longer + * than the buffer size used by readBlock(). Currently this is 1024 bytes. + */ + long rfind(const ByteVector &pattern, + long fromOffset = 0, + const ByteVector &before = ByteVector::null); + + /*! + * Insert \a data at position \a start in the file overwriting \a replace + * bytes of the original content. + * + * \note This method is slow since it requires rewriting all of the file + * after the insertion point. + */ + void insert(const ByteVector &data, ulong start = 0, ulong replace = 0); + + /*! + * Removes a block of the file starting a \a start and continuing for + * \a length bytes. + * + * \note This method is slow since it involves rewriting all of the file + * after the removed portion. + */ + void removeBlock(ulong start = 0, ulong length = 0); + + /*! + * Returns true if the file is read only (or if the file can not be opened). + */ + bool readOnly() const; + + /*! + * Since the file can currently only be opened as an argument to the + * constructor (sort-of by design), this returns if that open succeeded. + */ + bool isOpen() const; + + /*! + * Returns true if the file is open and readble. + */ + bool isValid() const; + + /*! + * Move the I/O pointer to \a offset in the file from position \a p. This + * defaults to seeking from the beginning of the file. + * + * \see Position + */ + void seek(long offset, Position p = Beginning); + + /*! + * Reset the end-of-file and error flags on the file. + */ + void clear(); + + /*! + * Returns the current offset within the file. + */ + long tell() const; + + /*! + * Returns the length of the file. + */ + long length(); + + /*! + * Returns true if \a file can be opened for reading. If the file does not + * exist, this will return false. + * + * \deprecated + */ + static bool isReadable(const char *file); + + /*! + * Returns true if \a file can be opened for writing. + * + * \deprecated + */ + static bool isWritable(const char *name); + + protected: + /*! + * Construct a File object and opens the \a file. \a file should be a + * be a C-string in the local file system encoding. + * + * \note Constructor is protected since this class should only be + * instantiated through subclasses. + */ + File(FileName file); + + /*! + * Construct a File object and use the \a stream instance. + * + * \note Constructor is protected since this class should only be + * instantiated through subclasses. + */ + File(IOStream *stream); + + /*! + * Marks the file as valid or invalid. + * + * \see isValid() + */ + void setValid(bool valid); + + /*! + * Truncates the file to a \a length. + */ + void truncate(long length); + + /*! + * Returns the buffer size that is used for internal buffering. + */ + static uint bufferSize(); + + private: + File(const File &); + File &operator=(const File &); + + class FilePrivate; + FilePrivate *d; + }; + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tfilestream.h b/Audio-Frameworks/bin/taglib/headers/toolkit/tfilestream.h new file mode 100644 index 0000000..fa113b7 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tfilestream.h @@ -0,0 +1,154 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_FILESTREAM_H +#define TAGLIB_FILESTREAM_H + +#include "taglib_export.h" +#include "taglib.h" +#include "tbytevector.h" +#include "tiostream.h" + +namespace TagLib { + + class String; + class Tag; + class AudioProperties; + + //! A file class with some useful methods for tag manipulation + + /*! + * This class is a basic file class with some methods that are particularly + * useful for tag editors. It has methods to take advantage of + * ByteVector and a binary search method for finding patterns in a file. + */ + + class TAGLIB_EXPORT FileStream : public IOStream + { + public: + /*! + * Construct a File object and opens the \a file. \a file should be a + * be a C-string in the local file system encoding. + */ + FileStream(FileName file, bool openReadOnly = false); + + /*! + * Destroys this FileStream instance. + */ + virtual ~FileStream(); + + /*! + * Returns the file name in the local file system encoding. + */ + FileName name() const; + + /*! + * Reads a block of size \a length at the current get pointer. + */ + ByteVector readBlock(ulong length); + + /*! + * Attempts to write the block \a data at the current get pointer. If the + * file is currently only opened read only -- i.e. readOnly() returns true -- + * this attempts to reopen the file in read/write mode. + * + * \note This should be used instead of using the streaming output operator + * for a ByteVector. And even this function is significantly slower than + * doing output with a char[]. + */ + void writeBlock(const ByteVector &data); + + /*! + * Insert \a data at position \a start in the file overwriting \a replace + * bytes of the original content. + * + * \note This method is slow since it requires rewriting all of the file + * after the insertion point. + */ + void insert(const ByteVector &data, ulong start = 0, ulong replace = 0); + + /*! + * Removes a block of the file starting a \a start and continuing for + * \a length bytes. + * + * \note This method is slow since it involves rewriting all of the file + * after the removed portion. + */ + void removeBlock(ulong start = 0, ulong length = 0); + + /*! + * Returns true if the file is read only (or if the file can not be opened). + */ + bool readOnly() const; + + /*! + * Since the file can currently only be opened as an argument to the + * constructor (sort-of by design), this returns if that open succeeded. + */ + bool isOpen() const; + + /*! + * Move the I/O pointer to \a offset in the file from position \a p. This + * defaults to seeking from the beginning of the file. + * + * \see Position + */ + void seek(long offset, Position p = Beginning); + + /*! + * Reset the end-of-file and error flags on the file. + */ + void clear(); + + /*! + * Returns the current offset within the file. + */ + long tell() const; + + /*! + * Returns the length of the file. + */ + long length(); + + /*! + * Truncates the file to a \a length. + */ + void truncate(long length); + + protected: + + /*! + * Returns the buffer size that is used for internal buffering. + */ + static uint bufferSize(); + + private: + class FileStreamPrivate; + FileStreamPrivate *d; + }; + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tiostream.h b/Audio-Frameworks/bin/taglib/headers/toolkit/tiostream.h new file mode 100644 index 0000000..3e7de22 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tiostream.h @@ -0,0 +1,160 @@ +/*************************************************************************** + copyright : (C) 2011 by Lukas Lalinsky + email : lalinsky@gmail.com + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_IOSTREAM_H +#define TAGLIB_IOSTREAM_H + +#include "taglib_export.h" +#include "taglib.h" +#include "tbytevector.h" + +namespace TagLib { + +#ifdef _WIN32 + class TAGLIB_EXPORT FileName + { + public: + FileName(const wchar_t *name) : m_wname(name) {} + FileName(const char *name) : m_name(name) {} + operator const wchar_t *() const { return m_wname.c_str(); } + operator const char *() const { return m_name.c_str(); } + private: + std::string m_name; + std::wstring m_wname; + }; +#else + typedef const char *FileName; +#endif + + //! An abstract class that provides operations on a sequence of bytes + + class TAGLIB_EXPORT IOStream + { + public: + /*! + * Position in the file used for seeking. + */ + enum Position { + //! Seek from the beginning of the file. + Beginning, + //! Seek from the current position in the file. + Current, + //! Seek from the end of the file. + End + }; + + IOStream(); + + /*! + * Destroys this IOStream instance. + */ + virtual ~IOStream(); + + /*! + * Returns the stream name in the local file system encoding. + */ + virtual FileName name() const = 0; + + /*! + * Reads a block of size \a length at the current get pointer. + */ + virtual ByteVector readBlock(ulong length) = 0; + + /*! + * Attempts to write the block \a data at the current get pointer. If the + * file is currently only opened read only -- i.e. readOnly() returns true -- + * this attempts to reopen the file in read/write mode. + * + * \note This should be used instead of using the streaming output operator + * for a ByteVector. And even this function is significantly slower than + * doing output with a char[]. + */ + virtual void writeBlock(const ByteVector &data) = 0; + + /*! + * Insert \a data at position \a start in the file overwriting \a replace + * bytes of the original content. + * + * \note This method is slow since it requires rewriting all of the file + * after the insertion point. + */ + virtual void insert(const ByteVector &data, ulong start = 0, ulong replace = 0) = 0; + + /*! + * Removes a block of the file starting a \a start and continuing for + * \a length bytes. + * + * \note This method is slow since it involves rewriting all of the file + * after the removed portion. + */ + virtual void removeBlock(ulong start = 0, ulong length = 0) = 0; + + /*! + * Returns true if the file is read only (or if the file can not be opened). + */ + virtual bool readOnly() const = 0; + + /*! + * Since the file can currently only be opened as an argument to the + * constructor (sort-of by design), this returns if that open succeeded. + */ + virtual bool isOpen() const = 0; + + /*! + * Move the I/O pointer to \a offset in the stream from position \a p. This + * defaults to seeking from the beginning of the stream. + * + * \see Position + */ + virtual void seek(long offset, Position p = Beginning) = 0; + + /*! + * Reset the end-of-stream and error flags on the stream. + */ + virtual void clear(); + + /*! + * Returns the current offset within the stream. + */ + virtual long tell() const = 0; + + /*! + * Returns the length of the stream. + */ + virtual long length() = 0; + + /*! + * Truncates the stream to a \a length. + */ + virtual void truncate(long length) = 0; + + private: + IOStream(const IOStream &); + IOStream &operator=(const IOStream &); + }; + +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tlist.h b/Audio-Frameworks/bin/taglib/headers/toolkit/tlist.h new file mode 100644 index 0000000..0099dad --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tlist.h @@ -0,0 +1,257 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_LIST_H +#define TAGLIB_LIST_H + +#include "taglib.h" + +#include + +namespace TagLib { + + //! A generic, implicitly shared list. + + /*! + * This is basic generic list that's somewhere between a std::list and a + * QValueList. This class is implicitly shared. For example: + * + * \code + * + * TagLib::List l = someOtherIntList; + * + * \endcode + * + * The above example is very cheap. This also makes lists suitable for the + * return types of functions. The above example will just copy a pointer rather + * than copying the data in the list. When your \e shared list's data changes, + * only \e then will the data be copied. + */ + + template class List + { + public: +#ifndef DO_NOT_DOCUMENT + typedef typename std::list::iterator Iterator; + typedef typename std::list::const_iterator ConstIterator; +#endif + + /*! + * Constructs an empty list. + */ + List(); + + /*! + * Make a shallow, implicitly shared, copy of \a l. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + List(const List &l); + + /*! + * Destroys this List instance. If auto deletion is enabled and this list + * contains a pointer type all of the memebers are also deleted. + */ + virtual ~List(); + + /*! + * Returns an STL style iterator to the beginning of the list. See + * std::list::const_iterator for the semantics. + */ + Iterator begin(); + + /*! + * Returns an STL style constant iterator to the beginning of the list. See + * std::list::iterator for the semantics. + */ + ConstIterator begin() const; + + /*! + * Returns an STL style iterator to the end of the list. See + * std::list::iterator for the semantics. + */ + Iterator end(); + + /*! + * Returns an STL style constant iterator to the end of the list. See + * std::list::const_iterator for the semantics. + */ + ConstIterator end() const; + + /*! + * Inserts a copy of \a value before \a it. + */ + Iterator insert(Iterator it, const T &value); + + /*! + * Inserts the \a value into the list. This assumes that the list is + * currently sorted. If \a unique is true then the value will not + * be inserted if it is already in the list. + */ + List &sortedInsert(const T &value, bool unique = false); + + /*! + * Appends \a item to the end of the list and returns a reference to the + * list. + */ + List &append(const T &item); + + /*! + * Appends all of the values in \a l to the end of the list and returns a + * reference to the list. + */ + List &append(const List &l); + + /*! + * Prepends \a item to the beginning list and returns a reference to the + * list. + */ + List &prepend(const T &item); + + /*! + * Prepends all of the items in \a l to the beginning list and returns a + * reference to the list. + */ + List &prepend(const List &l); + + /*! + * Clears the list. If auto deletion is enabled and this list contains a + * pointer type the members are also deleted. + * + * \see setAutoDelete() + */ + List &clear(); + + /*! + * Returns the number of elements in the list. + */ + uint size() const; + bool isEmpty() const; + + /*! + * Find the first occurrence of \a value. + */ + Iterator find(const T &value); + + /*! + * Find the first occurrence of \a value. + */ + ConstIterator find(const T &value) const; + + /*! + * Returns true if the list contains \a value. + */ + bool contains(const T &value) const; + + /*! + * Erase the item at \a it from the list. + */ + Iterator erase(Iterator it); + + /*! + * Returns a reference to the first item in the list. + */ + const T &front() const; + + /*! + * Returns a reference to the first item in the list. + */ + T &front(); + + /*! + * Returns a reference to the last item in the list. + */ + const T &back() const; + + /*! + * Returns a reference to the last item in the list. + */ + T &back(); + + /*! + * Auto delete the members of the list when the last reference to the list + * passes out of scope. This will have no effect on lists which do not + * contain a pointer type. + * + * \note This relies on partial template instantiation -- most modern C++ + * compilers should now support this. + */ + void setAutoDelete(bool autoDelete); + + /*! + * Returns a reference to item \a i in the list. + * + * \warning This method is slow. Use iterators to loop through the list. + */ + T &operator[](uint i); + + /*! + * Returns a const reference to item \a i in the list. + * + * \warning This method is slow. Use iterators to loop through the list. + */ + const T &operator[](uint i) const; + + /*! + * Make a shallow, implicitly shared, copy of \a l. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + List &operator=(const List &l); + + /*! + * Compares this list with \a l and returns true if all of the elements are + * the same. + */ + bool operator==(const List &l) const; + + /*! + * Compares this list with \a l and returns true if the lists differ. + */ + bool operator!=(const List &l) const; + + protected: + /* + * If this List is being shared via implicit sharing, do a deep copy of the + * data and separate from the shared members. This should be called by all + * non-const subclass members. + */ + void detach(); + + private: +#ifndef DO_NOT_DOCUMENT + template class ListPrivate; + ListPrivate *d; +#endif + }; + +} + +// Since GCC doesn't support the "export" keyword, we have to include the +// implementation. + +#include "tlist.tcc" + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tlist.tcc b/Audio-Frameworks/bin/taglib/headers/toolkit/tlist.tcc new file mode 100644 index 0000000..37817f0 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tlist.tcc @@ -0,0 +1,322 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#include + +namespace TagLib { + +//////////////////////////////////////////////////////////////////////////////// +// public members +//////////////////////////////////////////////////////////////////////////////// + +// The functionality of List::setAutoDelete() is implemented here partial +// template specialization. This is implemented in such a way that calling +// setAutoDelete() on non-pointer types will simply have no effect. + +// A base for the generic and specialized private class types. New +// non-templatized members should be added here. + +class ListPrivateBase : public RefCounter +{ +public: + ListPrivateBase() : autoDelete(false) {} + bool autoDelete; +}; + +// A generic implementation + +template +template class List::ListPrivate : public ListPrivateBase +{ +public: + ListPrivate() : ListPrivateBase() {} + ListPrivate(const std::list &l) : ListPrivateBase(), list(l) {} + void clear() { + list.clear(); + } + std::list list; +}; + +// A partial specialization for all pointer types that implements the +// setAutoDelete() functionality. + +template +template class List::ListPrivate : public ListPrivateBase +{ +public: + ListPrivate() : ListPrivateBase() {} + ListPrivate(const std::list &l) : ListPrivateBase(), list(l) {} + ~ListPrivate() { + clear(); + } + void clear() { + if(autoDelete) { + typename std::list::const_iterator it = list.begin(); + for(; it != list.end(); ++it) + delete *it; + } + list.clear(); + } + std::list list; +}; + +//////////////////////////////////////////////////////////////////////////////// +// public members +//////////////////////////////////////////////////////////////////////////////// + +template +List::List() +{ + d = new ListPrivate; +} + +template +List::List(const List &l) : d(l.d) +{ + d->ref(); +} + +template +List::~List() +{ + if(d->deref()) + delete d; +} + +template +typename List::Iterator List::begin() +{ + detach(); + return d->list.begin(); +} + +template +typename List::ConstIterator List::begin() const +{ + return d->list.begin(); +} + +template +typename List::Iterator List::end() +{ + detach(); + return d->list.end(); +} + +template +typename List::ConstIterator List::end() const +{ + return d->list.end(); +} + +template +typename List::Iterator List::insert(Iterator it, const T &item) +{ + detach(); + return d->list.insert(it, item); +} + +template +List &List::sortedInsert(const T &value, bool unique) +{ + detach(); + Iterator it = begin(); + while(it != end() && *it < value) + ++it; + if(unique && it != end() && *it == value) + return *this; + insert(it, value); + return *this; +} + +template +List &List::append(const T &item) +{ + detach(); + d->list.push_back(item); + return *this; +} + +template +List &List::append(const List &l) +{ + detach(); + d->list.insert(d->list.end(), l.begin(), l.end()); + return *this; +} + +template +List &List::prepend(const T &item) +{ + detach(); + d->list.push_front(item); + return *this; +} + +template +List &List::prepend(const List &l) +{ + detach(); + d->list.insert(d->list.begin(), l.begin(), l.end()); + return *this; +} + +template +List &List::clear() +{ + detach(); + d->clear(); + return *this; +} + +template +TagLib::uint List::size() const +{ + return d->list.size(); +} + +template +bool List::isEmpty() const +{ + return d->list.empty(); +} + +template +typename List::Iterator List::find(const T &value) +{ + return std::find(d->list.begin(), d->list.end(), value); +} + +template +typename List::ConstIterator List::find(const T &value) const +{ + return std::find(d->list.begin(), d->list.end(), value); +} + +template +bool List::contains(const T &value) const +{ + return std::find(d->list.begin(), d->list.end(), value) != d->list.end(); +} + +template +typename List::Iterator List::erase(Iterator it) +{ + return d->list.erase(it); +} + +template +const T &List::front() const +{ + return d->list.front(); +} + +template +T &List::front() +{ + detach(); + return d->list.front(); +} + +template +const T &List::back() const +{ + return d->list.back(); +} + +template +void List::setAutoDelete(bool autoDelete) +{ + d->autoDelete = autoDelete; +} + +template +T &List::back() +{ + detach(); + return d->list.back(); +} + +template +T &List::operator[](uint i) +{ + Iterator it = d->list.begin(); + + for(uint j = 0; j < i; j++) + ++it; + + return *it; +} + +template +const T &List::operator[](uint i) const +{ + ConstIterator it = d->list.begin(); + + for(uint j = 0; j < i; j++) + ++it; + + return *it; +} + +template +List &List::operator=(const List &l) +{ + if(&l == this) + return *this; + + if(d->deref()) + delete d; + d = l.d; + d->ref(); + return *this; +} + +template +bool List::operator==(const List &l) const +{ + return d->list == l.d->list; +} + +template +bool List::operator!=(const List &l) const +{ + return d->list != l.d->list; +} + +//////////////////////////////////////////////////////////////////////////////// +// protected members +//////////////////////////////////////////////////////////////////////////////// + +template +void List::detach() +{ + if(d->count() > 1) { + d->deref(); + d = new ListPrivate(d->list); + } +} + +} // namespace TagLib diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tmap.h b/Audio-Frameworks/bin/taglib/headers/toolkit/tmap.h new file mode 100644 index 0000000..a7d9930 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tmap.h @@ -0,0 +1,199 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_MAP_H +#define TAGLIB_MAP_H + +#include + +#include "taglib.h" + +namespace TagLib { + + //! A generic, implicitly shared map. + + /*! + * This implements a standard map container that associates a key with a value + * and has fast key-based lookups. This map is also implicitly shared making + * it suitable for pass-by-value usage. + */ + + template class Map + { + public: +#ifndef DO_NOT_DOCUMENT +#ifdef WANT_CLASS_INSTANTIATION_OF_MAP + // Some STL implementations get snippy over the use of the + // class keyword to distinguish different templates; Sun Studio + // in particular finds multiple specializations in certain rare + // cases and complains about that. GCC doesn't seem to mind, + // and uses the typedefs further below without the class keyword. + // Not all the specializations of Map can use the class keyword + // (when T is not actually a class type), so don't apply this + // generally. + typedef typename std::map::iterator Iterator; + typedef typename std::map::const_iterator ConstIterator; +#else + typedef typename std::map::iterator Iterator; + typedef typename std::map::const_iterator ConstIterator; +#endif +#endif + + /*! + * Constructs an empty Map. + */ + Map(); + + /*! + * Make a shallow, implicitly shared, copy of \a m. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + Map(const Map &m); + + /*! + * Destroys this instance of the Map. + */ + virtual ~Map(); + + /*! + * Returns an STL style iterator to the beginning of the map. See + * std::map::iterator for the semantics. + */ + Iterator begin(); + + /*! + * Returns an STL style iterator to the beginning of the map. See + * std::map::const_iterator for the semantics. + */ + ConstIterator begin() const; + + /*! + * Returns an STL style iterator to the end of the map. See + * std::map::iterator for the semantics. + */ + Iterator end(); + + /*! + * Returns an STL style iterator to the end of the map. See + * std::map::const_iterator for the semantics. + */ + ConstIterator end() const; + + /*! + * Inserts \a value under \a key in the map. If a value for \a key already + * exists it will be overwritten. + */ + Map &insert(const Key &key, const T &value); + + /*! + * Removes all of the elements from elements from the map. This however + * will not delete pointers if the mapped type is a pointer type. + */ + Map &clear(); + + /*! + * The number of elements in the map. + * + * \see isEmpty() + */ + uint size() const; + + /*! + * Returns true if the map is empty. + * + * \see size() + */ + bool isEmpty() const; + + /*! + * Find the first occurrence of \a key. + */ + Iterator find(const Key &key); + + /*! + * Find the first occurrence of \a key. + */ + ConstIterator find(const Key &key) const; + + /*! + * Returns true if the map contains an instance of \a key. + */ + bool contains(const Key &key) const; + + /*! + * Erase the item at \a it from the list. + */ + Map &erase(Iterator it); + + /*! + * Erase the item with \a key from the list. + */ + Map &erase(const Key &key); + + /*! + * Returns a reference to the value associated with \a key. + * + * \note This has undefined behavior if the key is not present in the map. + */ + const T &operator[](const Key &key) const; + + /*! + * Returns a reference to the value associated with \a key. + * + * \note This has undefined behavior if the key is not present in the map. + */ + T &operator[](const Key &key); + + /*! + * Make a shallow, implicitly shared, copy of \a m. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + Map &operator=(const Map &m); + + protected: + /* + * If this List is being shared via implicit sharing, do a deep copy of the + * data and separate from the shared members. This should be called by all + * non-const subclass members. + */ + void detach(); + + private: +#ifndef DO_NOT_DOCUMENT + template class MapPrivate; + MapPrivate *d; +#endif + }; + +} + +// Since GCC doesn't support the "export" keyword, we have to include the +// implementation. + +#include "tmap.tcc" + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tmap.tcc b/Audio-Frameworks/bin/taglib/headers/toolkit/tmap.tcc new file mode 100644 index 0000000..0f2b993 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tmap.tcc @@ -0,0 +1,196 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +namespace TagLib { + +//////////////////////////////////////////////////////////////////////////////// +// public members +//////////////////////////////////////////////////////////////////////////////// + +template +template +class Map::MapPrivate : public RefCounter +{ +public: + MapPrivate() : RefCounter() {} +#ifdef WANT_CLASS_INSTANTIATION_OF_MAP + MapPrivate(const std::map& m) : RefCounter(), map(m) {} + std::map map; +#else + MapPrivate(const std::map& m) : RefCounter(), map(m) {} + std::map map; +#endif +}; + +template +Map::Map() +{ + d = new MapPrivate; +} + +template +Map::Map(const Map &m) : d(m.d) +{ + d->ref(); +} + +template +Map::~Map() +{ + if(d->deref()) + delete(d); +} + +template +typename Map::Iterator Map::begin() +{ + detach(); + return d->map.begin(); +} + +template +typename Map::ConstIterator Map::begin() const +{ + return d->map.begin(); +} + +template +typename Map::Iterator Map::end() +{ + detach(); + return d->map.end(); +} + +template +typename Map::ConstIterator Map::end() const +{ + return d->map.end(); +} + +template +Map &Map::insert(const Key &key, const T &value) +{ + detach(); + d->map[key] = value; + return *this; +} + +template +Map &Map::clear() +{ + detach(); + d->map.clear(); + return *this; +} + +template +bool Map::isEmpty() const +{ + return d->map.empty(); +} + +template +typename Map::Iterator Map::find(const Key &key) +{ + detach(); + return d->map.find(key); +} + +template +typename Map::ConstIterator Map::find(const Key &key) const +{ + return d->map.find(key); +} + +template +bool Map::contains(const Key &key) const +{ + return d->map.find(key) != d->map.end(); +} + +template +Map &Map::erase(Iterator it) +{ + detach(); + d->map.erase(it); + return *this; +} + +template +Map &Map::erase(const Key &key) +{ + detach(); + Iterator it = d->map.find(key); + if(it != d->map.end()) + d->map.erase(it); + return *this; +} + +template +TagLib::uint Map::size() const +{ + return d->map.size(); +} + +template +const T &Map::operator[](const Key &key) const +{ + return d->map[key]; +} + +template +T &Map::operator[](const Key &key) +{ + detach(); + return d->map[key]; +} + +template +Map &Map::operator=(const Map &m) +{ + if(&m == this) + return *this; + + if(d->deref()) + delete(d); + d = m.d; + d->ref(); + return *this; +} + +//////////////////////////////////////////////////////////////////////////////// +// protected members +//////////////////////////////////////////////////////////////////////////////// + +template +void Map::detach() +{ + if(d->count() > 1) { + d->deref(); + d = new MapPrivate(d->map); + } +} + +} // namespace TagLib diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tpropertymap.h b/Audio-Frameworks/bin/taglib/headers/toolkit/tpropertymap.h new file mode 100644 index 0000000..b955739 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tpropertymap.h @@ -0,0 +1,184 @@ +/*************************************************************************** + copyright : (C) 2012 by Michael Helmling + email : helmling@mathematik.uni-kl.de + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef PROPERTYMAP_H_ +#define PROPERTYMAP_H_ + +#include "tmap.h" +#include "tstringlist.h" + +namespace TagLib { + + typedef Map SimplePropertyMap; + + //! A map for format-independent tag representations. + + /*! + * This map implements a generic representation of textual audio metadata + * ("tags") realized as pairs of a case-insensitive key + * and a nonempty list of corresponding values, each value being an an arbitrary + * unicode String. + * The key has the same restrictions as in the vorbis comment specification, + * i.e. it must contain at least one character; all printable ASCII characters + * except '=' and '~' are allowed. + * + * In order to be safe with other formats, keep these additional restrictions in mind: + * + * - APE only allows keys from 2 to 16 printable ASCII characters (including space), + * with the exception of these strings: ID3, TAG, OggS, MP+ + * + */ + + class TAGLIB_EXPORT PropertyMap: public SimplePropertyMap + { + public: + + typedef SimplePropertyMap::Iterator Iterator; + typedef SimplePropertyMap::ConstIterator ConstIterator; + + PropertyMap(); + + PropertyMap(const PropertyMap &m); + + /*! + * Creates a PropertyMap initialized from a SimplePropertyMap. Copies all + * entries from \a m that have valid keys. + * Invalid keys will be appended to the unsupportedData() list. + */ + PropertyMap(const SimplePropertyMap &m); + + virtual ~PropertyMap(); + + /*! + * Inserts \a values under \a key in the map. If \a key already exists, + * then \values will be appended to the existing StringList. + * The returned value indicates success, i.e. whether \a key is a + * valid key. + */ + bool insert(const String &key, const StringList &values); + + /*! + * Replaces any existing values for \a key with the given \a values, + * and simply insert them if \a key did not exist before. + * The returned value indicates success, i.e. whether \a key is a + * valid key. + */ + bool replace(const String &key, const StringList &values); + + /*! + * Find the first occurrence of \a key. + */ + Iterator find(const String &key); + + /*! + * Find the first occurrence of \a key. + */ + ConstIterator find(const String &key) const; + + /*! + * Returns true if the map contains values for \a key. + */ + bool contains(const String &key) const; + + /*! + * Returns true if this map contains all keys of \a other + * and the values coincide for that keys. Does not take + * the unsupportedData list into account. + */ + bool contains(const PropertyMap &other) const; + + /*! + * Erase the \a key and its values from the map. + */ + PropertyMap &erase(const String &key); + + /*! + * Erases from this map all keys that appear in \a other. + */ + PropertyMap &erase(const PropertyMap &other); + + /*! + * Merge the contents of \a other into this PropertyMap. + * If a key is contained in both maps, the values of the second + * are appended to that of the first. + * The unsupportedData() lists are concatenated as well. + */ + PropertyMap &merge(const PropertyMap &other); + + /*! + * Returns a reference to the value associated with \a key. + * + * \note: This has undefined behavior if the key is not valid or not + * present in the map. + */ + const StringList &operator[](const String &key) const; + + /*! + * Returns a reference to the value associated with \a key. + * + * \note: This has undefined behavior if the key is not valid or not + * present in the map. + */ + StringList &operator[](const String &key); + + /*! + * Returns true if and only if \other has the same contents as this map. + */ + bool operator==(const PropertyMap &other) const; + + /*! + * Returns false if and only \other has the same contents as this map. + */ + bool operator!=(const PropertyMap &other) const; + + /*! + * If a PropertyMap is read from a File object using File::properties(), + * the StringList returned from this function will represent metadata + * that could not be parsed into the PropertyMap representation. This could + * be e.g. binary data, unknown ID3 frames, etc. + * You can remove items from the returned list, which tells TagLib to remove + * those unsupported elements if you call File::setProperties() with the + * same PropertyMap as argument. + */ + StringList &unsupportedData(); + const StringList &unsupportedData() const; + + /*! + * Removes all entries which have an empty value list. + */ + void removeEmpty(); + + String toString() const; + + /*! + * Converts \a proposed into another String suitable to be used as + * a key, or returns String::null if this is not possible. + */ + static String prepareKey(const String &proposed); + + private: + + + StringList unsupported; + }; + +} +#endif /* PROPERTYMAP_H_ */ diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tstring.h b/Audio-Frameworks/bin/taglib/headers/toolkit/tstring.h new file mode 100644 index 0000000..759a175 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tstring.h @@ -0,0 +1,496 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_STRING_H +#define TAGLIB_STRING_H + +#include "taglib_export.h" +#include "taglib.h" +#include "tbytevector.h" + +#include +#include + +/*! + * \relates TagLib::String + * + * Converts a QString to a TagLib::String without a requirement to link to Qt. + * + * \note consider conversion via usual char-by-char for loop to avoid UTF16->UTF8->UTF16 + * conversion happening in the background + */ +#define QStringToTString(s) TagLib::String(s.utf8().data(), TagLib::String::UTF8) + +/*! + * \relates TagLib::String + * + * Converts a TagLib::String to a QString without a requirement to link to Qt. + * + * \note consider conversion via usual char-by-char for loop to avoid UTF16->UTF8->UTF16 + * conversion happening in the background + * + */ +#define TStringToQString(s) QString::fromUtf8(s.toCString(true)) + +namespace TagLib { + + class StringList; + + //! A \e wide string class suitable for unicode. + + /*! + * This is an implicitly shared \e wide string. For storage it uses + * TagLib::wstring, but as this is an implementation detail this of + * course could change. Strings are stored internally as UTF-16BE. (Without + * the BOM (Byte Order Mark) + * + * The use of implicit sharing means that copying a string is cheap, the only + * \e cost comes into play when the copy is modified. Prior to that the string + * just has a pointer to the data of the \e parent String. This also makes + * this class suitable as a function return type. + * + * In addition to adding implicit sharing, this class keeps track of four + * possible encodings, which are the four supported by the ID3v2 standard. + */ + + class TAGLIB_EXPORT String + { + public: + +#ifndef DO_NOT_DOCUMENT + typedef std::basic_string::iterator Iterator; + typedef std::basic_string::const_iterator ConstIterator; +#endif + + /** + * The four types of string encodings supported by the ID3v2 specification. + * ID3v1 is assumed to be Latin1 and Ogg Vorbis comments use UTF8. + */ + enum Type { + /*! + * IS08859-1, or Latin1 encoding. 8 bit characters. + */ + Latin1 = 0, + /*! + * UTF16 with a byte order mark. 16 bit characters. + */ + UTF16 = 1, + /*! + * UTF16 big endian. 16 bit characters. This is the encoding used + * internally by TagLib. + */ + UTF16BE = 2, + /*! + * UTF8 encoding. Characters are usually 8 bits but can be up to 32. + */ + UTF8 = 3, + /*! + * UTF16 little endian. 16 bit characters. + */ + UTF16LE = 4 + }; + + /*! + * Constructs an empty String. + */ + String(); + + /*! + * Make a shallow, implicitly shared, copy of \a s. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + String(const String &s); + + /*! + * Makes a deep copy of the data in \a s. + * + * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when + * used with other codecs it will simply print a warning and exit. + */ + String(const std::string &s, Type t = Latin1); + + /*! + * Makes a deep copy of the data in \a s. + */ + String(const wstring &s, Type t = UTF16BE); + + /*! + * Makes a deep copy of the data in \a s. + */ + String(const wchar_t *s, Type t = UTF16BE); + + /*! + * Makes a deep copy of the data in \a c. + * + * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when + * used with other codecs it will simply print a warning and exit. + */ + String(char c, Type t = Latin1); + + /*! + * Makes a deep copy of the data in \a c. + */ + String(wchar_t c, Type t = Latin1); + + + /*! + * Makes a deep copy of the data in \a s. + * + * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when + * used with other codecs it will simply print a warning and exit. + */ + String(const char *s, Type t = Latin1); + + /*! + * Makes a deep copy of the data in \a s. + * + * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when + * used with other codecs it will simply print a warning and exit. + */ + String(const ByteVector &v, Type t = Latin1); + + /*! + * Destroys this String instance. + */ + virtual ~String(); + + /*! + * If \a unicode if false (the default) this will return a \e Latin1 encoded + * std::string. If it is true the returned std::wstring will be UTF-8 + * encoded. + */ + std::string to8Bit(bool unicode = false) const; + + /*! + * Returns a wstring version of the TagLib string as a wide string. + */ + wstring toWString() const; + + /*! + * Creates and returns a C-String based on the data. This string is still + * owned by the String (class) and as such should not be deleted by the user. + * + * If \a unicode if false (the default) this string will be encoded in + * \e Latin1. If it is true the returned C-String will be UTF-8 encoded. + * + * This string remains valid until the String instance is destroyed or + * another export method is called. + * + * \warning This however has the side effect that this C-String will remain + * in memory in addition to other memory that is consumed by the + * String instance. So, this method should not be used on large strings or + * where memory is critical. + */ + const char *toCString(bool unicode = false) const; + + /*! + * Returns an iterator pointing to the beginning of the string. + */ + Iterator begin(); + + /*! + * Returns a const iterator pointing to the beginning of the string. + */ + ConstIterator begin() const; + + /*! + * Returns an iterator pointing to the end of the string (the position + * after the last character). + */ + Iterator end(); + + /*! + * Returns a const iterator pointing to the end of the string (the position + * after the last character). + */ + ConstIterator end() const; + + /*! + * Finds the first occurrence of pattern \a s in this string starting from + * \a offset. If the pattern is not found, -1 is returned. + */ + int find(const String &s, int offset = 0) const; + + /*! + * Finds the last occurrence of pattern \a s in this string, searched backwards, + * either from the end of the string or starting from \a offset. If the pattern + * is not found, -1 is returned. + */ + int rfind(const String &s, int offset = -1) const; + + /*! + * Splits the string on each occurrence of \a separator. + */ + StringList split(const String &separator = " ") const; + + /*! + * Returns true if the strings starts with the substring \a s. + */ + bool startsWith(const String &s) const; + + /*! + * Extract a substring from this string starting at \a position and + * continuing for \a n characters. + */ + String substr(uint position, uint n = 0xffffffff) const; + + /*! + * Append \a s to the current string and return a reference to the current + * string. + */ + String &append(const String &s); + + /*! + * Returns an upper case version of the string. + * + * \warning This only works for the characters in US-ASCII, i.e. A-Z. + */ + String upper() const; + + /*! + * Returns the size of the string. + */ + uint size() const; + + /*! + * Returns the length of the string. Equivalent to size(). + */ + uint length() const; + + /*! + * Returns true if the string is empty. + * + * \see isNull() + */ + bool isEmpty() const; + + /*! + * Returns true if this string is null -- i.e. it is a copy of the + * String::null string. + * + * \note A string can be empty and not null. + * \see isEmpty() + */ + bool isNull() const; + + /*! + * Returns a ByteVector containing the string's data. If \a t is Latin1 or + * UTF8, this will return a vector of 8 bit characters, otherwise it will use + * 16 bit characters. + */ + ByteVector data(Type t) const; + + /*! + * Convert the string to an integer. + * + * Returns the integer if the conversion was successfull or 0 if the + * string does not represent a number. + */ + // BIC: merge with the method below + int toInt() const; + + /*! + * Convert the string to an integer. + * + * If the conversion was successfull, it sets the value of \a *ok to + * true and returns the integer. Otherwise it sets \a *ok to false + * and the result is undefined. + */ + int toInt(bool *ok) const; + + /*! + * Returns a string with the leading and trailing whitespace stripped. + */ + String stripWhiteSpace() const; + + /*! + * Returns true if the file only uses characters required by Latin1. + */ + bool isLatin1() const; + + /*! + * Returns true if the file only uses characters required by (7-bit) ASCII. + */ + bool isAscii() const; + + /*! + * Converts the base-10 integer \a n to a string. + */ + static String number(int n); + + /*! + * Returns a reference to the character at position \a i. + */ + wchar &operator[](int i); + + /*! + * Returns a const reference to the character at position \a i. + */ + const wchar &operator[](int i) const; + + /*! + * Compares each character of the String with each character of \a s and + * returns true if the strings match. + */ + bool operator==(const String &s) const; + + /*! + * Compares each character of the String with each character of \a s and + * returns false if the strings match. + */ + bool operator!=(const String &s) const; + + /*! + * Appends \a s to the end of the String. + */ + String &operator+=(const String &s); + + /*! + * Appends \a s to the end of the String. + */ + String &operator+=(const wchar_t* s); + + /*! + * Appends \a s to the end of the String. + */ + String &operator+=(const char* s); + + /*! + * Appends \a s to the end of the String. + */ + String &operator+=(wchar_t c); + + /*! + * Appends \a c to the end of the String. + */ + String &operator+=(char c); + + /*! + * Performs a shallow, implicitly shared, copy of \a s, overwriting the + * String's current data. + */ + String &operator=(const String &s); + + /*! + * Performs a deep copy of the data in \a s. + */ + String &operator=(const std::string &s); + + /*! + * Performs a deep copy of the data in \a s. + */ + String &operator=(const wstring &s); + + /*! + * Performs a deep copy of the data in \a s. + */ + String &operator=(const wchar_t *s); + + /*! + * Performs a deep copy of the data in \a s. + */ + String &operator=(char c); + + /*! + * Performs a deep copy of the data in \a s. + */ + String &operator=(wchar_t c); + + /*! + * Performs a deep copy of the data in \a s. + */ + String &operator=(const char *s); + + /*! + * Performs a deep copy of the data in \a v. + */ + String &operator=(const ByteVector &v); + + /*! + * To be able to use this class in a Map, this operator needed to be + * implemented. Returns true if \a s is less than this string in a bytewise + * comparison. + */ + bool operator<(const String &s) const; + + /*! + * A null string provided for convenience. + */ + static String null; + + protected: + /*! + * If this String is being shared via implicit sharing, do a deep copy of the + * data and separate from the shared members. This should be called by all + * non-const subclass members. + */ + void detach(); + + private: + /*! + * This checks to see if the string is in \e UTF-16 (with BOM) or \e UTF-8 + * format and if so converts it to \e UTF-16BE for internal use. \e Latin1 + * does not require conversion since it is a subset of \e UTF-16BE and + * \e UTF16-BE requires no conversion since it is used internally. + */ + void prepare(Type t); + + class StringPrivate; + StringPrivate *d; + }; + +} + +/*! + * \relates TagLib::String + * + * Concatenates \a s1 and \a s2 and returns the result as a string. + */ +TAGLIB_EXPORT const TagLib::String operator+(const TagLib::String &s1, const TagLib::String &s2); + +/*! + * \relates TagLib::String + * + * Concatenates \a s1 and \a s2 and returns the result as a string. + */ +TAGLIB_EXPORT const TagLib::String operator+(const char *s1, const TagLib::String &s2); + +/*! + * \relates TagLib::String + * + * Concatenates \a s1 and \a s2 and returns the result as a string. + */ +TAGLIB_EXPORT const TagLib::String operator+(const TagLib::String &s1, const char *s2); + + +/*! + * \relates TagLib::String + * + * Send the string to an output stream. + */ +TAGLIB_EXPORT std::ostream &operator<<(std::ostream &s, const TagLib::String &str); + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/tstringlist.h b/Audio-Frameworks/bin/taglib/headers/toolkit/tstringlist.h new file mode 100644 index 0000000..f94b50f --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/tstringlist.h @@ -0,0 +1,115 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_STRINGLIST_H +#define TAGLIB_STRINGLIST_H + +#include "tstring.h" +#include "tlist.h" +#include "tbytevectorlist.h" +#include "taglib_export.h" + +#include + +namespace TagLib { + + //! A list of strings + + /*! + * This is a spcialization of the List class with some members convention for + * string operations. + */ + + class TAGLIB_EXPORT StringList : public List + { + public: + + /*! + * Constructs an empty StringList. + */ + StringList(); + + /*! + * Make a shallow, implicitly shared, copy of \a l. Because this is + * implicitly shared, this method is lightweight and suitable for + * pass-by-value usage. + */ + StringList(const StringList &l); + + /*! + * Constructs a StringList with \a s as a member. + */ + StringList(const String &s); + + /*! + * Makes a deep copy of the data in \a vl. + * + * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when + * used with other codecs it will simply print a warning and exit. + */ + StringList(const ByteVectorList &vl, String::Type t = String::Latin1); + + /*! + * Destroys this StringList instance. + */ + virtual ~StringList(); + + /*! + * Concatenate the list of strings into one string separated by \a separator. + */ + String toString(const String &separator = " ") const; + + /*! + * Appends \a s to the end of the list and returns a reference to the + * list. + */ + StringList &append(const String &s); + + /*! + * Appends all of the values in \a l to the end of the list and returns a + * reference to the list. + */ + StringList &append(const StringList &l); + + /*! + * Splits the String \a s into several strings at \a pattern. This will not include + * the pattern in the returned strings. + */ + static StringList split(const String &s, const String &pattern); + + private: + class StringListPrivate; + StringListPrivate *d; + }; + +} + +/*! + * \related TagLib::StringList + * Send the StringList to an output stream. + */ +std::ostream &operator<<(std::ostream &s, const TagLib::StringList &l); + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/toolkit/unicode.h b/Audio-Frameworks/bin/taglib/headers/toolkit/unicode.h new file mode 100644 index 0000000..cf7eb3c --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/toolkit/unicode.h @@ -0,0 +1,149 @@ +#ifndef TAGLIB_UNICODE_H +#define TAGLIB_UNICODE_H + +/******************************************************************************* + * * + * THIS FILE IS INCLUDED IN TAGLIB, BUT IS NOT COPYRIGHTED BY THE TAGLIB * + * AUTHORS, NOT PART OF THE TAGLIB API AND COULD GO AWAY AT ANY POINT IN TIME. * + * AS SUCH IT SHOULD BE CONSIERED FOR INTERNAL USE ONLY. * + * * + *******************************************************************************/ + +#ifndef DO_NOT_DOCUMENT // tell Doxygen not to document this header + +/* + * Copyright 2001 Unicode, Inc. + * + * Disclaimer + * + * This source code is provided as is by Unicode, Inc. No claims are + * made as to fitness for any particular purpose. No warranties of any + * kind are expressed or implied. The recipient agrees to determine + * applicability of information provided. If this file has been + * purchased on magnetic or optical media from Unicode, Inc., the + * sole remedy for any claim will be exchange of defective media + * within 90 days of receipt. + * + * Limitations on Rights to Redistribute This Code + * + * Unicode, Inc. hereby grants the right to freely use the information + * supplied in this file in the creation of products supporting the + * Unicode Standard, and to make copies of this file in any form + * for internal or external distribution as long as this notice + * remains attached. + */ + +/* + * This file has been modified by Scott Wheeler to remove + * the UTF32 conversion functions and to place the appropriate functions + * in their own C++ namespace. + */ + +/* --------------------------------------------------------------------- + + Conversions between UTF32, UTF-16, and UTF-8. Header file. + + Several functions are included here, forming a complete set of + conversions between the three formats. UTF-7 is not included + here, but is handled in a separate source file. + + Each of these routines takes pointers to input buffers and output + buffers. The input buffers are const. + + Each routine converts the text between *sourceStart and sourceEnd, + putting the result into the buffer between *targetStart and + targetEnd. Note: the end pointers are *after* the last item: e.g. + *(sourceEnd - 1) is the last item. + + The return result indicates whether the conversion was successful, + and if not, whether the problem was in the source or target buffers. + (Only the first encountered problem is indicated.) + + After the conversion, *sourceStart and *targetStart are both + updated to point to the end of last text successfully converted in + the respective buffers. + + Input parameters: + sourceStart - pointer to a pointer to the source buffer. + The contents of this are modified on return so that + it points at the next thing to be converted. + targetStart - similarly, pointer to pointer to the target buffer. + sourceEnd, targetEnd - respectively pointers to the ends of the + two buffers, for overflow checking only. + + These conversion functions take a ConversionFlags argument. When this + flag is set to strict, both irregular sequences and isolated surrogates + will cause an error. When the flag is set to lenient, both irregular + sequences and isolated surrogates are converted. + + Whether the flag is strict or lenient, all illegal sequences will cause + an error return. This includes sequences such as: , , + or in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code + must check for illegal sequences. + + When the flag is set to lenient, characters over 0x10FFFF are converted + to the replacement character; otherwise (when the flag is set to strict) + they constitute an error. + + Output parameters: + The value "sourceIllegal" is returned from some routines if the input + sequence is malformed. When "sourceIllegal" is returned, the source + value will point to the illegal value that caused the problem. E.g., + in UTF-8 when a sequence is malformed, it points to the start of the + malformed sequence. + + Author: Mark E. Davis, 1994. + Rev History: Rick McGowan, fixes & updates May 2001. + Fixes & updates, Sept 2001. + +------------------------------------------------------------------------ */ + +/* --------------------------------------------------------------------- + The following 4 definitions are compiler-specific. + The C standard does not guarantee that wchar_t has at least + 16 bits, so wchar_t is no less portable than unsigned short! + All should be unsigned values to avoid sign extension during + bit mask & shift operations. +------------------------------------------------------------------------ */ + +/* Some fundamental constants */ +#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD +#define UNI_MAX_BMP (UTF32)0x0000FFFF +#define UNI_MAX_UTF16 (UTF32)0x0010FFFF +#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF + +namespace Unicode { + +typedef unsigned long UTF32; /* at least 32 bits */ +typedef unsigned short UTF16; /* at least 16 bits */ +typedef unsigned char UTF8; /* typically 8 bits */ +typedef unsigned char Boolean; /* 0 or 1 */ + +typedef enum { + conversionOK = 0, /* conversion successful */ + sourceExhausted = 1, /* partial character in source, but hit end */ + targetExhausted = 2, /* insuff. room in target for conversion */ + sourceIllegal = 3 /* source sequence is illegal/malformed */ +} ConversionResult; + +typedef enum { + strictConversion = 0, + lenientConversion +} ConversionFlags; + +ConversionResult ConvertUTF8toUTF16 ( + const UTF8** sourceStart, const UTF8* sourceEnd, + UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); + +ConversionResult ConvertUTF16toUTF8 ( + const UTF16** sourceStart, const UTF16* sourceEnd, + UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); + +Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); + +} // namespace Unicode + +/* --------------------------------------------------------------------- */ + +#endif +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/trueaudio/trueaudiofile.h b/Audio-Frameworks/bin/taglib/headers/trueaudio/trueaudiofile.h new file mode 100644 index 0000000..9b0378f --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/trueaudio/trueaudiofile.h @@ -0,0 +1,212 @@ +/*************************************************************************** + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + (original MPC implementation) + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_TRUEAUDIOFILE_H +#define TAGLIB_TRUEAUDIOFILE_H + +#include "tfile.h" +#include "trueaudioproperties.h" + +namespace TagLib { + + class Tag; + + namespace ID3v2 { class Tag; class FrameFactory; } + namespace ID3v1 { class Tag; } + + //! An implementation of TrueAudio metadata + + /*! + * This is implementation of TrueAudio metadata. + * + * This supports ID3v1 and ID3v2 tags as well as reading stream + * properties from the file. + */ + + namespace TrueAudio { + + //! An implementation of TagLib::File with TrueAudio specific methods + + /*! + * This implements and provides an interface for TrueAudio files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to TrueAudio files. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * This set of flags is used for various operations and is suitable for + * being OR-ed together. + */ + enum TagTypes { + //! Empty set. Matches no tag types. + NoTags = 0x0000, + //! Matches ID3v1 tags. + ID3v1 = 0x0001, + //! Matches ID3v2 tags. + ID3v2 = 0x0002, + //! Matches all tag types. + AllTags = 0xffff + }; + + /*! + * Contructs an TrueAudio file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an TrueAudio file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. The frames will be created using + * \a frameFactory. + */ + File(FileName file, ID3v2::FrameFactory *frameFactory, + bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an TrueAudio file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an TrueAudio file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. The frames will be created using + * \a frameFactory. + */ + File(IOStream *stream, ID3v2::FrameFactory *frameFactory, + bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. + */ + virtual TagLib::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * If the file contains both ID3v1 and v2 tags, only ID3v2 will be + * converted to the PropertyMap. + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * As with the export, only one tag is taken into account. If the file + * has no tag at all, ID3v2 will be created. + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the TrueAudio::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Set the ID3v2::FrameFactory to something other than the default. + * + * \see ID3v2FrameFactory + */ + void setID3v2FrameFactory(const ID3v2::FrameFactory *factory); + + /*! + * Saves the file. + */ + virtual bool save(); + + /*! + * Returns a pointer to the ID3v2 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v2 tag. If \a create is true it will create + * an ID3v1 tag if one does not exist. If there is already an APE tag, the + * new ID3v1 tag will be placed after it. + * + * \note The Tag is still owned by the TrueAudio::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v1::Tag *ID3v1Tag(bool create = false); + + /*! + * Returns a pointer to the ID3v1 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v1 tag. If \a create is true it will create + * an ID3v1 tag if one does not exist. If there is already an APE tag, the + * new ID3v1 tag will be placed after it. + * + * \note The Tag is still owned by the TrueAudio::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v2::Tag *ID3v2Tag(bool create = false); + + /*! + * This will remove the tags that match the OR-ed together TagTypes from the + * file. By default it removes all tags. + * + * \note This will also invalidate pointers to the tags + * as their memory will be freed. + * \note In order to make the removal permanent save() still needs to be called + */ + void strip(int tags = AllTags); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void scan(); + long findID3v1(); + long findID3v2(); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/trueaudio/trueaudioproperties.h b/Audio-Frameworks/bin/taglib/headers/trueaudio/trueaudioproperties.h new file mode 100644 index 0000000..126b678 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/trueaudio/trueaudioproperties.h @@ -0,0 +1,98 @@ +/*************************************************************************** + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + (original MPC implementation) + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_TRUEAUDIOPROPERTIES_H +#define TAGLIB_TRUEAUDIOPROPERTIES_H + +#include "audioproperties.h" + +namespace TagLib { + + namespace TrueAudio { + + class File; + + static const uint HeaderSize = 18; + + //! An implementation of audio property reading for TrueAudio + + /*! + * This reads the data from an TrueAudio stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of TrueAudio::Properties with the data read from the + * ByteVector \a data. + */ + Properties(const ByteVector &data, long streamLength, ReadStyle style = Average); + + /*! + * Destroys this TrueAudio::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns number of bits per sample. + */ + int bitsPerSample() const; + + /*! + * Returns the total number of sample frames + */ + uint sampleFrames() const; + + /*! + * Returns the major version number. + */ + int ttaVersion() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/wavpack/wavpackfile.h b/Audio-Frameworks/bin/taglib/headers/wavpack/wavpackfile.h new file mode 100644 index 0000000..02bac02 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/wavpack/wavpackfile.h @@ -0,0 +1,186 @@ +/*************************************************************************** + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + (original MPC implementation) + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_WVFILE_H +#define TAGLIB_WVFILE_H + +#include "tfile.h" +#include "taglib_export.h" +#include "wavpackproperties.h" + +namespace TagLib { + + class Tag; + + namespace ID3v1 { class Tag; } + namespace APE { class Tag; } + + //! An implementation of WavPack metadata + + /*! + * This is implementation of WavPack metadata. + * + * This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream + * properties from the file. + */ + + namespace WavPack { + + //! An implementation of TagLib::File with WavPack specific methods + + /*! + * This implements and provides an interface for WavPack files to the + * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing + * the abstract TagLib::File API as well as providing some additional + * information specific to WavPack files. + */ + + class TAGLIB_EXPORT File : public TagLib::File + { + public: + /*! + * This set of flags is used for various operations and is suitable for + * being OR-ed together. + */ + enum TagTypes { + //! Empty set. Matches no tag types. + NoTags = 0x0000, + //! Matches ID3v1 tags. + ID3v1 = 0x0001, + //! Matches APE tags. + APE = 0x0002, + //! Matches all tag types. + AllTags = 0xffff + }; + + /*! + * Contructs an WavPack file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Contructs an WavPack file from \a file. If \a readProperties is true the + * file's audio properties will also be read using \a propertiesStyle. If + * false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + Properties::ReadStyle propertiesStyle = Properties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + /*! + * Returns the Tag for this file. This will be an APE tag, an ID3v1 tag + * or a combination of the two. + */ + virtual TagLib::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * If the file contains both an APE and an ID3v1 tag, only APE + * will be converted to the PropertyMap. + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * As for the export, only one tag is taken into account. If the file + * has no tag at all, APE will be created. + */ + PropertyMap setProperties(const PropertyMap&); + + /*! + * Returns the MPC::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + virtual Properties *audioProperties() const; + + /*! + * Saves the file. + */ + virtual bool save(); + + /*! + * Returns a pointer to the ID3v1 tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid ID3v1 tag. If \a create is true it will create + * an ID3v1 tag if one does not exist. If there is already an APE tag, the + * new ID3v1 tag will be placed after it. + * + * \note The Tag is still owned by the APE::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + ID3v1::Tag *ID3v1Tag(bool create = false); + + /*! + * Returns a pointer to the APE tag of the file. + * + * If \a create is false (the default) this will return a null pointer + * if there is no valid APE tag. If \a create is true it will create + * a APE tag if one does not exist. + * + * \note The Tag is still owned by the APE::File and should not be + * deleted by the user. It will be deleted when the file (object) is + * destroyed. + */ + APE::Tag *APETag(bool create = false); + + /*! + * This will remove the tags that match the OR-ed together TagTypes from the + * file. By default it removes all tags. + * + * \note This will also invalidate pointers to the tags + * as their memory will be freed. + * \note In order to make the removal permanent save() still needs to be called + */ + void strip(int tags = AllTags); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void scan(); + long findID3v1(); + long findAPE(); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/wavpack/wavpackproperties.h b/Audio-Frameworks/bin/taglib/headers/wavpack/wavpackproperties.h new file mode 100644 index 0000000..bd2209d --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/wavpack/wavpackproperties.h @@ -0,0 +1,105 @@ +/*************************************************************************** + copyright : (C) 2006 by Lukáš Lalinský + email : lalinsky@gmail.com + + copyright : (C) 2004 by Allan Sandfeld Jensen + email : kde@carewolf.org + (original MPC implementation) + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/ + +#ifndef TAGLIB_WVPROPERTIES_H +#define TAGLIB_WVPROPERTIES_H + +#include "taglib_export.h" +#include "audioproperties.h" + +namespace TagLib { + + namespace WavPack { + + class File; + + static const uint HeaderSize = 32; + + //! An implementation of audio property reading for WavPack + + /*! + * This reads the data from an WavPack stream found in the AudioProperties + * API. + */ + + class TAGLIB_EXPORT Properties : public AudioProperties + { + public: + /*! + * Create an instance of WavPack::Properties with the data read from the + * ByteVector \a data. + * + * \deprecated This constructor will be dropped in favor of the one below + * in a future version. + */ + Properties(const ByteVector &data, long streamLength, ReadStyle style = Average); + + /*! + * Create an instance of WavPack::Properties. + */ + // BIC: merge with the above constructor + Properties(File *file, long streamLength, ReadStyle style = Average); + + /*! + * Destroys this WavPack::Properties instance. + */ + virtual ~Properties(); + + // Reimplementations. + + virtual int length() const; + virtual int bitrate() const; + virtual int sampleRate() const; + virtual int channels() const; + + /*! + * Returns number of bits per sample. + */ + int bitsPerSample() const; + uint sampleFrames() const; + + /*! + * Returns WavPack version. + */ + int version() const; + + private: + Properties(const Properties &); + Properties &operator=(const Properties &); + + void read(); + unsigned int seekFinalIndex(); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/xm/xmfile.h b/Audio-Frameworks/bin/taglib/headers/xm/xmfile.h new file mode 100644 index 0000000..1b07010 --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/xm/xmfile.h @@ -0,0 +1,101 @@ +/*************************************************************************** + copyright : (C) 2011 by Mathias Panzenböck + email : grosser.meister.morti@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef TAGLIB_XMFILE_H +#define TAGLIB_XMFILE_H + +#include "tfile.h" +#include "audioproperties.h" +#include "taglib_export.h" +#include "modfilebase.h" +#include "modtag.h" +#include "xmproperties.h" + +namespace TagLib { + + namespace XM { + + class TAGLIB_EXPORT File : public Mod::FileBase { + public: + /*! + * Contructs a Extended Module file from \a file. If \a readProperties + * is true the file's audio properties will also be read using + * \a propertiesStyle. If false, \a propertiesStyle is ignored. + */ + File(FileName file, bool readProperties = true, + AudioProperties::ReadStyle propertiesStyle = + AudioProperties::Average); + + /*! + * Contructs a Extended Module file from \a stream. If \a readProperties + * is true the file's audio properties will also be read using + * \a propertiesStyle. If false, \a propertiesStyle is ignored. + */ + File(IOStream *stream, bool readProperties = true, + AudioProperties::ReadStyle propertiesStyle = + AudioProperties::Average); + + /*! + * Destroys this instance of the File. + */ + virtual ~File(); + + Mod::Tag *tag() const; + + /*! + * Implements the unified property interface -- export function. + * Forwards to Mod::Tag::properties(). + */ + PropertyMap properties() const; + + /*! + * Implements the unified property interface -- import function. + * Forwards to Mod::Tag::setProperties(). + */ + PropertyMap setProperties(const PropertyMap &); + + /*! + * Returns the XM::Properties for this file. If no audio properties + * were read then this will return a null pointer. + */ + XM::Properties *audioProperties() const; + + /*! + * Save the file. + * This is the same as calling save(AllTags); + * + * \note Saving Extended Module tags is not supported. + */ + bool save(); + + private: + File(const File &); + File &operator=(const File &); + + void read(bool readProperties); + + class FilePrivate; + FilePrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/headers/xm/xmproperties.h b/Audio-Frameworks/bin/taglib/headers/xm/xmproperties.h new file mode 100644 index 0000000..9b6624a --- /dev/null +++ b/Audio-Frameworks/bin/taglib/headers/xm/xmproperties.h @@ -0,0 +1,79 @@ +/*************************************************************************** + copyright : (C) 2011 by Mathias Panzenböck + email : grosser.meister.morti@gmx.net + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef TAGLIB_XMPROPERTIES_H +#define TAGLIB_XMPROPERTIES_H + +#include "taglib.h" +#include "tstring.h" +#include "audioproperties.h" + +namespace TagLib { + namespace XM { + class Properties : public AudioProperties { + friend class File; + public: + /*! Flag bits. */ + enum { + LinearFreqTable = 1 // otherwise its the amiga freq. table + }; + + Properties(AudioProperties::ReadStyle propertiesStyle); + virtual ~Properties(); + + int length() const; + int bitrate() const; + int sampleRate() const; + int channels() const; + + ushort lengthInPatterns() const; + ushort version() const; + ushort restartPosition() const; + ushort patternCount() const; + ushort instrumentCount() const; + uint sampleCount() const; + ushort flags() const; + ushort tempo() const; + ushort bpmSpeed() const; + + void setChannels(int channels); + + void setLengthInPatterns(ushort lengthInPatterns); + void setVersion(ushort version); + void setRestartPosition(ushort restartPosition); + void setPatternCount(ushort patternCount); + void setInstrumentCount(ushort instrumentCount); + void setSampleCount(uint sampleCount); + void setFlags(ushort flags); + void setTempo(ushort tempo); + void setBpmSpeed(ushort bpmSpeed); + + private: + Properties(const Properties&); + Properties &operator=(const Properties&); + + class PropertiesPrivate; + PropertiesPrivate *d; + }; + } +} + +#endif diff --git a/Audio-Frameworks/bin/taglib/libTagLib.a b/Audio-Frameworks/bin/taglib/libTagLib.a new file mode 100644 index 0000000..2789869 Binary files /dev/null and b/Audio-Frameworks/bin/taglib/libTagLib.a differ diff --git a/Audio-Frameworks/flac-src/put_sources_here b/Audio-Frameworks/flac-src/put_sources_here new file mode 100644 index 0000000..e69de29 diff --git a/Audio-Frameworks/libogg-src/put_sources_here b/Audio-Frameworks/libogg-src/put_sources_here new file mode 100644 index 0000000..e69de29 diff --git a/Audio-Frameworks/libopus-src/put_sources_here b/Audio-Frameworks/libopus-src/put_sources_here new file mode 100644 index 0000000..e69de29 diff --git a/Audio-Frameworks/libopusfile-src/put_sources_here b/Audio-Frameworks/libopusfile-src/put_sources_here new file mode 100644 index 0000000..e69de29 diff --git a/OrigamiEngine.podspec b/OrigamiEngine.podspec index 3e8f31e..9448dd4 100644 --- a/OrigamiEngine.podspec +++ b/OrigamiEngine.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/ap4y/OrigamiEngine.git" s.license = 'MIT' s.author = { "ap4y" => "lod@pisem.net" } - s.source = { :git => "https://github.com/ap4y/OrigamiEngine.git", :tag => "1.0.14", :submodules => true } + s.source = { :git => "https://github.com/darkcl/OrigamiEngine.git", :tag => "1.0.14", :submodules => true } s.default_subspec = 'Core' s.requires_arc = false s.ios.deployment_target = '5.0' diff --git a/OrigamiEngine/Plugins/CueSheet.m b/OrigamiEngine/Plugins/CueSheet.m index f829a5d..06a1fbc 100644 --- a/OrigamiEngine/Plugins/CueSheet.m +++ b/OrigamiEngine/Plugins/CueSheet.m @@ -51,9 +51,19 @@ - (void)dealloc { - (void)parseFileWithUrl:(NSURL *)url { NSStringEncoding encoding; NSError *error = nil; + + NSStringEncoding gbkEncoding = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000); + NSString *contents = [NSString stringWithContentsOfURL:url usedEncoding:&encoding error:&error]; + if (error) { + error = nil; + contents = [NSString stringWithContentsOfURL:url + encoding:gbkEncoding + error:&error]; + } + if (error) { error = nil; contents = [NSString stringWithContentsOfURL:url