taglib-extras-1.0.1/0000755000211100001440000000000011255770674013757 5ustar jefferaiuserstaglib-extras-1.0.1/cmake/0000755000211100001440000000000011255770671015034 5ustar jefferaiuserstaglib-extras-1.0.1/cmake/CMakeLists.txt0000644000211100001440000000003511156021600017547 0ustar jefferaiusersadd_subdirectory( modules ) taglib-extras-1.0.1/cmake/modules/0000755000211100001440000000000011255770671016504 5ustar jefferaiuserstaglib-extras-1.0.1/cmake/modules/FindTaglib.cmake0000644000211100001440000000774011156551310021504 0ustar jefferaiusers# - Try to find the Taglib library # Once done this will define # # TAGLIB_FOUND - system has the taglib library # TAGLIB_CFLAGS - the taglib cflags # TAGLIB_LIBRARIES - The libraries needed to use taglib # Copyright (c) 2006, Laurent Montel, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. if(NOT TAGLIB_MIN_VERSION) set(TAGLIB_MIN_VERSION "1.4") endif(NOT TAGLIB_MIN_VERSION) if(NOT WIN32) find_program(TAGLIBCONFIG_EXECUTABLE NAMES taglib-config PATHS ${BIN_INSTALL_DIR} ) endif(NOT WIN32) #reset vars set(TAGLIB_LIBRARIES) set(TAGLIB_CFLAGS) # if taglib-config has been found if(TAGLIBCONFIG_EXECUTABLE) exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_VERSION) if(TAGLIB_VERSION STRLESS "${TAGLIB_MIN_VERSION}") message(STATUS "TagLib version not found: version searched :${TAGLIB_MIN_VERSION}, found ${TAGLIB_VERSION}") set(TAGLIB_FOUND FALSE) else(TAGLIB_VERSION STRLESS "${TAGLIB_MIN_VERSION}") exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_LIBRARIES) exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_CFLAGS) if(TAGLIB_LIBRARIES AND TAGLIB_CFLAGS) set(TAGLIB_FOUND TRUE) endif(TAGLIB_LIBRARIES AND TAGLIB_CFLAGS) string(REGEX REPLACE " *-I" ";" TAGLIB_INCLUDES "${TAGLIB_CFLAGS}") endif(TAGLIB_VERSION STRLESS "${TAGLIB_MIN_VERSION}") mark_as_advanced(TAGLIB_CFLAGS TAGLIB_LIBRARIES TAGLIB_INCLUDES) else(TAGLIBCONFIG_EXECUTABLE) find_path(TAGLIB_INCLUDES NAMES tag.h PATH_SUFFIXES taglib PATHS ${KDE4_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ) IF(NOT WIN32) # on non-win32 we don't need to take care about WIN32_DEBUG_POSTFIX FIND_LIBRARY(TAGLIB_LIBRARIES tag PATHS ${KDE4_LIB_DIR} ${LIB_INSTALL_DIR}) ELSE(NOT WIN32) # 1. get all possible libnames SET(args PATHS ${KDE4_LIB_DIR} ${LIB_INSTALL_DIR}) SET(newargs "") SET(libnames_release "") SET(libnames_debug "") LIST(LENGTH args listCount) # just one name LIST(APPEND libnames_release "tag") LIST(APPEND libnames_debug "tagd") SET(newargs ${args}) # search the release lib FIND_LIBRARY(TAGLIB_LIBRARIES_RELEASE NAMES ${libnames_release} ${newargs} ) # search the debug lib FIND_LIBRARY(TAGLIB_LIBRARIES_DEBUG NAMES ${libnames_debug} ${newargs} ) IF(TAGLIB_LIBRARIES_RELEASE AND TAGLIB_LIBRARIES_DEBUG) # both libs found SET(TAGLIB_LIBRARIES optimized ${TAGLIB_LIBRARIES_RELEASE} debug ${TAGLIB_LIBRARIES_DEBUG}) ELSE(TAGLIB_LIBRARIES_RELEASE AND TAGLIB_LIBRARIES_DEBUG) IF(TAGLIB_LIBRARIES_RELEASE) # only release found SET(TAGLIB_LIBRARIES ${TAGLIB_LIBRARIES_RELEASE}) ELSE(TAGLIB_LIBRARIES_RELEASE) # only debug (or nothing) found SET(TAGLIB_LIBRARIES ${TAGLIB_LIBRARIES_DEBUG}) ENDIF(TAGLIB_LIBRARIES_RELEASE) ENDIF(TAGLIB_LIBRARIES_RELEASE AND TAGLIB_LIBRARIES_DEBUG) MARK_AS_ADVANCED(TAGLIB_LIBRARIES_RELEASE) MARK_AS_ADVANCED(TAGLIB_LIBRARIES_DEBUG) ENDIF(NOT WIN32) INCLUDE(FindPackageMessage) INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Taglib DEFAULT_MSG TAGLIB_INCLUDES TAGLIB_LIBRARIES) endif(TAGLIBCONFIG_EXECUTABLE) if(TAGLIB_FOUND) if(NOT Taglib_FIND_QUIETLY AND TAGLIBCONFIG_EXECUTABLE) message(STATUS "Taglib found: ${TAGLIB_LIBRARIES}") endif(NOT Taglib_FIND_QUIETLY AND TAGLIBCONFIG_EXECUTABLE) else(TAGLIB_FOUND) if(Taglib_FIND_REQUIRED) message(FATAL_ERROR "Could not find Taglib") endif(Taglib_FIND_REQUIRED) endif(TAGLIB_FOUND) taglib-extras-1.0.1/cmake/modules/COPYING-CMAKE-SCRIPTS0000644000211100001440000000246011163732263021475 0ustar jefferaiusersRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. taglib-extras-1.0.1/taglib-extras.pc.cmake0000644000211100001440000000067111155563222020120 0ustar jefferaiusersprefix=${CMAKE_INSTALL_PREFIX} exec_prefix=${CMAKE_INSTALL_PREFIX} libdir=${LIB_INSTALL_DIR} includedir=${INCLUDE_INSTALL_DIR} Name: TagLib Extras Description: Unofficial TagLib file type plugins maintained by the Amarok project Requires: Version: ${TAGLIB-EXTRAS_LIB_MAJOR_VERSION}.${TAGLIB-EXTRAS_LIB_MINOR_VERSION}.${TAGLIB-EXTRAS_LIB_PATCH_VERSION} Libs: -L${LIB_INSTALL_DIR} -ltag-extras Cflags: -I${INCLUDE_INSTALL_DIR}/taglib-extras taglib-extras-1.0.1/CMakeLists.txt0000644000211100001440000001011611254507246016506 0ustar jefferaiusersproject(taglib-extras) cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) #add some KDE specific stuff set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) set(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Base directory for executables and libraries" FORCE) # ## the following are directories where stuff will be installed to set(BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" CACHE PATH "The subdirectory to the binaries prefix (default prefix/bin)" FORCE) set(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE) set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The subdirectory to the header prefix" FORCE) if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_SYSTEM_NAME MATCHES Linux) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-check-new -fno-common") endif (CMAKE_SYSTEM_NAME MATCHES Linux) endif (CMAKE_COMPILER_IS_GNUCXX) if(MSVC) if (MSVC_VERSION GREATER 1399) # If using Visual C++ 2005 (MSVC80) and greater (MSVC_VERSION=1400) add_definitions(/D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /Zc:wchar_t-) endif (MSVC_VERSION GREATER 1399) endif(MSVC) if (WIN32) set(CMAKE_DEBUG_POSTFIX "d") endif (WIN32) set(TAGLIB-EXTRAS_LIB_MAJOR_VERSION "1") set(TAGLIB-EXTRAS_LIB_MINOR_VERSION "0") set(TAGLIB-EXTRAS_LIB_PATCH_VERSION "0") set(TAGLIB-EXTRAS_LIB_VERSION_STRING "${TAGLIB-EXTRAS_LIB_MAJOR_VERSION}.${TAGLIB-EXTRAS_LIB_MINOR_VERSION}.${TAGLIB-EXTRAS_LIB_PATCH_VERSION}") set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ) # built as part of kdesupport ? if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") set(TAGLIB_INCLUDES ${CMAKE_SOURCE_DIR}/taglib/include ${CMAKE_BINARY_DIR}/taglib ) set(TAGLIB_CFLAGS ) set(TAGLIB_LIBRARIES tag) else(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") # or separately ? set(TAGLIB_MIN_VERSION "1.6") find_package(Taglib REQUIRED) endif(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") include_directories(${TAGLIB_INCLUDES}) #option(WITH_KDE "Enable KDE4 integration" OFF) # Setup KDE4 support #if(WITH_KDE) # find_package(KDE4) # if(KDE4_FOUND) # message(STATUS "Enabling KDE4 integration") # include_directories(${KDE4_INCLUDES}) # add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS}) # set(HAVE_KDE 1) # set(KDE_LIBRARIES ${KDE4_KDECORE_LIBS}) # else(KDE4_FOUND) # message(STATUS "KDE4 not found, disabling KDE integration") # endif(KDE4_FOUND) #else(WITH_KDE) # message(STATUS "Disabling KDE4 integration") #endif(WITH_KDE) if(NOT WIN32) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib-extras-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib-extras-config ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib-extras.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib-extras.pc ) endif(NOT WIN32) include(CheckTypeSize) check_type_size("int" SIZEOF_INT) check_type_size("long" SIZEOF_LONG) include(CheckIncludeFile) check_include_file("stdint.h" HAVE_STDINT_H) check_include_file("strings.h" HAVE_STRINGS_H) check_include_file("unistd.h" HAVE_UNISTD_H) configure_file(config-taglib-extras.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib-extras/config-taglib-extras.h ) add_subdirectory( taglib-extras ) if(NOT WIN32) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/taglib-extras.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) install( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/taglib-extras-config DESTINATION ${BIN_INSTALL_DIR}) endif(NOT WIN32) taglib-extras-1.0.1/taglib-extras/0000755000211100001440000000000011255770674016525 5ustar jefferaiuserstaglib-extras-1.0.1/taglib-extras/rmff/0000755000211100001440000000000011255770673017456 5ustar jefferaiuserstaglib-extras-1.0.1/taglib-extras/rmff/rmff.cpp0000644000211100001440000007745311254453737021132 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Paul Cifarelli email : paulc2@optonline.net ***************************************************************************/ /*************************************************************************** * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ /*************************************************************************** * 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 or higher 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 St, 5th fl, Boston, MA 02110-1301, * * USA, or check http://www.fsf.org/about/contact.html * ***************************************************************************/ #include "rmff.h" #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #if !defined(_WIN32) && !defined(_WIN64) #include #else #include #include #endif #include #include #include #include #include #include #include #define UNPACK4(a, buf, i) memcpy((void *)&a, (void *) &buf[i], 4),i+=4,a=ntohl(a) #define UNPACK2(a, buf, i) memcpy((void *)&a, (void *) &buf[i], 2),i+=2,a=ntohs(a) using namespace TagLibExtras; RealMedia::RMFFile::RMFFile(TagLib::FileName filename) : File(filename), m_id3tag(0) { if (isOpen()) m_id3tag = new TagLib::ID3v1::Tag(this, length() - 128); } RealMedia::RMFFile::~RMFFile() { delete m_id3tag; } bool RealMedia::RMFFile::save() { TagLib::ByteVector bv = m_id3tag->render(); //TODO finish this return false; } TagLib::String RealMedia::RealMediaFF::title () const { return !m_err && m_id3v1tag ? m_id3v1tag->tag()->title() : ""; } TagLib::String RealMedia::RealMediaFF::artist () const { return !m_err && m_id3v1tag ? m_id3v1tag->tag()->artist() : ""; } TagLib::String RealMedia::RealMediaFF::album () const { return !m_err && m_id3v1tag ? m_id3v1tag->tag()->album() : ""; } TagLib::String RealMedia::RealMediaFF::comment() const { return !m_err && m_id3v1tag ? m_id3v1tag->tag()->comment() : ""; } TagLib::String RealMedia::RealMediaFF::genre() const { return !m_err && m_id3v1tag ? m_id3v1tag->tag()->genre() : ""; } TagLib::uint RealMedia::RealMediaFF::year() const { return !m_err && m_id3v1tag ? m_id3v1tag->tag()->year() : 0; } TagLib::uint RealMedia::RealMediaFF::track() const { return !m_err && m_id3v1tag ? m_id3v1tag->tag()->track() : 0; } // properties int RealMedia::RealMediaFF::length () const { return m_readProperties && !m_err && m_props ? m_props->duration : 0; } int RealMedia::RealMediaFF::bitrate () const { return m_readProperties && !m_err && m_props ? m_props->avg_bit_rate : 0; } int RealMedia::RealMediaFF::sampleRate () const { return 0; } int RealMedia::RealMediaFF::channels () const { return 0; } RealMedia::RealMediaFF::RealMediaFF(TagLib::FileName file, bool readProperties, TagLib::AudioProperties::ReadStyle /*propertiesStyle*/) : m_filename(0) , m_head(0) , m_tail(0) , m_err(0) , m_hdr(0) , m_props(0) , media_hdrs(0) , m_contenthdr(0) , m_md(0) , m_title(0) , m_author(0) , m_copyright(0) , m_comment(0) , m_id3v1tag(0) , m_flipYearInMetadataSection(0) , m_readProperties(readProperties) { m_filename = strdup(file); m_fd = open(m_filename, O_RDONLY); if (m_fd < 0) { m_err = -1; return; } // ok, for RM files, the properties are embedded, so we ignore propertiesStyle if (m_readProperties) { init(); // and now for the really complicated stuff... if (initMetadataSection()) std::cerr << "ERROR reading Metadata\n"; } // now get the ID3v1 tag at the end of this file m_id3v1tag = new RMFFile(m_filename); } RealMedia::RealMediaFF::RealMediaFF(RealMediaFF &src) : m_filename(0) , m_head(0) , m_tail(0) , m_err(0) , m_hdr(0) , m_props(0) , media_hdrs(0) , m_contenthdr(0) , m_md(0) , m_title(0) , m_author(0) , m_copyright(0) , m_comment(0) , m_id3v1tag(0) , m_flipYearInMetadataSection(0) , m_readProperties(src.m_readProperties) { m_filename=strdup(src.m_filename); m_fd = open(m_filename, O_RDONLY); if (m_fd < 0) { m_err = -1; return; } // ok, for RM files, the properties are embedded, so we ignore propertiesStyle if (m_readProperties) { init(); // and now for the really complicated stuff... if (initMetadataSection()) std::cerr << "ERROR reading Metadata\n"; } // now get the ID3v1 tag at the end of this file m_id3v1tag = new RMFFile(m_filename); } RealMedia::RealMediaFF::~RealMediaFF() { free(m_filename); Collectable *hdr = m_head, *next; while (hdr) { next = hdr->fwd; delete hdr; hdr = next; } delete m_id3v1tag; delete m_md; close(m_fd); } bool RealMedia::RealMediaFF::isEmpty() const { return m_id3v1tag->tag()->isEmpty(); } void RealMedia::RealMediaFF::saveHeader(Collectable *hdr) { hdr->fwd = 0; if (!m_head) m_head = m_tail = hdr; else { m_tail->fwd = hdr; m_tail = hdr; } } int RealMedia::RealMediaFF::init() { int nbytes; unsigned char buf[65536]; RealMedia::UINT32 object_id; RealMedia::UINT32 sz; RealMedia::UINT32 consumed = 0; off_t s; if ( (s = lseek(m_fd, 0, SEEK_SET)) ) { m_err = -1; return m_err; } m_hdr = new File_Header_v0_v1; nbytes = getChunk(buf, 65536, m_hdr->s.object_id, m_hdr->s.size, consumed); if (nbytes < 0 || m_hdr->s.size != consumed || memcmp((void *)&m_hdr->s.object_id, ".RMF", 4)) { //std::cerr << "SERIOUS ERROR - not likely a RealMedia file\n"; m_err = -1; return m_err; } if (!getRealFileHeader(m_hdr, buf, m_hdr->s.object_id, m_hdr->s.size)) { saveHeader(m_hdr); consumed = 0; nbytes = getChunk(buf, 65536, object_id, sz, consumed); if (nbytes < 0 || sz != consumed) { m_err = -1; return m_err; } while (!m_err && memcmp((void *)&object_id, "DATA", 4)) { char oid[5]; memcpy((void *)oid, (void *)&object_id, 4); oid[4] = 0; if (!memcmp((void *)&object_id, "PROP", 4)) { m_props = new RMProperties; getRealPropertyHeader(m_props, buf, object_id, sz); saveHeader(m_props); } if (!memcmp((void *)&object_id, "MDPR", 4)) { media_hdrs = new MediaProperties; getMediaPropHeader(media_hdrs, buf, object_id, sz); saveHeader(media_hdrs); } if (!memcmp((void *)&object_id, "CONT", 4)) { m_contenthdr = new ContentDescription; getContentDescription(m_contenthdr, buf, object_id, sz); saveHeader(m_contenthdr); } consumed = 0; do { nbytes = getChunk(buf, 65536, object_id, sz, consumed); } while ( !m_err && memcmp((void *)&object_id, "DATA", 4) && (consumed < sz) ); } } return 0; } int RealMedia::RealMediaFF::getHdr(unsigned char *buf, size_t sz, RealMedia::UINT32 &fourcc, RealMedia::UINT32 &csz) { int nbytes = 0, i = 0; if (sz < (size_t)RMFF_HDR_SIZE) return 0; if ( (nbytes = read(m_fd, (void *) buf, RMFF_HDR_SIZE)) != RMFF_HDR_SIZE ) { m_err = -1; return (nbytes); } memcpy((void *)&fourcc, buf, 4); i+=4; UNPACK4(csz,buf,i); return nbytes; } int RealMedia::RealMediaFF::getChunk(unsigned char *buf, size_t sz, RealMedia::UINT32 &fourcc, RealMedia::UINT32 &csz, RealMedia::UINT32 &alreadyconsumed) { int nbytes = 0, i = 0, readamount; csz = 0; if (!alreadyconsumed) { if ( (nbytes = getHdr(buf, sz, fourcc, csz)) != RMFF_HDR_SIZE ) { m_err = -1; alreadyconsumed += nbytes > 0 ? nbytes : 0; return nbytes; } alreadyconsumed += RMFF_HDR_SIZE; readamount = csz - RMFF_HDR_SIZE; i = RMFF_HDR_SIZE; } else readamount = csz - alreadyconsumed; if ( (nbytes = read(m_fd, (void *) &buf[i], readamount > (int)sz - i ? (int)sz - i : readamount )) != readamount ) { if (nbytes < 0) { m_err = -1; } else alreadyconsumed += nbytes; return (nbytes<0 ? i : i + nbytes); } alreadyconsumed += nbytes; return (csz); } int RealMedia::RealMediaFF::getRealFileHeader(File_Header_v0_v1 *hdr, const unsigned char *buf, RealMedia::UINT32 object_id, int sz) { int i = 0; // RealMedia header hdr->s.object_id = object_id; hdr->s.size = sz; i = RMFF_HDR_SIZE; UNPACK2(hdr->object_version, buf, i); if ( !strncmp((const char *) &hdr->s.object_id, ".RMF", 4) && (hdr->object_version == 0 || hdr->object_version == 1) ) { UNPACK4(hdr->file_version, buf, i); UNPACK4(hdr->num_headers, buf, i); } return 0; } int RealMedia::RealMediaFF::getRealPropertyHeader(RMProperties *props, const unsigned char *buf, RealMedia::UINT32 object_id, int sz) { int i = 0; // Properties props->s.object_id = object_id; props->s.size = sz; i = RMFF_HDR_SIZE; UNPACK2(props->object_version, buf, i); if ( !strncmp((const char *)&props->s.object_id,"PROP",4) && (props->object_version == 0) ) { UNPACK4(props->max_bit_rate, buf, i); UNPACK4(props->avg_bit_rate, buf, i); UNPACK4(props->max_packet_size, buf, i); UNPACK4(props->avg_packet_size, buf, i); UNPACK4(props->num_packets, buf, i); UNPACK4(props->duration, buf, i); UNPACK4(props->preroll, buf, i); UNPACK4(props->index_offset, buf, i); UNPACK4(props->data_offset, buf, i); UNPACK2(props->num_streams, buf, i); UNPACK2(props->flags, buf, i); } return 0; } int RealMedia::RealMediaFF::getMediaPropHeader(MediaProperties *media_hdr, const unsigned char *buf, RealMedia::UINT32 object_id, int sz) { int i = 0; // Properties media_hdr->s.object_id = object_id; media_hdr->s.size = sz; i = RMFF_HDR_SIZE; UNPACK2(media_hdr->object_version, buf, i); if ( !strncmp((const char *)&media_hdr->s.object_id, "MDPR", 4) && media_hdr->object_version == 0) { UNPACK2(media_hdr->stream_number, buf, i); UNPACK4(media_hdr->max_bit_rate, buf, i); UNPACK4(media_hdr->avg_bit_rate, buf, i); UNPACK4(media_hdr->max_packet_size, buf, i); UNPACK4(media_hdr->avg_packet_size, buf, i); UNPACK4(media_hdr->start_time, buf, i); UNPACK4(media_hdr->preroll, buf, i); UNPACK4(media_hdr->duration, buf, i); media_hdr->stream_name_size = buf[i]; i++; memcpy(media_hdr->stream_name, &buf[i], media_hdr->stream_name_size); media_hdr->stream_name[media_hdr->stream_name_size] = 0; i += media_hdr->stream_name_size; media_hdr->mime_type_size = buf[i]; i++; memcpy(media_hdr->mime_type, &buf[i], media_hdr->mime_type_size); i += media_hdr->mime_type_size; UNPACK4(media_hdr->type_specific_len, buf, i); if (media_hdr->type_specific_len) { media_hdr->type_specific_data = new UINT8[media_hdr->type_specific_len]; memcpy(media_hdr->type_specific_data, &buf[i], media_hdr->type_specific_len); if (!strncmp((const char *)media_hdr->mime_type, "logical-fileinfo", 16)) { media_hdr->lstr = new LogicalStream; UNPACK4(media_hdr->lstr->size, buf, i); UNPACK2(media_hdr->lstr->object_version, buf, i); if (media_hdr->lstr->object_version == 0) { UNPACK2(media_hdr->lstr->num_physical_streams, buf, i); if (media_hdr->lstr->num_physical_streams > 0) { media_hdr->lstr->physical_stream_numbers = new UINT16[ media_hdr->lstr->num_physical_streams ]; media_hdr->lstr->data_offsets = new RealMedia::UINT32[ media_hdr->lstr->num_physical_streams ]; for (int j=0; jlstr->num_physical_streams; j++) { UNPACK2(media_hdr->lstr->physical_stream_numbers[j], buf, i); } for (int j=0; jlstr->num_physical_streams; j++) { UNPACK4(media_hdr->lstr->data_offsets[j], buf, i); } } UNPACK2(media_hdr->lstr->num_rules, buf, i); if (media_hdr->lstr->num_rules > 0) { media_hdr->lstr->rule_to_physical_stream_number_map = new UINT16[ media_hdr->lstr->num_rules ]; for (int j=0; jlstr->num_rules; j++) { UNPACK2(media_hdr->lstr->rule_to_physical_stream_number_map[j], buf, i); } } UNPACK2(media_hdr->lstr->num_properties, buf, i); if (media_hdr->lstr->num_properties > 0) { media_hdr->lstr->properties = new NameValueProperty[ media_hdr->lstr->num_properties ]; for (int j=0; jlstr->num_properties; j++) { UNPACK4(media_hdr->lstr->properties[j].size, buf, i); UNPACK2(media_hdr->lstr->properties[j].object_version, buf, i); if (media_hdr->lstr->properties[j].object_version == 0) { media_hdr->lstr->properties[j].name_length = buf[i]; i++; if (media_hdr->lstr->properties[j].name_length) { media_hdr->lstr->properties[j].name = new UINT8[ media_hdr->lstr->properties[j].name_length + 1]; memcpy((void *)media_hdr->lstr->properties[j].name, (void *)&buf[i], media_hdr->lstr->properties[j].name_length); media_hdr->lstr->properties[j].name[ media_hdr->lstr->properties[j].name_length ] = 0; i+=media_hdr->lstr->properties[j].name_length; } UNPACK4(media_hdr->lstr->properties[j].type, buf, i); UNPACK2(media_hdr->lstr->properties[j].value_length, buf, i); if (media_hdr->lstr->properties[j].value_length) { media_hdr->lstr->properties[j].value_data = new UINT8[ media_hdr->lstr->properties[j].value_length + 1]; memcpy((void *)media_hdr->lstr->properties[j].value_data, (void *)&buf[i], media_hdr->lstr->properties[j].value_length); media_hdr->lstr->properties[j].value_data[ media_hdr->lstr->properties[j].value_length ] = 0; i+=media_hdr->lstr->properties[j].value_length; } } } } } else media_hdr->lstr = 0; } } else media_hdr->type_specific_data = 0; } else { m_err = -1; return m_err; } return 0; } int RealMedia::RealMediaFF::getContentDescription(ContentDescription *cont, const unsigned char *buf, RealMedia::UINT32 object_id, int sz) { int i = 0; // Properties cont->s.object_id = object_id; cont->s.size = sz; i = RMFF_HDR_SIZE; UNPACK2(cont->object_version, buf, i); if ( !strncmp((const char *)&cont->s.object_id, "CONT", 4) && cont->object_version == 0) { UNPACK2(cont->title_len, buf, i); cont->title = new UINT8[cont->title_len + 1]; memcpy((void *)cont->title, (void *)&buf[i], cont->title_len); i+=cont->title_len; m_title = (char *)cont->title; m_title[cont->title_len] = 0; UNPACK2(cont->author_len, buf, i); cont->author = new UINT8[cont->author_len + 1]; memcpy((void *)cont->author, (void *)&buf[i], cont->author_len); i+=cont->author_len; m_author = (char *)cont->author; m_author[cont->author_len] = 0; UNPACK2(cont->copyright_len, buf, i); cont->copyright = new UINT8[cont->copyright_len + 1]; memcpy((void *)cont->copyright, (void *)&buf[i], cont->copyright_len); i+=cont->copyright_len; m_copyright = (char *)cont->copyright; m_copyright[cont->copyright_len] = 0; UNPACK2(cont->comment_len, buf, i); cont->comment = new UINT8[cont->comment_len + 1]; memcpy((void *)cont->comment, (void *)&buf[i], cont->comment_len); i+=cont->comment_len; m_comment = (char *)cont->comment; m_comment[cont->comment_len] = 0; } else { m_err = -1; return m_err; } return 0; } int RealMedia::RealMediaFF::seekChunk(RealMedia::UINT32 object_id) { if (!m_err) { off_t s, tot; RealMedia::UINT32 oid = 0, sz = 0; unsigned char buf[255]; int nbytes = 0; if ( (s = lseek(m_fd, 0, SEEK_SET)) != 0) return -1; tot = 0; while( (nbytes = getHdr(buf, 255, oid, sz)) == RMFF_HDR_SIZE && memcmp((void *)&oid, (void *)&object_id, 4) ) { tot += sz; if (sz > (unsigned) RMFF_HDR_SIZE) { if ( (s = lseek(m_fd, sz - RMFF_HDR_SIZE, SEEK_CUR)) != tot ) return -1; } else return -1; // bail in this case, since the chuck sz includes the header size } if ( (s = lseek(m_fd, -RMFF_HDR_SIZE, SEEK_CUR)) != tot ) return -1; return s; } return -1; } int RealMedia::RealMediaFF::getMDProperties(MDProperties *props, const unsigned char *buf) { int i = 0; int start = i; UNPACK4(props->size, buf, i); UNPACK4(props->type, buf, i); UNPACK4(props->flags, buf, i); UNPACK4(props->value_offset, buf, i); UNPACK4(props->subproperties_offset, buf, i); UNPACK4(props->num_subproperties, buf, i); UNPACK4(props->name_length, buf, i); props->name = new UINT8[ props->name_length + 1 ]; memcpy((void *)props->name, (void *)&buf[i], props->name_length); props->name[ props->name_length ] = 0; i+=props->name_length; i = start + props->value_offset; UNPACK4(props->value_length, buf, i); props->value = new UINT8[ props->value_length ]; memcpy( (void *) props->value, (void *)&buf[i], props->value_length ); if ( (props->type == MPT_ULONG) || (props->type == MPT_FLAG && props->value_length == 4) ) { // wOOt! the Year is a ULONG, and its stored little endian?! my guess is this is a bug in // RealPlayer 10 for Windows (where I created my test files) // This hack is intended to ensure that we at least interpret the Year properly. if (!strcmp((char *)props->name, "Year")) { if ( *(unsigned long *)props->value > 65536 ) { *(unsigned long *)(props->value) = ntohl(*(unsigned long *)(props->value)); m_flipYearInMetadataSection = true; } else m_flipYearInMetadataSection = false; } else *(unsigned long *)(props->value) = ntohl(*(unsigned long *)(props->value)); } i += props->value_length; i = start + props->subproperties_offset; props->subproperties_list = new PropListEntry[ props->num_subproperties ]; for (int j=0; j<(int)props->num_subproperties; j++) { UNPACK4(props->subproperties_list[j].offset, buf, i); UNPACK4(props->subproperties_list[j].num_props_for_name, buf, i); } props->subproperties = new MDProperties[ props->num_subproperties ]; for (int j=0; j<(int)props->num_subproperties; j++) { i = start + props->subproperties_list[j].offset; getMDProperties(&props->subproperties[j], &buf[i]); } return 0; } int RealMedia::RealMediaFF::initMetadataSection() { RealMedia::UINT32 object_id; off_t s; int nbytes; unsigned char buf[65536]; RealMedia::UINT32 consumed; memcpy((void *)&object_id, "RMMD", 4); if ( (s = seekChunk(object_id)) < 0 ) { m_err = -1; return m_err; } m_md = new MetadataSection; consumed = 0; nbytes = getChunk(buf, 65536, m_md->s.object_id, m_md->s.size, consumed); if (nbytes < 0 || m_md->s.size != consumed || memcmp((void *)&m_md->s.object_id, "RMMD", 4)) { //std::cerr << "SERIOUS ERROR - not able to find the chunk I just seek'd to!\n"; m_err = -1; return m_err; } // Properties int i = RMFF_HDR_SIZE; memcpy((void *)&m_md->object_id, (void *)&buf[i], 4); i+=4; UNPACK4(m_md->object_version, buf, i); if ( !strncmp((const char *)&m_md->s.object_id, "RMMD", 4) ) { if (!getMDProperties(&m_md->properties, &buf[i])) saveHeader(m_md); } else { m_err = -1; return m_err; } return 0; } #ifdef TESTING void RealMedia::RealMediaFF::printRealFileHeader(std::ostream &os) { char object_id[5]; if (m_hdr) { strncpy(object_id, (const char *)&m_hdr->s.object_id, 4); object_id[4]=0; os << "HDR object_id: " << object_id << std::endl; os << "HDR size: " << m_hdr->s.size << std::endl; os << "HDR object version: " << m_hdr->object_version << std::endl; os << "HDR file version: " << m_hdr->file_version << std::endl; os << "HDR num headers: " << m_hdr->num_headers << std::endl; } } void RealMedia::RealMediaFF::printRealPropHeader(std::ostream &os) { char object_id[5]; if (m_props) { strncpy(object_id, (const char *)&m_props->s.object_id, 4); object_id[4]=0; os << "PROPS object_id: " << object_id << std::endl; os << "PROPS size: " << m_props->s.size << std::endl; os << "PROPS object_version: " << m_props->object_version << std::endl; os << "PROPS max_bit_rate: " << m_props->max_bit_rate << std::endl; os << "PROPS avg_bit_rate: " << m_props->avg_bit_rate << std::endl; os << "PROPS max_packet_size: " << m_props->max_packet_size << std::endl; os << "PROPS avg_packet_size: " << m_props->avg_packet_size << std::endl; os << "PROPS num_packets: " << m_props->num_packets << std::endl; os << "PROPS duration: " << m_props->duration << std::endl; os << "PROPS preroll: " << m_props->preroll << std::endl; os << "PROPS index_offset: " << m_props->index_offset << std::endl; os << "PROPS data_offset: " << m_props->data_offset << std::endl; os << "PROPS num_streams: " << m_props->num_streams << std::endl; os << "PROPS flags: " << m_props->flags << std::endl; } } void RealMedia::RealMediaFF::printMediaPropHeaders(std::ostream &os) { int i = 0; char object_id[5]; MediaProperties *media_hdr = (MediaProperties *)m_head; while (media_hdr) { strncpy(object_id, (const char *)&media_hdr->s.object_id, 4); object_id[4]=0; if (!strncmp(object_id, "MDPR", 4)) { os << "MEDIA HDR" << i << " object_id: " << object_id << std::endl; os << "MEDIA HDR" << i << " size: " << media_hdr->s.size << std::endl; os << "MEDIA HDR" << i << " max_bit_rate: " << media_hdr->max_bit_rate << std::endl; os << "MEDIA HDR" << i << " avg_bit_rate: " << media_hdr->avg_bit_rate << std::endl; os << "MEDIA HDR" << i << " max_packet_size: " << media_hdr->max_packet_size << std::endl; os << "MEDIA HDR" << i << " avg_packet_size: " << media_hdr->avg_packet_size << std::endl; os << "MEDIA HDR" << i << " start_time: " << media_hdr->start_time << std::endl; os << "MEDIA HDR" << i << " preroll: " << media_hdr->preroll << std::endl; os << "MEDIA HDR" << i << " duration: " << media_hdr->duration << std::endl; os << "MEDIA HDR" << i << " stream_name: " << media_hdr->stream_name << std::endl; os << "MEDIA HDR" << i << " mime type: " << media_hdr->mime_type << std::endl; if (media_hdr->lstr) { os << "MEDIA HDR" << i << " LOGSTR info size: " << media_hdr->lstr->size << std::endl; os << "MEDIA HDR" << i << " LOGSTR info num_physical_streams: " << media_hdr->lstr->num_physical_streams << std::endl; os << "MEDIA HDR" << i << " LOGSTR info num_rules: " << media_hdr->lstr->num_rules << std::endl; os << "MEDIA HDR" << i << " LOGSTR info num_properties: " << media_hdr->lstr->num_properties << std::endl; for (int j=0; media_hdr->lstr->properties && jlstr->num_properties; j++) { if (media_hdr->lstr->properties[j].name) os << "MEDIA HDR" << i << " LOGSTR info prop name: " << media_hdr->lstr->properties[j].name << std::endl; os << "MEDIA HDR" << i << " LOGSTR info prop type: " << media_hdr->lstr->properties[j].type << std::endl; os << "MEDIA HDR" << i << " LOGSTR info prop value_length: " << media_hdr->lstr->properties[j].value_length << std::endl; if (media_hdr->lstr->properties[j].value_data) { if (media_hdr->lstr->properties[j].type == 0) os << "MEDIA HDR" << i << " LOGSTR info prop value: " << *(unsigned long *)media_hdr->lstr->properties[j].value_data << std::endl; else if (media_hdr->lstr->properties[j].type == 2) os << "MEDIA HDR" << i << " LOGSTR info prop value: " << media_hdr->lstr->properties[j].value_data << std::endl; else os << "MEDIA HDR" << i << " LOGSTR info prop value: \n"; } } } i++; } media_hdr = (MediaProperties *)media_hdr->fwd; } } void RealMedia::RealMediaFF::printContentDescription(std::ostream &os) { char object_id[5]; if (m_contenthdr) { strncpy(object_id, (const char *)&m_contenthdr->s.object_id, 4); object_id[4]=0; os << "CONT object_id: " << object_id << std::endl; os << "CONT title(" << m_contenthdr->title_len << "):\t\t<" << m_contenthdr->title << ">" << std::endl; os << "CONT author(" << m_contenthdr->author_len << "):\t\t<" << m_contenthdr->author << ">" << std::endl; os << "CONT copyright(" << m_contenthdr->copyright_len << "):\t\t<" << m_contenthdr->copyright << ">" << std::endl; os << "CONT comment(" << m_contenthdr->comment_len << "):\t\t<" << m_contenthdr->comment << ">" << std::endl; } } void RealMedia::RealMediaFF::printID3v1Tag(std::ostream &os) { if (m_id3v1tag) { os << "ID3 tag : " << ID3v1::Tag::fileIdentifier() << std::endl; os << "ID3 title : " << m_id3v1tag->tag()->title() << std::endl; os << "ID3 artist : " << m_id3v1tag->tag()->artist() << std::endl; os << "ID3 album : " << m_id3v1tag->tag()->album() << std::endl; os << "ID3 year : " << m_id3v1tag->tag()->year() << std::endl; os << "ID3 comment : " << m_id3v1tag->tag()->comment() << std::endl; os << "ID3 track : " << m_id3v1tag->tag()->track() << std::endl; os << "ID3 genre : " << m_id3v1tag->tag()->genre() << std::endl; } } void RealMedia::RealMediaFF::printMDProperties(std::ostream &os, char *nam, MDProperties *props) { char name[8192]; strcpy(name, nam); os << "MDP subproperties for: " << name << std::endl; os << "MD properties.size: " << props->size << std::endl; os << "MD properties.type: " << props->type << std::endl; os << "MD properties.flags: " << props->flags << std::endl; os << "MD properties.value_offset: " << props->value_offset << std::endl; os << "MD properties.subproperties_offset: " << props->subproperties_offset << std::endl; os << "MD properties.num_subproperties: " << props->num_subproperties << std::endl; os << "MD properties.name_length: " << props->name_length << std::endl; os << "MD properties.name: " << (char *)props->name << std::endl; os << "MD properties.value_length: " << props->value_length << std::endl; switch (props->type) { case MPT_TEXT: case MPT_TEXTLIST: case MPT_URL: case MPT_DATE: case MPT_FILENAME: os << "MD properties.value: " << (char *)props->value << std::endl; break; case MPT_FLAG: if (props->value_length == 4) os << "MD properties.value: " << *(unsigned long *)props->value << std::endl; else os << "MD properties.value: " << *props->value << std::endl; break; case MPT_ULONG: os << "MD properties.value: " << *(unsigned long *)props->value << std::endl; break; case MPT_BINARY: os << "MD properties.value: " << std::endl; break; case MPT_GROUPING: os << "MD properties.value: " << std::endl; break; case MPT_REFERENCE: os << "MD properties.value: " << std::endl; break; } if (props->num_subproperties) { strcat(name, (char *)props->name); strcat(name, "/"); } for (int j=0; jnum_subproperties; j++) { os << "MD properties.sub_properties_list[" << j << "].offset: " << props->subproperties_list[j].offset << std::endl; os << "MD properties.sub_properties_list[" << j << "].num_props_for_name: " << props->subproperties_list[j].num_props_for_name << std::endl; os << std::endl; printMDProperties(os, name, &props->subproperties[j]); } } void RealMedia::RealMediaFF::printMetadataSection(std::ostream &os) { char name[8192]; char oid[5]; memcpy((void *)oid, (void *)&m_md->s.object_id, 4); oid[4] = 0; os << "MetadataSection: "; os << "MS object_id: " << oid << std::endl; os << "MS SIZE: " << m_md->s.size << std::endl; os << "MD object_id: " << (char *)&m_md->object_id << std::endl; os << "MD object_version: " << m_md->object_version << std::endl; os << std::endl; strcpy(name, ""); printMDProperties(os, name, &m_md->properties); } std::ostream &RealMedia::RealMediaFF::operator<<(std::ostream &os) { if (m_readProperties) { printRealFileHeader(os); printRealPropHeader(os); printMediaPropHeaders(os); printContentDescription(os); printMetadataSection(os); } printID3v1Tag(os); return os; } std::ostream &operator<<(std::ostream &os, RealMedia::RealMediaFF &rmff) { rmff.operator<<(os); return os; } int main(int argc, char *argv[]) { char *m_filen; if (argc > 1) m_filen = argv[1]; else m_filen = "./Drown.ra"; RealMedia::RealMediaFF rmff(m_filen); if (!rmff.err()) std::cout << rmff; /* RealMedia::UINT32 oid = 0; memcpy( (void *)&oid, (void *) ".RMF", 4); off_t pos = rmff.seekChunk(oid); std::cout << "POS=" << pos << std::endl; memcpy( (void *)&oid, (void *) "MDPR", 4); pos = rmff.seekChunk(oid); std::cout << "POS=" << pos << std::endl; memcpy( (void *)&oid, (void *) "RMMD", 4); pos = rmff.seekChunk(oid); std::cout << "POS=" << pos << std::endl; */ } #endif taglib-extras-1.0.1/taglib-extras/rmff/realmediafile.h0000644000211100001440000001140311255707405022402 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Paul Cifarelli email : paulc2@optonline.net copyright : (C) 2005 by Lukas Lalinsky email : lalinsky@gmail.com (portions) ***************************************************************************/ /*************************************************************************** * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ /*************************************************************************** * 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 or higher 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 St, 5th fl, Boston, MA 02110-1301, * * USA, or check http://www.fsf.org/about/contact.html * ***************************************************************************/ #ifndef _TAGLIB_REALMEDIAFILE_H_ #define _TAGLIB_REALMEDIAFILE_H_ #include #include #include #include #include namespace TagLibExtras { namespace RealMedia { class RealMediaFF; class TAGLIB_EXTRAS_EXPORT Tag : public TagLib::Tag { public: explicit Tag(RealMediaFF *rmff, bool allocnew = false); virtual ~Tag (); virtual TagLib::String title () const; virtual TagLib::String artist () const; virtual TagLib::String album () const; virtual TagLib::String comment () const; virtual TagLib::String genre () const; virtual TagLib::uint year () const; virtual TagLib::uint track () const; virtual void setTitle (const TagLib::String &s); virtual void setArtist (const TagLib::String &s); virtual void setAlbum (const TagLib::String &s); virtual void setComment (const TagLib::String &s); virtual void setGenre (const TagLib::String &s); virtual void setYear (TagLib::uint i); virtual void setTrack (TagLib::uint i); bool isEmpty() const; void duplicate(const Tag *source, Tag *target, bool overwrite); private: Tag(); RealMediaFF *m_rmff; bool m_owner; }; class TAGLIB_EXTRAS_EXPORT Properties : public TagLib::AudioProperties { public: Properties(RealMediaFF *rmff) : TagLib::AudioProperties(Average), m_rmff(rmff) {} virtual ~Properties() {} // you don't own rmff virtual int length () const; virtual int bitrate () const; virtual int sampleRate () const; virtual int channels () const; private: Properties(); RealMediaFF *m_rmff; }; class TAGLIB_EXTRAS_EXPORT File : public TagLib::File { public: explicit File(TagLib::FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); virtual ~File(); /* * Returns the TagLib::Tag for this file. */ virtual TagLib::Tag *tag() const; /* * Returns the RealMedia::RealMediaTag for this file. */ virtual Tag *RealMediaTag() const; /* * Returns the RealMedia::Properties for this file. */ virtual Properties *audioProperties() const; /* * Save the file. * * This returns true if the save was successful. */ virtual bool save() { return false; } // for now private: RealMediaFF *m_rmfile; Tag *m_tag; Properties *m_props; }; } } #endif taglib-extras-1.0.1/taglib-extras/rmff/CMakeLists.txt0000644000211100001440000000016011155742353022204 0ustar jefferaiusersINSTALL( FILES realmediafiletyperesolver.h realmediafile.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib-extras ) taglib-extras-1.0.1/taglib-extras/rmff/realmediafiletyperesolver.h0000644000211100001440000000454011164703160025063 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Paul Cifarelli email : paulc2@optonline.net ***************************************************************************/ /*************************************************************************** * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ /*************************************************************************** * 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 or higher 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 St, 5th fl, Boston, MA 02110-1301, * * USA, or check http://www.fsf.org/about/contact.html * ***************************************************************************/ #ifndef _TAGLIB_REALMEDIAFILETYPERESOLVER_H_ #define _TAGLIB_REALMEDIAFILETYPERESOLVER_H_ #include #include #include class TAGLIB_EXTRAS_EXPORT RealMediaFileTypeResolver : public TagLib::FileRef::FileTypeResolver { TagLib::File *createFile(TagLib::FileName fileName, bool readAudioProperties, TagLib::AudioProperties::ReadStyle audioPropertiesStyle) const; ~RealMediaFileTypeResolver() {} }; #endif taglib-extras-1.0.1/taglib-extras/rmff/realmediafile.cpp0000644000211100001440000001175311254453737022752 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Paul Cifarelli email : paulc2@optonline.net copyright : (C) 2005 by Lukas Lalinsky email : lalinsky@gmail.com (portions) ***************************************************************************/ /*************************************************************************** * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ /*************************************************************************** * 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 or higher 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 St, 5th fl, Boston, MA 02110-1301, * * USA, or check http://www.fsf.org/about/contact.html * ***************************************************************************/ #include "realmediafile.h" #include #include #include #include #include "rmff.h" using namespace TagLibExtras; RealMedia::Tag::Tag( RealMediaFF *rmff, bool allocnew ) : m_rmff( rmff ), m_owner( allocnew ) { if( m_owner ) m_rmff = new RealMediaFF( *rmff ); } RealMedia::Tag::~Tag() { if( m_owner ) delete m_rmff; } TagLib::String RealMedia::Tag::title() const { return m_rmff->title(); } TagLib::String RealMedia::Tag::artist() const { return m_rmff->artist(); } TagLib::String RealMedia::Tag::album() const { return m_rmff->album(); } TagLib::String RealMedia::Tag::comment() const { return m_rmff->comment(); } TagLib::String RealMedia::Tag::genre() const { return m_rmff->genre(); } TagLib::uint RealMedia::Tag::year() const { return m_rmff->year(); } TagLib::uint RealMedia::Tag::track() const { return m_rmff->track(); } void RealMedia::Tag::setTitle( const TagLib::String & ) { // TODO: write support } void RealMedia::Tag::setArtist( const TagLib::String & ) { // TODO: write support } void RealMedia::Tag::setAlbum( const TagLib::String & ) { // TODO: write support } void RealMedia::Tag::setComment( const TagLib::String & ) { // TODO: write support } void RealMedia::Tag::setGenre( const TagLib::String & ) { // TODO: write support } void RealMedia::Tag::setYear( TagLib::uint ) { // TODO: write support } void RealMedia::Tag::setTrack( TagLib::uint ) { // TODO: write support } bool RealMedia::Tag::isEmpty() const { return TagLib::Tag::isEmpty() && m_rmff->isEmpty(); } void RealMedia::Tag::duplicate( const Tag *source, Tag *target, bool overwrite ) { TagLib::Tag::duplicate( source, target, overwrite ); if( overwrite || target->isEmpty() ) { if ( target->m_owner ) { delete target->m_rmff; target->m_rmff = new RealMediaFF( *source->m_rmff ); } else target->m_rmff = source->m_rmff; } } int RealMedia::Properties::length() const { return m_rmff->length() / 1000; } int RealMedia::Properties::bitrate() const { return m_rmff->bitrate() / 1000; } int RealMedia::Properties::sampleRate() const { return m_rmff->sampleRate(); } int RealMedia::Properties::channels() const { return m_rmff->channels(); } RealMedia::File::File( TagLib::FileName file, bool readProperties, Properties::ReadStyle propertiesStyle ) : TagLib::File( file ), m_rmfile( 0 ), m_tag( 0 ), m_props( 0 ) { m_rmfile = new RealMediaFF( file, readProperties, propertiesStyle ); m_tag = new RealMedia::Tag( m_rmfile ); m_props = new RealMedia::Properties( m_rmfile ); } RealMedia::File::~File() { delete m_props; delete m_tag; delete m_rmfile; } TagLib::Tag *RealMedia::File::tag() const { return m_tag; } RealMedia::Tag *RealMedia::File::RealMediaTag() const { return m_tag; } RealMedia::Properties *RealMedia::File::audioProperties() const { return m_props; // m_rmfile->properties; } taglib-extras-1.0.1/taglib-extras/rmff/rmff.h0000644000211100001440000003271411254453737020566 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Paul Cifarelli email : paulc2@optonline.net ***************************************************************************/ /*************************************************************************** * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ /*************************************************************************** * 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 or higher 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 St, 5th fl, Boston, MA 02110-1301, * * USA, or check http://www.fsf.org/about/contact.html * ***************************************************************************/ #ifndef _RMFF_H_INCLUDED_ #define _RMFF_H_INCLUDED_ #include "config-taglib-extras.h" #include #include #include #include namespace TagLibExtras { namespace RealMedia { #if SIZEOF_LONG == 4 typedef unsigned long UINT32; #elif SIZEOF_INT == 4 typedef unsigned int UINT32; #else #error At least 1 builtin type needs to be 4 bytes!! #endif typedef unsigned short UINT16; typedef unsigned char UINT8; static const int RMFF_HDR_SIZE = 8; // packed hdr size // some assumptions on these 2 enum defs, based solely on the order they are listed on the website enum PROPERTY_TYPES { MPT_TEXT = 1, // The value is string data. MPT_TEXTLIST, // The value is a separated list of strings, // separator specified as sub-property/type descriptor. MPT_FLAG, // The value is a boolean flag-either 1 byte or 4 bytes, check size value. MPT_ULONG, // The value is a four-byte integer. MPT_BINARY, // The value is a byte stream. MPT_URL, // The value is string data. MPT_DATE, // The value is a string representation of the date in the form: // YYYYmmDDHHMMSS (m = month, M = minutes). MPT_FILENAME, // The value is string data. MPT_GROUPING, // This property has subproperties, but its own value is empty. MPT_REFERENCE // The value is a large buffer of data, use sub-properties/type // descriptors to identify mime-type. }; enum PROPERTY_FLAGS { MPT_READONLY = 1, // Read only, cannot be modified. MPT_PRIVATE = 2, // Private, do not expose to users. MPT_TYPE_DESCRIPTOR = 4 // Type descriptor used to further define type of value. }; struct Collectable { Collectable() : fwd(0) {} virtual ~Collectable() {} Collectable *fwd; }; struct File_Header_Start { File_Header_Start() : object_id(0), size(0) {} RealMedia::UINT32 object_id; RealMedia::UINT32 size; }; struct File_Header_v0_v1 : public Collectable { File_Header_Start s; UINT16 object_version; RealMedia::UINT32 file_version; RealMedia::UINT32 num_headers; }; struct RMProperties : public Collectable { File_Header_Start s; UINT16 object_version; RealMedia::UINT32 max_bit_rate; RealMedia::UINT32 avg_bit_rate; RealMedia::UINT32 max_packet_size; RealMedia::UINT32 avg_packet_size; RealMedia::UINT32 num_packets; RealMedia::UINT32 duration; RealMedia::UINT32 preroll; RealMedia::UINT32 index_offset; RealMedia::UINT32 data_offset; UINT16 num_streams; UINT16 flags; }; struct NameValueProperty { NameValueProperty() : size(0), object_version(0), name_length(0), name(0), type(0) , value_length(0), value_data(0) {} virtual ~NameValueProperty() { delete [] name; delete [] value_data; } RealMedia::UINT32 size; UINT16 object_version; UINT8 name_length; UINT8 *name; RealMedia::UINT32 type; UINT16 value_length; UINT8 *value_data; }; struct LogicalStream { LogicalStream() : size(0), object_version(0), num_physical_streams(0) , physical_stream_numbers(0), data_offsets(0), num_rules(0) , rule_to_physical_stream_number_map(0), num_properties(0) , properties(0) {} virtual ~LogicalStream() { delete [] physical_stream_numbers; delete [] data_offsets; delete [] rule_to_physical_stream_number_map; delete [] properties; } RealMedia::UINT32 size; UINT16 object_version; UINT16 num_physical_streams; UINT16 *physical_stream_numbers; RealMedia::UINT32 *data_offsets; UINT16 num_rules; UINT16 *rule_to_physical_stream_number_map; UINT16 num_properties; NameValueProperty *properties; }; struct MediaProperties : public Collectable { MediaProperties() : object_version(0), stream_number(0), max_bit_rate(0) , avg_bit_rate(0), max_packet_size(0), avg_packet_size(0) , start_time(0), preroll(0), duration(0), stream_name_size(0) , mime_type_size(0), type_specific_len(0), type_specific_data(0) , lstr(0) { memset(stream_name, 0, 256); memset(mime_type, 0, 256); } virtual ~MediaProperties() { delete lstr; delete [] type_specific_data; } File_Header_Start s; UINT16 object_version; UINT16 stream_number; RealMedia::UINT32 max_bit_rate; RealMedia::UINT32 avg_bit_rate; RealMedia::UINT32 max_packet_size; RealMedia::UINT32 avg_packet_size; RealMedia::UINT32 start_time; RealMedia::UINT32 preroll; RealMedia::UINT32 duration; UINT8 stream_name_size; UINT8 stream_name[256]; UINT8 mime_type_size; UINT8 mime_type[256]; RealMedia::UINT32 type_specific_len; UINT8 *type_specific_data; LogicalStream *lstr; // only one of these }; struct ContentDescription : public Collectable { ContentDescription() : object_version(0), title_len(0), title(0), author_len(0) , author(0), copyright_len(0), copyright(0), comment_len(0) , comment(0) {} virtual ~ContentDescription() { delete [] title; delete [] author; delete [] copyright; delete [] comment; } File_Header_Start s; UINT16 object_version; UINT16 title_len; UINT8 *title; UINT16 author_len; UINT8 *author; UINT16 copyright_len; UINT8 *copyright; UINT16 comment_len; UINT8 *comment; }; struct PropListEntry { RealMedia::UINT32 offset; RealMedia::UINT32 num_props_for_name; }; struct MDProperties { MDProperties() : size(0), type(0), flags(0), value_offset(0) , subproperties_offset(0), num_subproperties(0), name_length(0) , name(0), value_length(0), value(0), subproperties_list(0), subproperties(0) {} virtual ~MDProperties() { delete [] name; delete [] value; delete [] subproperties_list; delete [] subproperties; } RealMedia::UINT32 size; RealMedia::UINT32 type; RealMedia::UINT32 flags; RealMedia::UINT32 value_offset; RealMedia::UINT32 subproperties_offset; RealMedia::UINT32 num_subproperties; RealMedia::UINT32 name_length; UINT8 *name; RealMedia::UINT32 value_length; UINT8 *value; PropListEntry *subproperties_list; // num_subproperties MDProperties *subproperties; // num_subproperties }; struct MetadataSection : public Collectable { File_Header_Start s; RealMedia::UINT32 object_id; RealMedia::UINT32 object_version; // this is the 1 "unnamed root property" MDProperties properties; }; class Tag; class File; // RealMedia File Format contains a normal ID3v1 Tag at the end of the file // no sense reinventing the wheel, so this class is just so we can use TagLib // to manage it class RMFFile : public TagLib::File { public: RMFFile(TagLib::FileName filename); virtual ~RMFFile(); bool save(); TagLib::Tag *tag() const { return m_id3tag; } TagLib::AudioProperties *audioProperties() const { return 0; } private: TagLib::ID3v1::Tag *m_id3tag; }; class RealMediaFF { public: explicit RealMediaFF(TagLib::FileName file, bool readProperties = true, TagLib::AudioProperties::ReadStyle propertiesStyle = TagLib::AudioProperties::Average); RealMediaFF(RealMediaFF &src); ~RealMediaFF(); int err() const { return m_err; } bool isEmpty() const; // tag TagLib::String title () const; TagLib::String artist () const; TagLib::String album () const; TagLib::String comment () const; TagLib::String genre () const; TagLib::uint year () const; TagLib::uint track () const; // TODO write support //void setTitle (const String &s); //void setArtist (const String &s); //void setAlbum (const String &s); //void setComment (const String &s); //void setGenre (const String &s); //void setYear (uint i); //void setTrack (uint i); // properties int length () const; int bitrate () const; int sampleRate () const; int channels () const; #ifdef TESTING std::ostream &operator<<(std::ostream &os); #endif private: RealMediaFF(); char *m_filename; Collectable *m_head; Collectable *m_tail; int m_fd; int m_err; File_Header_v0_v1 *m_hdr; RMProperties *m_props; MediaProperties *media_hdrs; ContentDescription *m_contenthdr; MetadataSection *m_md; char *m_title; char *m_author; char *m_copyright; char *m_comment; RMFFile *m_id3v1tag; bool m_flipYearInMetadataSection; bool m_readProperties; int init(); int initMetadataSection(); void saveHeader(Collectable *hdr); int seekChunk(RealMedia::UINT32 object_id); int getHdr(unsigned char *buf, size_t sz, RealMedia::UINT32 &fourcc, RealMedia::UINT32 &csz); int getChunk(unsigned char *buf, size_t sz, RealMedia::UINT32 &fourcc, RealMedia::UINT32 &csz, RealMedia::UINT32 &consumed); int getRealFileHeader(File_Header_v0_v1 *hdr, const unsigned char *buf, RealMedia::UINT32 object_id, int sz); int getRealPropertyHeader(RMProperties *props, const unsigned char *buf, RealMedia::UINT32 object_id, int sz); int getMediaPropHeader(MediaProperties *mh, const unsigned char *buf, RealMedia::UINT32 object_id, int sz); int getContentDescription(ContentDescription *cont, const unsigned char *buf, RealMedia::UINT32 object_id, int sz); int getMDProperties(MDProperties *md, const unsigned char *buf); #ifdef TESTING void printRealFileHeader(std::ostream &os); void printRealPropHeader(std::ostream &os); void printMediaPropHeaders(std::ostream &os); void printContentDescription(std::ostream &os); void printID3v1Tag(std::ostream &os); void printMetadataSection(std::ostream &os); void printMDProperties(std::ostream &os, char *name, MDProperties *props); #endif }; } // namespace RealMedia } // namespace TagLib #ifdef TESTING std::ostream &operator<<(std::ostream &os, TagLib::RealMedia::RealMediaFF &rmff); #endif #endif taglib-extras-1.0.1/taglib-extras/rmff/realmediafiletyperesolver.cpp0000644000211100001440000000526411254453737025436 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Paul Cifarelli email : paulc2@optonline.net ***************************************************************************/ /*************************************************************************** * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ /*************************************************************************** * 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 or higher 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 St, 5th fl, Boston, MA 02110-1301, * * USA, or check http://www.fsf.org/about/contact.html * ***************************************************************************/ #include "realmediafiletyperesolver.h" #include #include #include #include "realmediafile.h" #include "rmff.h" #include TagLib::File *RealMediaFileTypeResolver::createFile(TagLib::FileName fileName, bool readProperties, TagLib::AudioProperties::ReadStyle propertiesStyle) const { if(CheckExtension(fileName, ".ra") || CheckExtension(fileName, ".rv") || CheckExtension(fileName, ".rm") || CheckExtension(fileName, ".rmj") || CheckExtension(fileName, ".rmvb")) { TagLibExtras::RealMedia::File *f = new TagLibExtras::RealMedia::File(fileName, readProperties, propertiesStyle); if(f->isValid()) return f; else delete f; } return 0; } taglib-extras-1.0.1/taglib-extras/CMakeLists.txt0000644000211100001440000000263711254507246021265 0ustar jefferaiusersset(CMAKE_INCLUDE_CURRENT_DIR ON) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/audible ${CMAKE_CURRENT_SOURCE_DIR}/rmff ) add_definitions(${TAGLIB_CFLAGS}) add_subdirectory( audible ) add_subdirectory( rmff ) set(libtagrealmedia_SRCS rmff/rmff.cpp rmff/realmediafile.cpp rmff/realmediafiletyperesolver.cpp ) set(libtagaudible_SRCS audible/audibleproperties.cpp audible/audibletag.cpp audible/audiblefile.cpp audible/audiblefiletyperesolver.cpp ) ########### next target ############### set(tag-extras_LIB_SRCS tfile_helper.cpp ${libtagaudible_SRCS} ${libtagrealmedia_SRCS} ) add_library(tag-extras SHARED ${tag-extras_LIB_SRCS}) set_target_properties(tag-extras PROPERTIES VERSION ${TAGLIB-EXTRAS_LIB_MAJOR_VERSION}.${TAGLIB-EXTRAS_LIB_MINOR_VERSION}.${TAGLIB-EXTRAS_LIB_PATCH_VERSION} SOVERSION ${TAGLIB-EXTRAS_LIB_MAJOR_VERSION} INSTALL_NAME_DIR ${LIB_INSTALL_DIR} DEFINE_SYMBOL MAKE_TAGLIB_EXTRAS_LIB ) target_link_libraries(tag-extras ${TAGLIB_LIBRARIES} ${KDE_LIBRARIES}) if(WIN32) target_link_libraries(tag-extras ws2_32) endif(WIN32) ########### install files ############### install(TARGETS tag-extras LIBRARY DESTINATION ${LIB_INSTALL_DIR} RUNTIME DESTINATION ${BIN_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR} ) install( FILES taglib-extras_export.h tfile_helper.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib-extras) taglib-extras-1.0.1/taglib-extras/tplugins.h0000644000211100001440000000332211254504103020520 0ustar jefferaiusers/* NOTE NOTE NOTE * This file is not compiled as part of taglib-extras anymore; but as the implementation * of the MimeTypeFileTypeResolver may yet be useful to someone, the code is being kept */ /*************************************************************************** copyright : (C) 2005 by Martin Aumueller email : aumuell@reserv.at ***************************************************************************/ /*************************************************************************** * 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 TPLUGIN_H #define TPLUGIN_H #include void TAGLIB_EXTRAS_EXPORT registerTaglibPlugins(); #endif taglib-extras-1.0.1/taglib-extras/tplugins.cpp0000644000211100001440000001165111254504103021057 0ustar jefferaiusers/* NOTE NOTE NOTE * This file is not compiled as part of taglib-extras anymore; but as the implementation * of the MimeTypeFileTypeResolver may yet be useful to someone, the code is being kept */ /*************************************************************************** copyright : (C) 2005, 2006 by Martin Aumueller email : aumuell@reserv.at ***************************************************************************/ /*************************************************************************** * 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 * ***************************************************************************/ #ifdef HAVE_KDE #include #include #include #endif #include #include #include "tfile_helper.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_KDE class MimeTypeFileTypeResolver : public TagLib::FileRef::FileTypeResolver { TagLib::File *createFile(TagLib::FileName fileName, bool readAudioProperties, TagLib::AudioProperties::ReadStyle audioPropertiesStyle) const; }; TagLib::File *MimeTypeFileTypeResolver::createFile(TagLib::FileName fileName, bool readProperties, TagLib::AudioProperties::ReadStyle propertiesStyle) const { QString fn = QFile::decodeName( fileName ); KMimeType::Ptr mimetype = KMimeType::findByPath( fn ); if( mimetype->is( "audio/mpeg" ) || mimetype->is( "audio/x-mpegurl" ) || mimetype->is( "audio/mpeg" )) { return new TagLib::MPEG::File(fileName, readProperties, propertiesStyle); } else if( mimetype->is( "audio/mp4" ) || mimetype->is( "video/mp4" ) ) { return new TagLib::MP4::File(fileName, readProperties, propertiesStyle); } else if( mimetype->is( "audio/x-ms-wma" ) || mimetype->is( "video/x-ms-asf" ) || mimetype->is( "video/x-msvideo" ) || mimetype->is( "video/x-ms-wmv" ) ) { return new TagLib::ASF::File(fileName, readProperties, propertiesStyle); } else if( mimetype->is( "audio/vnd.rn-realaudio" ) || mimetype->is( "audio/x-pn-realaudioplugin" ) || mimetype->is( "audio/vnd.rn-realvideo" ) ) { return new TagLib::RealMedia::File(fileName, readProperties, propertiesStyle); } else if( mimetype->is( "audio/x-vorbis+ogg" ) ) { return new TagLib::Ogg::Vorbis::File(fileName, readProperties, propertiesStyle); } else if( mimetype->is( "audio/x-flac+ogg" ) ) { return new TagLib::Ogg::FLAC::File(fileName, readProperties, propertiesStyle); } else if( mimetype->is( "audio/x-flac" ) ) { return new TagLib::FLAC::File(fileName, readProperties, propertiesStyle); } else if( mimetype->is( "audio/x-musepack" ) ) { return new TagLib::MPC::File(fileName, readProperties, propertiesStyle); } else if( mimetype->is( "audio/x-wavpack" ) ) { return new TagLib::WavPack::File(fileName, readProperties, propertiesStyle); } else if( mimetype->is( "audio/x-tta" ) ) { return new TagLib::TrueAudio::File(fileName, readProperties, propertiesStyle); } else if( mimetype->is( "audio/x-speex" ) || mimetype->is( "audio/x-speex+ogg" ) ) { return new TagLib::TrueAudio::File(fileName, readProperties, propertiesStyle); } qDebug() << "kmimetype filetype guessing failed for" << fileName; return 0; } #endif void registerTaglibPlugins() { #ifdef HAVE_KDE TagLib::FileRef::addFileTypeResolver(new MimeTypeFileTypeResolver); #endif TagLib::FileRef::addFileTypeResolver(new RealMediaFileTypeResolver); TagLib::FileRef::addFileTypeResolver(new AudibleFileTypeResolver); } taglib-extras-1.0.1/taglib-extras/taglib-extras_export.h0000644000211100001440000000403511156512732023034 0ustar jefferaiusers/*************************************************************************** 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * * 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_EXTRAS_EXPORT_H #define TAGLIB_EXTRAS_EXPORT_H #if defined(_WIN32) || defined(_WIN64) # if defined(MAKE_TAGLIB_EXTRAS_LIB) # define TAGLIB_EXTRAS_EXPORT __declspec(dllexport) # else # define TAGLIB_EXTRAS_EXPORT __declspec(dllimport) # endif #else # define TAGLIB_EXTRAS_EXPORT __attribute__((visibility("default"))) #endif #endif taglib-extras-1.0.1/taglib-extras/tfile_helper.cpp0000644000211100001440000000453511163120370021656 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2007 by Shane King email : kde@dontletsstart.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, or (at your option) any later version, 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 * ***************************************************************************/ #include "tfile_helper.h" #include "config-taglib-extras.h" #include #ifdef HAVE_STRINGS_H #include #else #define strcasecmp stricmp #endif #include #if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(_WIN64) int wcscasecmp(const wchar_t *s1, const wchar_t *s2) { int i; for (i = 0; s1[i] != L'\0' && s2[i] != L'\0'; i++) { wint_t x = towlower(s1[i]); wint_t y = towlower(s2[i]); if (x != y) return x - y; } return towlower(s1[i]) - towlower(s2[i]); } #endif bool CheckExtensionImpl(const char *fileName, const char *extension) { const char *ext = strrchr(fileName, '.'); return ext && !strcasecmp(ext, extension); } bool CheckExtensionImpl(const wchar_t *fileName, const wchar_t *extension) { const wchar_t *ext = wcsrchr(fileName, L'.'); return ext && !wcscasecmp(ext, extension); } taglib-extras-1.0.1/taglib-extras/audible/0000755000211100001440000000000011255770672020130 5ustar jefferaiuserstaglib-extras-1.0.1/taglib-extras/audible/audiblefiletyperesolver.h0000644000211100001440000000354211156300103025210 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Martin Aumueller email : aumuell@reserv.at ***************************************************************************/ /*************************************************************************** * 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_AUDIBLEFILETYPERESOLVER_H #define TAGLIB_AUDIBLEFILETYPERESOLVER_H #include #include #include class TAGLIB_EXTRAS_EXPORT AudibleFileTypeResolver : public TagLib::FileRef::FileTypeResolver { TagLib::File *createFile(TagLib::FileName fileName, bool readAudioProperties, TagLib::AudioProperties::ReadStyle audioPropertiesStyle) const; ~AudibleFileTypeResolver() {} }; #endif taglib-extras-1.0.1/taglib-extras/audible/CMakeLists.txt0000644000211100001440000000021511155615673022664 0ustar jefferaiusersINSTALL( FILES audiblefiletyperesolver.h audiblefile.h audibleproperties.h audibletag.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib-extras ) taglib-extras-1.0.1/taglib-extras/audible/audiblefile.cpp0000644000211100001440000000676511254453737023116 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Martin Aumueller email : aumuell@reserv.at copyright : (C) 2005 by Andy Leadbetter email : andrew.leadbetter@gmail.com (original mp4 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 * ***************************************************************************/ #include "audiblefile.h" #include "audibletag.h" #include #include #include #include namespace TagLibExtras { //////////////////////////////////////////////////////////////////////////////// // public members //////////////////////////////////////////////////////////////////////////////// Audible::File::File(TagLib::FileName file, bool readProperties, Properties::ReadStyle propertiesStyle, FILE *fp) : TagLib::File(file) , audibletag( NULL ) , properties( NULL ) { /** * Create the Audible file. */ if(fp) audiblefile = fp; else audiblefile = TagLibOpenFile(file, "rb"); if( isOpen() ) { read(readProperties, propertiesStyle ); } } Audible::File::~File() { if(audiblefile) fclose(audiblefile); delete audibletag; delete properties; } TagLib::Tag *Audible::File::tag() const { return audibletag; } TagLibExtras::Audible::Tag *Audible::File::getAudibleTag() const { return audibletag; } Audible::Properties *Audible::File::audioProperties() const { return properties; } bool Audible::File::save() { return false; } bool Audible::File::isOpen() { return audiblefile != NULL; } //////////////////////////////////////////////////////////////////////////////// // private members //////////////////////////////////////////////////////////////////////////////// void Audible::File::read(bool readProperties, Properties::ReadStyle propertiesStyle) { properties = new Audible::Properties(propertiesStyle); audibletag = new Audible::Tag(); if (audiblefile != NULL) { audibletag->readTags( audiblefile ); int off = audibletag->getTagsEndOffset(); //fprintf(stderr, "off=%d\n", off); if(readProperties) { // Parse bitrate etc. properties->readAudibleProperties( audiblefile, off ); } } } } taglib-extras-1.0.1/taglib-extras/audible/audiblefiletyperesolver.cpp0000644000211100001440000000364711254453737025576 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Martin Aumueller email : aumuell@reserv.at ***************************************************************************/ /*************************************************************************** * 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 * ***************************************************************************/ #include "audiblefiletyperesolver.h" #include "audiblefile.h" #include #include TagLib::File *AudibleFileTypeResolver::createFile(TagLib::FileName fileName, bool readProperties, TagLib::AudioProperties::ReadStyle propertiesStyle) const { if(CheckExtension(fileName, ".aa")) { TagLibExtras::Audible::File *f = new TagLibExtras::Audible::File(fileName, readProperties, propertiesStyle); if(f->isValid()) return f; else delete f; } return 0; } taglib-extras-1.0.1/taglib-extras/audible/audibleproperties.h0000644000211100001440000000573411254453737024033 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Martin Aumueller email : aumuell@reserv.at copyright : (C) 2005 by Andy Leadbetter email : andrew.leadbetter@gmail.com (original mp4 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 * ***************************************************************************/ #ifndef TAGLIB_AUDIBLEPROPERTIES_H #define TAGLIB_AUDIBLEPROPERTIES_H #include #include #include namespace TagLibExtras { namespace Audible { class File; /*! * This reads the data from a Audible stream to support the * AudioProperties API. */ class TAGLIB_EXTRAS_EXPORT Properties : public TagLib::AudioProperties { public: /*! * Initialize this structure */ Properties(Properties::ReadStyle style); /*! * Destroys this Audible Properties instance. */ virtual ~Properties(); // Reimplementations. virtual int length() const; virtual int bitrate() const; virtual int sampleRate() const; virtual int channels() const; void readAudibleProperties(FILE *file, int off); private: void readAudioTrackProperties(FILE *file); friend class Audible::File; int m_length; int m_bitrate; int m_sampleRate; int m_channels; Properties(const Properties &); Properties &operator=(const Properties &); void read(); }; } } #endif taglib-extras-1.0.1/taglib-extras/audible/audibleproperties.cpp0000644000211100001440000000547411254453737024367 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Martin Aumueller email : aumuell@reserv.at copyright : (C) 2005 by Andy Leadbetter email : andrew.leadbetter@gmail.com (original mp4 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 * ***************************************************************************/ #include "audibleproperties.h" #include #include "audiblefile.h" #include #if !defined(_WIN32) && !defined(_WIN64) #include // ntohl #else #include #endif using namespace TagLibExtras; //////////////////////////////////////////////////////////////////////////////// // public members //////////////////////////////////////////////////////////////////////////////// Audible::Properties::Properties(Properties::ReadStyle style) : AudioProperties(style) { m_length = 0; m_bitrate = 0; m_sampleRate = 0; m_channels = 0; } Audible::Properties::~Properties() { } int Audible::Properties::length() const { return m_length; } int Audible::Properties::bitrate() const { return m_bitrate; } int Audible::Properties::sampleRate() const { return m_sampleRate; } int Audible::Properties::channels() const { return m_channels; } #define LENGTH_OFF 61 void Audible::Properties::readAudibleProperties( FILE *fp, int off ) { if ( fseek(fp, off+LENGTH_OFF, SEEK_SET ) != 0 ) return; if (fread(&m_length, sizeof(m_length), 1, fp) != 1) return; m_length = ntohl(m_length); //fprintf(stderr, "len (sec): %d\n", m_length); m_bitrate = 0; m_sampleRate = 0; m_channels = 1; } taglib-extras-1.0.1/taglib-extras/audible/audibletag.cpp0000644000211100001440000001360311254453737022737 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Martin Aumueller email : aumuell@reserv.at copyright : (C) 2005 by Andy Leadbetter email : andrew.leadbetter@gmail.com (original mp4 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 * ***************************************************************************/ #include "audibletag.h" #include #include #include #include #if !defined(_WIN32) && !defined(_WIN64) #include // ntohl #else #include typedef unsigned uint32_t; #endif using namespace TagLibExtras; Audible::Tag::Tag() { m_title = TagLib::String::null; m_artist = TagLib::String::null; m_album = TagLib::String::null; m_comment = TagLib::String::null; m_genre = TagLib::String::null; m_year = 0; m_track = 0; m_userID = 0; m_tagsEndOffset = -1; } Audible::Tag::~Tag() { } bool Audible::Tag::isEmpty() const { return m_title == TagLib::String::null && m_artist == TagLib::String::null && m_album == TagLib::String::null && m_comment == TagLib::String::null && m_genre == TagLib::String::null && m_year == 0 && m_track == 0 && m_userID == 0; } void Audible::Tag::duplicate(const Tag *source, Tag *target, bool overwrite) { // No nonstandard information stored yet TagLib::Tag::duplicate(source, target, overwrite); } #define OFF_PRODUCT_ID 197 #define OFF_TAGS 189 void Audible::Tag::readTags( FILE *fp ) { char buf[1023]; if ( fseek(fp, OFF_PRODUCT_ID, SEEK_SET) != 0 ) return; if ( fread(buf, strlen("product_id"), 1, fp) != 1 ) return; if(memcmp(buf, "product_id", strlen("product_id"))) { buf[20]='\0'; fprintf(stderr, "no valid Audible aa file: %s\n", buf); return; } // Now parse tag. fseek(fp, OFF_TAGS, SEEK_SET); char *name = 0, *value = 0; m_tagsEndOffset = OFF_TAGS; bool lasttag = false; while(!lasttag) { lasttag = !readTag(fp, &name, &value); if(!strcmp(name, "title")) { m_title = TagLib::String(value, TagLib::String::Latin1); } else if(!strcmp(name, "author")) { m_artist = TagLib::String(value, TagLib::String::Latin1); } else if(!strcmp(name, "long_description")) { m_comment = TagLib::String(value, TagLib::String::Latin1); } else if(!strcmp(name, "description")) { if( m_comment.isNull() ) m_comment = TagLib::String(value, TagLib::String::Latin1); } else if(!strcmp(name, "pubdate")) { m_year = 0; char *p = value ? strrchr(value, '-') : 0; if(p) m_year = strtol(p+1, NULL, 10); } else if(!strcmp(name, "user_id")) { m_userID = value ? strtol(value, NULL, 10) : -1; } delete[] name; name = 0; delete[] value; value = 0; } m_album = TagLib::String("", TagLib::String::Latin1); m_track = 0; m_genre = TagLib::String("Audiobook", TagLib::String::Latin1); } bool Audible::Tag::readTag( FILE *fp, char **name, char **value) { // arbitrary value that has to be smaller than 2^32-1 and that should be large enough for all tags const uint32_t maxtaglen = 100000; uint32_t nlen; if ( fread(&nlen, sizeof(nlen), 1, fp) != 1 ) return false; nlen = ntohl(nlen); //fprintf(stderr, "tagname len=%x\n", (unsigned)nlen); if(nlen > maxtaglen) return false; *name = new char[nlen+1]; if (!*name) return false; (*name)[nlen] = '\0'; uint32_t vlen; if ( fread(&vlen, sizeof(vlen), 1, fp) != 1 ) { delete [] *name; *name = 0; return false; } vlen = ntohl(vlen); if (vlen > maxtaglen) { delete [] *name; *name = 0; return false; } //fprintf(stderr, "tag len=%x\n", (unsigned)vlen); if ( fread(*name, nlen, 1, fp) != 1 ) { delete [] *name; *name = 0; return false; } *value = new char[vlen+1]; if (!*value) { delete [] *name; *name = 0; return false; } (*value)[vlen] = '\0'; if ( fread(*value, vlen, 1, fp) != 1 ) { delete [] *value; *value = 0; return false; } char lasttag; if ( fread(&lasttag, 1, 1, fp) != 1 ) return false; //fprintf(stderr, "%s: \"%s\"\n", *name, *value); m_tagsEndOffset += 2 * 4 + nlen + vlen + 1; return !lasttag; } int Audible::Tag::getTagsEndOffset() { return m_tagsEndOffset; } taglib-extras-1.0.1/taglib-extras/audible/audibletag.h0000644000211100001440000001664511254453737022415 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Martin Aumueller email : aumuell@reserv.at copyright : (C) 2005 by Andy Leadbetter email : andrew.leadbetter@gmail.com (original mp4 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 * ***************************************************************************/ #ifndef TAGLIB_AUDIBLETAG_H #define TAGLIB_AUDIBLETAG_H #include #include namespace TagLibExtras { namespace Audible { /*! * This implements the generic TagLib::Tag API */ class TAGLIB_EXTRAS_EXPORT Tag : public TagLib::Tag { public: Tag(); /*! * read tags from the aa file. */ void readTags( FILE *file ); /*! * Destroys this AudibleTag instance. */ virtual ~Tag(); /*! * Returns the track name; if no track name is present in the tag * TagLib::String::null will be returned. */ virtual TagLib::String title() const { return m_title; } /*! * Returns the artist name; if no artist name is present in the tag * TagLib::String::null will be returned. */ virtual TagLib::String artist() const { return m_artist; } /*! * Returns the album name; if no album name is present in the tag * TagLib::String::null will be returned. */ virtual TagLib::String album() const { return m_album; } /*! * Returns the track comment; if no comment is present in the tag * TagLib::String::null will be returned. */ virtual TagLib::String comment() const { return m_comment; } /*! * Returns the genre name; if no genre is present in the tag TagLib::String::null * will be returned. */ virtual TagLib::String genre() const { return m_genre; } /*! * Returns the year; if there is no year set, this will return 0. */ virtual TagLib::uint year() const { return m_year; } /*! * Returns the track number; if there is no track number set, this will * return 0. */ virtual TagLib::uint track() const { return m_track; } /*! * Returns the user id for this file. */ virtual TagLib::uint userID() const { return m_userID; } /*! * Sets the title to \a s. If \a s is TagLib::String::null then this value will be * cleared. */ virtual void setTitle(const TagLib::String &s) { m_title = s; } /*! * Sets the artist to \a s. If \a s is TagLib::String::null then this value will be * cleared. */ virtual void setArtist(const TagLib::String &s) { m_artist = s; } /*! * Sets the album to \a s. If \a s is TagLib::String::null then this value will be * cleared. */ virtual void setAlbum(const TagLib::String &s) { m_album = s; } /*! * Sets the album to \a s. If \a s is TagLib::String::null then this value will be * cleared. */ virtual void setComment(const TagLib::String &s) { m_comment = s; } /*! * Sets the genre to \a s. If \a s is TagLib::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 TagLib::String &s) { m_genre = s; } /*! * Sets the year to \a i. If \a s is 0 then this value will be cleared. */ virtual void setYear(TagLib::uint i) { m_year = i; } /*! * Sets the track to \a i. If \a s is 0 then this value will be cleared. */ virtual void setTrack(TagLib::uint i) { m_track = 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; /*! * Copies the generic data from one tag to another. * * \note This will not 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); virtual void setUserID(TagLib::uint id) { m_userID = id; } int getTagsEndOffset(); protected: TagLib::String m_title; TagLib::String m_artist; TagLib::String m_album; TagLib::String m_comment; TagLib::String m_genre; TagLib::uint m_year; TagLib::uint m_track; TagLib::uint m_userID; bool readTag( FILE *fp, char **name, char **value); int m_tagsEndOffset; }; } } #endif taglib-extras-1.0.1/taglib-extras/audible/audiblefile.h0000644000211100001440000000702311254453737022547 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2005 by Martin Aumueller email : aumuell@reserv.at copyright : (C) 2005 by Andy Leadbetter email : andrew.leadbetter@gmail.com (original mp4 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 * ***************************************************************************/ #ifndef TAGLIB_AUDIBLEFILE_H #define TAGLIB_AUDIBLEFILE_H #include #include #include "audibleproperties.h" #include "audibletag.h" namespace TagLibExtras { namespace Audible { class Tag; class TAGLIB_EXTRAS_EXPORT File : public TagLib::File { public: /*! * Contructs a Audible 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. */ explicit File(TagLib::FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average, FILE *fp=NULL); /*! * Destroys this instance of the File. */ virtual ~File(); virtual TagLib::Tag *tag() const; /*! * Returns the Audible::Properties for this file. If no audio properties * were read then this will return a null pointer. */ virtual Audible::Properties *audioProperties() const; /*! * Save the file. * This is the same as calling save(AllTags); * * \note As of now, saving Audible tags is not supported. */ virtual bool save(); void read(bool readProperties, Properties::ReadStyle propertiesStyle); Audible::Tag *getAudibleTag() const; bool isAudibleFile() const; protected: File(const File &); File &operator=(const File &); bool isOpen(); Audible::Tag *audibletag; Audible::Properties *properties; FILE *audiblefile; }; } } #endif taglib-extras-1.0.1/taglib-extras/tfile_helper.h0000644000211100001440000000545611255706776021354 0ustar jefferaiusers/*************************************************************************** copyright : (C) 2007 by Shane King email : kde@dontletsstart.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, or (at your option) any later version, 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 TFILE_HELPER_H #define TFILE_HELPER_H #include #include "taglib-extras_export.h" // need to be able to deal with either the straight forward char version // or a char/wchar hybrid version of the filename #ifdef COMPLEX_TAGLIB_FILENAME #define CheckExtension(filename, extension) \ (static_cast(filename) == 0 \ ? CheckExtensionImpl(static_cast(filename), L##extension) \ : CheckExtensionImpl(static_cast(filename), extension)) #define TagLibOpenFile(filename, mode) \ (static_cast(filename) == 0 \ ? _wfopen(filename, L##mode) \ : fopen(filename, mode)) #include inline std::basic_ostream &operator<<(std::basic_ostream &stream, TagLib::FileName fileName) { if (static_cast(fileName) == 0) stream << static_cast(fileName); else stream << static_cast(fileName); return stream; } #else #define CheckExtension(filename, extension) CheckExtensionImpl(filename, extension) #define TagLibOpenFile(filename, mode) fopen(filename, mode) #endif bool TAGLIB_EXTRAS_EXPORT CheckExtensionImpl(const char *fileName, const char *extension); bool TAGLIB_EXTRAS_EXPORT CheckExtensionImpl(const wchar_t *fileName, const wchar_t *extension); #endif // TFILE_HELPER_H taglib-extras-1.0.1/AUTHORS0000644000211100001440000000017511160173366015020 0ustar jefferaiusersAuthors are noted in individual files. Please send all questions/patches/etc. to amarok@kde.org, NOT to individual authors! taglib-extras-1.0.1/taglib-extras-config.cmake0000644000211100001440000000122311254463245020760 0ustar jefferaiusers#!/bin/sh usage() { echo "usage: $0 [OPTIONS]" cat << EOH options: [--libs] [--cflags] [--version] [--prefix] EOH exit 1; } prefix=${CMAKE_INSTALL_PREFIX} exec_prefix=${CMAKE_INSTALL_PREFIX} libdir=${LIB_INSTALL_DIR} includedir=${INCLUDE_INSTALL_DIR} flags="" if test $# -eq 0 ; then usage fi while test $# -gt 0 do case $1 in --libs) flags="$flags -L$libdir -ltag-extras" ;; --cflags) flags="$flags -I$includedir/taglib-extras" ;; --version) echo 1.0 ;; --prefix) echo $prefix ;; *) echo "$0: unknown option $1" echo usage ;; esac shift done if test -n "$flags" then echo $flags fi taglib-extras-1.0.1/COPYING.LGPL0000644000211100001440000006133411160173366015544 0ustar jefferaiusers GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330 Boston, MA 02111-1307, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! taglib-extras-1.0.1/ChangeLog0000644000211100001440000000220311255770174015521 0ustar jefferaiusersTaglib-Extras ChangeLog ================ (C) 2009 Jeff Mitchell and the Amarok authors VERSION 1.0.1: BUGFIXES: * Fix some exports. Thanks to Patrick Spendrin for the fix. VERSION 1.0.0: CHANGES: * Compatible with TagLib 1.6. Removes redundant formats. Also changes the namespace to remove potential compatibility problems with TagLib in the future. VERSION 0.1.7: BUGFIXES: * Fix issue where old mp4 files written by iTunes used ID3v1-style numeric genre identifiers and were not properly read. VERSION 0.1.6: BUGFIXES: * Fix crash on corrupted mp4 files. Fix in upstream TagLib. (BR 197782) VERSION 0.1.5: BUGFIXES: * Fix mp4 file-handling crash. Fix in upstream TagLib. (BR 198730) VERSION 0.1.4: BUGFIXES: * Fix possible mp4 file-handling crash. Fix in upstream TagLib. Thanks to Tanguy Krotoff. * Fix compilation on Windows with MSVC++ 2005 and greater. Thanks to Tanguy Krotoff. VERSION 0.1.3: BUGFIXES: * Fix mp4 file-handling crash on some mp4 files. Fix in upstream TagLib. (BR 191021) VERSION 0.1.2: FEATURES: * Initial release on most distributions. taglib-extras-1.0.1/config-taglib-extras.h.cmake0000644000211100001440000000066011163012314021174 0ustar jefferaiusers/* config.h. Generated by cmake from config.h.cmake */ /* The size of a `int', as computed by sizeof. */ #define SIZEOF_INT ${SIZEOF_INT} /* The size of a `long', as computed by sizeof. */ #define SIZEOF_LONG ${SIZEOF_LONG} /* is 1 if the system has stdint.h */ #cmakedefine HAVE_STDINT_H 1 /* is 1 if the system has strings.h */ #cmakedefine HAVE_STRINGS_H 1 /* is 1 if the system has unistd.h */ #cmakedefine HAVE_UNISTD_H 1