Commits

Ivan Andrianov committed 4d28298 Merge

Merge with default.

Comments (0)

Files changed (45)

 include(${QT_USE_FILE})
 set(CMAKE_AUTOMOC 1)
 
-find_package(PythonInterp 2.7 REQUIRED)
-find_package(PythonLibs 2.7 REQUIRED)
-include_directories(${PYTHON_INCLUDE_DIRS})
-
-execute_process(COMMAND ${PYTHON_EXECUTABLE} --version
-                ERROR_VARIABLE PYTHON_VERSION_FULL)
-string(REGEX MATCH "[0-9]+\\.[0-9]+" PYTHON_VERSION "${PYTHON_VERSION_FULL}")
-
-find_package(SIP 4.13 REQUIRED)
-find_package(PyQt4 4.8 REQUIRED)
-include_directories(${SIP_INCLUDE_DIR})
-
 find_package(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL)
 find_package(FLAC)
 find_package(Lame)
   set(FFTRANSCODER_DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
   set(FFTRANSCODER_PLUGIN_INSTALL_DIR
       ${FFTRANSCODER_BIN_INSTALL_DIR}/plugins)
-  set(FFTRANSCODER_PYTHON_INSTALL_DIR
-    ${FFTRANSCODER_LIB_INSTALL_DIR}/fftranscoder)
 else(WIN32)
   set(CMAKE_CXX_FLAGS "-fvisibility=hidden")
   set(FFTRANSCODER_BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin)
   set(FFTRANSCODER_DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/fftranscoder)
   set(FFTRANSCODER_PLUGIN_INSTALL_DIR
       ${FFTRANSCODER_LIB_INSTALL_DIR}/fftranscoder/plugins)
-  set(FFTRANSCODER_PYTHON_INSTALL_DIR
-      ${FFTRANSCODER_LIB_INSTALL_DIR}/python${PYTHON_VERSION}/site-packages/fftranscoder)
 endif(WIN32)
 
-add_subdirectory(pysrc/fftranscoder)
 add_subdirectory(src/codecs)
+add_subdirectory(src/ui)
 
-install(FILES fftranscoder.py DESTINATION ${FFTRANSCODER_BIN_INSTALL_DIR})
+add_executable(fftranscoder src/main.cpp)
+
+target_link_libraries(fftranscoder fftranscoder_ui ${QT_QTGUI_LIBRARY})
+
+install(TARGETS fftranscoder DESTINATION ${FFTRANSCODER_BIN_INSTALL_DIR})
 
 if(WIN32)
   install(FILES license.rtf DESTINATION ${FFTRANSCODER_DATA_INSTALL_DIR})

cmake/FindPyQt.py

-# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
-#
-# Redistribution 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.
-
-import PyQt4.pyqtconfig
-
-pyqtcfg = PyQt4.pyqtconfig.Configuration()
-print("pyqt_version:%06.0x" % pyqtcfg.pyqt_version)
-print("pyqt_version_str:%s" % pyqtcfg.pyqt_version_str)
-
-pyqt_version_tag = ""
-in_t = False
-for item in pyqtcfg.pyqt_sip_flags.split(' '):
-    if item=="-t":
-        in_t = True
-    elif in_t:
-        if item.startswith("Qt_4"):
-            pyqt_version_tag = item
-    else:
-        in_t = False
-print("pyqt_version_tag:%s" % pyqt_version_tag)
-
-print("pyqt_sip_dir:%s" % pyqtcfg.pyqt_sip_dir)
-print("pyqt_sip_flags:%s" % pyqtcfg.pyqt_sip_flags)

cmake/FindPyQt4.cmake

-# Copyright (c) 2007-2008, Simon Edwards <simon@simonzone.com>
-#
-# Redistribution 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.
-
-# PyQt4 website: http://www.riverbankcomputing.co.uk/pyqt/index.php
-#
-# Find the installed version of PyQt4. FindPyQt4 should only be called after
-# Python has been found.
-#
-# This file defines the following variables:
-#
-# PYQT4_VERSION - The version of PyQt4 found expressed as a 6 digit hex number
-#     suitable for comparision as a string
-#
-# PYQT4_VERSION_STR - The version of PyQt4 as a human readable string.
-#
-# PYQT4_VERSION_TAG - The PyQt version tag using by PyQt's sip files.
-#
-# PYQT4_SIP_DIR - The directory holding the PyQt4 .sip files.
-#
-# PYQT4_SIP_FLAGS - The SIP flags used to build PyQt.
-
-IF(EXISTS PYQT4_VERSION)
-  # Already in cache, be silent
-  SET(PYQT4_FOUND TRUE)
-ELSE(EXISTS PYQT4_VERSION)
-
-  FIND_FILE(_find_pyqt_py FindPyQt.py PATHS ${CMAKE_MODULE_PATH})
-
-  EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} OUTPUT_VARIABLE pyqt_config)
-  IF(pyqt_config)
-    STRING(REGEX REPLACE "^pyqt_version:([^\n]+).*$" "\\1" PYQT4_VERSION ${pyqt_config})
-    STRING(REGEX REPLACE ".*\npyqt_version_str:([^\n]+).*$" "\\1" PYQT4_VERSION_STR ${pyqt_config})
-    STRING(REGEX REPLACE ".*\npyqt_version_tag:([^\n]+).*$" "\\1" PYQT4_VERSION_TAG ${pyqt_config})
-    STRING(REGEX REPLACE ".*\npyqt_sip_dir:([^\n]+).*$" "\\1" PYQT4_SIP_DIR ${pyqt_config})
-    STRING(REGEX REPLACE ".*\npyqt_sip_flags:([^\n]+).*$" "\\1" PYQT4_SIP_FLAGS ${pyqt_config})
-
-    SET(PYQT4_FOUND TRUE)
-  ENDIF(pyqt_config)
-
-  IF(PYQT4_FOUND)
-    IF(NOT PYQT4_FIND_QUIETLY)
-      MESSAGE(STATUS "Found PyQt4 version: ${PYQT4_VERSION_STR}")
-    ENDIF(NOT PYQT4_FIND_QUIETLY)
-  ELSE(PYQT4_FOUND)
-    IF(PYQT4_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "Could not find Python")
-    ENDIF(PYQT4_FIND_REQUIRED)
-  ENDIF(PYQT4_FOUND)
-
-ENDIF(EXISTS PYQT4_VERSION)

cmake/FindSIP.cmake

-# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
-#
-# Redistribution 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.
-
-# SIP website: http://www.riverbankcomputing.co.uk/sip/index.php
-#
-# Find the installed version of SIP. FindSIP should be called after Python
-# has been found.
-#
-# This file defines the following variables:
-#
-# SIP_VERSION - The version of SIP found expressed as a 6 digit hex number
-#     suitable for comparision as a string.
-#
-# SIP_VERSION_STR - The version of SIP found as a human readable string.
-#
-# SIP_EXECUTABLE - Path and filename of the SIP command line executable.
-#
-# SIP_INCLUDE_DIR - Directory holding the SIP C++ header file.
-#
-# SIP_DEFAULT_SIP_DIR - Default directory where .sip files should be installed
-#     into.
-
-IF(SIP_VERSION)
-  # Already in cache, be silent
-  SET(SIP_FOUND TRUE)
-ELSE(SIP_VERSION)
-
-  FIND_FILE(_find_sip_py FindSIP.py PATHS ${CMAKE_MODULE_PATH})
-
-  EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_sip_py} OUTPUT_VARIABLE sip_config)
-  IF(sip_config)
-    STRING(REGEX REPLACE "^sip_version:([^\n]+).*$" "\\1" SIP_VERSION ${sip_config})
-    STRING(REGEX REPLACE ".*\nsip_version_str:([^\n]+).*$" "\\1" SIP_VERSION_STR ${sip_config})
-    STRING(REGEX REPLACE ".*\nsip_bin:([^\n]+).*$" "\\1" SIP_EXECUTABLE ${sip_config})
-    STRING(REGEX REPLACE ".*\ndefault_sip_dir:([^\n]+).*$" "\\1" SIP_DEFAULT_SIP_DIR ${sip_config})
-    STRING(REGEX REPLACE ".*\nsip_inc_dir:([^\n]+).*$" "\\1" SIP_INCLUDE_DIR ${sip_config})
-    SET(SIP_FOUND TRUE)
-  ENDIF(sip_config)
-
-  IF(SIP_FOUND)
-    IF(NOT SIP_FIND_QUIETLY)
-      MESSAGE(STATUS "Found SIP version: ${SIP_VERSION_STR}")
-    ENDIF(NOT SIP_FIND_QUIETLY)
-  ELSE(SIP_FOUND)
-    IF(SIP_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "Could not find SIP")
-    ENDIF(SIP_FIND_REQUIRED)
-  ENDIF(SIP_FOUND)
-
-ENDIF(SIP_VERSION)

cmake/FindSIP.py

-# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
-#
-# Redistribution 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.
-
-import sys
-import sipconfig
-
-sipcfg = sipconfig.Configuration()
-print("sip_version:%06.0x" % sipcfg.sip_version)
-print("sip_version_str:%s" % sipcfg.sip_version_str)
-print("sip_bin:%s" % sipcfg.sip_bin)
-print("default_sip_dir:%s" % sipcfg.default_sip_dir)
-print("sip_inc_dir:%s" % sipcfg.sip_inc_dir)

fftranscoder.py

-#!/usr/bin/python
-
-# Copyright (C) 2011 by Ivan Andrianov
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-import sys
-
-import sip
-sip.setapi('QString', 2)
-sip.setapi('QVariant', 2)
-
-from PyQt4 import QtGui
-
-from fftranscoder import ui
-
-application = QtGui.QApplication(sys.argv)
-application.setWindowIcon(QtGui.QIcon.fromTheme('applications-multimedia'))
-mainWindow = ui.MainWindow()
-mainWindow.show()
-sys.exit(application.exec_())

pack/fftranscoder.wxs

-<?xml version='1.0' encoding='utf-8'?>
-
-<!--
-#################################################################################
-# Copyright (C) 2011 by Ivan Andrianov                                          #
-#                                                                               #
-# Permission is hereby granted, free of charge, to any person obtaining a copy  #
-# of this software and associated documentation files (the "Software"), to deal #
-# in the Software without restriction, including without limitation the rights  #
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell     #
-# copies of the Software, and to permit persons to whom the Software is         #
-# furnished to do so, subject to the following conditions:                      #
-#                                                                               #
-# The above copyright notice and this permission notice shall be included in    #
-# all copies or substantial portions of the Software.                           #
-#                                                                               #
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR    #
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,      #
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE   #
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER        #
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN     #
-# THE SOFTWARE.                                                                 #
-#################################################################################
--->
-
-<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
-    <?define GUID = b5deaf74-05af-420e-b113-86ab4e5615ed ?>
-    <?define GUID-2 = 24509cb1-0883-4771-b39c-09f8f8e3a29e ?>
-    <?define GUID-3 = 0273630c-aaa1-48cc-9a27-033788b97da5 ?>
-    <?define GUID-4 = e00b1f5c-93e8-4a3f-a636-a1386f832dbf ?>
-    <?define GUID-5 = 95f6d818-c1a9-4a6c-a5dd-9b1770b42766 ?>
-    <?define GUID-6 = 38e7e1ed-443b-4f94-b09f-ccd821c799e9 ?>
-    <?define GUID-7 = a5407838-a4d7-4314-8711-e9391ee37820 ?>
-    <?define GUID-8 = 41f5d8ef-5b36-43b9-8962-6a93748b07f0 ?>
-    <?define GUID-9 = 09681566-120f-4f9d-bc07-f642552e375f ?>
-    <?define GUID-10 = 2a951e16-1c87-4141-ac60-47c4dc6ee52a ?>
-    <?define GUID-11 = e008104d-79a2-44fd-a22e-f6859c43064a ?>
-    <?define GUID-12 = cffb152d-5438-44b2-ab2d-a2cbc4033b03 ?>
-    <?define GUID-13 = 31ae2c86-1a02-4a6b-9e7e-6dd832d2a59b ?>
-    <?define GUID-14 = ff9f1160-a18d-47cc-9b58-242b574f0d02 ?>
-    <?define GUID-15 = 00d88575-8108-4876-b2ca-301975819696 ?>
-    <?define GUID-16 = adfe3b13-bd24-43f3-83ea-52206d3b3067 ?>
-    <?define GUID-17 = a3dabc5f-79e0-4e8c-9235-cac9b36c6398 ?>
-    <?define GUID-18 = e6cfd0bc-b565-41e7-968d-df606960cb0b ?>
-    <?define GUID-19 = 900a8b93-b5ec-4c74-9fe3-f1fe7900b56f ?>
-    <?define GUID-20 = fc828969-e3a3-4ec1-862e-f2eec436016c ?>
-    <?define GUID-21 = e7fc9f1b-b2e6-489d-8128-de0fc7fd4082 ?>
-    <?define GUID-22 = 79805ad4-a5d8-484b-a221-bcffeb9bb09a ?>
-    <?define GUID-23 = b2dbc878-2830-437b-9270-5026a675465a ?>
-
-    <?define Name = FFTranscoder ?>
-    <?define Manufacturer = Ivan Andrianov ?>
-    <?define Version = 1.1 ?>
-
-    <Product Id='$(var.GUID)' Name='$(var.Name) $(var.Version)'
-             Language='1033' Version='$(var.Version).0.0'
-             Manufacturer='$(var.Manufacturer)' UpgradeCode='$(var.GUID)'>
-        <Package Description='Multimedia transcoder based on FFmpeg'
-                 Manufacturer='$(var.Manufacturer)'
-                 InstallerVersion='200' Compressed='yes' />
- 
-        <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
- 
-        <Directory Id='TARGETDIR' Name='SourceDir'>
-            <Directory Id='ProgramFilesFolder' Name='PFiles'>
-                <Directory Id='INSTALLDIR' Name='$(var.Name)'>
-                    <Component Id='fftranscoder' Guid='$(var.GUID-2)'>
-                        <File Id='fftranscoder' Name='fftranscoder.exe' DiskId='1'
-                              Source='fftranscoder.exe' KeyPath='yes'>
-                            <Shortcut Id='ProgramShortcut' Directory='ProgramMenuDir'
-                                      Name='$(var.Name)' Advertise='yes' />
-                        </File>
-                    </Component>
-                    
-                    <Component Id='bz2' Guid='$(var.GUID-3)'>
-                        <File Id='bz2' Name='bz2.pyd' DiskId='1'
-                              Source='bz2.pyd' KeyPath='yes' />
-                    </Component>
-                    <Component Id='library' Guid='$(var.GUID-4)'>
-                        <File Id='library' Name='library.zip' DiskId='1'
-                              Source='library.zip' KeyPath='yes' />
-                    </Component>
-                    <Component Id='python27' Guid='$(var.GUID-5)'>
-                        <File Id='python27' Name='python27.dll' DiskId='1'
-                              Source='python27.dll' KeyPath='yes' />
-                    </Component>
-                    <Component Id='select' Guid='$(var.GUID-6)'>
-                        <File Id='select' Name='select.pyd' DiskId='1'
-                              Source='select.pyd' KeyPath='yes' />
-                    </Component>
-                    <Component Id='unicodedata' Guid='$(var.GUID-7)'>
-                        <File Id='unicodedata' Name='unicodedata.pyd' DiskId='1'
-                              Source='unicodedata.pyd' KeyPath='yes' />
-                    </Component>
-                    <Component Id='w9xpopen' Guid='$(var.GUID-8)'>
-                        <File Id='w9xpopen' Name='w9xpopen.exe' DiskId='1'
-                              Source='w9xpopen.exe' KeyPath='yes' />
-                    </Component>
-                    <Component Id='_hashlib' Guid='$(var.GUID-9)'>
-                        <File Id='_hashlib' Name='_hashlib.pyd' DiskId='1'
-                              Source='_hashlib.pyd' KeyPath='yes' />
-                    </Component>
-                    
-                    <Component Id='QtCore4' Guid='$(var.GUID-10)'>
-                        <File Id='QtCore4' Name='QtCore4.dll' DiskId='1'
-                              Source='QtCore4.dll' KeyPath='yes' />
-                    </Component>
-                    <Component Id='QtGui4' Guid='$(var.GUID-11)'>
-                        <File Id='QtGui4' Name='QtGui4.dll' DiskId='1'
-                              Source='QtGui4.dll' KeyPath='yes' />
-                    </Component>
-
-                    <Component Id='PyQt4.QtCore' Guid='$(var.GUID-12)'>
-                        <File Id='PyQt4.QtCore' Name='PyQt4.QtCore.pyd' DiskId='1'
-                              Source='PyQt4.QtCore.pyd' KeyPath='yes' />
-                    </Component>
-                    <Component Id='PyQt4.QtGui' Guid='$(var.GUID-13)'>
-                        <File Id='PyQt4.QtGui' Name='PyQt4.QtGui.pyd' DiskId='1'
-                              Source='PyQt4.QtGui.pyd' KeyPath='yes' />
-                    </Component>
-                    <Component Id='sip' Guid='$(var.GUID-14)'>
-                        <File Id='sip' Name='sip.pyd' DiskId='1'
-                              Source='sip.pyd' KeyPath='yes' />
-                    </Component>
-                    
-                    <Component Id='avcodec' Guid='$(var.GUID-15)'>
-                        <File Id='avcodec' Name='avcodec-53.dll' DiskId='1'
-                              Source='avcodec-53.dll' KeyPath='yes' />
-                    </Component>
-                    <Component Id='avdevice' Guid='$(var.GUID-16)'>
-                        <File Id='avdevice' Name='avdevice-53.dll' DiskId='1'
-                              Source='avdevice-53.dll' KeyPath='yes' />
-                    </Component>
-                    <Component Id='avfilter' Guid='$(var.GUID-17)'>
-                        <File Id='avfilter' Name='avfilter-2.dll' DiskId='1'
-                              Source='avfilter-2.dll' KeyPath='yes' />
-                    </Component>
-                    <Component Id='avformat' Guid='$(var.GUID-18)'>
-                        <File Id='avformat' Name='avformat-53.dll' DiskId='1'
-                              Source='avformat-53.dll' KeyPath='yes' />
-                    </Component>
-                    <Component Id='avutil' Guid='$(var.GUID-19)'>
-                        <File Id='avutil' Name='avutil-51.dll' DiskId='1'
-                              Source='avutil-51.dll' KeyPath='yes' />
-                    </Component>
-                    <Component Id='ffmpeg' Guid='$(var.GUID-20)'>
-                        <File Id='ffmpeg' Name='ffmpeg.exe' DiskId='1'
-                              Source='ffmpeg.exe' KeyPath='yes' />
-                    </Component>
-                    <Component Id='postproc' Guid='$(var.GUID-21)'>
-                        <File Id='postproc' Name='postproc-51.dll' DiskId='1'
-                              Source='postproc-51.dll' KeyPath='yes' />
-                    </Component>
-                    <Component Id='swscale' Guid='$(var.GUID-22)'>
-                        <File Id='swscale' Name='swscale-0.dll' DiskId='1'
-                              Source='swscale-0.dll' KeyPath='yes' />
-                    </Component>
-                </Directory>
-            </Directory>
-       
-            <Directory Id='ProgramMenuFolder' Name='Programs'>
-                <Directory Id='ProgramMenuDir' Name='$(var.Name)'>
-                    <Component Id='ProgramMenuDir' Guid='$(var.GUID-23)'>
-                        <RemoveFolder Id='ProgramMenuDir' On='uninstall' />
-                        <RegistryValue Root='HKCU' Key='Software\$(var.Manufacturer)\$(var.Name)'
-                                       Type='string' Value='' KeyPath='yes' />
-                        <Shortcut Id='UninstallShortcut' Name='Uninstall $(var.Name)'
-                                  Target='[SystemFolder]msiexec.exe' Arguments='/x [ProductCode]'
-                                  Description='Uninstalls $(var.Name)' />
-                    </Component>
-                </Directory>
-            </Directory>
-        </Directory>
-        
-        <Feature Id='CompleteFeature' Title='$(var.Name)' Description='The complete package'
-                 Level='1' ConfigurableDirectory='INSTALLDIR'  Absent='disallow'>
-            <ComponentRef Id='fftranscoder' />
-            
-            <ComponentRef Id='bz2' />
-            <ComponentRef Id='library' />
-            <ComponentRef Id='python27' />
-            <ComponentRef Id='select' />
-            <ComponentRef Id='unicodedata' />
-            <ComponentRef Id='w9xpopen' />
-            <ComponentRef Id='_hashlib' />
-            
-            <ComponentRef Id='QtCore4' />
-            <ComponentRef Id='QtGui4' />
-            
-            <ComponentRef Id='PyQt4.QtCore' />
-            <ComponentRef Id='PyQt4.QtGui' />
-            <ComponentRef Id='sip' />
-            
-            <ComponentRef Id='avcodec' />
-            <ComponentRef Id='avdevice' />
-            <ComponentRef Id='avfilter' />
-            <ComponentRef Id='avformat' />
-            <ComponentRef Id='avutil' />
-            <ComponentRef Id='ffmpeg' />
-            <ComponentRef Id='postproc' />
-            <ComponentRef Id='swscale' />
-            
-            <ComponentRef Id='ProgramMenuDir' />
-        </Feature>
-        
-        <WixVariable Id='WixUILicenseRtf' Value='..\license.rtf' />
-        <Property Id='WIXUI_INSTALLDIR' Value='INSTALLDIR' />
-        <UIRef Id='WixUI_InstallDir' />
-        <UIRef Id='WixUI_ErrorProgressText' />
-    </Product>
-</Wix>

pysrc/fftranscoder/CMakeLists.txt

-# Copyright (C) 2012 by Ivan Andrianov
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-set(FFTRANSCODER_SRCS_PYTHON
-  __init__.py
-  info.py
-)
-
-install(FILES ${FFTRANSCODER_SRCS_PYTHON}
-        DESTINATION ${FFTRANSCODER_PYTHON_INSTALL_DIR})
-
-add_subdirectory(codecs)
-add_subdirectory(ui)

pysrc/fftranscoder/__init__.py

-

pysrc/fftranscoder/codecs/CMakeLists.txt

-# Copyright (C) 2012 by Ivan Andrianov
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-set(FFTRANSCODER_CODECS_SRCS_PYTHON
-  __init__.py
-)
-
-install(FILES ${FFTRANSCODER_CODECS_SRCS_PYTHON}
-        DESTINATION ${FFTRANSCODER_PYTHON_INSTALL_DIR}/codecs)
-
-set(FFTRANSCODER_CODECS_SRCS_SIP
-  wrappermod.sip
-)
-
-set(FFTRANSCODER_CODECS_SRCS_SIP_DEPENDS
-  decoder.sip
-  decoderfinder.sip
-  decoderplugin.sip
-  encoder.sip
-  encoderplugin.sip
-  frame.sip
-  global.sip
-  pluginloader.sip
-  streaminfo.sip
-  tagblock.sip
-  transcoder.sip
-)
-
-set(FFTRANSCODER_CODECS_WRAPPER_SRC_CXX
-  ${CMAKE_CURRENT_BINARY_DIR}/sipAPIwrapper.h
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrappercmodule.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperFFTranscoder.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperFFTranscoderCodecs.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperFFTranscoderCodecsDecoder.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperFFTranscoderCodecsDecoderFinder.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperFFTranscoderCodecsDecoderPlugin.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperFFTranscoderCodecsEncoder.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperFFTranscoderCodecsEncoderPlugin.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperFFTranscoderCodecsFrame.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperFFTranscoderCodecsPluginLoader.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperFFTranscoderCodecsStreamInfo.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperFFTranscoderCodecsTagBlock.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperFFTranscoderCodecsTranscoder.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperQList0101FFTranscoderCodecsDecoderPlugin.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/sipwrapperQList0101FFTranscoderCodecsEncoderPlugin.cpp
-)
-
-string(REGEX MATCHALL "[^ ]+"
-  FFTRANSCODER_CODECS_WRAPPER_SIP_FLAGS ${PYQT4_SIP_FLAGS})
-add_custom_command(OUTPUT ${FFTRANSCODER_CODECS_WRAPPER_SRC_CXX}
-  COMMAND ${SIP_EXECUTABLE} ${FFTRANSCODER_CODECS_WRAPPER_SIP_FLAGS}
-  -I ${SIP_DEFAULT_SIP_DIR} -I ${CMAKE_CURRENT_SOURCE_DIR}
-  -c ${CMAKE_CURRENT_BINARY_DIR} ${FFTRANSCODER_CODECS_SRCS_SIP}
-  DEPENDS ${FFTRANSCODER_CODECS_SRCS_SIP_DEPENDS})
-
-python_add_module(wrapper ${FFTRANSCODER_CODECS_WRAPPER_SRC_CXX})
-
-target_link_libraries(wrapper fftranscoder_codecs ${PYTHON_LIBRARIES}
-                      ${QT_QTCORE_LIBRARY})
-
-install(TARGETS wrapper
-        LIBRARY DESTINATION ${FFTRANSCODER_PYTHON_INSTALL_DIR}/codecs)

pysrc/fftranscoder/codecs/__init__.py

-# Copyright (C) 2012 by Ivan Andrianov
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-from fftranscoder.codecs import wrapper
-
-Decoder = wrapper.FFTranscoder.Codecs.Decoder
-DecoderFinder = wrapper.FFTranscoder.Codecs.DecoderFinder
-DecoderPlugin = wrapper.FFTranscoder.Codecs.DecoderPlugin
-Encoder = wrapper.FFTranscoder.Codecs.Encoder
-EncoderPlugin = wrapper.FFTranscoder.Codecs.EncoderPlugin
-Frame = wrapper.FFTranscoder.Codecs.Frame
-PluginLoader = wrapper.FFTranscoder.Codecs.PluginLoader
-StreamInfo = wrapper.FFTranscoder.Codecs.StreamInfo
-TagBlock = wrapper.FFTranscoder.Codecs.TagBlock
-Transcoder = wrapper.FFTranscoder.Codecs.Transcoder
-version = wrapper.FFTranscoder.Codecs.version

pysrc/fftranscoder/codecs/decoder.sip

-/*
- * Copyright (C) 2012 by Ivan Andrianov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace FFTranscoder
-{
-namespace Codecs
-{
-
-class Decoder /Abstract/
-{
-
-%TypeHeaderCode
-#include <codecs/decoder.h>
-%End
-
-public:
-    virtual QString codecName() const = 0;
-    virtual uint bitRate() const = 0;
-
-    virtual FFTranscoder::Codecs::StreamInfo streamInfo() const = 0;
-
-    virtual FFTranscoder::Codecs::TagBlock tagBlock() const = 0;
-
-    virtual bool readMetaData() = 0;
-    virtual FFTranscoder::Codecs::Frame * readFrame() = 0 /Factory/;
-};
-
-};
-};

pysrc/fftranscoder/codecs/decoderfinder.sip

-/*
- * Copyright (C) 2012 by Ivan Andrianov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace FFTranscoder
-{
-namespace Codecs
-{
-
-class DecoderFinder
-{
-
-%TypeHeaderCode
-#include <codecs/decoderfinder.h>
-%End
-
-public:
-    static FFTranscoder::Codecs::Decoder * findDecoder(QString) /Factory/;
-};
-
-};
-};

pysrc/fftranscoder/codecs/decoderplugin.sip

-/*
- * Copyright (C) 2012 by Ivan Andrianov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace FFTranscoder
-{
-namespace Codecs
-{
-
-class DecoderPlugin /Abstract/
-{
-
-%TypeHeaderCode
-#include <codecs/decoderplugin.h>
-%End
-
-public:
-    virtual FFTranscoder::Codecs::Decoder *
-        createDecoder(const QString &) = 0 /Factory/;
-    virtual QString decoderName() const = 0;
-
-    virtual QString version() const = 0;
-};
-
-};
-};

pysrc/fftranscoder/codecs/encoder.sip

-/*
- * Copyright (C) 2012 by Ivan Andrianov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace FFTranscoder
-{
-namespace Codecs
-{
-
-class Encoder /Abstract/
-{
-
-%TypeHeaderCode
-#include <codecs/encoder.h>
-%End
-
-public:
-    virtual bool setQuality(uint) = 0;
-
-    virtual bool setStreamInfo(const FFTranscoder::Codecs::StreamInfo &) = 0;
-
-    virtual bool setTagBlock(const FFTranscoder::Codecs::TagBlock &) = 0;
-
-    virtual bool writeMetaData() = 0;
-    virtual bool writeFrame(const FFTranscoder::Codecs::Frame *) = 0;
-    virtual bool flush() = 0;
-};
-
-};
-};

pysrc/fftranscoder/codecs/encoderplugin.sip

-/*
- * Copyright (C) 2012 by Ivan Andrianov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace FFTranscoder
-{
-namespace Codecs
-{
-
-class EncoderPlugin /Abstract/
-{
-
-%TypeHeaderCode
-#include <codecs/encoderplugin.h>
-%End
-
-public:
-    virtual FFTranscoder::Codecs::Encoder *
-        createEncoder(const QString &) = 0 /Factory/;
-    virtual QString encoderName() const = 0;
-    virtual QString codecName() const = 0;
-    virtual QString fileNameExtension() const = 0;
-    virtual bool isLossless() const = 0;
-
-    virtual QString version() const = 0;
-};
-
-};
-};

pysrc/fftranscoder/codecs/frame.sip

-/*
- * Copyright (C) 2012 by Ivan Andrianov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace FFTranscoder
-{
-namespace Codecs
-{
-
-class Frame
-{
-
-%TypeHeaderCode
-#include <codecs/frame.h>
-%End
-
-public:
-    Frame();
-    //Frame(SIP_PYLIST, int, int) [(const qint32 *, int, int)];
-    ~Frame();
-    //SIP_PYLIST samples() const [const qint32 * ()];
-    int sampleCount() const;
-    int channelCount() const;
-
-private:
-    Frame(const FFTranscoder::Codecs::Frame &);
-};
-
-};
-};

pysrc/fftranscoder/codecs/global.sip

-/*
- * Copyright (C) 2012 by Ivan Andrianov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-%ModuleHeaderCode
-#include <codecs/global.h>
-%End
-
-namespace FFTranscoder
-{
-namespace Codecs
-{
-
-const char * version();
-
-};
-};

pysrc/fftranscoder/codecs/pluginloader.sip

-/*
- * Copyright (C) 2012 by Ivan Andrianov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace FFTranscoder
-{
-namespace Codecs
-{
-
-class PluginLoader
-{
-
-%TypeHeaderCode
-#include <codecs/pluginloader.h>
-%End
-
-public:
-    static FFTranscoder::Codecs::PluginLoader * instance();
-
-    QList<FFTranscoder::Codecs::DecoderPlugin *> decoderPlugins() const;
-    QList<FFTranscoder::Codecs::EncoderPlugin *> encoderPlugins() const;
-	
-private:
-    PluginLoader();
-    PluginLoader(const FFTranscoder::Codecs::PluginLoader &);
-    ~PluginLoader();
-};
-
-};
-};

pysrc/fftranscoder/codecs/streaminfo.sip

-/*
- * Copyright (C) 2012 by Ivan Andrianov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace FFTranscoder
-{
-namespace Codecs
-{
-
-class StreamInfo
-{
-
-%TypeHeaderCode
-#include <codecs/streaminfo.h>
-%End
-
-public:
-    StreamInfo();
-    StreamInfo(uint, uint, uint);
-    StreamInfo(const FFTranscoder::Codecs::StreamInfo &);
-    ~StreamInfo();
-
-    uint bytesPerSample() const;
-    uint sampleRate() const;
-    uint channelCount() const;
-
-    bool isEmpty() const;
-
-    void setBytesPerSample(uint);
-    void setSampleRate(uint);
-    void setChannelCount(uint);
-};
-
-};
-};

pysrc/fftranscoder/codecs/tagblock.sip

-/*
- * Copyright (C) 2012 by Ivan Andrianov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace FFTranscoder
-{
-namespace Codecs
-{
-
-class TagBlock
-{
-
-%TypeHeaderCode
-#include <codecs/tagblock.h>
-%End
-
-public:
-    TagBlock();
-    TagBlock(QString, QString, QString, uint, uint);
-    TagBlock(const FFTranscoder::Codecs::TagBlock &);
-    ~TagBlock();
-
-    QString artistName() const;
-    QString albumName() const;
-    uint year() const;
-    QString trackName() const;
-    uint trackNumber() const;
-
-    bool isEmpty() const;
-
-    void setArtistName(QString);
-    void setAlbumName(QString);
-    void setYear(uint);
-    void setTrackName(QString);
-    void setTrackNumber(uint);
-};
-
-};
-};

pysrc/fftranscoder/codecs/transcoder.sip

-/*
- * Copyright (C) 2012 by Ivan Andrianov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace FFTranscoder
-{
-namespace Codecs
-{
-
-class Transcoder : QObject, QRunnable
-{
-
-%TypeHeaderCode
-#include <codecs/transcoder.h>
-%End
-
-public:
-    Transcoder(QString, QString, FFTranscoder::Codecs::EncoderPlugin *,
-            FFTranscoder::Codecs::TagBlock = FFTranscoder::Codecs::TagBlock(),
-            uint = -1);
-
-    virtual void run();
-
-signals:
-    void finished(bool);
-};
-
-};
-};

pysrc/fftranscoder/codecs/wrappermod.sip

-/*
- * Copyright (C) 2012 by Ivan Andrianov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-%Module fftranscoder.codecs.wrapper
-
-%Import PyQt4/QtCore/QtCoremod.sip
-
-%Include decoder.sip
-%Include decoderfinder.sip
-%Include decoderplugin.sip
-%Include encoder.sip
-%Include encoderplugin.sip
-%Include frame.sip
-%Include global.sip
-%Include pluginloader.sip
-%Include streaminfo.sip
-%Include tagblock.sip
-%Include transcoder.sip

pysrc/fftranscoder/info.py

-# Copyright (C) 2011 by Ivan Andrianov
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-_name = 'FFTranscoder'
-
-_version = '2.0.0'
-
-_author = 'Ivan Andrianov'
-
-_description = 'Multimedia transcoder based on FFmpeg and other libraries'
-
-_license = 'MIT'
-
-def getName():
-    return _name
-
-def getVersion():
-    return _version
-
-def getAuthor():
-    return _author
-
-def getDescription():
-    return _description
-
-def getLicense():
-    return _license

pysrc/fftranscoder/ui/CMakeLists.txt

-# Copyright (C) 2012 by Ivan Andrianov
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-set(FFTRANSCODER_UI_SRCS_PYTHON
-  __init__.py
-  encoderdialog.py
-  mainwindow.py
-  transcodemodel.py
-)
-
-install(FILES ${FFTRANSCODER_UI_SRCS_PYTHON}
-        DESTINATION ${FFTRANSCODER_PYTHON_INSTALL_DIR}/ui)

pysrc/fftranscoder/ui/__init__.py

-# Copyright (C) 2012 by Ivan Andrianov
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-from fftranscoder.ui.transcodemodel import TranscodeModel
-from fftranscoder.ui.encoderdialog import EncoderDialog
-from fftranscoder.ui.mainwindow import MainWindow
-

pysrc/fftranscoder/ui/encoderdialog.py

-# Copyright (C) 2012 by Ivan Andrianov
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-from PyQt4 import QtCore, QtGui
-
-from fftranscoder import codecs
-
-class EncoderDialog(QtGui.QDialog):
-    MIN_QUALITY = 0
-    MAX_QUALITY = 7
-    
-    def __init__(self, parent = None):
-        QtGui.QDialog.__init__(self, parent)
-
-        self.setWindowTitle(self.tr('Choose a codec'))
-
-        self._layout = QtGui.QVBoxLayout(self)
-
-        self._codecLabel = QtGui.QLabel(self.tr('Codec') + ':')
-        self._layout.addWidget(self._codecLabel)
-
-        self._codecComboBox = QtGui.QComboBox()
-        encoderPlugins = codecs.PluginLoader.instance().encoderPlugins()
-        for encoderPlugin in encoderPlugins:
-            self._codecComboBox.addItem(encoderPlugin.encoderName() + ' ' +
-                                        encoderPlugin.codecName())
-        self._codecComboBox.currentIndexChanged.connect(
-                                        lambda x: self.checkCurrentEncoder())
-        self._layout.addWidget(self._codecComboBox)
-
-        self._qualityLabel = QtGui.QLabel(self.tr('Quality') + ':')
-        self._layout.addWidget(self._qualityLabel)
-
-        self._qualitySlider = QtGui.QSlider(QtCore.Qt.Horizontal)
-        self._qualitySlider.setRange(EncoderDialog.MIN_QUALITY,
-                                     EncoderDialog.MAX_QUALITY)
-        self._qualitySlider.setValue(EncoderDialog.MAX_QUALITY)
-        self._layout.addWidget(self._qualitySlider)
-
-        self._buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok |
-                                                 QtGui.QDialogButtonBox.Cancel)
-        self._buttonBox.accepted.connect(self.accept)
-        self._buttonBox.rejected.connect(self.reject)
-        self._layout.addWidget(self._buttonBox)
-
-        self.checkCurrentEncoder()
-
-    def checkCurrentEncoder(self):
-        self._qualitySlider.setDisabled(self.encoder.isLossless())
-
-    @property
-    def encoder(self):
-        index = self._codecComboBox.currentIndex()
-        return codecs.PluginLoader.instance().encoderPlugins()[index]
-
-    @property
-    def quality(self):
-        if self._qualitySlider.isEnabled():
-            return self._qualitySlider.value()
-        else:
-            return None

pysrc/fftranscoder/ui/mainwindow.py

-# Copyright (C) 2012 by Ivan Andrianov
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-from PyQt4 import QtCore, QtGui
-
-from fftranscoder import codecs
-from fftranscoder import info
-from fftranscoder.ui import TranscodeModel
-from fftranscoder.ui import EncoderDialog
-
-class MainWindow(QtGui.QMainWindow):
-    def __init__(self):
-        QtGui.QMainWindow.__init__(self)
-
-        self.setWindowTitle(info.getName())
-        self.resize(900, 600)
-
-        self._prepareToolBar()
-
-        self.setCentralWidget(QtGui.QWidget())
-        self._mainLayout = QtGui.QVBoxLayout(self.centralWidget())
-        self._mainLayout.setContentsMargins(0, 0, 0, 0)
-        self._mainLayout.setSpacing(0)
-
-        self._transcodeModel = TranscodeModel()
-
-        self._prepareView()
-
-        self._prepareTagBlock()
-        
-        self._prepareWidgetMapper()
-
-    def _addFiles(self):
-        if len(codecs.PluginLoader.instance().decoderPlugins()) == 0:
-            QtGui.QMessageBox.critical(self, self.tr('Error'),
-                                       self.tr('No decoder plugins found.'))
-            return
-
-        fileNames = QtGui.QFileDialog.getOpenFileNames(self, 'Add files')
-        
-        if len(fileNames) > 0:
-            self._transcodeModel.addFiles(fileNames)
-
-            self._clearAction.setEnabled(True)
-
-            if self._transcodeModel.unprocessedFileCount > 0:
-                self._transcodeAction.setEnabled(True)
-
-    def _clear(self):
-        self._transcodeModel.clear()
-
-        self._clearAction.setEnabled(False)
-        self._transcodeAction.setEnabled(False)
-
-    def _transcode(self):
-        if len(codecs.PluginLoader.instance().encoderPlugins()) == 0:
-            QtGui.QMessageBox.critical(self, self.tr('Error'),
-                                       self.tr('No encoder plugins found.'))
-            return
-
-        dialog = EncoderDialog(self)
-        ok = dialog.exec_()
-
-        if ok:
-            progressDialog = QtGui.QProgressDialog(self)
-            progressDialog.setWindowModality(QtCore.Qt.WindowModal)
-            progressDialog.setWindowTitle(self.tr('Transcoding files') + '...')
-            progressDialog.setCancelButton(None)
-            progressDialog.setMinimumDuration(1000)
-            progressDialog.setMaximum(self._transcodeModel.unprocessedFileCount)
-            progressDialog.setValue(0)
-
-            self.setEnabled(False)
-            self._transcodeModel.filesTranscoded. \
-                connect(self._onTranscodedFiles)
-
-            self._transcodeModel.filesTranscoded. \
-                connect(progressDialog.setValue)
-            self._transcodeModel.transcode(dialog.encoder, dialog.quality)
-            self._transcodeAction.setEnabled(False)
-
-    def _about(self):
-        title = self.tr('About') + ' ' + info.getName()
-        text = '<big><big><b>' + info.getName() + ' '
-        text += info.getVersion() + '</b></big></big><br><br><br>'
-        text += self.tr(info.getDescription()) + '<br><br>'
-        text += 'Copyright (C) 2011-2012 ' + self.tr('by') + ' '
-        text += info.getAuthor() + '<br><br>'
-        text += self.tr('It\'s distributed under terms of the')
-        text += ' ' + info.getLicense() + ' ' + self.tr('license.')
-        QtGui.QMessageBox.about(self, title, text)
-
-    def _onTranscodedFiles(self, transcodedFileCount):
-        if self._transcodeModel.unprocessedFileCount == 0:
-            self.setEnabled(True)
-
-    def _prepareToolBar(self):
-        self._mainToolBar = QtGui.QToolBar()
-        self._mainToolBar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
-        self._mainToolBar.setFloatable(False)
-        self._mainToolBar.setMovable(False)
-        self._mainToolBar.setContextMenuPolicy(QtCore.Qt.PreventContextMenu)
-
-        self._addFilesAction = self._mainToolBar.addAction(self.tr('Add files'))
-        self._addFilesAction.setIcon(QtGui.QIcon.fromTheme('list-add'))
-        self._addFilesAction.triggered.connect(self._addFiles)
-
-        self._clearAction = self._mainToolBar.addAction(self.tr('Clear'))
-        self._clearAction.setIcon(QtGui.QIcon.fromTheme('edit-clear-list'))
-        self._clearAction.triggered.connect(self._clear)
-        self._clearAction.setEnabled(False)
-
-        self._transcodeAction = self._mainToolBar.addAction(self.tr('Transcode'))
-        self._transcodeAction.setIcon(QtGui.QIcon.fromTheme('system-run'))
-        self._transcodeAction.triggered.connect(self._transcode)
-        self._transcodeAction.setEnabled(False)
-
-        self._aboutAction = self._mainToolBar.addAction(self.tr('About'))
-        self._aboutAction.setIcon(QtGui.QIcon.fromTheme('help-about'))
-        self._aboutAction.triggered.connect(self._about)
-
-        self.addToolBar(self._mainToolBar)
-
-    def _prepareView(self):
-        self._view = QtGui.QTreeView()
-        self._view.setModel(self._transcodeModel)
-
-        header = self._view.header()
-        header.setResizeMode(QtGui.QHeaderView.ResizeToContents)
-
-        header.hideSection(TranscodeModel.ARTIST_NAME)
-        header.hideSection(TranscodeModel.ALBUM_NAME)
-        header.hideSection(TranscodeModel.TRACK_NAME)
-        header.hideSection(TranscodeModel.YEAR)
-        header.hideSection(TranscodeModel.TRACK_NUMBER)
-
-        self._mainLayout.addWidget(self._view, 1)
-
-    def _prepareTagBlock(self):
-        self._tagBlockWidget = QtGui.QWidget()
-        self._tagBlockLayout = QtGui.QGridLayout(self._tagBlockWidget)
-        self._tagBlockLayout.setColumnStretch(1, 1)
-
-        self._artistNameLabel = QtGui.QLabel(self.tr('Artist name'))
-        self._tagBlockLayout.addWidget(self._artistNameLabel, 0, 0)
-
-        self._artistNameLineEdit = QtGui.QLineEdit()
-        self._tagBlockLayout.addWidget(self._artistNameLineEdit, 0, 1)
-
-        self._albumNameLabel = QtGui.QLabel(self.tr('Album name'))
-        self._tagBlockLayout.addWidget(self._albumNameLabel, 1, 0)
-
-        self._albumNameLineEdit = QtGui.QLineEdit()
-        self._tagBlockLayout.addWidget(self._albumNameLineEdit, 1, 1)
-
-        self._trackNameLabel = QtGui.QLabel(self.tr('Track name'))
-        self._tagBlockLayout.addWidget(self._trackNameLabel, 2, 0)
-
-        self._trackNameLineEdit = QtGui.QLineEdit()
-        self._tagBlockLayout.addWidget(self._trackNameLineEdit, 2, 1)
-
-        self._yearLabel = QtGui.QLabel(self.tr('Year'))
-        self._tagBlockLayout.addWidget(self._yearLabel, 0, 2)
-
-        self._yearSpinBox = QtGui.QSpinBox()
-        self._yearSpinBox.setMaximum(9999)
-        self._tagBlockLayout.addWidget(self._yearSpinBox, 0, 3)
-
-        self._trackNameLabel = QtGui.QLabel(self.tr('Track number'))
-        self._tagBlockLayout.addWidget(self._trackNameLabel, 1, 2)
-
-        self._trackNumberSpinBox = QtGui.QSpinBox()
-        self._tagBlockLayout.addWidget(self._trackNumberSpinBox, 1, 3)
-
-        self._submitTagBlock = QtGui.QPushButton(self.tr('Submit tags'))
-        self._tagBlockLayout.addWidget(self._submitTagBlock, 2, 2, 1, -1)
-
-        self._mainLayout.addWidget(self._tagBlockWidget)
-
-    def _prepareWidgetMapper(self):
-        self._tagBlockWidgetMapper = QtGui.QDataWidgetMapper()
-        self._tagBlockWidgetMapper.setSubmitPolicy(
-                QtGui.QDataWidgetMapper.ManualSubmit)
-
-        self._tagBlockWidgetMapper.setModel(self._transcodeModel)
-        self._tagBlockWidgetMapper.addMapping(self._artistNameLineEdit,
-                TranscodeModel.ARTIST_NAME)
-        self._tagBlockWidgetMapper.addMapping(self._albumNameLineEdit,
-                TranscodeModel.ALBUM_NAME)
-        self._tagBlockWidgetMapper.addMapping(self._trackNameLineEdit,
-                TranscodeModel.TRACK_NAME)
-        self._tagBlockWidgetMapper.addMapping(self._yearSpinBox,
-                TranscodeModel.YEAR)
-        self._tagBlockWidgetMapper.addMapping(self._trackNumberSpinBox,
-                TranscodeModel.TRACK_NUMBER)
-
-        self._submitTagBlock.clicked.connect(
-                self._tagBlockWidgetMapper.submit)
-        self._view.selectionModel().currentRowChanged.connect(
-                lambda i, x: self._tagBlockWidgetMapper.setCurrentModelIndex(i))

pysrc/fftranscoder/ui/transcodemodel.py

-# Copyright (C) 2012 by Ivan Andrianov
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-from PyQt4 import QtCore, QtGui
-
-from fftranscoder import codecs
-
-class TranscodeModel(QtCore.QAbstractItemModel):
-    (FILE_NAME, CODEC_NAME, BIT_RATE, BYTES_PER_SAMPLE, SAMPLE_RATE,
-        CHANNEL_COUNT, ARTIST_NAME, ALBUM_NAME, TRACK_NAME, YEAR, TRACK_NUMBER,
-        COLUMN_COUNT) = range(12)
-    (NO, ERROR, OK) = range(3)
-    
-    filesTranscoded = QtCore.pyqtSignal(int)
-
-    def __init__(self, parent = None):
-        QtCore.QAbstractItemModel.__init__(self, parent)
-
-        self._threadPool = QtCore.QThreadPool()
-        
-        self._initValues()
-
-    def index(self, row, column, parent = QtCore.QModelIndex()):
-        if parent == QtCore.QModelIndex():
-            return self.createIndex(row, column)
-        else:
-            return QtCore.QModelIndex()
-
-    def parent(self, index):
-        return QtCore.QModelIndex()
-
-    def rowCount(self, parent = QtCore.QModelIndex()):
-        if parent == QtCore.QModelIndex():
-            return len(self._fileNames)
-        else:
-            return 0
-
-    def columnCount(self, parent = QtCore.QModelIndex()):
-        if parent == QtCore.QModelIndex():
-            return TranscodeModel.COLUMN_COUNT
-        else:
-            return 0
-
-    def data(self, index, role = QtCore.Qt.DisplayRole):
-        if role == QtCore.Qt.DisplayRole or role == QtCore.Qt.EditRole:
-            if index.column() == TranscodeModel.FILE_NAME:
-                return self._fileNames[index.row()]
-            else:
-                streamInfo = self._streamInfos[index.row()]
-                tagBlock = self._tagBlocks[index.row()]
-
-                if streamInfo is not None:
-                    if index.column() == TranscodeModel.CODEC_NAME:
-                        return self._codecNames[index.row()]
-                    elif index.column() == TranscodeModel.BIT_RATE:
-                        bitRate = self._bitRates[index.row()]
-
-                        if bitRate > 0:
-                            return str(bitRate / 1000) + ' ' + \
-                                self.tr('kbit/s')
-                        else:
-                            return self.tr('Lossless')
-                    elif index.column() == TranscodeModel.BYTES_PER_SAMPLE:
-                        return streamInfo.bytesPerSample()
-                    elif index.column() == TranscodeModel.SAMPLE_RATE:
-                        return str(streamInfo.sampleRate() / 1000.0) + ' ' + \
-                            self.tr('kHz')
-                    elif index.column() == TranscodeModel.CHANNEL_COUNT:
-                        return streamInfo.channelCount()
-                    elif index.column() == TranscodeModel.ARTIST_NAME:
-                        return tagBlock.artistName()
-                    elif index.column() == TranscodeModel.ALBUM_NAME:
-                        return tagBlock.albumName()
-                    elif index.column() == TranscodeModel.TRACK_NAME:
-                        return tagBlock.trackName()
-                    elif index.column() == TranscodeModel.YEAR:
-                        return tagBlock.year()
-                    elif index.column() == TranscodeModel.TRACK_NUMBER:
-                        return tagBlock.trackNumber()
-                    else:
-                        return None
-                else:
-                    if index.column() == TranscodeModel.CODEC_NAME:
-                        return self.tr('Unsupported')
-                    else:
-                        return None
-        elif role == QtCore.Qt.BackgroundRole:
-            status = self._statuses[index.row()]
-            
-            if status == TranscodeModel.ERROR:
-                return QtGui.QBrush(QtCore.Qt.red)
-            elif status == TranscodeModel.OK:
-                return QtGui.QBrush(QtCore.Qt.green)
-            else:
-                return None
-        else:
-            return None
-
-    def headerData(self, section, orientation, role = QtCore.Qt.DisplayRole):
-        if orientation == QtCore.Qt.Horizontal and \
-           role == QtCore.Qt.DisplayRole:
-            if section == TranscodeModel.FILE_NAME:
-                return self.tr('File name')
-            elif section == TranscodeModel.CODEC_NAME:
-                return self.tr('Codec')
-            elif section == TranscodeModel.BIT_RATE:
-                return self.tr('Bit rate')
-            elif section == TranscodeModel.BYTES_PER_SAMPLE:
-                return self.tr('Bytes per sample')
-            elif section == TranscodeModel.SAMPLE_RATE:
-                return self.tr('Sample rate')
-            elif section == TranscodeModel.CHANNEL_COUNT:
-                return self.tr('Channels')
-            else:
-                return None
-        else:
-            return None
-
-    def flags(self, index):
-        f = QtCore.QAbstractItemModel.flags(self, index)
-
-        if index.column() == TranscodeModel.ARTIST_NAME or \
-                index.column() == TranscodeModel.ALBUM_NAME or \
-                index.column() == TranscodeModel.TRACK_NAME or \
-                index.column() == TranscodeModel.YEAR or \
-                index.column() == TranscodeModel.TRACK_NUMBER:
-            f |= QtCore.Qt.ItemIsEditable
-
-        return f
-
-    def setData(self, index, value, role = QtCore.Qt.EditRole):
-        if role == QtCore.Qt.EditRole:
-            status = self._statuses[index.row()]
-            
-            if status != TranscodeModel.NO:
-                return False
-
-            tagBlock = self._tagBlocks[index.row()]
-
-            if index.column() == TranscodeModel.ARTIST_NAME:
-                tagBlock.setArtistName(value)
-            elif index.column() == TranscodeModel.ALBUM_NAME:
-                tagBlock.setAlbumName(value)
-            elif index.column() == TranscodeModel.TRACK_NAME:
-                tagBlock.setTrackName(value)
-            elif index.column() == TranscodeModel.YEAR:
-                tagBlock.setYear(value)
-            elif index.column() == TranscodeModel.TRACK_NUMBER:
-                tagBlock.setTrackNumber(value)
-            else:
-                return False
-            
-            self.dataChanged.emit(
-                  self.index(index.row(), index.column(), QtCore.QModelIndex()),
-                  self.index(index.row(), index.column(), QtCore.QModelIndex()))
-            return True
-        else:
-            return False
-
-    @property
-    def statuses(self):
-        return self._statuses
-
-    @property
-    def unprocessedFileCount(self):
-        return len(filter(lambda s: s == TranscodeModel.NO, self._statuses))
-
-    def addFiles(self, fileNames):
-        self.beginInsertRows(QtCore.QModelIndex(), self.rowCount(),
-                             self.rowCount() + len(fileNames))
-
-        self._fileNames.extend(fileNames)
-
-        for fileName in fileNames:
-            decoder = codecs.DecoderFinder.findDecoder(fileName)
-
-            if decoder is not None:
-                self._codecNames.append(decoder.codecName())
-                self._bitRates.append(decoder.bitRate())
-                self._streamInfos.append(decoder.streamInfo())
-                self._tagBlocks.append(decoder.tagBlock())
-                self._statuses.append(TranscodeModel.NO)
-            else:
-                self._codecNames.append(None)
-                self._bitRates.append(None)
-                self._streamInfos.append(None)
-                self._tagBlocks.append(None)
-                self._statuses.append(TranscodeModel.ERROR)
-
-        self.endInsertRows()
-
-    def clear(self):
-        self.beginRemoveRows(QtCore.QModelIndex(), 0, self.rowCount() - 1)
-        self._initValues()
-        self.endRemoveRows()
-
-    def transcode(self, encoderPlugin, quality = None):
-        self._transcodedFileCount = 0
-
-        for i in range(self.rowCount()):
-            status = self._statuses[i]
-            
-            if status != TranscodeModel.NO:
-                continue
-
-            inputFileName = self._fileNames[i]
-            tagBlock = self._tagBlocks[i]
-
-            outputFileName = TranscodeModel._processFileName(inputFileName,
-                     encoderPlugin.fileNameExtension())
-
-            if quality is None:
-                quality = 0
-
-            transcoder = codecs.Transcoder(inputFileName,
-                   outputFileName, encoderPlugin, tagBlock, quality)
-            transcoder.setAutoDelete(False)
-            self._transcoders[transcoder] = i
-            transcoder.finished.connect(self._onTranscoderFinish)
-            self._threadPool.start(transcoder)
-
-    def _onTranscoderFinish(self, ok):
-        transcoder = self.sender()
-        index = self._transcoders[transcoder]
-        del self._transcoders[transcoder]
-        
-        if ok:
-            self._statuses[index] = TranscodeModel.OK
-        else:
-            self._statuses[index] = TranscodeModel.ERROR
-        self.dataChanged.emit(self.index(index, 0), self.index(index, 5))
-
-        self._transcodedFileCount += 1
-        self.filesTranscoded.emit(self._transcodedFileCount)
-
-    @staticmethod
-    def _processFileName(fileName, fileNameExtension):
-        sections = fileName.split('.')[0:-1]
-        sections.append(fileNameExtension)
-        return '.'.join(sections)
-
-    def _initValues(self):
-        self._fileNames = []
-        self._codecNames = []
-        self._bitRates = []
-        self._streamInfos = []
-        self._tagBlocks = []
-        self._statuses = []
-        self._transcoders = {}

setup.py

-#!/usr/bin/python
-
-# Copyright (C) 2011-2012 by Ivan Andrianov
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-from distutils.core import setup, Extension
-import sipdistutils
-
-from fftranscoder import info
-
-setup(name = info.getName(),
-      version = info.getVersion(),
-      author = info.getAuthor(),
-      description = info.getDescription(),
-      license = info.getLicense(),
-      scripts = ['fftranscoder'],
-      package_dir = {'': 'pysrc'},
-      packages = ['fftranscoder', 'fftranscoder.codecs', 'fftranscoder.ui'],
-      ext_modules = [Extension('fftranscoder.codecs.wrapper',
-                              ['pysrc/fftranscoder/codecs/wrappermod.sip'],
-                              libraries = ['fftranscoder_codecs', 'QtCore4'])],
-      cmdclass = {'build_ext': sipdistutils.build_ext})

src/codecs/plugins/ffmpegdecoder/ffmpegdecoder.cpp

     Private();
     ~Private();
 
+    bool preparePacket();
+    bool prepareFrame();
     void initValues();
 
     bool openFile();
 
     AVPacket packet;
     int currentPacketSize;
-    AVFrame frame;
+    AVFrame * frame;
 
     bool readMetaData;
     bool readMetaDataSuccessful;
         av_register_all();
         avformat_network_init();
     }
-
     d->fileName = fileName;
     d->initValues();
 }
 {
     if(d->formatContext)
     {
-        if(d->frame.data[0])
+        if(d->frame)
         {